On Versioning (or how the simplest thing can save you from the hardest pain)

Originally posted by Luis.

Been there, know the feeling…

Long titles aside, this is no flashy post. Some will even find it a bit boring, but if at least one can learn anything from it, I will be happy. The motivation for it comes from an often overlooked issue. I now must tell how a work day can eventually turn out:

A freelance artist we are working with found this really strange and annoying crash bug in the LevelEditor. One point listed in the Luis’s standard procedure manual when working with bugs says “first, check the logs, see if anything looks strange there”, next one states: “try to reproduce, and work your way on from there”. Happened that the logs looked alright, and no one in the team could reproduce the bug in their machines, me included. So neither of these points threw any light into the issue.

It started to look like I was staring at one of those errors that no one wants to deal with, caused by hardware incompatibilities or similar übernice stuff (oh boy).

A new log seemed to make Luis happy, showing some strange error when loading a temporary file. It warned that the file the editor tried to read hadn’t been even created. This might sound like hint… but the way the editor works (it checks if the file exists before trying to read) certainly told me that it could not be possible. Frustration++ now (or for the non C speakers there, Luis starts to lose his temper a bit).

After a while of step-by-step execution debugging, unsuccessful thinking about the cause and some other shooting in the dark, a new log came in to my hands and, while it looked alright, it stank of “I fixed this warning thing like three months ago”. Turns out that the freelancer was using a dusty old version. He updated and bug gone. Gñe… now I want my sanity back.

This longish story confirms a couple things:

– You must never assume your users have the latest version when they complain about some bug.

– You definitely need a way to identify what version they are running without needing to ask them.

One might think I’m playing Captain Obvious here, but the same kind of situation described above happens a lot of times. It is actually strange to see no new messages for a while in our tech support forum. And even stranger if they are about stuff we have never seen before. Most of the time they are already solved issues, and the solution for them is as easy as updating to the latest patch.

So, after learning this nice lesson, I made a little program that is called by the IDE on the pre build event, and updates a build-ID string (in the form of yyyymmddhhmmss, with y – year, first m’s – month, d – day and so on… basically a timestamp of the moment the thing was built) that will then be hardcoded in the engine and apps, and appear at the first line in logs. I am pretty sure there already are better solutions out there for this kind of stuff, but I felt like doing it before any googling, and it didn’t take long, so no big deal. At least it might save me from having to buy a little suit:

Our Random Crash Simulator 1.0, feels just like crashing for real!

That’s enough for today. Remember to take care, and always version your stuff!
Also, merry Christmas and happy holidays everyone!