• Register

Fatty Rabbit Hole is a game about a hungry rabbit falling down an endless hole. Eat all the junk food you can while avoiding obstacles, healthy food, and a collection of shady characters who are out to end your feast!

Post news RSS Fatty Rabbit Hole: The Engine Update

A quick story about upgrading Fatty Rabbit Hole's game engine to GameMaker Studio 2, and the future of the game after having lifted the hood on it once again.

Posted by on

GameMaker Studio 2 compatibility report

GameMaker Studio 2 compatibility report

In the fall of 2018, I found myself at a crossroads with Fatty Rabbit Hole. Having gotten the game to a pretty good place earlier in the year, it had been months since I’d spent time working on an update for it; most everything I’d wanted to get into the game was there, and most of my notes I’d made about it since then had been devoted to a potential sequel.

Meanwhile, YoYo Games had begun phasing out support for GameMaker Studio 1.4, the engine the game was built in, and so the prospect of keeping the game up to date well into the future seemed dim. I’d tried importing the project into GameMaker Studio 1.4’s successor, GameMaker Studio 2, to see how well it would convert to the upgraded engine. Things mostly worked, but it left a lot of cruft behind, and I didn’t want to do a complicated engine upgrade just for the sake of it. So I put off converting the game to GameMaker Studio 2.

In September, I received an email from Google Play. It briefly went over some changes that were coming to the requirements for software hosted by the store – in particular, that new apps and updates would require Android 8.0 (API level 26) after a certain date. I opened my old project files and investigated, and indeed Fatty Rabbit Hole used an older API and would need to be updated to remain on the store.

Now, I had to decide: should I continue using GameMaker 1.4, even though support for the software had virtually ended, and make minimal changes – some of which also might not be supported – in order to ensure that my game remained on the store? Or should I bite the bullet and convert the project to GameMaker Studio 2, spending much more time up front to convert the game, but trading that for a potentially stronger future for the game?

Ultimately, I decided that the best approach was the harder one. I chose to upgrade the engine to GameMaker Studio 2, and put in the extra work to make sure it all worked correctly – hopefully well into the future. And so began the engine update for Fatty Rabbit Hole.

Fatty Rabbit Hole in GameMaker Studio 1.4

Fatty Rabbit Hole in GameMaker 1.4

Fatty Rabbit Hole in GameMaker Studio 2

Fatty Rabbit Hole in GameMaker 2

Import & First Assessment

Importing my old project files to the new engine was easy; YoYo Games has done a good job of helping make this transition as seamless as possible, even though a few bumps remain. I used the import option to bring the project in, and despite having generated a compatibility report 548 lines long, without any changes, the game would compile and run correctly. Pretty great!

GameMaker Studio 2 features many new – and many deprecated – functions. And so, one of the ways YoYo Games has made the import process work is that, when an older function is found in an imported project, the API automatically creates and substitutes these with scripts that replicate the old functionality. This is a great feature, but it left me wanting; my newly upgraded project had 20-30 of these compatibility scripts, and hundreds of instances where they were in use. It felt like a bad idea to ship my game straight to production without sorting these out, so I got to work.

There were two compatibility scripts that made up about 80% of the substitutions in my project. The first dealt with creating instances in the game, and the second dealt with drawing backgrounds (as opposed to sprites, which were phased out in GameMaker Studio 2. The other 20% was set around some changes that were made to the way the program handles strings.

GameMaker Studio 1.4 object panel

Object panel in GameMaker Studio 1.4

GameMaker Studio 2 object panel

Object panel in GameMaker Studio 2, sans depth

GameMaker Studio 1.4 was an evolution of the software, and it retained a lot of functionality that had been in the GameMaker engine for many, many years. One function, instance_create(), would allow you to create any object at runtime, and only accepted three arguments: x, y, and the object id that you want to create an instance of. You could determine which objects would draw in front of others by defining the depth of an object in the object’s properties panel. In GameMaker Studio 2, this function changed slightly, into two new functions: instance_create_depth() and instance_create_layer(). You might have guessed already from those function names what YoYo Games did – they uncoupled depth from the object properties and allowed you to set a depth at the time of object creation. This was an interesting new feature that made object creation more powerful and object layering more flexible, but it also left my project with a slew of compatibility scripts that I wanted to replace, and took me a few hours of comparing both projects side-by-side so I could create all of my objects in the new engine on the same layers as I’d set in the old one. It took some time, but ultimately, was not too hard to fix.

The backgrounds were a simple fix too, since they were handled almost the same as sprites anyway. I found all occurrences of the compatibility scripts, such as draw_background(), and replaced them with draw_sprite() with all the appropriate arguments. Not bad.

Game Maker 2 string compatibility

Game Maker 2 string compatibility

Cleaning up the text/strings in Fatty Rabbit Hole was more annoying than anything else. Virtually every function in Fatty Rabbit Hole which would draw text to the screen now encapsulated a string_hash_to_newline() script, meant to ensure that imported projects which used the hash symbol (#) in strings to indicate a new line would work properly in GameMaker Studio 2, which now used “\n” to indicate a new line. I doubt that these extra function calls would have affected the speed of the game, but I wanted to clean up the code, so I also set about removing all of these – which took time, in part, because there were so many, and because I then had to go back and make sure that all of the text in the game utilized this new way of doing things. Unlike the instance/depth issue described above, this didn’t require that I cross-check my work with the previous version of the game, so at least I didn’t have to do that!

Much of the rest of the work I did to convert the project to GameMaker Studio 2 involved further removal of old functions and implementing as many new functions as possible. I removed an old extension I’d used to invoke the keyboard on mobile apps and replaced it with a new native function provided by GameMaker Studio 2. I took advantage of the new Cleanup event added in GameMaker Studio 2 and combined a lot of my old code from the Destroy, Room End, and Game End events to make things simpler. Although they were not new to GameMaker Studio 2, I also found myself doing some work to clean up loading with texture and audio groups.

Just One More Thing…

As I dug deeper and deeper into my old code, refining things where I could, adding comments where I thought they’d be helpful, and generally making things better, I got to thinking: should I abandon the idea of making a sequel to Fatty Rabbit Hole, and just implement my ideas into this existing game?

It didn’t seem unreasonable. I’d been struggling to really come up with a meaningful way to improve on the game enough to warrant a sequel, and many of the ideas I’d had were just holdovers from before I’d finished the game the first time – things I’d wanted to implement, but just didn’t have time to do, back then.

Animated Injured Rabbit

It began with revisiting some animations in Spine – making some smoother, cleaning them up where possible, adding extra bones and flourishes – and grew to adding a new game mode, adding seasonal events, rewriting the entire scoreboard system, and making a whole host of other improvements to the game.

The updated version of the game will hopefully be out by the end of 2018, but I wanted to make a few posts here to chronicle the things I’ve done. If you enjoyed reading about the engine upgrade, I hope you’ll join me as I delve into the other updates I made. If you have any questions or comments, please post them – I’m happy to go into further detail where I can. Thanks for reading!

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Profile
Fatty Rabbit Hole
Windows, Mac, iOS, Android
Send Message
Release date
Game watch
Related Games
Related Engines
GameMaker Studio
GameMaker Studio Commercial
Related Groups
Indie Gamers
Indie Gamers Hobbies & Interests with 1,510 members
Massive Catapult Creative, Inc.
Massive Catapult Creative, Inc. Developer & Publisher
PC Gamers
PC Gamers Hardware & Tech with 744 members