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

    Arcanys

    Joined:
    Aug 10, 2020
    Posts:
    1
    I have tried to add the new 2D lighting using Universal Render Pipeline. When I do the GUI camera only shows flat blue, if I delete the gui camera, the regular camera shows no problem. Except even then I notice some objects such as the player and interactable objects are affected by the lighting, but platforms/anything on a tilemap are not affected by lighting. Is Corgi Engine not really compatible with the Universal RP and 2d lighting?
     
  2. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  3. Jak54s

    Jak54s

    Joined:
    Aug 12, 2020
    Posts:
    6
    What would be the best way to have coins fly out after an enemy dies? Thanks.
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  5. Jak54s

    Jak54s

    Joined:
    Aug 12, 2020
    Posts:
    6
    I am going through the API and saw various methods that would help with the system I am trying to build. For example, the add method. However, I am not sure how I would use that method to target a specific inventory. How would specify what inventory to add the item to?
     
  6. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Jak54s > The AddItem method is one of the Inventory class' methods. You don't have to specify what inventory you're adding the item to, as you're calling it ON the inventory you're targeting.
    So for example, myArmourInventory.AddItem(someItem, 50) will add 50 someItem to that armour inventory.
     
    javi_unity402 likes this.
  7. Jak54s

    Jak54s

    Joined:
    Aug 12, 2020
    Posts:
    6
    Appreciate the quick response. You have got one the best assets ever. Thanks for all the help.
     
    reuno likes this.
  8. Jak54s

    Jak54s

    Joined:
    Aug 12, 2020
    Posts:
    6
    Hello again. Since I'm not a great programmer, I only have basic understanding I am having some trouble with the implementation of the crafting system. At this point I want to implement the following ---- > You click a button and a coin gets added to your main inventory. How would the script look like for that and what game object would I attach the script to. An example would help me get started. Thanks.
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Jak54s > You can read input from any class in Unity. There are many ways to do so, and this question is really not specific to the engine, but here we go, your script would look something like :

    if (Input.GetKey(KeyCode.A))
    {
    myInventory.AddItem(myCoinItem, 1)
    }

    This would add 1 coin when you press A.
     
  10. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    119
    Dear @reuno ,

    Is there any way complete Corgi engine might get turned off on level load? When we build scene B directly, Corgi works, you can walk/jump around and see the FPS limited to 60. But when we build all scenes and you switch from scene A to scene B, the FPS is not limited and you can not move at all. Seems like all functionality of corgi is just gone suddenly.
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Cambesa > The engine is made of a lot of different scripts, it's not really a single entity, and there's no way to disable all its parts at once (aside from deleting them or extreme measures like that).

    What's probably happening is that you have a manager (input, game manager maybe?) that carries over from scene A to B - the GameManager doesn't destroy on load, and it's not setup properly (of all the scenes in the engine only the GameManager can impact FPS limit).
     
    Cambesa likes this.
  12. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    119
    We have a GameManager, LevelManager and InputManager, do they all get carried over from one to the other scene? If so, then the LevelManager may be the problem because for the player, I'm using a GameObject in the scene itself instead of a prefab. So then it might lose the player object when switching to a new scene. Where can I turn off the passing of objects between scenes? For our game no information needs to be remembered between scenes so that might be a quick way to fix it.
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Cambesa > The GameManager does persist, the LevelManager doesn't (it's specific to a Level).
    You can change the behaviour of the GameManager if you want, but I wouldn't recommend it.
    I'd recommend looking at the demo scenes to see how managers should be added to the scene. My guess is you changed something in the hierarchy.
    If the issue persists, please use the support form and provide more info about what exactly you're doing.
     
    Cambesa likes this.
  14. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    119
    I replicated the hierarchy from a demo scene, one GameManagers object that has the GameManager component and InputManager. Then a seperate object with the LevelManager. The problem persists. Can you point me in the direction where I can change code so the game manager does not persist between scenes? I really need a quick fix because we have the demo presentation shortly.
     
    Last edited: Aug 17, 2020
  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Cambesa > If you search for DontDestroyOnLoad across the whole engine, you'll find two occurences, for two singleton classes, persistent singletons, one of them used by the GameManager. Simply making the GameManager a regular class (or singleton) will prevent that.
    That's probably not the cause of your issue (or likely hides another problem).
    As I said before, please use the support form if the issue persists, as I'll need more info than this to be able to help you, thanks.
     
    Cambesa likes this.
  16. Cambesa

    Cambesa

    Joined:
    Jun 6, 2011
    Posts:
    119
    Yes it definitely has another cause, I will try to make it work properly when we have more time. Thanks for the help it works now! I just commented the DontDestroyOnLoad lines. Perhaps i'll contact you later through the support forms but there's enough other work to do before we can start cleaning up a lot. This is fine for the demo presentation!
     
    reuno likes this.
  17. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Cambesa > Note that turning it into a regular singleton shouldn't necessarily break stuff, it might work. You'll lose persistency for points etc of course, but if you don't need it, you'll be fine. I'd be more worried about the hidden consequences of whatever is wrong in the setup, it could well be nothing, but I'd investigate it at some point :)
     
    Cambesa likes this.
  18. piccolodmq

    piccolodmq

    Joined:
    Jan 7, 2020
    Posts:
    34
    @reuno
    Hi there, I am doing a big metroidvania, and I was wondering what was your recommendation, making one big map, using the room Systems and Proximity XXXXX, to improve performance,or just divide the Game into different scenes (still using the room system). what do you recommend so a character Inventory, upgrades and progress in general is saved between scenes, if that is the way to do it?

    Just so you have an idea, the game could have up to 40 rooms, more or less (using your Retrovania, room system).

    Thanks!
     
  19. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @piccolodmq > Both would work as far as the engine is concerned, it's really up to you.
    What I'd recommend is running your own benchmarks, in your own context.
    Establishing budgets, and seeing whether, for example, you're CPU or GPU bound will help determine what kind of optimizations you need, and what setup works best for you.
     
    piccolodmq likes this.
  20. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    I’ve owned corgi for years but haven’t yet delved into it as I’ve wanted to get better at unity first. I’d like to try making a simple Master System style Sonic game to experiment with, would Corgi be a good choice for this? I don’t imagine loops-de-loops would be supported but would other aspects like acceleration and deceleration and such be possible? Just a rough idea of how Sonic-ish Corgi can behave.

    Thanks!
     
  21. liquidsht

    liquidsht

    Joined:
    Jun 4, 2020
    Posts:
    49
    I am using another asset for the camera. Is it possible to have another camera only for the MMfeedback? Thanks.
     
  22. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Zebbi > That's a good question! There'd be quite a lot of work. The engine is designed with tighter controls in mind. The permanent floatiness of Sonic would take quite the effort to replicate, might not be your best choice. It's doable, of course, but it's not something that I'd recommend to someone without relatively strong coding skills, for example.
    @liquidsht > You can have as many cameras as you want. I'm not sure I understand the question though, could you clarify what you're after? MMFeedbacks are not tied to a camera, so it's a bit unclear at the moment :)
     
    Zebbi likes this.
  23. liquidsht

    liquidsht

    Joined:
    Jun 4, 2020
    Posts:
    49
    Sorry I mean the camera shake. I thought it was part of the MMFeedback.
    So if i want to use another asset that controls the main camera, can I still have another camera for MMCamera shake? Thanks.
     
  24. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @reuno > I'm not sure, I suppose it depends on your other asset and how it works?
    I suppose the camera you'd want to shake would be the main one?
     
  25. liquidsht

    liquidsht

    Joined:
    Jun 4, 2020
    Posts:
    49
    hmmm....the other asset I am using doesnt use cinemachine but does have its own screen shake. I was hoping I can skip having to link Corgi with the other asset for every camera shake event.

    Also, another quick one. I made a melee prefab weapon but could not trigger the attack animation with the start animation parameter. The weapon itself works fine, and i have the parameter in the animator and in the transition, is there anything else I need to bind to the melee weapon? Thanks.
     
  26. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @liquidsht > Again, I'm not sure what you mean by "link Corgi with the other asset".
    If your other asset has its own screen shake, maybe call it directly. Otherwise, you can create your own feedback to target it. Note that MMFeedbacks and the Corgi Engine are two completely separate systems, you can use one without the other. If the issue persists, please use the support form and provide a bit more info about what you're trying to do.
     
  27. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    521
    Thanks for the reply, really appreciate it! What is the proper way of integrating Unity's native 2D Pixel Perfect camera script with Corgi? I know there's a setting on the Corgi camera that allows it, but if I wanted to the use the Unity native PPC, is this added to the main camera? I've not worked with Post-processing stacks before, so I'm not sure if it needs be added in a specific way. Thanks again!
     
  28. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Zebbi > You can see an example of the Unity PPC in use in the RetroCorgi demo scenes. Note that it's a completely different thing than post processing, no relation between both.
     
    Zebbi likes this.
  29. StarShipMan

    StarShipMan

    Joined:
    Jan 28, 2014
    Posts:
    91
    Hey, I know I'm 1.5 years late to the party.

    Were you able to resolve this issue with the Corgi Engine Inventory system? I'm facing the same issue.
     
  30. Asterixman

    Asterixman

    Joined:
    May 28, 2017
    Posts:
    4
    Hello.I have a problem about selecting multiple character.What i want is selecting a player character then in other scene selecting a companion to spawn with player.Does anyone have solution for this?
     
  31. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Asterixman > You can see an example of character selection in the RetroAdventure demo scenes. Selecting a companion to start with would the exact same process.
     
  32. Zoo4125

    Zoo4125

    Joined:
    Oct 5, 2019
    Posts:
    9
    Hi, I have my character set up to auto equip a CorgiSword using the CharacterHandleWeapon script on start up. The hitboxes are damaging enemies properly and etc. the only problem I'm having is that the Parameter "MeleeAttack" for the Animator isn't triggered. I just want to have my melee attack play my attack animation, switching weapons isn't really necessary for my game. Where would I add the line of code to trigger the animation. Or would it be better to create a character ability for melee?
     
  33. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  34. Zoo4125

    Zoo4125

    Joined:
    Oct 5, 2019
    Posts:
    9
    @liquidsht I'm pretty sure you were asking a similar question to this a few posts ago so this might help you get your animations playing too. Thanks Reuno, that was a simple fix I got the melee animations to play properly now. Another quick question, I made some custom character ability scripts and added the required lines of code to the input manager script, and Unity's Input manager but I can't get my scripts to work. I know I remember seeing something about having over 100 can cause issues or something along those lines? I was thinking of deleting the player 2-4 inputs in Unity's since I only need one characters Inputs anyhow. Sorry if this is a dumb question. I can upload my CharacterScripts in question/Open a support forum if that helps. Thanks again, Reuno.
     
  35. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Zoo4125 > Sure, you can remove the input axis you don't use.
     
  36. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    I'm hoping someone can offer some advice with the animator. My 2D character has an animation when turning from left to right and vice-versa (think of it as turning around). Every other animation is a mirror, however I can't seem to set my animator up so that if the character is facing left and I turn right, it plays the turning animation and then goes back to idle. I've experimented a bit with the new FacingRight flag but that only seems to work when I have FlipModelOnDirectionChange set.

    Any advice would be appreciated.
     
  37. Asterixman

    Asterixman

    Joined:
    May 28, 2017
    Posts:
    4
    @reuno I already tried that and the first character i choose(as player character) doesn't spawn in playable level scene.
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Asterixman > I'm not aware of any issue with the character selection. If the issue persists, please use the support form to explain how to reproduce your problem, I'll be happy to look into it.
     
  39. Lord_Eniac

    Lord_Eniac

    Joined:
    Jan 28, 2020
    Posts:
    50
    I just started looking at this engine today and can tell that a lot of time and effort have gone into its creation, so I appreciate that very much. I have noticed a glitch though, and I haven't seen any mention of it with my searches. I apologize if the topic has been brought up before.

    My problem involves running the FeaturesGravity scene in play mode. I discovered that (seemingly random) if I ran full speed to the right immediately, I would burst into a cloud of smoke when going up the ramp to leave the first room. Sometimes I would make it, but other times I would wind up stuck in the ramp and subsequently die.

    To be fair, I had been making some changes to a copy of the scene, so It took me a little while to track down exactly what was going wrong. I loaded the original scene and tried moving fast to the right first thing. No issues... yet.

    I finally discovered that by selecting the player Rectangle in the inspector while in play mode, the problem would occur (regardless of what ramp you attempt to run up). I'm guessing that the collision detection and the editor are butting heads in terms of processing, and the obvious solution is to just make sure that a Corgi Character isn't selected in the editor when testing (not the best solution, though, imo). However, if this collision problem can occur when the editor is essentially taxing the system with inspector updates, it seems reasonable to think that the same phenomenon could occur in a release version if things get particularly computationally expensive. Has anyone experienced this issue before?

    Edit: If the Character Crush Detection is disabled, then the player does not die, but simply runs through the ramp. The character will die if it runs through the ramp further to the right because it will fall off the map.
     
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Lord_Eniac > If you think you've found a bug, please use the support form to report it, and provide context info. Note that latest versions of Unity are very, very buggy when selecting a prefab at runtime. If you can reproduce this in a build, please let me know, as unfortunately I can't fix current Unity's editor issues :)
     
  41. Lord_Eniac

    Lord_Eniac

    Joined:
    Jan 28, 2020
    Posts:
    50
    Yeah, I understand. I shot an email out to you, but I just now saw the "if you can reproduce this in a build" statement. Alas, I have not tried.
     
    reuno likes this.
  42. johntday

    johntday

    Joined:
    Jul 19, 2020
    Posts:
    1
    Is there support for enemy health bar?
     
  43. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @johntday > Yes, you'll find examples of that throughout the demos, in the RetroAI demo scene for example. The engine comes with multiple ways to set them up, either via UI prefabs, or automatically drawn on initialization.
     
  44. jernaben

    jernaben

    Joined:
    Jul 14, 2015
    Posts:
    1
    Hello. Anyone who knows how to add the "DamageOnTouch" script to a particle with collision?

    cant get it to work
     
  45. matttardiff

    matttardiff

    Joined:
    Feb 27, 2018
    Posts:
    30
    To be clear from the start, I use the Corgi Engine without out any programming which serves all my needs. And if there's something that would need to be programmed, well I figure out another way and design accordingly.
    Basically, I want to restart the level when the character dies. I know you can use the Level Restarter script on a trigger to make the player reset the level on enter. And that works as expected.
    I would assume adding it to the player's Death Feedback would work just fine but all levels point to the Player prefab that is not in the scene. So that wouldn't work as far as I could tell.
    I thought adding the Level Restarter to the character and adding it to an Animation Event could work but it doesn't show up in the list when I try to add the script to the event. Even though it's on the player like everything else.

    Hopefully all of this makes sense. Thanks in advance
     
    Last edited: Sep 5, 2020
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @jernaben > No, you can't. Particles don't have trigger colliders. You'd need a dedicated setup for that.
    @matttardiff > You can't add the LevelRestarter to a character. As explained in the documentation or the class itself, it has to be added to a trigger collider. What you'll want to do instead is extend the LevelManager, to implement your own rules (there are examples of that in the engine, and in the documentation. You could also listen and catch game events to act on a death event. Both would work.
     
    jernaben likes this.
  47. matttardiff

    matttardiff

    Joined:
    Feb 27, 2018
    Posts:
    30
    Thanks, I'll give those a shot.
     
    reuno likes this.
  48. Pablethe

    Pablethe

    Joined:
    Aug 11, 2017
    Posts:
    7
    Hi! I need to use the Weapons system but without guns and bullets. That is, when I grab a weapon it is consumed from the same inventory item and does not use another bullet item. I'm putting together a game where the character throws powers. So it is not viable for him to have guns and bullets. Basically what I want to do is that when I grab a "weapon" and use it, that weapon is consumed and not a second "bullet" item. It is understood?

    Can this be done?
     
  49. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Pablethe > Yes, it can be done. The Inventory Engine's API will let you implement that.
     
  50. Pablethe

    Pablethe

    Joined:
    Aug 11, 2017
    Posts:
    7
    Without abusing your trust. Where do I begin? I tried to implement the Bullets and Weapons scripts all on the same object. But I Crashed and closed Unity.