-
-
Notifications
You must be signed in to change notification settings - Fork 975
Road vehicles don't balance between multiple loading bays #7592
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
Comments
I'm guessing caching also breaks road vehicle balancing https://wiki.openttdcoop.org/Road_Vehicle_Networking#Balacing |
Would Edit: Looks like that function is mostly for updating
|
After some digging and wrestling with my own IDE, the cache is updated in I think that there is another kind of pathfinding that OpenTTD has, although I am not sure. I'll look into it, though. Edit: NPF is the other type, but does not cache, therefor, this issue (probably) does not exist with it. |
I just need to work on the turn counting that was the other part of the suggested fix. Hopefully what I have now works for "less that 10 tiles", although I am not sure if they are always before the next scheduled stop. I'll do some testing by just sending a bunch of before and after things and see how things stack up. |
I'm not sure what I was thinking with the suggested fix, it makes no sense to not cache the last 10 tiles if that's a straight road/no intersections, as that still doesn't give the vehicle any alternates. |
How about a different approach: still cache all the segments, but have the pathfinder add penalties for cached loading bay selections, so on average it still balances out? |
Any good resource for understanding YAPF? The wiki is very sparse. |
Rules for understanding YAPF:
|
YAPF is not so complicated that you should not try to understand it. The source can be understood with a little time, and is by nature authoritative. For what it's worth this is one I prepared earlier which gave satisfactory results at my end: JGRennison/OpenTTD-patches@79d5be7 A more heavyweight solution to issues around road vehicle cache invalidation in general is here: JGRennison/OpenTTD-patches@829c635, parts of this may come in handy. |
OK. I'll reset what I worked on and try to make some progress towards one of those suggestions (whatever may be easier for me at that time). Also, I have never worked with this kind template work before. Double whammy. |
I like to think I have made progress in the the understanding of the system, or at least a semblance of I don't see myself writing anything better than that, although I would be more than willing to help test it, if needed. |
…stination with multiple entrances Ported from jgrpp commit 79d5be7
…stination with multiple entrances Ported from jgrpp commit 79d5be7
…stination with multiple entrances Ported from jgrpp commit 79d5be7
Based on post on TT-Forums
Version of OpenTTD
Likely after merge of road vehicle path caching
Expected result
Road vehicles choose a free loading bay to head towards when multiple are available at a station.
Actual result
Road vehicles head towards the same loading bay even after it has been filled.
Steps to reproduce
Send many road vehicles to the same few stations with mutiple loading bays.
Suggested fix
Prevent road vehicles from caching the last 1 or 2 turns (or 10 tiles if that's shorter) before their scheduled next stop.
The text was updated successfully, but these errors were encountered: