dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

Timestream doesn't affect caravans properly

Open drhead opened this issue 3 years ago • 1 comments

When using timestream --units on a low FPS fortress, it seems that caravans stick around for far too long. As in, unloading/reloading their goods takes long enough for the next caravan to arrive. This is not a crippling issue as the game handles the situation of multiple caravans at one depot gracefully.

drhead avatar Jan 30 '23 04:01 drhead

I wrote the caravan script, and from looking at it again, I'm pretty sure the time_remaining field is what determines when caravans leave. That appears to be in units of days * 120 - so 1 unit per 10 ticks? That may not be possible for timestream to adjust exactly by the same factor as everything else, but it could probably get pretty close.

lethosor avatar Jan 30 '23 05:01 lethosor

not sure if it helps, but to give an example: my fort was running with round about 10-15 fps and the caravan left after round about 11 month.

Jamilian avatar Feb 11 '23 02:02 Jamilian

From Quietust on Discord:

Found it: FUN_140acf470 = caravan_state::doTimeout(), called once per tick. It will be important to, while "fast-forwarding" that counter, always make sure that it hits certain values such as 500 (to generate the "Merchants will be leaving soon" message).

From ab9rf:

called from FUN_140ab7000, which is called from a logic method, presumably viewscreen_dwarfmodest based on how long it's taking to decompile

lethosor avatar Aug 25 '23 02:08 lethosor

i'd also check to make sure that the cooldowns for the manager and bookkeeper are being adjusted properly as the call to the function that does that is immediately before the one that handles caravan timeouts

ab9rf avatar Aug 25 '23 03:08 ab9rf