Inconsistency in UnvGetElapsedGameTime

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

Thu May 02, 2019 12:45 pm

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: 536
Joined: Tue Mar 05, 2013 8:26 am

Sat May 04, 2019 8:58 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: 208
Joined: Wed Feb 11, 2015 10:32 am
Location: Scouring Dantalion System for CSC Antarctica...

Tue May 07, 2019 4:51 am

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: 536
Joined: Tue Mar 05, 2013 8:26 am

Tue May 07, 2019 12:18 pm

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