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

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    34
    One question, I made a Copy of the Retrovania Scene, and added my own Grid with my tilesets, and this alone brings the FPS down to 15. I have literally more than 2000 tiles divided into different palette. Could this be the reason for the FPS drop? I did an experiment where I took, the retrovania scene deleted the Grid and putted my own, (wich is basically same as yours, but with a bigger palette and same result.

    Or could be it be something else?

    Thanks
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @piccolodmq > If that's the only thing you changed, and it was working fine before, and not after, then it looks like that's the issue indeed. I have to admit I've never used 2000 tiles with Unity's tile system, it usually shows its flaws way before that.
     
  3. jhaypee1683

    jhaypee1683

    Joined:
    Mar 15, 2015
    Posts:
    5
    Hello good day. Im planning to make a sample scene using proximity manager. But im having problem replicating the minimalperf scene. Is there any step by step tutorial with this? Because when i play the scene all the game objects disappear.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @jhaypee1683 > No, there's no step by step tutorial, it'd be a bit overkill. It's quite a simple system.
    As explained in the documentation, all you need to do is add a ProximityManager to an empty object in your scene, and add ProximityManaged components to all the objects you’d like it to manage.
    If the issue persists, maybe compare with the demo scene, and if that doesn't help, don't hesitate to use the support form, and provide a bit more details about what exactly you're doing.
     
  5. jhaypee1683

    jhaypee1683

    Joined:
    Mar 15, 2015
    Posts:
    5
    @reuno > Cool thanks for the quick reply. I think i have to redo my scene i might have missed something.
     
    reuno likes this.
  6. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Hey everyone. I'm trying to figure out how to make smooth animation transitions on a jump as well as differing idle animations.
    I got a jump and fall animation working, but I'm looking to make a transition between the jump and the fall at the peak of the jump as well as a landing animation.
    I'm also looking to randomly play a different idle animation after some time passes. For example, after playing a standard idle for a few seconds, it plays one of 4 idles at random before going back to the standard animation.

    I realize this is probably more of a Unity animation issue and I apologize for asking it here, but I've been banging my head against a wall trying to figure it out. I read through Unity's docs on the subject and found them to be rather confusing (doesn't help that a lot their tutorials for it are really not that great). Any advice on this though would be greatly appreciated.
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @PhantomFox128 > That's indeed not specific to the engine (at all), but hopefully I can give you some pointers.
    In the animation section of the engine's documentation you'll find a list of animation parameters that abilities automatically update. You can use the HitTheGround parameter to know when you just touched the ground, and use it to transition to a landing animation. The NewCorgi3D prefab does that. For transitions between jump/fall, I'd recommend using a blend tree. As for playing random animations, I usually do that using sub states, with a script that feeds it a random parameter I update at the frequency that makes sense (it's usually not per frame, but really depends on your use case).

    And yes, Unity's documentation on animation can be confusing, unfortunately I agree with that. I think it's worth taking the time to learn and understand its possibilities, it's very satisfying to setup animations once you're not fighting the system at every step and have better (mental) tools to debug things when they don't go your way.
     
    PhantomFox128 likes this.
  8. PhantomFox128

    PhantomFox128

    Joined:
    May 22, 2019
    Posts:
    157
    Hey, thanks for that!

    If I may make a suggestion: coming from another engine (that's no longer being supported), I think having the option to assign animations to specific abilities and tweak them in the Inspector without having to use Unity's solution would be really helpful. I'd imagine it would be a bit work on your end, but I think it would go a long way to make Corgi more accessible in general. Just a thought. Either way, thanks again for the help!
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @PhantomFox128 > It may make it more accessible, but then also way more limited. It'd be impossible (and/or useless) to recreate the entire animator system in an inspector. You wouldn't be able to setup blend trees or sub states from an inspector, and you'd end up with very basic and unsatisfying animations. I prefer encouraging people to learn how to do things properly, and use the appropriate tool for the job. It's also generally considered bad practice (to hardcode animations), I really wouldn't recommend doing things that way :) But thanks for the suggestion!

    Edit : if you really want to do it though, it's doable out of the box with the engine (at least without requiring any coding), using the MMFeedbacks system, which lets you trigger animations. Every ability's got feedback slots, so you'd get something like what you describe. Again, I'd recommend investing the time to learn how the animator works, you won't regret it :)
     
    Last edited: Jul 1, 2020
    javi_unity402 and PhantomFox128 like this.
  10. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Hi @reuno,

    I think I might have found two little bugs while trying to create my shooting routine, i hope it helps!

    * If there is no bottom under the character, it's not considered to be Airborne as the _controller.DistanceToTheGround returns -1. (the map ad a level boundary not that distant)
    * The option that prevents all movement while shooting doesn't seem to work correctly as it sets speed and force to zero before checking if the character is airborne at all. So it will block the movement in any case.
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @drHogan > If you think you've found bugs, please use the support form to report them, thanks! And please provide context info (Unity version, asset version), and ideally repro steps, I'll be happy to check them out and fix them for you.

    Edit : I've added them manually in case you miss that message. The first one had already been reported and fixed for the next version. Drop me a line if you need the fix. The second one I don't reproduce on v6.5 / 2019.3.3f1, the option seems to work as intended (killing your horizontal speed if airborne, and dropping you to the ground). If you can provide me with more info on that one I'll be happy to have another look.
     
    Last edited: Jul 1, 2020
  12. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Ah ok. No worry, I fixed them for my needs already. They way I did read the
    Code (CSharp):
    1. _horizontalMovement = _character.Airborne ? _controller.Speed.x * Time.deltaTime : 0f;
    was that while Airborn speed had to be kept as controllerSpeed*Time.deltaTime, and zeroed only otherwise (probably wishful thinking because I need it to be so ;), and that setting previously the speed to zero would override that part of code. I nevertheless fixed it for my needs, just thought it was a bug for the intended behavior!

    If you don't mind, I have a tiny additional question. Do you happen to have any example of a character without visible weapons? In detail, we have our character shooting energy balls with one hand, therefore she has a shooting animation and i did create her an invisible weapon to handle that.
    I do really struggle in balancing out the syncronization of animation and projectile spawning, and I was wondering if there was some example I might have missed to take inspiration from.

    Cheers and thanks for the always fast answers!
     
    javi_unity402 likes this.
  13. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    33
    Hi @drHogan. I also have invisible weapons. Weapon animations are passed to animator character, so you just have to configure a trigger and setup the animation in the player.
     
    drHogan likes this.
  14. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    Yep, I am doing that, but I seem to really struggle to sync the bullet spawning. At times the FixedUpdate and Update probably have some small desyncs and the bullet one and then spawns before the right frame in the animation. I had considered adding an event to the frame, but it would make the logic dependent on the animation, while i would have liked to do the opposite for stability, i was wondering if there was a correct best way to do that.
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @drHogan > If you want to sync with a frame of your animation, then using animation events would be the best way to go, that's gonna be the more stable option. Not necessarily the easiest to maintain or debug, but that's what they're for. Alternatively you could change the delay so that it works on frames instead of time. I have to admit I've never had that issue, but for sure that use case is a very good example of what animation events were designed for.
     
  16. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    201
    hi, i did implement it with events, and indeed it works like a charm! thanks for the tips ;)
     
    reuno likes this.
  17. drjamiearron

    drjamiearron

    Joined:
    Jun 8, 2012
    Posts:
    134
    Hi there, is it possible to "butt stomp" using a default character ability, or is it something I need to make myself as an extension of the jump class, for example?
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @jamiewhitephd > That depends on what you're after. There's the CharacterDive ability that lets you pound the ground. There's the Stompable class that lets you kill/damage enemies by jumping on them.
     
  19. drjamiearron

    drjamiearron

    Joined:
    Jun 8, 2012
    Posts:
    134
    Mario 64 style, so allowing the character to stomp downwards as you mentioned which would either crush enemies or activate switches. It sounds like the CharacterDive ability will achieve this?
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @jamiewhitephd > By default the character dive ability doesn't apply any damage, but you can look at how the CharacterDamageDash ability does it, and you can then build your own ability that combines both.
     
  21. drjamiearron

    drjamiearron

    Joined:
    Jun 8, 2012
    Posts:
    134
    Ace, I’ll look into that - thanks.
     
    reuno likes this.
  22. FeboGamedeveloper

    FeboGamedeveloper

    Joined:
    Feb 2, 2014
    Posts:
    47
    Hi, I would like an area that applies a constant force of a specific direction and intensity to the player when he enters it. How could I do? I have seen that there is a wind zone but it only applies a force at the top T_T
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Amalfi-Prozen > you could create a new class that works similarly as the wind zone but also applies an horizontal force.
     
  24. FeboGamedeveloper

    FeboGamedeveloper

    Joined:
    Feb 2, 2014
    Posts:
    47
    what is the script for the wind zone?
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Amalfi-Prozen > The script for the wind zone is called CorgiControllerPhysicsVolume2D (you can see that if you select one, in its inspector), but come to think of it, it may actually not be the best pick for the job you're after.
    It's a bit of a hack, but you can use the SurfaceModifier to do so, like this :

    upload_2020-7-7_17-54-56.png

    This is a modified version of the Minimal Treadmill prefab. You'll want to make sure it's on the Default layer, that its box collider is set to "is trigger", and then you can apply forces.
     
  26. piccolodmq

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    34
    Hi Reuno, quick question regarding, the ProximityManager class, I am using your Vertical scene, prefab as an example. When I try to import the prefabs that "stops" the enemy's from doing anything, I couldn't get it to work. I literally used the Prefab named AI, and changed one of my enemy's with the one there (even using the platforms and other objects there), but still I can see the enemies moving when I am far from there, and FPS goes down. The MinimalPerformanceEnemy+Platforms has default values of 15 and 20 for how close the player/camera is. But still tinkering with this didn't get me anywhere. Any clues on how to fix this?

    ----

    Silly me... I was not using the Proximity Manager, functions... NVM.

    ---- Update 3

    Still I I cant get it to work. I am down to 30 FPS :( Picture for reference. (Green is the Player) and Red are the enemies that have the MinimimalPerformance options on it (with the default 15 and 20 proximity settings. .

    https://drive.google.com/file/d/1aGjLPAjxvK-KljUSA6Yawmg2jQ9HKF1g/view?usp=sharing
     
    Last edited: Jul 8, 2020
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @piccolodmq > I'm not sure I follow what you mean. I don't know what prefabs that stop enemys are, or what prefabs you're referring to in general, it's just all a bit too vague.
    As you'll see in the documentation (https://corgi-engine-docs.moremountains.com/scenes.html#managing-large-levels), the proximity manager is fairly simple, and if you simply have a proximity manager and the appropriate component on everything you want to disable, it'll simply work. If the issue persists, please use the support form and provide repro steps of what you did, I'll be happy to have a look for you.
     
  28. piccolodmq

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    34
    -----

    Let me rephrase myself, I am using all the Prefabs that are on MinimalPerf, that have to do with enable/disable objects to save on performance (that's what I meant with Stop), I am bringing ProximityManager -and also AI, prefab from that scene to another Scene, ( a clone of the Vertical scene). I changed the AI prefab only by taking out the RetroBlobWaitJumpWalk, and changing it for one of my Enemys. And I am not getting results. Do the Platforms or other objects need anything extra, to enable/disable to save on performance.
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @piccolodmq > As I said in my previous message, please just use the support form and provide repro steps of what you did, thanks!
     
  30. lguzman79

    lguzman79

    Joined:
    Jul 9, 2019
    Posts:
    1
    Hi. I´m interested in using the CharacterSwitchModel, but when I use it in a character that uses the combo weapon, the ComboInProgress does not fire on the other models and animations like punches don't play. Any ideas?
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @lguzman79 > Please use the support form to report this, and provide a bit more context (repro steps, what version of the engine you're running, what version of Unity, etc), thanks!
     
  32. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    Hi @reuno,

    quick question, coul the hit able be used on an ai to trigger a character switch to have a mechanic like that of Mario games where if you get hit you loose your power and switch to normal Mario and then to the small one ? Or should I go another route completely?
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Sofiel > There's an example of that exact behaviour in the SuperHipsterBros demo scene. It doesn't use the CharacterSwitch, but you could absolutely do that, it's a very good way of doing it
     
  34. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    reuno likes this.
  35. dasbin

    dasbin

    Joined:
    Jan 14, 2012
    Posts:
    261
    In Inventory Engine, is there a built-in way to limit the maximum of a single thing that an inventory can hold? I see the "maximum stack" variable, but my understanding is that a new stack will just be created when picking up more items. I want to limit the player to, eg, 100 of a small thing in a single stack, while not allowing a second stack to be created, and still having space in their inventory for other stuff.
    If not, any suggestions on where to do this override/check? Thanks
     
    Last edited: Jul 10, 2020
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @dasbin > No, there's no global limit at the inventory level. I could add that to a future update if you'd like though, it'd be a nice addition. In the meantime, if you wanted to implement that, that check would have to be in the AddItem method.
     
    dasbin likes this.
  37. Veritas

    Veritas

    Joined:
    Mar 18, 2014
    Posts:
    14
    Small feature request:
    Decouple movement and rotation. Unfortunately, due to the extreme limitations of the 2d animation package (used for IK) my object needed to be rotated. I was using procedural animations with this object which meant that I needed corgi to specifically move the top-level bone.

    The solution was to override the controller to apply movement based on world space instead of local as well as not change the object's rotation in the gravity classes. It'd be nice to have a checkbox to "ignore object rotation". Alternatively, it would be really helpful to apply any corgi behaviors to a remote object (instead of limiting it to itself).
     
    Bhanshee00 likes this.
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Veritas > The engine already lets you specify a model that will rotate (or not). That may not be enough though, in which case I'd need to know a bit more about your use case to pick the best approach for it. Don't hesitate to send me more info via the support form, I'll be happy to find a solution for it.
     
  39. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    30
    I would like to have a key operated door that works similar to the key operated chest. The door opens with the correct key, the door open animation plays but instead of applying inventory items, the teleporter becomes active. Is this something that is achievable without me writing code?

     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @SupremeSmash > I'd recommend handling that with code, but if that's not possible, I suppose you can use the MMFeedbacks system to handle that, via an event feedback. I'd always recommend avoiding hardwiring logic that way, it makes it harder to debug things in my opinion, but it'll work.
     
    SupremeSmash likes this.
  41. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    30
    Thanks @reuno I will look into trying it with code firstly
     
  42. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    @reuno im sorry but I hit a road block. how do I call a specific prefab from the list of switchable “” characters after being hit? Otherwise I just ditch in that order and can’t do it secuentially as in the Mario game mechanics. Thanks for your time.
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Sofiel > Right now that ability lets you switch sequentially or at random, not pick one prefab in particular. I can add that to the todo list if you'd like, but right now that'd require extra code, it's not a built-in feature.
     
  44. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    Yes please! And thanks again!
     
    reuno likes this.
  45. Veritas

    Veritas

    Joined:
    Mar 18, 2014
    Posts:
    14
    Sorry! I guess I should have posted an example.

    So when using the official 2D animation package (for IK with sprites) unity creates a prefab for you with the bone structure in the prefab. I need to specifically move bone_1 as my "thing that needs to move in the scene", as all my procedural animations are driven by this object (specifically the head bone) moving.

    I'm able to attach Corgi Engine stuff to it and move as I want, but the `bone_1` object's rotation is set to (0, 0, 90). This is unfortunately unchangeable thanks to the rigidity of the 2D animation package.

    So it'd be nice if Corgi Engine could
    1. Apply updates based on world space instead of local
    and
    2. Allow a "target" gameobject's transform, so you could do things like place the corgi scripts on a different gameobject.

    These aren't big dealbreakers because I'm able to easily override the behavior to accomplish #1, but it'd still be nice if there were a checkbox built into the system.

    upload_2020-7-13_15-23-28.png
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Veritas > Oh ok, I didn't know that about the 2D animation package. Seems like a pretty annoying constraint.
    Regarding the second point, you can already separate logic and model, that's actually encouraged, and done via the Character script. From what I understand it would have worked for this, but maybe I'm missing the problem?
     
  47. Veritas

    Veritas

    Joined:
    Mar 18, 2014
    Posts:
    14
    You can separate the sprite which is great, but the actual object that moves around in the scene is whatever object the Corgi Controller is actually attached to. In my case I require `bone_1` to be the object moving, and that object must be rotated 90 degrees on its Z axis. Corgi Controller needs to be attached to the actual collider that moves, unless I'm mistaken, so it must be attached to the `bone_1` game object.

    My point is: the visual aspect of modifying the actual sprite is decoupled which is great, but the actual movement of the game object is coupled to whatever object the Corgi Controller is attached to.
     
    reuno likes this.
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Veritas > Ok I get it now, thanks for the explanation!
     
    Veritas likes this.
  49. ZygoUgo

    ZygoUgo

    Joined:
    Jul 11, 2017
    Posts:
    63
    Hi, I need to know if I can have multiple ammo types for a weapon..? I am not a coder but willing to learn if you have an example. The ranged weapon represents the off-hand weapon as the character will be wielding a melee weapon in the other. Thank you for any help :)
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @ZygoUgo > That's not a feature of the engine at the moment, but it can be done. It'd require coding though. I can add that to the todo list if you'd like.