Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Random Room Generator  (Read 1939 times)

davidoskky

  • Escaped Lunatic
    • View Profile
Random Room Generator
« on: May 08, 2020, 03:59:54 am »

I'm not very good at making great architectures, therefore my forts always come strange and unstructured; I therefore like my rooming pattern to be strange and random as well.
The problem of making a random pattern is that no macro can be created, unless you just make one and repeat it.
Digging all the rooms manually takes an enormous amount of time.

I therefore decided to make a small utility to help me build some cool rooming pattern that doesn't always look the same.
I present you Random Room Generator, a small utility that will fill any shape you like with the number of rooms of your choosing.
You can use this to make random rooms in a repeating patter, so they are easy to deploy and expand (squares) or you can use it to make rooms in a complex shape that would be otherwise difficult to fill manually.

This program reads csv file, with a formatting similar to quickfort and generates a csv which can be used with digfort and I believe with quickfort as well.
The input csv must contain a dig designation 'd' outlining the perimeter of the shape you want to be filled.

Changing the number of rooms
Spoiler (click to show/hide)

Shapes that can be made with a little work
Spoiler (click to show/hide)

This program is written in python, therefore you will need to install python to use it.
There are two ways to use the program:

Fill a square of length 35 with 40 rooms and write the output to out.csv
Code: [Select]
python roomGenerator.py -d 35 40 out.csv
Fill the shape defined in shape.csv with 40 rooms and write the output to out.csv
Code: [Select]
python roomGenerator.py -s shape.csv 40 out.csv
You can find the program here: https://github.com/davidoskky/roomGenerator

If you like the program and have some ideas to improve it, don't esitate asking.
Logged