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
Linkgraph takes a very long time to recalculate on large save, causing hangs #7842
Comments
We require some more details. Which versions have you tried? What are the symptoms of the crash? Can you upload all the associated crash.* files ? |
When running the save myself, the game actually deadlocks (hangs) at 20 May, a few ingame days after loading. This appears to be occurring inside the Linkgraph code. If the game is actually crashing for you, that's a separate issue that we need those crash files to be able to diagnose. These will be in your "personal directory" - most likely |
J find that in C:\Users<username>\Documents\OpenTTD named as crash |
OK, that's unrelated to this issue - that file is from 1.9.1. When you say the game crashes, what do you mean? Is the game hanging, or exiting to desktop? |
Its hanging for 3-7 minutes mostly |
Your save game is set to take 16 days to recalculate each the cargo distribution graph. |
Is it possible to optimize the link graph calculation so that it takes less than O(N² log(N)) time (N proportional to station count)? If so, what's the lowest amount of time you can optimize towards? |
Thanks |
The existing algorithm can be optimised a bit to reduce the constants, but it doesn't make a huge difference. You still get O(N² log(N)) behaviour. It's more pragmatic to change the scheduler to be aware of the how long the recalculation is likely to take. |
For large networks and/or when fast-forwarding, I suggest the following for performance reasons:
|
Recently we added a change where the game pauses if linkgraph is taking too long. This at least makes it visible to the user what is going on, instead of just freezing up. Hopefully that helps a bit with mitigating this issue. It should make the game more playable, but of course it is still annoying, as instead of hanging, it pauses the game. One is slightly better, but still not good. This as a FYI. |
Automatic linkgraph scheduling is still a valid feature request, but I think we've solved the cause of this bug report, and mitigated it by pausing instead of freezing. I'm going to close it to keep the issue tracker down. 🙂 |
Can you do something with OpenTTD so j could again play on my save?
Save that crach in every version of OpenTTD.zip
Version of OpenTTD
Expected result
Actual result
Steps to reproduce
The text was updated successfully, but these errors were encountered: