Search Unity

Core GameKit! Pooling / Spawning / Combat

Discussion in 'Assets and Asset Store' started by jerotas, Jan 27, 2013.

  1. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    This kit has been used for 3rd person shooters, space games, tower defense and much more. Something like double dragon, I'm not sure how you could make it work right. Primarily in those types of games, you need to know who is doing the attacking so that your player doesn't lose hit points even when attacking an enemy. There's nothing out of the box to make that happen. You could add a tiny bit of code to make your player invincible while attacking or something. The invincible checkbox is already there in the Killable. That might work.
     
  2. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    You could use triggered spawners, to spawn enemies as you wish. It's highly customizable. All you have to do is play around with something small to see how many ways you can use the many tools the kit has.
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Hey Chibwemwn, I'm going to need to know how your player prefab is made up. I know you have more than one Killable in it. Is it a prefab with several Killables under it (which can be destroyed independently), but the top-level prefab does not have a Killable? So maybe when you lose all your arms and legs the game is over?

    I'm not sure how you want it to work.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit V3.2.1 will be live in 5 minutes. Changelog:

    • Added "mouseDown" despawn trigger to Killables.
    • Added "Invincible On Spawn" checkbox to Killable and "Invincible Time" setting under that. Now you can make Killables not take any damage for X seconds when they first spawn.
    • Added method: Killable.TemporaryInvincibility(float seconds) to make the Killable invincible for X seconds. You could use this for a fighting game and make the character invincible during the first part of their attack. Also created a Playmaker Custom Action to do this.
    • Added "Auto start waves" checkbox to LevelSettings. Defaults to on. If you uncheck it, the first wave won't start (technically it's paused), until you call LevelSettings.UnpauseWave();
     
  5. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    So you got the first part right, the parts of the player prefab have their killables, but the main prefab also has a killable itself.
     
  6. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok. Ideally how should it work? Do you ever respawn the destroyed parts by themselves to re-attach or anything?
     
  7. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    I was hoping to have the parts respawn, as the player got more hp.
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, I'll see if I can make Pool Boss work for that part for the next update. Thanks!
     
  9. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Nice! Thanks.
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well I was trying to reproduce the error on my Unity 4.3 today and I could not. I made a Killable player, and put 2 mini-killable Players as sub-prefabs. Whether I killed the mini's first or not, I got no error. The mini was put into Pool Boss fine. So I will need some repro steps for your error so I can know how to reproduce it. No problems on my end so far.
     
  11. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    Brilliant - thanks Brian :)
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Any time :)
     
  13. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    63
    Hi Brian

    Wanted to run an issue by you - we had problems in that it wasn't despawning. My coder said the following:

    "the problem is that in this loop below (LevelSettings.cs) as far as I can tell it only looks at the 1st object.
    despawning doesn't seem to remove it from the spawnditems list,

    adding this

    RemoveWaveSpawnedItem(spawnedItemsRemaining[0]);

    to the line after
    SpawnUtility.Despawn(spawnedItemsRemaining[0]);

    in the code below seems to fix it"



    // destroy spawns from current wave if any
    var restartMode = LevelSettings.Instance.waveRestartMode;
    if (restartMode != WaveRestartBehavior.LeaveSpawned) {
    var i = spawnedItemsRemaining.Count + 1;

    while (spawnedItemsRemaining.Count > 0) {
    var item = spawnedItemsRemaining[0];
    Killable maybeKillable = null;
    if (LevelSettings.Instance.waveRestartMode == WaveRestartBehavior.DestroySpawned) {
    maybeKillable = item.GetComponent<Killable>();
    }

    if (maybeKillable != null) {
    maybeKillable.DestroyKillable();
    } else {

    SpawnUtility.Despawn(spawnedItemsRemaining[0]);

    }

    i--;
    if (i < 0) {
    break; // just in case. Don't want endless loops.
    }
    }
    }
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It does look that way, but it works on my computer. I think it somehow automatically gets removed from the list when I call Despawn. Please let me know your repro steps and what issue exactly you're seeing.

    I don't have a problem adding that line if you see no ill effects. Let me know.
     
    Last edited: Feb 25, 2014
  15. tyrion

    tyrion

    Joined:
    Aug 8, 2013
    Posts:
    4
    I can't seem to see the killer waves lite/free anywhere. Has it been removed?
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Yes, there is no longer a free version as of v3.0. By the way, the product has been renamed to "Core GameKit". We simply don't have the time to maintain separate free versions of our plugins any more, and we don't want to put such an old free version out there. I can send you a quite old Killer Waves Lite if you want to try something in particular out though. Just email support@darktonic.com. However it doesn't have any of the v3.0 features.

    However, Core GameKit is only $15 right now (75% off). Might as well pick it up while it's on a huge sale! It now includes full pooling (like Pool Manager, which is $30 alone).
     
    Last edited: Feb 25, 2014
  17. tyrion

    tyrion

    Joined:
    Aug 8, 2013
    Posts:
    4
    I will appreciate it if you send me the old free version so I can see how it's like before purchase. I have made some poor purchases before.
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I will send it when I get home tonight. I don't think you should be afraid in our particular case though since we have 60+ reviews and a 5 star average rating (and our other plugin has 104 reviews and 5 stars). I doubt that was the case on your other bad purchases. We have made some bad purchases before as well though.

    Thanks,
    Brian
     
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit v3.2.1.1 will be live in 5 minutes. Changelog:

    • Added new Killable HP Death Mode "Collision or Trigger". This will cause the Killable to be destroyed even when invincible when it hits things. Useful for projectiles so they don't go through objects if they're both invincible and triggers.
    • Fixed bug where Killable would instantly die on spawn if not spawned from a spawner when "if spawner destroyed" set to destroy or die. This no longer happens.
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Core GameKit users, I have a question that I hope someone can answer. It happens when using Mechanim in combination with Pool Manager. I assume it will break just the same with our PoolBoss pooling system. Please take a look at this thread. The problem is very simple, but I just can't figure out how to make it work. It really seems like a bug, but I can't believe that it is a bug since Mechanim is way past beta and this is a pretty simple scenario.

    http://forum.unity3d.com/threads/231731-When-respawning-why-doesn-t-Animator-Play-work
     
  21. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    Hey i havnt bought this yet but i'm looking into it. i generally work on 3D action games and i'm just wondering if there is hitboxing in this or if there is an easy way i could add hitboxing(run a command to deal damage to a given enemy or area of enemies). also might be good to know how enemy control works. just the traditional program the control yourself or are there specific gatcha's i should be aware of?
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    What do you mean by enemy control? How the enemies move? That's completely up to you if so. We provide only the most basic movement scripts for demo scene purposes and nothing outside of that.

    Hitboxing - damage to a specific enemy is easy and supported. Damage to an area of enemies is not. You would have to get a list of them from the spawner and read their positions to do that.
     
  23. Cynicat

    Cynicat

    Joined:
    Jun 12, 2013
    Posts:
    290
    thanks. that helps a bunch. can use this for health management! also can i say holy S*** the stuff on the asset store is getting really good! Dialoguer, Playmaker, ShaderForge, Energy Bar Toolkit and This. not to mention the free stuff. ill get back to you on my experience with the product. have a nice day!
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you sir! Stay in touch.
     
  25. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Hi Jerotas,
    question, what would you suggest for mobile game - space shooter:

    I am wondering, should I create separate scenes for each level? (each level for about 5-10 waves, each wave for 10-80 units).

    or one game level with serveral levels in level waves settings (and when loading a main level scene from a map, use LevelSettings.CurrentLevelWave 2.2 for example)

    The question is optimasation and (pool boss).

    I am planing to have about 20 levels total.
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Either way is fine. If you don't want to have a huge Pool Boss (with 50 items or whatever) then do separate Scenes. I myself don't mind have a huge Pool Boss.
     
  27. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Will large pool boss (50 types with 10-50 pcs) have any impact on perfomance? As I understand pool boss is preloading of assets so fps wont go down, but how does it impact on performance in your expirience??

    Thanks in advance.
    KZ
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No. You may have a few extra milliseconds of level load time at the very beginning of the level. That's about it.
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Unity QA has replied to my email and said this issue is fixed and will be in the next version :)
     
  31. XilenceX

    XilenceX

    Joined:
    Jun 16, 2013
    Posts:
    122
    I've been using this asset for a while now and things have been going really smoothly, as it does almost everything I need out of the box.
    There is one functionality I haven't found yet though. How do I reset the Waves back to 0 and remove any remaining monsters?
    When the player is killed in my game mode they are presented with a scoreboard and then they start over again.
    So far I have been able to control almost everything via Playmaker (the support for it is awesome btw.) but I couldn't find an action or setting for this situation yet. So if you have a simple way to do this please let me know!
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    So you're using the global waves? What we do in our game for that scenario is just reload the level:

    Code (csharp):
    1.  
    2. Application.LoadLevel(1);
    for example. Would that work in your scenario? There's probably a Playmaker custom action for that. In order to get this to work our main menu scene has you choose your setup, then we load the "game level", where you start playing immediately when the scene is loaded.
     
  33. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    87
    Thanks!
     
  34. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    Such fun to play with. I just easily integrated this with a RAIN demo (from RivalTheory) and had some AI destroying each other (destroying because I used the PlanetExplosion prefab). All I had to do was add in some colliders and triggers then follow the Doc and done. Very nice.
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Killer! Is that the free Rain (Rain Indie) or the paid one? If it's the free one, I wonder if we could get their permission to use it in the demos scenes...
     
  36. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
    They only have 1 Rain now. Check it out. It's free. It's called RAIN 2.0.10, but I think everyone just calls it RAIN.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Cool. I'm wondering what kind of AI you have going on in your example Scene? Let me know.
     
  38. 99thmonkey

    99thmonkey

    Joined:
    Aug 10, 2012
    Posts:
    525
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
  40. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    jerotas, I am back to use Core GameKit and just last night went through your PDF doc.
    Great doc, covers all to get back into it, and lovely to see all those very useful addition to what was Killer Waves first iteration :)

    great job
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you sir!
     
  42. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    Hi jerotas! I have been used Core Gamekit for my iOs game for a while and enjoyed! Thanks!
    I do have a question about Timed Wave. Sometimes I found that if player's level is high and killed all enemies of the wave, they will need to wait for a long while.
    Is that any easy way to end the timed wave if all spawned enemies are killed before the end of this timed wave please? Is it possible to get the list of spawned or check if all spawned enemies of the wave via script?
    Thanks.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Then you should probably just use elimination waves instead of timed. Those automatically go to the next waves when everything is killed.
    Or you can turn on "wave repeat" per spawner in the timed wave, and it will continue to spawn new enemies if they kill everything early, until the time expires.
     
  44. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    I see. We were using Elimination before, but we hope to push our player a bit more. It will be nice if there is a feature to start next wave earlier if certain percent of enemies has been killed/despawned. :)
    I will try to see what can I do to achieve this with you advice. Thank you.
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Hmmm, explain why you switched from elimination waves? There may be a better way to use this plugin depending on your answer.
    By the way, you can always end the wave at any time by calling LevelSettings.EndWave(). There isn't a method to tell you what percent of spawned objects are destroyed, but you could use World Variable values to determine that possibly.
     
  46. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    Our game is a hack slash style game (something like Diablo?) with waves. Each mission has certain waves player needs to complete. Our problem when using elimination wave was .... let say a wave with 10 enemies but player killed 9 of them, then player can run and escape from the remaining one easily and possibly kill this one with ranged weapon without pressure. Yet, this is not we want so we hope to start next wave earlier if 90% of enemies of this wave are killed.

    Yes, I am looking at LevelSettings.EndWave() and see if I can call it from my script somehow.
     
  47. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok, if we need to try and add a "wave completed percentage" so you can change it from 100% to another number, we could put that down as a possible future feature, if you don't see any other way to do what you want.
     
  48. gshape

    gshape

    Joined:
    Aug 8, 2012
    Posts:
    104
    Thanks Jerotas! Thanks for your wonderful support and great product! :)
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Well let you know if you'll need that feature or not after you're doing trying other things. And good luck :)
     
  50. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    A wave percentage could actually be useful in other situations too. So maybe a worthy feature to consider adding