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
    @Pablethe > You can't put the bullets (projectiles I assume?) and weapon classes on the same object. As I said, one way to do it would be to create a new class (ConsumableWeapon maybe), that extends the Weapon class maybe, or lives on the side depending on what you're after, and implements calls to the InventoryEngine API on use.
     
    Last edited: Sep 7, 2020
  2. Boom_Shaka

    Boom_Shaka

    Joined:
    Aug 31, 2017
    Posts:
    141
    Start with the API dox:
    https://corgi-engine-docs.moremountains.com/API/index.html
    http://inventory-engine-docs.moremountains.com/API/index.html

    Post what you've tried and what you're trying to do to the discord channel: https://discord.gg/bA9PbYj

    Having said all that, my first suggestion is to stop thinking of them as "guns and bullets" and start thinking of them as "launchers and projectiles". If you don't want players to see the launcher, don't attach a mesh or sprite renderer to it.

    Pretty sure the rest of what you're looking for can be done with existing settings: setting your spawn point, adjusting the timing, setting the weapon to destroy itself when the ammo is consumed, etc....read the script comments and review the dox for what each setting does.
     
    reuno likes this.
  3. Pablethe

    Pablethe

    Joined:
    Aug 11, 2017
    Posts:
    7

    I don't know if you understand my point of view. I don't want a "launcher and projectile" system.

    Let's take an ax for example. When you grab an ax it doesn't have a launcher, you just throw the ax.

    What I want is that. Grab the ax and act as "launcher and projectile" at the same time.

    It is understood?
     
  4. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Pablethe > Feel free to do things differently, but @Boom_Shaka understood your question and gave you excellent advice. In terms of logic, you'll want a weapon that has no model, just logic, that acts as the launcher (detecting input, handling aim, etc) for your axe, which indeed will be a projectile. And then your weapon consumes itself out of the inventory.
     
  5. Pablethe

    Pablethe

    Joined:
    Aug 11, 2017
    Posts:
    7
    I made it !!!!

    I broke my head with the logic that I could not find. But looking closely, I found the RetroCorgi Demo which has the infinite weapon system without ammo.

    Add consumable item to that weapon and quantity.

    Magic.

    Thanks friends for the help !!
     
    reuno likes this.
  6. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Does anyone have any suggestions on how I could stop my character from climbing when it reaches the top of a ladder? I've extended Ladder and LadderCharacter so that I can detect Trigger events on the associated LadderPlatform, but even though I set LadderCharacter.CurrentLadderSpeed (I think that's it - I'm writing this at work), my character keeps moving up the ladder.

    My use case is just that I want my character to stop at the top and have to jump onto adjacent platforms.
     
  7. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @MonkeyCrime > Characters shouldn't keep climbing after having reached the top of a ladder, this sounds like a bug. Do you reproduce this in any of the demos? If yes, where?
     
  8. MonkeyCrime

    MonkeyCrime

    Joined:
    Jun 13, 2013
    Posts:
    32
    Ah apologies - I should definitely have been clearer. Characters don't keep climbing when they reach the top of the ladder (although I'd love to eliminate the little "pop" mine seem to get as they spring up and then back down onto the LadderPlatform).

    What I'm trying to achieve is stopping the character from climbing further when the top of the character collider enters the LadderPlatform. So think of it as "stop climbing when your head reaches the top of the ladder".
     
  9. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @MonkeyCrime > You'd need to extend the ability for that. Alternatively you could resize your ladder's collider.
     
  10. andrin2020

    andrin2020

    Joined:
    Mar 9, 2014
    Posts:
    29
    @reuno. I love the new ProximityManager class. I am wondering if there is a way to add objects to the Manger that are instantiated at runtime. The ProximityManager gathers all the managed objects in the Start() function so objects instantiated during gameplay will not be added. Is the best option to extend the Manager class to have a AddManagedObject() method with a custom MMEvent to trigger it? Would this create any downstream problems that I need to be aware of?
     
  11. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @andrin_man > Such a method is actually part of the next release :) But yeah in the meantime you can add one, there are no downstream problems with that :)
     
    Boom_Shaka likes this.
  12. jim00

    jim00

    Joined:
    Feb 1, 2015
    Posts:
    57
    I found a script about KillPlayerOnTouch, how do it extend it to damage enemy or npc on touch?
    thanks
     
  13. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @jim00 > No need to extend anything, damage, health and weapons are already (thankfully) built-in.
    I'd recommend reading the documentation to learn how it all works, or you can use the aptly named DamageOnTouch class.
     
    jim00 likes this.
  14. kundabufferr

    kundabufferr

    Joined:
    Nov 1, 2018
    Posts:
    3
    Hey. I really like CorgiEngine. But I am new to this.
    How to achieve the effect - when I enter the zone of influence, the animation I set is triggered (enemies appear, platforms move)?
     

    Attached Files:

  15. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @kundabufferr > The ButtonActivated class lets you trigger events on entry (among other classes). That's if you want advanced options. For stuff that simple, a simple collision detection might be enough though.
     
  16. kundabufferr

    kundabufferr

    Joined:
    Nov 1, 2018
    Posts:
    3
    Thanks for your reply! As far as I understand, this can be done using standard means. I'm new to this, where can I see an example of how this is done?
     
  17. kundabufferr

    kundabufferr

    Joined:
    Nov 1, 2018
    Posts:
    3
    I made an animation, but how do I activate it now when I hit the zone?
     

    Attached Files:

  18. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @kundabufferr > I suppose Unity's animation documentation would be a good starting point. That's not really a corgi engine related question, I don't have a specific link to give you.
     
  19. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    @reuno quick question. How do I combine the proximity manager with tile map?

    thanks for your time!
     
  20. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Sofiel > Combine? I'm not sure what you mean, could you clarify? One is a tilemap system, the other disables objects as you get away from them. If you mean "disabling individual tiles as you go away from them", I wouldn't recommend that using Unity's native tilemap implementation, performance is terrible, it's not designed for that.
     
  21. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    Got it. Thanks!
     
    reuno likes this.
  22. Veritas

    Veritas

    Joined:
    Mar 18, 2014
    Posts:
    14
    I added a random state picker to the AI brain pretty easily (for my purposes):

    in AIState.cs, where `RandomTrueStates` is just a list of strings:
    Code (CSharp):
    1.          
    2.          if (Transitions[i].Decision.Decide()) {
    3.             int count = Transitions[i].RandomTrueStates.Count;
    4.             if (count > 0) {
    5.               int random = Random.Range(0, count);
    6.               _brain.TransitionToState(Transitions[i].RandomTrueStates[random]);
    7.             } else if (!string.IsNullOrEmpty(Transitions[i].TrueState)) {
    8.               _brain.TransitionToState(Transitions[i].TrueState);
    9.             }
    10.           } else {
    11.             if (!string.IsNullOrEmpty(Transitions[i].FalseState)) {
    12.               _brain.TransitionToState(Transitions[i].FalseState);
    13.             }
    14.           }
    15.  
    Obviously better ways to do this, but needed it so this works in a pinch!
     
    Boom_Shaka, reuno and Bhanshee00 like this.
  23. Emphy

    Emphy

    Joined:
    Feb 7, 2014
    Posts:
    33
    This might be a weird question, but I always wanted to make an 'endless' mobile game. So, you have a screen with a character that fights of waves of enemies that keep getting stronger. I'm not afraid to code but I was thinking: could I use Corgi Engine for this? I'm interested in the AI for enemies, level selection, feedbacks, UI stuff. All that is already in Corgi. I just don't really need any of the character controls, I just have static characters with weapons you can upgrade.

    Does that make any sense? To abuse Corgi for a non-platformer? Sorry, kinda broad :)
     
  24. andrin2020

    andrin2020

    Joined:
    Mar 9, 2014
    Posts:
    29
    I have a quick question for you regarding the AIBrain. Is the List: States guaranteed to always be in the same order as the inspector? For example: Will the state on top of the list in the inspector always be at index[0] in States? So far in testing it has been but I can not find where the list is generated in the code to confirm it.

    I am hoping to leverage this to help reset the AI for each character in the scene on level reset .

    Thanks.
     
  25. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Emphy > That's possible, yes, everyting is :) But the parts you mention, especially level selection and UI, really aren't the "hardest" parts of the engine, so it may be easier to just start from scratch, if you're not interested in the core of the engine (platforming).
    @andrin_man > It should always be the same order, yes. That said, I'd recommend not relying on the order (as a general rule). You can get the States from your AIBrain, and check their State Name for example. That's more reliable.
     
  26. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60

    Sorry to go at it again. I’m working with the tilemap and it’s a fairly large level. I used the proximity manager to disable all the enemies in the level but I still get between 15 and 18 FPS. Would I be better of making all the platform portion of the level one big png and adding a collider to it? The level is similar in size to this SMW level. Thanks again @reuno
     

    Attached Files:

  27. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Sofiel > That's not really an engine question anymore :)
    I don't think one big png would be better. But a custom tilemap system, instead of Unity's relatively slow one, could maybe improve things.
     
  28. Emphy

    Emphy

    Joined:
    Feb 7, 2014
    Posts:
    33
    I suppose. But I also would like to use the mechanics of moving platforms, mmfeedback, the AI states, etc. I just won't be using all the character abilities and not the checkpoint system. Most stuff is kinda useful, kind of like a platformer that is standing still if you will ;) Even the whole system with level stars and unlocking is what I need :) There's just no real player control and there will be no gravity in place. Think of Plants vs Zombies 2, I guess.
     
  29. Sofiel

    Sofiel

    Joined:
    Aug 6, 2017
    Posts:
    60
    Awesome! Thanks @reuno
     
    reuno likes this.
  30. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Emphy > It's hard to take that decision for you. I usually don't recommend trying to bend a tool into something else. I definitely wouldn't recommend using the Corgi Engine to create a game like Plants vs Zombies 2, that's not the same genre, not the same 3Cs, that's not the same core logic, there's almost nothing in common. Using the engine for that would make the whole development experience more complex. Instead I'd suggest picking the right tool for the right job.
     
  31. Emphy

    Emphy

    Joined:
    Feb 7, 2014
    Posts:
    33
    Agree, does sound like bringing a hammer when you want to chop down a tree ;) Thanks for thinking with me here. But I WILL make a platform game with Corgi at one stage ;)
     
    reuno likes this.
  32. ViperBoy

    ViperBoy

    Joined:
    Mar 27, 2020
    Posts:
    7
    This might be more of general unity question. But how would you optimize our unity project to fit on various different device, for example iPhone and iPad? Does the engine have anything to handle this? Is there is sample way to do this? Thanks.
     
  33. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    130
    @reuno In your inventory engine...

    Each item is a separate instance of the base item, right?

    If I want for example to setup random properties on pickup (+3 str, +2 def, random colors, etc) will those stay in the item instance itself? If I pickup a sword with +3 str, for example, then I drop it and pick it back, I want it to keep the +3 str. If I pick up *another* sword, I want it to have a different attribute, +5 str, for example.

    So, where do I set that up? Directly on the ItemDefinition scriptobject? Is there a class I can override (for example something like onCreate() )?

    Also, final question, is it possible to directly add the item into a player's inventory? I don't do "Pick Ups" in my game, Enemies drop items Final Fantasy style, not Zelda style. Which mean you get a screen blah blah 20 gold 1 potion 40 exp, instead of having a prefab spawn on the world. So I basically want the random properties to fire when the item is created/added to the player inventory and persist per-item.
     
  34. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @ViperBoy > That's indeed a generic Unity question, nothing specific to the engine. There are various strategies you can employ, depending on what you're after. It ranges from pixel perfect approaches, to zoom, to black bars, forced ratios, etc.
    @Creiz > Items are scriptable objects, if you modify the definition, you'll modify them all. What you describe is not a feature of the engine, but the way it's usually done is that you either create a new version of it, or you store that data on whatever "gets" the object (a character, a chest, etc). Alternatively, an extra child class could also handle this.
    And yes, thankfully you can directly add stuff to the inventory :) There's an Inventory.AddItem method for that, and you can learn more about it and others in the API documentation. That's also how the pickers work (among other classes), if you want to look at examples of it in context.
     
  35. Creiz

    Creiz

    Joined:
    Jun 6, 2017
    Posts:
    130
    Thanks for the prompt answer!

    So basically you're telling me to save the "random data" of each item somewhere else, right? For ex. Take the Item ID, make a new Database, have that DB store the attributes of that specific item.

    But wait... Can we actually create an item at runtime? Let's say I create an "Leather Armor" Item with default attributes.

    Is it possible to somehow take that item, make a copy of it with a different ID and then have it randomize its attributes? At runtime?
     
  36. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Creiz > Yes, of course it's possible. Pretty much everything is :) You're describing two different options here though. Either you store the random data somewhere on your character, or you create an item at runtime. Both would be overkill, but it's up to you, both would work. Both at the same time too.
     
  37. SkyMan77

    SkyMan77

    Joined:
    Jan 15, 2018
    Posts:
    23
    Hi, i bought it time ago, and i have few questions. Unfortunately, i can't use my laptop for now, so i can't verify by myself.

    01. Does it have some kind of unlockable character Screen and transition? I mean, if a character beat for exemple 1-4, he unlocks Character B, then we can go to the Character Selection Screen, switching to Character B, and continue 1-5.

    02. Is it possible to make some clone of Flappy bird ? I saw there was an auto run/ walk feature, what about flying ?

    03. is it possible to change the world Map ?

    04. How does the multiplayer work, wifi or bluetooth ?

    Thanks for reading !!!
     
  38. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @SkyMan77 > 1. No
    2. Everything's possible, but this is a platformer asset. Using it to create a flappy bird clone would be a weird choice. I'd recommend the Infinite Runner Engine for that.
    3. Yes.
    4. Local only.
     
  39. Veritas

    Veritas

    Joined:
    Mar 18, 2014
    Posts:
    14
    Small bug: The AI brain doesn't call `OnEnterState` on start - This feels inconsistent. It should!
     
    reuno likes this.
  40. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Veritas > Indeed it should, thanks for mentioning this. If you find other bugs, please use the support form to report them, thanks!
    Edit : also it's fixed, drop me a line if you need the fix!
     
    Last edited: Sep 22, 2020
    Veritas likes this.
  41. DrNeko

    DrNeko

    Joined:
    Oct 5, 2012
    Posts:
    9
    Unity version: 2019.3.7f1
    Corgi Engine version: v6.5

    Hello @reuno
    I noticed the behavior of the moving platform changed between Corgi Engine 6.4 and Corgi Engine 6.5. When the character slides down a wall and the moving platform collides, it doesn't kill the character (although it sometimes cause the weird issue in platform-64.png). After upgrading to Corgi Engine 6.5, it kills the character (platform-65.png). Is there a way to not kill the character and instead just push the character (maybe force on/off it)? I couldn't find any document on the behavior change in the Corgi Engine Releases. Thank you.
     

    Attached Files:

  42. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @DrNeko > you can disable the newly added CharacterCrushDetection ability, which is responsible for the death of your character in this case. There is no change to the behaviour of the moving platforms themselves.
    You'll find that change in the release notes as usual, in fact it also gives its name to the update.
    upload_2020-9-23_8-41-8.png
     
  43. DrNeko

    DrNeko

    Joined:
    Oct 5, 2012
    Posts:
    9
    @reuno
    Thank you for the quick response! I was overlooking where to tweak and I was looking at the Inspector on the platform and not the character. I made the adjustment and the character no longer dies.

    However, I think I found a bug before I saw your response. Before I made any change and tested (and many crush deaths later), the character got push into the wall (in_wall.png). I made sure to revert all changes, and I was only able to reproduce this once. I don't know if this is expected. Thank you.
     

    Attached Files:

  44. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    If the issue persists, don't hesitate to use the support form to report it. If you can provide a bit more info on how I can reproduce this, I'll be happy to have a look.
     
  45. Bioman75

    Bioman75

    Joined:
    Oct 31, 2014
    Posts:
    92
    Hello, i'm very interested in buying this asset. It seems to have a lot of the features I want but I want to know if you can change "layers" like in Littlebigplanet?
     
  46. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @Bioman75 > No, you can't, it's a 2D gameplay, on one "layer", not 3D like LBP.
     
  47. dasbin

    dasbin

    Joined:
    Jan 14, 2012
    Posts:
    261
    Is it possible that CorgiController.SetForce() has some trouble dealing with fluctuating timescales?
    I've found inconsistent behaviour when setting a CorgiController's force on the frame that I send an MMTimeManager event to start lerping the timescale. The force will move the character very different (inconsistent) amounts.

    Context: A metroidvania "rooms" system where the player can jump up from one room into a room above them that they can't see. I add a force on this transition to "suck up" the player into the above room, and also pan the camera up to view the new room at the same time, and slow down time for a bit while the player is airborne so they can choose where to land better.
    But I have confirmed the SetVerticalForce value is being applied the same way every time, and yet it launches the player to wildly different heights each time. The behaviour becomes consistent if I don't change the timescale.

    EDIT: Nevermind, apparently I hadn't tested enough times with the timescale set to not change... it still occasionally happens even without the timescale change, so something else is going on that sometimes causes the SetForce to launch the player much higher than other times. It's weird because I'm printing to the log every time the force is applied, and it only applies a fixed amount, so it's very strange that a single application of the same force would ever result in very different movements to the character. Should note I'm also calling JumpStop() on the character before applying the force each time, so it's not the jump behaviour interacting with the added force in weird ways either.

    2nd EDIT: Figured it out. One must call ProcessAblity() after JumpStop() if additional forces are to be applied on the same frame. Sometimes my JumpStop() would get called before CharacterJump did its per-frame processing, sometimes after.
     
    Last edited: Sep 25, 2020
  48. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
  49. SacrificedSoul

    SacrificedSoul

    Joined:
    Mar 7, 2017
    Posts:
    3
    Thanks for the amazing engine. Though I am facing an issue and would like to know if you can help me with it. In my game, I need smooth curves for my platforms so I am using edge collider for platforms but there is a problem when I try to move my player character over the curved slope it falls down. If you can help me with how to fix this it will be a great help. PS: It usually falls down when trying to sprint.
     
  50. reuno

    reuno

    Joined:
    Sep 22, 2014
    Posts:
    4,923
    @SacrificedSoul > As explained in the documentation, platforms require box or polygon colliders, not edge colliders. I'd recommend using polygon colliders if you want more organic shapes. Note that most games tend to avoid very detailed curves, to improve performance. Doesn't mean that your visuals can't look very organic. The Ori games are a great example of that, and the engine will accomodate perfectly that sort of level design.
     
    SacrificedSoul likes this.