Tabletop Simulator

Tabletop Simulator

78 ratings
Dungeon Tile Maze Generator
   
Award
Favorite
Favorited
Unfavorite
Number of Players: 1, 2, 3, 4
Assets: Scripting
File Size
Posted
Updated
58.695 KB
Feb 4, 2017 @ 10:54am
Oct 15, 2018 @ 2:33pm
21 Change Notes ( view )

Subscribe to download
Dungeon Tile Maze Generator

Description
This is a set of tools used to generate tile mazes within Tabletop Simulator. You can also easily change the tile's type and rotation using the tile paintbrush, enabling you to paint your own wall positions on to the generated maze.

[www.paypal.com]

Maze Creator
I've previously posted on Reddit a GIF preview of the maze creator in action. Spawn in a Maze Creator, then hit "Create Maze". This will generate the maze.

On the Maze Creator itself, there are some input fields you can change.
  • GridSize.x and GridSize.z changes the size of the generated maze grid.
  • TilesPerCell.x and TilesPerCell.z changes how many tiles it uses per cell.
  • TileSpacing.x and TileSpacing.z is the spacing between tiles. If you scale the tile up, it will still use that relative spacing. Set spacing to 2 for the default tile spacing (it's set lower here to hide the gaps between tiles).
  • Sparsity is a value between 0 and 1. At the end of generation, this value will unwravel the maze leaving the Sparsity proportion behind.
  • Walls is a value between 0 and 1. At the end of generation, this will remove random intersecting walls inside the maze leaving the Walls proportion behind.
  • Seed is where you can place a generation seed. Mazes generated with this seed will appear the same every time. Leave this field blank to generate with a random seed.
Some things to note:
  • You can tint the Maze Starter any colour and the rest of the tiles will copy that colour.
  • You can rotate the Maze Starter at angles and have the rest of the maze spawn in relative to that angle.
  • You can scale the Maze Starter in any direction and the rest of the tiles will still follow the appropriate grid. Use this functionality to create bigger mazes, or even strange warped mazes.

You can also add more tiles to your mazes after they've already been generated. Simply create a Maze Starter and snap it to one of the existing tiles by brushing against it, then you will be able to use the arrow keys to move the Maze Starter relative to the other tiles.

____________________________________________

Tile Paintbrush
The Tile Paintbrush allows you to edit dungeon tiles on the fly. You can change the orientation of the tile to change the rotation of the tile you're stroking and change its state to switch its mode.

States:
  1. Floor Brush: press it against any tile to turn it into a floor piece.
  2. Wall Brush: press it against any tile to add a wall on that side (if you place 2 walls next to each other, it will create a corner tile). Flip over the Wall Brush to switch it to remove wall mode.

____________________________________________

Recent Updates
More Update Logs can be found in the Change Notes section.

Update 28/02/2018
  • Changed tool customisation to use input boxes instead of the description.
  • Improved code efficiency
  • Added Sparsity, Walls and Seed options.
  • Maze Tool is now a bag to make way for customisation in the future (put in your own tiles to use.) This is not yet implemented.

Update 05/07/2017
  • Updated the Maze Creator tool to use a Custom Tile instead of a block.
  • Updated layout, colour and size of buttons. This leaves more room for new features down the line.
  • Fixed a problem with the Maze Starter still being considered as held when snapping it to a maze tile.
  • Maze Starter now always spawns directly in front of the Maze Creator tool at any scale.

____________________________________________

Tags (ignore these): create your own mazes/dungeons! maze gen
45 Comments
V3NOM Dec 4, 2020 @ 5:19pm 
"The laggy version where it wouldn't need to re-use tiles would be a lot simpler. It would just delete the old tiles and spawn in new ones."

@Markimus - This option does not sound too bad.
Basically, the idea is to have players move their gaming piece through the maze toward the exit, while the maze layout will change to increase the challenge.
[]
Markimus  [author] Dec 4, 2020 @ 10:51am 
Maybe there wouldn't be any lag, the GIF shows instant generation after hitting the button.

The only thing you would definitely want to do is to re-use the tiles that are already on the table and just rearrange them in a different order instead of spawning in new ones.

It's definitely possible, though yeah it's not a simple request to do this. The laggy version where it wouldn't need to re-use tiles would be a lot simpler. It would just delete the old tiles and spawn in new ones.

The reason for the slow spawning in the GIF though is because spawning lots of objects at once is inherently laggy, and you wouldn't be able to have the instantaneous new maze layout that you want.
V3NOM Dec 3, 2020 @ 6:15pm 
"That would require generating multiple mazes beforehand and hot-swapping them in to avoid the lag."

@Markimus - This idea could be remedied by using "states" with pre-generated mazes, but I was requesting for an "timed looped" script that can generate an new randomized maze based on an set timed variable.
[]
Markimus  [author] Dec 3, 2020 @ 7:41am 
Oh right, thought we were still on the colour-changing topic. When you said change I thought you meant change colour. ;)

Thanks for the correction, you want to change maze layouts every 30 seconds or whatever interval you're setting.

That would require generating multiple mazes beforehand and hot-swapping them in to avoid the lag. I could make something that would do this, though it would require more work than a quick 15 line script.

I know you might be able to find help elsewhere and that I'm a shill for saying this, though if you're happy to pay for something like this I'd be more than happy to help. This is not something I can help you with for free unfortunately.

Please type your request in the form at the bottom of my website and I'll get back to you shortly:

https://automateyourmod.com/
V3NOM Dec 3, 2020 @ 6:59am 
"This will change the tiles to a random colour every 30 seconds"

@Markimus - I do appreciate your time and replies to my messages. However, I was requesting for an script to change the maze layout based on a timed variable, not the color of the tiles.
[]
Markimus  [author] Dec 3, 2020 @ 4:34am 
@V3NOM

Put this script in a separate object, like a cube for example.
This will change the tiles to a random colour every 30 seconds:
https://hastebin.com/cewewixivu.lua
Markimus  [author] Dec 3, 2020 @ 4:24am 
@V3NOM what is your use case?
V3NOM Dec 2, 2020 @ 2:18pm 
"Feel free to message me if you run into any more problems"

@Markimus - There are no problems, but can you provide a script that can enable the maze to change (randomize) after setting a timed variable? (For an example, if you want the maze to change every thirty seconds.)
*This function and option would be resourceful to me and others.
Markimus  [author] Dec 2, 2020 @ 7:20am 
@V3NOM Hey that's alright, not sure why that's happening. I did remove and edit my post a few times before submitting, you might have seen an earlier draft where I sent over the wrong line number. ;)

Feel free to message me if you run into any more problems, I'd be interested to know what your use case is for multi-coloured mazes.
V3NOM Dec 1, 2020 @ 11:07pm 
@Markimus - Thank you for replying to my message, and your suggestion was helpful.

[]