Dear Journal, Today I Video Gamed

Infinite Backlog added a new journal feature last month. I thought it was cool. You have to manually add sessions to your play log, and the journal will auto populate those sessions into a chronological list. You can add any comments you like, but I like to include when I started playing the game, when I beat/complete/drop/shelve a game, the achievements, and time played. I added a bunch of stuff through 2017 so far.

I wanted something similar on Royfuss Games; something more automated. So, I updated my python scripts to generate some new pages. Check out the results!

Royfuss Games Journal screenshot.
A page from my gaming journal.

This was a fun project. I started out generating session data for each day. Then, I added achievement data, and combined it with the session data. Afterwards, I added archive data into the mix. Finally, I tacked on obtain data.

Get ready for some programming talk. Royfuss Games is generated using an offline database, which I export as CSV files. After exporting the files, python scripts generate all the pages. I wanted the python script to be as efficient as possible. For starters, the CSV files were imported and sorted by the various sessions, archive, achievement unlock, and obtain dates (newest to oldest). From there, I needed to figure out which day needed to be processed by comparing the data in the sorted imports. Initially, I had hundreds of lines of code to do this, before I realized I overthought it. It is a lot more efficient and compact now. After that, it generates the daily output. The script also has logic to determine when a new page needs to be generated (new month), and the various navigation markup.

I thought I finished this a few weeks ago, and actually uploaded it to Royfuss Games. While manually going through it, I found some issues, and had to go back to my script to fix them. Some data was not being generated. For example, if I had sessions data for one game, but only achievement data for another game on the same day, the achievement data would not get generated. I ran into this type of issue a few times before getting it right.

The journal has helped me find errors in the data itself. The “Bikes Don’t Fly” achievement for Sable returns a 1979 date and time when queried through the Steam API. For some reason, it is correct when I view it on Steam and Exophase. So, I had to edit that achievement in my database to correct it. I also found missing session data where I had achievements unlocked. For those, I relied on timestamps among multiple achievements. It is nice to fix little stuff like that.

I swear this is the last web design thing I’ll do for a while. Let’s pad this post out with some personal stuff. I’m starting to get over my cold I have had for the past week. On top of a cold, the weather has been weird. We had three days of 90 degree weather. Then, we had three days of nothing but rain. It was much needed because we were in a drought, and we didn’t get much snow over the winter. After three days, my sump pump only ran a little bit, which is impressive. Now, we have freeze warnings. It looks like next week will be normal weather for May. It will be nice to have a spring.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top