Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. We are looking for your feedback about Templates! Tell us about your experiences by taking our survey.
    Dismiss Notice
  3. 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.6 : ability split, recoil, hitscan...]

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

  1. Jkc_dev

    Jkc_dev

    Joined:
    Apr 20, 2015
    Posts:
    35
    True.. i thought it, but i'm trying to implementing it myself (because my ground is more clear) and i'm having problems TT
     
  2. matteo-piccioni

    matteo-piccioni

    Joined:
    Jul 4, 2014
    Posts:
    49
    Hello Corgi,
    thanks for the new release
    I'd like to ask you a suggestion

    I need to add a 'special jump' platform.
    When the player jump into it, the controller is disabled and precalculated jump (left or right) starts (typically jumps on a specific platform without be able to move, the player can only face left o right while in the air)

    I attach a script into 'special jump' and a collider.
    In the script I made 6 gabeobject to design the path of the jump into unity
    Code (CSharp):
    1.    
    2.     public GameObject vectStart ;
    3.     public GameObject vectLeftControl;
    4.     public GameObject vectLeftEnd;
    5.     public GameObject vectRightControl;
    6.     public GameObject vectRightEnd;
    7.  
    Check when the player hit the jump area and backup current values of character and controller:
    Code (CSharp):
    1.    
    2. public void OnTriggerEnter2D (Collider2D collider)
    3.     {
    4.         if (collider.GetComponent<CorgiController>() != null)
    5.         {
    6.             if (_controller == null)
    7.             {
    8.                 _characterBehavior = collider.GetComponent<CharacterBehavior>();
    9.                 _controller = collider.GetComponent<CorgiController>();
    10.             }
    11.  
    12.             isLeft = collider.transform.localScale.x < 0;
    13.  
    14.             walkSpeedBackup = _characterBehavior.BehaviorParameters.WalkSpeed;
    15.             runSpeedBackup = _characterBehavior.BehaviorParameters.RunSpeed;
    16.             gravityBackup = _controller.Parameters.Gravity;
    17.  
    18.             collided = true;
    19.         }
    20.     }
    Then I made the player moving
    Code (CSharp):
    1.    
    2. void Update ()
    3.     {
    4.         if (!collided)
    5.             return;
    6.      
    7.         if (BezierTime < 1)
    8.         {
    9.             _characterBehavior.BehaviorParameters.WalkSpeed = 0;
    10.             _characterBehavior.BehaviorParameters.RunSpeed = 0;
    11.             _controller.Parameters.Gravity = 0;
    12.  
    13.             BezierTime = BezierTime + Time.deltaTime;
    14.  
    15.             if (isLeft)
    16.             {
    17.                 CurveX = (((1-BezierTime)*(1-BezierTime)) * StartPointX) + (2 * BezierTime * (1 - BezierTime) * ControlLeftPointX) + ((BezierTime * BezierTime) * EndLeftPointX);
    18.                 CurveY = (((1-BezierTime)*(1-BezierTime)) * StartPointY) + (2 * BezierTime * (1 - BezierTime) * ControlLeftPointY) + ((BezierTime * BezierTime) * EndLeftPointY);
    19.             }
    20.             else
    21.             {
    22.                 CurveX = (((1-BezierTime)*(1-BezierTime)) * StartPointX) + (2 * BezierTime * (1 - BezierTime) * ControlRightPointX) + ((BezierTime * BezierTime) * EndRightPointX);
    23.                 CurveY = (((1-BezierTime)*(1-BezierTime)) * StartPointY) + (2 * BezierTime * (1 - BezierTime) * ControlRightPointY) + ((BezierTime * BezierTime) * EndRightPointY);
    24.             }
    25.  
    26.             _controller.transform.localPosition = new Vector3(CurveX, CurveY, 0);
    27.         }
    28.         else
    29.         {
    30.           // Animation ends, restore old values of controller and character
    31.             _controller.Parameters.Gravity = gravityBackup;
    32.             _characterBehavior.BehaviorParameters.WalkSpeed = walkSpeedBackup;
    33.             _characterBehavior.BehaviorParameters.RunSpeed = runSpeedBackup;
    34.  
    35.             collided = false;
    36.             BezierTime = 0;
    37.         }
    38.     }
    In your opinion there is a best way to do it ?

    I hope that this kind of platform can be a good suggestion for future updates

    Thanks
     
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    I'm afraid I won't have time to review your code, hopefully others will (as I've said many times, I can't provide support for every feature you guys want to add, that's your job). However, you should have a look at the jumper script already included in the asset, it's probably a good starting point. Dunno myself, I try never to remove control from the character to the player, gamedesign wise I don't think it's nice, but that's just me :)
     
  4. codejoy

    codejoy

    Joined:
    Aug 17, 2012
    Posts:
    204
    @reuno I know you are busy, but I am trying to fix that head hitting a block and falling down issue. I found the code you spoke of in the CastRaysAbove method:
    Code (CSharp):
    1.     if (hitConnected)
    2.         {
    3.             _speed.y=0;
    4.  
    5.             _newPosition.y = smallestDistance - _rayBoundsRectangle.height/2   ;
    6.            
    7.             State.IsCollidingAbove=true;
    8.            
    9.             if (!State.WasTouchingTheCeilingLastFrame)
    10.             {
    11.                 _newPosition.x=0;
    12.                 Debug.LogError("Speed x: "+ _speed.x);
    13.                 _speed = new Vector2(_speed.x, _speed.y);//should be able to change this from 0 to _speed.x to not lose the speed in the x dir when the head hits something....
    14.             }
    15.         }    
    I thought I was giving the speed back after the head collision response...because that new Vector2(_speed.x...) was a 0. But I still must be missing something deeper.


    I thought my code change would do it but it didn't. I put up a graphic to show what is going on ...the first one is what is happening. Second one is what i am expecting or trying to get to.



     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @codejoy > Again, I'm using this thread to give news, not for support, that's what the support email is for :)
    And as I said, that's your own feature, it's not a bug, it's up to you to add your own. That said, the behavior in the asset right now is normal. If there's no force left to propel your character up, gravity kicks in and it falls down. That's the behavior in Mario games and many others.
    I'm not sure exactly what behavior you'd like, but if you want your character to jump, hit a ceiling, stay in the air connected to the ceiling and then fall down (I guess at the same time the character would have started to go down had he not hit a ceiling), then you need to code that. You need to add some sort of timer/counter to decide when to release the character.
     
  6. codejoy

    codejoy

    Joined:
    Aug 17, 2012
    Posts:
    204
    ohhh i thought this was a support forum :) ... oops. I will keep trying to figure out it shouldn't stick connected to the ceiling it just feels off and I am trying to figure out why. I am saying it seems like the ceiling when hitting your head has friction. I can keep tinkering with it... just wasn't sure why it seemed the speed.x in castrays above was making no difference on the character. I had figured when it creates a new speed from that vector the speed.x not 0 would fix that "friction" feeling. Hitting the head stops all forward momentum I guess and that isn't how I recall most platformers working. But 2am means not going to play with it now...i will try again tomorrow.
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    Well everyone keeps asking questions, so I keep answering them, but it's harder for me to keep track of everyone's questions here :) One way to reduce that friction you talk about could be also to add forward momentum.
     
  8. gamesbyangelina

    gamesbyangelina

    Joined:
    Jun 23, 2013
    Posts:
    20
    @reuno Hey, I know this isn't a support thread but I wanted to let you know I'm getting Bad File Length errors on your Unity demo and the HTML5 demo loads a blank page, so there's no way to test the engine! Very lovely website other than that though :) Any idea what's going wrong?
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @gamesbyangelina > Hum can you try from a different device/location maybe ? I've just tested both on 3 different devices and it's working fine, plus looking at the stats it seems to be working for a lot of people too. Does anybody else have the problem ?
     
  10. gamesbyangelina

    gamesbyangelina

    Joined:
    Jun 23, 2013
    Posts:
    20
    Someone did mention it on a previous page (found this thread by Googling, heh!) - I just tested it on my Windows 7 machine and it's not working here either. It's okay! The weird thing is I remember playing it previously...

    Anyway please don't worry, I do remember playing it previously, was just going to look at it one more time before purchasing. If I manage to solve it I'll let you know!
     
  11. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    302
    It would still be cool to see a beat em up engine. There isn't one currently in the Unity asset store so you would have a monopoly on that market if you were to make one :)
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @gamesbyangelina > I'll update the demos in the coming days anyway, hopefully it'll solve your issue :) Thanks for mentioning it.
    @jaelove > That's also on track, but will probably come after the infinite runner.
     
  13. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    302
    Thanks for the reply. That beat em up asset is going to be a huge success. I can't wait to see what you create :)
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    Hi,

    I've just submitted v1.6.1 to the asset store. It should be available for download within a few days.
    It's a minor releases that changes the following stuff :
    - adds camera offset settings
    - adds slope angle to the corgi controller inspector
    - fixes a bug that could cause enemies to spawn at weird positions right after a build
    - minor level design fixes on the demo levels
    - fixes the web demos

    I have to admit I'm getting a bit frustrated by the web demos. The html version weighs a ton, and the unity webplayer only works with firefox, and even then, only once in a while. Anyway, I hope you'll like this new update, and remember, if you like the asset, please put a nice review/note on the asset store.
     
  15. Plott

    Plott

    Joined:
    May 12, 2014
    Posts:
    94
    I was having issues with web player, but you have a ton a great stuff on your site good videos and gifs and documentation. I'm excited to dissect everything! Thanks a ton!
     
  16. matteo-piccioni

    matteo-piccioni

    Joined:
    Jul 4, 2014
    Posts:
    49
    Thanks reuno...
    If the player fall into a descent with a sufficient slope angle, the player will slip down automatically ?
     
  17. Plott

    Plott

    Joined:
    May 12, 2014
    Posts:
    94
    Hey reuno,

    If and when you add in multiplayer, how much do you think it'll break the current build? I would love just a local mutiplayer option. That would be great!
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @Plott > Have fun!
    @matteo.piccioni > There's no sliding behavior in place right now, if that's what you're asking. Would be easy to implement I guess.
    @Plott > The multiplayer will be in a separate asset, so it won't break the current build (that's actually the main reason why it'll be in a different asset).
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    I've updated the Android demo, it now includes all the levels.
    It works fine on all the devices I've tested it on. Can become pretty slow when (for example) shooting into portals, as the number of particles on these is quite high. Also Mesa2 still has camera effects and that can also affect performance. I left these as I think it can help get a good idea of what works and what doesn't on your device.
    You can get it there : https://play.google.com/store/apps/details?id=com.reuno.corgienginetechdemo
    Not that this is a new, separate Android app from the previous one. The only reason for that is that I lost the password to my keystore. So yeah, these are important, don't lose them :)
     
    Jkc_dev likes this.
  20. Jkc_dev

    Jkc_dev

    Joined:
    Apr 20, 2015
    Posts:
    35
    Jajajaja @reuno how bad! xD
    Thanks for the app!! min v4.4 Android =(
     
    Last edited: Sep 4, 2015
  21. Jeanchristophet

    Jeanchristophet

    Joined:
    Apr 7, 2015
    Posts:
    1
    Hey Reuno,
    I've been using your engine for a few weikd now and I'm really impressed and amazed by what it can do. I've added physic based door switch which works great with the pushable block and a few puzzles. The one thing that I would like is a fuel pack to refill the jetpack fuel (similar to the stimpack but for the jetpack.

    If you're interested, it would be something interresting to add to your to-do list.

    I don't want to impose it and at worst i will work on it on my side.
     
  22. Ssssilk

    Ssssilk

    Joined:
    Jul 28, 2014
    Posts:
    12
    I hope it's ok posting on this thread (since it's so relevant to this) -- I've purchased this wonderful asset, and was wondering if anyone here owns this asset AND spine pro -- I could use a bit of help getting the 2 to work together efficiently (Without baking) and figuring out the ideal workflow. Basically cutting out the hours of learning curve. :)

    I'm happy to pay someone for a few hours of their time. So I don't hijack this anymore, please PM me if you think you have a little time to help. Thanks!
     
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @Juaks > v4.4's the only version I could test on.
    @Jeanchristophet > I'm not sure I'll add the fuel pack refill thing. It's very similar to other pickables that are already in the asset, so in my opinion you already have all the elements to code it if you want, you just have to piece things together. You have the mechanics for pickable objects, you have the methods to refill fuel, just mix the two together. I'm trying to add a wide variety of features, not clones of the same one to artificially boost the feature list.
    @Ssssilk > It sure is ok to post here. I just want to avoid pages long thread about one particular problem.
     
  24. MarkOakley1975

    MarkOakley1975

    Joined:
    Sep 11, 2015
    Posts:
    14
    Hi guys,
    Complete newbie with a graphic design background rather than coding.

    Is there a simple way to get ice physics on a platform?
    Thanks
     
  25. Plott

    Plott

    Joined:
    May 12, 2014
    Posts:
    94
    @MarkOakley1975 go to 'create' select 'physics 2d material' set friction to zero and prob bounce to zero. add it into the platform
     
  26. MarkOakley1975

    MarkOakley1975

    Joined:
    Sep 11, 2015
    Posts:
    14
    Thanks. For some reason I couldn't get that to work late last night. Assumed it was because Corgi is non physics based, but I'll give it another crack.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    Hi all, here's a tutorial I recorded a while back and forgot to upload. It's a quick tutorial on how to use the basic physics features. Remember, it's a raycast based engine. If you're going for Angry Birds levels of physics interactions, you might want to use a different tool.

     
    zero_equals_zero and Jkc_dev like this.
  28. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    Great package. A nice jumpstart for my project.
    Regarding physics and knowing this isn't really a physics based package.
    What would be the correct workflow in order to make the enemies not able to move the pushable blocks?

    Thank you.
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @vl54 > What I'd recommend is to select your enemy, and in the inspector, under Corgi Controller you'll see a Physics 2D Interaction part. Set the Physics 2D Push Force to 0, and your enemy won't be able to push blocks anymore.
    There are other ways to do it through code, but really that's the easiest way.
     
  30. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    That is so great! How could I overlook that! Cheers
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    I've put a new short tutorial online. This one covers the teleportation options introduced in the latest update.
    Hope you'll like it!

     
  32. matteo-piccioni

    matteo-piccioni

    Joined:
    Jul 4, 2014
    Posts:
    49
    Hello reuno,
    I was in a hurry and I didnt look into code, but yesterday, using the last version in a new project, I made a quick test and I notice that a scaled enemy (red enemy I think) was scaled back to 1 when I try to play the scene

    Thanks
     
  33. tahmzad

    tahmzad

    Joined:
    Jan 24, 2014
    Posts:
    15
    @reuno Your asset looks absolutely amazing and has most of the elements I need to make my game, which is a tremendous help for someone like me who has no coding experience at all.

    I have a few requests that hopefully you will consider. I was wondering if you have plans to support 2.5D elements or CGI animation/Cutscenes? I am planning on using a lot of cutscenes to propel my story at start/middle/end of each level,for example my character walks into a room and an animation plays, at the end of it you will have some enemies who will appear in the room to attack. Another request is to have flying enemies who attack when you get closer and enemies who stand idle and throw projectiles and crouch behind a crate etc to avoid getting hit.

    I seriously can't thank you enough for all the work you have already done.

    Cheers.
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @tahmzad > I'm glad you like the asset :)
    As for 2.5D, I'm working on it right now, and hopefully it'll be in the next release (can't really give a release date, I never do, I only release when it's bug free - as much as possible - and it's pretty hard to estimate).
    Love your ideas for enemies, I'll keep that in mind.
    And regarding cutscenes, the asset already includes the trigger mechanisms you'd need for them. Hard to deliver more in a generic asset, cutscenes are really specific to your game. Not sure how I could push it further than triggers.
     
  35. monsieurtasse

    monsieurtasse

    Joined:
    Feb 2, 2013
    Posts:
    12
    First, awesome engine, thanks for your work!

    I was trying to implement a new mechanic in my prototype, and I just couldn't have a raycast/linecast working properly, so I relied on the CorgiTools script (because I haven't thought of that sooner, silly me).
    In fact I needed to emit a Linecast so I added it to the script.

    Code (CSharp):
    1.     public static RaycastHit2D CorgiLineCast(Vector2 lineOriginPoint, Vector2 lineEndPoint, LayerMask mask,bool debug,Color color)
    2.     {          
    3.         Debug.DrawLine( lineOriginPoint, lineEndPoint, color );
    4.         return Physics2D.Linecast(lineOriginPoint, lineEndPoint, mask);      
    5.     }    
    Sorry if that was discussed before or seems obvious, but maybe that will be useful to someone.

    Thanks again for this engine!
     
  36. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Hi,

    How it is possible to have moving platforms that when player jumps on them, he would attach to the moving platform?

    Right now when I jump on a moving platform from your demo, and moving platform goes down vertically, player would stay in the air for a second and then goes down. So if it was to attach to the moving platform, the behavior would be smooth.

    Thanks.
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @UnbreakableOne > What version of the engine are you using ? This has been fixed a few updates back.
    If you're using the latest version, does this happen on the demo levels too ? I just gave it a try just to be sure and the player sticks to the platform.
     
  38. UnbreakableOne

    UnbreakableOne

    Joined:
    Nov 16, 2013
    Posts:
    168
    Since we had to modify your code to fit our needs, we can not update. I think we are at 1.5 or something.

    Do you remember how you've implemented it? By parenting the platform to player or adding it's velocity before every other thing?
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    Well it's part of a lot of small changes so it'd be complicated to list them all.
    But yes, basically the idea is to detect whether your character is standing on a moving platform, and if that's the case, cancel its gravity until it jumps or leaves it, while allowing for horizontal movement and plugging its vertical velocity to the platform's.
     
  40. Mr.Stein

    Mr.Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @Mr.Stein > No I hadn't seen this post.

    Not sure I'll reply, I don't like comparing products, or dissing the other one. I prefer using my time on making great stuff. If people don't like it or prefer to go another way, that's fine by me. If you don't know which one to buy, play the demos, and look at the assets' websites, and get whichever looks the best to you.

    But thanks for spotting this :)
     
    twitchfactor and matteo-piccioni like this.
  42. kokkorollo

    kokkorollo

    Joined:
    Jan 16, 2013
    Posts:
    9
    Hi, there is a way to grab an edge?
    I need to stick on the edge of a platform, and then to release to fall or jump form there.
    is this an easy trick of options or I have to make it by my own?
    thanks!
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @kokkorollo > Hi, that's not included in the asset, that's something you'll have to code yourself.
    It's on my roadmap though, so hopefully it'll get included soon.
     
  44. MarkOakley1975

    MarkOakley1975

    Joined:
    Sep 11, 2015
    Posts:
    14
    Hi all,
    I'm trying to get a variable jump working where a quick tap produces a tiny jump and a hold of, say 2 seconds, produces a larger jump, with scope for varying height in between. I've had a look at the "Jump Is Proportional To The Press Time" check box but, no matter what I set the "Jump Height" and "Jump Minimum Air Time" parameters to, I can't seem to notice much difference between a short tap and long press in the overall jump height. Any ideas on what I might be doing wrong or should I be looking to recode the jump mechanic from scratch?

    Any help would be gratefully received!
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @MarkOakley1975 > I digged deeper into your problem, turns out there was a bug (not sure when or why I changed that, but I've fixed it for the next release). If you want to fix it in the meantime, in CharacterBehavior.cs, look for these lines :

    // if the character can jump we handle press time controlled jumps
    if (JumpAuthorized)
    ...

    Change that JumpAuthorized like that :
    // if the character can jump we handle press time controlled jumps
    if (Permissions.JumpEnabled)

    That should solve the problem. Let me know if the problem persists.

    And while I'm at it, v1.7 is almost ready for release, it includes quite a lot of changes, I'll update when I submit it, hopefully within a week.
     
  46. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,408
    Hello reuno, could you share a list of the changes? Therefore I see if I have to hold my production. Thankyou
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
  48. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,408
    Sure reuno, but I ask if we could get changelog before its done. Therefore I can decide if next features / fixes are important for me :)
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,038
    @Devision4 > Makes more sense :)
    But I'm afraid I can't give you the changelog before I'm done with the changes.
    Plus I'm still not sure what I'll include in this release exactly, still have work to do and decisions to take.
    You'll have to be patient :)
     
  50. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,408
    ah ok fine :) Thanks mate!
     
unityunity