Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v8.0 : advanced damage system]

Discussion in 'Assets and Asset Store' started by reuno, Dec 18, 2014.

  1. shyamlondonconsolidated

    shyamlondonconsolidated

    Joined:
    Apr 1, 2018
    Posts:
    36

    I have added that function into my script as well as onEnable and disable like so;

    Code (CSharp):
    1.      
    2.     public class ScoreManager : PersistentSingleton<ScoreManager>, MMEventListener<CorgiEngineEvent>
    3.  
    4. /// OnDisable, we start listening to events.
    5.         protected virtual void OnEnable()
    6.         {
    7.             this.MMEventStartListening<CorgiEngineEvent>();
    8.             TimedRewards.GetInstance().onClaimPrize += OnClaimPrizeTimedRewards;
    9.         }
    10.  
    11.         /// OnDisable, we stop listening to events.
    12.         protected virtual void OnDisable()
    13.         {
    14.             this.MMEventStopListening<CorgiEngineEvent>();
    15.             TimedRewards.GetInstance().onClaimPrize -= OnClaimPrizeTimedRewards;
    16.         }
    17.  
    18.  
    19.         public virtual void OnMMEvent(CorgiEngineEvent corgiEngineEvent)
    20.         {
    21.             if (corgiEngineEvent.EventType == CorgiEngineEventTypes.PlayerDeath)
    22.  
    23.             {
    24.                 Debug.Log("player died");
    25.  
    26.             }
    27.  
    28.         }
    29.  
    However when the player dies by the KillPlayerOnTouch, I am not getting the Debug.Log player died?
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @m039 > That's normal, you'd need mid height one way platforms to handle this scenario (they're in the asset, check out the documentation, and use the support email if it doesn't work). Scale has nothing to do with it by the way :)
    @shyamlondonconsolidated > I can't guess why your code doesn't work, maybe you didn't add it to your scene properly, maybe it's something else (from what I see it seems ok code wise). The event gets fired properly, and you can see that in the classes that listen to it. Do a fresh install, die, and you'll get an achievement for it (Death is only the beginning). This is triggered via the AchievementRules class, that listens to this very event.
     
  3. pharaway

    pharaway

    Joined:
    Nov 30, 2018
    Posts:
    6
    quick question: I want to completely kill gravity for everyone all at once. How would I do that? Not trying to change the direction like with zones or anything, just set it to zero. Sorry if this is an extremely obvious question, just can't seem to find the answer.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @russelleray100 > Go through all characters and set their controller's gravity value to zero.
     
  5. pharaway

    pharaway

    Joined:
    Nov 30, 2018
    Posts:
    6
    Yep, I'm blind. I found it. Thanks for the quick response.
     
    reuno likes this.
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  7. GodsonTM

    GodsonTM

    Joined:
    Apr 6, 2018
    Posts:
    6
    I'm not exactly sure if this is intentional (nor if this has a "fix"), but when I'm testing my game (using mario as a test cause I don't have any other sprites to use at the moment) and making sure all the animations work properly, I noticed there's one frame where the game says it's jumping, but also grounded. (The white texture is a testing platform, but you can see the raycasts reaching far enough to touch them.)

    upload_2018-12-1_2-9-14.png

    Because of this, I find instances of the animation failing to transition to Jump (because for one frame, the animation switches to crouching and has no transition to jump), though I managed to fix that specifically by adding extra conditions to crouch.

    upload_2018-12-1_2-17-45.png

    I figured I'd make note of this as I'm not entirely sure if this is indeed intentional or not, and if there was a way I could prevent the character from being both grounded and jumping (even if it is for one frame).
     
    Last edited: Dec 1, 2018
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Kektastic > That is because at this exact frame you are indeed jumping and grounded, that's by design, and I wouldn't recommend changing it (although it can of course be done by extending the CharacterJump ability).
    You'll indeed need more conditions, as you did, that's the solution :)
     
  9. carolinemariast77

    carolinemariast77

    Joined:
    Nov 24, 2018
    Posts:
    5
    Sorry my english and my stupid question! AM am a very very beginnner.
    When player die automatically respawn at check point now.
    I want when player die to see an intermediate screen (where to put many, many advertisements :).

    sorry again!
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @carolinemariast77 > One way to do that would be to listen to the PlayerDeath event and display your intermediate screen on death. Or you could extend the LevelManager to implement that there.
     
  11. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @reuno A little request: Add volume and FX slidders on the Start Screen settings pop-up, or an example on the MMInterface sample scenes.
     
  12. carolinemariast77

    carolinemariast77

    Joined:
    Nov 24, 2018
    Posts:
    5
    My Last Stupid Question! And my english!

    I have 3 scene(No level selection). My player finish 1st scene, now is in scene 2. When restart the game from Start Screen (Start Screen Script) and hit Play, my player begin from First Scene.
    I want my player to start where he's left (Scene 2).
    How do I do that? It is Hard?
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Muppo > Sliders would be nice indeed, I'll add that to the todo list!
    @carolinemariast77 > How hard something is depends on your skills, not mine, I can't answer that for you. What I can tell you though is that the Corgi Engine comes with examples of progress save. You can look at the documentation to learn more about it, and at the RetroAdventure demo scenes for an example of it in action.
     
  14. ZayLong

    ZayLong

    Joined:
    Jun 2, 2013
    Posts:
    33
    @reuno

    Loving the framework, Had a design pattern/best practices question.

    What's the preferred way to add additional gauges/bars?

    On one hand, the health bar/ammo display is updated/bound to a player via the GUIManager

    but on the other hand, you have the MMHealthBar that seems to do the same thing in a self-contained script, though I do notice only enemies have it; Seems it would work just as well for a player.

    Say I wanted to add a stamina gauge or something. (like in beath of the wild)

    Should I just extend the GUIManager to update this bar and add an UpdateStaminaBar, as there is an UpdateHealthBar?
    Or should I just extend/copy the MMHealthBar script?

    The framework as a whole is pretty agnostic, but there's intent with how this is handled and I kinda want to stick with the established design paradigm.
     
    reuno likes this.
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @ZayLong > Good question!
    So you're absolutely right, the MMHealthBar would work just as well for the player. The only reason it's done as it is right now is to show more than one way to do things, so now you have options :)
    Behind the MMHealthBar, that specifically works for health is the MMProgressBar class. This one is quite easy to use, you just have to call a one liner method to update it (at update, once when the value changes, it's up to you). If you were to create a gauge for this, that's how I'd do it. Extending the GUIManager would be one way to update it, another would be to create an additional GUIManager that only handles your own stuff, might make things easier, and it won't have any significant impact on performance.
     
    ZayLong likes this.
  16. SkyMan77

    SkyMan77

    Joined:
    Jan 15, 2018
    Posts:
    23
    Hi, i'm thinking about making a Sonic fangame, and i ended up thinking that your Engine might help. However, will it work, with curves and loops?

    Thanks for reading.
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @SkyMan77 > While it's certainly doable, it doesn't have loops, and is generally aimed at a tighter gameplay style than Sonic. So really I'd say the answer depends on your programming skills :)
     
  18. DoenitZ

    DoenitZ

    Joined:
    Oct 23, 2012
    Posts:
    16
    Hi everyone! Question, has anyone faced something like this?

    I had just bought the asset, to do some experiments, and I am facing this problem right out of the box, can't even add a simple weapon because of this...
    I have tried playing with the handles, checked the IK code to see if there was something weird there that is causing this behavior, also tried a simple IK script on my model to be 100% sure that it's not something that the model has.
    Also noted that the weapon itself, has a continuous transform rotation, coming maybe from the aim script, but unsure for now. If this is something that someone else faced, and have some insights, I will appreciate it

    Thank you all!
    Besides this little thing (that is probably my fault anyway), great asset!
     

    Attached Files:

  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @DoenitZ > Does the problem happen on any of the demo characters? If yes, where? If not, have you tried comparing with them? If the problem persists please use the support email and provide more info.
     
  20. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    29
  21. DoenitZ

    DoenitZ

    Joined:
    Oct 23, 2012
    Posts:
    16
    @reuno > Thank you for the quick reply. I've just sent you a message through the contact section on your site. Let me know if I can send you something else to solve the issue.
    At the moment this only happens on my models (I've tried several, same issue all the time, weapon spinning out of control)
    I've seen that some people here fixed it by moving the handles, but that didn't happen on my end, it just keeps spinning out of control. Also if I disable the IK, the weapon on the idle state points at 90 degree in the Z axis, while when moving, it points correctly where it should.
    Anyway, hope this gives more insight on the issue
    Thank you again!
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @DoenitZ > I've answered you via email already :)
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    I'm happy to announce that the upcoming new version will include the most requested feature ever, and by far, of these past 4 years :

     
    Meowx, NathanG, Havok_ZA and 7 others like this.
  24. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    17
    Ledge grab!
     
    reuno likes this.
  25. skayster

    skayster

    Joined:
    Aug 12, 2017
    Posts:
    46
    Noooooo way! <3<3<3<3<3
     
    reuno likes this.
  26. steelhamsterstudio

    steelhamsterstudio

    Joined:
    Mar 15, 2018
    Posts:
    29
    It's awesome news. I can't wait to start tasting new features!
     
    reuno likes this.
  27. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    *tries hard to not surrender and update the engine to 5.3*

    Just kidding, waiting to see the new stuff as anyone!
     
    reuno likes this.
  28. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Can you please clarify what the "Enabled" boolean on each pool element does/means on the Multiple Object Pooler? IE: does it mean that element is inactive if unchecked? Thanks in advance mmmultiplepooler.png
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Boom_Shaka > An enabled object can be pooled, otherwise it can't.
     
    Boom_Shaka likes this.
  30. vitomoroz

    vitomoroz

    Joined:
    Nov 19, 2018
    Posts:
    2
    I faced the same issue with boxes not being able to be pushed or pulled at all. But I don't see any relation to prefab stuff. My playable character succesfully links to a pushable object, when it comes close enough. But then nothing happens. So I spend some time debugging and that's what I found out.

    Pushable object takes a force instantly from a pusher. But this property is zeroed every frame by CorgiController, so the force equals to zero unless MovementBehavior is processed. That's why this bug happens, when Unity calls Pushable.Update() before Character.Update().

    Hope this will help to fix this issue in a next version.
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @vitomoroz > Thanks for your feedback! As I told the original poster, this has already been fixed and the fix will be included in the upcoming v5.3 :)
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    I'm glad you all like the upcoming ledge climb. Here's more of it.

     
    steelhamsterstudio, gurayg and TonyLi like this.
  33. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    That retro corgi looks really cute.
    Can you tell us more about the other new features?
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Muppo > Not many other new features for 5.3, but a lot of bugfixes and a few enhancements. I'll post the changelog as soon as it's ready (it's in beta right now).
     
  35. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    WHat's the way to display current lives in the hud ?
     
  36. vitomoroz

    vitomoroz

    Joined:
    Nov 19, 2018
    Posts:
    2
    Thanks for your reply! Great support quality :)

    By the way, I have another question about pushable stuff. I know Corgi is not a physics based engine, but it looks like with new pushable implementation in 5.2 (Pushable + CharacterPushCorgiController) colliding with objects with the same layer is now needed.

    Most common use case for Pushable is for crates. But it's not trivial to make two or more crates to collide that way.

    What do you think about this? Maybe it's planned for future releases?
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @shredingskin > You can see an example of it in action in the RetroAdventure demo scenes. It's handled through the GUIManager if that was your question.
    @vitomoroz > It's planned indeed, but low priority right now (trying to stick to the initial promise). I have plans to add a more physics based alternative at some point, and this kind of interaction would fall under that umbrella.
     
  38. steelhamsterstudio

    steelhamsterstudio

    Joined:
    Mar 15, 2018
    Posts:
    29
    I think I will make a simple and short cute adventure game when 5.3 will release and I already have a few ideas for it ;-).
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  40. Pikkukala

    Pikkukala

    Joined:
    Apr 17, 2013
    Posts:
    5
    Hello and congratulations for the Corgi Engine. I have been enjoying it a lot, but recently run into a problem with the Inventory engine. I get the error below when loading a saved inventory:
    The inventories in the rouge-like demo work fine until I reset them.
    Could it be a filesystem permission related problem?
    Using Unity 2018.2.19.1f on Mac.
    Sorry if this is too basic or has been solved before. Thanks!


    NullReferenceException: Object reference not set to an instance of an object
    MoreMountains.InventoryEngine.Inventory.ExtractSerializedInventory (MoreMountains.InventoryEngine.SerializedInventory serializedInventory) (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:447)
    MoreMountains.InventoryEngine.Inventory.LoadSavedInventory () (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:400)
    MoreMountains.InventoryEngine.Inventory.OnMMEvent (MMGameEvent gameEvent) (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:686)
    MoreMountains.Tools.MMEventManager.TriggerEvent[MMGameEvent] (MMGameEvent newEvent) (at Assets/CorgiEngine/ThirdParty/MMTools/Events/MMEventManager.cs:176)
    MoreMountains.Tools.MMGameEvent.Trigger (System.String newName) (at Assets/CorgiEngine/ThirdParty/MMTools/Events/MMEventManager.cs:28)
    MoreMountains.InventoryEngine.InventoryDemoGameManager.Start () (at Assets/CorgiEngine/ThirdParty/InventoryEngine/Demos/PixelRogue/Scripts/InventoryDemoGameManager.cs:25)
     
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Pikkukala > It could be a permission thing, hard to tell without context. If it was working before, I'd assume you've changed something? A first test would be to install a fresh instance of the engine, and see if the problem persists (it shouldn't). If it does, please send me more info on the support email, thanks.
     
    Pikkukala likes this.
  42. Pikkukala

    Pikkukala

    Joined:
    Apr 17, 2013
    Posts:
    5
    Thanks. Will do!
     
  43. carolinemariast77

    carolinemariast77

    Joined:
    Nov 24, 2018
    Posts:
    5
    Any New Inventory Items destroy my inventory!
    For example:


    Update:
    Work Only if items are in Resources Folder!
     
    Last edited: Dec 12, 2018
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @carolinemariast77 > Yes, as explained in the documentation, you need your items' scriptable object instances in a Resources folder, that's the only way Unity can load them at runtime (just like most scriptable objects).
     
    carolinemariast77 likes this.
  45. eiannell

    eiannell

    Joined:
    Jul 2, 2017
    Posts:
    1
    Having same issue. Decided to just Truncate to 4 decimal places using:


    public static float Truncate(this float value, int digits)
    {
    double mult = Math.Pow(10.0, digits);
    double result = Math.Truncate( mult * value ) / mult;
    return (float) result;
    }
     
  46. shyamlondonconsolidated

    shyamlondonconsolidated

    Joined:
    Apr 1, 2018
    Posts:
    36
    Hi Reuno,

    I have kind of got my scoremanager to work by listening to a playerdeath event;

    Code (CSharp):
    1.         public virtual void OnMMEvent(CorgiEngineEvent corgiEngineEvent)
    2.         {
    3.             switch (corgiEngineEvent.EventType)
    4.             {
    5.                 case CorgiEngineEventTypes.PlayerDeath:
    6.                     DBManager.IncreaseFunds("coins", totalScore);
    7.                     Debug.Log("player dieded");
    8.                     SaveHighScore();
    9.                     break;
    10.             }
    11.         }
    I have integrated the corgi engine with Simple IAP which if the player dies, the function
    Code (CSharp):
    1.  DBManager.IncreaseFunds("coins", totalScore);  // increases my virtual currency by totalScore.
    However something strange is happening ;

    1) Gameover Splash pops up when the player dies. When I restart the level, the currency instead of 2coins, it increases to 4coins.

    1) Gameover Splash pops up when the player dies. If I try going to another IAP splash menu, then close, then my coins increase to 4coins, then go to IAP splash again, then close again, my coins increase to 6coins (The IAP splash has a pause function which unpauses when closed and returned to the gameover splash)

    I dont have any other
    Code (CSharp):
    1. DBManager.IncreaseFunds("coins", totalScore);
    anywhere in any scripts within my game, so I believe something is happening in my player death listening events which is triggering multiple increasefunds

    Do you think its the playerdeath listening event? Its switching, causing an increase in coins?

    Any help would greatly be appreciated.

    Kind Regards,

    shyam
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @eiannell > It's a good solution, although that bug should be fixed already. What version are you running?
    @shyamlondonconsolidated > There's only one time the PlayerDeath event gets triggered, it's when the player dies. If I were you I'd start debugging to figure out exactly what's happening in your code, that's the only way to understand the problem.
     
  48. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    71
    Good day. Is there a sample implementation on how to add an option to modify control configuration in-game? I was planning to make one but then upon searching online, there's no way to add/modify entries in the InputSettings via script (which is what the InputManager of CorgiEngine is using). Any suggestions on how to do this? Thank you very much. :)
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @ironfiftynine > No, there's no implementation for that right now. You'd have to add a layer in between (or extend the InputManager, or use an asset dedicated to that, I think Rewired and InControl do that and both support the Corgi Engine).
     
    ironfiftynine likes this.
  50. RobertCom

    RobertCom

    Joined:
    Dec 9, 2018
    Posts:
    12
    I have ordered your top down engine some days before and paid no taxes (with a tax number); today i tried to buy your corgi engine and the system wants the tax. So i have not sent any money. Seems there is no way to contact unity to delete the order from my card now?!