top of page

Chase Morgan

Data Injection

Data Serialization

Interactive Media & Immersive Audio Technologies Sprint 3

10/09/2025

Sprint Overview

Sprint 3 is now finished and with it a significant amount of progress was made on the project! Many things got finished on the Unity side of this project which includes dynamic data collection via injection, data serialization, debugging, and dynamic data inclusion. Next sprint will be more outside of Unity with many logistical things needed completion.

The first thing I tackled during this sprint was finding a way to inject my code into Kickback's game in an efficient manner. The main way I am doing this is with a static class that hooks up to the Unity systems via the attribute of RuntimeInitializeOnLoadMethod which allows me to bind a method to be fired when Unity launches! This is only half of the battle as I also need at least one MonoBehaviour class to be present in the scene so I can collect necessary data. This is hard because I do not have anything related to my code in the scene yet. I get around this be loading a prefab that includes data necessary directly into the scene on start. This allows me to use this as a point of injection to link both my low-level systems outside of the scene and my high-level systems inside Unity.

Next up was making a settings class so that the developers of Kickback don't have to include my code in their builds which is very important! If I didn't allow this then my code would be included in their build which would slow down their game and potentially overwrite some portions of their game. The settings class contains various necessary options for runtime behavior for my code. It includes internet connection requirements, internet connection check intervals, dependencies, and options to include in editor and build. This class is meant to change with each iteration of my codebase as I need more and more settings to change runtime behavior if necessary.

Next up I did a lot of work on making data structures and records for holding a large amount of data at runtime. Ideally I want this data to be collected upwards of a thousand times in a single session. This means that I have to make all code in a highly optimized manner which is why I made the decision to use structures and records for data. A structure holds the throw away data and a record holds a collection of these structures and then serializes it to a string when told to. All data is also dynamically connected and stored using reflection at runtime. This allows me to add any fields at any point to my project and the system will automatically attach that field to the serialization process with no extra steps!

The serialization process is very unique as I have to make sure my data is in CSV format. CSV format requires the first line to be the data labels and after every data entry a comma. Formatting each data entry into CSV format is fairly easy as the system automatically sorts it as CSV as data is added. The first line data labels however, needed a bit more work as I needed to convert each field name from camel case format to a sentence format. Regular Expressions was used for this which really quickly converts each field name into a human readable string! After all this a correctly CSV formatted string is generated and ready to be uploaded to any spreadsheet!

The next thing I worked on is a custom internet availability checker which takes in a parameter of check intervals, and a delegate to invoke whenever internet availability ever changes. The way it works is that it checks for internet every X seconds which is the first interval given. If no internet is present it will then check and if internet is still not found it will check again after the next interval of seconds passes. So if the interval is 3, 5, 10, 15 and internet is not available it will check again in 3 seconds, then 5, and then so on until it hits 15 which it will now always check every 15 seconds. This is to not waste too many resources scanning for internet which can take a bit of time. 

The last thing I did on the Unity side for this sprint is make a custom debugger which debugs various things across the scene and my project. This is helpful because it can be used if anything goes wrong during runtime. It also lets me check on data in real-time instead of waiting until all data is collected. Since it uses Unity's OnGUI system it fires every frame and that is a problem because any data that changes from frame to frame is almost impossible to decipher as it changes to fast to see. To remedy this I set up a custom dictionary system that takes in a key and ties the string output to the last time it was changed. So I can input a interval for it to change and it will only ever change according to that interval. I can also set the interval to zero at any time which will update it right away if need be.

The rest of this sprint was spent working on gathering research for when I eventually need to write my research paper on this project. There aren't many research papers exactly relating to my field of research; however, there are a couple that will be great resources that I will use. I also had to contact the Institutional Research Board and fill out a survey as my project will use human test subjects in the form of playtesters. Luckily, after filling the survey out no review needs to be made for approval of human test subjects!

Overall, this sprint went very well with most things on the Unity side already complete. Progress has been made quicker than expected to the point where there may be potential to hook up to different projects across Advanced Game Production for even more data collection. This will greatly improve credibility of my research if proven across if my hypothesis is proven across all games in this class! The only problem is that data may be harder to collect in different games. Thank you for reading!

Data Collection

bottom of page