Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v8.0 : advanced damage system]

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

  1. KeepTrying

    KeepTrying

    Joined:
    Feb 23, 2011
    Posts:
    119
    @reuno "I'm probably out of your price range" i was thinking that too :(
    "If you have a specific question I'll be happy to help" :)
    Ok, i'm buying some stuff in UAS, as soon as i start to convert the 3D in 2D, we can start our conversation.
    Many thanks Mr. @reuno
     
  2. DiscoFever

    DiscoFever

    Joined:
    Nov 16, 2014
    Posts:
    286
    @reuno working quite well now thanks; i have a minor trouble with edge detection; i'm still missing some gaps (see screenshots) any idea where you define the edges and the raycasts ?
     

    Attached Files:

  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    That's very weird. Collision detection is based on the size of your collider2D. From what I can see on that screen it seems fine on your character. Maybe it's wrongly sized on your platform ?
     
  4. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    hi petelachatte,
    probably edge collider thicknes ; eg Ferr2D , below 0,06 , i have problem edge detection.

    Nb: edge collider 2D (physic2D Unity) can not handle edge collider thicknes.
     
    Last edited: Feb 19, 2015
  5. javier11om

    javier11om

    Joined:
    Apr 27, 2014
    Posts:
    28
    Hi,i'm loving this asset...I just had a couple questions, I read a post you had replied to earlier and for the past four or five hours I've been trying to map a button to the ChangeWeapon function (im not a programmer).I just want the game to remember which weapons were picked up and be able to switch through them. I got as far as mapping the button to the input manager so it looked like this

    if (CrossPlatformInputManager.GetButtonDown("ChangeWeapon"))
    _player.ChangeWeapon(Laser);

    but the actual parameter has to be of 'Weapon type' meaning it has to be a gameobject with weapon script right? Which confuses me because that means I have to put a prefab in the editor of the InputManager scipt? And also just picking up the prefab or walking over it actually doesn't save it if I pick up another upgrade the old weapon is gone, I have to do something in the GameManager script to save which weapons i've collected right? Sorry If I confused the hell out of you haha any guidance would be appreciated!
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @javier11om > I don't think there's a way to do what you want to do without coding it yourself. The inspector won't be enough.
    - To have the player change the weapon when pressing a button, you have to create a weapon prefab (there are two included in the asset, just look at how they work / what components they have). Then you'll have to instantiate it and then use the ChangeWeapon function.
    - To remember what weapons were picked up, I would expand on the existing GameManager, which is a singleton that persists between scenes.

    In any case, these are really "how does Unity work" questions, they're not specific to the Corgi Engine.
     
    Mr-Stein and Exeneva like this.
  7. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    does the corgi engine have a falling platform script (player runs, and the platforms he steps on falls to the floor). If it does not have it, how can i implement it to my game thank you in advance.
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @snake77jt > It does not, but I reckon it'd be a nice addition, I'll add that to the todo list.
    If you want to implement it yourself, it's pretty simple. Look at how the Jumper platform works. Basically it's the same thing, just instead of pushing the player up in the air, you make the platform fall down.
     
  9. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    Thank you!
     
  10. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    the falling platform thing works, but i now I am having problems with the SimpleEnemyAi script, it states (The SimpleEnemyAi has been destroyed but you are still trying to access it). the enemy wont re-spawn once I die. I tested it using the provided sample scene level 1.
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @snake77jt > I guess you got my email reply, but for anyone out there with the same problem, there was an issue with the HasHealth script. The last line shouldn't be Destroy(gameObject); but gameObject.SetActive(false);
    I've of course included this fix to the next release. Thanks again for spotting this bug, @snake77jt
     
  12. luigix

    luigix

    Joined:
    Mar 13, 2010
    Posts:
    15
    Playing around with this sweet asset, integrating my own code. And It's very well written, so well done.

    I know @reuno you're already working on a new release but I wonder if you already thought about different animations
    shooting/attacking while jump / run / walk / jetpack / dash , I think the are really a must for considering this, a complete set of animations, (especially if you're working with bigger sprites where animations are more detailed)

    Now a few questions:

    1) I'm struggling figuring out how to move the origin of shoot bullets.
    I though it would be enough to move the *FireLocation components of the Player prefab, but it seems to ignore it.
    Is that the right way?

    2) How to totally remove or reduce the slope behavior?
    Sometimes it activates the "jump/fall" animation which is really ugly to see.
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @luigix > well the asset already includes something like 15 animations, that cover all the actions you're mentioning and more, so I'm not sure what that first part is about :)
    Edit : I guess I missed that "while attacking" thing. Sorry. Yes, I'll add that someday.

    On to your questions :
    1 > Yes that part is (was) messed up, and pretty hard to figure out. I've spent the weekend reworking it completely, it'll be much easier to add new weapons (and the origin of their bullets and all) when 1.4 is released. In the meantime, look at the Shoot methods in CharacterBehavior. You'll notice some parts where the firelocation is hard coded (well modifiers are hard coded), that's probably why you're having trouble with it. I think you'll like 1.4.
    2 > That's going to be trickier. You'll want to change code in the CorgiController2D script. That's sensitive though. I have to admit removing the ability to handle slopes kinda goes against the whole idea of having a controller to handle slopes, so I never gave it much thought :) Maybe play with the slope speed curve before trying to remove it :)
     
    Last edited: Feb 22, 2015
  14. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    I have a few suggestions for future updates, please consider them.
    1. Ai's that are more focused on the player, ( once they spot the player, they will continue to attack not just walk away)
    2. Player/Ai's could use grenades, or other forms of weapons.
    3. pulling and pushing objects
    4. falling platforms once the player touches it, the platform breaks or explodes ( mentioned this one before lol)

    That's about it, everything else is perfect. :)
     
    KeepTrying likes this.
  15. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    My thoughts on the suggestions:

    Can put an invisible box around the prefab or generate an invisible box. If the player is in this box, the AI can see the player. Alternatively can use a way to detect line of sight, by raytracing. There's likely other methods of doing this.

    This could be detrimental to gameplay since I haven't personally played a platformer where the AI enemies could screw around with objects you set in a specific place for a specific purpose. This could be bad if your platformer has a puzzle and the AI respawns every now and then and moves objects around.
     
  16. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    those suggestions were based on battle block theater the game. The asset has 90% of the things i need, i only need the last 10% which was the things listed above. But the ai tip was helpful, thanks @Exeneva.
    the only assets im using is the corgi, and mad level manager.
     
  17. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    Those suggestions, while I think some are nice (especially falling/breaking platforms), are rather game specific and may fall outside the scope of the asset.
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @snake77jt > Good suggestions. The falling platforms and pushable stuff are already in the todo list, I'll think about the other two. A few things :
    - the enemy already "sees" the player via raytracing, that's how it decides to shoot or not. Updating it so it doesn't turn around would be fairly easy.
    - pushable stuff won't be pushed by AI, only by the player. As @Exeneva said, it'd become a mess very fast. I can make it optional I guess.
    In any case, these 4 features are relatively easy to code, if that's really all you're missing, you should try and code them yourself :)
     
  19. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    for the push and pull objects i was only talking about the player . I cant code at all, so i could just wait. If you make some of those suggestions its cool, but if you dont , i understand.
     
    Exeneva likes this.
  20. csotomon

    csotomon

    Joined:
    Apr 28, 2012
    Posts:
    20
  21. prime31

    prime31

    Joined:
    Oct 9, 2008
    Posts:
    6,426
    Just a heads up for anyone reading this thread:

    The 2D Platformer - Complete Project - Corgi Engine directly infringes on the freely available CharacterController2D (GitHub link): https://github.com/prime31/CharacterController2D The CorgiController2D class is a near copy of the CharacterController2D class.

    A cease and desist letter has been sent to the asset owner and the infringement has been reported to Unity.
     
    JamesArndt likes this.
  22. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    432
    This is a legal matter that is best handled by prime31, reuno, and the Unity team. Let's not turn this discussion thread into a flamefest where little children gossip.

    You can also stop messaging me about doing free programming work for you, snake77jt.
     
    Mr-Stein likes this.
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @prime31, @Exeneva, @KeepTrying > As I've mentioned a few times in this very thread (here for example), the basis for this project came after completing a free tutorial I found on youtube, by 3D buzz. This tutorial explained how to create a very basic platformer, and gave me a good head start. Since then, and mostly based on the feedback in this thread, I've built on it, and (I hope) added value to the product.

    That said, that tutorial and @prime31's code share a lot of similarities. When that was first mentioned to me I didn't think most of it and just thought we both had had the same inspiration, but it's clear to me now that it's just not the case. I don't think my code and @prime31's have a lot in common (that's why the near copy thing seems a bit hard to me), but if, as I think now, that tutorial was based on his work, then I guess mine is too, and the core logic is similar.

    As an artist and a developer, I don't take plagiarism lightly. I've had my work (design or code) ripped off many times (hell, even this asset's been pirated heavily), and that always bugs me a lot. So even if I know it was an honest mistake on my part, I'll do whatever @prime31 deems necessary. He's asked me to take the asset down, so I've immediately sent a request to Unity to comply. I've reached out to him, explaining the situation. If, after my explanations, he still thinks I've stolen his work, then I guess I'll have no choice but to start again from scratch.

    @csotomon > Thanks for pointing this out. I've already fixed this bug in the upcoming 1.4. Due to that whole mess though, I don't know if or when it'll get released. Sorry about that.
     
  24. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    302
    Man this sucks I hope you can continue working on it it's an amazing product and I am looking forward to the features in 1.4
     
    Mr-Stein likes this.
  25. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Since this is in the thread, everybody should be on the same page and I don't see a link to the tutorial series.

    Youtube Tutorials:


    CharacterController2D and CorgiController2D both use some of the same code from this tutorial. Not sure who made what first, but the fact is there are significant differences between the scripts. While they both use the ideas in the video and chunks of code from it, the controllers are clearly not copies. A public forum is not the place to deal with legal matters, especially when flamboyantly issuing C&D's.
     
  26. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    I dont think you need to start again from scratch, there is always similar codes in the world.
    I look at the @prime31 code and that is very basic implementation... there are many codes that use the base physical implementation too as with raycasting implementation.
    So in my opinion @reuno you just implement one more way to do things(mathematics was always there and Unity raycast technique also) and is not a copy.

    Regards
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    @Mr.Stein > Sure, but I now think @prime31 invented it, and I guess was (inappropriately) copied by some guy, who made a tutorial, and I dumbly followed that guy's tutorial. So basically I'm as guilty as the original guy. I feel really bad about it.
     
    landon912 likes this.
  28. MarcusWatson

    MarcusWatson

    Joined:
    Dec 9, 2014
    Posts:
    53
    Judging by the Github checkins and the date on the tutorial, @prime31 indeed had the code first. You didn't know you were handling stolen property, @reuno, but at least you're trying to make amends. Maybe there can be an amicable solution?

    Should @prime31 have a chat with the folks who did the video to let them know they need to attribute his work? It's not a commercial video, but if they're using his work they need to mention it (and also to avoid other people making the same mistake as you)
     
  29. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Agreed, it is really unfortunate and totally out of line on their behalf. 3DBuzz has a large viewer base and this could be all over the place by now with other developers assuming that they just followed a free tutorial with some cool tips.
     
  30. hodge_podge

    hodge_podge

    Joined:
    Feb 22, 2015
    Posts:
    30
    Yes, I had no idea the character controller had a GNU style license since those 3DBuzz tutorial didn't list its sources or state that the code belongs to someone else. Because of this, a lot of people figured its code were free to use in any project whether it was commercial or not.

    I hope this gets resolved in a manner where every party benefits from its outcome.
     
  31. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    what??.. the asset was removed from Asset Store?
     
  32. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Per Prime31, to reuno. Mentioned above.
     
  33. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    Dang, I really liked this asset. Im guessing the v1.4 will not be released : (

    I hope reuno will make more assets in the future peace.
     
  34. MarcusWatson

    MarcusWatson

    Joined:
    Dec 9, 2014
    Posts:
    53
    Reuno had a well-coded modular solution. I'm hoping it'll be a case of plugging in a different 2dcontroller if an agreement can't be reached with Prime31
     
  35. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,462
    Well, hopefully they're talking and sorting it out. We'll find out later.
     
  36. hodge_podge

    hodge_podge

    Joined:
    Feb 22, 2015
    Posts:
    30
    I am hopefully they will be able to reach a good agreement, Reuno's asset has more to it then the player movement script that was used from that 3D buzz video and Prime's controller has taught a lot of people how to a great 2d platformer script is made.
     
  37. KeepTrying

    KeepTrying

    Joined:
    Feb 23, 2011
    Posts:
    119
    @reuno "Maybe" you can use the "2D Platformer" from Unity Technologies as start point
    to get your new "2D Controller" done.

    https://www.assetstore.unity3d.com/en/#!/content/11228

    As far as i can see, Corgi Engine is the best 2D Platformer engine in UAS.
    In a few weeks i will start to port my 3D Platformer into 2D World and Corgi Engine is my choice to do that.
    Until then, I hope things are resolved, i'm counting on you :)
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    Hi all,

    I'm back with good news.
    Short version : the Corgi Engine will be back in a few days.


    Longer version :
    As I've explained previously, when I first started what would become the Corgi Engine, I took inspiration from books and online tutorials, mostly for the raycasting part (as I was not really an expert in maths). Among these was a video tutorial by 3D buzz, and some parts of the basic logic of this collision code were still present in the last version of the engine in the character controller script. It turns out this code was not created by 3D buzz as I thought (and as they say), but by @prime31, who offers this code for free to the community on github. So basically I copied his code without knowing it. His controller is excellent, and if you're interested in a robust character controller, you should look at https://github.com/prime31/CharacterController2D.

    I've asked Unity to remove the asset from the store temporarily, as I don't want to distribute code that is not mine. Sure, as some of you have mentioned, the character controller is only a small part of the engine, but it's still a core part, and I won't be called a thief. So I've started work on a new controller, which should be complete in the coming days.

    When I'm done rebuilding it (and maybe improving it with a few new things), I'll put the asset back up for sale. This new version (1.4) will also include new stuff I had already ready. I've had to reduce the scope of that 1.4 version, but it'll include among other things a jetpack upgrade, with more options like fuel management, which triggers if you want it to a new fuel jauge (you can customize the fuel quantity and cooldown time), makes the weapon, jetpack and melee systems independent from the character behavior, fixes quite a few bugs, and adds some GUI stuff, like the current level.

    If you wanted to purchase the engine right now, well I'm afraid you'll have to wait a few days.
    If you already own the asset, I'll make sure this new one doesn't cause any compatibility issues.

    Thanks to @prime31 for hearing me out, and to you guys for your support. Sorry about all that mess. I'll check back with you when I'm done with 1.4, in the meantime if you have questions about the asset I'll be happy to help.
     
  39. MarcusWatson

    MarcusWatson

    Joined:
    Dec 9, 2014
    Posts:
    53
    Thanks for your professionalism and transparency, Reuno. Really appreciated.
     
    gekidoslair likes this.
  40. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
  41. javier11om

    javier11om

    Joined:
    Apr 27, 2014
    Posts:
    28
    Hi, thanks for the response, I added multiple weapons and even ammo for each type...Just letting you know when the timemodifier is on if you press the pause button, then the duration ends up going forever(i think)...
     
    KeepTrying likes this.
  42. javier11om

    javier11om

    Joined:
    Apr 27, 2014
    Posts:
    28
    I figured it out, when you press the pause button it calls the function SetTimeScale, which saves the current timescale before pausing it, but if the Time modifier is on it obviously saves that timescale and when the Time modifier reverts back the saved timescale has been changed, so I duplicated SetTimeScale and ResetTimeScale and added a new variable _savedtimescaleifpaused so now if it pauses it won't override the _savedtimescale float :D
     
    KeepTrying likes this.
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    Good news everyone : I'll be submitting the new version tonight (French time).
    I've built a new collision controller from scratch, and so far it gives great results, while preserving the "feeling" of the old one. That new version will also include new features, I'll post them when I'm done with them all.
     
    sefou, inthemilkywat and MarcusWatson like this.
  44. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
  45. snake77jt

    snake77jt

    Joined:
    Dec 23, 2014
    Posts:
    46
    Faster than i expected good job
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,915
    The asset is back for sale!
    https://www.assetstore.unity3d.com/en/#!/content/26617

    So here's the v1.4 update.
    It has a shorter scope than initally planned, but 1.5 will have more stuff, so all is not that bad :)
    So what's new ?
    - a brand new character controller, this time coded from scratch (again, sorry @prime31 for all the trouble). I went with a different implementation (it's still raycasting), and tried to have the character stick more to the ground than it previously did. I also tried to keep the same feeling overall, can't wait to get your feedback. You can give it a try in the updated demo over there : www.reuno.net/corgi-engine-the-best-unity-2d-platformer-kit#demo Of course if you find bugs, please let me know and I'll try and fix them asap.
    - jetpack upgrade, with fuel management. you can now optionally have limited fuel, which triggers a new fuel bar in the HUD, you can customize the fuel duration and cooldown when empty
    - adds current level display
    - jetpack, guns and melee systems are now independent from the character behavior
    - fixes a bug that happened when trying to respawn a dead enemy
    - fixes a bug that caused the characters to slowly move down into platforms

    As this asset changes the character controller, it WILL break compatibility with previous versions of the assets. Update carefully. It should be pretty easy to convert an existing project to the new version though, let me know if you have questions.

    Thank you all for your support for the last few days, sorry for the inconvenience, and if you like the new version, please add a comment/note on the store!
     
    KeepTrying and MarcusWatson like this.
  47. inthemilkywat

    inthemilkywat

    Joined:
    Dec 29, 2013
    Posts:
    56
    The demo doesn't show the new updates you implemented. Also does this support 2d toolkit?
     
  48. sefou

    sefou

    Joined:
    Aug 30, 2011
    Posts:
    287
    Hi reuno,
    is it normal ,we must use keyboard ( space + up) or Xbox pad (left stick up +A ) to climb from the bottom of the ladder ?
     
  49. NAiLz

    NAiLz

    Joined:
    Apr 17, 2013
    Posts:
    88
    Reuno,

    First, let me add to the compliments found on this thread. I really love this asset. I'm having alot of fun working with it and learning alot in the process. I'm sorry about all this mess with Prime31's code. It's a real eye opener about 3DBuzz though. I guess they just became less reputable in my mind. I'm glad it got resolved though and I'm excited for the update.

    I have a couple of quick question for you concerning future updates:

    1. I've been working on an I/O system to make sure players can save their data and pick up where they left off. I wondered if you had an I/O system planned for future updates.

    2. I want to implement same-screen multiplayer, which is straight forward in some of the coding I've done before (involves using a variable for the inputs which captures the strings in the input manager so that each player has independent controls based on the same controller). It's going to take alot of extra work in the case of this engine so I wondered if you had plans on implementing such a system or if I should plod forward with my own version.

    Thanks so much for this awesome asset.

    Cheers
     
    gekidoslair likes this.
  50. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    I just wanted to say, I'm glad you redid the character controller from scratch. I just played the web-demo and everything just seems so much more responsive now! I'm impressed! :)

    This new version is a billion times better than that buggy version you supposedly made an "exact copy" of. This version is faster, cleaner, and all around more stable in functionality than the old version -- and you kept the jumpthrough slopes you implemented too!

    If prime31 wants to get butt-hurt that your engine is getting a lot of attention, that's fine! I promise his code isn't the reason for that. So good riddance to bad rubbish I'll say! Your ditching his code made this engine loads better! So I want to be the first to sincerely thank you for tossing that dude's code! Your customers are (and will continue to be) very grateful for your much-improved (and much-more responsive) play experience! :)