For once I'm starting one of these posts with tech stuff in mind.
Tech things
So I mentioned in yesterday's post, I'm looking to make an easier way to record a set of replays of interest (I'm calling them ROIs from now on).
There were a few issues I ran into.
First: it looks like BBCF requires a file called replay_list to agree with the header of a given replay in order for the game to load it. This means I have to update replay_list when I swap out the replays.
Second: replay_list, and the replays themselves, are in binary. I have never worked with binary files before, and will need to figure out what bits align with what information.
My friend and I started looking into reading the replay files to see if we can guesstimate some of the information. First he showed me an important series of commands:
cat <file> | hexdump -C | less
This allowed me to actually read the content of one of these files. (I was not kidding when I said I'd never worked with a binary file before.)
We started taking a look at some of the content of the files, and it didn't seem too bad. Obviously there was a header, and we could clearly see the usernames at the very least. I also made the educated assumption that buttons are stored in 4 bits in hex, e.g. a button press is stored in 00 00. I started trying to overthink it with stuff like "How few bits can you store flags as to whether or not 4 buttons are pressed?" but he explained that generally XInput devices store things in 16 bits, and I guesstimated that this game likely does the same (even if it parses it slightly to allow multiple types of controllers).
I also reached out to the modding discord and asked if anyone had already figured out how to parse these files, just because it seemed like it should be a solved problem. Which, turns out it is!
Here is the header file the improvement mod uses to parse a replay file.
Here is the header file the improvement mod uses to parse the replay_list file.
So, I'm going to go off of these in my code to generate a new replay_list file off a provided directory of ROIs.
More here after I do some work on my thesis and make some progress on this. It's going to take a while because it's been a very long time since I've worked in C#, let alone any visual C# and I'm trying to make a UI at the same time as I make the backend functionality.
Personal
It felt wrong not to put a personal section.
Uhh.
Uh.
I got a haircut!