Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @SillyCarbon > What you describe is the typical use case of a physics based solution. The engine is designed for tight gameplay, it can't (and won't) handle all possible shapes for a collider, the amount of use cases to support would be absolutely impossible to manage, that's why most games stick to boxes, you can't have tightness and infinite shapes. What happens if your character is L shaped, has one half of its L in a tunnel, and decides to flip? There would be a lot of situations like this to solve for.
    For what you're after, you'll likely want to go with physics, and probably a lot of extra code to handle all possible shapes, it's no small task. I'd be less afraid of the technical side of things, more of the design side.
     
  2. Crew_Long

    Crew_Long

    Joined:
    Feb 5, 2019
    Posts:
    8
    And for the battles scene, for example, if the player has drawn a tail on the character, that tail should be attackable, that means when a bullet flies through the tail(or the character body, but not the spaces between them), the character must take the damage accordingly; On the other hand, if the bullet doesn't touch the tail ,just keeps a narrow distance, then the player should not be damaged, so a BoxCollider cannot certainly cover this case.
     
    YoyiyoStudio likes this.
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @SillyCarbon > Health/hitboxes and collisions are two different things. The engine lets you have multiple hitboxes already, but that won't solve your main issues, which are more on the design side of collisions at the moment.
     
  4. Crew_Long

    Crew_Long

    Joined:
    Feb 5, 2019
    Posts:
    8
    @reuno Thanks very much for your replies, these are very nice~

    Yes I think I've got your point, maybe I'll think about other ways...
     
    reuno likes this.
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @SillyCarbon > Just to be clear, I think your idea is a very nice one. Letting players draw their own characters/shapes is awesome. But a tight framework won't be the right tool for the job, this requires something that can handle all shapes indiscriminately, and that's what physics engines are for.
     
    Crew_Long likes this.
  6. Crew_Long

    Crew_Long

    Joined:
    Feb 5, 2019
    Posts:
    8
    @reuno Thanks, I certainly will think about physics engines, it's just that CorgiEngine is so good that it makes me so hard to not use it;)
     
    reuno likes this.
  7. bwlgeo

    bwlgeo

    Joined:
    May 10, 2022
    Posts:
    13
    Having a rather bizarre issue where adding an MM Soundmanager to a scene makes it so that the player is suddenly unable to pause. Without a Soundmanager in the scene everything works as normal. With one in the scene, pressing the dedicated pause button does nothing, and the inventory can be opened, but it doesn't pause the game and the character still moves when using keys to navigate the inventory.

    Wondering if anybody might be keyed in to the potential cause of this?
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @bwlgeo > I can't think of any correlation between pause and sound manager. Most demos use the MMSoundManager and let you pause the game and open the inventory, so my guess would be you're doing something else maybe?
    You can see an example of it in action in the FeaturesInventory demo scene, among others.
    Does the issue happen there as well? If it doesn't, could you provide precise steps of how you're adding the MMSoundManager, and in what demo scene your issue can be reproduced?
     
  9. bwlgeo

    bwlgeo

    Joined:
    May 10, 2022
    Posts:
    13
    I located the problem, actually!
    As it turned out I had already added a sound manager to the scene nestled on my Level Manager that I didn't remember was there like a big doofus. It was the accidental addition of a second sound manager that somehow messed with the ability to pause. Removing the second egregious sound manager fixed it.

     
    reuno likes this.
  10. YoyiyoStudio

    YoyiyoStudio

    Joined:
    Dec 22, 2021
    Posts:
    56
    In my project i use animation to change 2dBoxCollider size.Because I cant code im animator.
     
  11. bwlgeo

    bwlgeo

    Joined:
    May 10, 2022
    Posts:
    13
    Any possible tips on how to have a character's different ability nodes have separate idle animations that it switches to on swap? I've got a "regular" ability set and a "combat" ability set. Can't quite manage to get the transition to work using animation parameters alone and the closest I've gotten is making it possible to go BACK from the combat idle to the regular idle on swap (after using attacking to get it to go the combat idle by way of exit time transition) by hitching a feedback to stopping the Handle Weapon Ability, but I can't quite seem to make the initial swap of going from the regular idle to the combat idle work.
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @bwlgeo > How to do that really depends on your animator's setup and transitions, there's no universal answer to this, and it's unrelated to the engine. I would recommend having a dedicated ability (or even a class, you don't really need an ability for this) update an extra parameter, let's say "Stance", and have your transitions use that, possibly in an Idle substate in your animator to go to one idle animation or the other.
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    Good news everyone, I've just released v8.0 of the Corgi Engine on the Asset Store.
    This new major version comes with the most requested feature in a long time, damage types (and damage resistance, and damage over time, etc), lots of improvements, and as usual, fixes for all known issues to date. I hope you'll like this new version, here are the full release notes :

    - Adds DamageTypes, and the ability to define and apply TypedDamage (via DamageOnTouch, Hitscan, or direct API calls)
    - Adds support for damage over time (and interruption of damage over time), damage that forces a condition, and damage that applies movement multipliers
    - Adds damage resistances, letting you define resistance (or weakness) to damage types, setup effects in reaction to damage types, etc
    - Adds the DamageOverTimeInterrupter picker
    - Adds the PickableDamageResistance, which lets you create, activate or disable a resistance on the picking character
    - Adds a health/damage focused demo, MinimalDamageTypes, with an ice gun, cannons throwing fireballs, ice balls, poison and electricity, and showcasing the various effects you can create by combining the new features above, as well as pickable shields and antidotes
    - Adds the MMF Player versions of the Corgi Engine Floating Text and Sound feedbacks
    - Adds the SetTransformAsTarget AI action, letting you set any specified Transform as your AI Brain's Target
    - Adds an option to WeaponAutoAim to also detect trigger colliders
    - MMPath now supports having the first path element at an offset
    - Adds a RequiresPlayerCharacter option to CorgiCinemachineZone
    - Adds a GetOwner method to Projectile, returning its current owner
    - Adds OnGrabbed and OnThrown unity event hooks to the GrabCarryAndThrowObject class
    - Adds the possibility for SurfaceCrawlers to start at any rotation
    - Adds InputSystem support to CharacterSwapManager, WeaponAim in mouse mode and InventoryInputManager
    - Adds input system support for all modes of ButtonActivated
    - The CorgiController now exposes a StandingOnArray, for finer control over what exactly the controller is standing on
    - Removes some assembly definitions and replaces them with assembly references
    - Adds a safety check to CharacterJump
    - Loot tables now refresh on validate
    - CharacterSwitchModel's SwitchModel method is now public
    - CharacterPersistence now forces the controller back on on spawn
    - Fixes a bug that could cause incorrect MMPathMovement speeds to be outputted when movement was prevented
    - Fixes a few stairs bugs
    - Fixes a bug that could cause WeaponAim to misalign the cursor
    - Fixes a bug that would cause loot to not take weight into account when in pooled mode
    - Fixes the Glide ability not being able to transition to ledge hanging
    - Fixes a missing sprite issue on the start screen
    - Fixes AI Brains not resetting properly on auto respawn if nested on separate nodes
    - Fixes a bug that could cause a character to get stuck in a Stunned state forever if stunned multiple times in a row
    - Fixes a bug that would prevent rolling when initiating the roll on the same frame as landing from a jump
    - Fixes position imprecision with the Dash and WallClinging abilities when they were added on sub nodes
    - Fixes possible double call in the Jumper class
    - Fixes a typo in AIActionReload's OnlyReloadOnceInThisState
    - Fixes erroneous distance computation in AIDecisionDetectTargetLine that could let a target be detected from the back
    - Fixes DamageOnTouch's ignore list not always initializing correctly
    - Fixes erroneously allowed jumps down one way platforms when being only partially over one such platform
    - Fixes a bug that could potentially prevent stop feedbacks from being triggered by CharacterHandleWeapon
    - Fixes a typo in a InventoryEngineKey comment
    - Fixes a bug that would cause a character to fall through a ladder instead of climbing it down when flying
    - Fixes a platform position in the Corgi3D demos
    - Fixes SurfaceCrawlers not applying offsets correctly and having issues with counter clockwise movement
    - Fixes indentation inconsistencies across all classes
    - The Minimal demo's Shotgun and RocketLauncher (ammo versions) now mutualize their pools by default
    - Moves the SurfaceCrawler class to its rightful folder
    - Comments an unused line in BouncyProjectile
    - The Corgi2D flames particles material is now two-sided
    - Fixes a duplicate instruction in the Projectile class
    - Adds more details to a LogError in AIState
    - Removes the Tilemap 2D extras from the asset, they were causing too much confusion, especially now that Unity has different versions of it for each version of the editor. You can of course still grab them from Unity's repository and add them to your project.
    - Updates MMFeedbacks, MMTools and InventoryEngine to their latest versions
     
  14. YoyiyoStudio

    YoyiyoStudio

    Joined:
    Dec 22, 2021
    Posts:
    56
    OMG reuno!DamageType!Thats exactly what i want in past 3 month.Now no need to use Extensions at github.Yeah
     
    Fed81 and reuno like this.
  15. EarlyDarkEntertainment

    EarlyDarkEntertainment

    Joined:
    Oct 8, 2018
    Posts:
    15
    thanks for the updates
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
  17. PeterJayJay

    PeterJayJay

    Joined:
    Jul 6, 2022
    Posts:
    4
    Hey Reuno, not sure if this is the right place but I would like to put in a request for "Corner Correction" on the dash/jump etc. It's in most modern platformers so I think it would be a great addition :)
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @PeterJonesMusic > No, the right place for feature requests would be the support form.
     
  19. FNRocha

    FNRocha

    Joined:
    May 30, 2015
    Posts:
    9
    Hello Reuno!
    Is there a way to make the particle system feedbacks related to an ability flip according to which direction the character is facing?
    I have a dust effect that I would like flip along with the character.
    if not can you provide me with some tips as to where I should implement this change?
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @FNRocha > Yes, if you nest your particles correctly under your model, and have them render locally, they'll flip as the character flips. You can see examples of that in most demos, the RetroCorgi ones for example.
     
    FNRocha likes this.
  21. FNRocha

    FNRocha

    Joined:
    May 30, 2015
    Posts:
    9
    Oh my, that is way simpler then I expected. thanks of the good support
     
    Dumpling007 and reuno like this.
  22. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    36
    Hello Reuno!I updated my CorgiEngine to ver.8.0, now I have a problem!
    "Assets/CorgiEngine/ThirdParty/MoreMountains/MMFeedbacks/Demos/MMFeedbacksDemo/Scripts/DemoPackageTester.cs(94,6): error CS0103: The name 'MMFDependencyInstaller' does not exist in the current context”;
    please help me!
     

    Attached Files:

  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
  24. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    36
    reuno likes this.
  25. Aki_zora

    Aki_zora

    Joined:
    Sep 12, 2021
    Posts:
    1
    There is a little glitch.
    If choose Input Independent in Character Wallclinging script.
    Using dash to the opposite direction during wallclinging, then dash won't trigger.
    Need do this very quickly, or limit character horizontal movement during wallclinging state.
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
  27. YoyiyoStudio

    YoyiyoStudio

    Joined:
    Dec 22, 2021
    Posts:
    56
    Hello, how can I adjust the damage value to an integer?
    The new version can set the random damage value in the maximum and minimum range, but they are always accurate to five decimal places, as shown in the pictur;
     

    Attached Files:

  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
  29. KOPEW

    KOPEW

    Joined:
    Jul 30, 2019
    Posts:
    27
    As always, thanks for your work @reuno ! <3

    Do anyone know how (and if it's possible) to make a crouch attack?
    I've two melee animations - stand & crouch attack.
    The attack has a simple mechanic - one button is a melee, the other is a long-range. Castlevania-like.
    Now melee attack is a [Handled weapon] cuz I haven't found any other ways to make the melee weapon permanent for char.
    This weapon has only one [Melee component].
    I tried adding another component but with a different line of animation - nope, doesn't work.
    Perfect solution - (one button) standart & crouched attack with permanent weap, (other button) - shoot if the character has a weapon and ammo
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @Cunny-Lang > Usually you'll want one Weapon prefab per "attack". You can then call ChangeWeapon to go from one attack to the other, on demand. Alternatively you could extend the MeleeWeapon class to have it behave differently (different attack size/damage/etc) based on input.
     
    KOPEW likes this.
  31. KOPEW

    KOPEW

    Joined:
    Jul 30, 2019
    Posts:
    27
    Thank you for reply!
    Well, that's why I love and use Corgi (+ Top Down) Engine cuz it's unbelievably easy to learn and interesting to master for an average artist, non-programmer)
    I know what "extend a class" is, but I have no idea how to do it in this case (exept "go google"))
    It seemed to me that it was enough to create CrouchAttack param. into the animator; in the transition from "crouch_idle" to "crouch_attack" select true "crouched" + "crouchAttack" and the Engine will pick it up and do it all by itself :D
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @Cunny-Lang > If the only difference between your two attacks is an animation, then you can do it natively without any code. In your animator, transition to your standing attack if you're not crouching, and to your crouching attack if you are.
     
    YoyiyoStudio and KOPEW like this.
  33. KOPEW

    KOPEW

    Joined:
    Jul 30, 2019
    Posts:
    27
    Brilliant!

    There were some problems getting it all work properly, but finally solved it!
    I made one state (Main attack) transited from {Any state} to {Idle};
    also made two states (Crouch atk): 1st transited from and to {Crouch idle}
    2nd from and to {Crawl}
    Otherwise the character either (a) didn't play attack animation while crawling, although the hit itself was technically perfomed, or (b) he played stand attack anim while crawling)
     
    reuno likes this.
  34. YoyiyoStudio

    YoyiyoStudio

    Joined:
    Dec 22, 2021
    Posts:
    56
    Thanks reuno.
    Forgive me I have a lot of questions.
    Will the InventoryEngine in future version have the function of one Item occupying multiple grids like Diablo or biohazard?
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @wechat_os_Qy0z_aF7Nfhquhava38GLxUWU > If more people request it via the support form, then yes. At the moment it's only received a handful of votes, so it's very low on the todo list.
     
    YoyiyoStudio likes this.
  36. YoyiyoStudio

    YoyiyoStudio

    Joined:
    Dec 22, 2021
    Posts:
    56
    Hello Reuno.
    I made a player slowmotion death visual effect by using MMFeedbacks.
    But when player lost last life it immediately turn to GameOver scene.
    In terms of mechanism, there is no problem.But it dosent play death visual effect feedback i think this kind of turn is very stiff.
    How to delay the scene switching when the character lost last life?
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    YoyiyoStudio likes this.
  38. EarlyDarkEntertainment

    EarlyDarkEntertainment

    Joined:
    Oct 8, 2018
    Posts:
    15
    Hello will there be a map system with item locations like in Metroid?
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @EarlyDarkEntertainment > At the moment that feature hasn't received a lot of votes, but if more people request it via the support form, it'll make it into a release, yes, don't hesitate to do so!
     
  40. EarlyDarkEntertainment

    EarlyDarkEntertainment

    Joined:
    Oct 8, 2018
    Posts:
    15
    thanks :)
     
    reuno likes this.
  41. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    Refer to MinimalDamageTypes demo, I would like to change the effect of the damage sprite.

    E.g. If I use an Ice Damage Type (scriptable object), when the bullet hit the target, the target will have an ice cube and get frozen for a few seconds.

    Question, how can I change the Ice cube sprite (or its effect) to my own sprite or effect?
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @jim00 > Select the sprite renderer for it, change its sprite to something else. Same for other effects, simply replace them with others. Or (and that's even easier) just setup new effects, it's usually faster and cleaner to start from scratch than to edit existing prefabs.
     
  43. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    Yes, I know to change the sprite renderer but I can't find which prefab that contains that sprite renderer. Can you please give me the name of that prefab and its location. Thanks

     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @jim00 > It's not a prefab, just a sprite renderer on the character in that demo, named IceBlock.
     
  45. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    Ok, now I can find that IceBlock, which prefab and its component is using that IceBlock?
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    @jim00 > Again, there's no prefab, it's just a sprite renderer on the demo character in the MinimalDamageTypes demo scene.
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
  48. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    very good, now i got it. that's easy. thanks
     
    reuno likes this.
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,942
    Good news everyone, v8.1 of the Corgi Engine is now available on the Asset Store.
    Here are the full release notes :

    - AIFollow will now auto initialize if instantiated past level start
    - Adds an option to DamageResistanceProcessor to ignore unknown damage types
    - Adds an option to MeleeWeapons to use existing DamageOnTouch areas instead of having the weapon generating them
    - Adds Existing mode to MMHealthBar, letting you bind an existing progress bar (in the scene, or in your prefab) instead of drawing or instantiating one
    - Adds options to mute tracks to CharacterPause, as well as UnityEvent hooks on pause / unpause
    - Adds options to the Walljump ability to limit the amount of wall jumps
    - Adds ResetForcesOnConstrain option to the LevelBounds ability (giving a better "bounce" behavior to top constrains when working without actual colliders
    - Adds Min/Max damage settings to the MeleeWeapon to mirror the Damage API
    - Adds optional bindings to the Bomb component, as well as extra null checks and renames its Destroy method to DestroyBomb
    - ButtonActivated's OnDisable method is now virtual
    - Adds a public method to cache the PlatformMask in CorgiController
    - Fixes a bug that would cause the first room to not be auto detected on start if the room's z position was different from the spawn point's
    - Fixes hard zero comparison in CharacterDash that could lead to erroneously prevented dashes
    - Fixes a bug that would cause HorizontalMovement feedback to not stop playing when walking into a wall if StopWalkingWhenCollidingWithAWall was true
    - Fixes a bug where disabling a MovingPlatform wouldn't impact CorgiController's speed correctly
    - Fixes a bug that could cause compute health damage to be incorrect when temporarily invulnerable
    - Renames DamageResistanceProcessor's DamageResitanceList to DamageResistanceList (writing is hard)
    - Fixes missing roll support on the InputSystemManager / CE InputActions
    - Adds prettier inspector to the Health class
    - Updates Inventory Engine to v3.2
    - Updates Cinemachine to 2.9.1
    - Updates MMTools and MMFeedbacks to Feel 3.7.1 equivalent

    I hope you'll like this new update!
     
  50. dannythareboss

    dannythareboss

    Joined:
    Sep 12, 2016
    Posts:
    4
    Is there any way to make combo out of multiple Projectile Weapons with different ammos?
    From what I can see, all tutorials and documentation points only to melee weapon, but not how to handle projectile weapons in combo.