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

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  2. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hi! I have this problem when trying to load the inventory. Copy all the example, I'm doing everything, except the Save / Load. Could you guide me where to look for the solution?

    It's when I pickup an item, I have it in the inventory correctly, but when I press play the editor again throws this error.

    For the game to work again I have to reset all inventories but the issue continue.. :(

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. MoreMountains.InventoryEngine.Inventory.ExtractSerializedInventory (MoreMountains.InventoryEngine.SerializedInventory serializedInventory) (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:447)
    3. MoreMountains.InventoryEngine.Inventory.LoadSavedInventory () (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:400)
    4. MoreMountains.InventoryEngine.Inventory.OnMMEvent (MMGameEvent gameEvent) (at Assets/CorgiEngine/ThirdParty/InventoryEngine/InventoryEngine/Scripts/Core/Inventory.cs:686)
    5. MoreMountains.Tools.MMEventManager.TriggerEvent[MMGameEvent] (MMGameEvent newEvent) (at Assets/CorgiEngine/ThirdParty/MMTools/Events/MMEventManager.cs:176)
    6. MoreMountains.Tools.MMGameEvent.Trigger (System.String newName) (at Assets/CorgiEngine/ThirdParty/MMTools/Events/MMEventManager.cs:28)
    7. MoreMountains.InventoryEngine.InventoryGameManager.Start () (at Assets/_CallOfCthulhu/Scripts/CorgiInventory/InventoryGameManager.cs:25)
     
    Last edited: Dec 14, 2018
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @gferrari > This error is not enough to tell exactly what's wrong, it could be a number of these things :
    - an item that doesn't exist anymore (you deleted the scriptable object)
    - an item that isn't stored in the right folder (it should be Resources/Items)
    - items with improper names
    - something else maybe
    Also I'm not sure what you mean by "I'm doing everything except the save/load".
    I'd suggest making a fresh install of the engine, and checking if the error happens. If it doesn't, look for differences. If the problem persists, send me more info on what you may have changed on the support email and I'll see what I can do :)
     
  4. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    This one!! "- an item that isn't stored in the right folder (it should be Resources/Items) "

    Thank you!!
     
  5. carlos170586001500

    carlos170586001500

    Joined:
    Mar 2, 2015
    Posts:
    2
    Hi, any way to order the MMEventManager when register the events? I want to trigger the positive effects first on a specific event.
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    Good news everyone, I've just submitted v5.3 of the Corgi Engine to the Asset Store.
    As announced previously, the main feature of this version is the ability to grab ledges and climb them.
    As usual, expect a few days of delay as Unity validates the package.

    Here are the full release notes :
    - Adds Ledges and the CharacterLedgeHang ability, allowing you to place ledges in your levels your characters will be able to hang from. You can then jump from that ledge, or pull yourself up.
    - Adds an example of a MidHeightOneWayPlatform to the FeaturesPlatforms demo scene.
    - Adds an option to reset camera offset on jump
    - Improves the reliability of the mobile buttons on certain Android devices
    - Fixes a bug that would cause the player to get stuck in an unstable state when dying while climbing up a ladder.
    - Fixes a bug that would prevent from triggering button activated zones with certain settings when arriving from the air only
    - Fixes the binding of the ResetSaveFiles button in the StartScreen
    - Prevents jumping while pushing
    - Fixes Pushable's execution order
    - Removes a useless object in the StartScreen scene
    - Fixes a bug with CharacterPush and weapon speed modifiers
    - Fixes a potential null reference exception error in the Pushable class
    - Fixes a bug in some levels where health and jetpack bars would be invisible
    - Fixes a bug with combo weapons equipped as secondary weapons
    - Fixes a bug that would have the treadmills work at the wrong speed on super low fps conditions
    - Fixes a bug that wouldn't correctly unequip the current weapon when dropping it
    - Fixes a bug that would preventing deleting save files on certain platforms
     
    Kelgand, NathanG, Boom_Shaka and 2 others like this.
  8. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    "- Improves the reliability of the mobile buttons on certain Android devices"

    Does this one include joystick or just buttons?
    Had issues on the joy response in my last cell phone, I though it was due to the age of the device (old Moto G from 2014) but it stills working a bit odd in a current phone - sometimes I have to release it then press again to get player response -

    May it be a problem on my side? I left this as it comes out from the box if that helps.

    "- Adds an option to reset camera offset on jump"
    Also, this sound interesting, not sure how it works but I'll try it definitely.
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Muppo > That fix is really just about buttons. I'm not aware of any issue with the joystick, I'd need more info to investigate.
    As for the camera offset reset, it adds more control over situations where you're crouched or looking up and camera is offset, and then you jump.
     
  10. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Oh, I see. Thanks.
    Will make some testing about my joystick issue and send you an email if I find something weird.
     
  11. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi reuno

    Is there an example of how to achieve this:
    • vertical dash which smashes the ground and shakes the camera
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > Sure, as explained in the documentation, that's handled by the CharacterDive ability. You'll find an example of it in the Mesa1 demo scene, for example.
    @Muppo > Alright, let me know what you find!
     
  13. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi renuo,

    Thanks for the info, I notice the dive ability, but it's really difficult to deal with! I mean you will need to be on air and then click on two buttons the F (dash) and quickly at the same time the down arrow S button, so can we do some modification so in case we was on the air (after jump) and only click the down arrow the Dive will get activated?

    will you please how to achieve this?

    Thank in advance.
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > Just like any other ability, you can extend it and override its HandleInput method to have it look at different conditions. Just extending it and having the HandleInput like this will give you the behaviour you're after :

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using MoreMountains.Tools;
    4.  
    5. namespace MoreMountains.CorgiEngine
    6. {
    7.     /// Add this class to a Character and it'll be able to dive by pressing down, pounding the ground in the process.
    8.     /// This class is derived from CharacterDive and shows how you can very simply extend an ability to change how it detects input
    9.     /// Animator parameters : Diving (bool)
    10.     [AddComponentMenu("Corgi Engine/Character/Abilities/Character Simple Dive")]
    11.     public class CharacterSimpleDive : CharacterDive
    12.     {
    13.         /// <summary>
    14.         /// We override input detection to have it simply look at the down direction
    15.         /// </summary>
    16.         protected override void HandleInput()
    17.         {
    18.             if (_verticalInput < -_inputManager.Threshold.y)
    19.             {
    20.                 InitiateDive();
    21.             }
    22.         }
    23.     }
    24. }
     
  15. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    WOW that's great

    thank you man :)
     
    reuno likes this.
  16. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    reuno,

    if I upgrade my unity to the latest version 18.3, is it compatible with Corgi 5.2?
     
    carlos_m_orozco likes this.
  17. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    Hello, what's the best way to reset the gamemanager at the gameoverscreen (or the menuscreen for that matter) ?

    I'm just using
    GameManager.Instance.ResetLives();
    Over a emply gameobject and calling it from the corgi button.
    Trying to use the gamemanager in the scene from the button doesn't work.
    I guess that's because it's using the scene reference of the gamemanager and not the original "don't destroy on load" gamemanager ?
     
    Last edited: Dec 16, 2018
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > Yes, absolutely.
    @shredingskin > What exactly do you mean "reset the gamemanager"? Just reset the lives? Then yes, calling that method will work. You shouldn't have more than one game manager, in any case :)
     
  19. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    Hello and thanks for making this. So far it's working great except for a couple areas, which I'm hoping can be resolved through help:

    1. The melee attack animation is ending too soon and the state changes back to idle before the attack animation is completed. Is there a way to ensure the attack animation completes before returning to idle?

    2. I would like to stop movement during attack animations or have a configurable "move forward" distance when each attack is executed. Should I build that through an extension of CE or is there an out of the box solution for doing this?

    Thanks in advance!
     
    andreiagmu likes this.
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Glaswyll > 1. You probably have another transition interrupting your animation. Animations in the engine is handled through Unity's native animator system, all the engine does is send and update parameters, so you have complete control over your animator and can tailor it to each character. Usually you'll want to look at exit time, and possibly diverge from the demo "any state" pattern, that works for a demo but your character might require something more traditional.
    2. You can (via the Weapon inspector) prevent movement during attack, or modify the movement speed. It may or may not be what you're after. These are the two only options related to movement when it comes to weapons.
     
    andreiagmu likes this.
  21. Glaswyll

    Glaswyll

    Joined:
    Feb 13, 2014
    Posts:
    103
    Yeah I saw your reply to a previous poster asking about a similar issue and found my answer. Thank you!
     
    reuno likes this.
  22. MoFaShi

    MoFaShi

    Joined:
    Oct 25, 2015
    Posts:
    43
    this is the best asset I have bought on AssetStore. it contains so many features, most of them are really cool.
    and I have learned a lot of new things from it. hope the author could add more features to it.
     
    reuno likes this.
  23. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi reuno

    If I want my character to climb the wall is it possible to do so?
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @MoFaShi > Glad you like the engine!
    @bravery > It's possible (everything is) but it's something you'll have to implement for now, it's not built-in. It's on my todo list though (and quite high).
     
  25. Mehrdad155

    Mehrdad155

    Joined:
    Jul 4, 2016
    Posts:
    7
    Hi
    I want make a cinematic platformer game like Flashback or Another world game. I have some parameters. If that was Ok I'll buy it now:
    I want for 2D only:
    1) Character don't move to left and right in the air
    2) Width jumping. Character make arcs for jumping and get new position.
    3) Standing after falling. After finish standing animation, player move again.
    4) Swim and change animation to swiming and grab ledges for out of water.
    5) show turning character animations before walking to left and right.
    6) Multiple rooms instead scrolling camera.

    Thanks a lot
     
  26. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Nice any hint or advise where I can start? Like for example how can the ladder implementation help me on this one?
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > Sure, the ladder could be a good start for this I guess :)
    @Mehrdad155 > Pretty much none of these features are in the engine right now, but all could be easily added by extending existing abilities or creating new ones. I can add these features to the todo list (a few of them are on it already).
     
  28. Mehrdad155

    Mehrdad155

    Joined:
    Jul 4, 2016
    Posts:
    7
    @reuno
    Which one is ready? I'm appreciate for mention them by numbers
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  30. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi Reuno,

    Wow man I was reading the wall clinging and the character ladder scripts to try to implement my own Wall Climping although they look nicely arranged but there is many factors need to take in consideration, it's not an easy task :(

    although I like to share my simple trial so maybe I can get some help:

    Code (CSharp):
    1.     [AddComponentMenu("Corgi Engine/Character/Abilities/Character Wallclimping")]
    2.     public class CharacterWallClimping : CharacterAbility
    3.     {
    4.         /// This method is only used to display a helpbox text at the beginning of the ability's inspector
    5.         public override string HelpBoxText() { return "Add this component to your character and it'll be able to climp to walls, moving up the wall. Here you can define the move up factor (close to 0 : super slow, 1 : fast) and the tolerance (to account for tiny holes in the wall."; }
    6.  
    7.         /// the speed factor when wall climping
    8.         public float WallClimpingSpeed=2.0f;
    9.         /// the tolerance applied to compensate for tiny irregularities in the wall (slightly misplaced tiles for example)
    10.         public float WallClingingTolerance = 0.3f;
    11.  
    12.         /// <summary>
    13.         /// Checks the input to see if we should enter the WallClinging state
    14.         /// </summary>
    15.         protected override void HandleInput()
    16.         {
    17.             // if we're pressing left or right
    18.             if ( (_horizontalInput <= -_inputManager.Threshold.x) || (_horizontalInput >= _inputManager.Threshold.x) )
    19.             {
    20.                 WallClimping();
    21.             }
    22.         }
    23.  
    24.         /// <summary>
    25.         /// Every frame, checks if the wallclinging state should be exited
    26.         /// </summary>
    27.         public override void ProcessAbility()
    28.         {
    29.             base.ProcessAbility();
    30.             WallClimping();
    31.             //ExitWallClinging();
    32.             //WallClingingLastFrame ();
    33.         }
    34.         /// <summary>
    35.         /// Makes the player stick to a wall when jumping
    36.         /// </summary>
    37.         protected virtual void WallClimping()
    38.         {
    39.             if (!AbilityPermitted
    40.                 || (_condition.CurrentState != CharacterStates.CharacterConditions.Normal)
    41.                 || (_controller.State.IsGrounded)
    42.                 || (_controller.State.ColliderResized)
    43.                 || (_controller.Speed.y >= 0) )
    44.             {
    45.                 return;
    46.             }
    47.  
    48.             if ( ( (_controller.State.IsCollidingLeft) && (_horizontalInput <= -_inputManager.Threshold.x) )
    49.                 || ( (_controller.State.IsCollidingRight) && (_horizontalInput >= _inputManager.Threshold.x)))
    50.             {
    51.                 MMDebug.DebugOnScreen("value is:" + _verticalInput * WallClimpingSpeed);
    52.                 // we disable the gravity
    53.                 //_controller.GravityActive(false);
    54.                 //_controller.CollisionsOn();
    55.                 _controller.SetVerticalForce( _verticalInput * WallClimpingSpeed);
    56.                // CurrentWallClimpingSpeed = Mathf.Abs(_verticalInput) * transform.up;
    57.  
    58.             }
    59.         }
    60.  
    61.  
    if any help is available that will be appreciated.
     
  31. artonator

    artonator

    Joined:
    Sep 12, 2009
    Posts:
    69
    HI, I have purchased your engine, it looks awesome. Great job.

    I have one question.

    I have a round platfrom which is rotating though when a character landed into that platform, it stays where it landed instead of rotating with the platform, is there a way I can fix this?

    Thank you
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > It's no easy task indeed. As I said, it's high on my todo list, it shouldn't be too long before it makes it into a release.
    @artonator > You'll need a script for that, it's a non physics based engine, nothing happens without a script explicitely telling things to happen. You can look at how the moving platforms work for reference.
     
  33. matttardiff

    matttardiff

    Joined:
    Feb 27, 2018
    Posts:
    30
    This is the best update! I'm so very happy with the additions and fixes. Our girls say "Thank you!"
    13903331_10210968361791856_3328912814743514404_n.jpg
     
  34. matttardiff

    matttardiff

    Joined:
    Feb 27, 2018
    Posts:
    30


    Hopefully i'm just doing something wrong.
    When I add the CharacterGrip to my character and Grip to the Object, no matter what, she'll always get sucked into the middle and stuck in her jump animation.
    When I remove the Grip component from the object, everything returns to normal.
    Here is what I've tried so far, even if some of it seems pointless.
    • Offset the grip values
      • This has the same result where I've offset the values.
    • Changed Layers
    • Changed Sorting
    • Removed and added several times
    • The object has a Box Collider 2D and its collision is the size of the object.
    What am I missing?

    Screen Shot 2018-12-17 at 4.00.31 PM.png Screen Shot 2018-12-17 at 4.01.16 PM.png
     
  35. pjooren

    pjooren

    Joined:
    Apr 12, 2017
    Posts:
    14
    So I had been working on my game using the Corgi Engine for months, I've got a lot of time invested into it, I didn't import the new updates nor did I upgrade Unity until now. I decided to update to 5.3 because some of the features looked useful. This of-course required that I upgrade Unity. So I upgraded from 2017.2 to 2018.3. Now, I've got 40 or so compiler errors and it's a bit overwhelming to try to fix for someone that isn't very skilled at troubleshooting code. One of the reasons I purchased the Corgi Engine is because I'm not good at code. Sooo, is there something obvious that I'm missing? Am I the only one? or am I going to have to try to figure out each one of these errors? Or worst yet start over rebuilding everything I've done so far?
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @matttardiff > Are these yours? They're adorable!
    As for the grip, I'm not sure what you were expecting, as you don't mention it :) As explained in the documentation, grip will indeed stick you to the center of the object (plus the offset) and turn the Gripping animation parameter to true, that's what the ability does, that's by design. You can see an example of it in the FeaturesPlatforms demo scene (the rope uses it). Maybe what you're after is the CharacterLedgeHang ability? If so, you can see an example of it in action at the start of the RetroPush demo scene, and check the documentation for more info about it.

    @pjooren > The safest way would probably to rollback to a previous version of Unity and your project. Then I guess I'd need to know more about the errors, are they engine related? Or in your own code? I'm not aware of any errors with 5.3 and 2018.3, it's gone through a lot of beta testing and no errors were reported. So my guess is it's in your code, and if it is, then rollbacking to a previous commit would be the way to go, especially if you don't want to debug :) Otherwise, I'm gonna need more info, such as wether or not these errors happen with a fresh install of the engine, and if they don't, what version you were coming from, etc. And please use the support email for support questions like these, thanks!
     
  37. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    When I want to add a custom projectile to the MM Simple Object Pooler (script) I get this Error:
    Exception: MinimalShotgun(Clone) is trying to spawn objects that don't have a PoolableObject component.

    The Asset is this here:
    https://assetstore.unity.com/packages/vfx/particles/aaa-stylized-projectiles-vol-1-130378

    How can I add those projectiles into the corgi engine or make those projectiles poolable?

    I am a newbie to game making, please help!

    Thanks
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @captnhanky > As the error tells you, you need to add a PoolableObject component to your projectile.
    You can see many examples of that throughout the engine's demos.
     
  39. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    ..but I need to add these particle bullets.

    Is there a easy way to manually override your bullet script to insert these bullets?
    Because I don´t want to use some cartoon sprites for shooting.

    Thanks
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @captnhanky > I'm not sure I understand what you mean. There's nothing to override, there is no bullet script, and nobody mentioned sprites. Your projectiles need that PoolableObject component, that's all :) Again, don't hesitate to look at the many examples of projectiles already included in the demos for reference.
     
  41. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Ok thanks, I will look into it!
     
  42. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    I just watched your tutorial on weapons, but unfortunately it does not mention how to make objects poolable.
    Can you please point me to a specific video or online tutorial?
    Thanks
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @captnhanky > As I've mentioned twice already, all you have to do is add the PoolableObject class to your projectile. You just select your projectile and click Add Component > PoolableObject, it's that simple.
    And don't hesitate to look at projectile examples in the demos. If you keep having issues with this, please use the support email.
     
  44. Meowx

    Meowx

    Joined:
    Oct 10, 2015
    Posts:
    33
    Is there a way to use the AddForce function to add force relative to the character (positive for forward, negative for backwards regardless of direction character is facing) rather than absolute (positive for right, negative for left)?

    Thanks!
     
  45. matttardiff

    matttardiff

    Joined:
    Feb 27, 2018
    Posts:
    30
     
  46. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    I sent you an email, it does not work.

    Thanks for your patience.

    Andy
     
  47. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Hi reuno,

    Currently the Dash is happening either left or right, can we dash on the 8 directions? like if I'm pressing the up + left buttons + dash button then the dash will be to the upper left direction?

    I checked the dash ability but it does not have this as configuration, so can you advise and provide some hints on achieving this?
     
  48. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    I notice that in the Dash ability in the function called Dash, there is:
    _dashDirection = _character.IsFacingRight ? 1f : -1f;

    that's what decide the direction wither it's right or left, then there is:
    _computedDashForce = DashForce * _dashDirection;

    That decide the dashforce will be right or left.

    As the function is using
    _controller.SetHorizontalForce(_computedDashForce);
    to computer the force in the X axes, so we will need to add another variable for the Y axes and called the function:
    _controller.SetVerticalForce

    What I'm searching for is how to replace the _character.IsFacingRight (which return only left and right) with some code that depend on the input to decide the direction that I need to pass to _controller.SetHorizontalForce and _controller.SetVerticalForce,


    any suggestions?
     
    Last edited: Dec 18, 2018
  49. Meowx

    Meowx

    Joined:
    Oct 10, 2015
    Posts:
    33
    Lol well I think you just unintentionally answered my question about adding force relative to character direction.

    For yours, you'll want a function that looks at the vertical and horizontal input from the input manager in CharacterAbility.cs and uses that data to give a Vector2 to the AddForce or SetForce functions (which control X and Y, as opposed to the AddHorizontalForce and SetHorizontalForce functions, which as their name implies only deal with horizontal movement).
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Meowx > There's no dedicated method for that, but you can use _character.IsFacingRight to determine the facing direction.
    @captnhanky > I didn't get your email. Please use the support contact form.
    @bravery > No option for that (yet). You'll want to compute the direction based on the input vector, @Meowx's answer is pretty spot on.
     
    Meowx likes this.