Published 2017-05-18

What’s been going on lately and some comments on the latest v1.2.1 update

Want to know why the latest update took almost two days to install or why I’ve been quite absent in the forum lately?

Since February I’ve been working on the v1.2.1 update. I feel like it’s been going on forever. What started out like a small bug fix update turned into a major performance update with major refactoring in the database.

That a game world might crash when switching over to a new season shouldn’t be news to anybody by now. This issue puzzled me, specially since it didn’t occur every time. So a while back I began logging and tracking almost everything that was going on and hoped(!) for a game world to crash again. And when one finally did I discovered two probable causes.

Simplified you could say that the game is made up of two components; The main website and the simulator. Both of these components use the same database and in some rare cases these two components might try to access and edit the same data at the same time. If this happens there could be corrupted data as a result, which might lead to a game world crash. This hypothesis would also explain why the crashes are more common in high speed game worlds since the simulator runs at a much faster schedule.

One other probable cause for simulator crashes is due to heavy database load. This made the database throw timeout exceptions every now and then.

These two new insights made me decide to extend the v1.2.1 with some major refactoring work which lead to the following:

  1. To avoid simulator and user conflicts I needed to somehow prevent the user from saving data when the simulator was working. So that’s why most save buttons are now disabled when the simulator is running the most, not all, critical updates. More info regarding this can be found at the forum change log for the v1.2.1 update.

  2. To reduce database load I decided to slim down database documents that are used frequently. This kind of change would probably be considered as a breaking change and I actually considered a complete wipe of all game worlds. But in the end I decided to keep them. That meant that I had to run through and update every document in the database in all game worlds. All in all I believe I’ve updated over a million documents when installing the v1.2.1 update. And that’s why it took almost two whole days to finish the update.

Besides all the above the update also contains some calibrations of the game engine. I will tell you more about this in another blog post real soon.

When I started this update in February I hoped I could finish it in a week or two. But time ran out of my hands and I could only put in an hour or two every week. In those hours I also answered questions in the forum, reverted and patched bad trades, looked into cheating/abuse and many other things. All of those things are really important too, no question about it, but I wasn’t getting anywhere with the update. So somewhere down the line I decided to focus all of my time to finish it. That’s why I have been quite absent lately.

I am now really looking forward to begin developing the next big feature of Game Plan Hockey Manager; Farm/Affiliation teams!