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

    skayster

    Joined:
    Aug 12, 2017
    Posts:
    46
    Are there plans to add weapon hit effects? Such as stun or poison-like effects?
    PS: +10 for ledgegrab :)
     
  2. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi reuno

    For my character I do have a hurt and push animation but when I was looking at the rectangleAnimator I did not find any parameters for them, so how Corgi handle the push and hurt state and animations?

    Thanks in advance
     
  3. skayster

    skayster

    Joined:
    Aug 12, 2017
    Posts:
    46
    Is there any way for combo melee weapons to go from combo 1 to combo 2 without going to the idle state in between for a moment?

    I think at the moment in the Retro AI the corgi sword goes Combo 1 -> Idle (for a split second) -> combo 2 -> Idle -> Combo 3. It's hard to notice there as the animation is so simple, but on a detailed animation it's really visible that it doesn't smoothly go from one combo into the next one. That little break in between affects the animation and the movement multiplier for a brief moment and I can't find a way to turn it into a smooth combo. Looked at the documentation, but could not find info on this, sorry if I missed it.
     
  4. steelhamsterstudio

    steelhamsterstudio

    Joined:
    Mar 15, 2018
    Posts:
    29
    @skayster You need to add a new boolean parameter into comboWeapon script. It must be "true" while combo cooldown active and you should send this parameter into animator and next you need to add this "false" parameter to idle transitions and other action at your choice. After that, you will have some kind of isolation for character combo and it never interrupted by other animations. It is how I solved this problem.
     
    Mindjar and skayster like this.
  5. Nuclear_Slingshot

    Nuclear_Slingshot

    Joined:
    Jun 17, 2018
    Posts:
    2
    I see the same behavior. I seems that Owner is null, which causes the method to return without drawing the gizmo. Commenting out
    Code (CSharp):
    1. if (Owner == null) { return; }
    results in a NRE in
    Code (CSharp):
    1. float flipped = Owner.IsFacingRight ? 1f : -1f;
    .

    Although the fix that @fabiopov_1 posted works, the gizmo doesn't reflect the area offset settings.
     
  6. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Hello!

    I am evaluating Corgi! I tried the demo and it looks really cool! My vision of this game is to be used for ministry (I know it doesn't happen often).

    In the 4 player minimal demo, confirming it can be pushed to 8 right?

    say if I wanted to do a red team blue team score, with health, is it easy to configure? I have a basic idea of how to do it but I don't know if its possible. I am not a expert at coding. I am using rewired.

    Thank you for answering my questions!!

    You created a amazing demo!!

    Thank you!
    Xalo
     
    Last edited: Sep 10, 2018
  7. Kelgand

    Kelgand

    Joined:
    Feb 3, 2018
    Posts:
    10
    @sultanwalid I am using Rewired and I recommend it. Not to get too off-topic from Corgi in here, Rewired does have a quick and easy way to map all common dual-stick controllers in one go. Once that is done, you really only need to extend Corgi abilities to override the HandleInput function to use the Rewired input and then bind a controller to each player, but that's as simple as a foreach loop on game start.

    It might be a little more complicated than that, my game required a fair bit of customization to Corgi to do what I want so it definitely isn't standard Corgi anymore, but if there was anything else that needed to be changed the error messages made it super straight-forward.
     
    guavaman likes this.
  8. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Regarding the Hurt animation when I was checking the health ability code I notice that there is a function called Damage and when it's start it's calling anim.SetTrigger("Damage");

    So is this the animation transition to play the Hurt animation when the player take Damage?

    So do I need the create a parameter in the Animator of type trigger and call it Damage and then link it to the Hurt animation?

    I'm asking because I have search for this in the documentation but found nothing useful about it?
     
  9. steelhamsterstudio

    steelhamsterstudio

    Joined:
    Mar 15, 2018
    Posts:
    29
    The documentation has a list of all animation parameters. You will find all you need up there.
    Damage.jpg
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    Whoops, the forum stopped sending me notifications (again), really sorry about the delay!

    @bravery > I don' thave any special guide for that, it's just standard Unity :) All the engine does is send and update these parameters. What you do from there usually differs from game to game, it depends on your animations, what tools you use, etc, there's no silver bullet.
    @skayster > Weapon hit effects weren't on the todo list yet. I've added them, thanks for the suggestion!
    @bravery > There's no push animation (yet), I'd suggest sending your own when pushing. For damage there's a Damage animation parameter, as explained in the documentation.
    @skayster > steelhamsterstudio's solution is the way to go
    @Nuclear_Slingshot > Is this still the case in the latest version? I've fixed this (or think I have).
    @XaloX > You can have as many local players as you want. You'll have to define their input, but it can absolutely be done, yes. " if I wanted to do a red team blue team score, with health, is it easy to configure?" > How easy that is depends on your skills, not mine, so I can't answer that question :) It's not built in if that's what you're asking.
    @Kelgand > Thanks for your feedback on Rewired!
    @bravery > As steelhamsterstudio said, it's all in the documentation :)

    Sorry again for the delay guys, and remember, if you need urgent help, please use the support email, the forum notifications are not reliable :)
     
  11. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Yeah I was checking the event system might help with that.

    Awesome!! Definetly!! Thank you @reuno !! :D
     
    reuno likes this.
  12. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Thank you man
    That help
     
    reuno and steelhamsterstudio like this.
  13. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Custom AI Decision: Random/Weighted Chance

    Per above, I wrote a simple random chance script for the new AI brain. It generates a number between 1-100 using random.range. The user supplies a min/max Value and the decision returns "true" if the random number falls within that value. I'm using it to tell the AI Brain to switch weapons "on the fly" during attacks.

    It works fine but I was wondering about optimizing it. Random value is a private float set to 0. I put the random.range function in the OnEnterState and then set the value back to 0 during OnExitState so it generates a new number every time. Is that redundant? Any other suggestions would be much obliged.

    I can post the script here if you'd like, but it's pretty basic....not much to see.
     
    Rockwall33 and reuno like this.
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Boom_Shaka > That sounds like the way to go if you only plan on using that number once in that state. I'm not sure you need to reset the value to 0 on exit if you grab a new one on enter, but it's pretty much costless so I wouldn't worry about it.
     
    Boom_Shaka likes this.
  15. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Yes, only need it once. Thanks. In case anybody else is reading this I changed the random range from 1-100 to 1-maxRangeValue so I can set any size random range in the inspector. It's just a minor update so I can have a little more control over the percentage chance for different outcomes.

    In addition to using it to "choose" weapons/attack types, I'm also using it for weighted higher level decisions like: fly or remain grounded? attack or evade? etc.
     
    reuno likes this.
  16. Nuclear_Slingshot

    Nuclear_Slingshot

    Joined:
    Jun 17, 2018
    Posts:
    2
    Yes, version 5.1. I just tried it in a new project and it still doesn't show the damage area gizmo.
     
  17. andrin2020

    andrin2020

    Joined:
    Mar 9, 2014
    Posts:
    29
    I just updated my project to the 5.1 engine from 4.5.1 and am getting multiple ambiguity errors between MMTools and MMInterface events. Any suggestions on how to fix this?
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  19. guavaman

    guavaman

    Joined:
    Nov 20, 2009
    Posts:
    5,605
    Rewired does come with a Corgi Engine integration:
    http://guavaman.com/projects/rewired/docs/Integration.html#CorgiEngine

    It was built when Corgi Engine was at 4.0. I need to make sure things haven't changed enough in the current version to warrant an update.
     
    Kelgand and reuno like this.
  20. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    I have been using Control Freak 2 for all of my iOS projects. Super easy to implement / use and only about 2 button clicks to get it working again with any Corgi Engine update.
     
  21. HenryChinaski

    HenryChinaski

    Joined:
    Jul 9, 2013
    Posts:
    108
    I have the exact same problem as you had. Did you manage to find a solution?
    I just took the Soldier3DRed Prefab, swapped my model in and changed the links in the Corgi scripts - just as written in the manual.
    Additionally though, my character aims slightly too high if facing right and slightly too low if facing left.
    Are there any requirements for the model besides being a humanoid rig? The only difference to the Soldier3DRed are the WeaponHandle position and the scale of the model container.
     
  22. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    1) Try the weapon flip on switch toggle; if enabled, disable. If disabled, enable
    2) You may also need to put the weapon model into an empty game object and then adjust the transform so that it works correctly, This, combined with the weapon flip toggle solved my issues.
    3) WeaponHandle will definitely have an impact....adjust the location to suit your new model. the model I was using had the weaponhandle on the model's hands - when I activated IK, the weapon constantly spun in a circle because the system was trying to attach it to the handle AND track the IK position.
     
  23. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi reuno,
    I'm trying to utilize the 2D game kit character animation to build the same player character but using corgi engine,

    my challenge is about setting up the same animation inside a animator that get understood by Corgi, as in the 2DGameKit the player character (Ellen) have a couple of animation one when Ellen has no weapon and one animation when she is holding a gun, like there is an idel and Idel_gun, run and run_gun, crouch and crouch_gun ...etc.

    However when you check all Corgi examples it's setup differently.

    So how to do setup character like Ellen (where it have different animation states for every weapon)?

    Thank in advance.
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > I don't know that 2D game kit, so I'm not sure how to help. In any case, and as explained in the documentation, the Corgi Engine is agnostic when it comes to animation. All the engine does is send animation parameter states to your animator, that's all. What you decide to do with them is just regular Unity, so any tutorial you'll find online about animation in Unity will be relevant. In this case I guess you need to learn more about how to setup transitions.
    Edit : to add a bit on that, the engine allows you to specify more parameters for each weapon, so you can have more flexibility. That is done in the weapon's inspector. And if your character's animation is really specific, and you feel like you're missing animation parameters, you can always add your own!
    @HenryChinaski > @Boom_Shaka said it all :)
     
    Last edited: Sep 15, 2018
  25. Razouille

    Razouille

    Joined:
    Jan 25, 2013
    Posts:
    44
    Hello @reuno , your engine looks quite complete, however I would like to know 2 things that I didn't see inside the demo :

    - Is there any ledge grabbing system in your engine, to catch platform corners ?
    - Is there any automatic sliding that we can set if the player is standing on a high slope ? If you take for example the high slope at the bottom end of the mountain level, the character is able to stay on it if you don't press any button (by holding the right direction he will slide over the platform like a wall), but when you press Right direction he will fall on the left.

    Thank you in advance for your time :)
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Razouille > No ledge grabbing (yet), and no sliding (yet). Both are on the todo list though.
    You can see a full list of features on the asset's page (http://corgi-engine.moremountains.com/). If it's not listed there, it's not in the engine :)
     
    Razouille likes this.
  27. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Thanks for the answer,

    I'm thinking in adding a solution a parameter "hasGun" so I can control which one ideal animation I will run (ideal or ideal_with_Gun)? can you please direct me how to do this?
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  29. admadea

    admadea

    Joined:
    Oct 26, 2017
    Posts:
    4
    How would I go about re-enabling gravity during the dash ability? I have my own, slightly modified version of the script, inheriting from the original, and I want gravity enabled to give the dash an arc when executed during a jump. I tried commenting out where gravity is set to false in the IEnum, but that didn't seem to have done anything.
     
  30. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Yes adding a parameter to the animator tree is something I know how to do, the question will be how to tell Corgi abilities how to handle them?
    Like for example there is a jump ability, and it will always call a parameter called "jumping" when you press the jump button, the parameter name is stated in the official documentation:
    http://corgi-engine-docs.moremountains.com/animations.html

    now my target is to decide if the player is not holding a gun then the jump animation will be played (with jumping parameter) but if the player press the jump button and the player is holding a gun then the (jump with gun) animation should play.

    I have the animation + I have added a parameter called JumpwithGun, the question is what ability in Corgi should call this one?
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > It's up to you. You could update that new parameter from a new ability, or by extending CharacterJump, for example.
    Edit : a bit more details, as I can see you're struggling with this. Hopefully this will help.
    If I were to add new animations based on the weapon I'm carrying, here's what I would do :
    - extend CharacterHandleWeapon so it updates a new int parameter in my animator, called GunID. 0 would be no gun, 1 would be a pistol, 2 would be a shotgun, etc.
    - in my animator, I'd set up different transitions based on that. If Jumping and GunID==1, then transition to JumpWithGun1, etc.
    And really this is not specific to the Corgi Engine, that's how I'd do it in any project.

    @admadea > You'll also need to comment that out in the ProcessAbility method.
    So if you comment lines 68, 69, 154 and 155 you'll get the desired behaviour :)
     
    Last edited: Sep 16, 2018
  32. admadea

    admadea

    Joined:
    Oct 26, 2017
    Posts:
    4
    Thank you!
     
    reuno likes this.
  33. HenryChinaski

    HenryChinaski

    Joined:
    Jul 9, 2013
    Posts:
    108
    Thank you very much for your detailed answer!
     
  34. BinarySouls

    BinarySouls

    Joined:
    Jan 14, 2018
    Posts:
    13
    Hey!

    I want to do something specific with horizontal movement.

    Right now, when the character moves horizontally, raycasts proyect in front of the player with some offset. With that, it makes the player stop at that distance from the walls instead of sticking to the wall (video:
    ).

    As you can see, I can't stick to the wall, and this is a problem in my case because I want pixel perfect precision.

    If I change RayOffset to 0 in the Raycasting parameters of Corgi Controller of the player, it goes through the walls. I noticed that when falling to the ground it doesn't happen and the character sticks to the ground.

    Any idea on how can I achieve that?
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @BinarySouls > Just change your collider's width, that should solve your problem.
     
  36. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello,
    i have to players in LevelManager (player two is follwoing player one with ai follow), also i have the GameManager with a GameOver Scene.
    But when all two players are dead, the players do not respawn and the game over scene is not loaded.
    No error message in console.
    Using Unity 2018.2.5f1 withe the minimal features demo scene.
    Any tips for me?
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @knuppel > You'll likely have to implement your own rules for multiplayer.
    You can look at the MultiplayerLevelManager for an example of that.
    And please use the support email for support, thanks!
     
  38. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    I don't want to make a multiplayer game, I'd like to have a sidekick that follows the player and kills enemies.
    Maybe this is interessting for others, too.
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @knuppel > It's the same thing, whether "player 2" is controlled by an AI or not, that makes it "multiplayer" when it comes to the level manager. I can add it to the todo list for sure, but in the meantime, check out the MultiplayerLevelManager to see how it works.
     
  40. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Hello as well!

    First I want to say, I love Corgi!! Its so awesome!! I will be leaving a 5 star review soon!!

    I am trying to get 8 players. I have rewired, and 8 xbox controllers. I added (for testing) 1 extra player in Rewired input manager, and replaced Input Manager script to Rewired IM script. One of my controllers is'nt showing a 4 in the center (I think its still on, even if its not 1-4 player. No one is moving. I did the necessary level Manager stuff for a 5th player.

    I am getting a error at CharacterJump.cs at line 41 which is about MMinput. How can I get it to work so 5-8 can properly deathmatch each other? :p

    Thank you!!
     
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @XaloX > I don't know Rewired at all, so I'm not sure what to tell you. You should ask them directly.
    Plus CharacterJump's line 41 isn't about input at all, so I don't really understand how you'd get an error there.
     
    Rockwall33 likes this.
  42. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Ah I see I got it wrong there, more towards input, its showing as a null. would it be better if I asked Gauvaman Enterprises in the rewired thread?

    I really appreciate the help!! Thank you!!
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @XaloX > Yes, unless it's a Corgi Engine issue, there isn't much I can do :)
     
    Rockwall33 likes this.
  44. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Silly mistake I did haha, Xbox 360 controller is not default setup from integration pack :p Need to put those actions in :D

    Thank you Reuno!! :D Really appreciate it!! :)
     
    reuno likes this.
  45. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Cannot understand how to get it to work. I made a big UI Image as half of my screen and attached MMTouchDynamicJoystick to it but can't figure out the rest.

    Another question, my platform is set to Android but during development I want to be able to test via keyboard, how can I do so? Because currently keyboard input is disabled.
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @UnbreakableOne > Whatever your current build target, you can force mobile or not via the InputManager's inspector, as explained in the documentation :)
     
  47. CaptCollins

    CaptCollins

    Joined:
    Jan 27, 2016
    Posts:
    13
    Yo reuno, just trying to wrap my head around the progress manager here since ive never really used one before. I noticed in the demos you have a progress manager in every level along with the level select scene. Do you need all levels in your progress manager to have a progress manager themselves? Also im doing a 5 world 15 levels each format for my platformer, would I want a new progress manager per world or just 1 for all 5 worlds? Only keeping track of level unlocks, no collectibles or anything complicated. Thanks man, love all the new updates!!!
     
  48. DearUnityPleaseAddSerializableDictionaries

    DearUnityPleaseAddSerializableDictionaries

    Joined:
    Sep 12, 2014
    Posts:
    135
    Hi, I found a swimming bug.

    If my respawn point isn't in water, and I die while swimming and then respawn, the game still thinks I'm swimming.

    I think it's to do with the InWater boolean. How do I fix this? Basically I think one needs to explicitly set "InWater" to false upon respawn (if not in water already).

    Is there a function where I can reset InWater upon player death? I'm also trying to reset the scene's mushrooms, NPCs and stars upon player death - is there a way to do this?

    TL;DR: In the Character Swim ability, the boolean InWater is not reset upon death/respawn.

    Edit: Another bug, is if you keep on walking while hitting the spike (hold D key), the walking sound (Ability In Progress) sound effect still plays while the death animation shows. The death animation also vibrates in a strange manner if you die this way.

    Bugs are reproducible in RetroAdventure1.

    Thanks!
     
    Last edited: Sep 18, 2018
  49. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Any idea?
     
  50. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    If I force the input, my Android build will have that keyboard input. I want to be able to play with the keyboard in the Editor and Android touch when I build.