Search Unity

[RELEASED] Procedural Area Spawner - Quick and Easy Procedural Space Filling

Discussion in 'Assets and Asset Store' started by r3eckon, May 2, 2019.

  1. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Procedural Area Spawner is a simple tool allowing for quick and easy procedural space filling using provided game objects. Automatically spawn in objects within a given area without any clipping using nothing more than bounding boxes and the chaotic nature of RNG.


    Yet another tool created for the Procedural Dungeon Toolkit that ends up being released as an independent asset, this tiny two script utility has the power to instantly generate procedural bookshelves or cities. It can act as an item or mob spawner. The anchor plane system allows objects to be automatically "rested" on to a side of your spawn areas, making it easy to rest objects on tables or walls.


    Using the AABB spawn mode when dealing with square objects that won't be rotated allows for instantaneous generation and can be used in many ways despite it's limitations. The physics based spawning system is a bit slower since it relies on the FixedUpdate method, but the tradeoff is that it can handle object rotation much better than the AABB mode.


    The physics based avoidance system works using built in unity layers, which means any scene object using the avoidance layer will be avoided by spawning objects. Easy way to further customize your spawn areas.

    As I've mentioned before this tool has been developed mainly for use in Procedural Dungeon Toolkit. You can see it in action below, generating some random bookshelves for my dungeons.


    The tool is currently awaiting validation from the asset store team. Price should be $10 for anyone interested in picking it up once it releases. Any feedback, comments, questions or feature requests are welcome :)
     
    DrOcto likes this.
  2. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    While waiting for validation, here is a quick video showing off the main features of the asset. In it you can first see how 4 large spawn areas get randomly filled with objects. The video also has a demonstration of simple bookshelf generation ( albeit without a step I've added to my dungeon bookshelves which is to "slide" books towards one side to realistically pack them together ) and how the "Anchor Point" of objects can be edited to switch from objects that spawn on the "floors" of spawn areas to objects that spawn on walls or ceilings of the areas.

     
    DrOcto likes this.
  3. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
  4. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Here is a voucher up for anyone lucky enough to get it first :)

    ASV-K4YG-FRW9-99QH-3FA6-4EN6
     
  5. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Here is a new video showing off a bunch of procedurally generated bookshelves inside Procedural Dungeon Toolkit!


    Also, quick reminder to everyone that if you have any support requests, questions or feedback about the asset, feel free to post it here if it's a question you feel others would want to see answered. You can also contact me through email at r3eckon@gmail.com if you want, and I usually reply to emails sent to this address within 1 to 2 days.
     
  6. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    A user just made a false review on the asset, stating that "Nothing Works" on Unity 2019. Here is proof that it works.



    I'd like to take this moment to remind everyone that if you experience any type of trouble with the asset, please send me a support request by email before writing an angry review saying "Nothing Works". I reply very fast to support requests. This user did not even try to ask for help before writing this review.

    If you enjoy using this asset, please consider leaving a review to counter balance this dishonest negative review :)
     
  7. unity_apaladines

    unity_apaladines

    Joined:
    Jul 18, 2018
    Posts:
    2
    Hi, please, I have a question, I need your help. How to make to spawn a specific quantity of objects in an area.
    What I need is to spawn a specific quantity of objects with "spawn chance" in an area. This package generates an infinite number of objects in any empty space to fill. Thanks in advance
     
    r3eckon likes this.
  8. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Can you send me an email at r3eckon@gmail.com with your invoice number? There are a few lines of code I need to add in order to get this working, so I would rather send you the two updated scripts directly instead of telling you the lines to add.
     
  9. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    Here is a bit of an update on the max count feature, it has been fully implemented and works as intended. As expected this did not take very long but the code changes are still numerous so this will be added in next version.


    Area Max Count is the maximum amount of a spawnable object allowed to appear for EACH AREA.
    Global Max Count is the maximum amount of a spawnable object allowed to appear OVERALL.

    Using these two new parameters it is possible to restrict the amount of an object spawning for each area or in an entire scene. As the header text says, to have limitless amounts of a certain object generate simply set the value to 0.


    As expected this also works flawlessly with the physics based spawn mode. The object counts are reset upon the CleanTransform() function being called ( C key in the demo scenes ) so if you must respawn objects in code make sure you call this function to reset the object counts otherwise the existing counts will still be in use.


    I'm not sure when this next update is going to come out, as I am currently waiting on validation of two other new assets, so if anyone wants to try it out before then just hit me up with an email containing your invoice number and I will send you the updated scripts!
     
  10. LeeJiHoon

    LeeJiHoon

    Joined:
    Aug 4, 2016
    Posts:
    14
    Is not 2017.4 supported?

    I added a layer.

    However, nothing happens when you press the g key.

    It works fine in the 2019 version.

    edit
    Physics.autoSyncTransforms = false
    This was a problem. Now it works fine.
     
    Last edited: Jul 4, 2019
  11. r3eckon

    r3eckon

    Joined:
    Jul 3, 2015
    Posts:
    506
    I'm glad you fixed the issue on your own :) After looking at the documentation it seems like this parameter can indeed cause troubles with Unity 2017. I'm not sure what it did exactly to mess with the generation methods, but since you found the fix easily I might just add a notice about it in the readme for next version.