Recording Virtual Opponent
Implementation
Design Challenge
This devlog contributes to the design challenge: "Build upon an existing game made for diabetes patients, so they can record a play-through to be played back as virtual opponents by other patients with the same condition."
Context
Previously I did some research on what's already been done by previous developers in another devlog. In this devlog, I'm going to implement the recording of a virtual opponent using this research.
How to implement a system where a play-through is able to be recorded and saved keeping in mind it has to be replayed later on by another system?
Methods
Workshop - Brainstorm
Based on knowledge gained while researching the topic, I brainstormed with the intern who is responsible for the replay part of the virtual opponent. We discussed what values would be needed to create a replay of the virtual opponent. We agreed on a turn-based system where every action is saved in a turn. These turns can later be played back through a virtual opponent. We also discussed a way of storing the data. Later on, the company has plans to save these files on their servers so all players have access to recordings, even sharing them with friends. Because of this, we decided to (temporarily) save the files in a .json format.
Workshop - Prototyping
I started by optimising and finishing the work an earlier intern did on the recording part. This wasn't complete and contained a lot of bugs. I recorded everything that was needed to replay the game and saved the file into .json. I also created a class for the other intern to be able to load those replay files back into classes with data. I also added a toggle to enable or disable your game being recorded. This may later default to always record in the background based on the company needs.

Result & Validation
The product is a background system recording every turn of the player and saving those in a file to later be retrieved.


Next step
With this recording functionality in place, the other intern can work on his part of the virtual opponent. He now has a base to start from and data to test with.
Sources
Replay Virtual Opponent. (2022). Daan van Eijl Graduation Internship Portfolio. Retrieved 7 March 2022, from https://daan-van-eijl-graduation-internship-portfolio.webnode.nl/replay-virtual-opponent-concepting/