Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

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

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

  1. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    for(int i = 0; i < _target.actions.Count; i ++)
    {
    RexAIActionConditionalSet action = _target.actions;

    string suffix = (action.actions.Count > 1) ? "Conditional" : "Action";
    int numberOfBranches = action.actions.Count;
    string conditionalSuffix = (numberOfBranches > 1) ? " branches" : " branch";
    string eventName = (event.event.Count == 1) ? ": " + event.actions[0].event.GetName() : " (" + numberOfBranches + conditionalSuffix +")";
    string foldoutName = (i + 1) + ": " + suffix + eventName;
    event.isFoldoutActive = EditorGUILayout.Foldout(action.isFoldoutActive, foldoutName);
    if(action.isFoldoutActive)
    {
    EditorGUILayout.BeginVertical(styles.eventBoxStyle);

    action.DrawInspectorGUI();

    EditorGUILayout.EndVertical();

    if(_target.actions.Count > 0)
    {
    DisplayOptionsMenu(i);
    }

    if(i < _target.actions.Count - 1 && _target.actions.Count > 1)
    {
    for(int j = 0; j < action.actions.Count; j ++)
    {
    RexAIEvent.EventType eventType = event.events[j].action.GetEventType();
    if(eventType == RexAIEvent.EventType.ChangeAIRoutine || eventType == RexAIEvent.eventType.ToggleSequence)
    {
    EditorGUILayout.BeginVertical();
    EditorGUILayout.LabelField("WARNING: No Rex AI Actions below this point will execute.", styles.helpTextStyle);
    EditorGUILayout.EndVertical();
    }
    }
    }

    EditorGUILayout.LabelField("");
    }
    }

    what line would i have to edit this to add this to the event field. Im trying to implement a means for a boss or enemy to drop a random amount of health
     
  2. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    I have an enemy that's supposed to in a small group of others like it, but I noticed that they're able to collide with it each other and can't move past one another. Is there a way to fix this?

    EDIT: Further testing shows that this might actually have to do with the Follow Target movement. I set the enemy to Patrol and they do not collide with each other, but I still find it kind of odd. The enemy in question moves around exclusively by jumping (or at least they're supposed to). It seems if they're following their target and said target is in an area they can't get to, like on terrain above them, they just jump in place. What I need for them is to jump forward regardless, but they're also able to turn midair instead of commit to the jump direction.
     
    Last edited: Jul 18, 2020
  3. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    theres prob a way to treat enemies with a tag as a sort of "terrain" layer for the purposes of walls. Tbh i dont need this myself but im just happy after i implemented metroid style missiles
     
  4. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    i have 5 bosses made, currently im working on the first non miniboss boss. Any idea of how to implement permadeath for a boss?
     
  5. hellosimplegame

    hellosimplegame

    Joined:
    Jun 13, 2017
    Posts:
    8
    @BeeZee
    Today I just see it no longer in the store, do you have the plan to support or make a new version of this template?
    Thank you for this awesome template!
    https://assetstore.unity.com/packag...24.254188613.1595219395-2129474917.1588902467

    Edit: I just scroll back and found that the author decides to pull it from the store.
    https://forum.unity.com/threads/rel...platformer-engine.477647/page-33#post-6023513

    Congrats on the job! I wish someday you can have some time and come back to support Rex!
     
    Last edited: Jul 21, 2020
  6. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    i would argue whats best is to reactivate this on the store and simply have the community add new features and fix bugs. My current problem is that i cant seem to combine charged combos and attack sets, its mostly to implement charge shots for about a dozen different weapons but the features work on their own and the (up) button is an alternative

    below is the boss that took my a few hours to make
    upload_2020-7-20_13-42-23.png
     
    Lars-Steenhoff likes this.
  7. thenadamgoes

    thenadamgoes

    Joined:
    Apr 26, 2019
    Posts:
    29
    I agree. Are you allowed to reactivate it and just be very clear in the description that it's unsupported? Or is that against Unity rules?

    I ask because I was about to get some help from someone with my game, but they can't download the asset now to do that. I really don't feel like starting over with something else...
     
  8. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    what kind of game, ive picked the code apart a bit, i can send you my additions, (more tags for power up types) Best part of community project is as long as those using it for a commercial game approve we should make the new additions public
     
  9. Deleted User

    Deleted User

    Guest

    100% agree, I really think that would be the fairest compromise and it looks like a lot of people are thinking the same.
     
  10. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    I have an enemy that supposed to stand in place and attack the player when they get too close, which is working mostly fine for now, but I can't figure out how to get them to turn around if the player manages to get behind them. Right now, it just keeps attacking in the same direction regardless of where the player is. How do I fix that?

    Quick edit: I've been playing around with the AI for a bit and, unless I'm just not understanding it, it seems like any option involving distance doesn't seem to work at all. I've tried adjusting the values for them, but nothing seems to change.
     
    Last edited: Jul 22, 2020
    jeremyfryc likes this.
  11. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    i implemented switches that depend on very specific projectiles one for electric and one for fire only problem is its based on the name
     
  12. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    i need to implement permadeath for bosses, items, blockers and switches. any idea?
     
  13. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    This is something that I have come across as well. Kind of frustrating. Unfortunately, I don't have a solution but I wanted to let you know that I'm in the same boat.

    I did figure out how to create a patrolling enemy do this: face the player when the player comes within a certain distance, and then melee attack at the player. I found that understanding the difference between "Movement", "Event", and "Sequence" helped a lot. I watched @BeeZee 's YouTube videos about enemy AI. Is that something that would help? Would you like to know how I did that?
     
    PhantomFox128 likes this.
  14. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    I actually tend to rewatch those whenever I need to add something, but yeah, a solution would be nice. I've already tried a handful of things including giving the enemy a Follow Target movement but then setting their movement to nothing, but I haven't gotten it to work properly yet...
     
  15. MrJump

    MrJump

    Joined:
    Feb 1, 2018
    Posts:
    3
    I can't find the rex engine on the asset store, is it going through an update?
     
  16. BorisCerdan

    BorisCerdan

    Joined:
    Jun 3, 2020
    Posts:
    17
    Hey guys! I'm having a little issue with my melee attacks, they seem to randomly hit the enemy twice ? I really don't get why, tried to play around with the inspector but nothing seems to resolve this. I'm using a Combo Chain, but even a single attack triggers damage to the enemy twice. Only one animation would display, but on the enemy's side we see (and hear) two hits. Anything I might have overlooked in the inspector ?
     
  17. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    its intended this is why some enemies have invincibility frames. Also ive figured out a solution to the above at least in theory. You have to make it so the enemies treat each other was a wall upon collision with another. ive been working on my own game so its been a bit busy here . This is what i have so far upload_2020-7-24_14-48-15.png
     
  18. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Hey sorry about the delay. Busy days, but I wanted to record something to help you out. Check out the video here to see how I got AI Enemy to work when the Player comes within a certain distance. Hope it helps!

    https://www.loom.com/share/e8558f19a9bd4fbfb6cb44aaad6f9da2
     
  19. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Hey, good question -- I had this issue with a melee attack myself, and I found that it's because the attack collider was lingering over two many animation frames. I made it so that the collider only occurs on one animation frame and this solved my issue. You can see my solution to adjusting the collider using the animation properties here:

    https://forum.unity.com/threads/rel...platformer-engine.477647/page-34#post-6061910

    Hope it helps. Let me know if you're still stuck.
     
    Bagnol and BorisCerdan like this.
  20. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Good question -- @BeeZee , creator of the Rex-Engine asset, has decided to stop supporting the asset. Understandably, he got a great new job, but just doesn't have the time to support and update the asset, so he removed it from the store. The forum here is still up and those that have purchased it can continue to use it, but for the time being, it seems RexEngine production has stopped. Please take a look at his post here:

    https://forum.unity.com/threads/rel...platformer-engine.477647/page-33#post-6023513
     
    Bagnol likes this.
  21. BorisCerdan

    BorisCerdan

    Joined:
    Jun 3, 2020
    Posts:
    17
    Like always, a clear and very helpful response ! Thank you so much Jeremy ! :)
     
    jeremyfryc likes this.
  22. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    starting boss #9 upload_2020-7-26_19-56-15.png Jerry you got any idea how to implement how to implement saving and permadeath for bosses?
     
    Last edited: Jul 27, 2020
  23. HeadfireStudio

    HeadfireStudio

    Joined:
    Jul 10, 2020
    Posts:
    4
    can someone send me a rex engine I can't buy it but I really need it
     
  24. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    @ConstantineFrad This will depend on how you're doing your saving and loading (PlayerPrefs, EasySave etc.), as well as how you're handling your boss spawning and level logic. The DataManager is a good start either way - toggling a custom "hasBeatenBoss1" bool when Boss1 has been defeated, then when re-entering the room in the future, have the boss either disabled or not spawned in the first place if the bool has been toggled. Then you can save and load that bool value with PlayerPrefs or your third party solution. Unfortunately it's difficult to give a global answer - for example the included Boss demo scene has the boss placed in the scene by default, but I spawn my bosses dynamically which would make the process different.
     
  25. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    @Skrylex I don't think we're allowed to do that unfortunately. The developer hasn't mentioned anything yet about making it available. A few people have requested for it to be released as open source but we're not sure.
     
  26. HCrowley

    HCrowley

    Joined:
    Oct 16, 2013
    Posts:
    41
    I've not been working on any of my Rex-based projects for a fair while, so it was a bit of a disappointment recently to go into My Assets and see that it had been deprecated

    However, as a long time Unity user I've seen this happen a lot over the years, so it didn't come as a great big OMFG shock or anything

    When something like this happens there are always likely to be some losers (I've been one in the past), and @BeeZee has been honest and upfront about the reason for abandoning it, so I'd like to wish him good luck for the future

    It looks like he'll be popping in here from time to time anyway, and it seems like there's going to be ongoing support from within the user community too. Rex is a solid system even without any further development, and I reckon it should be viable for a few years yet
     
  27. HeadfireStudio

    HeadfireStudio

    Joined:
    Jul 10, 2020
    Posts:
    4
    it disappeared just when I wanted to buy it
     
  28. HeadfireStudio

    HeadfireStudio

    Joined:
    Jul 10, 2020
    Posts:
    4
    why couldn't it just be left in the store
     
  29. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,470
    Because then it would not be supported, and would damage the publishers reputation. It would receive many 1 star reviews because of this.

    It would be nice if it became open source so the users could continue with support.
     
  30. HeadfireStudio

    HeadfireStudio

    Joined:
    Jul 10, 2020
    Posts:
    4
    I don't know what to do now I'm very upset
     
  31. thenadamgoes

    thenadamgoes

    Joined:
    Apr 26, 2019
    Posts:
    29
    This is probably going to be a pretty dumb and basic question and I'm still learning unity...but how do you import sprites at the right size?

    So I'm targeting 4K for the game resolution. So I make the background image 3840 x 2160. So it should fit perfectly in a basic room set up. But it's way too big. I have to set the ppu to 140 to get it even close. I have the image max size set to 4096.

    I'm even more confused cause the demo BG is 340 x 192. with a PPU of 12. So that would be 4080x2304 image - slightly bigger than the screen size.

    Am I just completely misunderstanding how this works?
     
  32. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    welp finished beta of another area upload_2020-7-30_0-0-45.png
     
  33. jeremyfryc

    jeremyfryc

    Joined:
    Mar 11, 2014
    Posts:
    95
    Hello! It's not a dumb question at all -- it can be confusing at first, since the solution is quite simple and not obvious to a newbie. I was equally confused years ago when I started using Unity. Let's get to it. Here are the things you need to know:
    • Importing Sprites: you don't need to change or adjust any input settings. Just drag and drop your sprites into a project folder. As a suggestion/tip -- make sure you have a naming convention pattern that you understand and follow. I do something like this "Player_Run_1 Player_Run_2..." or "Player_Jump_1"... or "Scene1_BG_Terrain_1"... you know, it can get pretty messy. ood to decide on a naming pattern and place all those assets in folders accordingly. Do what works for you!
    • Sprite Resolution: First of all, if you want to compress your images (which you absolutely should for performance issues; use "Crunch Compression"), all your sprites should have pixel height and width divisible by 4. You can't compress a sprite if its dimensions are not divisible by 4. So, 204x480 is divisible by 4, but 203x479 is not. You'd have to add a few transparent pixels when exporting your image from photoshop or whatever. Now, compression sizes are 1024, 2048, 4096... something like that. Anyways, you probably don't want to use images that are 3840 x 2160 because then you'd have to use compression for 4096. The issue is that some devices won't even render a 4096 sprite and then your game won't work. I would cut that image into 4 pieces of 1920 x 1080 and import those images into your project folder. Compress each image using 2048 Crunch Compression (which any device can render). Then you can assemble those sprites in the Scene. The player won't know the difference, your game will run faster and on more devices, and it'll look WAY crisper.
    • Changing the PPU: For most games, you never even need to adjust the PPU. Leave it at 100. Why? Well, this means that one Scene Unit will be 100 pixels by 100 pixels. If your game is not really set up on a grid (like Rayman or Hollow Knight) there's no reason to think in terms of "the grid". Just place things where they should be in the scene. However, if your character is 1 Unit high/wide and you have blocks or assets that scale to specific unit heights/widths (like Mario, Megaman, Sonic), then you want EVERY SINGLE SPRITE to have the same PPU. So, if your character is like 32 pixels tall (give or take a pixel for aesthetics), you'll want the unit to be 32 by 32 (PPU 32). Why? Game feel. The player needs to understand what they can and cannot do. They will unconsciously know "the player can jump 3 units high and about 10 units if I run". Again, they don't KNOW they know this, but the visuals of the game are communicating the rules you set in place.
    • But I can't see the entire background image!: Well, if you are using RexEngine and your images are large, this is because the Camera is set to smaller pixel height and width, basically it's set up for pixel art. You can adjust this though. In the project folder search for "Camera" and open the Camera Prefab (little blue box). You'll want to adjust EACH camera to suit your game (Main Camera, Foreground, Mid-ground, Background...). You can adjust these settings temporarily in real time. Do this; "Play" the game without Maximizing the Gameplay window. Then in the Scene Hierarchy, open where it says "Don't Destroy on Load" and find the Camera Prefab that is pulled into the Scene upon runtime. Adjust the settings there until you have what you want. Right them down somewhere, because adjusting these settings while you play doesn't save them. Then, go back to the prefab and change those settings. Press Play again and you should be in business.
    I hope this helps. It's a lot of information. Play around with everything. Literally everything. Make a duplicate of your project and just play with settings like you don't care. Don't worry, you can't break anything. Just experiment until you learn more about what you can and cannot do. Anyways, hope it works out. Let me know if you have any questions.
     
  34. I_hope_Unity_DIES

    I_hope_Unity_DIES

    Joined:
    Dec 7, 2016
    Posts:
    38
    Just noticed Rex has been deprecated from the UAS. Hope everything is ok.
     
  35. vizard00

    vizard00

    Joined:
    Feb 10, 2017
    Posts:
    13
    Any idea how to make Springs Bounce diagonally or any angle like in sonic!?
     
  36. countfts

    countfts

    Joined:
    Sep 19, 2015
    Posts:
    3
    Great Asset ! I know that its discontinued --too bad but so honest since it wont be updated anymore. Anyhow ..how can i use switch button to lets say start an elevator -tried world action call function with is movement enabled of elevator platfom it didnt work. I know its too much to ask but since it isn't in the market any more but another video about switch button on youtube would be wonderful to exist.
     
  37. OscarLeif

    OscarLeif

    Joined:
    Jul 17, 2016
    Posts:
    68
    The Author already explain what happen on previous post.
     
  38. thenadamgoes

    thenadamgoes

    Joined:
    Apr 26, 2019
    Posts:
    29
    Thank you so much for this detailed response. It's been incredibly helpful!

    I think my dream was that I could draw out all the graphics in photoshop at 4k, and then export the sprites to their relative size and not have to worry about scaling them when I import them. I think I just need to experiment more to gegt to that point.
     
  39. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    Hey so I know this asset is no longer supported technically but I was wondering if anyone would be willing to help me with this error message.


    NullReferenceException: Object reference not set to an instance of an object
    RexEngine.ScoreManager.UpdateDisplay () (at Assets/RexEngine/Scripts/RexEngine/_Managers/ScoreManager.cs:88)
    RexEngine.ScoreManager.Start () (at Assets/RexEngine/Scripts/RexEngine/_Managers/ScoreManager.cs:45)



    Not sure what is causing it. I am perfectly okay removing the score system entirely as I have no intention of using any of the rex engine UI if I could figure out how to do that.
     
  40. OscarLeif

    OscarLeif

    Joined:
    Jul 17, 2016
    Posts:
    68
    Maybe your singleton prefab have missing references.
     
  41. Tom_Bombadil_

    Tom_Bombadil_

    Joined:
    Aug 6, 2018
    Posts:
    46
    It seems in an effort to disable to score system I broke something. I was able to resolve the issue by re-enabling it and removing it another way.
     
  42. countfts

    countfts

    Joined:
    Sep 19, 2015
    Posts:
    3
    I want to be able to use the switch button - to enable disable an elevator movement . Call function on script asks a method .. any way to use switch button to enable /disable scripts on game-objects other than player? a youtube video would be a blessing
     
  43. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    i have made code to allow the switch to be able to use a specific projectile to work, hmm perhaps one could make a separate switch that occupies the same space that is enabled by the first. That could work. i have a similar issue myself to this but i have other things to implement for my game so im delaying it for now. one could enable one by disabling the other hmmm
     
  44. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    Im trying to implement a gimic where the player changes color based on the weapon they have selected, any idea how to implement something like this?, in addition toggling buttons would be nice as well. My game is going pretty well with how much i have done im almost ready to call it an "alpha" . The only remaining areas i have to make are, "the river", the frozen caverns (which will be in the center of the river area as well as "the abyss" there are some slight overlaps on the map, namely with hollow knight style entrances into rooms. In the beta i am going to add more rooms to the following areas; the green caverns (olivine mines), the pink areas (quartzite goldmines), A leftward expansion on the town area in the center left of the map, more rooms in the upper cliffs. With this expansion plan the final area "the pit" will be far more leftward on the map upload_2020-8-8_0-59-55.png
     
  45. clammy2017

    clammy2017

    Joined:
    Feb 21, 2018
    Posts:
    27
    "Im trying to implement a gimic where the player changes color based on the weapon they have selected, any idea how to implement something like this?, "

    What specifically do you want help with?

    (I can see why the author of this quit now)
     
  46. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    @ConstantineFrad Not without some coding I'm afraid. It'd probably be best integrated into the way you switch weapons. Even then, I believe each animation frame will reset the sprite's colour which makes things tricky. I believe people have posted solutions on the forum somewhere but aside from that, one of the 2D Sprite Shader assets with a Hue Shift shader might be another way to go.
     
  47. vizard00

    vizard00

    Joined:
    Feb 10, 2017
    Posts:
    13
    thank you
     
  48. skinny_

    skinny_

    Joined:
    Feb 3, 2018
    Posts:
    6
    Hi @BeeZee,

    I’ve just integrated InControl in Rex Engine, that was really easy to do

    I use multiple controllers of the same type and I didn’t find, if there is any inbuilt solution in Rex Engine for the query of an indexed device? If there is not, what is the best practice to do it?

    Thanks in advance.
     
  49. ShirohelmDev

    ShirohelmDev

    Joined:
    Jun 26, 2019
    Posts:
    32
    like i always say i would like to take over the development of this engine as a sort of community project namely whatever holes i need to fill for a metroidvania game i would like to work out a solution for it for my next project to be a bit better

    -hollow knight style markets
    -metroid prime 2 style keys
    -grappling hooks
    -ice that isnt slippery just on the top layer because this is actually how it is
    -hybrid attacks im sure are possible already with a little fixing
    switches and buttons that are toggles not just a permanent on and off
    -more detail on using multiple controllers for the same enemy
    -maps, and checkpoints that are more dynamic like hollow knight benches
    -a hollow knight style item equipment menu

    I want to turn this into a dedicated metroidvania engine upload_2020-8-14_16-21-41.png
     
  50. BorisCerdan

    BorisCerdan

    Joined:
    Jun 3, 2020
    Posts:
    17
    Hey guys ! I haven't been around in a while as I was working on something very important...

    My project, Aeternum Vale is going live on Kickstarter today ! :D

    I would really love your feedback on the Kickstarter page as well as the trailer, and of course, if you feel like sharing the campaign to your fellow gamer & game dev friends, that would be truly amazing !

    Here is the page : https://www.kickstarter.com/projects/boriscerdan/aeternum-vale
    And the trailer :