-
Notifications
You must be signed in to change notification settings - Fork 278
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
Unreachable Job Fix #1580
Unreachable Job Fix #1580
Conversation
Characters will correctly abandon jobs they can't reach.
…upine into Pathfinding_Optimization
…upine into Pathfinding_Optimization
Commented more. Changed the Character.JobState to null instead of idle when unable to find a job. reduces time between job calculations for unreachable jobs.
I was a dummy. Was removing a job from the JobQueue when using the Enqueue method. should be all fixed. Just need to do stylecop. @dusho @koosemose Is there anything else I should address with jobs in this PR? For instance handling the saving and loading of jobs? |
Just focus on the main point of the PR. We can do saving/loading of jobs in another PR |
Ready for testing. |
First issue I notice, is that they still go to pick up the inventory before abandoning the job, and are now stuck with that inventory. Aside from the being stuck with inventory issue (which is separate from this), could you look into having them figure out they can't get to the job before getting inventory for it? |
sure can. although that would require two calculations for movement. One from character to job site. the other from character to pickup location. |
Not optimal, of course. But it works for now. |
Remove |
You've got failures, it looks like you had conflicts in Prefab.meta, and still have the HEAD>>> and such lines in it, guessing from the errors reported. |
Fixed Merge Conflict Added handling for characters that can't reach inventory.
Now your builds failing with the following error:
|
fixed LUA for previous name refactoring
…ch any inventory that is required.
Almost done with this PR, some things to note.
The last thing to do is fix a bug described in the OP. |
All done, terrible lag for unreachables though due to using dykjstra over the whole map, switching to A* pathfinding to nearest inventory, bi-directional searching, and metastockpiles will help with that though. |
You have merge conflicts. hopefully the mdb file wont give you trouble. I don't know why git doesn't just overwrite the meta files like it usually does. |
I got these exact conflicts like 10s ago, I fixed it by merging in upstream like you normally would then just press clear errors in the Unity Console, and then just commit the changes, you shouldn't need to make any changes, the clear error is just to make sure it doesn't have any access errors and it should overwrite the metas/mdb files (thus fixing the conflict), then just push 😃 |
…upine into Pathfinding_Optimization # Conflicts: # Assets/Plugins/Net20/Newtonsoft.Json.dll.mdb # Assets/Plugins/Net20/Newtonsoft.Json.dll.mdb.meta # Assets/Plugins/x86_64/fmod.dll.meta
fixed conflicts, ty @BraedonWooding |
Fixes #1536, #1545, #1602
Fixes when characters cant reach jobs and go into infinite loops.
To recreate: add build wall job somewhere (reachable). then add a stack of steel (unreachable). queue job to deconstruct wall (to make steel reachable). Wall should be deconstructed but the current characters will not do the build job (new characters that spawn in will pick it up though).