-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basecamp job rework - wandering/sitting/job priorities. #38248
Conversation
So will job priorities be NPC specific? i.e. can I make Helen prioritise vehicle maintenance while Larry does some cooking then goes off to hunt? |
Yes. Each NPC will have their list of jobs with each having its own priority, like Rimworld. |
aa39539
to
9761f13
Compare
924f105
to
39e00e3
Compare
ad63e77
to
8e68539
Compare
621a68e
to
b7106d0
Compare
0f30a43
to
d432807
Compare
debug output fix up job structure and tidy activity shortern is_npc check clang tidy debugmsg potentially used null ptr remove string constant unneeded
…o camps to be more robust, add worker assignment menu and job priorities
Rebased, cleaned up, little bug fixed, tested, working. |
This is causing debug message to show when loading saves from 0.D experimental
Seems that "job" was changed from an int to an object but the deserialization code wasn't made back-compatible. |
Summary
SUMMARY: Features "Basecamp job rework - wandering/sitting/job priorities."
Purpose of change
This is a combination of #37330 and #37325 , and a new feature of adding differing priorities to basecamp jobs.
Normally I wouldnt like to mush PRs together, but they were all chaining building on from one another, all caught up in freeze, rebasing wa sa nightmare, and as I worked on the 3rd one in the chain, I was discovering I had to rework the entire thing anyway which made the previous 2 PRs obsolete. So here it is.
Ive changed how jobs work - now it is its own class, not with an enum list of jobs, but an entry for each type of activity, which can then be given a priority each. This makes things more robust going forward with adding new tasks etc.
Ive changed how being assigned to a camp works, before it was an NPC mission, which conflicted with other stuff like the missoin for GUARD_ALLY and so on, it was best if being assigned to camp was a seperate thing that was more explicit, so NPCs didnt get confused about what to do.
Due to adding job priorities ive had to change how the activity code works a bit, so now they can just scan if an activity is possible, before they do it, if it isnt possible, they scan the next activity in their list.
Ive added them wandering and finding chairs to sit on when they dont have any tasks to do.
Also allowed activities to use the basecamp storage zone for the job components/fetching.
I dont think there will be any problems migrating from the previous job system in older saves, it should validate and the worst that would happen is that they dont do any jobs until you assign new priorities at the camp board, but im willing to accept ideas for how to migrate this fast moving mess a bit smoother.
This is something im laying some foundations for more flexible camps , where camp upgrades lay down construction zones, for this to work, it needs to be a bit smarter in how camp workers are assigned and do their jobs.
Describe the solution
As above
Describe alternatives you've considered
N/A
Testing
Made lots of new camps, assigned workers, killed them, checked if they were removed, told them to leave, made them mutiny, assigned jobs, assigned different priorities, layed down various types of tasks ( vehicle deconstruction and construction zones for example ) , chjecked to see they were performed in order, checked to see if they wandered around when thewy werent working.
Checked to see if th enew camp mission for "assign workers" worked by only showing followers, made sure that everything was serialized and deserialized correctly.
Additional context
N/A