-
Notifications
You must be signed in to change notification settings - Fork 0
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
Freeserf bug? - mine not receiving food despite being the highest food priority #55
Comments
after doing some testing with save games, it looks like the difference between the "before" iron mine and the rebuilt one is that the rebuilt one has stock[0].requested = 7 while the broken one has stock[0].requested = 8. If I modify the save game and change the 8 to a 7, it fixes the problem - food starts being delivered to the iron mine. Need to figure out how this .requested variable is used |
maybe it stops trying once it hits max requested?
|
ah, I see prio is also set to 1 in the rebuilt/fixed save. I think the issue is: if the building requesting resources reaches requested = 8 (it looks like it increases by one every so often?) then it sets priority back to zero. However, if no resources were actually dispatched (because they were available then? Or inventory queue was full??) the building will set the priority back to zero and will never get the resources when they are next available! |
see further comments here: freeserf#490 If I assume the game is working perfectly, then the issue is that letting roads/flags become clogged with resources is MUCH WORSE than it seems, because not only will those resources not be stored, they are occupying slots in buildings that requested them. And once requested count reaches max count, those buildings will never request resources again even if a much closer source becomes available! So it is possible to modify the AI logic to take drastic action if roads become clogged, but it seems more realistic to allow them to become clogged and have some fallback plan to re-request resources that haven't arrived in a reasonable amount of time, and let resources become lost on roads. |
I think the best answer to this, assuming the game tracks all resources perfectly, is to have a building re-request resources that have not arrived in a reasonable amount of time, AND to cancel the original request so that the en-route resource (that is probably stuck in a congested flag somewhere) can be re-routed to either a nearby inventory or a new direct destination. OR, have serfs prioritize transport of materials destined for a non-stock (warehouse/castle) building over any resource destined for storage. Check to see if there is already some game feature do to do this that maybe I am not understanding. |
heh, i dont use your AI build to test this, so im looking on TWO MAJOR PROBLEMS: |
hey, fix is simple, what about adding stock[0].prio fix in my code? in food type fix, file building.cc in Building::requested_resource_delivered, recalculate stock priority, and i need to find where is resource consumed and fix it there too. |
testing now:
..... |
fixing this functions too: bool bool
} |
looks like this fixes miners food deprivation bug :) i cant still confirm this definitely, because there is another bug crashing game with big settlement after x-12hours ... |
Thanks for contributing this, I am opening an issue in Forkserf as I have moved this project there. I will take a look into this soon |
I have a savegame demonstrating this. Player1 has two iron mines. Iron mines have the highest food priority. The next-highest food priority gets all the food. Even after rebuilding various roads, changing food priorities, etc. nothing causes iron mines to receive food. HOWEVER, destroying one of the iron mines then rebuilding it in the same place triggers food to be delivered to that rebuilt iron mine.
I suspect there is an issue where the "request resource" setting is being lost and is never revisited
The text was updated successfully, but these errors were encountered: