Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[20% off!] Core GameKit! Pooling / Spawning / Combat

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

  1. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Yes! Okay, awesome!
     
  2. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Okay, so the only irritating thing so far is that it wiped out all my items in LevelWaveSettings.
    And my Killables have to be reconfigured, it looks like. Is there a way to avoid this in the future?
     
  3. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Sorry about that! That is to be expected if you didn't make your own prefab for each Level Settings prefab in your Scenes. Because if you do not, then they are associated with the Level Settings prefab in the Core GameKit prefabs folder. So any time you upgrade, you will get wiped out. Same goes for any prefab in pretty much any plugin. If I made a window that Instantiates the prefab instead of you pulling it into the Scene, this problem would also go away. I'll see if I can do that in the next couple versions. Master Audio (our other plugin) does this and it's cool.

    So make your own Prefabs folder, and make an empty prefab for "Scene X LevelSettings" and drag the Level Settings prefab from Scene X into it, to break the connection to the Core GameKit folder one. Then upgrade. Generally I make a prefab of absolutely everything in my Scenes so that this doesn't happen. Also it allows more than one person to work on a Scene without conflicts if they are just modifying the prefabs and not adding new things to the Scene.

    Also, I advocate using source control such as SVN (free) so that when these sort of things happen, you can just roll back and not lose anything.
     
    Last edited: Jan 25, 2014
  4. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    64
    Hi there. So I'm having an odd issue with the TriggeredSpawner after updating to 3+. I've set it up as you can see in the image below and I'm getting some extreme framerate fluctuations.

    The Unity framerate goes all over the place from 700fps to 1200fps and my "real" framerate that I'm measuring in my code is showing about 19fps. But the moment I enter the trigger for the spawner, the enemies spawn and both the Unity framerate and my manual framerate stabilize at 60fps as they should've been from the start. I've tested this a dozen times including restarting Unity and other than the odd time or two, it happens consistently. Any ideas?

    $screenshot.png
     
  5. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Sorry, no I don't have any idea. That's pretty weird. There's code you can use to set a target framerate instead of just letting it go "however fast it can". Would you want to use something like that?

    You also can turn on VSync which does something similar.
     
  6. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    64
    I am aware of vsync but I'm not concerned with the framerate at the moment, my concern is that there seems to be something unstable going on with the TriggeredSpawner in the latest update since I've had no framerate issues until dropping in this spawner in tonight. And the fact that as soon as the enemies spawn my framerate instantly stabilizes would seem to indicate an issue with the component.

    If you don't think it's on your end then I'll just keep an eye on it and see if it returns after removing the TriggeredSpawner.
     
  7. JAMiller

    JAMiller

    Joined:
    Apr 2, 2009
    Posts:
    73
    I'm all up to date on 3.1.1, and decided to set up some waves (had been using Triggered the last few versions), but can't seem to add any waves! There is no plus button, only remove. I can add levels, but no waves. What am I missing?

    $4ZvzLYx.png

    Edit: Even after deleting the LevelSettings and starting from scratch with a new one from the included prefab, I cannot remove waves - but now I get a red del button. (Tried in a new scene as well)

    $6BiMB0K.png

    Edit2: Hmm... even after adding it to a blank new project, importing KillerWaves and creating a LevelSettingsWave there is no add waves, only delete...
     
    Last edited: Jan 25, 2014
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    I definitely don't think it has anything to do with the Triggered Spawner, and here's why. There are no Coroutines running in that script and only 1 Fixed Update routine. The Fixed update method returns after 2 lines of code if there's nothing spawning.

    i.e. There is *substantially less* code executing when nothing is spawning.

    Now I've been using Unity 2.5 years and I notice that every so often (usually a few times a day) I need to quit Unity and restart Unity to get normal framerates back. I'm not sure why that is, and that's even when I'm not using our own plugins.
     
    Last edited: Jan 25, 2014
  9. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    That may have gotten screwed up in the V3.0 update. I'll fix this in the morning. Sorry about that!
     
  10. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    64
    Thanks for clarifying. That definitely makes sense and that's why I thought it was so strange. I was looking at the profiler and TriggeredSpawner was consistently at a near non-existent CPU usage level. That being said, I may have found the issue. Within the TriggeredSpawner's collider I had an environment object that had a collider but was static and not supposed to be triggering the spawner. But after updating the layer collision matrix I'm not seeing the issue any longer.

    The part that was odd was that prior to updating I had it set up exactly the same but there was no issue. Ah well, that's the fun of game development! ;)
     
  11. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Haha, yeah those sorts of issues keep our brains awake! Hope to see you at the next Seattle Unity user group :)
     
  12. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Ok, it was a quick fix. I've submitted hotfix version 3.1.2 and it will be live in a couple minutes. The plus icons have returned!
     
  13. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    I felt bad about this so I went ahead and did the following the LevelWaveSettings prefab when you select it in Project View.

    $Capture.PNG

    So now, you do not need to create a prefab of the LevelWaveSettings in your Scene to avoid losing data when upgrading. You just need to *not* drag this prefab into the Scene to create one. Instead, click that button! I also updated the readme to make this clear. I hope that helps and sorry for not making this clear before - I actually never had it happen to me due to my excessive prefabbing behavior.

    I've submitted V3.1.4 and it is now live. You shouldn't have this problem any more once you create your LevelWaveSettings this way.
     
    Last edited: Jan 25, 2014
  14. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    85
    Jerotas, music addes to Asset is royality free?

    Btw: starting position of level wave settings is off from 0,0,0

    Not visible too long on child object doesnt work for me
    -now when i start off screen it dissapears even when it goes via svreen at some point, countdown start fron instantiation, not from enering scene(i think this is how it worked before).
    - when I instantiate on screen and go off screen - it doesnt destroy.
    Also in pool boss there are some leftovers.
     
    Last edited: Jan 25, 2014
  15. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    The music is not royalty free, that's from my 2013 CD.

    I'll take a look at the other issues tomorrow sometime. Thanks for letting me know.
     
  16. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    85
    Also when I instantiate on screen and go off screen - it doesnt destroy. (dont know did you read edit)


    Also pool boss makes a lot of problem when depsawning shot and ect.
    The Transform 'Bolt(Clone)' passed to Despawn is not in the Pool Boss. Not despawning.
    UnityEngine.Debug:LogError(Object)
    I even putted bolt to Pool Boss - it doesnt help.
    Also after the wave is finished I can no long detroy Enemy.

    :(
     
    Last edited: Jan 25, 2014
  17. JAMiller

    JAMiller

    Joined:
    Apr 2, 2009
    Posts:
    73
    Hey, cool, it seems to work just fine with this update! To my surprise, after creating one with that button it even repaired my existing LevelWaveSettings (which is no longer a prefab in DarkTonic\...) !

    Thanks for the update!
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    I will redo the Killable Child Visibility script tomorrow. I think I did it wrong.
    If you have the word "(Clone)" in your prefab, that's right, they won't despawn from Pool Boss - the name needs to be the same as the item in Pool Boss. Now how did you end up with the word "(Clone)" in your prefab? That doesn't happen to me. Pool Boss renames it after spawning to get rid of the Clone word. Was there a script error during Pool Boss spawning? Did you Instantiate it into the Scene yourself instead of using SpawnUtililty or a Core GameKit Spawner?
     
    Last edited: Jan 26, 2014
  19. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    What do you mean by leftovers? I see nothing in my Pool Boss when I create LevelWaveSettings from the new button. Totally empty.
     
  20. ChrisMaster

    ChrisMaster

    Joined:
    Dec 27, 2013
    Posts:
    85
    Clone is instatitated from another scipt - not your asset.
     
  21. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Actually this will be a problem if they're Instantiated from another script. Even if we make Pool Boss despawn them into the Pool Boss prefab, they will never be respawned from there. What will need to be done for Pool Boss to work properly is we need to change the code in your script or other plug so that it uses SpawnUtility.cs (Pool Boss).

    What plugin or script are you using to Instantiate? If it's your own script, make sure you're using the SpawnUtility.Spawn method instead of Instantiating.
     
  22. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Ahh! Thank you so much! Gestures like this are making learning Unity so awesome! I also find it very easy to recommend your plug-ins to my friends. I think I've sold 4 people on both your products, since I found out about them!
     
  23. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Well then, thank you very much! Let us know if you have any other problems!
     
  24. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    The insanity sale is over! Welcome to our hundreds of new users! Currently we are setting the price back to 50% off of the normal $60 price, at $30 as a special introductory sale while we build up more reviews and features. That is the same price as another Pooling system plugin, but with Core GameKit you get full combat, spawning, stats manipulation, and tons more! All with zero coding on your end. Still a great deal for sure!
     
  25. dev_2051

    dev_2051

    Joined:
    Jul 25, 2013
    Posts:
    88
    Today i was trying to achieve combination of Layer Filters and Tag Filters in triggered spawners.
    e.g. Trigger a enemy wave only when layer ="Player" and tag="Type1".But somehow this does not seem to trigger the spawners.
    So just wanted to confirm does Trigger spawners support using combination of layer and tag filters?

    Also the new update resets the prefab pools count too.It reset all levels prefab pools to count 1.Had to redo all the prefab pools again :(:(
     
  26. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Sorry to hear that. Yes it does support both layer and tag filters at the same time. It worked in my tests. Do you have a tiny project you could send me that reproduces the problem?

    As Chibwemwn and I were talking about on the previous page, you will keep having parts of your LevelWaveSettings prefabs cleared out every time time you update, until you do one of two things.

    1) Make your own prefab out of each LevelSettings

    or

    2) Start over and use the button I added to Instantiate that prefab in the Scene instead of dragging it into the Scene.

    Making a copy by dragging the prefab in - you still have a connection to the prefab in the Core GameKit folder. That's a bad thing. When that one gets updated by you downloading the newest version, it will affect all copies you have of it.

    But not if you do one of the two things above. I have modified the readme to make this clear as well.
     
  27. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Core GameKit V3.1.5 is submitted and live. Changeset:

    • Instantiating LevelWaveSettings prefab now places it at World position 0,0,0.
    • Refixed Killable Child Visibility.
     
  28. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Fixed the starting position of LevelWaveSettings and I actually reverted back to the old Killable Child Visibility because I got it to work with both the invisible despawn and the "not visible too long" settings. It works. We don't need a settings for "not visible too long" on the Killable Child. It uses the setting on the parent Killable.

    Let me know if you still have problems with the latest, it works for me!
     
  29. dev_2051

    dev_2051

    Joined:
    Jul 25, 2013
    Posts:
    88
    Got the triggered spawners working problem was happening due to collider matrix.
    Thanks for these suggestions will surely implement them to remain future safe :)
     
  30. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    38
    Is there any way to restart a wave via script?

    When the player dies mid-wave, I'd like to trigger the current wave to restart.
     
  31. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Cool, no problem.
     
  32. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Not yet. Let me see if I can add that in the next version or 2.
     
  33. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    I just updated, and I got these errors. How can I fix these?

    $Screen shot 2014-01-27 at 1.30.54 PM.png
     
  34. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Delete that file (KillableChildVisibilityInspector). There's no way for me to make the package do that. I forgot to put that in breaking changes. I'll put it there tonight.
     
  35. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Okay cool, that fixed it. Thanks.
     
  36. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    I'm just going to fix that Inspector instead of making people remove it. Even though we don't really need it right now. Will submit a hotfix.
     
  37. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Hotfix for missing / incorrect Inspector submitted, V 3.1.5.1, will be live in 5 minutes.
     
  38. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    $Screen shot 2014-01-28 at 1.14.49 AM.png $Screen shot 2014-01-28 at 1.14.49 AM.png

    I'm getting this error when Killables interact. What does it mean?

    Edit:
    I can't seem to attach an image.
    but these are the errors:

    NullReferenceException: Object reference not set to an instance of an object
    PlayMakerUnity2DProxy.OnTriggerEnter2D (UnityEngine.Collider2D coll) (at Assets/Assets/PlayMaker Unity 2D/Components/PlayMakerUnity2DProxy.cs:159)

    NullReferenceException: Object reference not set to an instance of an object
    Killable.TriggerEnter2D (UnityEngine.Collider2D other) (at Assets/Assets/DarkTonic/CoreGameKit/Scripts/Utility/Killable.cs:384)
    Killable.OnTriggerEnter2D (UnityEngine.Collider2D other) (at Assets/Assets/DarkTonic/CoreGameKit/Scripts/Utility/Killable.cs:380)
     
    Last edited: Jan 28, 2014
  39. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    I don't know. That's a Playmaker error. You may have to send me a reproduceable example for this one.
     
  40. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    It looks like PlayMaker and CoreGame Kit are fighting over which 2D collision system to use. I need both of them. CoreGame Kit for Killables, and PlayMaker for effects like screen shake and other things that are dependent on object collisions/interactions. This issue wasn't there in the 2.x versions. I wonder what's causing this now. The damage prefabs aren't even being made when the player is hit by the enemy ammo. Any ideas?
     
  41. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    No idea. And I don't know how to use Playmaker with 2d stuff. You are going to have to send me a small project to reproduce this one.
     
  42. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Okay so, what's happening now is that some objects are working consistently with the killables, while others are working only half the time.
    How would I send you the project, by the way?
     
  43. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Use filemail.com, it's free. You'd need to zip the whole thing up. Don't include the Library folder, that's huge and unneeded. Send to support@darktonic.com

    Thanks!
     
  44. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    I've sent the project, it's under Anonymous. I had no idea it would do that, but the title is "Unity Project to Reproduce Error."
    I hope it helps!
     
  45. supericon

    supericon

    Joined:
    Feb 15, 2013
    Posts:
    38
    k. Thanks Brian.
     
  46. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    I'll see if I can take a look tonight. Can you also send me an email telling me how to make the error happen? Downloading now.
     
  47. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Just try to shoot an enemy. The controls are arrows to move, Space/X to fire, and Z to dash.
     
  48. Vaupell

    Vaupell

    Joined:
    Dec 2, 2013
    Posts:
    175
    Pre-buy question.

    I've got almost a entire game frame setup, and everything is ready to go.
    However, i need to spawn waves, bosses and pickups.

    All my prefabs are allready setup with health, dmg, and death/score registration with a homemade GameController.

    Now my question,,

    Can I use "killerWaves" in such a way it will only control the following things

    - Spawning of waves
    - Enemies weapon fire
    - Boss spawning and weapong fire

    and nothing else ?
     
  49. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,130
    Sure. What you want to use it for has been possible since V1.4 :) You will want to use the "Prefab Pools" feature to spawn waves of not just a single enemy type. Also, Pool Boss will be used automatically for spawning and despawning everything. If you want to use Pool Manager (if you're already using it), you can do that. Or just set up these things in Pool Boss.

    In your next game, you may wish to use more of the other features so you don't have to code them all.
     
  50. Chibwemwn

    Chibwemwn

    Joined:
    Feb 6, 2013
    Posts:
    129
    Hey, so did you have a chance to check out the project I sent you?
     
unityunity