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. alKaszL

    alKaszL

    Joined:
    Jan 26, 2013
    Posts:
    8
    Recently bought the asset and I am quite impressed with how easy it to to customize out of the box. I am tinkering with an idea for a game which involves a character control similar to the classic "Asteroids". Essentially, I would like to disable gravity (I have done this in a test with the Corgi engine), be able to apply jet pack force from any direction (untested), and have the ability to continue moving after the thrust is released from the initial force of the jet pack. I would like to be able to control the damping of the motion as well (think a hockey puck sliding on ice). I would love to have this specific mechanic integrated into the feature set of the Corgi engine. I figure there is nothing directly out of the box that satisfies this requirement, but is it possible to use the Corgi engine's physics engine to achieve this game mechanic? I am a C# developer by trade so I don't mind digging into the code and extending functionality. Thanks.
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @alKaszL > Technically everything is possible, but turning a platformer engine into an Asteroids game seems a bit of a weird tech choice if you ask me. It'd be much easier to do that with the TopDown Engine, seeing as Asteroids is a top down game (https://topdown-engine.moremountains.com/).
     
    alKaszL likes this.
  3. macish

    macish

    Joined:
    Oct 29, 2018
    Posts:
    55
    Thank u reuno, this is highly appreciated! And you are right, its super simple, after one understands how things are set up. So its Character Abililty -> Individual Ability and therefore there was no PermitAbility declared inside the individual ability itself. I get it now and again thank you very much!

    I just drop a link to your API Documentation here if somebody else wants to modify your script further. https://corgi-engine-docs.moremount...s_1_1_corgi_engine_1_1_character_ability.html

    thnx again! :D :thumbs_up:
     
    Last edited: Mar 12, 2019
    reuno likes this.
  4. alKaszL

    alKaszL

    Joined:
    Jan 26, 2013
    Posts:
    8

    Thanks for the response. It is more that I want to have a part of the game use this type of mechanic in small sequences and then switch back to platforming. I will look into how I can achieve this and look into the TopDown engine as well :)
     
    Betzalel likes this.
  5. user547532163967

    user547532163967

    Joined:
    Jan 18, 2019
    Posts:
    3
    Hello Everyone I dont know why but my player cant stomp an enemy even the bulkydude i think i miss somthing important but what ? if someone can help me it would be great thank you again.
     
  6. Quinn221

    Quinn221

    Joined:
    Oct 16, 2017
    Posts:
    22
    @MadZack Do you have the stompable script set up on the enemy?
     
  7. user547532163967

    user547532163967

    Joined:
    Jan 18, 2019
    Posts:
    3
    yeah am using the bulkydude for testing but like i say no result :/
     
    Last edited: Mar 12, 2019
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @MadZack > does the problem happen with the demos as well (mesa1) for example? Please use the support email if the problem persists, I'll need more info to help.
     
  9. user547532163967

    user547532163967

    Joined:
    Jan 18, 2019
    Posts:
    3
    its working on your demo scene but in my scene nothing happen am taking the bulkydude for testing it but nothing happen like a sayed i think my player setup is wrong maybe i dont know.
     
    Last edited: Mar 12, 2019
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @MadZack > As I said, please use the support email, I'll need more details, thanks!
     
  11. Betzalel

    Betzalel

    Joined:
    Dec 3, 2017
    Posts:
    22
    Hey @alKaszL ive also been trying to integrate a sort of 'mini game' level where one can have a top down asteroids type flying mode then to return to a platformer. I haven't come up with a working solution yet but would be happy to share once i do. on that note i have a question for you @reuno ... is the topdown engine compatible with the corgi engine in the same project? im assuming they arent since it looks like the topdown has more physics active components? if they arent is there a way to disable one for one scene and activate another for the next? i know that might sound like overkill for what im trying but just curious for other reasons as well... i like the idea of mixing the two genres.
     
  12. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Have you tried extending the character fly ability? I think that would probably be the best way to simulate the movement physics you're talking about and the "always flying" boolean would allow you to bypass Corgi's gravity effects.

    You might also have to use a dedicated scene that simulates a "top-down" view -- not sure how you'd be able to switch to/from it and a traditional platformer in the same scene.
     
    alKaszL likes this.
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Boom_Shaka > I would also recommend using a dedicated scene (or at least controller for that). It's gonna be much faster and easier to manage in the long run. I believe in picking the right tool for the right job and a platformer controller is not the right solution for a top down game. Both genres share pretty much no core mechanics when you dive into the details of the gameplay. That's the whole reason behind the TopDown Engine being a different thing.
     
    alKaszL and Boom_Shaka like this.
  14. NEHWind2

    NEHWind2

    Joined:
    Jan 7, 2016
    Posts:
    31
    @reuno

    Hi again! I'm back with another probably silly question!
    I'm looking to include two modes in my game, Stage Mode and Standard Mode.
    Standard Mode gives the player three lives before the Game Over scene sends them back to the main menu.
    Stage Mode gives the player unlimited lives and they can play until they win the stage or decide to quit.

    Either one is easy to set up but I'm having trouble featuring both since the Game Manager from any previous scene is carried over into the next which brings in the maximum/current lives settings from that previous scene. If the first scene of Standard Mode could force the max/current lives to 3 and ignore what came before, or if the Stage Mode level select scene could force the max/current lives to 0, I'd be set.

    I'm probably not explaining this well, but is there a way to make the game drop the previous scene's Game Manager (or just the settings about player lives) and instead use the one in the scene being loaded?

    Thanks!!
     
  15. BlastingGamesSL

    BlastingGamesSL

    Joined:
    Jul 24, 2017
    Posts:
    8
    Thanks! that solution worked perfectly to play a sound when landing :)
    Now I'm struggling with other issues... I'm trying to use the HitTheGround variable to also trigger a landing animation, but it doesn't play. I see that the boolean only becomes true for a frame and then it comes false and the Animator goes back to Idle, could that be the problem?
    Also I can't find how to modify the falling velocity of the Player. Right now it falls too quick and it seems to allways have the same falling speed. That looks really nice for cartoon graphics, but would it be possible to make it fall slower and to gradually accelerate? (nothing fancy, if the character takes "just a second" before start falling at the full current speed that would work)
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @NEHWind2 > I'm not sure I understand what's preventing you right now to have a class in your scene call the GameManager's methods to change the amount of lives as you see fit. That seems easier than changing how the game manager works.
    @VandalProductions > If the boolean becomes true, then it's working just fine. What (probably) isn't working fine is your transition(s). I'm guessing it's getting interrupted by something else, in which case you need to tweak your animator to prevent that. Just standard Unity, nothing specific to the engine here. As for falls, no, it's not a constant speed, gravity is an acceleration (just log positions to verify that). And you can tweak gravity on the CorgiController's inspector, as explained in the documentation.
     
  17. Grafos

    Grafos

    Joined:
    Aug 30, 2011
    Posts:
    231
    Hey reuno,
    Can you provide steps on how to update objects on a SingleObjectPooler?
    I took an object with GetPooledGameObject() applied some changes and then used it as GameObjectToPool(). I'm unclear on how to apply the changes to the rest of the objects in the pool though. I thought FillObjectPool() with PoolCanExpand set to false would do the trick, but it still just expands the pool with the new objects, instead of replacing the old ones with the new.
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Grafos > Yeah that is indeed not gonna work. You can either iterate through all objects in the pool and apply your changes, or apply changes on activation. Or you could extend the pool to add a dedicated method for that.
     
  19. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    32
    Just curious, how is the implementation with cinemachine going?
    Or is it still not supported from their side for integration with the engine?

    I am need of some of its features but got a bit worried when I read about problems with the LevelManager and Parallax elements throughout the forum. I will try with the provided script on GitHub for starters.
     
    Friction likes this.
  20. Friction

    Friction

    Joined:
    Jan 6, 2015
    Posts:
    18
    I'm also waiting for this feature. I hope we don't have to wait too long.
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @kriyordev, @Friction > I'm waiting on Unity to change the way it handles packages in the context of the Asset Store.
    Basically right now a publisher on the store can't include the package manifest (so you can't say "when importing this asset make sure that Cinemachine and the Post Processing packages get installed"). Until then, if I were to add support for Cinemachine, this would mean errors on install. I hacked an auto import thing in the TopDown Engine, but something like 2 to 4% of users still have issues with it, as it's not as bulletproof as a native solution could be. And I'd rather not have that same issue affect the Corgi Engine user base. So still waiting. In the meantime the one in the extensions repo should act as a good starting point.
     
  22. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    32
    Thank you for the quick reply. I do hope they would allow you this integration soon.

    Might be a simple question, but how do I actually use the script at the repo? I just dropped it into my game folders and it's full of the same error. FindObjectOfType(); is underlined with the same error. (Uploaded an image). Overall I did make the Cinemachine camera work and follow my player, however, there are two instances of my player at the same time. Checkpoints and parallax not tested, but I assume the script at the repo will help.
     

    Attached Files:

  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @kriyordev > I wouldn't know, I've never tested that script. You'd have to ask its author.
     
  24. JohnnyBrovo

    JohnnyBrovo

    Joined:
    Feb 11, 2018
    Posts:
    4
    Hello have a question. When i use the SwitchManager in 2D platformer. If i take damage on one of the characters and i switch to the other my health resets back to full. How can i keep the damage from reseting on switch?
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @JohnnyBrovo > You'd need to extend the SwitchManager for that (have it target the Health component of the "new" character to pass it the health of the previous one).
     
  26. statrick

    statrick

    Joined:
    Oct 12, 2013
    Posts:
    4
    @VandalProductions basically the way I solved this was to not use the Anystate. I've seen this question a few times now so i made a little video showing how I did it.
     
    Last edited: Mar 16, 2019
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @statrick > Thanks for sharing this! And indeed, not using the any state pattern is the very first advice in the animation documentation. It's for demo purposes only, of course it's better to do it the regular way, just like you would for any character in Unity in general :)
     
  28. whatbus2000

    whatbus2000

    Joined:
    Nov 21, 2014
    Posts:
    65
    would there be an easy way to have the player keep the momentum of the moving platform when jumping from it?
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @whatbus2000 > Sure, you can get info from the MovingPlatform class to get its current speed, and then add it to the character on jump, possibly altering that vector depending on the desired result.
     
  30. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello, could you give an example how to get the state of the (for example) shoot button from InputManager. I'd like to access it from an other script.
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @knuppel > Sure, as explained in the documentation, and as shown in the ton of examples of that throughout the engine (pretty much in every ability), it's as simple as this : _inputManager.ShootButton.State.CurrentState
     
  32. DrSizzle

    DrSizzle

    Joined:
    Feb 16, 2018
    Posts:
    2
    Anyone else having trouble importing v5.4? every timeI try to import it only imports v5.3?

    OK I got it. For some reason unity wasn't updating the import link.
     
    Last edited: Mar 18, 2019
    reuno likes this.
  33. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    32
    I just wanted to update on something that might be useful. I managed to combine the LevelManager script with the Cinemachine one on the GitHub and it works. The camera follows the player and so on. Now I have another small issue, but that is not what I wanted to share.

    The only reason I have these problems from the start is that I need to select my character in the original LevelManager from my Project folder. If I place my character prefab inside the scene and I reference the same on scene character prefab to my LevelManager, I get a duplicate of my player on Play. So I get two players at the same time and it's far from optimal. Is there a way to have my player be taken from the scene rather than how it is now from my Project folders? I checked all examples, but in all cases, the character does not initially exist in the scene. Or maybe I am missing something simple?
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @kriyordev > As explained in the documentation, characters get instantiated, that's how the system works. So of course if you have one in your scene you'll get two on play (or more). That's because the LevelManager handles instantiation, of one or many characters, and this enables many other systems afterwards.
    You can decide to not use the LevelManager, although I wouldn't recommend it, as it'll of course imply re-implementing a lot of things if you decide to use them, and instantiating characters is just standard practice. You could also extend the LevelManager to have it pick a character from the scene instead, although there's nothing to be gained from that, and is gonna complexify stuff (respawn, among other things).
     
  35. KriYorDev

    KriYorDev

    Joined:
    Oct 3, 2017
    Posts:
    32
    I see. Quite the dilemma. I can't fix some of the bugs with the current manager, but I am far from able to edit it that much. I wouldn't want to drop it either after it works so well. Ultimately I was trying to create cutscenes with Cinemachine and have Dynamic Camera zones with it as well, but it proves tricky so far. Thank you for your time though!
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @kriyordev > I'm not aware of any bug with the current manager, if you think you've found some, please use the support email to report them, thanks.
     
  37. Legionghost

    Legionghost

    Joined:
    Nov 30, 2018
    Posts:
    16
    Hi, this may be a silly question but I searched the docs but can't find a way to set up a fade in/out after dying (staying in the same scene), I added a MMfader on the 'fader' in the UI and tried using MMFadeOutEvent.Trigger(IntroFadeDuration); when the player dies, but I don't think I'm doing it right. I'm probably missing something obvious.
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Legionghost > There should already be a properly setup fader in all scenes, and already an example of a fade in/out in the LevelManager for reference. Please use the support email if the problem persists, thanks!
     
    Legionghost likes this.
  39. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    Hello everybody! Does anyone have a quick explanation for why this continuous movement with one keypress works for jumping but not for horizontal movement in this example? You don't have to provide code if you don't want to, just some guidance THX much!

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using MoreMountains.Tools;
    5. using UnityEngine.Events;
    6.  
    7. namespace MoreMountains.CorgiEngine
    8.  
    9. {
    10.         public class CharacterConstantMovement : MonoBehaviour
    11.     {
    12.  
    13.         bool continuousMovement;
    14.  
    15.         // Start is called before the first frame update
    16.         void Start()
    17.         {
    18.        
    19.         }
    20.  
    21.         // Update is called once per frame
    22.         void Update()
    23.         {
    24.             if (Input.GetKey(KeyCode.Y))
    25.             {
    26.                 continuousMovement = true;
    27.             }
    28.  
    29.             if (continuousMovement)
    30.             {
    31.                 InputManager inputManagerUiCam = gameObject.GetComponentInParent<InputManager>(); // The component is on UiCam
    32.                 inputManagerUiCam.JumpButtonDown(); // This works and Player jumps constantly
    33.                 inputManagerUiCam.SetHorizontalMovement(1); // This does not work and Player does not move right
    34.  
    35.                 CharacterHorizontalMovement charMovement = GameObject.Find("PlayerChar").GetComponent<CharacterHorizontalMovement>();
    36.                 charMovement.SetHorizontalMove(1);  // This does not work either
    37.             }
    38.  
    39.         }
    40.     }
    41. }
    42.  
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @polyconvex > Without context it's hard to tell but I'm guessing you have another ability that is setting that movement to 0 at the same time, probably CharacterMovement getting zero input.
     
    polyconvex likes this.
  41. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    I'm using just the basic abilities that come with the corgi engine default Player. I tried this with the minimal and retroadventure demos too, no luck.

    But if
    Code (CSharp):
    1.  .SetHorizontalMovement(1);
    or
    Code (CSharp):
    1.  .SetHorizontalMove(1);
    is the right way to do this then I'll figure something else out! thank you!
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @polyconvex > That's what I meant, by default the basic character movement listens for input, so it's already setting horizontal move, and that's where your conflict lies. You'll want to make sure that method only gets called once per frame at a time, otherwise the last call wins.
     
    polyconvex likes this.
  43. polyconvex

    polyconvex

    Joined:
    Aug 17, 2018
    Posts:
    7
    Oh of course, sweet! That did the trick totally. Thank you so much!! :D:cool:
     
    reuno likes this.
  44. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    17
    Can I use Anima2D with Corgi Engine?

    (I know spine, 3d/mecanim and spritesheets will work, but what about Anima2D? Its bone animation unity addon that is officially supported by Unity and is completely free, hence why I want to use it in particular.)
     
  45. RisingHigh

    RisingHigh

    Joined:
    Apr 30, 2018
    Posts:
    3
    Hey,

    I'm looking at this awesome engine as a choice for a new project we're looking to build - Is there a showcase thread or page anywhere to see live examples or other people games to get a real life example of what's possible pretty much out the box?
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
  47. Reactorcore3

    Reactorcore3

    Joined:
    Nov 27, 2018
    Posts:
    17
    Excellent, thank you!

    In that case I think it will, since the end-product of Anima2D bone-driven animations of a nested/segmented character are regular Unity animation/animator keyframes.

    I'm currently comparing and gathering info on all the tools out there to see which I should commit to such as Puppet2D, Spine, Anima2D and recently Unity's own new native 2D animation system which can be seen here:
    https://blogs.unity3d.com/2018/11/09/getting-started-with-unitys-2d-animation-package/

    I also learned today that Unity hired the talent behind Anima2D, then gave Anima2D away for free. However unlike what I first thought, Anima2D is *not* going to be the basis for Unity's native solution. The person developing Anima2D is still improving Anima2D, but its competing with Unity's own solution. Its interesting to see which one a developer should commit to in the future, since Anima2D being free means its only still supported for the sake of having a better 2D bone animation tool, but recieving no monetary compensation for its development. I'm a bit worried for its future and have a thought that perhaps Unity's new prototype native 2D animation suite would be a better option.
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Reactorcore3 > As long as your animation system interfaces with Unity's animator, it'll work natively with the engine.
    As for the best tool to pick, I'm partial to Spine myself, it's a great tool, and the one I've seen used the most in the industry.
     
    Reactorcore3 likes this.
  49. karmik

    karmik

    Joined:
    Oct 8, 2014
    Posts:
    124
    When using COrgin enjin with unity 2018.3.6f1 i am receiving some errors after import. Should I upgrade to later version of unity?
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @karmik > "Some errors" is too vague to give you an answer.
    I'd suggest upgrading to the latest stable, and if the problem persists, please use the support email and give me some details.