Feature #2439
openCache pathfinding results between calls
0%
Description
Currently, pathfinding is not reused between calls. This is particularly inefficient in late-game big maps, e.g. Europe around T250,
where assess_danger()'s pathfinding can take 1m/turn.
This patch adds a generation counter, allowing pathfinding caching, which will be used in the next tickets; on my saves, the combination reduces time taken by about 90%.
Files
Updated by Sweet Tea Dorminy 21 days ago
- File 0001-common-Add-world-and-per-player-knowledge-generation.patch 0001-common-Add-world-and-per-player-knowledge-generation.patch added
A proposed patch.
Updated by Marko Lindqvist 18 days ago
- Blocks Feature #2440: path finding: share reverse map searches across calls added
Updated by Marko Lindqvist 8 days ago
- The main problem I see with this is that the world generation number refers to changes in main map, while path finding might be using some other map; 'map' parameter of pf_parameter (in practice the issue comes up with tex AI)
- There's already tile_map_check() to check if tile is on a given map
Updated by Sweet Tea Dorminy 2 days ago
That's a good point. I'm not dropping this, but I'm going to take a moment to redesign it.