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

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Sir thanks for quickly respond.Now i understand why you make custom weapon parameter name.I made some character animation can rotate with weapons angles and it works!Me Catman as an artist think you are genius!
     
    reuno likes this.
  2. bl4ckfr05t

    bl4ckfr05t

    Joined:
    May 13, 2017
    Posts:
    4
    Hi, how to switch rooms when I'm going from one room to another without the Teleporter or GoToLevelEntryPoint?
     
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @bl4ckfr05t > I'm not sure what you mean, these are the two ways to go from one room to another. You can create new classes if you want to, targeting the same APIs these two do, or extend the system. If you have more questions, please use the support form, thanks!
     
    bl4ckfr05t likes this.
  4. Pvt_Hudson

    Pvt_Hudson

    Joined:
    Jan 20, 2016
    Posts:
    41
    Hello, i am trying to substitute a human character in the new 3d demo scene.
    Is it possible to have the weapon (e.g. pistol) follow both the position AND rotation of the weapon attachment ?

    I am using Weapon Aim with Mouse aim control and Free rotation mode, with limited aim angle (+/- 20).

    When the character looks up (and arms also face up as part of the animation), the gun is still facing horizontal which looks very odd. Whilst I could widen the min/max angles, the player can rotate the gun at unrealistic angles.

    So what i am trying to achieve is... the gun moves based on the "weapon attachment" position and rotation, and the player can then influence the aiming within a limited range based on where the character is facing/aiming.
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Pvt_Hudson > The best way to do that natively would be to widen your aim angles. Alternatively, you can extend the WeaponAim class to implement your own specific rules and have it be a mix of attachment rotation and some input influence.
     
  6. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    I dont know whats looks like in your scene.In my situation I use anima2d and character animation to relative Pistol's angle(I dont know how to programing.I dont have any choice:( ).So far it likes fine at aim.A small problem for me is pistol keep rotation with mouse direction when the character play reloading animation.It depending on the art style and final visual effect you use:)
     
  7. wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    wechat_os_Qy0z_aF7Nfhquhava38GLxUWU

    Joined:
    Dec 22, 2021
    Posts:
    56
    Hi reuno Please show me the way
    At PixelRouge demo.The Adventure can change appearance when armor equiped.
    I want CharacterInventory ability can equip armor or helemt.When the armor equiped then character can replace skins.The Corgi Engine only support weapon and hotbars.What should i do?
     

    Attached Files:

  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
  9. Pancakz

    Pancakz

    Joined:
    Sep 24, 2021
    Posts:
    6
    Hello, I just started using Corgi Engine and so far I love it.
    I'm trying to find the best way to use a cat sprite in a 2D platform level. The issue I have is that it seems the engine only supports box colliders for players, am I right ? While that works fine for simple standing characters, I'm finding it difficult to handle a cat sprite correctly.

    If I put the box collider on the body, the cat's face goes through walls
    If I extend the collider to cover the body and the face, it means my cat can land on a platform even though its body is not touching the ground and it looks like it's floating (picture attached).

    Does Corgi (or Unity) has anything that can help me dealing with this ?
     

    Attached Files:

  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Pancakz > No, the engine only works with box colliders, like most platformers do.
    I'd recommend adjusting your collider's width to have it only cover the body, and then deal with rendering issues (like a cat's face going through walls) at the rendering level. Typically a sorting layer tweak will solve this.
     
  11. Pancakz

    Pancakz

    Joined:
    Sep 24, 2021
    Posts:
    6
    Alright, thank you for the advise !
     
    reuno likes this.
  12. otphj_llc

    otphj_llc

    Joined:
    Feb 15, 2021
    Posts:
    3
    Hey I'm having a bit of a problem with the combo weapon playing my full animations. In the gif you can see the animations playing out how I want them in order, then you can see how it looks in game. The animations come out truncated for some reason. I've tried messing with the "Time Between Uses" and the "Active Duration" parameters but they don't seem to do much. Any help would be appreciated!
     

    Attached Files:

  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @otphj_llc > As explained in the documentation (https://corgi-engine-docs.moremountains.com/animations.html#debugging-animations), if your animations are "truncated", then it's likely because another transition is interrupting them. Making sure your transitions are setup correctly will fix the problem. How to do that depends on your animator, there's no universal setting for this, but checking your exit times and points of entry into animations would be a good start.
    You can learn more about Unity's animator at https://learn.unity.com/tutorial/controlling-animation or https://www.gamedeveloper.com/design/unlocking-unity-animator-s-interruption-full-power
     
  14. otphj_llc

    otphj_llc

    Joined:
    Feb 15, 2021
    Posts:
    3
    Thanks @reuno ! One last question, is there a parry/blocking ability, and if not how would you go about starting to create one? Cheers!
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @otphj_llc > No, there isn't. You can see a full list of abilities in the documentation. As for how to create one, that'd be a new system, and how to implement that would depend on your exact specs, there are tons of different ways to go about it.
     
  16. ViBrentStudios

    ViBrentStudios

    Joined:
    May 3, 2021
    Posts:
    1
    Did you ever find the solution to this? All my key operated doors stopped responding same as you had here..
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @ViBrentStudios > Make sure your item's asset file name matches your ItemID.
     
  18. Cosmobeard

    Cosmobeard

    Joined:
    Jan 7, 2022
    Posts:
    1
    Hello Reuno,
    I bought Corgi and TopDown engine recently and I've been having strange issues with the character movement. I'm on a Macbook Pro M1Max Apple Silicon with Mac OS 12.1. Unity editors are freshly downloaded, nothing changed in project settings or Preferences, and are versions LTS 2020.3.25f1 (Intel running Rosetta II) and beta 2021.2.7f1 for Native Apple Silicon.

    I imported the assets like normal, everything is fine, no errors.
    When I play any of the demo scenes for both Corgi and TopDown, the character movement acts strange; If I continually tap and release the A (left) or D (right) keys (or W and D for TopDown) they will move a bit in their direction, then move farther like I held down the key, and lastly it will keep moving the character even if I have stopped pressing the movement input key. Additionally, using spacebar to jump occasionally doesn't work or there's a delay of about 2 seconds. Is this an issue because of Apple Silicon?

    I tested both plugins on my Windows 11 PC running LTS 2020.3.25f1 and the beta 2021.2.7 - they had no issues. The character controller worked perfectly with keyboard input.

    I've uninstalled/re-installed Unity a handful of times. I've tried using bluetooth keyboards and wired keyboards. I read that it could be an issue with Unity's Input Manager but everything looked fine, and again, I did not alter any settings.

    Any ideas would be awesome. Bonne année!
     
  19. Pancakz

    Pancakz

    Joined:
    Sep 24, 2021
    Posts:
    6
    Hello @reuno, I've encountered a weird problem where my character would randomly go flying for no reason.
    I attached a gif to show the problem. All I'm doing is pushing a Pushable object with a basic Box Collider 2D. In this example, my level bound is not very high, but if I increase it my character goes way higher.

    It doesn't always happen, but it happens fairly often. If you have any idea what could be causing this issue and how I could solve it, I would be very grateful !
     

    Attached Files:

  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Cosmobeard > I unfortunately don't have a M1Max macbook to test with. The closest I have is a M1 Air, where it works fine, no input issue. If it works there, if it works on your PC, then I'd say it's starting to look a lot like a hardware issue, but I have to admit I don't know what it could be, nobody's reported such a thing so far. I'll try to see if some of my users have such a device.
    @Pancakz > It doesn't seem like it's flying for no reason, it's flying because it's being pushed by a rigidbody powered pushable object. As explained in the documentation, the engine isn't physics based (it's the whole point), and physics interactions are experimental at best. In this case locking rotation for that vase would likely improve things, or you could use the CorgiController push ability instead, but physics will always lead to that kind of glitches, hence the non physics design of the engine.
     
  21. OldRoutes

    OldRoutes

    Joined:
    Aug 1, 2013
    Posts:
    5
    Hey!

    The Corgi engine looks great!

    I was planning on working on a 2d game that features digging mechanics, similar to Yoshi's Island or even Ori and the Will of the Wisps (digging a whole through sprites).

    Is this built-in in the engine, and if not do you have any ideas how to achieve such a feature with Corgi?
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @OldRoutes > no, there is no such feature. As for how to implement it, it's too big a feature to answer in a forum thread, and it depends too much on your exact specs. But that'd be pretty much unrelated to the engine, so any approach would do.
     
  23. Fed81

    Fed81

    Joined:
    May 22, 2020
    Posts:
    5
    Hi, Reuno! I have actually the same kind of a problem. It is very important to keep things realistic in this situation.
    I just wonder if it is possible to make some restrictions (by scripts or some other options may be..) for the Character to make it "not to fly(jump) higher than Y" when other rigidbodies force it to fly(jump)?
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Fed81 > As explained above, this is a non physics engine, it's not designed for physics interactions, quite the opposite. It's designed for tight gameplay. The solution I'd recommend in this particular case is to not use glitchy physics, but stick to the engine's features, such as the dedicated corgi controller push ability. But you can also try to fight physics and add restrictions like you describe, it may work in your use case.
     
    Fed81 likes this.
  25. Pancakz

    Pancakz

    Joined:
    Sep 24, 2021
    Posts:
    6
    I managed to fix my issue simply by adding more raycasts on the Corgi Controller component of my character. It was set to 4 and I increased both vertical and horizontal rays to 8, and no more flying to outer space!
     
    Fed81 and reuno like this.
  26. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    Hello everyone I am just looking for some friendly advice about source control with Corgi Engine. I just started using Unity Collaborate and was wondering if I should ignore the CorgiEngine folder (its quite large) since I could just reimport it if I ever needed to and just keep track of my own scripts and assets with the source control? Or is that a really bad idea?
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    brittany likes this.
  28. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    Thank you very much for the advice Reuno! I will take a look at those options.
     
    reuno likes this.
  29. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    Hello everyone; I am looking for some ideas on how to implement something into Corgi Engine. When my character moves left and right, and is not shooting, it needs to flip to the correct direction, which was easy to do. However, for shooting I will use two buttons. One for shooting left and one for shooting right. So, for example, the character may be moving left, but facing and shooting right. If it is moving left and not shooting, it faces left, but if as I am still moving I then press to shoot right, it needs to keep moving left but flip to the right and shoot right. Then as I still keep moving left I stop shooting, it would flip back and face the left again.

    If I were coding it from scratch I would know how to do it, but I want to implement it as properly and in the spirit of Corgi Engine as I can. I see some features that I think may be what I am looking for but I haven't figured it out yet. For example, in Character Handle Weapon, there is the option "Face Weapon Direction", and in Projectile Weapon, under Position, there is "Flip Weapon On Character Flip". I selected Face Weapon Direction, and unselected Flip Weapon On Character Flip but this is not enough, the weapon shooting still changes direction with the movement and so does the character.

    Is this doable in the engine as is or do I need to extend, hmm probably the Character Handle Weapon class to add this functionality?
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @brittany > You could do it like it's done for the AIs, the WeaponAim component has a Script mode that lets you feed it any direction you want.
     
    brittany likes this.
  31. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    Nice! Well, I almost have it working. I am using the SetCurrentAim method on my WeaponAim, like this (_weaponAim.SetCurrentAim(Vector3.right) (or left) for example. The problem is that it doesn't immediately switch between right and left, it is gradually rotating toward the right or left. How can I make it instantly switch? I have it set on Strict 4 Directions, but I think since I have the aim control set to Script and am changing the aim directly in the code that it is overriding that.
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @brittany > You can tweak weapon rotation speed on that same component, or set it to rotate instantly.
     
    brittany likes this.
  33. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    Thank you so much Reuno!! I actually even saw that on there but didn't think to set it to 0. I thought that would make it not rotate at all. Thanks again!!!!
     
    reuno likes this.
  34. mk7gwc

    mk7gwc

    Joined:
    Mar 3, 2016
    Posts:
    27
    Hello, I have a question.
    The Corgi engine consumes a lot of Layers by default, but when I want to combine other assets that utilize Layers, there is not enough free space in the Layers.
    Is there any Layers that I can exclude from the CorgiEngine? Is there any other way to solve this problem?
    As an example, the Parallax effect of the asset procamera 2D uses Layers to specify the depth. There are not enough unused Layers, so it can only represent about 3 layers of depth.
    I would like to use another asset because the Parallax effect in CorgiEngine does not work as well as I would like.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @mk7gwc > Sure, you can remove any of the layers you don't plan on using. For example if you don't use moving platforms, you can remove/reuse the MovingPlatforms layer. None of them are mandatory, and can be renamed/moved/replaced. All that matters is that your scripts' layermasks be properly set. For example, you could remove the Platforms layer and create a new MyGround layer. And then you'd need to modify your CorgiControllers' PlatformMask to target this new layer, that's all.

    As a general rule I'd recommend using layers, as the engine does, only for what they were intended, which is interaction definition (https://docs.unity3d.com/Manual/Layers.html). Using them for parallax level definition is a bit of a waste of precious layers, but I don't know that asset you mention and maybe there's a good reason for using them like that.
     
  36. mk7gwc

    mk7gwc

    Joined:
    Mar 3, 2016
    Posts:
    27
    @reuno
    thanks answer!
    I have an additional question: Are there any Layers that should never be removed?
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @mk7gwc > As I said, it depends on the ones you're using, there's no generic rule. I personally would recommend not removing any if you're not sure about the consequences, for the reasons explained above. Keep your layers for physics interactions, not for parallax management. But again, that's up to you.
     
  38. mk7gwc

    mk7gwc

    Joined:
    Mar 3, 2016
    Posts:
    27
    @reuno
    Of course, I know that it depends on my game design.

    I'll change my question.
    Could you please list the minimum of layers that are absolutely necessary for a typical side-scrolling action game?
    For example, assuming the content is about the same as Super Mario Bros. on the NES, etc.

    I'd like to use that information as a benchmark to test which Layers to remove or keep.
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @mk7gwc > I think Super Mario Bros would be using all of them, except maybe Friendlies, Pushables and maybe PlatformsPlayerOnly although I have a doubt on that last one, I'd need to redo a playthrough to double check.
     
  40. mk7gwc

    mk7gwc

    Joined:
    Mar 3, 2016
    Posts:
    27
    @reuno
    I see... Layers will be tighter than I thought, even if I only make a minimal action game.
    Unless Unity's own Layers limit is raised, it's going to be a hindrance to expanding the CorgiEngine's functionality.
     
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @mk7gwc > What use cases do you need to cover that the layer limit would be a problem? I've never ran into that limit yet, or heard about it.
     
  42. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,638
    There's a hard maximum of 32 layers available in any given Unity project. Apparently Unity uses 32-bit bit-masks to filter layers (probably optimization).
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @kdgalla > Yes, I know about that limit, what I meant is I've never heard of a real life use case where you're actually stopped by that limit. Especially for a platformer it looks like enough to me if you use them only for what they're designed for.
     
  44. mk7gwc

    mk7gwc

    Joined:
    Mar 3, 2016
    Posts:
    27
    @reuno
    As I said in post #7898, there are not enough free Layers to use non-CorgiEngine assets that use Layers.

    Unfortunately, CorgiEngine's Parallax feature is not up to the quality we want. That's why I'm using the pro Camera 2D asset.

    We also use an asset called Utage for the Dialog feature.
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @mk7gwc > As I've explained, they're all optional, you can remove them all and add just the ones you'd want to use, as long as you then setup layers correctly in your various abilities, everything will keep working, none of them are mandatory.
    And again, they've been designed by Unity to handle physics interactions. That gives you a collision matrix of 32x32, that's 1024 potential interactions, that's usually more than enough to cover most use cases. But yes, if you use them for stuff they're absolutely not designed for, like parallax, or dialogues, you'll run out. That's typically use cases where sorting layers, components, or even tags would make more sense, but definitely not layers.
     
  46. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    I try to understand how to use CorgiEngineEvent and MMCharacterEvent, thus I copy and paste this code (from your documentation) and I got an error in MyEvent function.

    Code (CSharp):
    1. new CorgiEngineEvent

    Here are the full code:

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using MoreMountains.Tools;
    4.  
    5. public class MyCorgiEngineEvent : MonoBehaviour
    6.     {
    7.     public enum CorgiEngineEventTypes {
    8.         LevelStart,
    9.         LevelEnd,
    10.         PlayerDeath
    11.     }
    12.  
    13. public void MyEvent() {
    14.        MMEventManager.TriggerEvent(new CorgiEngineEvent(CorgiEngineEventTypes.LevelStart));
    15.     }
    16. }
    17.  

    also on MMCharacterEvent, Got error on myCharEvent function:
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using MoreMountains.Tools;
    4. using MoreMountains.CorgiEngine;
    5.  
    6. public class MyCharacterEvent : MonoBehaviour
    7. {
    8.     public GameObject _character;
    9.  
    10.     public enum MMCharacterEventTypes {
    11.         ButtonActivation,
    12.         Jump
    13.     }
    14.  
    15.     void myCharEvent() {
    16.         MMEventManager.TriggerEvent(new MMCharacterEvent(_character, MMCharacterEventTypes.Jump));
    17.     }
    18. }
    19.  
    20.  
     
    Last edited: Jan 23, 2022
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @jim00 > It's quite hard to tell what your issue may be without knowing what that code is trying to do, or what the error is. I don't understand why you copied the CorgiEngineEventTypes enum or the MMCharacterEventTypes enum. That may be the cause of your errors.

    I'd recommend looking at the documentation (https://corgi-engine-docs.moremountains.com/events.html), it explains how to listen to and trigger events. You can also look at example classes throughout the engine for reference.
     
  48. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    thanks for the reply, as stated, I'm trying to understand how to use CorgiEngineEvent and MMCharacterEvent. The above code is from your documentation. I just copy and paste from your documentation code and test it out just to try to understand how the code works.

    But the copied code give me errors, do you mind telling me why there is are error. This code is from your documentation link: https://corgi-engine-docs.moremountains.com/events.html
    Please refer to CorgiEngineEvent and MMCharacterEvent.section.

    All I wanted, is to learn how to trigger CorgiEngineEvent and MMCharacterEvent.and how to listen to to them. I have try to refer to the code in Corgi engine but still have a bit hard time to understand it. sorry for my coding knowledge is not so good.
     
    Last edited: Jan 23, 2022
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @jim00 > You get an error because you copied not only the code needed to trigger an event, which is the line below the "trigger one like this.." but also the structure of the event itself, which is presented there for reference as explained in the text above, you're not supposed to copy/paste it, it's the actual event's types.

    Triggering an event is one line, and that's the only line you need :
    Code (CSharp):
    1. MMEventManager.TriggerEvent(new CorgiEngineEvent(CorgiEngineEventTypes.LevelStart));
    Usually you'll want to listen to events rather than trigger them (all of them already get triggered when needed), but if you want to do it, that's how it's done.
     
  50. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    Oh now it make sense, I don't need to worry about trigger as the engine will trigger it whenever something happen. Yap, I can just listen to those triggered event.

    thanks.
     
    reuno likes this.