[RELEASED] Rex Engine: A Unity 2D Platformer Engine

Rex Engine is a 2D platformer engine designed to help you make classic 2D games as quickly and easily as possible!

You can buy it here: Rex Engine: Advanced 2D Game Engine | Systems | Unity Asset Store

Playable demo: Unity WebGL Player | Rex Engine
Website: http://www.skytyrannosaur.com

I’m a huge fan of the 8 and 16-bit classics, and I wanted to make an engine that would replicate that tight, polished feel.

Out-of-the-box, it’ll let you create characters and enemies that move, jump, attack, and use a variety of other mechanics:

  • Move (With and without acceleration)
  • Jump (And double-jump and infinite-jump)
  • Climb ladders
  • Dash (And air-dash)
  • Crouch (And crouch-move)
  • Wall jump
  • Wall climb
  • Ledge grab
  • Swimming
  • Flying
  • Melee attack
  • Projectile attack
  • Bounce on enemies (or other objects)

You can add any of these mechanics to any character at any time, directly from the menu!

Additionally, you can tweak a huge number of parameters for every single mechanic right from the Inspector. I put a ton of work into making sure you can give your game its own unique feel with Rex Engine – you can do stuff that feels like Mario, or that feels like Mega Man (or Mega Man X!), or that feels like Castlevania, or pretty much any in-between (other personal favorites that I made sure had their bases covered were Ducktales and Ninja Gaiden!)

There’s also a ton of advanced stuff. It’s got perfect sloping terrain, because I used to tear my hear out trying to nail that, and I want to save you the time when you make your own games! You can flip gravity upside-down with the press of a button and run along the ceiling (or lower gravity to do moon physics and underwater physics!) You can set up checkpoints, moving platforms, one-way platforms, and collectibles and powerups.

You can even hot-swap entire movesets on the fly with the press of a button. Want a character to have different moves and a totally different feel when it’s underwater? You can do that, and a ton of other cool related stuff.

I wanted to make this the single easiest way to get a 2D game up and running, so the process is as streamlined as I could make it. Once you import the asset, there’s a menu option to create a new character. From there, you can add the mechanics you want from the menu, and you’re good to go, with no code whatsoever! You can even do this for enemies, and you can give them a bunch of behaviors for moving and attacking, including stuff like turning when they hit walls, following the player, or jumping when they detect ledges. There’s even a menu option to create a new scene, which comes pre-loaded with everything you need to play it, and to make entrances and exits between rooms.

Rex Engine has a lot of game-feel type stuff like sprite flash, sprite flicker, screen fade, and screen shake, as well. Game feel is really, really important to me, so I wanted to make sure games made with Rex Engine feel as good as humanly possible.

If you want to use this as a foundation to build off of, that’s easy, too! Everything is commented and documented, and I made everything clean and organized, so it’s very easy to add your own mechanics on top of what’s here.

EDIT: Released!

3 Likes

This looks pretty - all encompassing. Well done.
Have you considered Playmaker support?
I didn’t see any mention of one way and two way platforms. One way (to me) is the character able to jump through the bottom of a platform and land on the top.
Two way (to me) is the player is able to jump through the platform, land on top of it, and drop down through the platform if desired.
Just a couple semi-fringe cases I didn’t see mentioned, but overall nice offering.

Yup, it’s got one-way platforms and platforms you can crouch through. Thanks for bringing that up! I should add those to the original post.

I don’t have any concrete plans for PlayMaker at the moment, but I’d love to add support for it at some point.

1 Like

Very interesting and well done.
Good job !
6R

Thank you!

Working on some big updates which should launch shortly after the main asset gets approval! I’m most excited for charge shots, so you can hold down the attack button to power-up progressively larger projectile blasts, a-la Mega Man!

Just got approved! RexEngine is now live on the Asset Store.

You can download it here:

I’m very excited to start getting feedback from everyone.

I was unable to find any info on the asset store or on your website about how level creation is handled, specifically colliders. The information mentions ‘pixel perfect collision’, so does that mean that collision is somehow actually driven by texture pixels? Does your physics system use stock Unity 2D colliders, and if so are there any limitations on that or best practices? Is there anything in the way of a tile system or tile map support built in? I imagine the provided example content demonstrate some of this, but it would be nice if there was at least some information available without having to purchase the asset first. This was the one thing that kept me from making an impulse purchase and actually trying out the framework. What is available looks like great work!

1 Like

The physics do use Unity’s colliders, so you’re still setting up your own colliders – it’s not taking anything from the pixel data or anything.

The physics are made to emulate classic sidescrollers from the 8 and 16-bit eras, so making them feel really good and really precise was my number one goal. I used to struggle a lot with Unity’s default physics, where I’d run into scenarios like jump heights varying slightly at a different FPS, or falling down slopes when trying to walk up them. So at that level, when I talk about the physics being pixel-perfect, it means they’re precise and stable; if you set a character to jump a certain height, it will ALWAYS jump that height, down to the pixel, and so on.

There’s no built-in tilemap support, at least not yet. Terrain is open-ended, so you can use any system you want. For the demo (http://www.skytyrannosaur.com/BoostersAdventure/index.html), every tile is just its own sprite with its own collider.

You can do the same really easily, or Rex will also play very nicely with other tools like Ferr2D Terrain or Super Tilemap Editor.

Thanks for the feedback, as well! That’s really useful to hear.

A new version of Rex Engine is now live! It adds:

  • Charge Shots: You can hold down the attack button to charge up a giant projectile

  • Added toggle to make actors ignore terrain

  • Added ability to randomize enemy attack times

  • Added ability for SceneLoaders to be positioned independently of the SceneBoundaries bordering a room

  • Several QoL updates to make it faster to create new characters

The new version is available here.

Is there a Scene Manager (from scene to scene) ?
Is there a way to start from the 15th level for example if I want to resume the game a day after ?
6R

1 Like

Yep, it’s got its own scene manager. It’ll let you put multiple scenes together into full levels, put doorways between them, set up checkpoints to respawn there when you die, and so on and so forth. The example project included also has a data system for saving and loading player progress between plays.

Rex Engine is temporarily on sale! You can get it here for 30% off for a limited time:

Just got it, I’m now trying to get the character left right move mid air, like Mario can do when he jumps, any way that I can get more mid air control?

Edit I found the acceleration controls this in the movement script.

1 Like

Yep, no problem.

So if you go into the Player prefab (RexEngine/Resources/Demo/Actors/Player/Player.prefab), you can expand the Player GameObject. Drill down to the Player > Controllers > Controller GameObject, and click on that. In the Inspector, you’ll see a component called “Jump State.” This has a bunch of options for air movement. “Freeze Horizontal Movement” will lock the player into a direction when the jump if it’s turned on, so you’ll want to make sure that’s turned off.

If you want the player to have momentum, like Mario, you can do that under their Moving State component, which is right above Jump State. Movement Properties can be expanded, and it has Acceleration and Deceleration values. I’d put those both at around 0.25 to make the player feel Mario-ish.

thanks for the detailed reply I have few more questions

Now I just need to find a way to make the player run faster when pressing a button, like in mario…

and if you can add the functionality to break boxes from below, jump under box and break like Mario that would be awesome

and one more, can you add more shooting directions like meteoroid? diagonal up and left right, and down when jumping. :slight_smile:

and perhaps one more , can you show a damage number when the enemy is hit, like in cave story

Haha, no pressure, right?

You can currently set projectiles to fire in any direction, but it requires a small bit of code. When a projectile is fired, this method gets called:

public void Fire(Vector2 _startingPosition, Direction.Horizontal _horizontal, Direction.Vertical _vertical, RexActor _spawningActor, RexPool _parentSpawnPool = null)

The “_horizontal” and “_vertical” properties there can be passed in as any direction, so you could wire up something like, if the player is pressing Up on the d-pad when they attack, call Fire(Direction.Horizontal.Neutral, Direction.Vertical.Up).

I’ve been planning to add something like that directly to the engine, so if you’d like, I can code up a solution for you and send it to you before the official version gets submitted. The same goes for damage numbers, pressing a button to run faster, and blocks you can break from below; they’re all on my to-do list.

Send me a PM and I can get the ball rolling on those!

Bottom-breakable blocks, damage numbers, and holding a button to run are now ready to go, and I’ll be submitting them to Unity tomorrow. I can send the files on request to anyone who has Rex. I’ll also post up some .gifs tomorrow to show them working.

1 Like