Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. 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. ShinyShovel

    ShinyShovel

    Joined:
    Aug 13, 2016
    Posts:
    2
    That didn't work for me. I got it working by tagging the Player 'Player' (I should have done that first).

    Now I have a different issue though. When I press the button to advance the text, it skips a speech bubble. In other words, it reads every other sentence.
     
  2. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    I had no issues with corgi engine and or its layers or collision boxes. Just make sure you tag the tile system or your brushes with the correct layer or tag or both even.
    I actually bought it for a freelance project where I had to build floorplans in 3D, so I made hallway brushes/room brushes and literally painted a floorplan in a few minutes with "intelligent" corner rotations etc. A nice example is the "bitgem dungeon" video demo on how to use rotorz.

    It surely is a bit more expensive but worth all the money. Even though it's a "grid system"; you don't need to snap to the grid. You can actually paint where you want + do note it's a bit more complex to set up vs maybe any other tile system you tested. But the documentation guides you step by step how to use it. it has build features, prefab features and my favourite you can easily overwrite code and snippets to make your own brushes. For example: randomly snap rotate a brush 90° each time you paint on the Y axis and so on. The developer knows his product and code and helped me out with a few more complex issues in just a few hours. I can safely say it's one of my favourite purchases ever where I never doubted any usage. (along side pro camera 2D). And of-course Corgi and okay a few others but I digress :) Good luck!
     
  3. WillyCornbread

    WillyCornbread

    Joined:
    Mar 11, 2016
    Posts:
    1
    Hi all - I'd like to implement a wall jump animation into my game, but I'm struggling a bit. It seems the way the normal jump is implemented is making it consume any trigger or boolean I try to fire by adding a new behaviorstate and appropriate animator trigger calls. I also tried resetting a boolean in the UpdateReset() but it seems no matter what I do the normal jump takes over...

    I was thinking perhaps someone else has done this... (Just animating when the character jumps from a wall cling, within the CharacterBehavior script there is already code to identify this action)

    Thanks if you can help

    b
     
  4. davidseth8

    davidseth8

    Joined:
    May 8, 2016
    Posts:
    13
    Hello,

    Great engine! I have your WaterCube prefab (with Water.cs attached) and would love to slow down my character as soon as it hits the water. Right now if the character falls into the water he continues to descend at same rate as in the air. I have tried adding

    controller.SlowFall(20f);

    into the OnTriggerEnter2D function within Water.cs but it seems to have no effect.

    Can you please point me to were I need to slow down the character? Thanks.
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    Alright, I'm back!
    @painkiller2007 > That moving platforms bug was introduced by Unity's latest update. I've given the fix to it a few posts before yours.
    @ShinyShovel > Glad you figured out the Player tag thing. As for why it skips dialogues... No idea. Does this happen with the demo prefabs ?
    @WillyCornbread > the next version will make it easier (and more elegant), but in the meantime, you can add a new boolean (or trigger) called WallJumping and have it work with the existing Jumping, and just have your transition based on WallJumping and Jumping.
    @davidseth8 > One way to do that is to reset its forces (controller.setforce(Vector2.zero)). You can tweak that reset force until you get the feeling you want (or maybe compute it based on the player's velocity).
     
    Bagnol likes this.
  6. painkiller2007

    painkiller2007

    Joined:
    May 25, 2013
    Posts:
    44
    @reuno Oh damn!! sorry for wasting your time man... You are on top of it :p Should have known! hahaha
    Thank you so much for the fix. I wasted like 4 days of project time trying to fix it in various ways. Its weird that the scale should have weird issues like that. Sorry for bugging you in your vacation time man. Have a good one :)
     
    reuno likes this.
  7. meghapants

    meghapants

    Joined:
    Nov 10, 2015
    Posts:
    8
    Hey @reuno , Hope you enjoyed your time off. I have another question for you!

    I'm working on adding in a grappling hook to the Corgi Engine. I've been using this asset to learn and have since custom built my own grappling scripts: https://www.assetstore.unity3d.com/en/#!/content/22937 The premise behind it is to use a line renderer between the player and a "hook" object when the rope button is pressed, and detaches from the rope when the jump button is pressed. This asset uses regular rigidbody gravity and adds force to the rigidbody, so it takes the player's momentum and applies to the swing... but of course the Corgi Engine behaves a little differently. So now I'm at the part where I'm building my Swinging() function within CharacterBehavior.cs.

    So far, I've got the player character attached to the grappling line renderer, gravity is suspended, but the player can move freely from left to right.

    I've toggled the GravityActive bool to false so the player stays suspended in the air, but what would be the best way to simulate the swing from left to right? I don't want it to be player controlled (pressing horizontal input), but rather if the player was running to the right and grappled they would swing to the right. Should I be checking _horizontalMove for input and then using SetHorizontalMove? Feeling a little lost. Thanks in advance.
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @meghapants > I wouldn't try to reimplement swing physics.
    If you want you want to go the physics way, use a physics controller.
    If not, script the movement. In this case I would just move the character along computed coordinates (based on the target distance and your hook's parameters. That's how it's done in most old school games. Makes it repeatable and predictable. At least that's how I like it :) Seems like the best way especially if you don't need it to be player controlled.
     
    meghapants and JamesArndt like this.
  9. beach3d

    beach3d

    Joined:
    Mar 16, 2016
    Posts:
    9
    Hey, maybe you guys can help me out I'm looking at having some images be a type of cutscene before the game starts and after a few levels. Any Corgi users have any idea to go about with a solution for it? Thank you in advance!
     
  10. Rizzledeep

    Rizzledeep

    Joined:
    May 7, 2016
    Posts:
    14
    Hey Reuno,

    I don't really have a question specific to Corgi Engine, i just wanted to get your take on something as you said you are a 2d guy.

    I have noticed with the orthographic camera that anything that is locked to it (player + bg) for example is not effected, but anything the camera passes by creates this motion blur or ghosting effect. I have done a lot of searching on the forum and google but no one seems to have a good reason/fix for it. Most just say the monitors response time is not fast enough and it creates the ghosting/motion blur effect on sprites that are not locked to the camera. Basically blaming it on hardware.

    I just wondered what your take was on this issue. Have you ever experienced it? Have you ever found a way of doing something that reduces this? V-Sync seems to have something to do with it, so the refresh rate/response time theory is plausible but I just find it very strange. Some games do have this slight blur on them but other titles are somehow able to achieve movement without it. I am just wondering if you have any idea how they are able to mitigate this issue?

    Thanks!
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Rizzledeep > If we're talking of the same thing, in my experience this was indeed hardware related. I don't have the issue on any of my test devices right now, but I have in the past. Fiddling with settings (vsync, refresh rate when possible) usually kind of solved the problem. I never dug too deep into this so I don't have much to offer in terms of solutions, sorry :)
     
  12. Rizzledeep

    Rizzledeep

    Joined:
    May 7, 2016
    Posts:
    14
    It's all good I was just wondering if you had seen it before, it seems to be something inherent in unity and not the corgi engine. I will try testing it on some other screens and see if it changes. Thanks for the feedback!
     
  13. frulica

    frulica

    Joined:
    Jul 6, 2013
    Posts:
    4
    Hello.

    What would be the simplest way to make the dialog two-way between the player and a NPC? I don't need multiple choice for the player, but i can't figure it out if its already supported.

    Thank you :)
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @frullca > No, that's not supported, you'll have to implement it yourself. I guess the best way would be to expand on the current system, and add a different style/position for the player's dialogue boxes.
     
  15. Rizzledeep

    Rizzledeep

    Joined:
    May 7, 2016
    Posts:
    14
    Hey Reuno,

    I was messing with checkpoints and I was trying to figure out how to make it so that you have to hit a 2d collider to activate the checkpoint. Right now as long as you move past the checkpoint in a linear fashion it sets it as the new spawn point.

    If we could activate the checkpoint with a collider then we could set up check points in a vertical style level for example. I tried looking through the checkpoint script but I am not sure of the best way to achieve this. Do you have any suggestions?

    Thanks

    Edit:
    I was able to achieve this but I had to edit the checkpoint script itself. I added a OnTriggerEnter2D that stored the checkpoints transform, then replaced the transform in the SpawnPlayer portion with the stored value. There is also some if statements so that the initial LevelStart does not bug out. If anyone else is looking to achieve this please send me a message!
     
    Last edited: Aug 29, 2016
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Rizzledeep > That's a good solution, congrats on figuring this out on your own :)
    In any case, that's actually what I'm working on right now, as others have already asked for this (and the current system is too limited). So it should be in the next update. That'll replace the old one, as I think a collider based one can achieve the same result effortlessly.
     
  17. Rizzledeep

    Rizzledeep

    Joined:
    May 7, 2016
    Posts:
    14
    Good to hear! I really want to update to the newest version of Corgi but there was a couple scripts I had to edit and could not extend so I am afraid of breaking my project lol. This version has everything I need right now to complete this one so I figured I would wait until the next game and then update.

    Cheers!
     
  18. blueLED

    blueLED

    Joined:
    Jan 5, 2014
    Posts:
    102
    Hi everyone! I made a game with the Corgi Engine. Can I post a link here?

    Please visit and vote on this Greenlight page.
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @blueLED > Of course you can post it here :)
    Your game looks great, I just voted for it. Can't wait to play the whole thing!
    Thanks a lot for sharing. Would you mind if I added it to the "made with the corgi engine" section of the asset's page ?
     
  20. blueLED

    blueLED

    Joined:
    Jan 5, 2014
    Posts:
    102
    Oh sure, please do.

    EDIT: I put the video here for people to see easier:

     
    Last edited: Aug 31, 2016
    meghapants and reuno like this.
  21. meghapants

    meghapants

    Joined:
    Nov 10, 2015
    Posts:
    8
    @Rizzledeep @reuno Nice solution, Rizzle! Thanks for sharing. I had the same problem earlier in my project. I am using PlayMaker on the side for visual scripting (as I improve my C# skills), so it's a little different but here was my solution:

    -Created global GameObject variable and global Vector3 variable
    -Added 2D Box Collider to checkpoint
    -Created FSM (visual script) that on trigger enter with "player" stores itself and it's own position into the global variables

    -In CharacterBehavior.cs RespawnAt(Transform spawnPoint):
    ---Stored list of global variables to access (from PlayMaker)
    ---Created a Transform variable and stored the player's transform component
    ---Created a Vector3 variable and stored the touched checkpoint object's position
    ---Adjusted the y position of the temp Vector3 slightly (so the player drops in slightly on respawn)
    ---Set the player's transform to the temp Vector3 (checkpoint) position
    ---Set spawnPoint to the player's transform

    -In LevelManager.cs KillPlayerCo():
    ---Changed "_checkpoints[_currentCheckPointIndex].SpawnPlayer(_player);" to "_player.RespawnAt(transform);"

    Probably ended up being more complicated than necessary, but it works! Same sort of principle, but yours seems to be more elegant :)
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    I'm still hard at work on the next version of the engine (initially 2.3 but looking more and more like 3.0).
    Here's a sneak peek of the new local multiplayer mode :

    It supports as many players as you have controllers.
    Stay tuned for more soon!
     
    JeffSLG, meghapants and Bagnol like this.
  23. Bagnol

    Bagnol

    Joined:
    Sep 5, 2013
    Posts:
    169
    That's incredibly cool, @reuno. Although I understand the reasons why it's not so common these days, part of me misses local multiplayer.
     
    reuno likes this.
  24. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @reuno I have the latest version of Corgi, and when I ran it in Unity 5.4, I was noticing a few warnings of deprecated api methods and a couple shader errors. Are you planning to address these in the next update? And do you know how far off that will be.
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Ben-BearFish > Absolutely. As these were just warnings and nothing game breaking I focused on the next version instead of releasing a fix that wouldn't have fixed much. No release date for the next version yet, as it all depends on how many bugs are still there, but it should be within a few weeks.
     
    Ben-BearFish likes this.
  26. cooler150

    cooler150

    Joined:
    May 17, 2015
    Posts:
    9
    Been playing about with the corgi engine (nice engine by the way)

    I have encountered a problem with the moving platforms. On first landing on the platform which is set to move only when a player is on it all seems fine but if i jump or move to much the character no longer sticks to the platform and flies off. Any ideas on what I am doing wrong I made sure my settings were the same as the demo minimal but I noticed it does it as well ?

    It could be just something I am doing wrong on my end and any insight would be appreciated.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @cooler150 > I'd need more info about how to replicate that on the demo levels. Send me an email with more details on the support email address along with your unity/corgi engine version and I'll have a look.
     
  28. cooler150

    cooler150

    Joined:
    May 17, 2015
    Posts:
    9
    ok will do thanks

    Sent
     
    Last edited: Sep 5, 2016
  29. cooler150

    cooler150

    Joined:
    May 17, 2015
    Posts:
    9
    Thanks for the great customer support issue resolved.
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
  31. FranPina

    FranPina

    Joined:
    Mar 17, 2016
    Posts:
    6
    Hi @reuno

    I would like to know how leads the new version, and if you are going to correct the problem with the physics and random jumps of character...
    Now let's turn up the game this month .. and I really do not want to risk upload with that ruling is quite important ...



    I also like to know how do to make the character jump when you throw a box ... as us the character jumps the physics.

     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @FranPina > I'm not sure what you mean by "how leads" ?
    And what "problem with the physics and random jumps" ? There are no current physics or jump bugs reported (apart from the moving platforms + latest Unity and that's already been answered).
    And I didn't understand that last sentence, sorry :(
     
  33. FranPina

    FranPina

    Joined:
    Mar 17, 2016
    Posts:
    6
    @reuno > Sorry for my English...
    In this gif i show the bug.
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @FranPina > Oh these physics, makes sense :).
    Well first of all if you encounter a bug, the easiest way is to send me a bug report via email, otherwise, I may not know it's there.
    Regarding these, that probably won't be addressed right now. These physics interactions have always been marked as "experimental at best". I wouldn't recommend using them for more than really basic and optional stuff. If your game relies heavily on physics interactions, don't go for raycasts.
    That said, I think you should be able to solve that particular case by preventing rotation on the block's rigidbody :
    upload_2016-9-5_13-52-2.png
     
  35. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    @reuno Thanks for the prompt response. I also had one last question. I use the Rewired plugin which is a universal input plugin that makes porting between PC, mobile, and consoles incredibly easy for input controls, but I noticed with the Corgi sample scenes that you had your own input scripts. Thus, I was wondering is there a way to override the Input of the Corgi engine?
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Ben-BearFish > Of course. Right now the engine uses two things mostly for input : an InputManager class, and mobile controls handled by the MMControls classes. You can get rid of one or both and replace them with whatever you prefer. There is no universal way to do that though, as every 3rd party solution has its own process and "way". I don't know Rewired myself, but I'm sure they have a documentation about how to implement it in your own project.
     
    Ben-BearFish likes this.
  37. Ben-BearFish

    Ben-BearFish

    Joined:
    Sep 6, 2011
    Posts:
    1,204
    Thanks again for the prompt response. I have their side of things handled already, so I'll see how I can replace the InputManager class.
     
  38. Unipue

    Unipue

    Joined:
    Sep 6, 2016
    Posts:
    3
    @reuno hey man that's a beautiful engine, great work.
    right now i'm rebuilding my project on corgi engine, but my project is physic-based and objects moves using rigidbody.
    i uderstand that corgi engine is raycasting based, is there any way i could use unity physic in your engine(or atleast no locked rotation so when my characters standing on ramp they align with it, my character looks like a square), so i can move objects using their rigidbody. ( rigidbody.velocity )
    how can i achieve this? any tips would be gladly appreciate.

    Thanks for your time.
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Unipue > Nope, the whole point of the engine is being raycast based, so right now there's no solution to achieve that.
    If your only need is to align your character with the ground, that can be done. Not out of the box, but you can get the normal of the ground, and rotate your character (make sure you don't rotate the colliders, just the sprite), and you should be ok. It's actually quite easy to do, I'll add that to a future update. And a physics collider that'd work with the rest of the engine is on my todo list, just not very high priority right now.
     
  40. Rizzledeep

    Rizzledeep

    Joined:
    May 7, 2016
    Posts:
    14
    Hey everyone,

    I was fiddling around and I was trying to make WallCling only apply to certain platform colliders and not all of them(as is default). After a bit of toiling I was able to achieve this with a script that basically allows you to toggle wall cling on or off depending on the platform. If any is looking for something like this please give me a shout, I am glad to share!

    Cheers
     
    reuno likes this.
  41. qiqiqi

    qiqiqi

    Joined:
    Nov 3, 2015
    Posts:
    16
    Hi guys.
    Thanks so much @reuno for sharing this great engine.
    I'm a beginner developper tring to learn charactor control from corgi controller, can anyone explain what is the 'edge case', and how does the a ray offset work to avoid that?
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @qiqiqi > An edge case is a problem or situation that occurs only at an extreme (maximum or minimum) operating parameter (at least according to wikipedia). The ray offset is just a small value added to the ray's length to make sure they're larger than colliders at all time. If you remove that, it'll work in most cases, but in some "edge cases" you'll get weird behaviors.
     
    qiqiqi likes this.
  43. qiqiqi

    qiqiqi

    Joined:
    Nov 3, 2015
    Posts:
    16
    Thanks for the reply, but I don't really understand, could you describe a weird behavior in game, that is caused by the edge case?
     
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    Remove it and you'll see :)
    It's just a security for cases where you'll skip a frame because of whatever else is running on your computer/mobile phone, when a wall is set in a certain way, or simply to make sure it covers colliders properly at all times. Feel free to remove it if that's somehow a problem for you.
     
    qiqiqi likes this.
  45. Zgar

    Zgar

    Joined:
    Dec 19, 2014
    Posts:
    1
    Hi there ! Thank you for this very great engine. I would like to know if there's anyway to make the character jumps from a wall to the opposite direction. For now if I'm on a left side wall I have to jump and then turn right, because if I turn right and jump the character falls. It results in a small distance jump, is there any way to delay the end of the wall grip ? Thank you !
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Zgar > Not natively, no, but you can easily extend the wallgrip methods to add a delay.
    It's actually a good idea, I'll add delays to most actions. It's on the todo list now, thanks :)
     
  47. Rizzledeep

    Rizzledeep

    Joined:
    May 7, 2016
    Posts:
    14
    Hey Reuno,

    I am noticing some strange behavior with the melee area of effect since upgrading unity to 5.4.1f1

    I am not sure if it is something related to the moving platform bug and the flip function. It is hard to describe but it i feel like it is not functioning as tightly as it did before. I am going to dig a bit but I just wanted to let you know.

    Update:
    I just did a bit of testing using the default corgi prefab as well as my own. It does seem to be something strange as if its not flipping the child of melee area of attack properly. Sometimes it is on the correct side of the player but sometimes it is behind them.

    When using the Flip() workaround you provided earlier in the thread this problem exists, but when you switch back to the original 2 lines of code it seems to function properly.

    Solved:
    If anyone else has this issue please do the following, it worked for me.

    //Declare For Melee Attack
    protected GameObject _meleeAttack;

    In Awake() assign the variable the child object for meleeAttack:

    _meleeAttack = this.gameObject.transform.GetChild (1).gameObject;

    Then ensure you are using Reuno's hotfix for Flip() it should look like this with my extra meleeAttack line:
    Code (CSharp):
    1.             if (_isFacingRight)
    2.             {
    3.                 if (_spriteRenderer != null)
    4.                 {
    5.                     _spriteRenderer.flipX = true;
    6.                     _meleeAttack.transform.localPosition = new Vector3(-_meleeAttack.transform.localPosition.x, _meleeAttack.transform.localPosition.y, _meleeAttack.transform.localPosition.z);
    7.  
    8.                 }                
    9.                 _isFacingRight = false;
    10.  
    11.             }
    12.             else
    13.             {
    14.                 if (_spriteRenderer != null)
    15.                 {
    16.                     _spriteRenderer.flipX = false;
    17.                     _meleeAttack.transform.localPosition = new Vector3(-_meleeAttack.transform.localPosition.x, _meleeAttack.transform.localPosition.y, _meleeAttack.transform.localPosition.z);
    18.  
    19.                 }                
    20.                 _isFacingRight = true;
    21.  
    22.             }
     
    Last edited: Sep 10, 2016
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Rizzledeep > You're right, there was indeed a bug.

    I'm still hard at work on the next "real" update, so in the meantime and to avoid trouble to people who run the latest Unity version, I've just submitted v2.2.4 to the asset store. It fixes all flip related issues (weapon aiming weirdly, melee area not being positioned as intended, and moving platforms strange behaviors.

    In related news, progress is going great on what will probably be called v3.0, as I ended up reworking LOTS of stuff. Performance is now sometimes up to 5 times better, I think the codebase is even easier to understand, it's easier to expand on stuff, and the new weapon system is super fun to play with. According to my github issues, it's 85% complete, which doesn't mean much, but it gives you an idea.

    Now, I'm going to try something new and ask if some of you would like to beta test this new v3.0 release. I guess I should have a beta ready within 30 days. Note that this beta shouldn't be used in production, and will probably contain bugs (that's the whole point of it), and you'll need to be prepared to send me feedback on it. If you're interested, drop me a line, and I'll let you know when I've got something polished enough for people to test it!
     
    Last edited: Sep 10, 2016
  49. Rizzledeep

    Rizzledeep

    Joined:
    May 7, 2016
    Posts:
    14
    Good to hear this info! I cant wait to finish my current project so I can upgrade to the newest version of Corgi and start another. As I mentioned before i have tweaked a lot of things and since i am fairly new to c# i am so worried of breaking what currently works perfectly lol.

    I will likely be purchasing inifinite runner in the future as I would like to make something for mobile with it! Is this beta for 3.0?
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,870
    @Rizzledeep > Yes, the beta is for 3.0, I edited my message as it wasn't that clear :)