Does the ANode-array in route.h takes 19MB (max_route_steps = 1,000,000), or I am failed with simple arithmetic? Then much memory would be needed, if every AI gets its own routefinder. But it's a very elegant idea. Maybe we should think of one array for the player and one for all AIs?
Imho, 19 MB should not be too much for modern computers? I imagine the following mechanism
=3= allocate route-finding memory for each player
=2= if that fails, allocate the route-finding memory for two players (human + ai)
=1= if that fails allocate route-finding memory once (for all)
=0= if that fails, simutrans will not be playable (which is the current implementation imho)
Then:
== if each player has its own memory, the step()-able route finding can be used be the ai's
== if each ai has its own route memory, a resource management has to be implemented to enable step-able route finding.
== if only one route-finding memory is allocated, ai cant use step()-able route finding and are restricted to use the conventional code