Search Unity

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v6.1 : auto scrolling levels, and more]

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

  1. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    Hello
    i'd like to know if the loading scene currently help to load the next scene or it's just a visual effect ?
    Sometimes when i directly load a scene i have a little lag before the player can move
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @krisss666 > The loading scene loads the next scene and displays progress.
    As mentioned before you can either replace calls to it with regular SceneManager calls, or use the "light" class I posted in the post before yours.
     
  3. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    44
    How could we get more precise collisions with a 3d model than the box collider can provide?
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @HeathC > That depends what for, without context it's a bit too vague :)
    Usually for platformers a box is enough, and the controller will only accomodate for that.
    If it's for hits, you could create more advanced hitboxes I suppose.
     
    HeathC likes this.
  5. phateRM

    phateRM

    Joined:
    May 1, 2018
    Posts:
    5
    Hi,
    I have been searching through the documentation but I was not able to find an answer. When jumping, correct me if I am wrong, it is possible to set the property JumpTimeWindow to implement a late jumping mechanics by setting the value to something bigger than zero. Is there a way to achieve a similar result when landing so that the player is forgiven for slightly short jumps, i.e. an "early landing" mechanics?

    Thanks!
     
  6. HeathC

    HeathC

    Joined:
    Oct 17, 2016
    Posts:
    44
    Basically I'm looking for a way to have more realistic collision with ledges, walls, etc. Right now if I run and hold running into a wall, parts of my character are in the wall, or, if I stand on a ledge, I can walk quite a ways off the ledge before falling. If I make the box collider bigger, I can get hit with damage/enemies before it looks like they are actually touching the model... Is there a way to make compound colliders or something that would allow to fix these? A standing character takes up less space visually than a running character... but the box is the same regardless...
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @HeathC > As I said, the controller will only work with boxes.
    Usually what you're after is handled outside of the controller, as it's just visuals.
    Depending on your tech stack the solutions for that vary a lot, but it usually implies IK and similar solutions.
     
  8. NicoloTrapasso

    NicoloTrapasso

    Joined:
    Sep 23, 2016
    Posts:
    13
    Thank you so much!!
     
    reuno likes this.
  9. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    103
    Maybe you can resize it at runtime based on the character's current state? Just a thought.

    https://forum.unity.com/threads/changing-the-size-of-a-box-collider-at-runtime.200043/
     
  10. ckgames-admin

    ckgames-admin

    Joined:
    Feb 20, 2019
    Posts:
    5
    I've found PointsWhenDestroyed on Health script. Thanks!
     
    reuno likes this.
  11. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    Maybe make the collider of the wall bigger so the player's collider hit the wall's collider before the player's sprite enter the wall's ?!
     
    Boom_Shaka likes this.
  12. Svonsil

    Svonsil

    Joined:
    Jun 24, 2018
    Posts:
    13
    Hello! I want to make object to fly away when colliding with other game object. How can I do it?
     
  13. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    28
    If it's rigidbody2D - https://docs.unity3d.com/ScriptReference/Rigidbody2D.AddForce.html
    But it depends what do you want to achieve. If you want an explosion effect use Point Effector:

    If you want to move corgi controller use damage on touch script and add Knockback Force.
     
    reuno and Boom_Shaka like this.
  14. Mindjar

    Mindjar

    Joined:
    Aug 13, 2013
    Posts:
    28
    Here's a simple script I'm using in my game. I've added it to bullets.
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class AddForceOnCollision : MonoBehaviour
    6. {
    7.     public float magnitude = 100f;
    8.  
    9.     void OnCollisionEnter2D(Collision2D collision)
    10.     {
    11.      
    12.         if (collision.gameObject.tag == "movable")
    13.         {
    14.             Rigidbody2D rb = collision.collider.attachedRigidbody;
    15.             Vector3 force = transform.position - collision.transform.position;
    16.             force.Normalize();
    17.             rb.AddForce((-force + transform.up) * magnitude);
    18.         }
    19.     }
    20. }
    Just tag the object you want to move with "movable" tag.
     
    spaceJASE, Betzalel, mmn_tlh and 2 others like this.
  15. mmn_tlh

    mmn_tlh

    Joined:
    Jun 30, 2018
    Posts:
    1
    So I am having problem with the player character that its sprite don't flip when changing the direction, and I have already checked the flip-model on direction change this is probably because of using two sprites and having an empty gameobject as their parent, how can i flip them.

    upload_2019-5-18_22-10-37.png
     
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @mmn_tlh > You can have as many sprites as you want in your character (the Spine examples have something like 12, for example), as long as you nest them properly and bind your model to your Character as recommended in the documentation. Hard to tell what's wrong here without any info though. I'd recommend checking either the documentation or the many examples provided in the asset for reference.
    If the problem persists please use the support form, thanks.
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    Good news everyone, I've just submitted v5.5 of the Corgi Engine to the Asset Store. As usual, it fixes all bugs reported to date, adds a bunch of new features, including the extremely frequently requested directional dash. You can also now create hittable switches (or bind any action to an object getting hit, really), have pickable items that enable abilities, and much more. Note that this update requires Unity 2019.1 or more.

    Here are the complete release notes :

    - Adds the PickableJetpack class, an example of how you can create pickable objects that enable abilities when picked.
    - Adds the Hittable class, a class you can put on any Health based object, that will allow you to trigger any sort of action when hit (and adds an example of such an object, used as a hittable switch in the FeaturesWeapons demo scene).
    - Adds a completely reworked dash, more robust, directional (free, 4 or 8 directions), with auto trajectory correction, optional forces reset on exit, and optional auto character flip.
    - Adds a new decision, AIDecisionTargetIsNull, that returns true if the current target is null, false otherwise
    - Adds an option to the CharacterInventory ability to automatically equip the current weapon when switching characters via the CharacterSwitchManager
    - Adds an option to the WallClinginging ability to have it trigger independently from input, letting the character cling as long as it faces the wall (making wall jumps much easier if you prefer it that way)
    - Adds an option to the CharacterSwitchManager to share a common health through all switch characters
    - Adds more options to handle mobile button delay order
    - Adds an additional cycle option mode for moving platforms : Stop at Bounds. In that mode, moving platforms will move until they reach the end/start of the path, then wait there until you call their ResetEndReached method.
    - Adds frequency options to AIBrains to define separate frequencies to evaluate decisions and perform actions for finer performance control
    - Adds an Alive boolean animation parameter to Weapons to trigger specific animations when the character is alive or dead
    - Adds an option to define a spawn transform in addition to the pre-existing spawn offset for projectile weapons.
    - Makes sure projectiles clear their ignore list properly
    - Adds an option to create invulnerable Health based objects, that you can hit forever
    - Adds OnHitZero, a new delegate to the Health component triggered when getting damage while invulnerable
    - Adds support for treadmills when working with InstantAcceleration
    - Fixes a bug that would prevent the proper initialization of a Weapon's character animator under certain conditions
    - Fixes a bug that would prevent dash from working properly when instant acceleration was checked on the movement ability
    - Fixes erroneous projectile spawn position on non flippable weapons
    - Prevents (harmless) jetpack related errors on automatic character creation
    - Fixes the lack of a Swim ability on the RetroAdventureCorgi prefab
    - Fixes a bug that would prevent from being able to grip multiple Grip objects while in the air
    - Fixes a bug that could cause a wrong crouch exit when pushing objects
    - Fixes a bug that could cause dialogue zones to not reset prompt settings properly
    - Fixes a bug that would cause a spawn at a point of entry to always face right instead of the point's chosen facing direction
    - Fixes a bug that would cause inventory slots to not refresh properly when moving to the same slot
    - Fixes a bug in MMTriggerAndCollision's custom inspector that could result in changed values on play
    - Fixes UnPause events that wouldn't get triggered correctly
    - Fixes a bug that would cause the wallclinging sound to persist even after touching the ground
    - Auto generated character's rbs will now be set to never sleep by default
    - Improves stability for the CharacterHandleWeapon class
    - Renames the ability's Reset method to ResetAbility
    - Adds inspector test buttons for MovingPlatform's main methods
    - Improves performance and behaviour of the object pools

    The next version will probably be a new major one. Following the release of TopDown Engine v1.3, in which I wanted to test a new way of dealing with packages and feedbacks, and its reception so far, I plan on doing the same for the Corgi Engine. That means native support for post processing, cinemachine, and feedbacks everywhere (feedbacks are the best). So that's probably gonna be the main change in the next version. That means a lot of work on my side to translate everything to the new system in all demos (and make everything better). For users that shouldn't break much, but enable so much fun :)

    In the meantime I hope you'll like this new version! And if you run into any weird stuff, please let me know via the support form.
     
    NathanG, Meowx, CHEMAX3X and 13 others like this.
  18. Richer-Jen

    Richer-Jen

    Joined:
    Jul 30, 2017
    Posts:
    2
    Hello
    I want to achieve the below effect:
    The character jumps on a tree branch, and the branch will sway because of the force. As the character walks on the branches, the branches will also have different shakes. Refer to the effect of the character inside <<Feist>> jumping on the branch.
    could this engine achieve this effect?
     
    Mindjar likes this.
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @Richer-Jen > That can be easily done either with physics, or an animation (most likely the second one). Both are native to Unity. If that's all you're after, you don't need the engine :)
     
  20. HCrowley

    HCrowley

    Joined:
    Oct 16, 2013
    Posts:
    18
    @reuno great update! hittable switches, and items that enable abilities, both sound like they'll be extremely useful features
     
    reuno likes this.
  21. phateRM

    phateRM

    Joined:
    May 1, 2018
    Posts:
    5
    @reuno Hi, I have just started playing with the .5 update. I have a question about the new wall clinging Input Independent behaviour: I'd like to use the ability to jump from one wall to the opposite direction, i.e. similar to how it is done in Ori and the Blind Forest (
    ). However, I cannot find a proper combination of settings in the wall jump and wall clinging abilities to achieve a similar result. Do you have any advice on that?

    In addition, is it possible to flip the character once it jumps off a wall if pressing in the opposite direction from the wall?

    Thank you very much
     
  22. unity_Ylbfa9DZXWF-mg

    unity_Ylbfa9DZXWF-mg

    Joined:
    Apr 30, 2019
    Posts:
    1
    i downloaded the new version but when i select to import it will import the version 5.3 instead of the 5.5, i am using unity 2018.4.0f1

    Edit: I tried to delete the package and re-download, but is still importing version 5.3
     
    Last edited: May 20, 2019
  23. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @unity_Ylbfa9DZXWF-mg > Please read the first, highlighted item of the FAQ. v5.5 requires Unity 2019.1 or more.
    @phateRM > I can't guess what settings would work for that without context. That's dependent on too many factors in your game. You can flip the character by calling its flip method. If the default settings for walljump aren't what you're after, feel free to extend the wall jump class to apply whatever force you prefer.
     
  24. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    222
    @reuno those hittable switches are like that one on the Top Down Engine wich activate a ninja spawning portal, right?
    This update is making me consider update the project again, even if I already have all I need :D
     
    Mindjar likes this.
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @Muppo > No, the one in the TopDown Engine that activate the ninja spawn portal is just a ButtonActivatedZone, this has been in Corgi Engine for a long time. Hittable switches are a different thing. You hit them, with a weapon, and they do stuff. It's basically a zero-code-required way to plug actions into damage (which was of course possible before but required a bit of manual coding).
     
    Boom_Shaka and Muppo like this.
  26. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    222
    Sounds really interesting. Thanks!
     
    reuno likes this.
  27. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    12
    Hi @reuno,

    Thanks for last update.

    I have improved RegularSpawnSingleCharacter function to work in levels with more than one point of entry. It uses Point Of Entry index to get component Check Point facing direction.

    Old:
    Code (CSharp):
    1. Players[0].RespawnAt(PointsOfEntry[point.PointOfEntryIndex], point.FacingDirection);
    New
    Code (CSharp):
    1. Players[0].RespawnAt(PointsOfEntry[point.PointOfEntryIndex], PointsOfEntry[point.PointOfEntryIndex].GetComponent<CheckPoint>().FacingDirection);
    Best,
     
    Boom_Shaka and reuno like this.
  28. mooumari

    mooumari

    Joined:
    May 9, 2018
    Posts:
    10
    hello there,
    could you please tell me how can I make the Moving platforms push the characters?
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @mooumari > That is not something that is supported right now. It's on the todo list though.
    In the meantime, you'd have to implement a dedicated ability that replicates a platform's force on the controller when colliding with one.
     
  30. mooumari

    mooumari

    Joined:
    May 9, 2018
    Posts:
    10
    ok, thanks
    hope it will be in the next update
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @mooumari > If it gets more votes it will, but for now it's pretty low on the todo list (I've added yours of course).
    I guess people usually go for physics for that kind of interactions, rather than a tight raycast based approach.
     
  32. ppl2

    ppl2

    Joined:
    Dec 9, 2016
    Posts:
    3
    Hello, I am new to this engine.

    I would like to know if there is a way for AI to walk in the way like the image below without using gravity?

    Thank you.

    walk.png
     
    norsemedia and NEHWind2 like this.
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @ppl2 > That's not something that is built-in right now, no. It's on the todo list though, I'll add your vote to it.
     
    norsemedia and Legionghost like this.
  34. blastedw

    blastedw

    Joined:
    Apr 29, 2019
    Posts:
    12
    Does the camera controller script work with a perspective camera, eg with keeping within level bounds?
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @blastedw > As explained in the documentation (or the class itself), LevelBounds apply to orthographic cameras only.
    That'll change with the next update to the engine, which will bring a major update to the CameraController.
     
    CHEMAX3X likes this.
  36. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    151
    Is there some mechanism for reducing the count of simultaneously displayed characters(enimes) ?Cause I have about 100 characters in my level ,all of them with controller monobehaviour. And this will reduce frame rate prominently.
     
  37. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    151
    Yes, I am some kind of confused with synchronization mechanism. As you mentioned "it is done before",is there some completed game that used CorgiEngine for online player?
     
  38. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    151
    I am wandering whether it is possible to ignore the calculatation of uncerned enemies,or just hide or destroy them,which are far away from player or just be passed by the player. Maybe I can make a probable solution for it, like appear&disappear by the distance of Player and enmey. But I expect for smarter and more reasonable solution for it ,if it exists:)
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @Bagazi > There's no magical mechanism for that, no. You might want to do some changes if you're running 100 characters. Chances are they don't need an advanced controller and there may be better ways to make them move. Could as well be the visual side of things that causes issues. Might want to try ECS. Hard to tell without context.
    As for online, it's been mentioned repeatedly throughout this thread (I don't have the exact links), and of course much more via the support email. I'll need to update the showcase.
    And what you're after is called culling. It's not something that is built in, but you'll find tons of implementations online, I'm sure.
     
  40. kevin_Leo

    kevin_Leo

    Joined:
    Mar 20, 2018
    Posts:
    15
    Thanks for another terrific update and +1 for the zero-G walking AI that ppl2 asked for. :)
     
    reuno likes this.
  41. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    151
    Excited to hear that! I had some research about ECS before,I am a little worried that if many basic classes should be modified heavily for ECS implantation.And is there some official plan on this?:D
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @Bagazi > The official plan is to wait for ECS to be production ready :)
     
  43. Bagazi

    Bagazi

    Joined:
    Apr 18, 2018
    Posts:
    151
    Get it:)
     
  44. Legionghost

    Legionghost

    Joined:
    Nov 30, 2018
    Posts:
    16
    Another +1 for the zero-G walking AI :)
     
    reuno likes this.
  45. krisss666

    krisss666

    Joined:
    Feb 14, 2014
    Posts:
    18
    Great job Reuno, that's a bunch of updates here and "Adds an additional cycle option mode for moving platforms : Stop at Bounds. "
    Thanks for your hard work :)
     
    reuno likes this.
  46. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    103
    @reuno - I'm working on a weapon that detonates a projectile at a specific point in the scene.

    ProjectileWeapon.cs
    • create a detonation point variable
    • set the detonation point variable in WeaponUse using Input.mousePosition
    • pass the detonation point to the projectile in SpawnProjectile using nextGameObject.gameObject
    Projectile.cs
    • create a detonation point variable
    • add a function that destroys the projectile and creates a damage area at the detonation point

    Seems too simple....am I missing anything? Thanks in advance!
     
  47. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    222
    Didn't knew there was people asking for that Zero-G walking AI thing. It have my vote too.
     
    reuno likes this.
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,166
    @Boom_Shaka > Is it an actual projectile (damage zone that moves forward) or is it more like a remote bomb (a "weapon" that, when activated, triggers an explosion somewhere)?
    Because if it's the former I guess your plan is solid.
    If it's the second, then it's too complex, and you don't even need a projectile. You'd just need to extend weapon, and have it instantiate a damage area on use.
     
    Boom_Shaka likes this.
  49. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    103
    Option 1 thanks......but I think I can use your idea for option 2 on something else!
     
    reuno likes this.
  50. Harrk

    Harrk

    Joined:
    Oct 11, 2013
    Posts:
    16
    Hi there, having lots of fun with your engine so far.

    I've got a little issue involving collisions. How would I best go about making objects interact with other objects on the same layer?

    Eg, I have a rock prefab where I would like the rock to collide with rocks. I've put the rocks onto the pushables layer and added pushables to their platform mask. Doing this makes my rock fall through the world though. I'm wondering if it's due to the raycast detecting its own gameobject as a collision?

    Is there a better way round this?