Search Unity

  1. 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,905
    andreiagmu likes this.
  2. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    Got it! I sent a pull request with my CharacterPersistence_CustomScene extension. :)
     
    reuno likes this.
  3. saebashi

    saebashi

    Joined:
    Nov 5, 2013
    Posts:
    18
    Thanks for the great Asset.
    However, I followed the tutorial and installed CorgiEngine on my 2D URP project, but the frame rate drops momentarily during play in any demo scene, causing a choppy game screen.
    How can I improve it? This phenomenon occurs even in Minimal scenes. When I installed it on a non-URP 2D project, this phenomenon did not occur.
    The version of Unity is 2022.3.7f1.
    <This is machine translation.>

    In the video, it is around 00:13 and 00:24.
    Again, this does not happen with Built-In.
    https://www.dropbox.com/scl/fi/a9jj...4-09.mp4?rlkey=bv0zss71xkjokm3gvq7zqwcut&dl=0
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @saebashi > It could be a URP bug, especially if this doesn't happen with built-in. I'd suggest looking at your profiler to see what causes these things. The engine itself doesn't do any rendering, it just handles gameplay logic, so if you see a difference between a demo scene in URP and in BiRP, the issue is on URP's side. I'm personally not aware of that particular issue, but then again, it's URP, it doesn't lack for issues.
     
  5. saebashi

    saebashi

    Joined:
    Nov 5, 2013
    Posts:
    18
    Hmmm...
    I see, from your advice, I changed the Unity version to 2021 and this one worked fine. I have no choice but to try developing with 2021 for a while.
    Thanks for your quick reply.
    <This is a machine translation>
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @saebashi > That'd make sense, 2021 is still much more stable. I'm glad you solved your issue.
     
  7. saebashi

    saebashi

    Joined:
    Nov 5, 2013
    Posts:
    18
    I was mistaken. After all, whether it is 2021 or 2022, URP will be choppy.
    I was troubled.
    <This is a machine translation>
     
  8. saebashi

    saebashi

    Joined:
    Nov 5, 2013
    Posts:
    18
    Looking at the profiler, the spike is occurring in the EditorLoop, and this seems to be an issue that only happens in the Editor. In the URP project before incorporating CorgiEngine, this spike did not occur. As a solution to the problem, I enabled Incremental GC. This is not a fundamental solution, but for now, I will consider it resolved.
    <This is a machine translation>
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @saebashi > What was in your project before importing CE?
    Nothing (or almost nothing) in CE runs in the editor loop, aside from a few custom inspectors, and again nothing in the engine does anything related to rendering, so whether you're using URP or BiRP or HDRP or a custom RP will have zero impact on the engine's performance, it's scripts, they're unrelated to your RP of choice entirely.
    Use deep profiling to find out what exactly it is.
     
  10. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    Hi! Is there any example of using an animation system other than Mecanim with Corgi?
    Any tips/advice about using another animation system with Corgi?

    In my case, I prefer to use Animancer as my animation system.
    Did someone already make an integration between Corgi and Animancer?

    My intention is to not use Mecanim at all, and control my animations through Animancer only.
    I see there's the "Use Default Mecanim" bool in Character.cs, which can be disabled so Corgi stops updating its default Mecanim stuff.

    What would be the next steps regarding that implementation?
    I guess I'll need to add stuff to CorgiMonoBehaviour and MMMonoBehaviour, to add some Animancer-related code (so all Corgi classes that work with animations can easily access Animancer), or is there a more recommended way to do this?
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @andreiagmu > No, there's no such example in the engine. What I've seen most studios do is to still have the abilities output to an Animator, then read that Animator's parameter list and feed it to whatever 3rd party system. Of course that requires still using Mecanim at least as a proxy for parameters.

    If for some reason you don't want to use Mecanim at all, even for that, then you'd need to override the MMAnimatorExtensions update methods to plug in your own systems. I'm not sure what you mean to add to CorgiMonoBehaviour or MMMonoBehaviour (these are empty proxy classes), but if that works for you you can of course do things that way, there are plenty of good ways to go about this.
     
    andreiagmu likes this.
  12. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    Thanks for the advice!
    I haven't thought of overriding MMAnimatorExtensions. I think this will be a cleaner solution than some other solutions I was considering doing with those proxy classes. :)
     
    reuno likes this.
  13. EarlyDarkEntertainment

    EarlyDarkEntertainment

    Joined:
    Oct 8, 2018
    Posts:
    15
    Hello any chance of porting Corgi over to Unreal?
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
  15. andreiagmu

    andreiagmu

    Joined:
    Feb 20, 2014
    Posts:
    175
    In the ability CharacterSurfaceFeedbacks.cs, DetectSurface(), I think there should be an extra null check:
    Code (CSharp):
    1. if (!_controller.State.IsGrounded || _controller.StandingOn == null)
    2. {
    3.     return;
    4. }
    I frequently have an exception at the first frame whenever I spawn the player on my level.
    The controller is grounded, but doesn't know yet if it's standing on anything (StandingOn == null).
     
    reuno likes this.
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @andreiagmu > Yes, you're right. Thankfully, this has already been reported and fixed, the fix will be in the next release, coming very soon (submitted a while back to the asset store, so a matter of days now).
     
    andreiagmu likes this.
  17. bwlgeo

    bwlgeo

    Joined:
    May 10, 2022
    Posts:
    12
    Afternoon everybody, two quick questions

    Just updated from 8.3.1 to 8.6 (a big jump, I know) taking care to remove my Corgi folder first and then import the new version. I then went through using my backup as a reference to match layer/physics/collision settings to what they were previously, but I'm having a problem where now my player characters are no longer properly colliding with or triggering 2d box colliders that aren't explicitly using Corgi components. Teleporters and combat using Corgi characters still works, for example, but when using Dialogue System's On Trigger Enter and On Collision Enter systems, which worked with Corig in the 8.3.1 version, now won't trigger in 8.6. Any clues as to where the issue might lie? Can provide more info if necessary

    Also I updated to 8.6 but it doesn't seem like the KillsManager is in the new version. Am I missing something or is it not there yet?
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @bwlgeo > 1. I don't know what your issue may be, but the engine doesn't have the "power" to interfere with your triggers and collisions. Maybe something's wrong in your physics settings? Or maybe your objects are on layers that don't collide in your layer matrix?
    2. Yes, the KillsManager is in the new version. The most likely explanation would be that you're not on 8.6. You can verify what version you're on in the readme at the root of the asset (see 1st highlighted item in the FAQ).
     
    bwlgeo likes this.
  19. bwlgeo

    bwlgeo

    Joined:
    May 10, 2022
    Posts:
    12
    Ah, got it on the KillsManager. Misread the version number at the end of the changelog I was one behind.

    The problem ended up solving itself and I'm not totally sure how. My only thought is that updating Corgi reset one of my layer settings and then in the process of updating Unity the setting got set back somehow? Still not totally sure because those were the only things that I changed in between collision working and not.

    Thanks for the help!
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @bwlgeo > I'm glad you got it working, thanks for letting me know!
     
  21. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    Hi ! Thanks Reuno for Corgi engine ! i just discover it few days ago, bought it on the asset store. This is great for me since i'm not a coder at all, i struggle for month to try to achieve simple things that i just made in 2 hours with your tools...
    i have to work a lot to complete but it's really great.

    i have a question about the pushable feature :
    it seems impossible to replace the BoxCollider2D by a CircleCollider2D because the CorgiController only accept BoxCollider, unless i miss something ? i tried to create an alternate corgiController with a CircleCollider but as i said i'm a really bad coder/beginner it's too complex for my abilities right now...
    by the way, why would i change the BoxCollider for a CircleCollider ? Because i would like my player to be able to push a rolling stone. The stone would e basically a circle, rolling on itself as it's would be pushed horizontally. i can't make it happen with a boxcollider with a square shape. Maybe there another way to do so ?

    thansk ! :)
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @DrSpoutnik > No, indeed you can't just replace a box collider with a circle collider, this isn't a physics framework (quite the opposite). But that shouldn't prevent you from having a rolling stone. Your stone can have a circle/stone sprite, and a box collider. Animate its rotation based on its position in the world, for example, and you'll get a visually rolling stone with tight gameplay.
     
  23. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    Okay thanks for your answer.:)

    i'm trying to do what you propose, but i did not succeed right now (because i'm learning as i'm trying to do, so it take me forever every time :D ) i did not try with "position in the world" thought, good idea, i'll try that.
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @DrSpoutnik > There are plenty of ways you could go about it. Having it compute its delta position (vs position last frame) and compute a delta rotation based on that, then applying it to the sprite (make sure you separate your visuals (sprite) and logic (collider in this case).
     
  25. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    Oh, and i don't know if you're still open to suggestions for future version, i thought to a "Character Hide" component. i'm trying to do something like that : when the player crosses a zone where he can hide, if he pushes a button or just crouches, he would be hidden (High Herbs, Plants, Rocks, whatever) ennemies would not notice him while patroling, nor hit him. or just through a shadow area, he would be hidden as long as he stays in the shadow area (to be define in the component or a "HideZone" component to attach to a gameobject to combine with.
    i'm sure it's quite smple to achieve, so maybe it's not so interesting to add it to corgi's functions...

    Thanks
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @DrSpoutnik > Yes, that'd be quite simple to add. Please use the support form to submit feature requests, thanks.
     
  27. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    Oh, sorry i didn't saw the support form, i would post it there !
     
    reuno likes this.
  28. DrSpoutnik

    DrSpoutnik

    Joined:
    Jan 14, 2018
    Posts:
    72
    it works perfectly now (after a looooot of tries :D) but of course when the player jump over the object, the illusion broke when he can stand on the edge of the boxCollider instead of being in contact with the circle. But maybe it's not a big deal after all. (i'm just trying to do a game for pleasure, not trying to do a commercial one)
     
    reuno likes this.
  29. windslayer

    windslayer

    Joined:
    Jul 29, 2014
    Posts:
    14
    upload_2023-11-28_3-44-8.png
    Hi Reuno, I'm trying to set up a slope as a oneway platform above a regular platform which the player and enemies can go to both the upper platform and lower platform.
    However, When you are traversing from the lower platfrom from below, you will get stuck by the colliders of the upper platform, and the player will jump very high because the way the engine implements collision detection.

    I wonder if there is a built-in way in the engine for me to achieve this kind of set up?
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
  31. windslayer

    windslayer

    Joined:
    Jul 29, 2014
    Posts:
    14
    reuno likes this.
  32. windslayer

    windslayer

    Joined:
    Jul 29, 2014
    Posts:
    14
    Hi Reuno, I find my character falling into platforms even with perform safety boxcast set on. This usually happens when I jump around slopes. I have tiledmap collider 2D and composite collider 2d on my platforms. Could you pls give me some pointers on how should I debug this or what sort of information you would need to help me?
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @windslayer > I'm not aware of any situation where this could happen, so I'd need more info about your context.
    I would need repro steps from a fresh install, via the support form (https://corgi-engine.moremountains.com/corgi-engine-contact). You'll find plenty of demo scenes with tilemap based slopes, RetroMountains for example. I'd recommend testing there, and comparing with your setup.
     
  34. windslayer

    windslayer

    Joined:
    Jul 29, 2014
    Posts:
    14
    Thanks, I eventually solved it by imitating your examples and playing around with parameters.
     
    reuno likes this.
  35. atticusbsnowvaldez

    atticusbsnowvaldez

    Joined:
    Mar 15, 2020
    Posts:
    2
    I tried using the dialogue zone to permit an ability and in the inspector it works but the ability to activate in runtime.
     
  36. atticusbsnowvaldez

    atticusbsnowvaldez

    Joined:
    Mar 15, 2020
    Posts:
    2
    Nevermind I did the jetpack thing ya'll recommended that guy with! Ya'll rock!
     
    reuno likes this.
  37. zuniga

    zuniga

    Joined:
    Sep 8, 2014
    Posts:
    3
    Hi Reuno,
    I'm building a game that has the player dialogue with NPCs. As the Corgi Engine has a very simple dialogue system, it is only one-way communication, so I purchased Pixel Crusher's Dialogue System and am reading their documentation for Corgi Engine integration. Their documentation states "Add a ConversationZone prefab (located in Corgi Support ► Example ► Prefabs) as a child of the NPC." But I can't find a ConversationZone prefab. Is this asset still available? Does Corgi Engine integrate with Dialogue System? Thank you!
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Hi! Did you import Plugins ► Pixel Crushers ► Dialogue System ► Third Party Support ► Corgi Support.unitypackage? This package contains the ConversationZone prefab and an example scene.
     
    reuno likes this.
  39. zuniga

    zuniga

    Joined:
    Sep 8, 2014
    Posts:
    3
    THANK YOU TonyLi. After I wrote to the forum, I realized exactly what you wrote me. The package is imported and now, I've got things working, though I still have a lot to learn about how to refine the conversation. Thank you for your swift response!!!
     
    reuno and TonyLi like this.
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,626
    Glad to help! If any other Dialogue System-related questions come up, feel free to post in the Dialogue System's Unity forum thread, or the Pixel Crushers forum, or the Pixel Crushers Discord server (link in the Dialogue System's _README.txt file).
     
  41. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    Hi Reuno, my friend, I am not sure whether this is a bug in the engine. When I set the flying enemy AI, if I check the "Always Fly" animation status, I will get stuck in a certain animation, as shown in the files:


    After unchecking "Always Fly", everything is normal again, what is the reason?
    And I found that if you remove "always fly", "Action_Fly towards target" doesn't work,Is there any solution?
     

    Attached Files:

    • Q3.png
      Q3.png
      File size:
      22.7 KB
      Views:
      10
    • Q4.png
      Q4.png
      File size:
      31.1 KB
      Views:
      11
    Last edited: Jan 10, 2024
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @Dumpling007 > Without any info about your Animator to work with aside from that screenshot, I can't tell you what could be causing this. This screenshot doesn't show anything useful I'm afraid. You'll find examples of AlwaysFlying enemies in the RetroAI demo scene.
     
  43. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    I found the problem, I did not set the animation conversion parameter "FlySpeed", so the animation can not switch, thank you Reuno
     
    reuno likes this.
  44. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    Hi Reuno,I found that the animation conversion issue still exists, and I'll describe it briefly, but when you set an enemy to "Always Fly", he can't switch from other animations back to the flight animation properly, and the animation state machine gets stuck at the end of that animation
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @Dumpling007 > Have you tried tweaking your animator's transitions to reflect the change you made in your character's properties?
     
  46. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    My transition is normal when always fly is not turned on, but it is abnormal when it is turned on. I looked at the AI and Animator of HideGhost in the Demo, but he did not switch other animation actions in flight state, so I did not find the answer
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @Dumpling007 > Do animation parameters turn on/off as expected? If they do, then the engine is working, and you need to tweak your transitions for whatever result you're after, that's done like in any project. If they don't change state, then maybe you have a setup issue, and if you think it's related to the engine, provide steps to reproduce your setup and I'll be happy to have a look.
     
  48. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    Can I send you a small DEMO?
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,905
    @Dumpling007 > No need, as mentioned previously, if you think the issue is on the engine's side, please use the support form and provide repro steps to your issue. I would recommend double checking your setup though, as I just gave it another try and everything seems to work just fine on the engine side, you just need to tweak your Animator's transitions.
     
  50. Dumpling007

    Dumpling007

    Joined:
    Dec 13, 2018
    Posts:
    32
    Okay, I'll sort it out for you