How to generate houses procedurally in a voxel world?

I am developing a mod for the game Minecraft, a block-based voxel game. As part of the mod, I want to create a procedural house generator that will be generated based on specific needs/desires, such as a desire for a bed, a desire to have certain blocks as part of the 'furniture'/walling. It also needs to be able to be extended over time.

What kind of algorithms would be suitable to generate unique-ish houses of this sort? I was thinking some kind of genetic algorithm perhaps, or a collection of built in house modules. I would like to avoid manual user input / manual input of a large collection of widgets as much as possible, or at least allow the layout of a room to be dynamically generated or themed.

First you need a very general function for creating rooms. So it takes a lot of parameters, say length, width, height, main material, detail material, floor material, number and style of windows, and so on.

Then you can create rooms considering the user requirements and the dimensions which you calculate out of the number of furniture the user selected. (For example assuming that every piece of furniture needs two blocks space at the edge of the room. So pass dimensions to the functions resulting in a big enough perimeter.)

After that you have to place the actual pieces like doors, windows, beds, workbenches, chests, and so on. I am not entirely sure how to that this but maybe you could just walk along the edges of the room and place things consecutively.

For now that algorithm would create determined results which is a bit boring. On the other hand it is hard to extend a random house because you would either store the edges or find them out later again. Nevertheless you could vary the dimensions by a random offset.

To create non-rectangular rooms take a closer look on noise algorithms or space division algorithms.

One Idea would be to provide so called modular sections of a house so.

For example you have modules for each section eg.

• Intersection
• Single room with NORTH,EAST,SOUTH,WEST entrance
• T junctions.
• Corridors

You would design these parts of the model with say 3 distinct block types base wall,detail, floor and store these sections with knowledge of their design and which block type they set at.

Your user can now select what to use for base wall, detail and floor and a design you came up with and also where to add an intersection or t-juction etc, at which the section would change accordingly.

This way is a fair bit of work to set up the logic but you can speed up the process if you take rotation into consideration.

Hope this helps

• Thanks for your answer, I have clarified the question a little bit at the end - if possible I would like to avoid this approach as it appears to the user as 'cookie cutter' without a large library of rooms. Jan 30, 2013 at 13:56