Try to find the most efficient way (space) to record each move in a game (regardless of engine or language) without going through any type of replay plug-in.
Rather than simply recording a recovery, it would be more of a time travel affair.
You wonder how you would structure the data, when there is the following information to keep in mind:
- Player movement and camera angles
- Player Actions and Interactions
- NPC default pathways (rather deterministic IA paths) and player interaction / interference deviations
- Other information about world-related entities that can be changed by the player
I think I should probably divide this into at least 3 sets:
– The initial paths of NPCs and global entities
– Deviations from NPCs, related to the data of the initial path
– Paths and actions of players, related to deviation data
This would probably be complicated quite quickly, but most importantly, a lot of data.
Say I want to record an hour and keep the data as small as possible, what should I count and what is the best way to structure my data?
I found a similar question with some useful tips, but I do not answer in a very detailed way about the tables or types of data that I should use:
Effective algorithm for recording the positions of game objects
Q1: Should I store everything with a large number of columns, and each step should be a new "time stamp" (assuming 1 second per tick of recording, though for some things I might wish a more fluid recording like a camera movement)
Q2: When NPCs move by AI, this should be predictable, but how to synchronize the behavior of the AI with a predetermined path? (which should save space)
Q3: How to save space, while having a smooth movement during replay (you would see yourself playing when you go back in time). I would probably use motion vectors and replay with a smooth path? Mostly worried about whether the player moves around the camera a lot and very quickly that the rehearsal will be strange. Maybe a dynamic tick time system? What recording ticks depend on the amount of changes right now?
Q4: Example, would I record a complete line when the player will only do a specific "action", as in the table below, or should I have separate tables for each "action" (click, camera_move, player_pos )
check | player_pos | click | camera_mov |
1 | 0,0,0 | null | 0,0,0,0 |
4 | nochange | open | 0,1,1,0 |
8 | 1,0,0 | null | nochange |
(Thinking about it, this table should probably be the one I work with when I "replay" the game, after several tables are stored, but do not store it like that with many empty / useless fields)