Pages

Wednesday, July 9, 2014

Toilets, Meat, and Drugs: Bug fixed!


Some of you who've been trying to play Toilets, Meat, and Drugs may know about a save bug in the game.  Basically, the game would be unable to save until after you close it for the first time. I am so relieved to say that I have finally fixed the bug.

Here's the technical explanation of what happened. When you save progress a video game, the game itself is unchanged. Instead, a separate data file is created that contains all of the relevant information, such as the player's status or location. While game developers usually create save scripts from scratch that target the information that needs to be saved and ignore the information that doesn't, Game Maker has a single function, game_save(), that automatically stores all information to a file. While this function is overkill and only recommended for beginners, it's really convenient to use for a jam game, when time is not a luxury.

The function has worked wonderfully in past experience, with older versions of Game Maker. But when Yoyo made the switch from Game Maker 8 to Game Maker Studio, the file directory system changed so that Game Maker games could be ported to platforms besides Windows. Which is great and all, except you don't get the benefits of this change unless you pay $100+ dollars for a professional license. The standard license, which I have, lets you port games to Mac, but that requires going through a holyshitton of hoops that I don't ever want to go through again.

Anyway, Game Maker Studio used to have the game_save() function removed altogether. It's since been added back in, but doesn't work as its supposed to with the new file directory system. Basically, the function doesn't actually create a directory in which to store save files until after you close the game for the first time! What the hell?!
 
What this means is that people who played Toilets, Meat, and Drugs for the first time would lose all of their progress upon dying or quitting the game. This is incredibly frustrating for the player, and even more embarrassing for me. I also wasn't able to detect the bug during development at all - the directory was created well before I even implemented the save system. It was a much unwanted surprise when I found out that I published a broken game!

Let me tell you, for a developer, there is no worse feeling than releasing a broken game. I would rather release a bad game than a broken one. I feel no shame about releasing games with crude, hastily draw, graphics, or a game with overly simplistic game play, or a game with missing music, or a game that I made in middle school. However rough these games are, they still have some sort of appeal, and, goddamnit, at least they work. Technical competency is the baseline, the absolute minimum standard a game must meet. Releasing a buggy game is like releasing a song recording that can only play through shitty laptop speakers - technical incompetence ruins the art.

I've been incredibly anxious over the past few days trying to figure out the cause and solution to this bug. Just this evening, after the deleting the game's directory and keeping an eye on Windows explorer as I played the game, I finally was able to identify the problem. Finally, by using a piece of code that creates an empty dummy folder when the game starts, I've tricked the game into actually creating the directory before the player closes the freakin' game. Cripes.

Fuck you, Game Maker. Fuck you. This extra stress was the last thing I needed.

But thanks for allowing me to create games for the past nine years.

Toilets, Meat, and Drugs is now available on itch.io and Gamejolt. And thanks to Warpdoor for featuring it on their site!

No comments:

Post a Comment