Search Unity

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

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v6.6 : ability split, recoil, hitscan...]

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

  1. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    ok, will do then! i am not 100% sure if it works mostly because my character has no real weapon (it's invisible) and the shooting is done through a character animation, but will try!
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @drHogan > If that helps you can disable the sprite renderer on any of the demo weapons, and you'll get an invisible weapon :) Let's start like that and hopefully I'll be able to solve your issue quickly!
     
  3. drHogan

    drHogan

    Joined:
    Sep 26, 2012
    Posts:
    187
    Will do, thanks and see you tomorrow!
     
  4. Cunny-Lang

    Cunny-Lang

    Joined:
    Jul 30, 2019
    Posts:
    15
    Btw I have the same problem and I was asked here before)
    I'm using RetroCorgi animator as a reference but still have problems with pre-jump (when character crouch for a moment to charge push) and landing, exactly what drHogan asks. I tried different transition settings, different transitions as such, but it never lands correctly
    And when I'm just running left and right character can "fall" for a moment, I mean at the edges or angles of terrain he falls and plays falling animation like for 0.2sec. I have semi-smooth terrain, like ~~ hills or something) And characters can't walk on it properly
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @Cunny-Lang > Regarding landing, likewise, I'd recommend looking at the NewCorgi3D demo character, it's got a landing animation. I don't believe you should copy its animator, or any demo animator, each character in each game is unique and ideally requires its own custom animator, if you want to get good and pleasing results, but you can probably take inspiration from it.
    Your other issues (pre jump and that edges thing) seem completely unrelated :
    - pre jump would require extending the jump ability to add a delay before the actual jump. I encourage you to use the support form to request it if you'd prefer I add it.
    - the second one I'm not sure I understand. The engine comes with stick to slopes features, you might want to look at the examples to see how it's done in various contexts. If the issue persists, don't hesitate to use the support form and provide repro steps for it.
     
  6. Cunny-Lang

    Cunny-Lang

    Joined:
    Jul 30, 2019
    Posts:
    15
    Yeah, second issue was solved by different slope settings in Corgi Char component, thank you)
     
    reuno likes this.
  7. andrin_man

    andrin_man

    Joined:
    Mar 9, 2014
    Posts:
    23
    How does the CinemachineCameraController get a reference to the player? There is no way to set it in the inspector as it is set to read only and I can not track it down in the code. I have set up the cameras but when I play the scene the camera does not find the player.
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @andrin_man > As explained in the documentation (or the class itself), that's done via its SetTarget method, which gets called on certain events (in your case, that'd be a SetTargetCharacter CameraEvent).
     
  9. andrin_man

    andrin_man

    Joined:
    Mar 9, 2014
    Posts:
    23
    @reuno. Yes I have found the line of code in the LevelManager script that calls the MMCarmeraEvent to SetCtargetCharacter but that line fo code does not seem to execute. If found that if I put a debug.log in prior to MMGameEvent.Trigger("Load") it will write to the console but if I place it immediately after that line and before the MMCameraEvent.Trigger section it does not. Is there something I am missing here? If I set up debug.logs in the CInemachineCameraController where these event are handled it does not appear to be hearing them.
     
  10. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @andrin_man > I don't know, it seems to work with a fresh install of the engine on my side, and it's never been reported before, so maybe you've changed something, but I can't really guess what without more details. If the issue persists, please send me repro steps via the support form, I'll be happy to have a look.
     
  11. andrin_man

    andrin_man

    Joined:
    Mar 9, 2014
    Posts:
    23
    @reuno > As a test I commented out the MMGameEvent.Trigger("Load"); line of code in the LevelManager and it all works as expected. I suspect this will lead to unwanted downstream consequences but it worked for now.
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @andrin_man > That's probably not a good idea down the line, indeed. As I said, if you could just send me more info about what you may have changed, I could tell you more about your issue.
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @andrin_man > Please provide the info requested right next to the form, and your email, I can't reply to you if you write that in the email field :
    upload_2020-6-4_14-4-50.png
    :)
     
  14. andrin_man

    andrin_man

    Joined:
    Mar 9, 2014
    Posts:
    23
    Just caught that. Sent you another message through support with my email. Doh!
     
    reuno likes this.
  15. Cunny-Lang

    Cunny-Lang

    Joined:
    Jul 30, 2019
    Posts:
    15
    Can I make rotation of the sprite by ground angle with tradition / default method, not Spine (Q1)? And if it yes, can I set the limit of rotation (Q2)?
     

    Attached Files:

  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @Cunny-Lang > Yes, you absolutely can, slope orientation is completely unrelated to Spine, it impacts the model, however it's made. And the ability also lets you control min and max rotation angle (as well as rotation speed, weapon rotation, behaviour in the air, and more).
     
    Cunny-Lang likes this.
  17. Cunny-Lang

    Cunny-Lang

    Joined:
    Jul 30, 2019
    Posts:
    15
    @reuno it means that I need to separate model from main game obj? Now sprite renderer and animator components placed at main game obj.
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @Cunny-Lang > Yes, you need to separate them, it's a good practice in general, and especially for this ability to work.
     
    Cunny-Lang likes this.
  19. Serotonina

    Serotonina

    Joined:
    Oct 5, 2019
    Posts:
    1
    Hi @reuno! First of all, thank you for all the love and work you put on the Corgi Engine: it's an amazing engine to learn and build from.

    I'm here to ask you something regarding weapons, particularly about projectile weapons. I'm trying to make a semi-auto weapon with a burst: every time the player shoot, N projectiles will come out one after the other in rapid succession (much like here: youtube.com/watch?v=UiiXufcppWA). I've tried tweaking the option in the Projectile Setting script, but I can't seem to find a way to do it without working on your code: am I missing something?

    Thanks in advance!
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @Serotonina > There's no such feature at the moment, but feel free to use the support form to request it.
     
  21. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    Good news everyone, I've just pushed v6.5 of the Corgi Engine to the Asset Store. As usual, it fixes all known bugs to date, brings new features, and improves things across the board.

    Here are the full release notes :

    - Adds the MovingPlatformFree component, that lets you turn any object into a (potential) moving platform. You can then drive that object's movement however you like (via a script, physics, or even by dragging it around in the scene view) and any Character that steps on it will follow and behave like it would on any "normal" moving platform
    - Adds the MinimalMovingPlatforms demo scene to showcase some of the most "extreme" moving platforms the engine can handle
    - Adds the CharacterFallDamage ability, which lets your characters take damage when falling from a certain height.
    - Adds the MinimalFallDamage demo scene to showcase that.
    - Adds the AIActionDash, and a new type of enemy that uses it, the RetroBlobDash in the RetroAI demo scene
    - Adds CharacterCrushDetection, a new ability that lets you detect when your character gets crushed, and lets you act on it, causing damage or death
    - Adds the RetroCrusher prefab to demonstrate that new Crush Detection ability, and an example of it in use in RetroVania (first room to the right when entering the level)
    - Adds the ProximityManager class, a system you can use to dynamically enable/disable ProximityManaged objects in your scene based on their distance to the player, disabling objects that are far from the camera/action to save on performance. Also adds the MinimalPerf demo scene, showcasing the difference between a scene with and without that setup.
    - Adds AIActionMoveAwayFromTarget, a new action that will make a character move in the opposite direction of its current target
    - Adds support for gravity and moving platforms combinations
    - Adds a delay option to the FinishLevel class to enable longer end level animations without any external manipulation
    - Adds an option to CharacterHandleWeapon to allow shooting from ladders natively (false by default). The RetroCorgi demo character can now shoot from ladders.
    - Adds force application modes (set or add, instead of the default add up until now) to SurfaceModifiers
    - Adds an option to reset forces on exit to SurfaceModifiers
    - Adds a normalized method to MMProgressBar.
    - Adds force modes to CharacterWallJump
    - Stompable can now be combined with gravity zones and points
    - Adds an option to Stompable objects to define whether or not they can be stomped by dead characters. Yes it's quite specific.
    - Minimum push speed on the PushCorgiController ability will now be compared with greater or equal (instead of greater before). This makes pull without pushing more obvious to setup, and it's now the default behaviour for this ability
    - Adds an option to CharacterJump to opt out of being able to jump down from one way platforms
    - Adds an option on Health components to turn gravity off on death
    - Adds an option to force a character to stop running/walking when colliding with a wall, regardless of input
    - ButtonActivated zones now enforce CanOnlyActivateIfGrounded even in auto mode
    - Greatly improves the slope orientation precision, now handling more complex edge cases
    - Adds an extra check to InventorySelectionMarker
    - Adds extra checks to bind weapon and character animators
    - Adds missing RequireComponent attribute to HealthAutoRefill
    - Adds tooltips to all fields of all classes in the engine
    - Removes multiple (harmless) missing references throughout the engine
    - Tweaks the Rectangle demo character's raycast settings to have it appear more aligned with obstacles when colliding with them
    - Fixes a bug that could cause an error when using the CharacterPushCorgiController ability on an AI swappable character
    - Fixes a bug in the SoundManager that could cause background music to not play again after a certain sequence of enable/exit/disable
    - Fixes an incorrect application of the vertical raycast offset of CharacterWallClinging
    - Fixes a bug that could cause unwanted flips while using a combo weapon in the air while getting damaged.
    - Fixes a bug that could cause wrong freeze frame durations with DamageOnTouch's FreezeFrameOnHitDuration
    - Fixes a bug that could cause lateral jumps into one way slopes to result in improper x position offsets
    - Fixes a bug that would cause a character to not reset properly after dying from being out of bounds while wallclinging.
    - Fixes a bug that would cause SurfaceModifiers to not apply forces correctly when colliding with multiple controllers
    - Fixes a bug that would cause pushable blocks to not fall correctly when not in button based push mode
    - Fixes a bug that would cause KillPlayerOnTouch objects to kill a player more than once (which is harmless but not ideal) if collisions were set to not disable after death on the Player side
    - Fixes a bug that could cause a flying character to not escape gravity correctly after exiting a dialogue zone
    - Removes an extra and useless box collider on a few scenes' level start object
    - Solves an issue with SlopeOrientation and how it forces additional angles on weapon aim
    - Fixes a bug that could prevent weapons from auto equipping

    As usual, expect a few days of delay while the store team validates the update.
    I hope you'll like this new version!
     
  22. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    26
    Thanks @reuno.

    Always so productive.
     
    luigi7 likes this.
  23. oriolmanya

    oriolmanya

    Joined:
    Jul 4, 2012
    Posts:
    50
    Hi @reuno, a really nice asset, it helped me a lot to have a kickstart :)
    I'm having an issue with platforms with EdgeCollider2D, both with edge-radius > 0 or = 0.
    When my player hit a platform sideways (So, like stabbing the "belly" on the platform) it produces 3 types of unpredictable and undesired effects:
    1. Sometimes it makes the player jump with a too much velocity (I half-prevent that by restricting the Y-velocity of the character, but it jumps anyway)
    2. Sometimes it pushes the player down, with a lot of force too.
    3. If I enable CorgiController > PerformSafetyBox, still it happens 1 and 2 (maybe happens less), but sometimes even it gets stuck on the platform
    By now I changed the EdgeCollider2D for a thin BoxCollider2D, and the problem is solved, but I would prefer to use the EdgeCollider2D instead.

    Maybe the edge platform is only designed to work as a one-way platform? I mean to stand up with the feet but you can traverse it from below? I guess the Platform Effector 2D is designed to solve this issue, but I've never used it.

    If it cannot be solved, could you give me more information or an example on how I should deal with that?

    Thanks in advance
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @javi_unity402 > I hope you'll like this new version!
    @oriolmanya > As explained in the doc, edge colliders are meant for 1 way platforms. For platforms, use box colliders. Using a 1 way platform + edge collider will solve your 3 issues.
     
    oriolmanya likes this.
  25. Stab

    Stab

    Joined:
    Jan 26, 2013
    Posts:
    7
    Hi Corgi! ^_^

    Do I understand correctly that KNOCKBACK does not work with flying opponents? Because the CharacterFly ability constantly updates the forces applied to the controller. What workaround do you recommend? I want the ghosts to knockback on impact.
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @Stab > That's a good question :)
    You're right that CharacterFly holds a tight grip on the forces applied.
    One way to do what you're after would be to extend CharacterFly to implement that behaviour, basically not setting the (usually) movement horizontal force while your taking damage window is open, but instead adding one for example, and then resuming control afterwards.
     
  27. hippobob

    hippobob

    Joined:
    Feb 26, 2017
    Posts:
    28
    How do I animate a diagonal attack?
    Such as diagonally above or diagonally below the attack animation. I'm not going to use an external gun to show it. Just like Contra.
    It is even similar to using a melee weapon to attack downward after jumping.
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @hippobob > You can use the WeaponAngleAnimationParameter (defined per weapon) to do so. And then using a blend tree is probably the easiest way to set it up in your animator, but that's entirely up to you.
     
    hippobob likes this.
  29. Bonfi_96

    Bonfi_96

    Joined:
    Oct 2, 2013
    Posts:
    34
    Hey! I'm on 6.4 and there seems to be an issue with the interaction of gravity zones and the auto movement.
    The player corectly flips upside down but it keeps walking in the other direction.
    I've tested it using the 3d scene, played around with all available options but I was not able to solve it
     
  30. oriolmanya

    oriolmanya

    Joined:
    Jul 4, 2012
    Posts:
    50
    I'm checking the documentation and I only find it for Moving Platforms, but I assume that when you say "Using a 1 way platform" is setting the Layer to "OneWayPlatforms" or "MovingOneWayPlatforms". I'll give it a try and I'll let you know. Thanks!
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
  32. Bonfi_96

    Bonfi_96

    Joined:
    Oct 2, 2013
    Posts:
    34
    It would be great for consistency! I think I solved it by editing CharacterAutoMovement
    Code (CSharp):
    1.         protected override void HandleInput()
    2.         {
    3.             bool shouldReverse = _characterGravity.ShouldReverseInput();
    4.             if (_horizontalInput != 0f)
    5.             {
    6.                 if (shouldReverse)
    7.                     _horizontalInput = -_horizontalInput;
    8.                 _currentDirection = (_horizontalInput < 0f) ? -1f : 1f;
    9.             }
    10.  
    11.             _characterHorizontalMovement.SetHorizontalMove(shouldReverse ? -_currentDirection : _currentDirection);
    12.         }
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @Bonfi_96 > That looks like the right fix :)
    I'll definitely add that to the next release's todo list, I can see how it can be expected and confusing if it doesn't work. Thanks a lot for mentioning this!
     
  34. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    66
    Hello, I am thinking about a mana bar: what would be a clean way to set it with corgi?
    Mana would be working mostly like health being visible in the hud, just added or substracted via code called by something acting like a weapon ability.
    I'd prefer to stay inside corgi, but healthbar is bounded with player id and it seems I can't have two different healthbars for one player, and jetpack it's too much for what i look for.
    More generally, I'd have generic object around the screen with their healthbar in the HUD in a fixed position, is that possible in corgi?
     
    Last edited: Jun 11, 2020
  35. masak

    masak

    Joined:
    Aug 14, 2011
    Posts:
    15
    Hello, Does TerrainCollider work? I checked NewCorgi3D demo. There is a terrain disabled in the scene. I set active the terrain and disable ground box collider2d. And start playing, a character starts to fall.
     
  36. Jellybean82

    Jellybean82

    Joined:
    May 23, 2020
    Posts:
    2
    Hi All,
    Can anyone point me in the right direction for solving an animation problem?
    When I set up a character and use it as player then all animations work as expected and the state of the Character transitions correctly from 'Idle' to 'Walking' .
    When I set up a same character as AI, then the Movement State never changes out of 'Idle' while it is actually moving around and following the player.
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @luigi7 > The engine itself doesn't do any UI, Unity does. So there's no limit to what you can have (including healthbars in the HUD if you'd like). There's a progress bar helper in the asset that you can use if you want to build progress bars (it's called MMProgressBar), but for a new and separate feature like the one you describe, you can build it completely from scratch if you'd like.
    @masak > No, the engine works with 2D colliders, TerrainColliders are 3D colliders.
    @Jellybean82 > That's very weird, I'd recommend looking at any of the demo AI characters (RetroAI is full of them) to look at examples of AIs that idle/walk correctly. If the issue persists, don't hesitate to send more info via the support form.
     
    masak likes this.
  38. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    28
    I have a death animation set up for the character to fall down to the floor, can I stop the default fall off the screen on death sequence?
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @SupremeSmash > Sure, there are a number of settings you can set on the Health component to determine what you want to happen on death.
     
    Cunny-Lang and SupremeSmash like this.
  40. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    28
    Nice one, and thanks for the quick response
     
    reuno likes this.
  41. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    28
    The Masks section of the Rooms System documentation refers to the RetroVania demo scene but it's not in the package
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @SupremeSmash > My guess would be that you're using an old version of the engine. I'd suggest reading the first item of the FAQ. Don't hesitate to use the support form and provide more info if that doesn't solve your issue though.
     
    SupremeSmash likes this.
  43. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    28
    Yeah, I was using an older version of Unity, learned something new :)
     
    reuno likes this.
  44. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    28
    Unity version: 2019.2.17f1
    Corgie Engine version: v6.5

    Hi, I installed the Unity version you used in the rooms tutorial, I created a new project, imported Corgi engine and got the following errors

    Library\PackageCache\com.unity.2d.pixel-perfect@2.0.4\Runtime\PixelPerfectCamera.cs(218,13): error CS0103: The name 'PixelPerfectRendering' does not exist in the current context

    Library\PackageCache\com.unity.2d.pixel-perfect@2.0.4\Runtime\PixelPerfectCamera.cs(223,13): error CS0103: The name 'PixelPerfectRendering' does not exist in the current context

    Followed the install process and checked the package manager and 2D Pixel Perfect is up to date.

    Have I missed something?
     
  45. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @SupremeSmash > I suppose you have :)
    For a start, as explained in the first item of the FAQ I pointed you at earlier, each version of the engine has a minimum Unity version requirement. In the case of v6.5, that's 2019.3.3 or higher, as mentioned in the release notes.
    So if you're on 2019.2.x, you're probably not running 6.5.
    Again, I'd suggest updating to a more recent version of Unity. If that's not possible, and if the issue persists, once more, please use the support form and I'll be happy to help you (link is the same as the FAQ I previously mentioned).
     
    SupremeSmash likes this.
  46. SupremeSmash

    SupremeSmash

    Joined:
    Nov 30, 2018
    Posts:
    28
    Updated to 2019.3.3 and all is good
     
    reuno likes this.
  47. Wolfie2000

    Wolfie2000

    Joined:
    Mar 21, 2020
    Posts:
    1
    Hello everyone,
    I have 2 questions and hope the forum can answer them

    1) I have problems with jerky gameplay because of CPU (Profiler) on android. Every 7 to 20 Seconds there are little jerks. Profiler identifies Script and Renderer as most intensive. Are there Tips for clicks in Unity and the corgi Engine settings to get best Performance on android? My Quality Setings are at the fastest Value.
    Maybe you reuno can post the settings you have changed in Unity and corgi Engine for the available Tech demo in Google Play Store to Work on android devices?

    2) I installed the newest Corgi Engine and Unity Version 2019.3.3 . I switched to Android build and use Ui camera with intern Touch controls. In the demos and in new scenes it is Not possible to jump more than one time in the Air by pressing the jump Button. If i force desktop Mode I can jump Up to 3 Times with space. As set in Player settings. Is anyone else facing same Problem?

    Thanks for your Help!
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @Wolfie2000 > 1. The settings I've used to publish the tech demo are the ones that ship with the asset. The engine itself is very low footprint, and from there it's mostly standard Unity mobile optimization that applies. That part is quite game specific, and the strategies you can apply vary greatly based on your game's challenges.
    2. Just tested on device, iOS and Android, can jump 3 times in both, so I'd need more info and context to be able to help. In general, if you think you've found a bug, please use the support form and provide context and details on how to reproduce your issue, I'll be happy to have a look.
     
  49. mmyh147

    mmyh147

    Joined:
    Nov 19, 2013
    Posts:
    2
    I need an example to use MMTouchDynamicJoystick.
    I read the documentation but I don't understand how it's work.
     
    reuno likes this.
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,838
    @mmyh147 > I've planned to add an example of that to a future release, there are no examples of it at the moment indeed. It'd also could use a bit of polish to make it easier and more efficient. I'll push its priority a bit :)
     
    Boom_Shaka and mmyh147 like this.
unityunity