"In my career, I’ve probably coded 'jumping' several dozen times. I wanted to do that one last time, and be done with it."
- Game developer Muir Freeland, explaining the genesis of his new Unity 2D game toolkit RexEngine.
Last week the folks at indie studio Sky Tyrannosaurus (Seafoam Empress, Blowfish Meets Meteor) launched RexEngine, a robust $100 Unity toolset for creating 2D games with a custom physics system designed to make them feel like "classic games of the 8- and 16-bit eras."
This is potentially of interest to Unity devs aiming to make something along those lines, but even indies who don't use Unity may appreciate hearing the story of how RexEngine came to be.
It's an interesting example of why you might take time away from making games to make something that can help you (and others) make games more effectively, even if you're scared of rolling your own game dev tech.
According to Sky Tyrannosaurus owner (and occasional Gamasutra blogger) Muir Freeland, "I made RexEngine because I was tired of having to reinvent the wheel every time I started a new project." In an email to Gamasutra, Freeland opened up a bit about how the toolkit works, and what it can do for Unity devs -- as well as some of the hurdles encountered in its creation.
What is RexEngine, and why did you make it?
RexEngine is a 2D game engine for Unity. It gives you a pixel-perfect 2D physics engine and easy access to a huge library of classic game mechanics, including running, jumping, attacking, and a bunch of more granular stuff like dashing and wall-climbing. You can set all of this up without any code. It’s designed to save time and to make games feel awesome.
You can create new characters, and give them any combination of these abilities, directly from the menu, and they just work. Then you can fine-tune every aspect of how they behave and interact, all from Unity’s Inspector, without typing a single line of code.
You can make a game that plays like Mario, with the momentum-based movement and the bouncing on enemies, or you can make a game that plays like Castlevania, with the stiff movements and locked jumping. Or you could make a version of Simon Belmont that damages enemies on contact and jumps up walls like Mega Man X.
It also has a custom 2D physics engine. I’ve always struggled to make Unity’s default physics feel good for 2D platformers, so RexEngine has its own physics, which are pixel-perfect and based on old-school classics. I wanted them to be easy to work with, and I also wanted them to feel really crisp and precise and digital, the way classic games do.
I made RexEngine because I was tired of having to reinvent the wheel every time I started a new project. In my career, I’ve probably coded “jumping” several dozen times. I wanted to do that one last time, and be done with it. From here on out, I’m not programming jumping any more. I’m just importing RexEngine and hitting a checkbox.
What challenges did you face in putting it together?
The biggest challenge with making RexEngine was making everything play nicely together.
For example, you can press a button to flip gravity upside-down, because I’m a huge sucker for stuff like Mega Man 5, and then you can run along the ceiling.
RexEngine also has ladders you can climb on. I realized a long ways into development that ladders were broken with reverse gravity, because the conception of up and down was flipped, and ladders weren’t coded to understand that. So I had to go in and rebuild ladders to be gravity-agnostic.
Then the rabbit hole kept getting deeper — enemies, for example, can also climb ladders, and they can be set to move towards the player, and there were issues with enemies trying to climb towards the player in reverse-gravity. At one point, I ended up with enemies shooting off the ladders into space. It was hilarious but also obviously broken.
There were a lot of little things like that. The idea behind RexEngine is that people can take the mechanics and use them in any combination and with any set of values, so it’s a huge challenge accounting for things I haven’t thought of.