Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v6.5 : fall damage, crush detection...]

Discussion in 'Assets and Asset Store' started by reuno, Dec 18, 2014.

  1. inoj

    inoj

    Joined:
    Feb 27, 2014
    Posts:
    21
    Thank you very much for your answers, i think that will actually be very inspirating and good practise to learn some coding, i haven't done it too much, so now is time to take over it! :D And you can be sure @reuno that i will rate Corgi as soon as i have played around for a bit and can have a bit more to tell about my experience, i regularly review assets i like, and you no need to worry that i wouldn't do in this case! :) Corgi is one of those assets that five stars is not enough in my opinion. :)
     
    reuno likes this.
  2. laymelek

    laymelek

    Joined:
    Apr 21, 2017
    Posts:
    14
    Hi Reuno, just about the finish my prototype :) In my game there is a part with small pool and i have two questions about that:

    1) When player is in the water, he doesnt look like in the water. I think i need do modify the color or so. Do you already have something for that?
    2) How can I add movements on the water so it look little mor realistic than just a blue surface?
     
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @laymelek > These questions are kind of unrelated to the engine. The look of your game is up to you, and really depends on your game's art direction, there's no generic answer to these. That said, my answer to both questions would be to use shaders, that's usually how you handle water and character color changes.
     
  4. Koodetat

    Koodetat

    Joined:
    Apr 11, 2014
    Posts:
    14
    Hi Reuno,

    Is it possible to use a controller one touch to manage the movement of the character? thank you !
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @Doud8ou "a controller one touch"? What do you mean?
     
  6. Koodetat

    Koodetat

    Joined:
    Apr 11, 2014
    Posts:
    14
    A touch on the screen (without joystick or buttons) triggers the move of the player (sorry for my english !)
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @Doud8ou > I'm not sure I understand but sure. The engine exposes movement methods and includes an input solution. You should be able to do whatever you want.
     
  8. laymelek

    laymelek

    Joined:
    Apr 21, 2017
    Posts:
    14
    Hi,

    is it possible to activate/deactivate buttons on the run time?
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @laymelek > They're gameobjects, so yes, of course. Use SetActive(bool).
     
  10. Rothfuss

    Rothfuss

    Joined:
    Dec 16, 2014
    Posts:
    6
    Hello Reuno, congratulations, you have done a great job!
    I have a couple of questions:
    - I see that you handle player movement via controller but it also has a Rigidbody attached, does it has any downside?
    I ´ve read you normally use one or the other, but dont mix both... but I really dont know.
    - Do you have any support contact or all questions should be submitted here?
    - Is the kit done or are you planning to add new features, like character selection screen or locked/unlocked levels on level selection map?

    Thank you for your time and your work!
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @Rothfuss > Good questions :)
    1 > Player movement (and collisions) is controlled via raycasts. The rigidbody is used for triggers (are you inside a zone or not) and for (limited) physics interactions. Basically even if it's not a physics based engine you can still have limited interactions with physics objects if needed (pushing a block, stuff like that).
    2 > You can find the support email link on the asset's page on the store, or at the bottom of http://www.moremountains.com/corgi-engine-best-unity-2d-platformer. Ideally ask general questions/suggestions here, if you need actual support (you've found a bug, something is not working as expected) use the support email link or contact form.
    3 > The kit is never done! It's been out for 2 years and I've tried pushing updates on a monthly(ish) basis. You can find the changelog/history of versions on the page I linked above, and a short overview of my todo list there too. There's much more in it than what's there though :) Character selection and locked/unlocked levels are on the list for example. Note that I never give ETAs for features. Things get released when they're ready.
     
  12. pawelf

    pawelf

    Joined:
    Jun 1, 2016
    Posts:
    5
    Hello Reuno

    I'm trying to do press (like on the attached GIF).I want them to move alternately. I added a script Moving Platform to my sprites. Then I set the values
    in the delay section: Press_1-Element0: 1s, Element1: 0.5s and press_2-E0: 1.5s, E1: 0.5s. After that when i turn on the game looks like delay has changed.
    You may have some idea why this is happening and how to fix it?
    corgi.gif
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @pawelf > I don't know, it's way too vague for me to guess. Maybe you've applied your prefabs wrong?
    Try debugging to see what could be modifying that value.
    And please, as I said in the post right above yours, use the support email for that kind of stuff, thanks!
     
  14. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    How to remove crouch walking ? It drives me crazy;)
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @meapps > Not sure I understand your question, it looks very basic. Just disable the CharacterCrouch ability? And please use the support email, for the third time in a row.
     
  16. meapps

    meapps

    Joined:
    May 21, 2013
    Posts:
    167
    reuno likes this.
  17. rickman75

    rickman75

    Joined:
    Feb 16, 2016
    Posts:
    5
    Not sure if its my software or Corgi Engine but I have made a small level to try my player with animation on a minimal level but when I try to build the build freezes. Can anybody point me in the right way is it freezing or just going to take a long time. I have taken out all the demo apart from minimal and made my own player with animation. I am very new to this.
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @rickman75 > That's probably a known issue with Unity's postprocessing effects. You can either remove them or wait (it can take up to an hour). It'll only take that long on the first build though.
     
  19. rickman75

    rickman75

    Joined:
    Feb 16, 2016
    Posts:
    5
    Thank for that.
     
  20. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    Asset very cool.
    But open Scene Asset/Corgi2D/Mesa2.unity and some other scene.
    How to fix error on Console:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. ProgressBar.UpdateBar (Single currentValue, Single minValue, Single maxValue) (at Assets/CorgiEngine/MMTools/GUI/ProgressBar.cs:23)
    3. MoreMountains.CorgiEngine.HealthBar.UpdateBar (Single currentHealth, Single minHealth, Single maxHealth) (at Assets/CorgiEngine/Common/Scripts/GUI/HealthBar/HealthBar.cs:121)
    4. MoreMountains.CorgiEngine.Health.UpdateHealthBar () (at Assets/CorgiEngine/Common/Scripts/Agents/Core/Health.cs:323)
    5. MoreMountains.CorgiEngine.Health.OnEnable () (at Assets/CorgiEngine/Common/Scripts/Agents/Core/Health.cs:100)
    6. UnityEngine.GameObject:AddComponent()
    7. MoreMountains.CorgiEngine.HealthBar:Start() (at Assets/CorgiEngine/Common/Scripts/GUI/HealthBar/HealthBar.cs:74)
    8.  
    Thanks !
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @vudong > I don't get this error, and it's never been reported.
    Maybe you've changed something? I'd suggest reimporting the asset in a fresh project.
    If the problem persists, please contact me on the support email address, thanks.
     
  22. jingray

    jingray

    Joined:
    Feb 6, 2015
    Posts:
    53
    @reuno > Thanks. It's working. I don't know changed something. May be. :cool:
     
    reuno likes this.
  23. thefox

    thefox

    Joined:
    Nov 22, 2016
    Posts:
    16
    Hi Reuno

    As usual great work!!. I have used your infinite runner engine with great success and now I am onto something new!!

    I am playing around at the moment trying to learn and I would like to have the character follow the slope of the platform. I know there is the CharacterSlopeOrientation class but it does not seem to work. Your instructions state

    "This component will orient the character's model to it is perpendicular to the slope it's walking on. Note that this only works if your model is not on the top level of your character, but instead nested under it."

    I have tried different variations of setting up the playable character model (2d) but is just does not want to rotate. Is there a 2d example of this anywhere?

    Also how would I go about not allowing to jump unless moving forward? Would I create a new ability? Is there a ismoving flag?

    Many thanks.
     
  24. thefox

    thefox

    Joined:
    Nov 22, 2016
    Posts:
    16
    Solved the rotation question.
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @thefox > There's an example of an already setup slope orientable(?) character in the aptly named MinimalSlopes demo (and in some other scenes I think).
    As for not allowing jump unless moving, I'd say the most simple way would be to just extend the Jump ability to add that check. There's no IsMoving flag, as that wouldn't be very accurate, but you depending on what you want to do you can look at the current hztal speed, or the input, etc. If you have more questions like these please use the support email, thanks.
     
  26. thefox

    thefox

    Joined:
    Nov 22, 2016
    Posts:
    16
    @reuno all working now. I have the characterslope working and I did this on my extended jump ability on the update method

    if (_movement.CurrentState == CharacterStates.MovementStates.Idle) {

    AbilityPermitted = false;

    } else {

    AbilityPermitted = true;
    }

    You have so many attributes I can tap into that my game is practically writing itself!!
     
    reuno likes this.
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @thefox > Oh right you can also look at the current state :) Good job!
     
  28. Soilworker

    Soilworker

    Joined:
    Jan 20, 2014
    Posts:
    3
    Hi! I just got Corgi about a week ago, and I'm very happy overall. However, I'm confused about something - the documentation makes reference to a PixelPerfect setting in the Camera Controller script - however, no such setting exists? Am I doing something wrong? I've even opened up the script itself and searched for the word "pixel" and it doesn't occur even once.

    Just wondering what I'm supposed to do?
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @Soilworker > Small mistake on my part, this is not yet released, it'll be part of the next update. It got into the documentation a little too soon :)
     
    Soilworker likes this.
  30. Soilworker

    Soilworker

    Joined:
    Jan 20, 2014
    Posts:
    3
    Thanks so much for clearing that up for me so quickly! I'd already invested a couple of hours trying various things, as I figured I must have been doing something wrong. I'll just wait for the update, in that case. :)
     
    reuno likes this.
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @Soilworker > Really sorry you lost 2 hours that way!

    But the good news is, I've just submitted v3.3 of the Corgi Engine to the Asset Store!
    It fixes a few things and add some cool new features. Here's the full changelog:
    - Adds an option to force a Corgi Controller to stick to the ground when walking down slopes
    - Adds a pixel perfect option for cameras, and a dedicated demo scene
    - Adds an option for moving platforms to reset position when the player respawns
    - Unifies animator controller parameters
    - Adds flicker on damage support for 3D models
    - Adds an option to prevent crawl but still allow crouch.
    - Adds a new features page
    - Fixes a bug that could cause sounds to keep playing after an enemy's death.
    - Fixes a bug with applied forces when dying while climbing a ladder
    - Prevents conflicts between jetpacking and gripping
    - Prevents the character from getting stuck in the crouch state for a few frames when diving on a moving platform.
    - Fixes bug logic when jumping down a platform.
    - Fixes a case where the jetpack wouldn't restart if you had died while still pressing the jetpack button after burning all its fuel
    - Fixes a typo in the CharacterSlopeOrientation ability
    - Fixes the WeaponStop Sfx trigger
    - Removes a reference to the Lazer in Mesa1
    - Fixes cases where the HorizontalMovement's UsedSfx wouldn't trigger back.

    Edit: As usual, expect a delay of up to 3 weeks for the Asset Store to put the update online. And thanks a lot to everyone who reported issues with the last version!
     
    Last edited: Jun 13, 2017
    meapps and ayk like this.
  32. NEHWind2

    NEHWind2

    Joined:
    Jan 7, 2016
    Posts:
    24
    Hello again everyone! I need to ask a quick question!

    Is there a function that instantly pauses your scenes when playing? If so I may have accidently activated it.

    Out of nowhere all of my scenes now start with the game paused. It's not the Unity editor pausing, but the in-game pause function. I have to hit the pause button on my controller every time a scene starts playing to get things moving. This is happening in the editor and in builds. I tried clearing out the pause controls on the Input page just in case something was being pushed somewhere but it didn't help.

    As usual I'm very sorry for my ignorance on these subjects and thanks for you help!
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @NEHWind2 > Well yes, there is. GameManager's Pause method, as its name implies.
    In such situations, don't hesitate to look at the documentation, or search the code for "pause", you'll find it instantly.

    Edit : not really something you trigger by accident though, so if that's not it, not sure what it could be. Try looking at your latest changes maybe?
     
  34. NEHWind2

    NEHWind2

    Joined:
    Jan 7, 2016
    Posts:
    24
    I'm sorry, I keep forgetting about the documentation and help you've provided. I have it bookmarked and I'll consult it first before posting from now on.

    After looking at the GameManager code I noticed "Time" in there an awful lot, so I went to Edit>Project Settings>Time and noticed that Time Scale had been set to '0'. I'm not sure how that happened, since I certainly didn't do it myself, but switching it back to '1' fixed my issue!

    Sorry for bugging you about something simple, but thanks again for your help! :)
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @NEHWind2 > That TimeScale setting should be kept to 1 indeed. I don't see any way that the engine would change it by itself, so not sure what happened there. I'm glad you figured it out though! Good job :)
     
    NEHWind2 likes this.
  36. eleven43c

    eleven43c

    Joined:
    Jun 14, 2017
    Posts:
    5
    Hi everyone! A quick question!

    Is there any way to slow down the time on a button press (not only when I pick something up), and a way to not affect the player (when I press the button everything slows down but the player is walking or running normally)?

    Thank you for your help!
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @eleven43c > I guess you're the same person that just asked that via the support email :) Here's my reply anyway:
    If you look at the pickable TimeModifier's code, you'll see that it calls the GameManager's SetTimeScale method (and a few others, but basically this).
    As the method's name implies, this sets the game's time scale. This will affect everything, player included. There's no method right now to slow down time but not the player.
    You could implement it by having different time scales stored and applying these differently to different objects. Could be tricky with the physics part.
     
    eleven43c likes this.
  38. Plott

    Plott

    Joined:
    May 12, 2014
    Posts:
    94
    @reuno Thanks for the update!

    One feature that would be cool, instead of using gravity modifier only in vertical direction, maybe have your "wind" effect also work in other directions! I was thinking of adding horizontal wind into my game (think a fan blowing), and just saw the wind modifier is only in vertical direction.
     
    Muppo likes this.
  39. eleven43c

    eleven43c

    Joined:
    Jun 14, 2017
    Posts:
    5
    @reuno thank you, I will try that
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @Plott > That should be pretty easy to change. I'll add that to the todo list.
     
    Muppo and Plott like this.
  41. ChrisuIndy

    ChrisuIndy

    Joined:
    May 17, 2017
    Posts:
    4
    Hi, I encountered some problems with the falling platforms, that happen when Player 1 is standing on a falling platform and Player 2 is standing right beneath it.

    I captured 2 videos with the default multiplayer setup showing 2 variations of the bug.

    Video #1 is with the default falling platform at scale 1 - 1. - The second player is getting pushed through the floors.


    Video #2 is with the default falling platform at scale 0.5 - 0.5. - The second player is getting shot up in the air when in contact with the falling platform.


    Is there an easy fix for this? :)
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @ChrisuIndy > It depends on what you want to happen. You could have the player below the platform killed, or pushed, or have the falling platform stop. You can also make it a one way falling platform. It's up to you :)
    In any case it's not a bug, that's the expected behaviour, there's just no specific implementation of it right now, the asset focuses on single player. There are too many possible implementations for that in mp to provide them all, and you have all the required elements to implement your own approach.
     
  43. ChrisuIndy

    ChrisuIndy

    Joined:
    May 17, 2017
    Posts:
    4
    Ok, thanks. Then I will start to look up the right event now and probably add some dying animation. I am currently having a lot of fun messing around with the engine. ;)
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @ChrisuIndy > If you want player2 (well the player below the falling platform) to die, the "best", or cleanest way to do it would be to extend the FallingPlatform class to add a player detection and kill it if necessary. Another, much simpler way would be to just add a collider, nested under your platform, with a KillPlayerOnTouch component on it. The result will be the same, but that way you don't have to write a single line of code.
    And thanks for sharing this video! It looks really fun already :)
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    Alright, so good news / bad news.
    The good news is the Corgi Engine has got a brand new page : http://corgi-engine.moremountains.com/
    The bad news is I broke my contact form for the past 24 hours. It's working now, but if you sent me an email yesterday via this form, better send it back, sorry!
     
  46. Luremaster

    Luremaster

    Joined:
    Dec 17, 2016
    Posts:
    9
    Hi Reuno,
    How the development of the beat and Up engine is going?
    Keep the great work!!!
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @Luremaster > It's going great, I have most of the base mechanisms going ok now, I need to push the visual part now.
    I hope I'll be done by the end of summer. Don't take my word for it though, I don't like giving estimates :)
     
    Havok_ZA and Muppo like this.
  48. ChrisuIndy

    ChrisuIndy

    Joined:
    May 17, 2017
    Posts:
    4
    Hey,
    I am trying to add collision between the different players so they can't just run through each other. (and then make them pushable, but that will be the second part)
    What would you say would be the best way to do that? I looked up the CorgiController and it looks like I will have to override the CastRaysToTheSides(), CastRaysBelow() and CastRaysAbove() methods and rewrite a lot of the raycasting there.
    Are there any other code parts in the engine I would have to watch out for?

    By the way, I already tried just adding the Player layer to the "PlatformMask" object in the CorgiController, but then the player just flew up in the air and where never seen again, because they collided with their own Player layer and were constantly being pushed up. That would have been too easy. ;) But maybe splitting up the layers for each Player in Player1, Player2, etc. and then doing the raycasting for all Player layers except the own one would be an easy solution? :)
     
    Last edited: Jun 29, 2017
  49. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    Hello Reuno and everyone else!

    I've got three questions for anyone who might have solutions. I'm not sure how complex the problems are that I'm asking about but after searching for a few hours on this forum I wasn't able to find a solution so please redirect me if someone has already solved these and I overlooked it. Here are the questions:

    1. I have created a simple script which uses a box collider in conjunction with OnTriggerEnter2D, OnTriggerStay2D and OnTriggerExit2D. The idea behind this script is to create a switch which finds the animator and character script on trigger enter (simple enough with getcomponent<>() ) but also I want it to find out which player entered the trigger (this is going to be a 1-4 player coop game). The idea is that it gathers this info and waits for input from that specific player. When it gets the right button press from this player and this player only, it triggers other methods etc etc. The the part of this problem is that even though I know about input manager and character scripts where the PlayerID is stored, I'm not sure how to check for ONLY that player's input through script. Any help would be very appreciated and I'll be sure to post the resulting script here if anyone wants to see it.

    2. I would like to create a character selection screen for 1-4 players. Everyone has seen this in any 1-4 player coop games they've played before. Basically I want the scene to have a "Press A to Join" prompt for up to 4 players. When pressed I would like that player to be able to select from available characters (those which haven't already been selected by another player yet) and then to change to a "Start Game" prompt. So in my head, this would be a matter of creating a state machine which would have the following states:
    • Waiting For Player Input
    • Player Character Selection
    • Ready To Play
    Waiting for player input is "Press A To Join". When this state receives input > state change to Player Character Selection. The player moves a cursor or scrolls through the players in whatever method I end up implementing and then presses A again when the desired character is selected > state change to Ready To Play where it displays "Press A To Play" now and if A is pressed again, the game starts with the players and characters that were selected. I would also like the players to be able to drop in and out of the game but I'll get to that after the character selection scene is good to go. Again, any ideas?

    3. Finally, I would like a way to create local accounts, similar to let's say, an Xbox account, so that player information/upgrades/progress can be saved locally. When I get ready to port to consoles I'll look at their specific API's for localization solutions but for now, this is a PC release and I just want friends to be able to go to another friend's house and reload their character in the state that it was in when they last played. Bonus if they could bring it with them on a thumbstick so that any progress they make at home can be brought to a friend's house to play. This would also be implemented into the above character selection screen by adding a state to the state machine that allows the player to select an account stored on that machine and from there either create a new character or select one that has been saved.

    Hopefully this makes sense. Sorry for the long-winded, multiple question post here but hopefully it'll lead to some good solutions that anyone looking to make a 4 player local multiplayer game can benefit from. Thanks all!
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,835
    @ChrisuIndy > You're absolutely right, these are the main methods you'll need to modify. Could have some side effects into other methods maybe, but that's probably the only class you'll need to consider, as it's the only one handling collisions. And the solution you propose looks good to me :)
    @NAiLz > 1 - You can simply check that the PlayerID of your character matches the one you want in your ability.
    2 - This looks like a good plan to me. Not sure if there was a question in there :)
    3 - Not sure how this relates to the Corgi Engine. In any case, I don't have much to say about that, sorry.
     
    NAiLz likes this.
unityunity