Search Unity

[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. codejoy

    codejoy

    Joined:
    Aug 17, 2012
    Posts:
    204
    @reuno I noticed in examples like the RetroForest that the Gunpickup item pickers do not correctly respawn. They still have a quantity of 0 on respawn. So if you pick up a gun... go drop the gun elsewhere, die, then the original pickup will not give you a gun. The same holds true mostly for bullets and other ammo pieces too. is this an intended behavior? Additionally the respawn won't 'back out' inventory items already obtained. So if you obtain an item and die it is still in your inventory. Ideally one would be able to reset the state of the inventory on checkpoints as well (I suspect this would be a huge pain to code up though)
     
  2. Ohamallama

    Ohamallama

    Joined:
    Feb 8, 2018
    Posts:
    2
    @reuno
    Is it possible to add a Play Random Sound option to a weapon? I would like to be able to load up multiple sounds and upon weapon use, play 1 of those sounds at random to add variation.

    I deduced that it would be in the Weapon.cs portion, here:

    Code (CSharp):
    1.         [Header("Sounds")]
    2.         /// the sound to play when the weapon starts being used
    3.         public AudioClip WeaponStartSfx;
    4.         /// the sound to play while the weapon is in use
    5.         public AudioClip WeaponUsedSfx;
    6.         /// the sound to play when the weapon stops being used
    7.         public AudioClip WeaponStopSfx;
    8.         /// the sound to play when the weapon gets reloaded
    9.         public AudioClip WeaponReloadSfx;
    10.         /// the sound to play when the weapon gets reloaded
    11.         public AudioClip WeaponReloadNeededSfx;
    This would add a lot to the polish of a game. Thank you!
     
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Ohamallama > You can easily extend the weapon class to add an array of sounds and pick one from that if you want.
    @codejoy > An easy way would be to simply reload the level, that'd solve it all. I can add more options for respawn on objects and inventories to the todo list though.
     
  4. Magixapps

    Magixapps

    Joined:
    Mar 4, 2017
    Posts:
    55
    hi, i want my player always on my scene (not spawn when the game begin but already on scene when i start the game) its possibe? i use "minimal pixel perfect scene"
    Thanks
     
    Last edited: Mar 2, 2018
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @BOOapp > Yes, of course it's possible.
    There are examples of that, in the MinimalGravity scene for example, you get a bunch of player controlled objects, it works just fine.
     
  6. rscott78

    rscott78

    Joined:
    Nov 22, 2016
    Posts:
    4
    I'm considering a purchase of this game engine. Does anyone know how hard it would be to integrate it with the Bolt multiplayer asset?
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @rscott78 > I've never tried Bolt myself, but I know a lot of people are currently using the Corgi Engine along with Playmaker, and from what I know of Bolt it's pretty similar, so I'm guessing it'd work. Would love to hear feedback from people who've actually tried it :)
     
  8. Magixapps

    Magixapps

    Joined:
    Mar 4, 2017
    Posts:
    55
    ok, but i want my principal player not spawn ( the player followed by the camera).
    I want place the principal player on the scene myself and that player is flowed by camera.
    Thank you for your help
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @BOOapp > I suggest extending the LevelManager to implement your own specific changes then :)
    Or simply have another script bind that player to the camera if you prefer.
     
  10. rscott78

    rscott78

    Joined:
    Nov 22, 2016
    Posts:
    4
    @reuno Thanks for the quick reply! Could this game engine be used to create a dynamic level with voxel-style destruction and placement of blocks (i.e, like a 2d Minecraft)?
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  12. codejoy

    codejoy

    Joined:
    Aug 17, 2012
    Posts:
    204
    Very Good, I can do that for now.

    Also one thing I would love to see in this engine (I know you don't try to fill up the engine but make it extendable). Though some hooks for different damage types would be awesome... it is neat to have situations where big bad boss isn't effected by your weapon can ignite bombs that do hurt the boss. Since I didn't see how I could coax the current classes to do this out of the box, I will be extending the health and damage on touch I think. Probably with another class of DamageType or something to that effect.
     
  13. pjooren

    pjooren

    Joined:
    Apr 12, 2017
    Posts:
    14
    Sorry, some of this is just a little over my head. I'm getting a few errors when I try to implement this.

    "The type of namespace name ' CharacterHandleSecondaryWeapon' could not be found. Are you missing an assembly reference?"
    "The type of namespace name ' CharacterHandleSpecialWeapon' could not be found. Are you missing an assembly reference?"
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @codejoy > I can add different damage types to the todo list, but that's gonna be low priority. It's very specific.
     
  15. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    Hi @reuno.I"m having a problem about spine in corgi engine.I follow the tutorials about Animation and Player do work.My problems is duration of animation spine (for ex Idle, Walking, Jumping) different duration when Player on scene.It can't exactly what spine can play the animation.The player walking slower and don't exactly.Please suggest for me solution.thanks, bro!
     
  16. Hellwaiker

    Hellwaiker

    Joined:
    Jan 8, 2016
    Posts:
    118
    Hello,
    I want add weaponless martial melee attacks, (Kick/Punch), and I have a few questions.
    Is the weapon good way to do this? Or is the weapon best suited to only one button for activating it scenarios?
    Is there a way to add custom input support without overwriting the Input manager?

    The final desired behavior for is that I Click one button and character Kicks and I click another and player Punches. Each attack would have different animation and damage value.
    Damage behavior is pretty much same as on minimal melee weapon.
     
  17. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    I made a simple auth example of a platformer if you want to see an example of how to do that, might give you an idea of how to convert this to server auth networking. If you don't want server auth it should be relatively easy.
     
    reuno likes this.
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Green-Jungle > I'd suggest reading Spine and/or Unity's documentation about animators. The animator is really part of Unity. All the Corgi Engine does is send parameters to it. What you do with them is up to you :)
    @Hellwaiker > Yes, weapons are the good way to do it. No way to add input without overwriting. And for your specific behavior, you should override CharacterHandleWeapon to distribute input correctly.
     
  19. Ordnas006

    Ordnas006

    Joined:
    Jun 5, 2016
    Posts:
    53
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Ordnas006 > Looking really good, thanks for sharing! Can I add this to the engine's showcase?
     
    Ordnas006 likes this.
  21. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    I read Spine corgi document.Player still work good.I mean time of animation when run demo different time when run with character corgi.I'm wondering why you use spine that need more animator of Unity.usually If using spine I only need run name of it.I tried change time of animtion but don't exactly.this is my photo.
     

    Attached Files:

    Last edited: Mar 5, 2018
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Green-Jungle > I didn't understand any of this. Again, the animator is just regular Unity, nothing specific to the Corgi Engine. Go check out Unity's documentation about it.
     
  23. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    If you don't mind I can send spine player(json,atlas) to your email and you can check help me?Thanks a lot!
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Green-Jungle > Once again, this has nothing to do with the Corgi Engine. I'm not a Unity teacher. I'm happy to help if you've got issues with the engine, but this is the animator, and it's part of Unity, like regular Unity. Please, look at Unity's documentation, or check out Spine's documentation.
     
  25. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    In fact,I think that this problems involve to engine.because If I only use spine I shoudn't need use animator.But when using corgi engine I should custom spine via animator.
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Green-Jungle > You're confusing a lot of things. Feel free not to use an animator if you want to, but really, animations are not handled by the engine (all the engine does is update parameters), so I can confidently say this is not an engine problem. I'm not sure what else to add at this point. Again, I'd recommend reading Unity's documentation about animators, it holds the answers you seek.
     
  27. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    as you know,I have never use spine with animator.because spine was created to don't need use animator in unity.I searched some of article about this problems and I think that they also have problems same to me.
    http://vi.esotericsoftware.com/forum/Understanding-how-Spine-Mecanim-Corgi-Engine-blend-7415
    http://vi.esotericsoftware.com/forum/Spine-With-Corgi-Engine-in-Unity-7710
    Maybe I will do it by myselt.thanks a lot!
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Green-Jungle > I'm pretty sure you're confusing things, and would benefit greatly from reading Spine's and Unity's documentations about animations. But please, keep ignoring this advice :)
     
  29. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hello Reuno, just a couple of minor suggestions for the DialogueZone - being 2 boolean activation options for pause gameplay (freeze time) and/or make playable character invincible until dialogue is completed. The second option is probably the more important one so that enemies can still wander around the player whilst they are in dialogue mode at runtime. Not sure if you covered that latter scenario, still looking to see if I can spot any options.
     
  30. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    Thanks @reuno I wrote a separate class to run animation sprite by name in Update as this:
    if (_movement.CurrentState == CharacterStates.MovementStates.Jumping)
    transform.GetChild(0).GetComponent<SkeletonAnimation>().AnimationName = "Jumping";
    Do you think is it good? :)
     
  31. Magixapps

    Magixapps

    Joined:
    Mar 4, 2017
    Posts:
    55
    I have not resolve that problem, when I put a script for camera follow the player, i lose perfect pixel effect.
    2days i work for that.
    I just want the player is in my scene before play and followed by camera with that pixel perfect effect, not spawn player when i press play.
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @MudPuppet > Thanks for the suggestions! I feel like these are already things that can be added pretty easily in the current state of things, as there are already methods to freeze/slow down time, and to turn the player invincible. I'm not sure I'd want to turn the dialogue zone into a more complex thing (it's already quite big), so I'd suggest extending in this case.
    @Green-Jungle > As long as it works for you, it's good :)
    @BOOapp > Well if you don't want to use the engine as it's meant to be used, you'll need to plug your character into LevelManager, and possibly to the camera. Just look at the code, look at all that's done by the spawning system, all that you'll need to do as well. Spawning your character is good practice, you're absolutely free to do things differently, but of course it'll imply some (minor) work on your part. If you've spent 2 days on this already, maybe try with something a little more basic first.
     
  33. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @xpachin Thanks! Well there is a combination of stuff going on there. I'll probably change the platforms to not receive dynamic lighting the way they are now but I'm using 2DDL for the cool "volumetric" effects and I've created normal maps for the characters and platforms so that they project some depth. As I said I will probably remove these effects from platforms and just have them on characters and backgrounds for the final build but for now that's how it is set up. If you have a lit sprite texture it will receive light from unity lights but it won't show depth without normal maps. I use SpriteIllumintor to create the normal maps.
     
    twomack37 and reuno like this.
  34. knuppel

    knuppel

    Joined:
    Oct 30, 2016
    Posts:
    97
    Hello, is there a example scene where character is using a sword as weapon?
     
  35. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    Hey Reuno, yeah I knew that I could have tackled it myself but considered this an out-of-the-box issue as strange things can happen with player/dialogue/enemies/health/death as it currently is without having one or both suggested options in place. I will do a vanilla test with one of your demo scenes to be sure of what I am experiencing and get back to you.
     
    reuno likes this.
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @knuppel > There's one in the retro levels, and there's also a sword for the corgi character, and one for the minimal rectangle.
     
  37. Liverlips

    Liverlips

    Joined:
    Sep 21, 2017
    Posts:
    2
    Hi! I love working with corgi, and have made some 2D characters that have full movement when loaded with the game manager and when just dropped in the scene..

    but now i want to implement machine learning with my character without having inputs. My question is how would i simulate passing my keyboard commands to a corgi character? say i have a character in my scene, and i have a script attached to it that references the character.

    How i would i call the referenced corgi character to move horizontally or jump one unit? Say for example i want simulate pressing the space bar one time, how would i send a "jump()" command to my corgi character in the scene, simulating a jump ? i'm having a hard time trying to understand how movement gets called on a object that we are not controlling with a game manager..

    Thank you for your help!
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Liverlips > Have a look at how the AI scripts work, that's exactly what you're looking for. Basically each ability's got a bunch of public method (RunStart, JumpStart, etc), that you just have to call to trigger. Which means you'll need references to each ability you want to interact with. Again, that's how the AI scripts work :)
     
  39. Liverlips

    Liverlips

    Joined:
    Sep 21, 2017
    Posts:
    2
    I was actually just thinking about how the robots moved around as i submitted this ... Il take another look at those! THANK YOU FOR THE FAST REPLY WOW <3
     
    reuno likes this.
  40. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    @pjooren Here try this version. It's probably because I have the secondary and special weapon script references in there and you don't use those extensions, since they are custom. I might have to modify this script and ask reuno to update the public repo with the "vanilla" script. Lemme know if this works for you:


    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using MoreMountains.CorgiEngine;
    5. using MoreMountains.Tools;
    6. public class WeaponDisable : CharacterAbility {
    7.     public override string HelpBoxText() { return "This component handles the disabling of weapons during both wall hanging and ladder climbing.  This is to create a more visually pleasing situation and should be supplimented in the animator with animations that include the weapon in the position the designer would like it to be in while clibming or wall hanging"; }
    8.     private GameObject weapon;
    9.     private GameObject weapon2;
    10.     private GameObject weaponSpecial;
    11.     private CharacterHandleWeapon weaponScript;
    12.     [HideInInspector]
    13.     public bool usingSwitch;
    14.     void Awake ()
    15.     {
    16.         weapon = transform.Find("WeaponAttachement").gameObject;
    17.         weaponScript = GetComponent<CharacterHandleWeapon>();
    18.         secondaryWeaponScript = GetComponent<CharacterHandleSecondaryWeapon>();
    19.         specialWeaponScript = GetComponent<CharacterHandleSpecialWeapon>();
    20.         usingSwitch = false;
    21.     }
    22.     void Update ()
    23.     {
    24.         if(_movement.CurrentState == CharacterStates.MovementStates.LadderClimbing || _movement.CurrentState == CharacterStates.MovementStates.WallClinging || usingSwitch)
    25.         {
    26.             DisableNormalWeapons();
    27.             DisableSpecialWeapons();
    28.         }
    29.         else
    30.         {
    31.             EnableNormalWeapons();
    32.             EnableSpecialWeapons();
    33.         }
    34.     }
    35.     public void EnableNormalWeapons ()
    36.     {
    37.         weapon.SetActive(true);
    38.         weaponScript.enabled = true;
    39.         if(secondaryWeapon && secondaryWeaponScript != null)
    40.         {
    41.             weapon2.SetActive(true);
    42.             secondaryWeaponScript.enabled = true;
    43.         }
    44.     }
    45.     public void EnableSpecialWeapons ()
    46.     {
    47.         if(specialWeapon && specialWeaponScript != null)
    48.         {
    49.             weaponSpecial.SetActive(true);
    50.             specialWeaponScript.enabled = true;
    51.         }
    52.     }
    53.     public void DisableNormalWeapons ()
    54.     {
    55.         weapon.SetActive(false);
    56.         weaponScript.enabled = false;
    57.         if(secondaryWeapon && secondaryWeaponScript != null)
    58.         {
    59.             weapon2.SetActive(false);
    60.             secondaryWeaponScript.enabled = false;
    61.         }
    62.     }
    63.     public void DisableSpecialWeapons ()
    64.     {
    65.         if(specialWeapon && specialWeaponScript != null)
    66.         {
    67.             weaponSpecial.SetActive(false);
    68.             specialWeaponScript.enabled = false;
    69.         }
    70.     }
    71. }
     
  41. Magixapps

    Magixapps

    Joined:
    Mar 4, 2017
    Posts:
    55
    Hi,
    player can jump when i use joystick?
    i want my player jump when i up joystick, i not want use button.
    Thanks :)
     
  42. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @BOOapp I haven't tried it by myself but that seems to be Unity related, not CorgiEngine. Check out Project Input Options, it should be there.
     
    reuno likes this.
  43. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    Hi @reuno .I wanna ask about CameraController.I setup cameraspeed==1.but when player jump higher with platform then player fall so slow.How can I change player move horizontal with cameraspeed=1 but when player jump high and when falling I wanna camera move faster with axis Y.
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Green-Jungle > I'm sorry but each of your question is impossible to understand. Look at the camera's documentation, it contains all there is to know about the camera.
     
  45. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    @reuno.Sorry I'm not good English.Maybe how I try to explain for you not good.I mean if setup Camera Speed==1 then player move by horizontal is good but vertical is slow.I wanna when the player falls by vertical faster.
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Green-Jungle > Don't hesitate to extend the camera script to suit your own needs, it's all commented, it should be quite easy.
     
  47. Green-Jungle

    Green-Jungle

    Joined:
    Jun 10, 2014
    Posts:
    79
    @reuno Thanks for the support.I will try.
     
    reuno likes this.
  48. rbagao

    rbagao

    Joined:
    Feb 13, 2016
    Posts:
    19
    this is so cool :)
     
    NAiLz likes this.
  49. CHEMAX3X

    CHEMAX3X

    Joined:
    Jan 8, 2018
    Posts:
    265
    Hello, i don't know if this is a bug or something but when the player is in the middle of the air and it does a stomp to kill an enemy, it happens 2 things: or the player goes through the enemy like a ghost or it get's killed instantly, this happens only when i use the stomp as the first attack, if i use a jump and then the stomp works fine.

    I don't know if i was clear.
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @CHEMAX3X > Please use the support email for support questions, thanks. And I'd need more info : Unity version, engine version, where in the demos I can reproduce the problem, etc. Otherwise it's impossible to help :)
    Edit : there's no such thing as stomp, I mean it's not supposed to damage enemies if you're referring to the dive, at least not in the demos.