Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    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. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Muppo > Basically you'll want the platform to detect the player and use the player's controller SetForce (or similar) methods to move it instead of just relying on input. It becomes tricky if you want to also have input at the same time, and then you have to decide what input can be had at the same time, and how to handle that.
     
    Muppo likes this.
  2. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99
    @reuno your tip did not work, but I got why and it's my bad.
    Before teleporting, i was lerping the character to move towards a door and it was passing through a platform collider ... so it was interacting somehow with CorgiController I guess. I disabled the CorgiController component before the walk and enabled after the teleport, and it worked.
     
  3. raingame_

    raingame_

    Joined:
    Jan 15, 2019
    Posts:
    28
    Hi there, I've noticed that when I have low fps Corgi's physics starts to work bad, especially dash. And I think it's because Corgi uses Update method instead of using FixedUpdate for physics calculations. Then I called EveryFrame method in CorgiController in FixedUpdate:
    upload_2019-1-15_16-29-29.png

    But physics started to work weird. How to solve this problem? I also have noticed that your new project TopDown Engine has a selection to choose where physics needs to be handled. Waiting for response. Thanks!
     
  4. lmalec

    lmalec

    Joined:
    Nov 20, 2016
    Posts:
    5
    Hi,
    First of all, I would like to say that Assets are amazing. Good job.
    I’m going to transform my game demo from Construct 3 to Unity. I’m beginner in C#. I would like to custom mouse aiming, but I have problems.
    When "On" Weapon Flip and Character shoots back the weapon does not flip x axis.

    Example (CharacterIsFlipRight): weaponCurrentAim.png
    I would like weapon flip X axis.
    Example (CharacterIsFlipRight):

    weaponProperAim.png
    I have changed the settings manually.

    Do You have an idea how to solve this problem?
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @luigi-freguglia > I'm glad it's working now!
    @raingame_ > The Corgi Engine doesn't use physics for movement, so that's really unrelated. The TopDown Engine does though, and that's why you get to choose. In the case of the dash, nothing to do with physics. But if you're planning on having low fps (instead of degrading whatever causes the FPS drop - models, textures, etc) you'll need to plan for that. One solution could be to compute the dash destination when the dash starts, or casting a ray behind you to make sure you didn't cross a wall during a (now super long) frame. I prefer making sure FPS never drop to guarantee a good gameplay experience, but there are definitely two schools on this, feel free to take the other approach.
    @lmalec > That's not something that is built-in, you'll have to implement it. Extending WeaponAim to do so will be the easiest solution to this, it already contains all the methods you need for this.
     
  6. lmalec

    lmalec

    Joined:
    Nov 20, 2016
    Posts:
    5
    @reuno Thanks for quick replay
     
    reuno likes this.
  7. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    Is it possible to use a visual scripting asset combined with corgi engine?
    The reason I ask is because bolt2 does not work for that matter (I got it to work but it was a real headache, I had to delete most of the corgi demo folders and still got many warnings)

    I need a visual scripting language that generates c# code (like uNode). There are some in the asset store, but they all cost some decent cash so I wanted to ask:

    Has anyone experience with corgi engine AND visual scripting?
    Is there a proven visual scripting solution with c# code generation that works with corgi engine?

    thanks


    P.S.:
    I managed to develop endless side scrolling with bolt2 (portals in corgi engine do not work for that matter). It is really fast because of the c# generation- even in the editor, but unfortunately it stops working at some point because of Incompatibilities with corgi engine and other assets.

     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @captnhanky > I don't use visual scripting myself (obviously) but I know a lot of people have been using Bolt or Playmaker with the Corgi Engine successfully (from what they've reported via email, right here or in the reviews).
    Everything in the engine is scoped properly behind a namespace, so I don't see how it could cause any incompatibility, at least not in the C# sense. As far as I know these tools simply allow you to plug into public methods, so as long as you use the ones exposed in the engine, you should be fine.

    And indeed to do something like your video a portal may be a bit overkill (although I really think it'd work), but a much simpler solution is to simply teleport your character when its x value reaches a certain threshold to a new position with the same y and z, and an adjusted x. By teleporting I mean just updating its transform's position.

    I'd suggest contacting Bolt's creator for help on this maybe, I don't see why it wouldn't work. If you need more methods exposed on some specific components I'm always happy to discuss and accomodate for this.
     
  9. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    It's been a while since I used Bolt and Corgi but I don't recall any input errors. I suspect they may have to do with project settings getting overwritten.

    That said, you import your scripts as unit options and then add them to your graphs as needed (note: these aren't Corgi scripts, this is just a screen shot from their website).



    In all honesty, though, I started both Bolt and C# from scratch and have actually found it a little easier to just use C# -- due to the learning curve, Bolt just felt like I was doing twice the work.
     
    Last edited: Jan 17, 2019
  10. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    @reuno

    Thanks for the reply!

    I do NOT use Bolt. I use Bolt2 (it is currently in alpha status..because it can generate c# code)

    Bolt2 uses .net 4.x
    Maybe this is the reason why it makes so much trouble?


    Bildschirmfoto 2019-01-18 um 05.25.01.png

    I already contacted the bolt developer on that issue but got no response until now

    ..and yes, you are correct..the method you describe as teleporting is exactly the method I use, but it is much more complicated than that (at least for me ;) )


    @Boom_Shaka

    "That said, you import your scripts as unit options and then add them to your graphs as needed (note: these aren't Corgi scripts, this is just a screen shot from their website)."

    Sorry, but I don´t understand that. I have no scripts written, Which scripts should I import? And why?

    I am such a noob when it comes to programming. I have some experience in c, because I programmed some micro controllers but object oriented programming is giving me headaches. I tried it but after months of failures I decided to focus on visual scripting more. Bolt2 can generate c# code so maybe I learn a little there.
     
  11. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    OK, my bad...never heard of it. Couldn't help you. But if it's still in alpha, you should count on it not working with anything
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @captnhanky > The Corgi Engine is absolutely safe to use with .net 4.x, so it must be something else.
    I don't know much about Bolt 2, but as @Boom_Shaka said, I wouldn't expect much stability from an alpha in general :)
     
  13. pjooren

    pjooren

    Joined:
    Apr 12, 2017
    Posts:
    14
    I think I might have found an issue with the Health Component. Death Force Y works fine, but Death Force X isn't working.
     
  14. Yuuki-66

    Yuuki-66

    Joined:
    Jan 18, 2019
    Posts:
    6
    Hello !

    I've buy the Corgi Engine a few month ago and just begin with it now. I am a newbie on Unity and in creating a game but it seems to be very simple to use this engine. Thanks a lot for all your work !

    I am trying to understand the Projectile Weapon Component and after a few test, I was able to create a machine gun. The only problem I have for now is after the Auto Reload, I have to click again for restarting fire. Is it not possible to just hold the button all the time ?

    The question in French (because I'm not sure my question is understable in english) :
    Est-il possible de rester appuyer sur le bouton de tir tout le temps ? Ou doit-on obligatoirement réappuyer sur la touche après que le rechargement de l'arme se soit faite ?

    Thanks a lot !
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @pjooren > It was only ever designed to move on y I think, I'll change that for the next release. In the meantime you can comment line 354 in the Character class and that'll solve your problem. If you find bugs please use the support email to report them, makes it easier for me to keep track and deliver fixes (I have a more elegant one ready for this if you want, drop me a line), thanks!
    @Yuuki-66 > Not built in, no (but you can extend the class to do so using all the existing public methods to implement your specific use case). And please stick to English, thanks!
     
  16. Yuuki-66

    Yuuki-66

    Joined:
    Jan 18, 2019
    Posts:
    6
    Thanks for the answer. I'm not sure to understand the solution (I'm not a programmer at all) but it works fine as it is now. I was just wondering if I've missed something or not :)
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Yuuki-66 > Ok if you're not a programmer it's gonna be a bit harder :)
    But you haven't missed anything, it's just not a setting right now. I usually put some of the most common use cases as examples, and from there I recommend extending the engine (basically creating scripts that change a feature slightly) as implementing all possible use cases would turn the engine into an unusable and overly complex mess.
     
  18. Yuuki-66

    Yuuki-66

    Joined:
    Jan 18, 2019
    Posts:
    6
    Yes, I understand it will be hard to make everything possible. And the Corgi Engine have already a lot of thing.

    Well, I'm not against learn how to code and all or at least trying to understand how your engine works, but when I see that that "Weapon.cs" have 880 lines for exemple, I'm not sure where I should begin ^^'
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Yuuki-66 > The amount of lines doesn't really matter when logic is well distributed across methods, as is the case in Weapon. It's just a big state machine. When extending, for something as simple as that reload thing, you'll usually only have to extend one method. In this case that'd probably be CaseWeaponReloadStop, and it's only 4 lines. As for where to begin, I'd say definitely with something more entry level than this, tutorials, stuff like that. And then as far as the Corgi Engine is concerned, the API documentation seems like a good entry point to understand how classes work.
     
  20. Yuuki-66

    Yuuki-66

    Joined:
    Jan 18, 2019
    Posts:
    6
    Yes, I see the lines in question. I'll try a few stuff. thanks !

    I've already did a few tutorials but it was nothing like your engine who are a lot more complex ^^' I can understand the basics of your codes but I don't think I have the level to try to modify it. I'll look the API documentation in detail and try a few thing. Thanks a lot for the help !

    Edit : Oh it was very simple indeed. I just changed the state of "WeaponStates.WeaponIdle" to "WeaponStates.WeaponStart" and it begins to works. Thanks a lot Reuno !
     
    Last edited: Jan 19, 2019
    reuno likes this.
  21. Yuuki-66

    Yuuki-66

    Joined:
    Jan 18, 2019
    Posts:
    6
    Hi ! It's me again. I'm sorry to ask a basic question again :/

    My weapon use the Free Rotation mode with the mouse at Aim Control. I'd like to flip my character to the left when the mouse go behind him. I did not find an exemple in the asset.

    Should I modify that in the Weapon Aim Script or in the Character Script ? I'm a little lost.

    Thanks !
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Yuuki-66 > Extending WeaponAim seems like the obvious choice here, but really there are no rules, feel free to do it however works for you.
     
  23. Yuuki-66

    Yuuki-66

    Joined:
    Jan 18, 2019
    Posts:
    6
    I'll do that then. Thanks !
     
    reuno likes this.
  24. Mcg

    Mcg

    Joined:
    Mar 28, 2012
    Posts:
    114
    hey, I'm trying to use mecanim animations for things like ladder climbing however their facing direction will be facing to the right or left when say for ladder climbing its needs to face backwards, is there an easy way to switch the facing direction backwards until the player is off the ladder?
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Mcg > I'm not sure I get what you mean. In what context? 3D?
    If yes, have you looked at how the Corgi3D climbs ladders for example?
    In any case, in a 2D platformer (or 2.5D), your Character doesn't face forwards or backwards. That's something you animate if you want.
     
  26. Mcg

    Mcg

    Joined:
    Mar 28, 2012
    Posts:
    114
    Hey sorry yes I meant for 3d well 2.5d :p, it was just the case of the animation not set up to face another direction other than forward so I just added some code to override the rotation for now while it's colliding with a ladder to face backwards :)
     
    reuno likes this.
  27. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    29
    Is there an option to have stun effect for a brief time after taking damage? I couldn't find it.
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Mindjar > Nope. You can see a full list of features on the asset's page. If it's not listed, it's not in the engine (yet).
     
  29. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    @reuno -- just out of curiosity, could we use the "frozen" character condition state for something like this or would we need to create a new condition state altogether?
     
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Boom_Shaka > Absolutely, that'd be a really good use of that state.
     
  31. Ale_alejandro

    Ale_alejandro

    Joined:
    Dec 12, 2012
    Posts:
    22
    Is there a known inventory bug?
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @Ale_alejandro > There is one in one of the latest versions that prevents unequipping weapons properly, and a minor typo one that can cause a target equipment inventory not to be found if you haven't set a target inventory name. Both have been fixed for the next release. If you think you've found a bug, please use the support email to report it (and provide reproducible steps, thanks!).
     
  33. achan_unity

    achan_unity

    Joined:
    Apr 23, 2018
    Posts:
    13
    Hello, I would like to add a new ability for the character to 'break' things. I am thinking of extending the Character Ability to introduce a new CharacterBreak ability and a Breakable object.. (following the CharacterPush and Pushable example).. but I have a few questions:
    1. Is my approach right?
    2. Any suggestion on how to trigger this ability? a special button? part of the melee attack?
    3. Looking at the set of CharacterMovement states.. should i introduce a new state? or is this not really a movement state?
    4. Any suggestion on how to create a generic "breaking" animation on top of any tiles?

    Thanks, Allen
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @achan_unity > There you go :
    1. Yes, or you could just use the Weapons/Health system. You'll find a lot of breakable things in the demos for reference.
    2. I don't know, depends on what you want to do. But I'd recommend a new input per ability, gives you more freedom to tweak your control scheme afterwards
    3. It doesn't seem like a movement state to me
    4. Depends on your tech, art style, etc. Hard to answer that question without knowing your specs and skills.
     
  35. achan_unity

    achan_unity

    Joined:
    Apr 23, 2018
    Posts:
    13
    Hello, thank you for the quick answer!

    1. Using the weapon & health system is a good idea. Let me experiment with that approach as well.
    2. I am thinking as part of the game, the player will need to break thru certain walls or dig through the ground. Maybe the player will have to equip a pickaxe to break stone or an axe to break door. In that case, maybe I will just use the attack action then?
    3. I agreed breaking is not a movement state. Looking at the code, I don't see a way to extend the states without modifying the original file, is that the case?
    4. The game level is going to be tile based. I want to see if there is a way to modify the sprites of the tiles with cracks without having to draw all the tiles beforehand. Any suggestion would be great.

    Thanks again. Allen.
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @achan_unity >
    2. Again, I'd recommend separating input, but it's up to you. Do however you prefer.
    3. Yes, C# limitation, enums can't be extended.
    4. If you're using Tilemap, you can create custom rule tiles for that I guess.
     
  37. MudPuppet

    MudPuppet

    Joined:
    Aug 10, 2012
    Posts:
    162
    POSSIBLE BUG WITH RETRO ADVENTURE HEARTS (Lives) DISPLAY

    Platform: OSX (High Sierra / Mojave) + iPhoneX
    Unity3d: version is irrelevant but today it is 2018.3.2
    Corgi Engine: all versions since Retro Adventure was implemented - today it is 5.3

    Hello, first off let me say that 'yes' I know that bug reports should be sent via email. This has been done with no satisfactory result or solution - but Reuno was kind enough to do a test (whilst on vacation which shows product support dedication) that proved me wrong about the bug/issue at his end on iPhoneX. Yet the bug or issue has been persistent at my end since the Retro Adventure demos were implemented.

    The Problem:
    On the Retro Adventure demos the Lives (Hearts) will not display on either Mac desktop build or iPhoneX mobile build - regardless of resolution etc. They appear just fine when playing/testing in Unity3d itself though.

    What I am asking for:
    Someone with a Mac (or iPhoneX I suppose) other than Reuno, to create a clean/vanilla project using the Corgi Engine, do a build, and let me know if you see the Hearts (Lives) display properly in the build with the Retro Adventure demo. I have been testing on a 2013 MBP and a 2015 5k iMac. If testing on a Mac I would also be interested to know what resolution you are using.

    I have held off posting about this as I wanted to do a test on a totally wiped clean Mac and install of Mojave because I wanted to be sure that the issue wasn't caused by either Unity3d or dirty/old data for CE or anything else. I did test with a manual uninstall of Unity3d and deletion of all files pertaining to CE but the result was the same - hence the need for a test with a totally clean test environment.

    So, I have a wiped drive, brand new OS, and Unity3d is the only software installed, followed by installation of CE. Yet this issue persists. For what it's worth I have tested on multiple Macs with the same result.

    If anyone would be kind enough to do a test and let me know the result it would be greatly appreciated.
     
    reuno likes this.
  38. lsflet

    lsflet

    Joined:
    Aug 15, 2014
    Posts:
    6
    Hello, I just bought Corgi Engine and I am trying to import my character with spine animation.
    I added a box collider and use Agent to add script a character needed.
    When the character walk outside a platform, it fall and touch the lower level bound, but it have a bouncing when the character touch the lower bound, how can I solve it?
    And flip when change direction seems not work on spine animation object, do I need to override the current flip method or the engine should be able to handle it?
    Thx a lot.
     
  39. Pacaworks

    Pacaworks

    Joined:
    Jan 28, 2016
    Posts:
    12
    @lsflet

    About Level Bounds, If you want the level bounds to behave differently, take a look to your "Character Level Bounds" Abilty or simply just add to your character the "Character Level Bounds" Ability if not added. This ability allows you to customize what the player will do when colliding with a limit.

    About Spine2D, first of all I would recommend you to place it as a child of your Player/Character Object. About its facing direction, take a look to your "Character" Abilty where you'll find "Initial Facing Direction", "Direction On Spawn" and "Flip Model On Direction Change". You can tweak all the previous parameters to fit your game. Also notice that if you have set up the Spine2D model as a child, you should link it to the "Character Model" property on your "Character" Ability.

    More Documentation:
    All the documentation you need about Level Bounds (Level Manager): https://corgi-engine-docs.moremountains.com/managers.html
    All the documentation you need about Animations & Spine2D integration: https://corgi-engine-docs.moremountains.com/animations.html

    Hope it helps!
     
    Last edited: Jan 24, 2019
    reuno likes this.
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @lsflet > @AesopWorks pretty much said it all :) The "bounce" you mention in relation to level bounds might be the Death Force, it's something you can set on your Character's Health component. And you'll need to nest your model/animator for a spine flip to work. Check out the links mentioned in the post above.
     
  41. Pacaworks

    Pacaworks

    Joined:
    Jan 28, 2016
    Posts:
    12
    Hey there!

    Does the "DamageOnTouch.cs" work with Particle System colliders? If not, any idea on how should I approach this? Tried to use the "OnParticleCollision()" method without success.


    Thanks! :)
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @AesopWorks > I guess technically it could, but that seems like a bad idea performance-wise. Usually you'll want your particles to be the visible part but actually have a regular (invisible) collider do the actual damage.
     
    Pacaworks likes this.
  43. Pacaworks

    Pacaworks

    Joined:
    Jan 28, 2016
    Posts:
    12
    Yey that usually works! (the invisible collider technique), but in my case I should have to animate the collider to fit the particle visual fx. Any recommendation is welcome ^^ but let me link a gif so you can watch my case:

    ezgif.com-optimize.gif

    @reuno as you said previously, in most of the cases I use the other technique!
     
    reuno likes this.
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @AesopWorks > I'd use a circle collider for that. I don't think you could easily add a script to particles, that's not native in Unity. What you could do is create a new class that hooks on OnParticleCollision, but that seems really overkill for something that simple (and again, not the best idea performance wise).
     
    Pacaworks likes this.
  45. lsflet

    lsflet

    Joined:
    Aug 15, 2014
    Posts:
    6
    @AesopWorks @reuno Thanks for help! I nested the object to Character Model parameter and set the Death Force in Health script to zero then both problem solved well.
     
    Pacaworks and reuno like this.
  46. gamekitteh

    gamekitteh

    Joined:
    Aug 24, 2018
    Posts:
    3
    I'm having a problem in that my character always spawns twice and then you attack and it hits yourself. I can't find out how to not have this happen. Like I'll put in a prefab character and assign it in the level manager, but pressing play makes it duplicate in the game and hierarchy. Both of them are controlled at once.
     
  47. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @gamekitteh > Please use the support email for questions like these, and please provide some details. Does the problem happen with any of the demo levels, no changes made? I guess not. If not, what have you changed? What version of the engine are you running, what version of Unity, how can I reproduce the problem, etc?
     
  48. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    Two quick questions:

    1
    Is there a way to make the speed of a bullet relative to the player speed?
    If I fire the bullet from a moving character (retrocopter) the bullet should go faster in the flying direction than fired stationary.

    2
    Is there a way to change direction for a playable character by pressing a button?
    ..I am using the retrocopter to fly in all directions, but I only want to shoot in one direction, only when a button is pressed, the copter should turn and shoot in the other direction.

    Thanks!
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,950
    @captnhanky > 1. You can extend the projectile class for that. It gets set an Owner by the ProjectileWeapon, and from the Owner you can get the Controller, and from there the speed, and thus modify your projectile's speed accordingly.
    2. Create a new ability to do that, that would act more or less as the Handle Weapon one, but wouldn't do the flip part, and optionally would parent weapons differently.
     
  50. RadTT

    RadTT

    Joined:
    Nov 9, 2016
    Posts:
    7
    Hi! Love the engine. Got a quick question about recommended best practices and roadmap with the AI brain.

    1. Due to Decisions being components, and the fact that the same decision might be added as a separate component multiple times, the more complex the brain gets, the harder it seems it's going to be to keep all the decisions straight. For example, you might have a brain state that uses AI Decision Time In State 2-4 seconds, and another state that uses 5-10 seconds, etc, and each of these Decisions are separate components when the min and max times need to be different. Do you have any suggestion on how to keep this organized in the inspector for complex AI brains?

    2. Are any significant improvements on the roadmap for the AI brain? I'm considering writing my own (or editing yours to better suit my needs) but was wondering if there are some changes coming soon that I should just hold out for. Some ideas would be...

    - add more possible conditions for transitions (instead of just true/false)
    - have scriptable objects for decisions and/or states
    - (or easiest) add field to give each decision a Label which would then be shown in the "Transition" data above or below "Decision" (so the Decision file might be AIDecisionTimeInState and below that is a new row Label: "Time In State 2-4 seconds" or whatever the user wants to call it to differentiate it in the component list.