Jump to content

How timers are stocked in .gam files


Recommended Posts

After some research about this, I finally found how the IE stocks timers...


The example here is taken from BG1 : when xzar and Montaron join the party, two global timers are set : "montaron" is set to 9 days, and "xzar" is set to 7 days.


In my saved game, the "xzar" variable is set to 572008, whereas "montaron" is set to 788008.


The difference between them, once divided per 14400 (number of rounds in two days) gives 15.


Is 15 the number of AI updates that gives a round? At least, there is the parity 1 round <-> 15 units there.


EDIT: after reading some previous post, It seems that 15 is the game unit for 1 second, or half the default number of AI updates per seconds...


avenger, it seems that gemrb should switch to 30 ai updates per seconds, don't you think ?



It seems that the way time is saved in IE files is very inconsistent... in EFF files, duration seems to be in rounds.


PS : this is probably already known, but I found little to no written documentation on this issue.

Link to comment

The GAM stores time in ticks, and as you say, 15 ticks = 1 sec. Timers work by storing a tick count in the variable so that when global GAM time equals that variable, the timer is said to have expired. For example, if the global timer is 485000 and you StartGlobalTimer("f00", ONE_DAY), then f00 is set to 485000 + <whatever ONE_DAY is equal to in ticks, check GTIMES.IDS>.


I don't know enough about AI updates to comment on that part.

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...