Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] SmartSpawn System

Discussion in 'Assets and Asset Store' started by GoGoGadget, Mar 27, 2014.

  1. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Quickly and easily create a fully customisable spawning system for your game!

    Now with dynamic wave spawning! Influence every wave & spawn-related variable with new wave spawning features and Influence Maps!

    SmartSpawn allows you to easily modify almost everything in relation to the spawning system - the chance for an object to spawn, the objects you want to spawn, the number and location of spawn positions, and more. This system also replaces any need for complex, hard-to-manage loot tables.With full Bolt, Photon, and Unity networking support, SmartSpawn is a production-tested solution to networked spawning as well.

    SmartSpawn on the Unity Asset Store

    Current version: 1.9
    • 1.9 Changelog:
      • -All new wave spawning functionality options, in Spawners & Influence Maps
      • -Improved features for Influence maps
      • -New Wave spawning demo scene
      • -Updated documentation
    Influence Maps update video
     
    Last edited: Oct 8, 2015
  2. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Last edited: Aug 12, 2015
  3. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    SmartSpawn version 1.3 is out - now with Bolt and default networking addons, so you can spawn items authoritatively over the network! Also, 1.3 brings in new Spawner Assets, which allow for easy extensibility in huge scenes.
     
  4. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Currently working on an update to SmartSpawn that will facilitate persistent player spawning, with unique player IDs & spawnpoints!
     
    OnePxl likes this.
  5. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Update 1.5 has been submitted and is pending review! Of course, the current version of SmartSpawn works perfectly in Unity 5 already.
     
  6. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Update 1.5 hasn't even been approved yet, but work on 1.6 has now started! Very excited about the main featuring coming into 1.6 - influence maps. These will let you dynamically alter values of any SmartSpawner within their area of effect at runtime, opening up a whole new range of possibilites for the SmartSpawn system.

    If you have any feature requests for Influence Maps, let me know!
     
  7. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I have Bolt and I have kept an eye on SmartSpawn, but I'm wondering how helpful it would be in my case. My spawning logic needs to take into account a challenge level, which doesn't seem to be in this spawner kit yet.

    Is this the kind of feature you might consider adding?
     
    GoGoGadget likes this.
  8. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Absolutely! So you'd want certain spawners (say, for enemies) to be able to spawn different enemies based on something like a difficulty level? Right now, you should be able to do that already by swapping out the SpawnAsset in a spawner based on difficulty level. Let me know if there's any extra specifics you'd like to see in it, that's definitely within the scope of SmartSpawn.
     
  9. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I have a fairly complicated list of features to implement. I think they are widely applicable to other games, and potentially users of SmartSpawn could choose which strategies they'd like to implement.

    First, for an enemy encounter I want to specify the enemy group type for each particular spawn point. I may have more than one type of enemy group type in a scene, and it might need to be decided at runtime, so there should be some flexibility in how it is done. In the default scenario, I copy this same spawning rule to place after place in the scene, maybe arranging to have skeleton spawn points (encounter type #1) in the north and zombie spawn points (encounter type #2) in the south. Or street thug encounters by day, and werewolves by night. Something like that.

    Also, I would want to set a percentage chance of a particular unit appearing. Say, if swordsmen, archers, and magicians are all in one group (Knights of the Mystic Temple, or whatever), I might want a specific encounter type to feature just swordsmen and archers, and no magicians, but swordsmen and archers can be mixed in a ratio of 2 swordsmen to 1 archer (so 2 swordsmen / 1 archer / 0 magicians). I believe NWN used an encounter model like that, where you could decide how many to spawn, how many of which type to spawn, and either incorporate random numbers within range or not. As I recall, it was simple but flexible.

    Then, when determining the rank and level of that group to spawn, I need to check the player's challenge / difficulty level. The logic here is a little complicated, as I would want to give the player the ability to make encounters weaker or stronger in terms of number of enemies, rank of enemies, and level of enemies. And, with Bolt, there can be more than one player, so if there are 2 players, the difficulty of each spawn must increase in a predictable fashion.

    So first I'd want to set the default behavior. In my case, I would have 8 ranks (0-7), but it should be an adjustable value. Default encounters for me would have 3 rank 1 enemies per player (with rank 0 being some minor nuisance enemy, like a rat).

    Next would come the rank, level, and number of players modifiers.

    But I guess it's probably best to leave this for now, and see what you think so far ... if it's something that seems reasonable to do, or if you don't see it as being within the scope of SmartSpawn.
     
    GoGoGadget likes this.
  10. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Thanks for the detailed explanation, helps alot. So;
    Currently, each SmartSpawner can already have it's spawn asset changed dynamically at runtime - that's just one line of code (eg. whateverSmartSpawner.spawnObject = werewolfSpawnObject;).

    SmartSpawn does work with a ratio-based spawning system at the moment, although there is no way currently to say "I want this spawner to spawn exactly 3 zombies, 2 archers, and 1 wizard every time" - that's something which could be added.

    With difficulty, that's where influence maps will be able to help - I'll keep this use case in mind when developing the influence maps update, and try and make sure it's as adaptable as possible. Thanks!
     
    hopeful likes this.
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    What about using this with UMA? Any special considerations you're aware of?
     
  12. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    None at all. If it works with Instantiate, it works with SmartSpawn.
     
  13. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Update 1.5 is now live on the asset store, with all new persistent player spawning features!
     
    OnePxl likes this.
  14. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Update 1.51 is now live, which improves the default behaviour of tracking enemies! Also, 1.6 is currently in testing, and includes full Photon networking support.
     
    hopeful likes this.
  15. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Here's a sneak peak on some of the features coming in update 1.6 - Photon networking support, improved inspector GUI, hot-swapping between different networking systems, and more!

    The update's been submitted to the Asset Store for review, so it should be live within the next 2 weeks once approved.
     
    hopeful likes this.
  16. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Version 1.6 is now live in the store!

    1.6 Changelog:
    • -Added Photon networking support
    • -Reworked all networked spawning scripts into one hot-swappable networked SmartSpawn script
    • -Startup speed optimizations
    • -Removed various useless in-editor debug info
    • -Added "Add spawn point button"
     
  17. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    Hi @GoGoGadget, i have look your asset in the store but and I have some question:
    1) what include the photon support ? the RPC call ?
    2) you have some example of photon implementation? some short code o something?
     
  18. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hi,

    1) The networked SmartSpawn script can be used with Photon (and Bolt, and default Unity) networking, and has the exact same functionality as non-networked SmartSpawn, but spawns the objects across the network. As of 1.6, there's also the option to toggle authoritative spawning, so if you use the "SS_AUTH" scripting define symbol, then SmartSpawn will only run on the server (or, in Photon's case, the master client).

    2) SmartSpawn's Photon integration is very simple, it doesn't use any RPCs for spawning, but instead uses PhotonNetwork.Instantiate.
     
  19. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    Oh! thats nice! i will buy this next month..
    thx!
     
    GoGoGadget likes this.
  20. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    @GoGoGadget - You've heard the rumor that Bolt was bought by Exit Games (Photon)?
     
  21. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Well, it's not a rumor anymore, it's true :) This probably isn't the right thread to discuss it, but overall it is positive, and in terms of SmartSpawn integration, I guess SmartSpawn now technically supports 2 Photon-owned networking systems!

    If anyone is using another networking system (TNet, uLink, Forge, ???) and would like to see built-in SmartSpawn support for it though, let me know, and in most cases it should be a simple addition.
     
  22. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    In addition to U5.1 networking and Photon + Bolt, which you have covered, I do have TNet. So if it's not too much trouble ... :)
     
    GoGoGadget likes this.
  23. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Sneak peak at the next major feature for SmartSpawn, influence maps! Got everything working in relation to them today, just need to tidy up the inspector GUI, run some more tests, and they'll be ready to push to the asset store (and planning some cool stuff in Down To One that'll make use of them).

    Pretty happy with how they're working at the moment, each influence map can exert influence in different ways - Additively (adding values to all target SmartSpawners each "Tick"), Override (completely replacing the values on all target SmartSpawners), or Single Influence (like additive, but only called once, as opposed to each tick).
     
  24. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    SmartSpawn version 1.7 is now live! With influence maps, that allow you to dynamically change values on a range of SmartSpawnScripts at runtime.

     
  25. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
    Hi @GoGoGadget, this Asset support the bussy spawn point? I mean detect if a Spawn Point is currently used by an item like a Medical Kit and if currently used then dont use that spawn point and use another point.

    I want to know if all that have your asset and support all that in Photon too.

    Regards,
     
    GoGoGadget likes this.
  26. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hi Mr.Stein,

    Yes, if an item is already in a Spawn Point (and you've made sure to set the correct tag to check for on that spawn point via the SmartSpawnColliderCheck script), then the SmartSpawner will pick a different spawn point.
    All variations of the SmartSpawn script (standard, Unity networking, Bolt networking, Photon networking) support the exact same feature set.
     
  27. Mr-Stein

    Mr-Stein

    Joined:
    Dec 4, 2013
    Posts:
    169
  28. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    Well, i have a problem, i cant seem to get the spawner to only spawn once, if changed the tag to the same as the item, ticked the Increment spawns on death. it still spawns all items even if i have the max spawns on 1.

    any help would be great and just ask if you need anything else
     
  29. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hey Jacko,

    Just double-checked with the current version of SmartSpawn, couldn't reproduce that issue (http://i.imgur.com/dUJ1KIv.png) - so, first things first, can you send a screenshot of your SmartSpawners settings, and what version of SmartSpawn/Unity you're running?
     
  30. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81

    Unity 5.1.0f3
    Smart Spawner V 1.61








    EDIT: updating now and gonna try and stuff around with it, almost everything is basic settings but cant figure it out why it doesnt just spawn once or twice

    EDIT2: updated but still doing it, i can set the max spawns to match the spawn points but sometimes the last point does get loot cause a few points get 2 or 3 items
     
    Last edited: Aug 3, 2015
  31. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Just from that first screenshot, it looks like you haven't got "Cap Maximum Spawns" ticked? That will cause the SmartSpawner to continue trying to spawn an object every tick.
     
  32. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    but even if i have that on and set to 100 it will still spawn all 100 at once, so pretty much i have to have the max cap on the same as spawn points?

    the way its going to be set up is loot will drop from above and not sitting on anything so as soon as it spawns it drops

    Edit: also for some spawn points it may not fit in the area and moves to a side and if it does that it spawns again and the end up to close to each other. some times i end up with 4-5 items spawning just in 1 area
     
    Last edited: Aug 3, 2015
  33. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    So from the looks of your screenshots, your "Time between spawns" is 0, that will effectively spawn all your items at once. It's in seconds, so if you only want a maximum of 1 item to spawn every 5 seconds, you can set that to 5.

    So, one thing you can do here is increase the Sphere Colliders radius on a spawn point, to ensure it keeps track of a larger area in case items move out of the default range. Let me know how this goes.
     
  34. JACKO4590

    JACKO4590

    Joined:
    Nov 25, 2014
    Posts:
    81
    that last bit is a good idea, we will try that tomorrow when we start again, a big thanks anyways, love your asset :D
     
    GoGoGadget likes this.
  35. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Update 1.8 has been submitted to the Asset Store (pending review)! Got some new features for Influence maps, spawn points will now support multi-tags (thanks to a great suggestion) and an edge case where if a spawners max spawns somehow got below 0, it would still keep spawning, has been fixed.

    Also, I'm using the current version of SmartSpawn in DTO (updated last night) - and we're using influence maps to add dynamic loot events to the map, I'm really happy with how they're working so far. It was super easy to set up as well, basically, I have a regular SmartSpawner

    on the server, that can spawn a bunch of difference influence maps, with Spawn Points set up in areas around the map. So, 120 seconds into the round, this SmartSpawner essentially creates a "random event" via influence maps, that then influence all the SmartSpawners in the town/area that they are spawned in.
     
  36. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    SmartSpawn v1.8 is now live in the store! Check it out for a bunch of new features & improvements.
     
    hopeful likes this.
  37. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Just putting the final touches on SmartSpawn v1.9, which brings an all-new set of innovative wave spawning features to SmartSpawn and Influence Maps. Actually very excited with how they're working at the moment, not only can influence maps listen to when SmartSpawners spawn waves, but all influence map features (Additive, override, and single influence) are fully compatible with waves, all with the tick of a checkbox in the inspector!

    Of course, you won't have to worry about updating SmartSpawn, as with every update, no breaking changes are ever introduced due to the decoupled dependencies between the spawner, spawner types, and spawnpoints :)
     
    hopeful likes this.
  38. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    SmartSpawn version 1.9 has now been tested & submitted to the Asset Store for review! With all new wave spawning and a new wave spawning demo scene.

    I think it's safe to say that SmartSpawns wave spawning will be the most dynamic around, as every wave spawner is a normal SmartSpawner, so it can be influenced by any influence map. As an example, let's say you have a zombie wave defence game, you could have a random event that makes the full moon come out, and enables an Influence Map. That influence map prefab could then auto-magically change Spawners in the moonlight to spawn Werewolves for that night (eg. that night might last for 3 waves, and the waves could get faster throughout the night).
     
  39. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
  40. keifyb

    keifyb

    Joined:
    Feb 12, 2016
    Posts:
    62
    hi just got the smartspawner but get this error when adding a smartspawn networked script to an empty object and nothing shows up in the inspector, any ideas?

    Expected top level layout group missing! Too many GUILayout.EndScrollView/EndVertical/EndHorizontal?
    UnityEditor.DockArea:OnGUI()

    im using 5.6.2f1
     
    Last edited: Jul 19, 2017
    Musketeer likes this.
  41. GoGoGadget

    GoGoGadget

    Joined:
    Sep 23, 2013
    Posts:
    864
    Hi, try reimport the package. Also, you may need to add the required network defines as per manual.