Search Unity

[RELEASED] Corgi Engine - Complete 2D/2.5D Platformer [new v6.2 : stairs, Rooms System, and more]

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

  1. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Kellyrayj > Please use the support form and provide exact repro steps to your issue, without knowing what you're doing exactly, and what you changed, it's quite hard to help :)
     
  2. gamesbyangelina

    gamesbyangelina

    Joined:
    Jun 23, 2013
    Posts:
    20
    Hey Reuno!

    I bought Corgi a while ago to experiment with smaller platformer stuff. However, today I'm considering porting a procedural game to it. Before I get really deep into it, I wondered if you could let me know:

    1. If I want to generate level geometry at runtime, is there anything that will confuse Corgi? I assume if everything uses Collider2Ds, the system should be fine and play nicely?
    2. If I want to generate level geometry continuously, i.e. have a level that dynamically grows or a level bounds that scales up, is there anything in Corgi that will start to get unhappy? The demo levels are relatively small (which makes sense, they're demos!) but I'm wondering how big stuff can get before Corgi kind of wants you to break it up into two smaller levels.

    Thanks for making such a great asset.

    Mike
     
  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @gamesbyangelina > You can absolutely generate level geometry at runtime.
    And the engine itself doesn't have issues with large levels. Most of the issues you'll have are Unity ones (performance, floating point errors, that sort of things), but nothing I can think of on the engine's side.
     
  4. Meowx

    Meowx

    Joined:
    Oct 10, 2015
    Posts:
    28
    Another question about the CharacterSwitch function - right now, prefabs maintain their direction and velocity when airborne/dashing. This can lead to some really jarring switches where you're suddenly getting shot off in a different direction when you switch, and will sometimes cause the state machine to break if you swap while dashing.

    Would it be difficult to transfer the prefab's facing direction and velocity over to the switch prefab like the position and state is transferred?

    (To see what I'm talking about in action, press the "switch" key while dashing back and forth in the air in the MinimalCharacterSwitch scene.)
     
  5. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Meowx > No, it wouldn't be difficult, you can implement that in one line (getting the current velocity, applying it to the new prefab on switch. That's one line if all goes well. You'll see examples of that being done at different places in the engine, getting in and out of gravity zones for example.
     
    Meowx likes this.
  6. wayloon

    wayloon

    Joined:
    Oct 2, 2015
    Posts:
    7
    @reuno ,How to implement glide in mobile mode and jump and glide share a key?
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @wayloon > As explained in the documentation, you just have to bind a button to that specific action. Either another one, or the same one as jump. One button can have more than one action bound to it, no problem.
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    Good news, I've just pushed v6.2 of the Corgi Engine to the Asset Store.
    As usual, this new version fixes all reported bugs to date, and comes with a pack of new features, the biggest ones (and the most requested) being Castlevania-like stairs, as well as a Room system also seen in Castlevania, or Hollow Knight, or Super Metroid (etc, etc).

    Here are the full release notes, I hope you'll like this new version (and as usual expect a few days of delay until Unity validates it) :

    - Adds support for stairs (like in Castlevania for example), one-way slopes that the user can decide to go up or down on, or ignore and keep moving forward
    - Adds the CharacterStairs ability that lets Characters handle the stairways mentioned above
    - Adds MinimalStairs, a minimal level showcasing how to setup stairs
    - Adds the CharacterSpeed ability, letting you set specific speed multipliers for each movement state
    - Adds the Rooms system, which lets you cut your level into isolated sections, each with their own contained camera, and link them together via doors/teleporters/portals/etc, letting you create the same kind of navigation seen in Super Metroid or Hollow Knight for example
    - Adds the RetroVania demo scene to showcase that Rooms system
    - Improves SurfaceModifiers' force application method
    - Renames Singletons into MMSingletons to avoid conflicts with other assets that wouldn't properly namespace classes
    - Adds more options to the SaveLoadManager, including json and encryption support
    - Adds an option to not instantiate characters when a scene starts but rather have them already in the scene before play
    - AIActionChangeWeapon can now also be used to unequip the currently equipped weapon
    - Adds support for multiple AmmoDisplays
    - Adds an option to CharacterMovement that lets you define the duration (in seconds) during which the character has to be airborne before a feedback can be played when touching the ground
    - Adds default bindings for xbox dpad for all 4 player input settings
    - Adds an option to CharacterCrouch to prevent crouching while in movement
    - Fixes the scale of the Mesa2 Heavy Corgi
    - Fixes a jump that could lead to jumps on moving platforms not happening correctly when pressing down + jump
    - Fixes a bug that could prevent grounded only ButtonActivatedZones from being activated when entering them via the air
    - Fixes the size of the HeavyCorgi in Mountains
    - Fixes a bug that could result in a wrong state reset after a dash done airborne and parallel to a surface close to the feet of the player character following a jump
    - Jumps done during the jump time window now trigger the grounded jump feedback instead of the air jump feedback
    - Fixes the crouch resize settings on a few playable character prefabs
    - Fixes some improperly setup one way platform colliders
    - Fixes a bug in the RetroCorgi's animator that prevented sword animations to play while in the air
    - Removes an outdated line in OneWayLevelManager that could cause errors to pop up with certain settings
    - Adds comments to the Bomb class.
     
    mbosoftgame, ILJI, Quinn221 and 5 others like this.
  9. christophercasey2

    christophercasey2

    Joined:
    Jan 28, 2019
    Posts:
    1

    Change your sorting layer to player and you can remove the sprite renderer for the corgi if you want it gone maybe?
     
  10. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    17
    Thanks for the update @reuno.

    Amazing as always.
     
    reuno likes this.
  11. xpachin

    xpachin

    Joined:
    Feb 6, 2014
    Posts:
    49
    Nice, do you have a video to show the ROM system?
     
  12. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
  13. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    233
    Nice update, Rooms system looks pretty cool, gotta give it a try!
     
    reuno likes this.
  14. xpachin

    xpachin

    Joined:
    Feb 6, 2014
    Posts:
    49
    hey reuno, i was playing with the demo retro roms on the website, and it' s an excelente work, but the transitions looks a little "off", i mean when you enter a door, the camera moves to the other scene, but you can still see it and then it suddenly disaapears , perhaps with a transition will it look better? fade in or fade out or something like that? just to hide the camera movement..
    amazing work!!
     
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @xpachin > You can tweak the transition to whatever you want, and it's got fades built-in. You'll find that in many other demos (or if you look at the teleporter's inspector). The whole point of that one was to showcase that you could also do camera and mask movement, as some games prefer that approach.
     
  16. xpachin

    xpachin

    Joined:
    Feb 6, 2014
    Posts:
    49
    it was just an opinion, to get a better visualization..
     
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @xpachin > The system already allows for it, and shows different solutions for different tastes :)
     
  18. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    204

    Very nice, @reuno ! I truly appreciate that you are always adding great features. Thanks for the update!
     
    reuno likes this.
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    I've just pushed v6.2.1 of the Corgi Engine to the asset store. The main reason for this minor update is that there was a game breaking bug that would cause an improper respawn when dying while using the new Rooms system. I took this occasion to improve a bit on this new feature (you can now replicate Megaman room transitions 1 to 1, for example), as well as fixing all other reported bugs so far. Here are the full release notes :

    - Adds an option to freeze time while going through a teleporter/door
    - Adds an option to prevent jumpers to be activated from below
    - Adds an exit offset to teleporters
    - Adds a new option to teleporters to tween position instead of instant teleport
    - Adds options to teleporters to maintain entry X and/or Y position on exit
    - Characters on moving platforms and moving one way platforms can now cross one way platforms without causing a mini jump
    - Adds an option to not put the teleported object on a Teleporter's ignore list to allow for instant re-entry
    - Button activated zones can now optionnally define a specific input they can be activated with (either default, a button, or a key)
    - Button activated zones can now specify an animation parameter to trigger on the character that activates them
    - Caches delays in the Teleporter class
    - Fixes the title of Minimal CharacterSwitch's card in the LevelSelection scene
    - Fixes an incorrect repositioning of the camera when dying within a Room system
    - Fixes an incorrect sorting layer on the RetroCorgiPushableBlock prefab
    - Fixes a few teleporters' positioning in RetroVania that could result in improper position on room entry

    (same version requirements as 6.2, and as usual expect a few days of delay. I hope you'll like this update!)
     
    mbosoftgame, Meowx, ILJI and 6 others like this.
  20. Quinn221

    Quinn221

    Joined:
    Oct 16, 2017
    Posts:
    19
    Great Update @reuno ! Excited to play around with the new rooms feature! And love that you added the option to not instantiate characters when a scene starts!!!!
     
    javi_unity402 and reuno like this.
  21. FDGSundae

    FDGSundae

    Joined:
    Aug 28, 2019
    Posts:
    6
    Hi there. :)

    I've been going through the weapon examples and haven't seen this, so figured I'd ask: Is there a built-in option for a maximum range / lifespan on projectile weapons? I haven't found anything in the Corgi system that does it yet. It'd be easy enough to make a bullet range extension, but if it's already there and I'm blind, I'd rather not duplicate it. =)

    I see speed, acceleration, etc etc. What I don't see is a way to destroy the projectile before it collides with something.

    Thanks!
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @FDGSundae > It's right above "speed, acceleration, etc etc" and is called Life Time.
    upload_2020-1-19_9-24-24.png

    And as explained in the documentation, it's "The life time, in seconds, of the object. If set to 0 it'll live forever, if set to any positive value it'll be set inactive after that time."
     
    Quinn221 likes this.
  23. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    96
    YES! I so needed this thing! THANK YOU
     
    Quinn221 likes this.
  24. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    17
    This is me using new Rooms system...



    Seriously @reuno, guys from Unity should integrate Corgi Engine as Unity Rogue version or something like this...
     
    reuno likes this.
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @javi_unity402 > I'm so glad everyone seems to love it so far :)
    I'm really happy with it myself, it's proven to be quite efficient.
     
    javi_unity402 and Quinn221 like this.
  26. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    96
    Upon discovering that the room system is mainly a visual system and doesn't actually automatically turn rooms on and off depending where the player is, I felt dissapointed.

    The main benefit I was originally excited for this feature was that this would provide a way to create gigantic sprawling levels where the engine would intelligently disable rooms the player was not in at the time, thus allowing for the performance benefit that Super Metroid had this system for originally.

    Do other see this as an issue or is it just me? If yes,will this be addressed in the future?
     
  27. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    233
    This would be amazing, indeed, but you can do something like that by disabling zones far from where the player is at runtime. IE. Only the room the player is in and a radius of 1 more colliding room, the rest remains disable meanwhile.
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Reactorcore > I'm not sure how you understood it would "turn rooms on and off" from "cut your level into isolated sections, each with their own contained camera, and link them together via doors", but as @Muppo said, you can actually already do what you're after.

    It's not built-in because there are many, many ways to build rooms (tilemaps, sprites, 3D models, procedural generation of all that, etc), and also many, many ways to "turn rooms on and off". But the system now knows what room the player is in, what room it's going to, and has public callbacks on enter/exit/enter the first time, etc. This all makes it very easy to automate what you describe, I don't think there is anything preventing you to do it right now.
     
    Quinn221 and javi_unity402 like this.
  29. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    4
    Hi Reuno, first of all I just want to say your engine is the bomb, it will surely save for all of us thousands of hours! :p I just bought it with a friend to start working on our indie game project. I am not an experience programmer but more of a hobbisit. My question is ; I know its a 2D sidescroller engine but I was wondering what it would take to have the main character folow a path or a spline. I know everything in the controller seems to be working in X and Y, what approach would you recommend to have the X+ be going toward the direction of the spline instead of the actual X coordinate?

    An exemple of what I would be looking for is :

    I know you already have a follow path controller, its one of the reason among lots of others why we thought to buy your engine. The probleme is that when we do so it is set to go to a certain speed and removes all the controls. So therefore cannot be used for the actual player from what I understand..

    I know this might be huge as the whole moving, forces and raycast system seems to be build in a 2D manner..

    We also got the curvy spline Asset which we thought of using to make the actual spline in catmull form.

    Any cues on this or if you would be thinking to had this as a possibility in your future updates would be well appreciated.
    Thanks so much
    Cheers!
     
    Last edited: Jan 25, 2020
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @XavierSubsonic > It'd take a full refactor. How hard that'd be depends on your skills.
    It's too big a task do discuss like that, really depends on too many parameters.
    It's on the todo list, I'll add your vote to it. So far it's almost at the bottom of the pile. But if more people request it, maybe one day it'll make it into a release.
     
    XavierSubsonic likes this.
  31. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    4
    All right thanks I knew that would be quite a heavy job, If I replace the X in all functions with a Spline.nodes{whatever}.position and do you think that could work ? lol

    thanks much man, I guess we will figure out a way ! :p
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @XavierSubsonic > No, I don't think that would work, that'd be a very naive approach.
    You'd be ignoring collisions, the way raycasts work, and many other aspects of the problem.
     
  33. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    4
    humm ok then I guess I'd better go buy myself some wisdom at the corner store !! haha
    Sorry I know it sounded totaly like a naive solution

    I thought ray casts were aimed at some coordinates in X and Y, if the ray cast system casts rays in the direction of the spline forward and backward wouldnt it work?
    Or the direction in which the charater is facing?

    Why would it mess with the collision? Are they not in 3D?

    I think it would mess especialy with the direction particles or projectiles would be fired too .. :(

    what if id go with a node in front of the player and a node behind, all moving at the same speed and then I create a vector between the 2 and I use this vector to cast rays and to calculate the next position of the player?
    upload_2020-1-25_15-17-55.png

    or any good ways you think I should be checking in order to achieve that..
    ok thanks man sorry to bother you with all my questions.
    Cheers
     

    Attached Files:

  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @XavierSubsonic > I think you're really underestimating the complexity of the problem here.
    I'd suggest you do some research on it, I'm sure you'll figure it out.
    After that, don't hesitate to use the support form to discuss this further if you have specific questions, but this is just way too vague.
     
    XavierSubsonic likes this.
  35. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    4
    thanks lots!
     
  36. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    Hi, I am trying to integrate Photon into Corgi for a game I am making but I can't find where in your code to use this check
    if (PV.IsMine)
    {

    }
    I am supposed to put this around the action that is being called but I can't find where. Everything I try make the game crash...
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Zoraph > You'd have to ask Photon about it, not me. I don't even know what you're referring to :)
     
  38. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    lol I found how :p

    if (PV.IsMine)
    {
    HandleInput();
    }

    In CharacterAbility

    Because if I don't do this check where the input are being handled in your code I move all character even if they are not local since they all have the same controller.
     
  39. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    You controller is far more complex than any of their exemple code or tutorial so it is hard to find where things are actually being called.
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Zoraph > Maybe don't hesitate to read the docs, it would have answered your question, input is well detailed in the documentation.
     
  41. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    For lag compensation I need to do something (not sure exactly what and how yet) where you manage the animator in the code. Not sure where yet. They can't help since they don't know your code. I know what to use on the photon side but I need to find where to put it in your code without messing anything :)
     
  42. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    Yeah I did but since usually you use this check directly where you manage the Input I was messing with input manager.
     
  43. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    I had to go farther down the line to CharacterAbility.
     
  44. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    This is an example of how they do this:

    public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
    if (stream.IsWriting)
    {
    stream.SendNext(rigidbody.position);
    stream.SendNext(rigidbody.rotation);
    stream.SendNext(rigidbody.velocity);
    }
    else
    {
    rigidbody.position = (Vector3) stream.ReceiveNext();
    rigidbody.rotation = (Quaternion) stream.ReceiveNext();
    rigidbody.velocity = (Vector3) stream.ReceiveNext();

    float lag = Mathf.Abs((float) (PhotonNetwork.Time - info.timestamp));
    rigidbody.position += rigidbody.velocity * lag;
    }
    }
     
  45. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    28
    I think I will have to put this where every abilities are coded in their respective scripts but it is more complex than their example ;)
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Zoraph > Maybe no need to spam this thread. Again, please contact them directly, I don't provide support for other assets. If you have questions that are related to the engine itself, please use the support form, thanks.
     
  47. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    96
    Eh, I was hoping the corgi engine would have included a default method for it since I'm strongly relying on one if its selling points of not needing to be skilled in coding to make a game.

    Honestly, "cut your level into isolated section" and "metroid/castlevania inspired room system" did give me the impression that this would be more of a performance oriented feature than a visual effect. I guess I should try harder to learn to not have expectation. :(

    What would be the simplest way to disable/enable rooms? I'd really appreciate it if there was a simple solution I could just take and use without having to worry about being skilled at coding.
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Reactorcore > If it had been about performance, I'd have mentioned it, like every other time. There's a support form, a discord, a documentation, tutorials, if you have questions or are not sure about a feature, feel free to ask.

    "Disable / enable rooms" doesn't mean much on its own. What do you want to disable? What do you plan on achieving that way? Unity performance ain't really something that can be fixed at the engine level. It's game dependent and device dependent, there is no silver bullet. There's a script to disable AI based on distance in the extensions repo, if that's what you're referring to, and it's as far as the engine can go.

    The rest is up to you and can't really be generalized. It's based on your assets, your scripts, your setup, your level design, your game design, and so many other parameters, most of them (if not all) completely unrelated to the engine. If you're worried about the cost of the engine scripts related to the Rooms system, don't be, they're negligible.

    And if you're really after performance, I'd recommend doing a bit of research on the subject. There are some nice talks about that in the GDC vault for example. After that, if you have more specific questions about performance that are related to the engine, I'll be happy to discuss them via the support form.
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    3,290
    @Reactorcore > And of course I didn't mention it but if you want me to add features don't hesitate to use the support form to request them.
     
  50. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    96
    I just want whatever the super metroid guys had. Big sprawling open world made up from individual rooms where only one room and its contents (objects, background, npcs, decorations, platforms, everything) was active at a time. I figure they made it so since the SNES could only handle a small active space at any given time.

    Currently my only obvious option is to make a super metroid like game using unity's scene transition where each room is a seperate scene. Imagine playing super metroid, but you had a loading screen for every time you went through a door. I was hoping to avoid that.
     
unityunity