Search Unity

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

Discussion in 'Assets and Asset Store' started by BeeZee, Jun 20, 2017.

  1. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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: https://assetstore.unity.com/packages/slug/92333

    Playable demo: http://www.skytyrannosaur.com/BoostersAdventure/index.html
    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!
     
    Last edited: Mar 27, 2020
    StevenPicard, Bhanshee00 and Neviah like this.
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    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.
     
  3. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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.
     
    theANMATOR2b likes this.
  4. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    Very interesting and well done.
    Good job !
    6R
     
  5. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Thank you!
     
  6. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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!
     
  7. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
  8. MissingText

    MissingText

    Joined:
    Oct 15, 2013
    Posts:
    11
    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!
     
    BeeZee likes this.
  9. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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.
     
  10. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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.
     
  11. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    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
     
    BeeZee likes this.
  12. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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.
     
  13. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Rex Engine is temporarily on sale! You can get it here for 30% off for a limited time:

    http://u3d.as/RLr
     
  14. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    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.
     
    Last edited: Jul 26, 2017
    BeeZee likes this.
  15. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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.
     
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    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
     
  17. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    and one more, can you add more shooting directions like meteoroid? diagonal up and left right, and down when jumping. :)
     
  18. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    and perhaps one more , can you show a damage number when the enemy is hit, like in cave story
     
  19. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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!
     
  20. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    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.
     
    Bhanshee00 likes this.
  21. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    wow!!! so fast, Thanks, I will send the pm
     
  22. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Check your inbox! Got some goodies for ya.
     
    Lars-Steenhoff likes this.
  23. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    New features in v1.02 (and v 1.01, since I never made a video for that one):



    1.02 has been submitted to Unity, so it should be up shortly.
     
    Lars-Steenhoff likes this.
  24. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Looks great!

    Did you already implement controls for mobile? I see there is a prefab with touch control, how do I get this to work?

    Thanks
     
  25. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    They'll automatically turn on if the platform is set to Android or iOS.

    Let me know if you'd like more fine-grained control over that, and I can set something up for you.
     
  26. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Cool, I would love to have a way to make the touch overlay user configurable, so for example an option menu with some settings like overlay transparency, and if a joystick is used on mobile that the overlay can be set to total transparent.
     
  27. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Good idea. I plan to add a lot of stuff to the touch controls in future updates. For the time being, you can manually adjust them under the RexEngine/Resources/System/Singletons GameObject; if you drill down into the TouchInterface GameObject inside that, you can set the opacity on the sprite renderers for the buttons.
     
  28. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Nice!

    I have one question about crouching and breaking blocks, right now I cannot break a box from when under them crouching, and pressing jump, even with jump enabled in the crouch settings.
     
  29. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Feature request: When in air press down to dash down on the ground, and when dash down on a breakable block also allow the block to break. ( a bit like in Yoshi Island )
     
  30. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Hm... sounds like a bug. Thanks for catching it. I'll look into fixing it.

    The butt-stomp will absolutely be in a future update, as well as probably Yoshi's flutter jump. (But not Baby Mario. Never Baby Mario.)
     
    mattglaister likes this.
  31. KyleRR12

    KyleRR12

    Joined:
    Aug 15, 2016
    Posts:
    11
    I just bought Rex Engine yesterday, and I must say it looks like it can give my game a lot of potential. So, I have a few questions.

    Is there a guide on how to swap out the sprites for my own? I have a general idea how to do it, but asking in case there's an easier way.

    How do I implement the Save/Load feature with Save Files on the title screen? And the option to delete a save file from the title screen?

    How do I adjust the camera position of the player? Because for some reason it went lower when I lowered the "SceneBoundary_Bottom" and it doesn't seem to move when I move the "MainCamera" in the scene view.
     
    BeeZee likes this.
  32. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Thanks for checking out Rex!

    You can swap out sprites for an actor in two main places (I'll use the Player GameObject as an example, found under RexEngine/Resources/Demo/Actors/Player):

    • Drill into the Player GameObject to: Player > SpriteHolder > JitterHolder > Sprites > Sprite. This is where its SpriteRenderer is, and you can drag any sprite onto that.
    • RexActors will mostly be playing animations, so you'll also want to swap out the AnimationClips. You can do that as follows: Player > Controllers > Controller. From there, in the Inspector, you'll see all of the Rex States the player has, including things like Jump State and Moving State. Those have an "Animation" slot; if you drag an AnimationClip onto those, it will play that AnimationClip when the character enters that state. For the player's Default State -- i.e. the one that plays when they're standing still -- pop open the Animations section under their Rex Controller component.

    There's an example of saving and loading in DataManager.cs. There's a Save function as well as a Load function; you can call them from anywhere in the game using the following line:
    • DataManager.Instance.Save() or DataManager.Instance.Load()

    Right now, they're full of data for the Booster's Adventure demo, but you can adjust it as-needed to save or load any type of data you want. I should also note that the Title screen of Booster's Adventure calls ResetData() on line 46, so if you're using that as a template, you might want to get rid of that line if you want data to persist between saves.

    If you need any assistance with that part, let me know and I can help out further.

    I'm not 100% sure what you're asking on the Camera question, so if this isn't what you're looking for, let me know and I can elaborate more. By default, the RexCamera will try to follow the player, and it will override any manual positioning you do in its attempt to do so. There are some options to change this if you'd like. You can find the cameras under: RexEngine/Resources/System/Cameras. The MainCamera there has an option called "Will Track Focus Object" which you can toggle off to prevent it from doing so. You can also toggle X and Y scrolling on and off independently with the Will Scroll Horizontally and Will Scroll Vertically options.

    Hope that helps!
     
  33. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    I'm working on a new system for doors you can walk through. In this example, they're set up like the doors in Yoshi's Island, but the system is flexible enough that they can also work like Mario Bros.-style pipes, Castlevania doors, teleporter maze nodes, or a ton of other things.

     
    Bhanshee00 and Lars-Steenhoff like this.
  34. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
  35. molul

    molul

    Joined:
    Jan 21, 2017
    Posts:
    15
    I bought the engine this evening and I'm so looking forward to make my first tests next week :D I've been developing a 2D platformer on different engines for a few years, and now I want to seriously get back to it with Unity, and this looks like it could save me a lot of re-coding.
     
    BeeZee likes this.
  36. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Adding some new options for creating projectiles. Here's a small taste:

     
    Lars-Steenhoff and Bhanshee00 like this.
  37. molul

    molul

    Joined:
    Jan 21, 2017
    Posts:
    15
    Very cool!
     
    BeeZee likes this.
  38. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    More projectile options in the pipeline! Can you tell I like Castlevania?

     
    molul, Bhanshee00 and Lars-Steenhoff like this.
  39. molul

    molul

    Joined:
    Jan 21, 2017
    Posts:
    15
    Hehehe, very cool as well.

    Small question, BeeZee: did you make the Rex Engine assets graphics?
     
  40. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    I have a friend that I collaborate with on all my games, including Rex Engine. He does really amazing pixel art, as well as more fluid hand-drawn stuff. He's awesome to work with!
     
  41. molul

    molul

    Joined:
    Jan 21, 2017
    Posts:
    15
    Amazing pixel art indeed :)
     
  42. tcfluharty

    tcfluharty

    Joined:
    Aug 12, 2017
    Posts:
    2
    Having issues with the Scene Loaders. I followed your documentation perfectly. However I found I needed to scale the loader so it was a tiny bit overlapping with the player for it to even activate. Instead of having it be aligned with the boundary. But when I activate it the screen just goes black and it fails to load the next level. I have everything named properly.
     
  43. molul

    molul

    Joined:
    Jan 21, 2017
    Posts:
    15
    I'd recommend sending a video to the developer, which by the way is on a trip this weekend :)
     
    BeeZee likes this.
  44. tcfluharty

    tcfluharty

    Joined:
    Aug 12, 2017
    Posts:
    2
    Thanks! I'll do a capture and send over to his email then.
     
  45. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Heya, just sent you an email for your controller question! I don't have my regular computer at the moment -- I'll be home with it tomorrow night -- but in the meantime, it might be that you need to add the second scene in the build settings. You can do that via:

    • Open the scene that isn't loading
    • Open Unity's build settings (File > Build Settings on OSX, although I think this is slightly different on Windows)
    • Click the "Add Open Scenes" button
    • I'd do this for every scene you're trying to load, including the original scene

    Hopefully that fixes it up. If not, let me know and I can troubleshoot it more directly tomorrow night when I get home.
     
  46. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Thanks for having my back while I'm between internet connections. I appreciate it!
     
  47. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    More projectile options incoming. This rabbit hole is getting deep.

     
    Bhanshee00 likes this.
  48. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Adding an easy option for 8-way projectile aiming.

     
    Bagnol and Lars-Steenhoff like this.
  49. nosajtevol

    nosajtevol

    Joined:
    Jun 28, 2012
    Posts:
    219
    This is really awesome and I want to get this, but am concerned about a few limitations because I can't see the code and stuff myself. I'm currently making a Metroidvania game. You already got my ferr 2d question really quickly today (thank you!). Also curious about animation support. Can I use the animator component without a fair amount of headache? Or is it purely animation state driven? Thanks again!
     
    BeeZee likes this.
  50. nosajtevol

    nosajtevol

    Joined:
    Jun 28, 2012
    Posts:
    219
    Also really curious about enemy AI. You say that the enemies can have the same behaviors, so could you elaborate a bit on that? Like can the enemies wall jump and jump around? Any kind of movement enemy AI for them to do that (and if not it'd be awesome if that's something you could build in later). I'm making a game with lots of different creatures that will need lots of running around and attacking the player. Just wondering if you've added anything like that to the engine
     
    BeeZee likes this.