Replay System
During my capstone project at FIEA, I built a replay system tool to collect, analyze and debug player data from playtest sessions.
This tool was capable of logging all keyed inputs to a .csv file during a data collection session and read this data from the specified file and virtually recreate a play session almost exactly how it was played. This includes running the same code that was run so we were able to debug any unusual behavior that may have occurred. This also allowed our designers to visualize how players interacted with the levels to help improve the level layouts.
How it works:-​
-
The first part of the system required a way to collect data from sessions. In order to do so I made a function that could be called from blueprints for every input that needs to be logged. Then I saved this information as a pair of a timestamp and input state(this was a pair of the input name and an optional axis value) to the csv.
-
The next part was the replay mode. This required the user the specify which csv to read from and replay, and then I engineered a parser to parse my custom grammar to get all the information out of it.
-
Once the timestamp and input state information were parsed, I used Unreal's FTimerHandles to call the appropriate function for a given input (and it's optional axis value), after a delay of the timestamp part of the current pair. I also used Unreal's FTimerDelegates to pass in the axis value parameters and bound them to the timers with the appropriate delay.
-
To find out which function to be called for a given input state, I made a function lookup table which is essentially a hashmap of strings to function pointers with signature void(float).
A few of caveats to consider:
-
This "tool" has no front-end, I leveraged Unreal Engine's blueprint scripting system to communicate with the back-end of the replay system.
-
This tool was used during an early build of the game when we were just prototyping mechanics and level layouts, and hence does not consider any randomly generated numbers.
-
The tool only worked accurately when the FPS of the system on which the session was played, and the FPS of the system on which the session was replayed, were similar. This was not a major issue as most of the people who sent us play test data were from our cohort at FIEA and we all had the exact same PC hardware.
​
This replay tool was really fun to make and really helped us get insightful information from player data. Especially for us programmers, stepping through the actual code that was running when a bug was encountered was really helpful towards debugging.​
Due to the short timeline of capstone, and a small programming team, we decided to halt development of the replay system to focus on core gameplay features. At some point in the future, I would love to revisit and extend this tool to address it's drawbacks and account for any seeded random numbers.