Search Unity

Core GameKit! Pooling / Spawning / Combat

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

  1. g0tNoodles

    g0tNoodles

    Joined:
    Nov 28, 2010
    Posts:
    193
    Hello, with regards to making a TD game; how can I control if the user would like to skip the countdown timer and release the next wave of objects? In most TD games they have a button that allows this to happen. Where is the code for the timer and would messing about with it have a negative impact on the functionality of the spawners?

    Cheers
     
  2. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Is there a reason you wouldn't use elimination waves instead of timed? If you want to delay the next wave, there is a delay wave start setting, but currently no way to change that dynamically. I would set that to a very short interval like 1-2 seconds probably.
     
  3. g0tNoodles

    g0tNoodles

    Joined:
    Nov 28, 2010
    Posts:
    193
    I am using elimination waves and have 5 seconds set before each wave is released. However, I am looking to make this game for people with disabilities and they may not have the ability to quickly place turrets during this 5 second period if they have some for motor, visual or learning disability. Also, setting it to something higher like 10 seconds would make the game way too slow for people who have no problems with speed.

    Like I say, in many TD games I have played, after a wave ends and another begins the countdown is used for the player to place turrets but if they cannot for whatever reason, be-it not enough gold or not enough spaces left, you can skip the time and allow the waves to be released early.
     
  4. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok g0tNoodles, thank you for the explanation. I will see if that's doable in the next release. It sounds like a good feature. Will update you when I have a moment to proof-of-concept this!
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sorry, but I'm removing this from the feature backlog because I don't think it will work:

    1) Option to have visible spawners not spawn anything (only when offscreen).

    The reason is that the functionality requires a mesh renderer to function, and we can't rely on spawners having a renderer. If anyone disagrees and sees a way for this to work, let me know :)
     
  6. Z43D

    Z43D

    Joined:
    Jan 2, 2013
    Posts:
    100
    Hey jerotas,

    Just happened to be browsing the forums and came across this. I'll probably end up using this system at some point in the future for sure. Don't have a need for it atm but it looks pretty awesome. Seems to be easy enough to implement.

    Btw, anybody ever tell you that you sound a bit like Keanu Reeves? lol
     
  7. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No, I've never heard that haha, but cool! Let me know what you think after you've had a chance to play with it. I do take feature requests (working on a couple of them tonight actually).
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Killer Waves V 2.3 has been submitted to the Asset Store. The changes are as follows:

    - Added limitations for random angle, to enable Fruit Ninja fruit style spawning of narrow random angles.
    - Added "EndWave" method for LevelSettings, to enable countdown abort for tower defense games.
    - Renamed all example scene scripts to avoid name collisions.

    Note that for the countdown timer you would actually use a separate Timed wave (with no spawners assigned to that wave) instead of a new wave delay start field on each wave. That's not the way I wanted to do it but the code is much much cleaner this way.
     
  9. g0tNoodles

    g0tNoodles

    Joined:
    Nov 28, 2010
    Posts:
    193
    As ever, great service and coms for this product. Cheers ^_^
     
  10. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Aaaaand, Killer Waves 2.3 is live! Go grab the updates!
     
  11. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    If you're a Killer Waves user, you have a few hundred buddies also using it, so don't be shy about asking questions or showing off your work here.

    In fact, we'd like to help you promote your game, even if you've only got some rough work in progress screenshots. PM me or Brian (jerotas), or email somethingkiller@darktonic.com and let us know what you're cooking up!
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Killer Waves is now having a half off sale for a mere $20! Pick it up on the cheap if you don't already have it after checking out the videos in the OP.
     
  13. MESBill

    MESBill

    Joined:
    Sep 16, 2012
    Posts:
    13
    Hi there,

    Awesome plugin this is. I tried out your free version once and immediately bought the full version! Now I really can get waves of enemies done in no time.

    I do have a question though (sorry if it is silly, still a new Unity3D developer).

    Lets say I have 10 waves, and all are of elimination type with a range of spawners each (no fixed amount of enemies). How can I trigger an event to show the "level complete" stuff once every spawned object from the final wave is destroyed?

    Thanks for your help.

    Cheers!
    -Bill
     
  14. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thank you MESBill, we find the plugin quite useful ourselves. It sounds like you want some code to fire every time the wave is completed. So you'll want to use the LevelSettingsListener.cs script included in the "Scripts/Level" folder. There are a few steps.

    1) Put that script onto the GameObject in your Hierarchy that will "do something" when the current wave ends.
    2) Click on your LevelWaveSettings prefab in the current scene. Look in the Inspector pane. In the top section, there's a field called "Listener". Drag the prefab that you used in step 1 into that field.

    Now the events in LevelSettings will be communicated to the listener automatically during runtime. You'll now want to edit LevelSettingsListener.cs and add code to the events you want things to happen in. There is no "WaveEnded" but there are "Wave Started" and "Win". You should be able to prevent the WaveStarted code from showing the "wave completed" message by checking the wave number which is a content of the LevelWave variable passed to the listener. For the final wave completed event, you will use "Win".

    I hope that helps! At some point I will redo these listeners so that it's easier to make multiple versions of them for different scenes with a simple EventHandler .NET mechanism.
     
  15. MESBill

    MESBill

    Joined:
    Sep 16, 2012
    Posts:
    13
    Awesome! Got it to work... Thanks a bunch! Great support too!
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Good to hear MESBill. Let me know if you have any other questions. And make sure you watch all 4 videos if you haven't.
     
  17. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    HI,
    I picked this up recently and I'm just playing with it to see how it might be used.

    Is it possible to get more control and variation in the Spawn Limit Controls?
    Say add time based as well as randomization to a fixed amount for both time and distance.

    I also noticed (may be a bug or a feature) that span limit of distance goes a bit whacky if you check randomization as well.

    Another use case: How would I control wave spawning so that new elements are spawned only when an existing element is destroyed, either directly or indirectly?

    ty!
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Hi in Toyko! If you want to spawn 1 thing every 1 second for instance, you just set the "time to spawn all" equal to the "max to spawn" in the spawner. Let me know exactly what you'd like to do (something extra random) and I'll take a look at adding it. Are you saying you want to use a distance limit that's a random range of 30-50 instead of a fixed distance?

    Yes, the random location and distance limited don't work well together, because it's calculated from the spawner location. I'll add a note about that in the documentation. It may be fixed in a future version, I'll look at it.

    You use elimination waves (in Level Settings) to do the last part. You can do a spawner wave or 1 or more (turn repeat wave on), and the wave will be repeated when the entire wave is destroyed or despawned automatically, up to the point that the Level wave changes.

    I hope that helps!
     
    Last edited: Jul 17, 2013
  19. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    >>Are you saying you want to use a distance limit that's a random range of 30-50 instead of a fixed distance?

    Yes, the ability to randomize the distance range would be good, otherwise the patterns look too regular. I thought the randomization would do this, but as noted it doesn't.

    ty!
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    No problem, I will make an extra setting in the limiter section for the next update. I will post here when I submit to the Asset Store. Thanks!
     
  21. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
    Thanks!

    I'm also having some issue replicating your damage and destroying using Killable script.
    Take Example 1 for instance.
    Just focusing on the Enemies left spawner and the Level1 Wave 1 Enemy object.
    It has a killable script and also Projectile has a killable script.
    If I fire collision detection via both these scripts handles the hits and auto destruction + explosion prefab.

    I tried replacing the Enemy with one of my prefabs, added a killable script, but it seems as if the collisions are not getting detected.

    Am I missing something here? I'm just trying to understand the guts of your system before applying it to anything.

    ty!
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    It's probably something simple. You probably know (but I'll say it anyway) that for a "collision" to occur, both objects need to have colliders on them. They also both need to have Rigidbodies. And one of them needs to be a GRAVITY rigidbody. Your ship's weapon is a gravity rigidbody, so we're ok there. You could make your enemy a kinematic. Also, I set up all collisions for the scenes to use triggers instead of normal collisions. So make sure your collider has "is trigger" checked.

    If that's all looking ok and it still doesn't work, make sure the layer filter in the projectile isn't only registering collisions with a layer that your new enemy isn't in. If it is, change the enemy's layer.

    That should get it working. Let me know if you have any further problems.
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Just a quick post to say that the half price sale for Killer Waves is almost over. So make sure to grab it in the next day or so for 50% off!
     
  24. TheBrian 666

    TheBrian 666

    Joined:
    Jul 7, 2013
    Posts:
    2
    I just bought it after 2 weeks of using lite, its absolutely awesome, im having one problem which is i cant get a guitext for the number of waves..

    can anyone help me please..

    thanks
     
  25. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I'm always here to help. Are you saying you want to display a Gui Text for "Wave 2" etc? If so, add a WaveSettingsListener to the prefab with your Gui Text. Then drag it into the LevelWaveSettings prefab "listener" field in the Inspector. Lastly, inside WaveSettingsListener.cs, add code to "WaveStarted" to read the wave number from the LevelWave object and populate the Gui Text. That should do it.

    If I misunderstood the question, let me know!
     
  26. TheBrian 666

    TheBrian 666

    Joined:
    Jul 7, 2013
    Posts:
    2

    yeah thats correct "wave: 1", "wave: 2", "wave: 3" ..etc..

    i cant find the waveSettingsListener though
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Sorry about that, I mistyped. It's LevelSettingsListener.cs, not waveSettingsListener. Video #4 in the OP shows most steps of how to use a listener for a World Variable, the steps are the same on each. I hope that helps.
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Hey everyone! I'm giving a heads up here, I'm going to update Killer Waves Lite very soon to include all the features of the full version, but the extra features will be limited, so you can try them out for free! However, this will mean that the source code is no longer supplied in the free version. It will be a DLL. So you won't be able to add your own modifications to Killer Waves Lite.

    You will soon have Spawn Pools, Triggered Spawners, Killable and World Variables!
     
  29. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Killer Waves 2.3.1 has been submitted to the Asset Store. Changes are as follows:

    1) Added random distance to the spawn distance limiter. Now you can specify a min distance that's a random range of 30-50 instead of a fixed distance for instance.
    2) Added extra settings to the repeat wave section. Now you can make the wave larger (or smaller) with each repeat. You can also make each wave "time to spawn all" shorter or longer.
     
  30. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Killer Waves v2.3.1 is live! Grab those updates!
     
  31. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
  32. ddfire

    ddfire

    Joined:
    Dec 22, 2010
    Posts:
    53
    Just got it... i will start asking questions soon :D
    ok first one... are you planning to release a playmaker addon? that will be amazing!!! your system do almost everything and connect to ngui and poolmanager... if you can make it to connect to playmaker it will be really easy to make a game with out a line of code!!!
    Thanks!
    David
     
  33. dark_tonic

    dark_tonic

    Joined:
    Mar 23, 2011
    Posts:
    138
    We are still planning on Playmaker support, just got real busy with other things for awhile. It will happen!
     
  34. gv

    gv

    Joined:
    Feb 22, 2013
    Posts:
    89
    purchased! :)
     
  35. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Excellent gv, let us know how you get on with it!
     
  36. SvenGee

    SvenGee

    Joined:
    Feb 8, 2013
    Posts:
    6
    Just bought too, based on good faith that Playmaker addon integration is coming soon ;) (but honestly, even without Playmaker integration the asset looks fantastic).

    Can't wait to get into it.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I can't estimate how long Playmaker integration will take, since I've never used it. But it is coming (and also coming for Master Audio, our other plugin)!
     
    Last edited: Aug 27, 2013
  38. SvenGee

    SvenGee

    Joined:
    Feb 8, 2013
    Posts:
    6
    My comment was more tongue-in-cheek, but thanks for the fast reply :)

    I'm still at work so I haven't been able to play with Killer Waves yet, but it looks like most of the functionality can very easily be used without Playmaker at all. I think mainly world variables and listeners would be the candidates for integration. If I get time to play with it in the next few days I'll post back.
     
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Here's the WorldVariableListener you would use instead of the one in the package if you want to use NGUI to display one: script here!
     
  40. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Hello KW users, one of you sent me an email letting me know that the way I coded the World Variables was causing occasional slowdown on mobile platform due to PlayerPrefs performance. So I have now redone the World Variable storage to not use PlayerPrefs but the "Player Prefs caching" open source solution they pointed me to online and now everything is over 100x faster and much more reliable in this area. This will be in the next release.

    Thank you for the suggestions and reports!
     
  41. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Great to hear about playmaker integration !!! can't live without it
     
  42. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    I very well may be saying the same thing after I get the hang of using it! Looking amazing so far.
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Killer Waves users that use Playmaker, I need your input! I just finished up making 19 Playmaker custom actions for our other plugin Master Audio, basically supporting everything you would code by hand. However for Killer Waves, it's not obvious to me which custom actions should be written. When we use Killer Waves, I need to write zero code and I think most / all of this functionality works as is with no custom actions, with or without Playmaker (i.e. no integration required per se).

    However if you use Playmaker maybe you can point me to specific custom actions you would like to see? Thank you!
     
  44. ddfire

    ddfire

    Joined:
    Dec 22, 2010
    Posts:
    53
    Hi
    I am not using kw yet.. i bougth it becoause i saw it was perfrct for a project i have in mind...
    The integration with playmaker will be something more oriented to the values and events more than the actions.
    Loke if is killed shot an event un the fsm... or be able to change the hitpoints and the power in playmaker at run time.. like upgrading the gun...
    Thanks!!!
     
  45. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Ok got it, kinda. You'd like a custom action for changing hit points and attack points for a Killable. I'll see what I can do there. Anything else?
     
  46. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Here's 2 custom actions for you, hot off the press! Download here or wait for the next update.

    I have:

    1) Killable Change Attack or Hit Points
    2) World Variable Change Value

    I am really at a loss as to what else I should make custom actions for. Playmaker users speak up please. These are pretty easy to make so far!
     
  47. WarHead

    WarHead

    Joined:
    Nov 15, 2012
    Posts:
    28
    I havent tried Playmaker with KW yet, but some cool actions would be...

    Player Spawner
    Enemies Left Counter
    Time Left For Wave
    Current Level
    Current Wave
    A way to call scenes at the end of a level before the next level begins (Im thinking of cut scenes here)
     
  48. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Except for the last one, you'd have to describe how each of those would work, I don't understand. Mostly they sound like variables, not actions. Except for Player Spawner and the last one.
     
  49. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    For Playmaker actions
    *It would be nice to see an action for spawn and despawn.
    *controlling the killer waves inspector variables in playmaker.
    *hide or activates / deactivates waves
    *change the direction of the waves after they already exist.

    Also would welcome some kind of flocking behaviour, follow a target and flock around this target.
    This could be cool for birds, fish , etc.
     
  50. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    The spawn and despawn action, how would that work? Since normally you only spawn (in particular) from a spawner in Killer Waves.

    The rest of your suggestions are things that aren't currently possible even *with code* in the plugin. First I would need to make things possible *with code*, then writing custom actions to actually use the code is trivial.

    So, you're not really asking for Playmaker actions per se haha, but new functionality. I'll see what I can do! The manipulation of Inspector values thing isn't as easy as it may seem. There are dozens of settings there, and they are only read when the Scene starts...