IDB update, routing in TTD, aiboost
Posted: 11 May 2004 10:30
Hello all,
Last weekend I took it upon myself to finish annotating TTD's route
tracing code (which TTD uses to route vehicles, to search for the
nearest railway or road depot, and to update the state of signals) and,
after a long break, release an updated IDA database, available at
<http://kufel.immt.pwr.wroc.pl/~mgrzegor/ttdpatch/ida/> as usual, for
those who aren't daunted by 80386 assembly.
Thus, we now have the definite answer to the old question: how far TTD
'looks ahead' when trying to find a route to the destination? The
answer is: for trains and road vehicles, the limit is 64 tiles or 7
junctions (whichever is reached first); for ships, the limit is 50 tiles
or 4 turns. (This does not answer the question of how TTD selects the
'best' route; that'll need more investigation, which I hope I'll have
time to do in a couple of next weeks.)
Now I also know for 100% sure what I've long suspected: the 'aiboost'
switch never worked as expected because it patched the wrong code (the
code that traces existing routes, not the AI route planning code).
That's also why it was a major CPU hog even if no AI company was
present... The 'aiboost' switch in its old form could result in a minor
routing improvement, though, so it was not entirely useless. (In the
few latest alphas the switch does nothing.)
That's it for now, have to get back to my PhD thesis...
--
Marcin Grzegorczyk
Last weekend I took it upon myself to finish annotating TTD's route
tracing code (which TTD uses to route vehicles, to search for the
nearest railway or road depot, and to update the state of signals) and,
after a long break, release an updated IDA database, available at
<http://kufel.immt.pwr.wroc.pl/~mgrzegor/ttdpatch/ida/> as usual, for
those who aren't daunted by 80386 assembly.
Thus, we now have the definite answer to the old question: how far TTD
'looks ahead' when trying to find a route to the destination? The
answer is: for trains and road vehicles, the limit is 64 tiles or 7
junctions (whichever is reached first); for ships, the limit is 50 tiles
or 4 turns. (This does not answer the question of how TTD selects the
'best' route; that'll need more investigation, which I hope I'll have
time to do in a couple of next weeks.)
Now I also know for 100% sure what I've long suspected: the 'aiboost'
switch never worked as expected because it patched the wrong code (the
code that traces existing routes, not the AI route planning code).
That's also why it was a major CPU hog even if no AI company was
present... The 'aiboost' switch in its old form could result in a minor
routing improvement, though, so it was not entirely useless. (In the
few latest alphas the switch does nothing.)
That's it for now, have to get back to my PhD thesis...
--
Marcin Grzegorczyk