Inconsistency in UnvGetElapsedGameTime

Freeform discussion about anything related to modding Transcendence.
Post Reply
AdmiralZo
Militia Lieutenant
Militia Lieutenant
Posts: 228
Joined: Wed Feb 11, 2015 10:32 am
Location: Scouring Dantalion System for CSC Antarctica...

Why does unvGetElapsedGameTime produce inconsistent outputs across games? In one game, (unvGetElapsedGameTime 0 7000 'display) will output 9 hours 41 minutes, in another game it will output 2 days 3 hours, and different again the next game.

My understanding is that it should output 3 hours 53 mins because there are 2 seconds game time to each tick.

The function seems to be accurate for small inputs, but goes wacko when the input exceeds about 500 - 600 ticks.

Any idea why this happens?
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

When the player gates, a random amount of time is added to the elapsed game time, and it keeps track of what ticks these "discontinuities" happened at.

If you need a function to convert ticks to human-readable game time, that could be added to fmtNumber pretty easily.
AdmiralZo
Militia Lieutenant
Militia Lieutenant
Posts: 228
Joined: Wed Feb 11, 2015 10:32 am
Location: Scouring Dantalion System for CSC Antarctica...

Thanks NMS. I'll try using fmtNumber. I also found that (unvGetElapsedGameTime (unvGetTick) (add 7000 (unvGetTick)) 'display) also works.
NMS
Militia Captain
Militia Captain
Posts: 569
Joined: Tue Mar 05, 2013 8:26 am

Clever. There are no discontinuities in the future, so that will be accurate. I don't think fmtNumber currently handles time, but I was saying it could be added since a lot of the necessary code already exists for unvGetElapsedGameTime.
Post Reply