Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Change: Add path cache for ships #7072
This is an attempt to improve performance of YAPF by caching the path found for a number of steps, removing the need to call the pathfinder every time the ship enters a new tile.
Significant performance improvements have been observed, in one save reducing the average ship ticks from ~ 60ms down to 17ms, allowing the game to run in realtime: http://fuzzle.org/~petern/ottd/shipcache2.png
As the path cache is required to be synchronized, changes to the save/load system have been implemented to include std::deque functionality.
I tried to break this, by e.g.
Everything I tried was handled as expected.
If you are interested in extending this to NPF, these two commits may come useful for a starting point. Note that these commits should be adapted:
If not interested in taking on this, let me know and I will try to do it.