Search Unity

[RELEASED] RoomGen - Procedural Level Tool

Discussion in 'Assets and Asset Store' started by angularfoxdev, Apr 5, 2022.

  1. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    RoomGen - Procedural Level Tool

    RoomGen_Cover 3.png

    RoomGen is the easiest and fastest way to create fully decorated rooms or dense landscapes for your game. Configurable presets allow you to fine tune the details while also creating reusable templates so you can create endless variations from the same assets.


    A focus on ease of use -
    RoomGen was designed to be as simple to use as possible. Create a preset, drag and drop your tiles and hit generate. Your levels will build on the fly, and every change you make will be showcased within the editor.


    Multi-Story Generation -

    Now you can expand your room height and add multiple floors with one click! Set room presets PER-LEVEL and precisely build exactly what you want.
    Dynamic controls let you specify how tall you want each level to be, add doors and windows to each level, and RoomGen will populate each floor for you automatically.
    Drag floors into a different order and RoomGen will rebuild it for you. Adjust entire floor positions to give your building/dungeon some horizontal variance. Quickly design levels and tweak with a non-destructive process.


    Floor Level Specific Items and Characters -

    Working on a boss level? Want to add treasure chests, but only in the deepest depths of your rooms? You can specify a preset for every level. Place a boss only on the top level, or create an entire level of treasure!


    Endless Customizations -

    Every aspect of the generation process is customizable. Set individual probabilities for each item, specify offsets to work with non-uniform tiles, add scale and rotation variation to items to create more natural looking layouts. Scale your rooms to any size, add tall walls with windows, add in enemies, loot, collectibles, and more!


    Perfect for dungeons -
    One of the hardest parts of level design is creating variation. With just a few presets, you can create endless variations down to the smallest details. Make a room of all doors, build courtyards, forests, boss rooms, whatever assets you add into the generator, it will put them together for you. Save your designs as prefabs, and place them together to build dungeons in no time at all.


    Populate dense landscapes -
    RoomGen can build rooms, create dense forests, place NPCs, enemies, and more.


    Easy prefab creation -
    Once you've tweaked the settings to your liking, hit the save button and your room will automatically be saved as a prefab for later use. This means you can create an entire dungeon worth of rooms in a matter of minutes.


    3rd Party Support -
    RoomGen was designed for use with any modular tileset.
    RoomGen works great with Synty Studios assets!


    RoomGen_Cover 1.png





     
    Ryiah, frbrz, BetaMark and 1 other person like this.
  2. RatherGood

    RatherGood

    Joined:
    Oct 12, 2014
    Posts:
    21
    Question. I've yet to find an asset that can populate a non-square or non-90 degree walls buildings/rooms with "stuff". Real buildings are not always square. Can this asset be given a room/building outline and populate it? If yes, I'll buy right now. Thank you
     
    Ryiah likes this.
  3. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    I like the suggestion. Let me see what I can do! Right now RoomGen builds rooms and populates them as part of the same process. I can look into creating something similar to the `TargetGenerator` component that could potentially do that.
     
    Ryiah likes this.
  4. SammmZ

    SammmZ

    Joined:
    Aug 13, 2014
    Posts:
    174
    I second it! There are many different assets that generate & populate square-grid spaces, but if "TargetGenerator " could just populate objects inside a defined volume/surface it would be a bomb!
     
    angularfoxdev and Ryiah like this.
  5. trialnterrorgames

    trialnterrorgames

    Joined:
    Feb 20, 2014
    Posts:
    58
    Can this also be used real-time (eg used to fill a procedurally generated room)?
     
  6. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    RoomGen is made to procedural build and then fill the rooms. You just have to supply the Asset tiles. I’m working on adding support for filling any kind of pre made structure with decorations. Run-time support is possible but will just require a bit of coding. Working on making that easier as well!
     
  7. bvonline

    bvonline

    Joined:
    Feb 27, 2021
    Posts:
    85
    First: Is it possible to procedurally create rooms like that, with that kind of shape / angles?:

    upload_2022-8-13_12-56-7.png

    Second: And What about round corners? Could I run into any problems (overlapping issues for example)? I saw in your video, that walls can be rotated - I assume, that there will be then wall corner parts missing, if you rotate these? Is there an option to close open corners anyhow? By the way, I am using a known Toon Shader. I hope, that in that case wall cuts like "wall - corner - wall" can't be seen visually when using a shader?
     

    Attached Files:

    Last edited: Aug 13, 2022
  8. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    Right now RoomGen only generates square or rectangular rooms. For the case of rounded corners, that’s something I could consider adding in. Where you could specify specific curved wall tiles for the corners. But right now any rotated or curved walls will show gaps. The purpose of that in the video is to show the individual control of tiles from the editor in case you had an asset you need to rotate to fit.
     
    Last edited: Aug 14, 2022
  9. tapticc

    tapticc

    Joined:
    Jan 16, 2014
    Posts:
    379
    Hello I noticed the multi-storey generation but couldn't see any stairs to link levels, is this something that is present but not demonstrated in the video?
     
    chaymber likes this.
  10. MorpheusXI

    MorpheusXI

    Joined:
    Jan 18, 2018
    Posts:
    71
    I can confirm my testing on U2021 shows RoomGen is working without any issues. I will use this version for RoomGen usage, as per your minimum supported Unity version, thanks.

    In v2020 I get several syntax errors on line 622 Roomgenerator.cs with RG imported. I did try changing between : & ; which dropped 2 out of 4 errors:
    upload_2023-5-2_15-53-3.png

    And changing colon to semicolon drops 2 of the errors......I'm not programmer so not sure why 2 further syntax errors persists.
    upload_2023-5-2_15-59-20.png
     
    Last edited: May 2, 2023
  11. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    61
    Hello, I'm receiving this error: Using Unity version 2021.3.15f1.

    My project was recently updated from 2020.3.32f1 to the above Unity version, could I be missing any packages as I did make a new project with RoomGen in 2021.3.15f1 and it is working. I just hoped I could integrate with my current project for procedural content.

    I apologies, I looked in to the Unity registry and found Visual Scripting is enabled in the fresh launch of Unity 2021.3.15f1. I am backing up my project and will install and see how it goes, may take a few hours...

    Updated.
    That has resolved the issue. It might be an idea to put a note for anyone who upgraded their project to make sure to install Visual Scripting via package manager / Unity.

    Hoping this will be great to use, thanks so much!
     
    Last edited: Jun 1, 2023
  12. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    61
    Sorry again to post, I have two other issues I'm trying to resolve.

    1. I'm trying to make it so that seed can randomly generate each time the map loads. I have tried to use a Unity event to trigger the action but It doesn't seem to give the option to trigger the seed. How can I randomly generate the Terrain Generator using a Unity Event if possible.

    2. I'm using a Terrain Generator so the trees, rocks, etc will generate, but they only generate on the surface if that is set to the Height of 1. When I made hills there's no decoration on the hills or inclines, how can the terrain objects generate on higher surfaces of the terrain also?

    Thanks for the help!
     
  13. CEO-Games

    CEO-Games

    Joined:
    Nov 7, 2014
    Posts:
    1
    Is it possible to generate external buildings using assets like Synty? Not just internal rooms?
     
  14. Enzo36t

    Enzo36t

    Joined:
    Aug 30, 2020
    Posts:
    61
    If you use the Target Generator you can put buildings in there to generate on any surface with the tag. That would be the best way to have buildings generate on a map with different surface levels. Although I am having difficulty with this and even when set a surface layer nothing will be placed on the surface and only works on a Terrain with Terrain tag, it worked and then broke for other surfaces even with the terrain tag. Unsure what the support is like so far as no answers were returned.
     
    Last edited: Jun 2, 2023
  15. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    I sincerely apologize for the delay in response! This thread hasn't been active since August 2022, so I haven't checked this as frequently and for some reason I didn't get any notifications for these new posts.

    Addressing each issue:

    It might be an idea to put a note for anyone who upgraded their project to make sure to install Visual Scripting via package manager / Unity.
    I have a new update coming out (2.6.3) that will resolve issues with builds using Unity 2020. I switched to a new IDE and it looks like it was adding libraries that were not even used! Visual Scripting is not needed for RoomGen, and this new update will remove any of those dependencies.


    I'm trying to make it so that seed can randomly generate each time the map loads. I have tried to use a Unity event to trigger the action but It doesn't seem to give the option to trigger the seed. How can I randomly generate the Terrain Generator using a Unity Event if possible.
    I've added new events in 2.6.3 that will allow you to update the radius, seed, and object density of Target Generators at runtime using the following syntax:
    Code (CSharp):
    1. EventSystem.Instance.SetTargetGenSeed(targetGeneratorID, 90123);
    I'm using a Terrain Generator so the trees, rocks, etc will generate, but they only generate on the surface if that is set to the Height of 1. When I made hills there's no decoration on the hills or inclines, how can the terrain objects generate on higher surfaces of the terrain also?
    This will also be fixed in 2.6.3.

    Although I am having difficulty with this and even when set a surface layer nothing will be placed on the surface and only works on a Terrain with Terrain tag

    TargetGenerators do not require terrains. Any object with a collider can be used as a base. Make sure the Layer is selected in the TerrainGenerator's SurfaceLayers property. If you don't want the TargetGenerator to align to a surface, simply uncheck the Align to Surface box in the Terrain Generator component.
     

    Attached Files:

  16. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    As Enzo mentioned you can use the target generator to place buildings aligned to a surface. This asset is mostly used for detailed interiors, as buildings from the outside will just be square. There is some flexibility, you can see in this video I used Synty assets to place the walls of the building together. There is a place to input your own roof tiles as well, but this asset works best for generating interior structures rather than being something like a building/city generator.

     
  17. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    Apologies for the delay in response! I'll be releasing a new version (2.6.3) this week that will address these issues for users on Unity v.2020
     
  18. leonardherndon

    leonardherndon

    Joined:
    Sep 1, 2014
    Posts:
    2
    I'm looking into this asset for a top down space game I am working on. The forest generation looks pretty good an is similar to the density that I would like my game to be. I do wonder if this asset will build full procedural maps with customizable rules on which rooms connect to others? Or is it more powerful of a tool to build rooms with then use another system to connect them together.
     
  19. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    RoomGen is best used to create prefab "rooms", it doesn't do any linking between generated rooms. The benefit of RoomGen is that you can create reusable presets for your rooms and tweak seed values to create some variety and very quickly generate many prefabs that share a common theme. For dungeon generation or stitching prefabs like this together I typically recommend DunGen, as it has capabilities to generate layouts from prefabs.
     
  20. xnitro1234

    xnitro1234

    Joined:
    Jan 3, 2014
    Posts:
    1
    Hello,
    there was previous question regarding stairs. as far i can see its not implemented isnt it?
    is there a way to get stairs for multi-story-buildings?
     
    chaymber likes this.
  21. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    No, stairs are not implemented. There are too many edge cases to account for when designing for stairs to make this asset still useful to the widest variety of projects possible.

    I recommend generating rooms or multi-story buildings to your liking and then adding the stairs to the prefab by hand. This is the best way to ensure the ceiling is high enough compared to the steepness of your stairs so your character doesn't hit their head; the opening in the floor above is wide enough for your character, decorations don't get placed to close to stairs etc.
     
  22. ufulio

    ufulio

    Joined:
    May 7, 2013
    Posts:
    88
    hi ... i just want to know if i can EXPORT this rooms when finish ..... to BLENDER OR CINEMA 4D with all textures .... please ?
     
  23. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    Hi there! RoomGen doesn't provide any export functionality. It is used to piece together existing assets to create prefabs or to generate rooms at runtime.
     
  24. wahyuway

    wahyuway

    Joined:
    Oct 7, 2013
    Posts:
    84
    is it possible to put road path on forest?
     
  25. jpileborg

    jpileborg

    Joined:
    Jan 5, 2013
    Posts:
    33
    I'm looking into using RoomGen for runtime generation of a set of simple dungeon locations. I can create a number of presets, and can easily generate different seeds, but I don't see any way to set the preset asset at runtime.

    Is it possible to create multiple RoomGen game objects, each one with a specific preset, and then invoke a random instance to create a location? Will the event handler singleton be a true singleton, where there's only one in the whole game, or will it be local to the current RoomGen game object? Is this the best (or only) way to handle multiple presets?

    Also, I don't want a multi-level dungeon, it should all be one single linear level with randomly generated locations.
     
  26. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    Will your dungeon be static, like the room sizes and locations won't change but the presets will? There's a couple ways you could go about this.
    One, you could use the level system and update the offsets so they appear side by side instead of stacking vertically. Since levels can have their own preset and offset you can lay out your levels side by side so you just have a single floor and then apply different presets to each level. This method means your rooms would all be the same size (probably not ideal).
    Two, you can have multiple RoomGen components in your scene and each can be customized as you like. You would need to generate and align them according to your desired room sizes to check they don't overlap.
    I'll push out an update this week that adds an ID parameter to the event system so you can update specific RoomGen instances in your scene. I'll also add a new event to change the preset for an instance and level.
    Alternatively, you could use RoomGen to generate and save prefabs of each room size and at runtime simply replace each room in your dungeon with one of the prefabs. This would probably be the most efficient in terms of performance. RoomGen really shines when it comes to prefab creation and quickly creating many different room variations.

    The EventSystem is a true singleton, only one should ever exist at a time.
     
    jpileborg likes this.
  27. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    RoomGen won't create paths specifically, but if you have a path prefab it can be added as a floor decoration and placed for you.
     
  28. jpileborg

    jpileborg

    Joined:
    Jan 5, 2013
    Posts:
    33
    A little background: I'm basically creating something like an infinite runner type game, where the player is running in a dungeon fighting monsters and picking up loot. Each room will have one entrance and one exit (I have some ideas on how to solve that) and once an entrance or exit has been passed it will be closed (easy to do with triggers). Each room will be connected with a small set of corridors. Finally, the player will have some control to move around freely in each room and corridor, and will control the pace.

    While it can be done using a set of existing prefabs (and like you said, RoomGen really shines in that departement), it will add a little too much repetition I feel. I would like to add some randomness between locations. So your second alternative with multiple RoomGen components (and adjusting the seeds) seems like what I will pick.

    I will create the rooms and corridors a few segments ahead, and together with the player needing to stop and fight monsters along the way it will hopefully allow RoomGen to work its magic without the players noticing it. :)

    Thanks for the advice. And thanks for an incredible easy to use system (much easier than many others I tried).
     
    angularfoxdev likes this.
  29. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    From your setup it seems that would be the best option! If you want to send me an email at angularfoxdev@gmail.com with your invoice number I'll send you a preview package of the next update with these additions so you don't have to wait for the Unity approval process.

    This update adds new ID's for updating specific RoomGen instances in your scene, adds a new event to update a RoomGen preset, and also adds door pinning, which sounds like it could also be useful for your game! Basically you create a Door Pin object in your scene, bind it to a RoomGen component and it creates doors in that spot :).
     
    jpileborg likes this.
  30. jpileborg

    jpileborg

    Joined:
    Jan 5, 2013
    Posts:
    33
    Thanks but I'm not in a hurry. Still a lot of other things to do! :)

    But I'll come back to it when the update is generally available.

    And yes, that door pinning will be very useful... ;)
     
  31. AESStudio

    AESStudio

    Joined:
    May 11, 2021
    Posts:
    1
    Hi there, love the asset. Using it for a VR project although is there a way to create multiple rooms in a scene and then link them? tried it and the player gets stuck at the door... also tried making a room with 4 floors but cant get up the stairs.
     
  32. angularfoxdev

    angularfoxdev

    Joined:
    Aug 20, 2017
    Posts:
    17
    Hi! Glad to hear its been helpful for you. Currently there are no plans for linking rooms in that way, RoomGen was intended for room generation and then rooms could be linked using other methods/assets etc. The way RoomGen is built does make it really easy to implement dungeon generation tools like DunGen though! You can also offset levels horizontally rather than vertically to do a sort of basic dungeon generation.
    Stairs are a tricky one and I get this question a lot! The idea was that RoomGen will get you 99% of the way without any manual asset placing. Stairs are that 1% really. In testing, implementing stairs led to too many situations where it would work for some users but completely break rooms for others. Character height, level height, stair height, stair width as opposed to floor tile width/depth, stair angle and steepness, railings and holes in floors ended up with so many options needed to get a room to be generated properly I eventually omitted them for the sake of ease of use for the end user.