Re: terminate_monitor to improve turn times?
It's a numbers game - you will see a difference with high numbers of initial monitors. Take the vanilla script - turn time simply breezes by with only 35 monitors.
Now take EBII - 916 monitors and roughly 30 seconds.
In EBII this number is reduced over time with terminating of monitors, a decrease in turn times however is barely noticeable as it is a) gradually and b) off set by an increase on characters on the map (themselves increasing the number of times character based monitors fire).
The worst offenders are condition monitors - they 'fire' multiple times per second all the time as long as they are 'live'.
A simple test would be to take a script like EBII's and then terminate all monitors after a number of turns - that should establish the difference. My bet: from the 30 seconds to zero. Adding this simple code snippet under each monitor_event\condition line will do the job after the first turn, zero being the game start turn and 1 the first end turn:
Code:
if I_TurnNumber > 1
terminate_monitor
end_if
Summary: while terminating monitors does have a positive effect on turn time length it may be off set by other factors. Best example is a comparison between a 'CharacterTurnEnd' and a SettlementTurnEnd' monitor. While settlements are finite (199 max) the number of characters after some time will by far outstrip that number. 'FactionTurn' monitors have the least impact with 31 max. Which means while terminating a 'FactionTurn' monitor will have close to zero impact on turn times doing that with a 'CharacterTurnEnd' monitor can be noticeable, especially in later stages of the game. In the end it's a cumulative and proportional affair, closing 30 monitors in EBII will have no effect most likely whereas in the base game it will make turn times nearly non existent. Closing 'condition' monitors has by far the greatest impact on turn times due to the continious triggering of it several times per second (20 times I think?)
I am not familiar with AI scripting but I would imagine that a similar principle applies to it. In the end it's a matter of how a script is structured, again an example: there is a finance balancing script that actually works but is not practical as it causes a turn time delay of nearly a minute due to it's use and nature (the 'condition' I mentioned) of monitors.
Last edited by Gigantus; October 05, 2020 at 11:00 PM.