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. xpachin

    xpachin

    Joined:
    Feb 6, 2014
    Posts:
    62
    VERY NICE!!!
    i like the mist a lot. how did you do it? just a particle? or any asset?
     
  2. Levrault

    Levrault

    Joined:
    Jan 22, 2018
    Posts:
    29
    @jasonxtate66 really nice and a wonderfull nes style :p

    @reuno I got a question about soundmanagers and entrypoint. If I create two scene, both of them with a sound manager when I travel between them, the sound manager seems to stop existing and I got the following error when I try to jump with a sfx


    NullReferenceException: Object reference not set to an instance of an object
    MoreMountains.CorgiEngine.SoundManager.PlaySound (UnityEngine.AudioClip sfx, Vector3 location, Boolean loop) (at Assets/Vendors/CorgiEngine/Common/Scripts/Managers/SoundManager.cs:81)


    Strange seems the sound manager still exist :/
     

    Attached Files:

  3. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Levrault > Might be something wrong with your setup, but it's hard to tell what.
    I don't think it's related to entry points though, entry points or not scenes are loaded and unloaded the same way.
    I just gave it a try in the vanilla MinimalRooms1 scene though, and it works just fine. Added a sfx to the JumpStart, and it's fine.
    It'd be interesting to see what the error is referring to exactly. The SoundManager can't be null, it's a singleton, and will be created if needed. So what the error likely points at is the fact that your audio clip is null. Why that's the case, I don't know, but I don't think it's due to the engine. Give it a try on the demo levels, without any change, and let me know if the problem persists. I'm testing on my work in progress next version, so maybe I've fixed something here without realizing it.
     
  4. jasonxtate66

    jasonxtate66

    Joined:
    Nov 21, 2017
    Posts:
    133
    The mist is a particle effect! Thank you!
     
  5. GioSales

    GioSales

    Joined:
    Jan 15, 2014
    Posts:
    3
    I'm having this issue with animation events. The player character has all these Abilities and stuff and they have that function PlayAbilityUsedSfx(), I want to add an animation event to play the AbilityUsed sound of a specific ability, but the animation event function picker doesn't let me choose, is there any way to differentiate the function in the animation event?
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @GioSales > I never use animation events, I didn't know the list looked so bad.
    I don't understand why it's not separated by components like pretty much everywhere else in Unity.
    My suggestion here would be to create a new method, with a unique name, like DashAbilityUsedSfx, that simply calls its own PlayAbilityUsedSfx(), and that way you'll be able to spot it in the list.
    The easier solution would be for Unity to fix that awful list though, it's unusable.
     
  7. GioSales

    GioSales

    Joined:
    Jan 15, 2014
    Posts:
    3
    Yeah it's pretty bad. It just lists ALL the freaking functions the gameobject has from all the components without saying from which component it is (that's A LOT of functions when you're using Corgi Engine). Your suggestion gave me an idea though, I'll test it out and come back if it doesn't work.
     
    reuno likes this.
  8. jasonxtate66

    jasonxtate66

    Joined:
    Nov 21, 2017
    Posts:
    133
    I see some guys mentioning ProCamera2D along with Corgi Engine... would this offer a solution like the camera panning to the next room as you open a new area similar to Metroid or Castlevania when you enter a tunnel or new room? I already like the existing Camera. Is it hard to implement? I would only want to use it to pan forward to the player something, or for "cut scenes", or for the "tunnel" effect in Metroid.
     
    Last edited: May 18, 2018
  9. NEHWind2

    NEHWind2

    Joined:
    Jan 7, 2016
    Posts:
    31
    @jasonxtate66
    It isn't hard to implement at all! It's really nice and straight forward. Just like Corgi Engine there are demos included for every ProCamera2D function that you can check out to see how everything works.

    It certainly does have room switching like Metroid, but it won't pause the game while it transitions like Castlevania or Mega Man games do. You add a room in the Camera component and just drag the window into the shape you need the room to be! You can change how fast the transition happens, whether the camera should fill in the space if the new room is bigger or shrink if it's smaller, and all kinds of other options.

    It has cutscene functions also but I've never used them so I can't speak for it really. There's a lot of info on the website though!

    http://www.procamera2d.com/user-guide/extension-rooms/
    http://www.procamera2d.com/user-guide/extension-cinematics/
     
    jasonxtate66 and reuno like this.
  10. breeme

    breeme

    Joined:
    Mar 17, 2014
    Posts:
    21
    Please tell me.
    I would like to know best practices for setting the background with multiple independent layers.
     
  11. Samewrai

    Samewrai

    Joined:
    May 5, 2015
    Posts:
    1
    I tried adding this script to my camera object, along with the procamera2d setup but I get the error

    The name `ProCamera2D' does not exist in the current context

    I've been trying to get procamera 2d working for a while. Any help is appreciated =-) I'm probably doing something wrong...
     
  12. Levrault

    Levrault

    Joined:
    Jan 22, 2018
    Posts:
    29
    @reuno I was able to reproduce with minimalRooms and minimalRooms2.

    Here how I reproduce it
    - Add a background music to the game manager singleton

    If I remove the background music. It seems alright. I think it's maybe by adding it to the gamemager, the manager is created/keep before the sound manager singleton.
     
  13. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Well, it's being a while but finally I have something I want to show you.

    Ralesizo Adventures demo is online, get it on the website below.



    Ralesizo website

    Stills on development and there are a lots of things to improve and new stuff to come, but one step each time :)

    Hope you like it!
     
    Last edited: May 20, 2018
  14. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @breeme > I don't know about "best practices" for that. But you can look at the Mesa1 demo level for an example of that (among other demos).
    @Levrault > Don't add your background music to a Singleton gameobject, it won't work :) Put it on a separate one.
    @Muppo > Very nice!
     
  15. breeme

    breeme

    Joined:
    Mar 17, 2014
    Posts:
    21
    @reuno > I will study the sample you taught.
    Thank you.
    @Muppo > Thank you very much for the fun game.
    "ム" katakana is wonderful.
    What can I use for my collected donguri?
    I played with my family.
    I do not know the way to go ahead from where the green slime is.
     
  16. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Thanks @reuno , glad you like it

    @breeme
    "無" was original the idea, just I don't want to draw a complicated kanji and also like the triangular shape of "ム"

    Donguri / Nuts are just collectables on the demo, will have a use on final game (maybe money for buying things, not decided yet)

    If you're stuck on that level, just explore, there is a room with a switch that can open your path ;)
     
    reuno likes this.
  17. jasonxtate66

    jasonxtate66

    Joined:
    Nov 21, 2017
    Posts:
    133
    Says your site is currently sleeping bro on the link!
     
  18. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @jasonxtate66
    Sorry about that, it's on a free hosting by now, sometimes it goes down. Try ralesizo.es instead, it's on spanish but menu items are on the same order.
     
    CHEMAX3X likes this.
  19. CHEMAX3X

    CHEMAX3X

    Joined:
    Jan 8, 2018
    Posts:
    265
    No sabia que hablabas español (=
     
  20. Prog-Maker

    Prog-Maker

    Joined:
    Mar 6, 2017
    Posts:
    20
    Hello! Game is good!! Very good. But problem with stone.

    I was in a situation where the stone can not be moved.

    At the first level, too, the same situation can happen.

    gameBug0.jpg
     
    Grafos likes this.
  21. breeme

    breeme

    Joined:
    Mar 17, 2014
    Posts:
    21
    You can pull it while holding down the button.
     
    Muppo likes this.
  22. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @CHEMAX3X Soy de España, y por tu nick algo me dice que tu también lo hablas :)

    @Prog-Maker and anyone else with the same issue: stop near the stone as if you want to push it, hold P key / (B) button and move. Ralesizo will then pull the rock.
     
  23. Kelgand

    Kelgand

    Joined:
    Feb 3, 2018
    Posts:
    10
    @Samewrai This would be a more appropriate question to ask through ProCamera2D's support, but to me it looks like you don't have a reference to ProCamera2D's script in your own script. Make sure you have the following at the top of your script as well:
    using Com.LuisPedroFonseca.ProCamera2D;


    If you have any more questions about this, I would recommend Googling "Unity The name `ProCamera2D' does not exist in the current context" as this is a pretty generic error (that is, it's not really specific to PC2D), and for further questions about PC2D to go to their support.
     
    reuno likes this.
  24. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99
    Just tried: disabling/enabling the Player worked, but commenting SpawnSingleCharacter () call in the LevelManager didn't. By now it's not a problem, hope the same in the future.
    May I ask if such functionality Is going to be implemented? :)
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @luigi-freguglia > If more people ask for it, sure (so far you're the only one who ever requested this).
    In the meantime I'd recommend extending the LevelManager to implement your own specific behaviour.
    What exactly didn't work with what I recommended previously? I tried it and it works as intended.
     
    luigi7 likes this.
  26. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    @reuno
    I need to add animations to the player, so I followed the instructions from the documentation:

    protected override void InitializeAnimatorParameters()
    {
    RegisterAnimatorParameter ("Jetpacking", AnimatorControllerParameterType.Bool);
    }



    public override void UpdateAnimator()
    {
    MMAnimator.UpdateAnimatorBool(_animator,"Jetpacking",(_movement.CurrentState == CharacterStates.MovementStates.Jetpacking),_character._animatorParameters);
    }


    If I use a new name on this animation it will prompt an error on the MovementStates.Jetpacking string unless I add that new animation to CharacterStates.cs

    Have read it twice and I don't see any reference to that. Maybe I'm loosing something here or maybe there is another way to get this working?

    Thanks in advance.
     
  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    States and animations are two different things.
    In this example the animator parameter is updated using a check on the current state, but that's just an example, and you can pass it any bool you prefer, the two are completely independent.
     
  28. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    OK but, What sense do it have to call an animation speaking (i.e.) but having state as idle? Will this work fine then?
     
  29. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Muppo > I'm not sure I understand your question. The methods you mention (InitializeAnimatorParameters and UpdateAnimator) are completely optional. You can also use Unity's native methods, such as _animator.SetBool() and that kind of stuff. Nothing specific to the engine here.

    To clarify, all the engine does is update parameter states. What you do in your animator using these parameters is absolutely independent. So you can set a "Speaking" parameter to true, if your transitions are setup properly (so that your animator doesn't transition to Idle if Speaking is true, for example), then yes it'll work just fine. Again, classic animator stuff, nothing specific :)
     
  30. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Nice.
    Thank you :)
     
    reuno likes this.
  31. luigi7

    luigi7

    Joined:
    Jun 30, 2015
    Posts:
    99
    @reuno Just commented the line but the character is still spawning, maybe I wrote somewhere something I don't remember... I'll let you know.
     
  32. Levrault

    Levrault

    Joined:
    Jan 22, 2018
    Posts:
    29
    @reuno Thanks for the answer.

    I just made me think, does the corgi engine should get a "music background singleton" if he support the metroidvania play style ? For me, it can be a great improvement to had the same music for multiple level because with the actual background music, everytime I change scene, the music will restart. Thanks
     
    jasonxtate66, CHEMAX3X and luigi7 like this.
  33. jasonxtate66

    jasonxtate66

    Joined:
    Nov 21, 2017
    Posts:
    133
    Agreed... it would also be nice to have the music fade in and out, or a multiple tracks it runs through. but there may be an asset for that or some alteration (over my head) that could be done to the existing system. I haven't researched these assets, but I don't think we are married to the way Corgi sets the music up.
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Levrault, @jasonxtate66 > That's already the case. You can have music keep playing while transitioning to another scene. Just put a BackgroundMusic component in scene A, and nothing in scene B.
    And this can easily be extended to support a playlist or fades, no problem.
     
    Levrault, Muppo and CHEMAX3X like this.
  35. jasonxtate66

    jasonxtate66

    Joined:
    Nov 21, 2017
    Posts:
    133
    I have a question... that may be a silly one. My character's sprite is small (think NES small)... one of his upgraded weapons, is a whip that extends a tile before him (the whip's extra tile being 16x16). His other weapons, guns, sword, etc. stay within his "sprite". The whip has the extra tile.

    How would you go about implementing something like Castlevania's Upgraded Extended whip, that goes beyond the character? Would you instantiate and quickly destroy it as a prefab whenever it was used, or is there an easier way to do this? Does this make sense?
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @jasonxtate66 > It's never such a good idea to instantiate stuff at runtime, especially if you do it a lot (like I imagine you use that whip a lot). It's best to enable/disable stuff when you can. That'd be a good way to do things here.
     
  37. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @jasonxtate66 > I don't see any problem with that :) Just have that in your animation then, it'll be fine.
    I thought you meant as a separate object.
    There are multiple examples in the engine of animations with different size than the original sprite if you want to have a look at that.
     
    jasonxtate66 likes this.
  38. jasonxtate66

    jasonxtate66

    Joined:
    Nov 21, 2017
    Posts:
    133
    I know I'm missing something too... because for whatever reason I cannot get the character animation of "Holding the rifle" whenever I equip the rifle. It all works fine, I just want him to carry the rifle when it's equipped - as of now he just pulls a rifle out. I'm sure it's a simple thing in the animation parameters. Do you have any ideas? Make a parameter like "holding rifle" = true?
     
  39. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @jasonxtate66 > I don't know your setup, and I don't know your animations. I can't guess what's wrong.
    Plus it doesn't have anything to do with the engine :)
     
    jasonxtate66 likes this.
  40. GioSales

    GioSales

    Joined:
    Jan 15, 2014
    Posts:
    3
    I'm having this issue here whenever my enemy revives after being killed by the player. The revived enemy wont walk unless I reopen the game. Any clue on how to fix this? upload_2018-5-23_11-36-35.png
     
  41. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @GioSales > Please use the support email, and provide more details (what version of the engine, of Unity? where in the demo scenes the problem can be reproduced, and if not, if you've compared for differences). Thanks.
     
  42. AbsurdMcMan

    AbsurdMcMan

    Joined:
    Apr 11, 2018
    Posts:
    3
    Yes indeed, the Dpad thing is a bit odd. I'll keep fiddling and see if I can work out what's going on (and share in case anyone else ever has this bug with the DS4 controller).

    And ok noted! Will take a look through the timelines stuff in this case :)

    I was wondering too regarding the Door / Key system - is there a way within Corgi to have it so that a Door only activates when multiple Keys have been obtained by the player?

    The idea is to have a blocked 'door' at the end of the level, and once you collected all of the items needed in that level (say 4-5), only then will it be possible to unlock the door at the end. Thanks!
     
  43. Muppo

    Muppo

    Joined:
    Sep 28, 2016
    Posts:
    242
    Check the reuno's Corgi Engine repo ;)
     
    reuno likes this.
  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  45. stmaddox

    stmaddox

    Joined:
    May 15, 2016
    Posts:
    9
    @reuno > Have you ever tried giving an enemy only a melee attack? I have a "man with a club" enemy and it doesn't seem to work unless I add the AI shoot on sight to the enemy. The melee weapon has just the Melee weapon script on it and is a child of the enemy.
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @stmaddox > Well if you don't have an AI script to trigger the weapon, nothing will happen. That's to be expected :)
    But yes, having a melee weapons on enemies works just fine.
     
  47. stmaddox

    stmaddox

    Joined:
    May 15, 2016
    Posts:
    9
    @reuno > Thank you for the 1 minute response.
    I just thought that the Auto setting automatically triggered event. Don't see an equivalent to the AI shoot on sight that is melee only. Guess I could write my own.
     
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @stmaddox > You can absolutely write your own if you want, but AIShootOnSight is designed to handle melee weapons as well. I guess I could have named it AIUseAnyTypeOfWeaponWhenEnemyIsInRange, but it was shorter :)
    The Auto setting, as explained in the documentation, is a completely different thing, independent from AI, it's more about whether the weapon is automatic or semi automatic. It's the trigger mode.
     
  49. steelhamsterstudio

    steelhamsterstudio

    Joined:
    Mar 15, 2018
    Posts:
    29
    There is a lot of things to polish, add and so on, but still, I finally found out "why damage and death animation triggers don't have any effect on the animator", 'health' script find animator in the main object, but my character is Spine animated child object...so I just added FindInChild and its immediately worked.
    Now I'll add more parameters for melee (more accurate timings of invincibility while attacking and dashing) and divide damage on 3 main type.
     
    Muppo, prethon and matteo-piccioni like this.
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @steelhamsterstudio > Looking good! The way the health comp grabs the animator isn't correct, I'll fix that in the next release, thanks for spotting this!