Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[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,756
    The person I replied to back then offered a solution to implement that specific feature. It hasn’t received a single feature request so far. Feel free to use the support form to do so.
     
    TheAPGames likes this.
  2. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    For sure, was worth checking with you to be sure I'm not missing anything on my end before requesting an additional feature.
     
    reuno likes this.
  3. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    92
    Sorry to ask but I could not find this anywhere in docs or examples:
    if I need characters not to overlap preventing bodies compenetration, is there a simple way to do it with corgi?
    Just tried a naive way nesting platorm colliders in characters but it's not working.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @luigi7 > No, that's something you'd have to implement, there's no such feature at the moment. Don't hesitate to use the support form to request it!
     
    luigi7 likes this.
  5. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    92
    Tried this
    Code (CSharp):
    1.  
    2. void OnTriggerStay2D(Collider2D collider)
    3.     {
    4.         if (collider.gameObject.layer == LayerMask.NameToLayer("Enemies"))
    5.         {          
    6.             if ((transform.position.x < collider.transform.position.x && transform.parent.GetComponent<Character>().IsFacingRight) ||
    7.                 (transform.position.x > collider.transform.position.x && !transform.parent.GetComponent<Character>().IsFacingRight))
    8.             {
    9.                 transform.parent.GetComponent<Ellie_CharacterHorizontalMovement>().SetHorizontalMove(0f);
    10.                 transform.parent.GetComponent<Ellie_CharacterHorizontalMovement>().MovementSpeedMultiplier = 0f;
    11.             }
    12.             else
    13.             {
    14.                 if (transform.parent.GetComponent<Character>().IsFacingRight)
    15.                     transform.parent.GetComponent<Ellie_CharacterHorizontalMovement>().SetHorizontalMove(1f);
    16.                 else
    17.                     transform.parent.GetComponent<Ellie_CharacterHorizontalMovement>().SetHorizontalMove(-1f);
    18.                 transform.parent.GetComponent<Ellie_CharacterHorizontalMovement>().MovementSpeedMultiplier = 1f;
    19.             }
    20.         }
    21.     }
    22.  
    it works but it's not precise, maybe should be done with rays.
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @luigi7 > No, indeed, a dedicated ability using the controller's raycasts would be better. It gets harder the more use cases you need to support, but basic functionality should be quick enough to implement.
     
    luigi7 likes this.
  7. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Hello Reuno, Where do i find the setting to have the "Player" stay on the moving platforms? Currently the player stays and the platforms moves.

    Thank you
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @Aprn > Staying on moving platforms is the default behaviour. You can see that in most demos, for example at the end of FeaturesPlatforms, or in the dedicated MinimalMovingPlatforms demo scene. Without more details, I'm not sure what you could have changed for the player not to connect with them, maybe a wrong layermask on your controller. If your issue persists, and for all support questions, please provide repro steps to it via the support form, thanks.
     
    TheAPGames likes this.
  9. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44

    Well i basically recreated the moving platform from scratch. I created an Empty object, nested the 3Dmodel underneath it, and on the top node ( The parent), i added the 2D collider, 2D riggid Body, and the moving platform component. It worked. Now looking at my older moving platform, the issue may have been that the box collider 2D was on the model node, the script for moving platform was on the parent object and it had no riggid2D.

    Thank you for the nudge kind sir
     
    reuno likes this.
  10. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Hello Reuno,

    Could you please share your thoughts on what i hope to achieve?

    I'm hoping to add shooting spikes going vertical ( like the Lava in this Example : https://i.gifer.com/6B88.gif). I could have used the AI and set it up as enemy to go back and forth, but that only works horizontally.


    Maybe make it a moving platform, add damage on touch ? thanks for your input.

    Cheers
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @Aprn > Using the AI system for something that simple wouldn't be efficient. You could indeed go with a moving platform and damage on touch, but likewise it feels completely overkill. I'd suggest simply having a script move your object between two points, which is all these fireballs do.
     
    TheAPGames likes this.
  12. TheAPGames

    TheAPGames

    Joined:
    Jun 1, 2020
    Posts:
    44
    Thank you,

    i will create a script. One question is, do i need to add "using MoreMountains.Tools;" on top of my script to make sure it is all tied in with the corgi engine?

    is there any general rule for adding my own scripts to what i hope to achieve?


    thanks
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @Aprn > No, that script wouldn't have anything to do with the engine, it's a separate system, you wouldn't need to add any reference to that namespace in it. And once again, I'd really appreciate it if you could use the support form for further questions, thanks.
     
    TheAPGames likes this.
  14. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,542
    Just bought this, very impressive!! Though the bizarre choice to use WASD throws me off :) What is the easiest way to change to cursors, is it just editing in the input manager? And if so which ones? I am only interested in one player for now.

    edit no worries found this:
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
  16. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,542
    Im trying to edit the retro AI level, seems odd that you cannot select tiles and move them around. How do we edit these "tilemaps"? I cant even work out from the inspector where this data is coming from.. thanks, if you have a tutorial on making levels with basic building blocks in 2d, that would be perfect.
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
  18. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,542
    Thanks, I hadn't seen that before!.. amazing little tool, and I love the corgie engine! You should supply more graphics/sprites etc, would be sweet.
     
  19. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    92
    @reuno I see that Damage parameter is a trigger and my damage animation is not played fully, because the trigger turns off and swith to the previous state: is there a way to play it fully or I have to code?
    If I need to write code, let's suppose I change Damage's Trigger to Bool in animator and use SetBool instead of SetTrigger in Health class, is there a right place to Damage's SetBool to false?
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @luigi7 > Getting damage is instant, it doesn't happen over time (at least by default, and even "over time" would likely be punctual events at certain frames). Your animation not playing fully is unrelated to the parameter being a trigger, it just means you have another transition interrupting it. As explained in the docs (https://corgi-engine-docs.moremountains.com/animations.html#debugging-animations), you should be able to identify which one by debugging your animator at runtime. You'll need to work on your transitions' setup to prevent that, with interruption settings, substates or different transition patterns for example. You could of course also change that parameter for a boolean if you wanted to (like you describe), but this likely won't fix your animator's setup though. As for "a right place to set that bool to false", it's a punctual event, so it's only true for one frame, regardless of the length of your animation. Your transitions' setup will determine how long the animation lasts, not the frame at which the damage happens.
     
  21. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    92
    @reuno as you suggested, it was about my animator: I had all states arriving from AnyState, from Idle it seems to work properly.
     
    reuno likes this.
  22. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    92
    Hello, is there a straightforward way to set a particular character's movement state via code? Like Idle, something simple.
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @luigi7 > Yes, of course. You can use the ChangeState method on the movement state machine for that, like so :

    Code (CSharp):
    1. someCharacter.MovementState.ChangeState (CharacterStates.MovementStates.Idle);

    You'll find examples of it in use in pretty much every ability, and more info in the documentation, as usual. Please stick to the support form for support questions, thanks.
     
    Last edited: Oct 2, 2021
    luigi7 likes this.
  24. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    92
    Another question, feedbacks: how do i set a feedback to play a particle on a projectile if hitting non damageable and destroying in that moment (think about a bullet hitting the wall). Is there a working example like that? Thankyou
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    luigi7 likes this.
  26. Shinyshoes

    Shinyshoes

    Joined:
    Oct 12, 2021
    Posts:
    1
    Hello Reuno, is there a roadmap about planned features for the engine ? I'm particulary interested in a Map system like Super Metroid had and a level selection system like Super Mario or Donkey Kong Country (SNES) has (where you can move around the island and select levels).
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @Shinyshoes > No, there's no public roadmap. A map system is on the todo list. As for the map level selection, there's already an example of that in the engine.
     
  28. ChrisSheeler

    ChrisSheeler

    Joined:
    Mar 29, 2013
    Posts:
    3
    Hi Reuno,

    I've been trying to implement the New Input System. I'm just working with your existing MinimalLevel_Input scene, but the controls do not work, and I can't figure out why.

    I have the new input system package imported, I can see and fiddle with your Action Map, but when I run the scene there is no control at all. Is there something obvious I'm missing?
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    Good news everyone, I've just uploaded v7.3 of the Corgi Engine to the asset store. As usual, it brings a lot of improvements and fixes all known bugs to date. Here are the full release notes :

    - Adds the CorgiCinemachineZone system, which lets you easily define sections in your levels that will enable a specific virtual camera when entered, and confine the camera to that zone. It's a "light" version of the Rooms system, more limited but extremely easy to setup. Adds the MinimalCinemachineZones demo scene to showcase that feature.
    - Adds the CharacterGroundNormalGravity ability, which will automatically compute slope angle and adjust gravity direction to match its normal, letting you stick to the ground and walk on walls. Also adds the MinimalDynamicGravity demo scene, showcasing this ability's possibilities.
    - Adds the CharacterSpeedAnalysis ability, which computes and exposes various speed metrics at runtime (controller speed, transform speed, previous frame speeds, customizable rolling average based on frame count or time
    - Adds RetroPush to the LevelSelection demo scene
    - Adds an option to AIActionShoot to target distinct CharacterHandleWeapon abilities
    - Adds a public IsGravityActive to CorgiController
    - Adds a UnityEvent OnCheckpointReached hook to the Checkpoint component
    - Adds an option to ThrownObjects to orient towards their trajectory (useful for arrows for example)
    - DamageOnTouch will now force isTrigger:true on its associated collider
    - Adds options to the Health class to be immune to damage (in addition to the previously existing Invulnerable setting), and to have damage feedback be proportional to damage
    - Adds a new IgnoreDownWhenGrounded option to WeaponAim when used in PrimaryMovement mode, letting you ignore downwards aim when grounded, similar to games like Contra
    - Adds PreventHorizontalAirMovementWhileInUse option to the Weapon class, and renames PreventHorizontalMovementWhileInUse to PreventHorizontalGroundMovementWhileInUse
    - Adds an AutoRun option to CharacterRun, letting you define an input threshold above which the character will run, without having to press the run button.
    - CorgiController now exposes its DeltaTime with a virtual public getter
    - Adds a ladder based transition to Room1 in the RetroVania demo scene
    - Adds a new animation parameter to the Character class, Flip, a trigger animation parameter that becomes true every time the character changes direction
    - Adds a ForceWeaponRotationResetOnEquip option to the CharacterHandleWeapon ability
    - Adds an optional InventoryTransform to CharacterInventory, letting you assign a different transform to all inventories attached to a character, useful to have a specific drop target.
    - Adds an option to CharacterGrip to be driven by input and not just automatic
    - CorgiController.SetTransformPosition now takes a Vector3 (changed from Vector2), which allows (among other things) ladders to not force a z position on the character anymore
    - Adds an option to the Character class to disable animator logs, useful if you choose not to perform animator parameter sanity checks
    - Adds extra security to the MeleeWeapon to make sure it turns off correctly
    - Removes the legacy VibrateOnDeath option on the Health component. Use a haptic feedback instead (if needed).
    - Adds extra check to CorgiController.ComputeDistanceToTheGround
    - Adds AbilityAuthorized checks to the GrabCarryAndThrow ability
    - AmmoDisplay now uses StringBuilder for increased performance
    - Sets a few forgotten methods to virtual
    - Improves WeaponLaserSight's performance.
    - Improves DamageOnTouch init performance
    - Adds an option to the Health class to use material property blocks and to specify material color property name.
    - Cleans up the Physics2D collision matrix
    - Improves CharacterAbility's performance
    - Exposes a previously hardcoded multipler to apply to vertical downward raycasts while on a moving platform
    - Adds the latest versions of MMFeedbacks, MMTools and InventoryEngine
    - Fixes a bug that could cause unwanted bounces when jumping on a corner with InstantAcceleration off
    - Fixes a bug that could result in a character being stuck if it climbed down a ladder and instantly transitioned to a dangling state
    - Fixes a wrong ladder animation orientation on the old Corgi3D prefab
    - Fixes a bug that would cause the jump animation to sometimes not trigger when the jump was triggered via the input buffer
    - Fixes wrong anchor/scale on the RetroAdventure fader
    - Fixes bugs that could occur when setting different speed multipliers on the various parts of a combo weapon
    - Fixes a bug that could cause RespawnFeedbacks to not trigger when respawning at a checkpoint
    - Fixes a few ammo count and reload related bugs
    - Fixes a bug that could cause jumps not to reset properly if you were to jump multiple times while a weapon was blocking movement
    - Fixes a bug that would prevent putting swap abilities on separate nodes
    - Fixes Weapon.PreventHorizontalMovementWhileInUse also resetting vertical force
    - Fixes CharacterCrushDetection not checking for ability permissions
    - Removes box colliders in NewCorgi3D and Corgi3D on the Ground cubes
    - Fixes issues that could arise with the OneWayLevelManager under certain portrait aspect ratios
    - Fixes a bug that would sometimes cause Character.UnFreeze to not revert to the correct state
    - Fixes a bug that could cause pickable items to disable too soon when using auto respawn after Xs duration
    - Fixes PickableWeapon not using CharacterHandleWeapon.CanPickupWeapons
    - Adds RetroPush to the build settings
    - Fixes a wrong collider and picker setup on the RetroOneUpPicker prefab
    - Removes a disabled RetroCorgi from RetroPush
    - Tweaks camera settings in a few demo scenes
    - Adds a better skybox to the Corgi3D demo scene
    - Postprocessing is now disabled by default in Minimal demo scenes (you can turn it back on if you edit the MinimalCameraRig prefab)

    I hope you'll like this new version!
     
  31. MuntyMcFly

    MuntyMcFly

    Joined:
    Sep 29, 2016
    Posts:
    44
    Is it possible to use Corgi Engine inside of an existing project? For example if I have a 3d project and I want to have a character walk up to some sort of interface to trigger a 2d game and start playing, is that something that can be done with Corgi Engine or is there any limitation that would prevent it?
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @MuntyMcFly > It's possible. The only thing to be aware of is that the Corgi Engine is what Unity / the asset store considers a "complete project". It's meant as a foundation, and as such, ships with a number of project settings (mostly input, layers, physics settings). If you import it into an existing project, you'll get a prompt asking you if you want to import these. If you accept, all these project settings will get erased/replaced. The recommended approach would be to import in another project, setup your 2D game there, then port it to your existing project while merging project settings as needed, using version control tools it's relatively easy.
     
    MuntyMcFly likes this.
  33. MuntyMcFly

    MuntyMcFly

    Joined:
    Sep 29, 2016
    Posts:
    44
    Thank you so much for that valuable information! I am glad I asked, really love to hear that it is possible :) Will be making a purchase shortly.
     
    reuno likes this.
  34. MuntyMcFly

    MuntyMcFly

    Joined:
    Sep 29, 2016
    Posts:
    44
    @reuno > Is there somewhere I can find information regarding using version control tools to do the merging of project settings? That sounds like a really great approach.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
  36. MuntyMcFly

    MuntyMcFly

    Joined:
    Sep 29, 2016
    Posts:
    44
    @reuno I will have a look and dig deeper into that thank you again I really appreciate the insight :)

    Edit: I get what you are saying that seems simple enough. Thanks again!
     
    reuno likes this.
  37. cficara

    cficara

    Joined:
    Sep 27, 2017
    Posts:
    31
    Hi, kudos on the update, all works great!

    One simple question: does the inventory engine work for multiplayer? Say, for example, you want two different inventories for coop gameplay.

    If not planned or not currently supported, I could give it a shot. Unsure how much time it would take.
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @cficara > No, right now it doesn't. Doable of course, but no example of it is built-in.
     
  39. cficara

    cficara

    Joined:
    Sep 27, 2017
    Posts:
    31
    Thanks for the reply!

    Quick question, as the Inventory engine is quite extensive and going trough it would take some time.

    So, here's my weapon wheel:



    I already setup different ammo types, so far, all good. I can also display current ammo, magazine, all that stuff. All working great!

    My question is, how can arbitrarily access the Inventory engine to access certain ammoID ?

    I'm looking something like InventoryEngine.ammoinventory.getItemID("ammo762").Quantity. Is there an example? Thanks a lot!
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
  41. cficara

    cficara

    Joined:
    Sep 27, 2017
    Posts:
    31
    That worked great, thanks! Here it is:



    But I'm having another issue. I want to display CurrentAmmoLoaded for each of my guns. The problem is, I can't seem to access the guns in a arbitrary way. I've got a list of weapons I set up:



    I can change to any by using ChangeWeapon. But when I try to get, say, Glock CurrentAmmoLoaded it returns the value of the prefab, not of the actual gun, because when you use ChangeWeapon it actually clones the prefab.

    Am I supposed to put these weapons as inventory items, instead of a list? And would that even work? What are my options to display current ammo loaded for all my guns? Thank you!
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @cficara > Usually that's done by reading inventory values, but it's up to you.
     
  43. Dante20011

    Dante20011

    Joined:
    Mar 3, 2015
    Posts:
    33
    Hi! I'm adding a Gravity Point to my level and it works great! Problem is after dying for the first time the gravity point stops working completely. Am I missing something? Thanks in advance!
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @Dante20011 > That's a bug, fixed already in anticipation of the next update.
    Don't hesitate to use the support form if you need a fix for that before the next release.
     
  45. Dante20011

    Dante20011

    Joined:
    Mar 3, 2015
    Posts:
    33
    Oh man, I'm on a jam. Is there any hotfix I can do to fix it?
    Edit: The support form is on your main website?
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
  47. natsuha816

    natsuha816

    Joined:
    Aug 13, 2021
    Posts:
    3
    Hi there.

    I'm trying to put the inventory engine inside DoozyUI, but when I put the InventoryCanvas inside another canvas, it doesn't show up!

    Shouldn't the inventory engine have a parent canvas when the scene starts? Please let me know if there is a workaround.
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @natsuha816 > I don't know DoozyUI so I'm not sure I can help here.
    As for the InventoryCanvas having a parent, I can't see any reason why not. I just tested this in a fresh install of the Corgi Engine, v7.3.1 on Unity 2019.4.31f1, under UICamera I created a new Canvas with the same settings as the InventoryCanvas, then nested the InventoryCanvas under it, it displays just fine.
    The demo Inventory UI is built using only native Unity UI components, so if Unity supports it, this will too :)
     
  49. natsuha816

    natsuha816

    Joined:
    Aug 13, 2021
    Posts:
    3
    Hi there.

    It seems that the strange behavior when the InventoryCanvas has a parent Canvas is a problem with my environment.
    I kept moving it in and out of the Canvas after your question. Then there were times when the problem did not occur.
    However, out of curiosity, I took it out of Canvas and had to repeat the same thing again.
    I don't know why, but the solution for me seems to be to not touch the nest again when it no longer gives me problems.

    InventoryEngine.png

    As shown in the image, I have InventoryCanvas nested in tab A.
    I changed it to another tab and it worked fine.

    Here's my question: is there a problem if I don't use UICamera, just InventoryCanvas and Inventory?
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,756
    @natsuha816 > As I said, these are all native Unity components, and this UI is just a demo of how you can setup your inventory front, just one way out of plenty. You can do anything you want, including removing the UICamera :)