Project

General

Profile

Actions

Feature #2439

open

Cache pathfinding results between calls

Added by Sweet Tea Dorminy 21 days ago. Updated 2 days ago.

Status:
New
Priority:
Normal
Category:
Server
Target version:
Start date:
11/02/2026
Due date:
% Done:

0%

Estimated time:

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


Related issues 1 (1 open — 0 closed)

Blocks Feature #2440: path finding: share reverse map searches across callsNewSweet Tea Dorminy11/02/2026

Actions
Actions #2

Updated by Marko Lindqvist 18 days ago

  • Target version set to 3.4.0
Actions #3

Updated by Marko Lindqvist 18 days ago

  • Blocks Feature #2440: path finding: share reverse map searches across calls added
Actions #4

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

Actions #5

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.

Actions

Also available in: Atom PDF