Page 1 of 1

Replay Formatting for Replay Analysis Tool

Posted: Sat Jul 22, 2017 8:21 pm
by freact
Hi first post on this forum so I apologize if this is in the wrong spot or something but I did do some searches and couldn't find this information elsewhere.

What I am trying to do is make a small utility tool that will analyze a replay file and give some information about the playthrough. The first most basic feature I'm hoping to implement is a simple calculation of how long a player spent 'idle'. It's my understanding that this file is basically a list of player actions and the tick that they occur at. Unfortunately I haven't been able to decode any of the information in the replay.dat file. If anyone has had any success in decoding replay files, has some tips for how I might proceed, or other resources they could point me at; I would be very grateful for any help!

Re: Replay Formatting for Replay Analysis Tool

Posted: Sun Jul 23, 2017 6:34 pm
by Jap2.0
I have no experience in this, however a good way to start would be to do something along these lines:

1. Start a game, do nothing, close it, look at replay, see if there is anything, try to decode it.
2. Only craft one pickaxe, decode.
3. Only craft one transport belt, decode.
4. Move one direction, decode.
5. Move same direction for different length of time, decode.

You can probably get what I'm getting at now, and you can proceed like this and (maybe) figure out the codes for crafting all items, placing items, completing researches, moving, etc.

Re: Replay Formatting for Replay Analysis Tool

Posted: Mon Jul 24, 2017 11:21 pm
by Jap2.0
Now that I think about it, I might try to make a replay interpreter sometime (generating a text file showing what was done, not really doing the replay). It probably won't happen for a while, though, as I should probably wait for the 0.15 stable so it doesn't change for a while (I'm quite busy right now too). It sounds like a fun challenge. If I ever do, I'll try to add some analysis to it. If you figure anything out regarding replays, be sure to let me know.

Thanks!

Re: Replay Formatting for Replay Analysis Tool

Posted: Fri Aug 04, 2017 2:23 pm
by daniel34
Here is some info: viewtopic.php?f=34&t=44225#p255694
Rseding91 wrote:All inputs contain the following data:
  • uint8_t action ID
  • uint32_t tick of action
  • uint16_t player index
  • payload *variant - tons of different combinations*
As far as I understand it the action ID list (possible kinds of action IDs) is the same as used by the input action permissions system (/permissions in console).

Re: Replay Formatting for Replay Analysis Tool

Posted: Fri Aug 04, 2017 4:19 pm
by Jap2.0
Thanks a lot!

I'll start work on this when I'm sure we're at the final version of 0.15 and I have a bit of extra time.