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

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Alexflame108 > The wind is a bit different in that it actually affects the gravity. It's using a CorgiControllerOverride.
    I'll add that to the todo list.
     
    Alexflame108 likes this.
  2. coldfire1500

    coldfire1500

    Joined:
    Apr 28, 2018
    Posts:
    11
    @reuno Hi, is there any reason why everytime I define a platformer to move in between 2 points and after I press play they move a few cm to the side?
     
  3. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Moving platforms start moving from the first node in the list, no matter where do you place the platform itself.
    Perhaps that's what happening to you?
     
  4. coldfire1500

    coldfire1500

    Joined:
    Apr 28, 2018
    Posts:
    11
    This is my problem, I place the points in this position upload_2020-4-9_0-3-35.png
    but when I press play they go to here upload_2020-4-9_0-4-8.png
     
  5. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    @coldfire1500 - troubleshooting:
    1. make sure you save the changes before you click "play"
    2. verify both your placement and the displacement with coordinates (IE: you should see a difference between the starting point you designated and the object's actual coordinates during runtime)
    3. make sure your platform's centerpoint is set correctly (not likely, but worth a look)
     
    ryzeonline, coldfire1500 and reuno like this.
  6. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @coldfire1500

    Be sure the first Path Element is on the platform (as it came by default), otherwhise the entire prefab will displace to where your Path Element 0 is, then start moving along the path, with the offset due to that.
     
  7. Alexflame108

    Alexflame108

    Joined:
    Sep 24, 2019
    Posts:
    23
    @reuno is there a way to make character always take periodic damage after spawn?

    So like he has 50 HP and he takes 1 hp damage per second, and in 50 seconds he dies and respawns?

    And also, is there an (easy) way to set cooldown for character switch?
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Alexflame108 > Sure, the easiest way would be to create a class that targets the Health API.
    And sure, you can also implement a cooldown, it's like two lines of code, you'll find plenty of examples throughout the asset (look for "cooldown" in your IDE). You can also look that up online, it's not something that would be specific to the engine.
     
    Alexflame108 likes this.
  9. coldfire1500

    coldfire1500

    Joined:
    Apr 28, 2018
    Posts:
    11
    That was exactly it tnks :)
     
    ryzeonline likes this.
  10. Jonathan-Westfall-8Bits

    Jonathan-Westfall-8Bits

    Joined:
    Sep 17, 2013
    Posts:
    271
    Is there a way to add force on exit from water volumes?

    At the moment my character is jumping out of water and even though he is leaving the corgi controller override collider he loses all momentum on exiting water surface and he just snaps back under the water like his jumps lose all force and height.
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @cecilcruxis > Yes, you absolutely can (and should), that's how most demos are setup. You can define how much force you'd like applied in the CharacterSwim ability, in the WaterExitForce field in its inspector.
     
    Boom_Shaka likes this.
  12. Alexflame108

    Alexflame108

    Joined:
    Sep 24, 2019
    Posts:
    23
    @reuno, hey just tried to add negative Y force to treadmill but it doesn't work and pops up an error:

    "transform.position assign attempt for 'RetroCorgi_mobile' is not valid. Input position is { NaN, NaN, NaN }.
    UnityEngine.Transform:Translate(Vector3, Space)
    MoreMountains.CorgiEngine.CorgiController:MoveTransform() (at Assets/CorgiEngine/Common/Scripts/Agents/CorgiController/CorgiController.cs:537)
    MoreMountains.CorgiEngine.CorgiController:EveryFrame() (at Assets/CorgiEngine/Common/Scripts/Agents/CorgiController/CorgiController.cs:459)
    MoreMountains.CorgiEngine.CorgiController:Update() (at Assets/CorgiEngine/Common/Scripts/Agents/CorgiController/CorgiController.cs:419)"
     

    Attached Files:

  13. coldfire1500

    coldfire1500

    Joined:
    Apr 28, 2018
    Posts:
    11
    hey @reuno not sure if what I'm going to say is completely random or wrong but in your website instead of "more" shouldn't it be "higher"
    upload_2020-4-10_17-16-50.png
     

    Attached Files:

  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @coldfire1500 > You're absolutely right, thanks for letting me know, I've fixed it.
    @Alexflame108 > I just gave it a try in FeaturesPlatforms and didn't get any error. In general, please use the support form if you think you've found a bug, and provide exact repro steps in a fresh install, in any of the demos.
     
    Alexflame108 likes this.
  15. Alexflame108

    Alexflame108

    Joined:
    Sep 24, 2019
    Posts:
    23
    Can you please attach screenshot with your settings?

    Cuz i have just tried to do it in featureplatforms and got the same error. (I changed layer from Platforms to Default, is that correct?)

    Btw i use Unity 3.5f1, if it somehow relates.
     

    Attached Files:

  16. KOPEW

    KOPEW

    Joined:
    Jul 30, 2019
    Posts:
    27
    Hallo!
    Does anyone know if the Corgi engine has a "random feature"? Like I create empty game obj -> attach random component -> select few prefabs into it and for example it starts to spawn one random prefab. Like floating clouds on background or randomly chosen enemy at his appear position
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Alexflame108 >
    upload_2020-4-11_8-58-19.png
    And no, you don't want to remove a SurfaceModifier platform from the platforms layers (or add Default to your platform mask then).
    @Cunny-Lang > no, it doesn't, but it's super easy to create. There you go, I've attached one to this post.
     

    Attached Files:

    Alexflame108 and Boom_Shaka like this.
  18. KOPEW

    KOPEW

    Joined:
    Jul 30, 2019
    Posts:
    27
    @reuno wow! It's awesome, thank you very very)
     
    reuno likes this.
  19. coldfire1500

    coldfire1500

    Joined:
    Apr 28, 2018
    Posts:
    11
    Hi, I'm trying to make a falling enemy like super mario. Everything is working fine and how it should, when I collide with an invisible box collider it activates the "moving platform" making it fall and when I exit that box it stops like you can see in the picture, do you have a function for "on exit" to reset its position after exiting the collider? because if I exit too soon it stops on the floor and it doesn't go up again.
    upload_2020-4-12_3-5-17.png
     
    Last edited: Apr 12, 2020
  20. Alexflame108

    Alexflame108

    Joined:
    Sep 24, 2019
    Posts:
    23
    Thanks for your reply.

    As far as I see I wasn't clear enough.

    The reason why I changed treadmill's layer from Platforms to Default is because when it has Platforms layer character CANNOT go INSIDE the treadmill box collider, but that is exactly what i WANT it to do!

    And the problem I am reffering to - is that when I change treadmill's layer to Default and make a POSITIVE force, it's working perfectly fine! But when i try to use negative force, it shows an error.

    As far as I understand for now it is impossible to make some kind of "room" or "space" within the box collider of which some force can be applied to a character from different sides similar to retrowind effect without changing the gravity.

    Am i correct?
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Alexflame108 > Of course it's not impossible, you can do everything. But as I said previously, you should look at the SurfaceModifier script for reference, not just use it like that. It's designed to do a certain thing (apply surface modifiers), you can't just change its context and expect it to do what you want without changing any code, unfortunately :)
    But as I said, it's super easy to write a class that does what you're after. Here's one attached to this message.
    @coldfire1500 > I'm not sure what you mean exactly, but maybe look at the moving platforms API documentation, it explains it all. My guess is you're after the ChangeDirection() method, which does what its name implies :)
     

    Attached Files:

    Alexflame108 and Boom_Shaka like this.
  22. Alexflame108

    Alexflame108

    Joined:
    Sep 24, 2019
    Posts:
    23
    Thanks, I'll try that.

    Unfortunately, I am noob in programming and it will take time to learn this, that's why I am at the moment relying only on Corgi's functions)
     
    reuno likes this.
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    Good news everyone, I've just pushed v6.4 of the Corgi Engine to the Asset Store.
    As usual, it fixes all reported bugs to date, and among its new features, introduces the most requested feature so far : auto run. It'll let you create Super Mario Run-like levels, and comes with a few control helpers for it as well.

    Like that : https://imgur.com/a/6Ja1PSd

    Full release notes :
    - Adds the CharacterAutoMovement ability. It lets you walk or run automatically
    - Adds the AutoMovementControlZone, a script that lets you define a zone that, when entered, gives you control over CharacterAutoMovement, letting you force a direction change, state change, stop movement, etc.
    - Adds the MinimalAutoMovement demo scene, showcasing how you can easily setup a level for auto movement
    - Adds the ForceZone, a new class that lets you simply apply a force to any CorgiController that enter a trigger zone with that component on it
    - Adds the MMRandomInstantiator, a class that lets you spawn random objects on initialization
    - Adds the MMAnimatorMirror class, letting you mirror an animator state into another, useful to have a controller or weapon command more than one animator
    - Improves the pause sequence, adding a TogglePause event type to the CorgiEngineEvent
    - Adds WorldXSpeed and WorldYSpeed, two new animation parameters outputting the current speed of the character relative to the world (ie. 0 if colliding)
    - CharacterInventory can now work with extended InventoryEngineWeapons
    - Fixes a potential wrong init frame on fader round
    - Fixes a wrong axis binding in the InputManager
    - Fixes a bug that could result in mobile arrows not being visible if the virtual joystick had been unbound from the GUIManager
    - Fixes a bug that could cause an error when hiding a prompt with an inactive parent object
    - Fixes a bug that would cause ItemUsed events to be fired too late in some situations
    - Fixes a bug that could end a dash too early under certain raycast settings
    - Fixes a few Cinemachine issues that could cause a camera to teleport to the wrong target
    - Fixes a bug that would prevent the Jumping animation parameter to trigger correctly
    - Fixes an animator setup issue that could cause the RetroCorgi to appear as Dead when using CharacterSwitch repeatedly
    - Fixes a bug that could cause a Character to flip when getting damage while executing a no movement allowed combo
    - Fixes a few comments and typos in ButtonActivation and SecondaryWeapon abilities
    - Fixes the way the scale gets saved in the GrabCarryAndThrowObject class
    - Fixes the PC demo link
    - Adds RequireComponent attributes to all AI Actions and Decisions when needed
    - Adds comments description for each of the CorgiEngineEventTypes
    Note that this specific version requires Unity 2019.3.3 or higher
     
  24. coldfire1500

    coldfire1500

    Joined:
    Apr 28, 2018
    Posts:
    11
    oh man, I love your work and I love you hahahaah! I love the release tnks!!! Specially because your scrips are all well commented for noobs like me. Is there a donation place? So I can donate extra money for you once I get more?
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @coldfire1500 > I'm glad you like the engine!
    And no, there is no donation place, and there's no need for it really, thank you :)
    But if you've got a minute don't hesitate to leave a review for it on the Asset Store if you want!
     
    Alexflame108 likes this.
  26. piccolodmq

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    34
    Dont forget the "castlevania" jump, to your list :) where you are locked on the direction you jump, and cant change the direction, once you are in the air, for those retro feel like games.
     
  27. xpachin

    xpachin

    Joined:
    Feb 6, 2014
    Posts:
    62
    grappling hook and minimap first!!!
     
  28. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    you can't do that with AirControl and AllowFlipInAir?
     
  29. KDB44

    KDB44

    Joined:
    Feb 12, 2017
    Posts:
    5
    Hello.
    Is it feasible to import the top down engine into a corgie engine project?
     
  30. Alexflame108

    Alexflame108

    Joined:
    Sep 24, 2019
    Posts:
    23
    @reuno I am trying to update Corgi Engine from Unity, but assetstore says that latest version is 6.3 (from browser as well).

    Unity 3.5f1
     
  31. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @KDB44
    If you now how to merge classes, yes, otherwise it will not work.

    @Alexflame108
    He just uploaded it, expect 2 days aprox. for Unity to verify it.
     
    Alexflame108 likes this.
  32. Alexflame108

    Alexflame108

    Joined:
    Sep 24, 2019
    Posts:
    23
    Ok! Didn't know about. Thanks!
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    Alexflame108 likes this.
  34. lmalec

    lmalec

    Joined:
    Nov 20, 2016
    Posts:
    5
    Hi,
    when I use weapon control I noticed that when the character changes direction fast, the weapon flip has a slight delay. This also applies to the reticle. Are there any settings that I should change to make the weapon flip work correctly?
    Below is an example:
    weapon_flip.gif
     
  35. andrin2020

    andrin2020

    Joined:
    Mar 9, 2014
    Posts:
    29
    I was wondering if you could give me best practice when it comes to extending inputs. I have extended your classes extensively and have added many new attacks with various button combos to trigger them. Each time I do this I have to add lines of code to the InputManager class to handle the new button inputs as well as add new states to the MovementStates enum. Each time you release an update these classes get overwritten and I need to manually update those scripts agin. While this is easy enough to do I was wondering if there is a better way that I am missing?
     
    javi_unity402 and Boom_Shaka like this.
  36. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    33
    Hi @andrin_man,

    Hope this post helps you to implement extended classes in Unity.

    https://stackoverflow.com/questions...-a-class-from-another-script-in-c-sharp-unity
     
  37. andrin2020

    andrin2020

    Joined:
    Mar 9, 2014
    Posts:
    29
    @javi_unity402. I could subclass the InputManger and override the methods I am adding to but then I would need to change all the references to InputManger throughout the project to whatever I named the new one. This would be even more work as that would all be overwritten each time an update comes out as well.
     
    javi_unity402 likes this.
  38. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    33
    Then I think I'cant help you.

    Let's wait for an answer that helps both of us.
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @lmalec > I don't reproduce your problem. Please send repro steps via the support form, in any of the demo scenes, and I'll be happy to have a look.
    @andrin_man > You can extend the InputManager like you did the other classes, that's what I'd recommend in this case. Just make sure you can to that specific input manager when getting input from your custom classes.
     
    javi_unity402 likes this.
  40. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    33
    reuno likes this.
  41. theindielawyer

    theindielawyer

    Joined:
    Mar 25, 2016
    Posts:
    21
    Hey @reuno - hope you're doing well in these weird times! I've run into a slight problem with the rooms system that I'd appreciate some pointers on as I've been stuck for a few weeks and have scoured the documentation without luck!

    When teleporting between rooms, every now and again my player will teleport between the collider on the tilemap, either getting stuck there or being forced below the map. I've checked and no colliders have any offset on their colliders. Having studied retrovania and the documentation I haven't managed to find a workaround on this and just wondered if you had any ideas off the top of your head.

    And another minor point is the cinemachine camera seems to have stopped automatically picking up my player character, any idea why this might be?

    Thanks in advance for your help and thanks again for this awesome engine!
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @Dragonbladeon > No, without exact context, I can't really guess what's wrong. Does the problem happen in RetroVania for example? If yes, where exactly?
     
  43. lmalec

    lmalec

    Joined:
    Nov 20, 2016
    Posts:
    5
    Thank you for the answer, but I solved the problem. I had to change weapons and character flip settings. Now it's work perfect.
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @lmalec > I'm glad you figured it out, thanks for letting me know!
     
  45. theindielawyer

    theindielawyer

    Joined:
    Mar 25, 2016
    Posts:
    21
    As is always the way, as I raised the issue I've now solved it - basically a conflict between my tile map collider (which wasn't flat) and the teleporter offset - all working perfectly now!
    Still looking into the camera issue which is happening in retrovania. I assume I've done something to the character class to cause the issue.
     
    reuno likes this.
  46. ShakalXKla

    ShakalXKla

    Joined:
    Feb 16, 2018
    Posts:
    21
    Is it possible, instead of being pulled automatically by the RetroZipLine line, that I can go back and forth like on the stairs with horizontal movement like in donkey kong country series? And I could also add a function to move with me elements of the scene as blocks, in case I wanted to be able to move with me barrels as in donkey kong.
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @hemersonkla > If you implement it, it's possible, yes. That's not the native behaviour though, but it's doable.
    As for moving stuff around, there's a carry mechanic already built-in.
     
    ShakalXKla likes this.
  48. ShakalXKla

    ShakalXKla

    Joined:
    Feb 16, 2018
    Posts:
    21
    upload_2020-4-18_14-37-32.png Well, I'm in the retro mountains scene and I'm trying to use the E key to pull the block but nothing happens I need to add something to the script button activator?
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,929
    @hemersonkla > Push is not bound to E, it's bound to 3 by default, so it's not surprising that pressing E does nothing :)
    As for ButtonActivator, as explained in the documentation, it's a class used to activate button activated zones, nothing to do with input, or push.
    Please use the support form from now on if you have other questions, thanks.
     
    ShakalXKla likes this.
  50. ShakalXKla

    ShakalXKla

    Joined:
    Feb 16, 2018
    Posts:
    21
    thanks. =)