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
    @MaccyDBoy > I'm not sure I understand your problem or what you're doing/trying to do, but as long as it works :)
    If the problem persists please use the support email, thanks!
     
    MaccyDBoy likes this.
  2. Mackerel_Sky

    Mackerel_Sky

    Joined:
    Jul 24, 2018
    Posts:
    26
    Hey @reuno, managed to get the script mostly working as intended! It was easier than expected and after I finish tweaking the physics a bit I reckon it will be (mechanically) working perfectly. In the meantime though, I have been trying to flip the player's direction based on the direction he's sliding in, using something like
    transform.localScale = _controller.((some direction of movement))
    but I can't find anything inside CorgiController that seems to work. Do you have any suggestions?

    Thanks!
     
    Last edited: Oct 1, 2018
  3. Drew_Davis

    Drew_Davis

    Joined:
    Jul 2, 2018
    Posts:
    2
    @reuno with the level bounds in the engine, the function that won’t allow you to go back (i.e always head to the right) how do I make it so the level pushes the player to keep moving. What I’m trying to achieve is my spy character trying to outrun an avalanche in a ski section of my game and need them to die if the left of the screen touches them. I also want to link a snow particle effect to it aswell.

    Thanks,
    Drew
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Mackerel_Sky > I wouldn't use that, there are already methods for that in the Character class. Flip, namely. Please don't hesitate to look at the documentation.
    @Drew_Davis > That's not a feature of the engine (yet), you'd have to implement it yourself. It's on my todo list already though. Should be relatively easy to do, you'll need to create a new cam controller that auto moves, and a killer object that follows it (there are many ways to do it, that's only one of them).
     
    Drew_Davis likes this.
  5. Jim_Xenostar

    Jim_Xenostar

    Joined:
    Jun 13, 2017
    Posts:
    1
    Hello, just got the Corgi engine and it's just great! I was wondering if there is a way to do persistent storage chests? Treasure chests like Skyrim/Minecraft/Adventure Creator types where you can take items out and put items back in?

    Thanks very much!
     
  6. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    That's something I'm thinking on include in my game as well, just didn't start to mess with it yet.
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Jim_893 > That's not built-in, but thanks to the Inventory Engine it'd be doable.
     
  8. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Hey!

    I am starting to work out UI, art is coming along! In the level selection without map (the one where you scroll), how do you set the level selection screen to recognize your loading screen? I copied the demo loading screen and made adjustments but I made it separate so just in case Corgi updates (which it will), it wont get sucked into the reload part of it).

    I looked into the loading screen code. but I couldn't find a way to edit the scene name to my loading screen in Level Selection.

    Also, I was looking at weapons, is there a way the weapon pickups can spawn automatically? and when someone picks it up it gives them that ability, like smash sort of?

    Thank you!
    Xalo
     
    Last edited: Oct 1, 2018
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @XaloX > The LoadingSceneManager class comes with a public LoadingScreenSceneName attribute that you can change from anywhere, like so : LoadingSceneManager.LoadingScreenSceneName = "MyNewSceneName"; And it's gonna be used for the next scene loads instead of the default one.
    And sure you can spawn objects, there are examples of that, look for the TimedSpawner class, it could act as a good basis.
     
    Rockwall33 likes this.
  10. Rockwall33

    Rockwall33

    Joined:
    Mar 4, 2016
    Posts:
    186
    Awesome!! Thank you!!
     
    reuno likes this.
  11. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    29
    I've thought that I can share progress on my game so far:


    Note that everything is a placeholder art...
    Thanks @reuno for this amazing engine! :)
     
  12. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    @Mindjar good work! it's one of the few times I am having a hard time believing this is the corgi engine. Well done!
    usually there are obvious hints that corgi was used. Not a bad thing, but it means the tons of work you have put into this. I would however tone down the ripple effect in the water, it feels a bit "too much" for me. regardless, really loving the vibe and even though you call it placeholder art. I would play it! awesome job.


    *****
    Up to my question :)

    Hello there,

    I'd love to suggest a blocking layer field so that the enemy doesn't shoot when the raycast hits ground.
    It feels so wrong and odd that the character shoots down (in my eyes) obviously some games could benefit from that. For example with passable floor tiles (one direction / dual direction platforms) but with solid grounds it makes not much sense to me.

    Would you be so kind to add such a blocking layer to the next update?
    It's easy enough to update the code right now, but with future updates in mind...

    Also I'd love to request pulling / pushing of objects with a button press.
    I tried it so many times but I can't find a good way to make objects draggable and still make them react to the "physics".

    If anyone has done this before please contact me on how you pulled it off, i am even willing to purchase the code base as i have prototyped so many puzzles on paper with pushing/pulling mechanics.

    Thanks for your implementation.



    upload_2018-10-4_23-51-16.png
     
    Boom_Shaka and Mindjar like this.
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Mindjar > Wow, these have to be the prettiest placeholders ever. Very nice job!
    That water, that jump smoke, the roll, the dash at the end... Impressive!

    @zero_equals_zero > Sure, I'll add these to the todo list, thanks for the suggestions!
     
    Mindjar and zero_equals_zero like this.
  14. Mackerel_Sky

    Mackerel_Sky

    Joined:
    Jul 24, 2018
    Posts:
    26
    Hi @reuno, apologies about the lack of updates- unfortunately work gets in the way a lot and I don't have a lot of free time to play around with Unity.

    I've continued to work on the new Sliding Ability but seemed to have run into a wall regarding implementing a jump into the slide, unfortunately no matter what I try it turns into this: the character seems to just teleport all over the place when I jump. I've tried using AddForce, AddHorizontal and VerticalForce, using the regular Jump ability, splicing the Walljump code into it, and turning SticksToSlopes off but it all ends up with the same results. Did you have any trouble like this when making the Walljump ability? If you would like me to I can post the code up as well.

    ((hopefully this isn't fixed by reading documentation ;_;))
     

    Attached Files:

    • GIF.gif
      GIF.gif
      File size:
      668.2 KB
      Views:
      815
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Mackerel_Sky > I have no idea what could be wrong here. I'd suggest looking at how the walljump and actual jump work, they're doing what you need to do in this situation. I mean if it works in these two classes, you must be doing something wrong, but it's impossible to guess what like that :)
     
  16. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    Hi here, I began to use the Corgi Engine recently, It is very great!!! But I got a problem, cause my spirtes are Bottom-alignment,In unity ,as upload_2018-10-7_3-8-32.png


    It seems got a half-body gap if I give the platform and the character the default 2d-collider. How can I correct it?
    upload_2018-10-7_3-4-22.png
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Bagazi > You can change the y offset on your colliders. And I'd also recommend nesting your model/sprite one level below the logic, as explained in details in the documentation, for better separation and control.
     
  18. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    611
    Thanks very much~
     
    reuno likes this.
  19. bravery

    bravery

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

    I was reading the weapon documentation and I found that there is a parameter called: EquippedAnimationParameter but I searched on the inspector of the Projectile weapon in the "Animation Parameter names" but could not identify it, will you please advise where can I access this EquippedAnimationParameter in the inspector?
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > My bad, this parameter will only be included in the next version. I updated the documentation on this too soon. I plan on releasing it soon. If you need this parameter urgently, please use the support email and I'll see what I can do.
     
  21. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    It's Ok not urgent, I can wait, but it's a nice idea to have such a parameter as I can use it as a flag to control different animations like for example, I have an animation for ideal (with no weapon) and another animation for ideal+Gun, so having such a parameter will help in controlling this in animation.

    nice idea.
     
    Boom_Shaka and reuno like this.
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    What follows isn't really about the Corgi Engine, but may be of interest to some of you.

    I've spent the past 2 years working on a new asset, the TopDown Engine, and it just came out of beta. As its name implies, it's aimed at top down games, and with it you'll be able to create games such as Zelda, Hotline Miami, Final Fight, Enter the Gungeon, and basically any action game with a top down perspective.

    I've put a lot of work and love into it. I've tried to match the level of quality of the Corgi Engine, and tried to keep similar structures and coding conventions, so really if you already know the Corgi Engine, you should feel right at home. Some scripts are similar, and both have actually influenced each other over the past two years (the AI and Weapon systems for example are pretty much the same).

    Here's the release trailer for it :



    You can buy it here on the Asset Store.

    And you can learn more about it there.

    I hope you'll like this new asset as much as I do!

    So what does this change for the Corgi Engine? Nothing, I'll keep working on it (and on my other assets) as I have these past 4 years. Monthly or bi-monthly updates. If anything, it means more features :) Next on my roadmap is v5.2, coming soon!
     
  23. skayster

    skayster

    Joined:
    Aug 12, 2017
    Posts:
    46
    The trailer is awesome! Loving the style and the new character. Looks really smooth and high quality just like corgi. Is the new char a koala? :)

    Any hints of what might come in v5.2? Fingers crossed for a ledge climb.
     
  24. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Great moment for forums to stop notice me. Found the TopDown Engine in store before here, haha.
    It looks and feels great reuno, already tried the demo and almost anything from Corgi is in there. Is there a dedicated forum already? because I can't find it.

    About the 5.2 release, I've planed to stay on 5.1 to finish my little game, is there huge changes on your road map until a future 6.0 release?
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  26. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Thanks!

    Indeed it's a really complete asset as it is right now, some adds can be done as ledge climb, sliding, metroidvania stairs... and all the stuff you should have on the ToDo list already but, looking at version 2 or so -when I started playing with this engine- there's a long road of improvements and almost any kind of classic platformer can be done with Corgi Engine. Pretty satisfied with the asset.
     
    reuno likes this.
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Muppo > All of these are relatively high on the todo list and coming in future updates.
     
  28. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Wow nice weapons, can we have the same weapons on Corgi engine as well :)
     
  29. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    29
    Wow,the top down engine is looking great! Is there any chance that some features will appear in Corgi engine? The Cinemachine integration and the feedback options are fanatastic!
     
  30. thundercatoh

    thundercatoh

    Joined:
    Jul 3, 2018
    Posts:
    4
    The Top Down Engine seems Great Renaud :)

    But you have to stop making new engines and stuff, because now i want to buy that one too :)

    This way i wont finish my 2d game until 2050.

    Just kidding, great work once again :) Impressive asset
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @bravery > You already do, both systems use pretty much the exact same version of the weapons system.
    @Mindjar > These two in particular are very high on my list, so yes. I have to admit I love playing with this new feedback system, it's super powerful and removes a lot of mind barriers when working on small features that would still benefit from a bit of juice. For Cinemachine, I'm a bit more hesitant as Unity/the Asset Store has a weird way of handling packages for now (it simply doesn't), so I'm waiting to see if the solution I came up with holds at scale. If it does, it's coming very soon to the Corgi Engine as well.
    @thundercatoh > To be fair I don't plan on creating new ones, the ones I have now cover all my favourite genres. I plan on adding a lot to them though :) And thanks for the kind words!
     
    Mindjar likes this.
  32. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Remember these platforms?


    Just in case anyone want this kind of behaviour and can't achieve it, there's my solution. Replace MovingPlatform script with this one and follow instructions.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using MoreMountains.Tools;
    4.  
    5. namespace MoreMountains.CorgiEngine
    6. {
    7.     public class MovingPlatformExtended : MovingPlatform
    8.     {
    9.         [Header("Repeat Loop")]
    10.         [Information("Select '<b>Only Once</b>' then check this and the platform will respawn at the first point when last one is reached.",MoreMountains.Tools.InformationAttribute.InformationType.Info,false)]
    11.         public bool Repeat = false;
    12.  
    13.  
    14.         protected override void Update ()
    15.         {
    16.             if(PathElements == null
    17.                 || PathElements.Count < 1
    18.                 || _endReached
    19.                 || !CanMove)
    20.             {
    21.                 if(_endReached && Repeat) {
    22.                     Initialization ();
    23.                 }
    24.                 else {
    25.                 return;
    26.                 }
    27.             }
    28.             Move ();
    29.         }
    30.     }
    31. }

    @reuno Oh, come on! no dropping-things-puzzle-like engine on the way? So disappointed :p
     
  33. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    29
    @reuno I'm pretty hyped about the feedback feature in Corgi engine :) That feature would be a big time saver for me. I like adding small details that stack up for the overall feel of the game. The Cinemachine implementation would be pretty straightforward, I think.
     
    zero_equals_zero and reuno like this.
  34. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    Awesome job!
     
  35. bravery

    bravery

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

    Just wondering if we can have the following:

    While player is running once we change direction of the player (like from left to right) first the player slow-down then change direction so player will take a little time to completely change direction while we are running.

    Thanks in advance.
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Muppo > Can I add this to the extension repository? It's great work, thanks for sharing it!
    @Mindjar > Yup, Cinemachine would be fairly easy to implement. It's actually (and of course) much easier than the current Camera Controller, and way more powerful. An amazing framework, I absolutely love working with it.
    @bravery > So that's not something you can tweak on the controller (which is meant to be "tight", so sort of the opposite of this really), but I think you can get that behaviour with surface modifiers (look at the Ice in the demos), if I understand what you mean correctly.
     
  37. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @reuno no problem, go ahead
     
    reuno likes this.
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
  39. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Every time the player dies, Score is reset to 0. I want it to be persistent even from level to level because I want this to unlock levels, something like "you need 1000 score to get to the next level".

    I've looking at the managers already in the engine but I think I don't know where to start to dig. Anyone had done this or can give a tip?
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @Muppo > Points are reset in the SoloModeRestart method of the LevelManager :

    // we send a new points event for the GameManager to catch (and other classes that may listen to it too)
    CorgiEnginePointsEvent.Trigger(PointsMethods.Set, 0);

    (towards the end of it)
     
    Muppo likes this.
  41. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Thank you!
     
  42. AxelBoltok

    AxelBoltok

    Joined:
    Jun 26, 2017
    Posts:
    10
    Hello, i think that there is a bug with the MeleeWeapon script, the damage area is not shown at all (the docs shows a gizmos), is there any way to fix this or is that im doing something wrong?, thanks.
     
  43. bravery

    bravery

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

    I was wondering what is the best option to do the following:
    In one of the levels of the game I need to player to ride a car (of-course I will switch the player sprite with the car sprite), but what I was wondering about is how to setup my car object to make it move constantly? where the car will be moving the player will only when to jump from the different obstacles?

    Thanks in advance.
     
  44. CrazyEvilHamster

    CrazyEvilHamster

    Joined:
    Oct 13, 2018
    Posts:
    1
    Hello,

    First of all want to say big thanks for such nice tool like Corgi engine. Really good stuff. Saved a lot of time for me.
    But I have one issue with falling platforms. Maybe this issue already known and someone just could help me out with solution.

    Here is my problem: sometimes falling platforms just doesn't fall down. Here is one simple example. There are two yellow falling platforms. Y scale for smaller one is 0.2 and for bigger is 1. When I'm trying to jump on bigger platform everything is fine (not always, but usually). It shakes and falls. The main problem with smaller platform. Sometimes it falls down after few jumps, sometimes after 20 or more jumps.



    I looked into FallingPlatform.cs code and found the reason:sometimes variable controller.ColliderBottomPosition.y is a little bit less then variable _platformTopY

    controller.ColliderBottomPosition.y = -0.6324614
    _platformTopY = -0.6324613

    and this check just doesn't work (OnTriggerStay2D)
    Code (CSharp):
    1. public virtual void OnTriggerStay2D(Collider2D collider)
    2. {
    3.     ...
    4.             if (controller.ColliderBottomPosition.y >= _platformTopY)
    5.             {
    6.                 _timer -= Time.deltaTime;
    7.                 _shaking = true;
    8.             }
    9.     ...
    10. }
    in this case platform doesn't shake, variable _time doesn't decrease and platform doesn't fall down.

    It's just my thoughts, but maybe we shouldn't compare two floating point numbers just like that? Shouldn't we round (with some precision) these two numbers before compare them? Or maybe we should find difference between these two variables and compare it with some small epsilon?

    Thank you.
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @AxelBoltok > You need to select the weapon for it to show. And sometimes it disables itself from the gizmos, seems to be a Unity bug (haven't been able to pinpoint it).
    @bravery > It really depends on what exactly you'd want, but a moving platform could do the trick.
    @CrazyEvilHamster > Interesting, thanks for reporting this. I'll look into a way to make this more reliable.
     
  46. NEHWind2

    NEHWind2

    Joined:
    Jan 7, 2016
    Posts:
    31
    @bravery

    I have a level like that in my current project. What I'm doing to get this effect is disabling the ability to move the player character altogether. Then I grabbed the entire level layout, put it into one parent gameobject, attached a Moving Platform script to it and setting it up so the entire stage scrolls towards the player giving the illusion of constant movement on the players part! It may not work for you depending on what you're building but that's a solution that worked for me so I thought I'd share!
     
    reuno likes this.
  47. hicksor

    hicksor

    Joined:
    Oct 18, 2018
    Posts:
    2
    I can confirm the problem with AI Brain and AutoRespawn. It happens with my own scenes as well as the RetroAI-scene. I added the AutoRespawn script e.g. to the little angry bird and when i die after killing it and it respawns at player respawn the AI does not work any longer. The angry bird just keeps walking into one direction forever.

    Also i have a problem with my own character after respawn. Parts of the character are simply not drawn any longer after dying for the first time. Though it only happens to parts of the character, e.g. the face while the rest of the character still appears as expected (the character is created with Spriter Pro, thus it consists of single sprites that are keyframe animated and controlled through mecanim).
    The strange thing here is: When starting the scene and the character is initially spawned everything works perfectly. Only after first death and respawn the problems appear. So the question most likely is: Where is the difference between first spawn at level start and respawn after death?

    EDIT: Also i found that when using the new AI Brain and Ai Actions (i copied the variant from the demo where the enemy is on patrol, attacks when in range and after that returns to patrol) after the enemy was killed and respawned he is facing the wrong direction (meaning he's walking backwards) depending on which direction he was heading while being killed.

    So if i kill him while hes walking right the character is facing correctly after respawn but when killing him while he's walking left he is facing the wrong direction after respawn. When i use the old and simple "AI Walk" script (without a brain) it doesn't matter which direction the enemy is facing when being killed, he is always facing correctly after respawn.

    Again: The AI brain and it's actions are working perfectly when starting the level. The problem appears only after a first kill and respawn of the enemy.
     
    Last edited: Oct 18, 2018
    Alexis_Sto likes this.
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,914
    @hicksor > I really wouldn't know why parts of your character are not reactivated. There's nothing in the engine that knows about these parts, in fact the engine doesn't know about your model, or whether it's 2D spritesheets, a 3D model, a Spine thing, etc. So you must have something else happening.
    As for bugs, if you think you've found some, please use the support email and give me steps to reproduce in any of the demo scenes from a fresh install, right now it's just too vague for me to help.
     
  49. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    242
    @hicksor I don't have the editor running right now, but you should uncheck something like "destroy on death" or something like that in the character, that made the game behave like it should.
     
    reuno likes this.
  50. bravery

    bravery

    Joined:
    Mar 26, 2009
    Posts:
    270
    Thank you NEHWind2 for sharing you experience really appreciated.

    Is it possible to point me out to the "Moving Platform script" you are referring too? so I can give it a test.

    Thanks in advance.