Search Unity

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

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

  1. KyleRR12

    KyleRR12

    Joined:
    Aug 15, 2016
    Posts:
    11
    How do I set camera boundaries and offset the camera from the player?

    I attached 2 screenshots of what I mean about the camera boundaries.
    Photo 1. In the editor the camera is positioned where I want it. Photo 2. When I press play the MainCamera drops level with the player.

    How do I set the camera boundaries to set a little above the player so it doesn't drop level with the player but will move down when the player does like, in the Demo_2 scene? When I try to make a new scene that is vertical, the camera either drops to low or won't move down at all.

    I've done this with ProCamera2D or is there a way to use ProCamera2D with Rex Engine?
     

    Attached Files:

  2. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Heya Kyle,

    A couple notes on the camera: first, it loads in dynamically at runtime, so the Cameras object shouldn't be onstage when you hit Play; that can cause issues. The SceneBoundary markers -- the long yellow lines framing the scene -- are where the camera's boundaries will be, so you can put limits on the camera by dragging those around. I've attached an image to show where those are:



    I've had a few requests to integrate with ProCamera2D, so it's on my radar. I haven't used it personally yet, but another Rex user recently got them working together and said it worked out pretty well. I plan to reach out to their dev in the near future and see if we can set up an official integration.

    Hope that helps! Lemme know if there's anything else I can help with.
     
  3. KyleRR12

    KyleRR12

    Joined:
    Aug 15, 2016
    Posts:
    11
    I get that part, it's when I try to make a level where you can go down, the camera points too low, because there's no boundaries to keep it from doing it. Instead of the camera being centered on the player, how do I offset the camera when it's a little bit above the player? Because like in the 2nd screenshot I attached in my recent post, the camera centers on the player, showing what's underneath the platform the player is standing on instead of being offset a little, and not showing what is underneath until the player moves under the platform.
     
  4. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Ah, I see what you mean. There's no camera offset feature in Rex at the moment; in the Demo_2 scene, the SceneBoundary on the ceiling just prevents it from going higher. It's something I'd like to add in the future, though! (Along with a ProCamera2D integration, hopefully)
     
    hodgepodge2022 likes this.
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    BeeZee and hodgepodge2022 like this.
  6. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Ah, cool, thanks! I'll scope all of this out.
     
  7. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
  8. kitsune9000

    kitsune9000

    Joined:
    Aug 15, 2015
    Posts:
    42
    Hi. Is there a way to Minimally import this project so that it does not interfere with other things, like my inputs and preferences, or overwrite any layers? I was going to use this in a mini game for a larger game, but I don't want the two resources to conflict with one another.

    *Edit. I guess while I'm at it, I'll be a little more specific about what I was hoping to accomplish. If I have Scene0 running WITHOUT RexEngine, and Scene1 a RexEngine Scene, and finally, Scene 2 again running WITHOUT the engine, with the implication being I do not want a game over scene if the player dies, how can I start to accomplish this? I want the player to be able to have three tries at the level, and if he doesn't pass, then the next Scene, a Rex Free one, loads. Upon failure, I don't want game over, or anything to really exist outside of that scene stat wise. I will have one Boolean, the condition changed upon collection of a sprite-based item, and that will just be a flag that allows for dialog to change in the main game. I do not want the bool to really be controlled by Rex, but instead I was planning to control it with Unity UI. This, collecting the sprite sets my flagged bool to true, which was the only universal variable to appear in the entire level.
     
    Last edited: Dec 20, 2017
  9. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Hm... so, I've been getting more questions about how to handle updating lately. I'll admit this is kind of a new frontier for me, since I only just started getting questions about it. I wasn't aware that it would import input settings or layer settings until very recently -- that's why there are menu settings in Rex to update things like Tags and Layers.

    When you go to update Rex, does Unity give you an option for what files to update? If so, does it give you options to not update input settings and such?

    For the Game Over question, the Rex Settings panel (under Tools > Rex Engine > Rex Engine Settings) has a few options for how lives are handled. In that panel, expand the Lives field, and there's a field called "Game Over Scene" which has the name of the scene it will load when the player loses all of their lives. You could change that to the scene you want it to progress to afterwards. Then hit the Save button at the bottom of the panel, and you should be good to go.
     
  10. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    I always update rex without the project settings folder, thats where things like input are overwritten.
    It may be better to remove the project folder from the rex package in an update and just use he menu to initialise rex settings, this will make updating the blackage easier.

    another thing to look out for is prefabs with your own settings, when rex has a new changed player prefab for example it will overwrite your own settings there in an update. best to make a backup of any changed settings and then update en add then again to the new prefabs.
     
  11. kitsune9000

    kitsune9000

    Joined:
    Aug 15, 2015
    Posts:
    42
    I know what you're referring to. I did not specify this in my example, where I said RexEngine was basically sandwiched between Scenes, but I planned to have multiple instances of platforming. The best example I can give you of a game, real world, is that of Fire Emblem if you've played it. There are some dialogue scenes, and then there is a battlefield scene. Then when that's over, there is a dialogue scene again. Then a battlefield, then a dialogue... and on and on and on.

    If I do not have a way to change the field I want to progress to either at run time, or locally, after a platforming scene, then I can't have a dialogue followed by a platformer followed by a dialogue followed by a platformer. Just wondering if there are any other suggestions.


    ALSO - as for updating, I have not imported Rex into my project YET. I would be merging two projects which I've obviously backed-up, so I'm willing to try risky suggestions. I began to import Rex and was worried about the inputs and layers or the resources file would cause things to go haywire. I feel like sometimes when I've adjusted things after using others' scripts, I'll come to find out further along that I was wrong and I never noticed something went unexpectedly. Thus I'm trying to understand what changes will happen when I import. Regarding RexEngine and updating, I've only updated it once for one other thing I was working on, and I think the only warnings Unity ever gives me is when certain scripts are out of date, like from 4.6 or earlier, or when I need to regenerate materials.
     
  12. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Nice, Fire Emblem is awesome! The easiest way to handle that would probably be to not fully unload Rex between scenes, but instead, to disable the player and hide their lifebar and such. The Star() method of TitleScript.cs does this:

    Code (csharp):
    1.  
    2. void Start()
    3.     {
    4.         Camera.main.GetComponent<RexCamera>().willTrackFocusObject = true;
    5.         Camera.main.GetComponent<RexCamera>().willScrollHorizontally = true;
    6.  
    7.         RexTouchInput rexTouchInput = GameManager.Instance.player.GetComponent<RexTouchInput>();
    8.         if(rexTouchInput != null)
    9.         {
    10.             rexTouchInput.ToggleTouchInterface(false);
    11.         }
    12.  
    13.         ScoreManager.Instance.gameObject.SetActive(false);
    14.  
    15.         for(int i = 0; i < GameManager.Instance.players.Count; i ++)
    16.         {
    17.             RexActor player = GameManager.Instance.players[i];
    18.             player.gameObject.SetActive(false);
    19.  
    20.             if(player.hp.bar)
    21.             {
    22.                 player.hp.bar.gameObject.SetActive(false);
    23.             }
    24.  
    25.             if(player.mpProperties.mp)
    26.             {
    27.                 player.mpProperties.mp.bar.gameObject.SetActive(false);
    28.             }
    29.         }
    30.  
    31.         ScoreManager.Instance.text.gameObject.SetActive(false);
    32.         PauseManager.Instance.isPauseEnabled = false;
    33.         LivesManager.Instance.Hide();
    34.  
    35.         if(GameManager.Instance.isTimerEnabled)
    36.         {
    37.             TimerManager.Instance.Hide();
    38.             TimerManager.Instance.StopTimer();
    39.         }
    40.     }
    41.  
    Then, when the game starts, it calls these things to re-enable them:

    Code (csharp):
    1.  
    2. for(int i = 0; i < GameManager.Instance.players.Count; i ++)
    3.         {
    4.             RexActor player = GameManager.Instance.players[i];
    5.             player.gameObject.SetActive(true);
    6.  
    7.             if(player.GetComponent<Booster>() != null)
    8.             {
    9.                 player.Reset();
    10.             }
    11.  
    12.             player.Revive();
    13.  
    14.             player.slots.input.isEnabled = true;
    15.             player.SetPosition(new Vector2(-10000.0f, -10000.0f));
    16.         }
    17.  
    18. ScoreManager.Instance.gameObject.SetActive(true);
    19.         ScoreManager.Instance.SetScoreAtCheckpoint(0);
    20.         ScoreManager.Instance.SetScore(0);
    21.  
    22.         for(int i = 0; i < GameManager.Instance.players.Count; i ++)
    23.         {
    24.             RexActor player = GameManager.Instance.players[i];
    25.             if(player.hp.bar)
    26.             {
    27.                 player.hp.bar.gameObject.SetActive(true);
    28.             }
    29.  
    30.             if(player.hp)
    31.             {
    32.                 player.RestoreHP(player.hp.max);
    33.             }
    34.  
    35.             if(player.mpProperties.mp)
    36.             {
    37.                 player.mpProperties.mp.bar.gameObject.SetActive(true);
    38.             }
    39.  
    40.             player.CancelActivePowerups();
    41.         }
    42.  
    43.         LivesManager.Instance.Show();
    44.  
    There's probably a bit more stuff in there than you'll need for your game, but I think it should handle cover all the bases.

    Also, happy holidays, all!
     
  13. calminthenight

    calminthenight

    Joined:
    Nov 23, 2017
    Posts:
    11
    Thanks for that. I have been experimenting and have got it feeling good. Am I able to use length of button press to determine the XY movement speed? I am making a cannon that is not aimable so I would like to be able to give the player control over the shot distance each time they fire. Any ideas?

    Having heaps of fun diving into this.
     
  14. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    I'm trying a new update from rex with incontrol.
    I unzipped RexInControl.zip and installed incontrol from the asset store, and setup the default incontol input manager settings.

    what is the next step to get it to work?


    Thanks
     
  15. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Heya all, hope you had a great holiday!

    Hm... yeah, that should be pretty doable with a small bit of code. What I'd consider doing is adding a variable that tracks the amount of frames the button has been held down, and then sets the movement speed of the projectile accordingly.

    I'd look into the Attack.cs file, which is where an attack typically spawns a projectile. I'd add the following to the FixedUpdate and CreateProjectile methods:

    Code (csharp):
    1.  
    2. int framesAttackButtonHasBeenHeld = 0;
    3.  
    4. void FixedUpdate()
    5. {
    6.      if(slots.actor.slots.input.isAttackButtonDown)
    7.      {
    8.           framesAttackButtonHasBeenHeld ++;
    9.      }
    10.      else
    11.      {
    12.           framesAttackButtonHasBeenHeld = 0;
    13.      }
    14. }
    15.  
    16. public void CreateProjectile()
    17. {
    18.      newProjectile.movementSpeed.x = framesAttackButtonHasBeenHeld;
    19. }
    20.  
    For FixedUpdate, you should be able to add those new lines of code to the bottom of the method, underneath the stuff that's already there. For CreateProjectile, you should be able to add that new line around line 342, right before it calls newProjectile.Fire().

    I'd also consider doing this in an override of Attack.cs, so that it doesn't apply that to EVERY projectile in your game.

    Let me know if you need me to further clarify anything in there, and I'll be happy to.

    Here you go:
    http://www.skytyrannosaur.com/rex-engine-incontrol-integration/
     
  16. calminthenight

    calminthenight

    Joined:
    Nov 23, 2017
    Posts:
    11
    Thanks,

    I figured that would be the way to go and had already stolen the frame tracking code from the chargeup shot to do it. I'll give this a test over the next week.

    :) Michael
     
    BeeZee likes this.
  17. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Rex Engine 1.11 is now live! Among other things, this one adds grace frames for jumping, so you can walk off ledges and still jump for a few frames afterwards, and the ability to continuously fire attacks by holding the button down.
     
  18. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Nom I'm trying to use incontrol on the iPad with icade, and I would like to switch between touch controls and incontrol input. can you make some kind of toggle for that? thanks
     
  19. kitsune9000

    kitsune9000

    Joined:
    Aug 15, 2015
    Posts:
    42
    Hello, back again everyone, and spent some time again today on my project. First of all, as Lars suggested, I did not import the Project Settings at all. After that, I imported the layers Rex uses into my project, and manually added the Inputs like Player0Vertical, ect... I started a new Scene and used 'Setup Level Scene' from the RexEngine toolbar. Everything works great and I don't think I'm missing anything. I went from my visual novel section to running Rex. But then - I ran into the little problem quoted above ...not to fully load or unload Rex between scenes. Going into Rex Engine was easy. It's coming back out of it that's hard.

    So, I put a Right scene loader in and thought to myself, what is the easiest way to get rid of Rex for this next scene? The above code makes sense Beezee, but if I just want to purge the player from the scene and operate without the engine, is there a simple way to just shut it down if I am not going to be using or remembering variables? The instance of platforming is very local to the scene each time I instance a platforming level, with no interconnectivity from one scene to the next.

    *I think I could write a script OnAwake for next scene that hides the Rex Canvas and constrains player. Would that work? I haven't tried it yet. Scene loader to the right obviously takes me to the next level. I guess ideally if I could just constrain player and disable RexEngine inputs, plus hide the UI, that would be ideal. Then I have an added bonus of dragging any variables with me from scene to scene if I wanted. Does this sound like a solution I should work on, or do you think I should just do a more simple approach? Just purging Rex from the next scene is better if it's easier. Let me know thoughts, opinions.
     
    Last edited: Jan 10, 2018
  20. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    So I think the ideal way to approach this is to just hide the Rex Engine stuff and show it when appropriate. You probably *could* write scripts to fully delete it and re-instantiate it, but I don't think there would be much of a benefit to that approach. It would be harder to do and probably more error-prone. There should be very minimal overhead from Rex running in the background as long as the relevant GameObjects are deactivated -- mostly just the Player and the UI -- and there aren't any objects active and using RexPhysics in a scene.

    The main stuff I would do here, which you can see examples of in my above post with the code, is:

    • Deactivate the Player's GameObject
    • Hide the UI
    • If you're using the Timer or anything, stop and hide that as well

    You could potentially deactivate the cameras that RexEngine uses as well, but I don't think there's much of a need to; if you need to change the zoom level or anything, they all work just like standard Unity cameras.

    Off the top of my head, I think that should be just about it. It should run well and all the Rex stuff should be out of the way, ready to come back when you want it.
     
  21. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    InControl has its own set of touch controls, right? Once InControl is instantiated, it's probably best to use those; I don't think there's an easy way to unplug them from Rex once you've hooked them up, short of doing a lot of custom code.
     
  22. kitsune9000

    kitsune9000

    Joined:
    Aug 15, 2015
    Posts:
    42
    Code (CSharp):
    1.     void Awake(){
    2.  
    3.         for(int i = 0; i < GameManager.Instance.players.Count; i ++)
    4.         {
    5.             RexActor player = GameManager.Instance.players[i];
    6.  
    7.             player.gameObject.SetActive(false);
    8.  
    9.  
    10.             if(player.hp.bar)
    11.             {
    12.                 player.hp.bar.gameObject.SetActive(false);
    13.             }
    14.  
    15.             if(player.hp)
    16.             {
    17.                 player.RestoreHP(player.hp.max);
    18.             }
    19.  
    20.             //if(player.mpProperties.mp)
    21.             //{
    22.             //    player.mpProperties.mp.bar.gameObject.SetActive(false);
    23.             //}
    24.  
    25.             player.CancelActivePowerups();
    26.         }
    27.  
    28.         LivesManager.Instance.Hide();
    29.  
    30.         ScoreManager.Instance.gameObject.SetActive(false);
    31.  
    32.  
    33.  
    34.  
    35.  
    36.     }

    *Edited for clarity... As suggested, I am able to hide player and UI. I am going to explain the issue, which is a spawning issue, by example:

    I have 4 scenes.
    Scene A
    Scene B_Rex
    Secne C
    Scene D_ Rex

    Starting with A. a non Rex scene, I transition to Sene B by normal loadLevel method. Scene is the 'start' of when I use Rex Engine. My spawner is hypothetically at (0,0,0) and the right scene loader of that scene is hypothetically at (100,0,0). Using the scene loader, I instantiate the above code on awake of Scene C. It's a non Rex Scene and the above code cause the Player Sprite to stay hidden, along with the UI. At the end of Scene C, I use a loadLevel to call Scene D. This is the second Rex Scene. However, the player starts on the far right of the screen. I attempted to reset the player. I can't seem to find the right line of code to set to a default, fresh spawnpoint though.I think that seems to be the only issue. Everything else is working fine and I have no errors during any runtime.

    **RESOLVED (I THINK)

    on awake...


    if(player.GetComponent<Booster>() != null) {
    player.Reset();
    }
    player.slots.input.isEnabled = true;
    ----> player.SetPosition(new Vector2(-2.61f, 3.78f));



    I manually set a spawn point and I think it works now. I will leave this up of course if anyone wants to provide comments.
     
    Last edited: Jan 12, 2018
  23. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Hm... I wonder if the issue before was that the player was getting re-enabled *after* the SpawnPoint was setting their position, so the position-setting failed? At any rate, thanks for leaving your solution here! I'm sure it'll help people.
     
  24. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Can you add "setup level scene" to the undo stack.

    because right now after pressing that your scene is changed without undo possible.

    Thanks
     
  25. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Sure, I can look into that for the next update.
     
  26. Rick-Kercz

    Rick-Kercz

    Joined:
    May 17, 2017
    Posts:
    4
    Is there a way that I can trigger a player state change, like flying, from a controller / key input? Thanks in advance.
     
    Last edited: Jan 19, 2018
  27. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Sure thing. It'll take some pretty minor coding. I'd do this:

    • Make a new class to override RexActor.cs for your Player
    • In your new player class, do something like this:

    Code (csharp):
    1.  
    2.         public RexController flyingController;
    3.  
    4.         void Update()
    5.         {
    6.             if(slots.input.isSubAttackButtonDownThisFrame)
    7.             {
    8.                 SetController(flyingController);
    9.             }
    10.         }
    11.  
    Your public RexController, flyingController, would be visible in the Inspector, so you'd slot it with the controller you wanted to change to. You can see an example setup on Booster, where he's got both a SwimController and a FlyingController.

    That's the general idea. If you need any further clarification on how to handle any of the specifics, let me know and I can go into more detail.
     
    Rick-Kercz likes this.
  28. Rick-Kercz

    Rick-Kercz

    Joined:
    May 17, 2017
    Posts:
    4
    I will give it a try.
    Thank you for the help!
     
    BeeZee likes this.
  29. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Hey all, there was a bug in the Unity Asset Store preventing people from downloading the new version of Rex, but it's resolved now, and it should work normally.

    The new version has a window called Rex Level Editor, available under Tools > Rex Engine > Rex Engine Level Editor. This window houses some options for setting up individual scenes, including whether or not the Pause button is enabled in that scene and what music that scene plays. (These used to be on the Level Manager GameObject, but I'm slowly moving away from scattering things around the Hierarchy in favor of consolidating them all in windows where they're easier to manage.) You'll want to enable the new Rex Level Editor window and get familiar with it, because I'll be adding new features to it as time goes on!
     
  30. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Who wants to make Castlevania?

     
  31. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Me Me Me! Thanks!
     
    BeeZee likes this.
  32. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Heya all! Happy Friday!

    I hope everyone's games are going well. If you've got a few minutes, I'd love to see screenshots or videos of your games-in-progress for potential inclusion on the Rex Engine site.
     
  33. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
  34. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
  35. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Just submitted a brand-new update. Everyone who wanted the ability to jump higher while moving faster should be very, very happy.
     
  36. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Coming in 1.13:

     
    Rick-Kercz likes this.
  37. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    Thanks for the updates!

    I have one thing that I would like to change. when a dialog pops up the engine still runs in the background, so enemies can kill the player. I would like the engine to completely stop when I dialog comes up, is that possible?
     
  38. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Sure, that should be doable. It'll be in a near-future update.
     
    Lars-Steenhoff likes this.
  39. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    I want to show off a new feature of v1.13, which is available now:



    This is the Rex Palette. It's a window available under Tools > Rex Engine > Show Rex Palette. This window lets you create new players or enemies from a template, or insert enemies, powerups, or level gimmicks directly into your scene, with the push of a button. It also sorts them directly into the right parent GameObject, so you don't have to mess around with your Hierarchy. Hope it helps everyone make games even faster!
     
  40. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    New version is up! This one focuses on UI and tool improvements.

    I moved the 3 Rex windows out of Tools and into Window so they'd be easier to find. You'll want Rex Level Editor open most of the time (I keep it docked under Hierarchy so it's out of the way.) Having that window open now gives you a lot of options for setting up spawn points and Scene Loaders: you can create them directly from buttons on the window, facing any edge of the screen; doing so will automatically tag them with an unused ID, so that's one less thing you'll have to think about when creating scenes! You can also hit a checkbox to Lock or Unlock the Rex GUI, which will minimize the screen real-estate Scene Loaders and spawn points take up, and also toggle whether or not they're selectable. Also, the Scene Loaders feel really good to drag around now, which is something I've been wanting to do for a while.

    Enjoy!
     
  41. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Got a brand-new version coming! Version 1.15 fixes a bunch of bugs, adds some slick new visualizations for scene editing, and gives you new features like the ability to pause gameplay while a dialogue box is displaying. It should be up in the next few days!
     
  42. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    good stuff looking forward to try it out
     
    BeeZee likes this.
  43. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Happy Valentine's Day, all! Thanks for being here.

     
  44. Montimation

    Montimation

    Joined:
    Feb 15, 2018
    Posts:
    1
    So been wanting to try my shot at making a game, but being much more of an artist with absolutely no skill in programing, I thought i'd give an engine a shot. Now I am gonna start out with something simple, but I got enough ideas floating in my head that I would want to know how well the engine might handle future projects if I ever got to them... so questions/suggestions

    What about multi-phase enemies? Like you could have an enemy that sleeps, but when you get close enough, it wakes up and starts walking around? Or how about an enemy that starts out by walking back and forth, but after you hit it, the enemy becomes aggressive and quickly chases after you?

    How well would the engine handle something like complex boss fights? Like could it handle something like out of megaman where the boss moves about the room and uses a wide variety of attacks? How about setting those attacks for only when the boss is in a certain position (like firing a straight projectile when he's against the wall, melee attacking you when he's next to you, and then firing a scatter shot diagonally when he hops up to the top corner)? Could the attacks be randomized or could we set them to a distinct pattern? What about the boss teleporting next to you to deliver a melee attack? Or how about a multi-phase boss where the boss changes behavior and form either at certain times, or when he losses enough health? Can the engine display enemy health?

    What about giving the player multiple abilities they can swap between? Like the player has both a primary and secondary attack, but the secondary attack can be swapped out by pressing different keys. What about making it so you can cycle through multiple abilities like using the L and R trigger on a controller.

    What about in-game cutscenes? We got the dialogue box, but would I be able to have the sprites actually act on their own so they can act out a cutscene? I suppose one way that might work is having the AI temporarily take control and just having the character perform a bunch of actions that might either play out o its own, or be timed to the dialogue box (take 3 steps forward, play thinking animation, play shocked animation, play anger animation, run towards other character, play attack animation)

    And I know you answered it on the previous page, but I was wondering if there were any fresh thoughts on the differences between Rex, Corgi and Platformer Pro
     
  45. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Heya, thanks a ton for checking out Rex!

    There's a lot of questions here, so I'll try to get to them all, but feel free to let me know if there's anything I can help clarify at the end of it.

    The quick answer is, Rex can do all of these things. It can do a lot of them out-of-the-box with no scripting; some of them will require minor scripting, but Rex has infrastructure in place to knock that down so you're scripting one or two lines of code instead of the -- *checks source code* -- several thousand it would take to do it from scratch.

    Rex has a bunch of enemy AI out-of-the-box; you can set enemies to move, jump, attack, and a bunch more. What's more, you can set them to only activate when the player (or another actor) is nearby if you want, so your example of having an enemy chase the player when they get near would be super simple. For more complex bosses or multi-phase enemies, you'll probably want to delve into scripting a bit, but Rex will make that easy -- for example, you can give an enemy multiple EnemyAI routines straight from the Inspector, and simply enable and disable them individually whenever you want.

    Rex Engine can display enemy health, yes; every enemy (or NPC, or the player) has a slot in the Inspector where you can drag and drop a health bar for them, and it'll display when that enemy is in the scene.

    Letting the player swap between multiple abilities would be pretty easy, as well; the included demo uses this a few times when the player gains the ability to shoot their Mega Buster projectile, and again when they lose their attacks underwater, and again when they gain the ability to fly and their weapon changes. You'd have to do a small bit of scripting to bind this to a button, but it would be a few lines at best, and I'd be happy to help (as with any of these.)

    For cutscenes, I'd largely just use Unity's built-in animation features -- so, yep, totally doable.

    As far as choosing which engine to use, they all have good things going for them, and it's definitely worth taking the time to explore them fully before you choose. My single biggest focus with Rex is game feel: classic sidescrollers are my lifeblood and my goal with Rex is to help you make something that feels as good as the best professional games in the business.

    I hope that helps! Lemme know if there's anything I can add to that. I hope to see you around more!
     
    Lars-Steenhoff likes this.
  46. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Also, we have Dracula Rex. (And I've got a million more terrible video game puns ready and waiting.)

     
  47. hodgepodge2022

    hodgepodge2022

    Joined:
    Mar 8, 2015
    Posts:
    19
    Oh boy, I can't wait to see mega rex 2, rex island and rextra 3: the bot wars.
     
    BeeZee likes this.
  48. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
    Too bad! You're getting this:

     
    hodgepodge2022 likes this.
  49. hodgepodge2022

    hodgepodge2022

    Joined:
    Mar 8, 2015
    Posts:
    19
    Jokes on you, I liked that game as a kid.
     
    BeeZee likes this.
  50. BeeZee

    BeeZee

    Joined:
    Sep 25, 2012
    Posts:
    657
     
    hodgepodge2022 likes this.