donadigo / gbxtools

Various scripts that I use for TrackMania replay analysis
GNU General Public License v3.0
58 stars 11 forks source link

small questions about you script #1

Closed dabde closed 3 years ago

dabde commented 3 years ago

Hi,

was try to take a look into your script and try to understand it. Could not find some good information online, so maybe you can give a little bit more inside.

  1. https://github.com/donadigo/gbxtools/blob/master/generate_input_file.py#L13 Why the precision is removed and the times only 0.01s and not 0.001s ? Why removing 10ms for the return?

  2. https://github.com/donadigo/gbxtools/blob/master/generate_input_file.py#L52 You extracting this to 4 entries (time, controlname, value (16 bit) and flags (16bit) https://github.com/donadigo/pygbx/blob/6b01b3b3103f95a4479a46f13945baeac72fc7c7/pygbx/gbx.py#L742). But can't find what flags means. Only a reference to another ControlEvent here https://wiki.xaseco.org/wiki/GBX#CGameCtnGhost_.2803_092_000.29 - 03092019, where I see only 3 entries (time, controlname and "value" 32bit). But could not find any information to 03092025

thanks

Zatura24 commented 3 years ago

Regarding the rounding I have found this:

"TrackMania checks for input every 10 milliseconds. Suppose we can only do keyboard inputs."

From his post about TAS

donadigo commented 3 years ago

Sure thing:

  1. The tickrate of the game is 100/s. All timestamps of inputs saved are divisible by 10. So 10, 20, 4030, 9320 and so on. There are however some cases where events like Respawn contain a non-zero digit at the end, this is why the remove happens.

  2. "flags" is an old term used in pygbx. The event data is a 24 bit number, that has to be shifted arithmetically by 8 bits when it comes to steer value. This wasn't known/I didn't know about this when writing pygbx. This is why the initial or and shifting by 16 happens.

dabde commented 3 years ago

thanks for the fast response. thx for the infromations.