Jump to content
Sign in to follow this  
zefklop

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 ?

 

EDIT 2:

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.

Edited by zefklop

Share this post


Link to post

Feel free to alter the timing. This part of the engine is not clear to me. It could be that there is even difference between engine versions.

The 15 ticks for one round sound right.

Share this post


Link to post

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.

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...