Search Unity

[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,923
    @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.
     
  2. xpachin

    xpachin

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

    reuno

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

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239

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

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    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.
  6. Quinn221

    Quinn221

    Joined:
    Oct 16, 2017
    Posts:
    22
    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.
  7. FDGSundae

    FDGSundae

    Joined:
    Aug 28, 2019
    Posts:
    7
    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!
     
  8. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
  9. Reactorcore

    Reactorcore

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

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    33
    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.
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
  12. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    105
    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?
     
  13. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    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.
     
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
  15. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    8
    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
  16. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
  17. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    8
    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
     
  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
     
  19. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    8
    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:

  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
  21. XavierSubsonic

    XavierSubsonic

    Joined:
    Jan 18, 2020
    Posts:
    8
    thanks lots!
     
  22. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    29
    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...
     
  23. reuno

    reuno

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

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    29
    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.
     
  25. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    29
    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.
     
  26. reuno

    reuno

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

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    29
    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 :)
     
  28. Zoraph

    Zoraph

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

    Zoraph

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

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    29
    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;
    }
    }
     
  31. Zoraph

    Zoraph

    Joined:
    Aug 23, 2012
    Posts:
    29
    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 ;)
     
  32. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
     
  33. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    105
    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.
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @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.
     
  36. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    105
    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.
     
  37. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    You already can do that with the rooms system.
    Maybe it's not 100% obvious as RetroVania scene is made of Unity tiles, true, but if you make the level with standard assets, just a simple script to disable the whole room may do that.

    Ok, this may not be exactly what they did back in the SNES era but you can use this method and add even more stuff per room than they were able to as you don't have such limitations on current machines.
     
    reuno likes this.
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    There was a loading screen every time you went through a door in super metroid. I never looked at the code myself but it seems pretty clear that's actually what the doors were for : https://external-preview.redd.it/4x...p4&s=09a7ecf835dcdb7e42c8257c738020ceeb51cb98

    Again I'd recommend reading a bit more on optimization techniques, especially in the context of your game. I'm sure you'll have a clearer picture of what you want after that.You'll likely run into harder issues to solve than just disabling objects. Again, really happy to discuss that with you once you've done a bit of research and have engine related questions in that regard.
     
    shyamarama and Meowx like this.
  39. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    If you could add features to your engines that fix Unity's underlying performance issues that'd be great.
     

    Attached Files:

    reuno likes this.
  40. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    105
    Thats the thing, I do not know how to make such a script. I am relying on Corgi and its workflow because I lack the ability to do this myself. Can you please make it if it is so simple?

    Come on, you know what I mean. Please don't play dumb.

    I get it you're working on this project alone, among many other responsibilities and have a need to ease the load on yourself. At the same time I'd like a bit more understanding from you to see my point of view. I am making the game completely within the limits of the corgi engine and I would appreciate if the Room System included a simple enable disable script that only kept one room active.


    Thats not okay for you to do that. Please be more respectful and do not belittle others.
     
  41. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    105
    I get a feeling like I'm being spat on here. : (
     
  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Reactorcore > I don't think Muppo was implying that optimizing a game is simple. And I'd appreciate it if you didn't suggest I was playing dumb. And no, I don't know what you mean. I've been patient, and have tried to explain to you that optimization is a bit more complex than what you mention in your messages, and have suggested ways you can learn more about it. It's a vast subject, dependent of many, many parameters, and a subject I find very interesting. As far as I can tell, everyone's been respectful of what you've said and have just tried being helpful, and have tried pointing you in the right direction.

    But at this point I'm not sure what else to do. I've asked you to submit your improvement requests via the support form, as far as I can tell, you haven't. You won't be able to optimize your game if you refuse to do either research, code, or listen to advice.

    Enabling or disabling stuff is actually already doable with the Actions per teleporter, without code :

    upload_2020-1-26_17-2-44.png

    I can make a dedicated list for that at the Room level, if you request it via the support form. But once again, please understand that this may not have the impact you think it will, and that efficiently optimizing a game without writing a single line of code is gonna be hard.

    Edit : had missed the part where I ease the load on myself. That's cute.
     
    Last edited: Jan 26, 2020
    MudPuppet likes this.
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  44. javi_unity402

    javi_unity402

    Joined:
    Nov 29, 2018
    Posts:
    33
    Please, suggest a feature and wait for @reuno response (or any other). If you need freelance programmer, contact him by private.

    We are more using the forum.
     
  45. piccolodmq

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    34
    Hi there, I was looking to edit the Jump Script, with my limited c# knowledge and have not been successful. I tried to emulate old nes game "rigid" jumping. For example, Castlevania when Simmon jumps forwards, he cannot change his direction mid-air. I tried looking at the scripts for crouching and melee weapons that does this, so I could try to adapt the stop movement in mid-air once it jumps (but keeping the direction and inertia) with no luck. Any advice on what to do?
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @piccolodmq > I believe I just answered you via email, no need to ask twice :).
    In any case, as explained in the documentation, you can set MovementForbidden to true on CharacterHorizontalMovement to stop movement.
     
  47. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    105
    @reuno I think you're being evasive here.

    My whole point is that you created a feature which introduces a way to chop a level into smaller chunks (rooms) and making an elaborate camera transition between them... but not actually having any practical benefit to it.

    Its like you built a car without wheels. Just a chassis on the ground that isn't going to move anywhere.

    I'm saying the room system is useless and it makes more sense to build levels without it.
     
  48. Reactorcore

    Reactorcore

    Joined:
    May 19, 2011
    Posts:
    105
    That screenshot doesn't explain anything. Do I stick the room game object into it or what do I do?
     
  49. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @Reactorcore , I'm not saying optimizing is simple at all. Hope it was.
    If you just wanted to disable the rooms where there's no player, one way to do that is with the Actions on the teleporter as the pic he posted show, no code need for that, just setting things right.

    I'll assume you're not use to this if you allow me for. Here is a video showing how to set stuff on Unity Events (the "Actions" on reuno's pic)



    Anyway, current room system let you chop level in isolated rooms as near or far as you want and it's useful because gives you more control on the camera behaviour than previous one.

    upload_2020-1-27_12-50-27.png
    (I just place it near because I don't want to zoom out too much)

    As graphic artist myself, I can understand the initual frustration on dealing with such things, but gathering knowledge about how the engine -and I mean Unity in this case- works will help you to get your own solutions eventually.

    Hope this helps.
     
    Meowx likes this.
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Reactorcore > No, I'm not being evasive. The feature you're after is already supported. I've showed you how. Didn't know you didn't know what actions were, I thought you just didn't know how to code. Muppo explained more. But please check that attitude, just because you don't understand a feature doesn't make it a car without wheels. At best it makes it a car without a driver.
    And again, if you want changes and updates, just like everyone else, you can request them via the support form. I get tons of request on a daily basis.
     
    MudPuppet and UnityMaru like this.