A system that takes an arbitrary Minecraft build area, searches for suitable spots for a village using a genetic algorithm, and constructs all the buildings using procedural and modular techniques.
The goal was to build a settlement that looks natural in the terrain it lands on. That means finding the flattest, most natural spots, minimising how much the terrain has to be reshaped, and making sure the village has some spatial coherence (houses clustered together, worship place visible from everywhere).
The whole pipeline runs sequentially: a genetic algorithm figures out the layout, then the builder modules go through and construct everything from the ground up. Each run produces a different result.
Finding good spots for 11 houses and a worship place simultaneously is a hard combinatorial problem. Testing every possible layout is infeasible — the search space grows as O((l·m)n). A greedy approach (place one building at a time, pick the best remaining spot) works for small n, but for 12 buildings the later placements consistently end up in suboptimal locations because the good spots are already taken.
Instead, all 12 positions are searched at once using a genetic algorithm. Each candidate solution is a bitstring that encodes the X and Z coordinates of every building. The algorithm runs for 1000 generations with a population of 50, using tournament selection, per-section uniform crossover, and bit-flip mutation (rate 0.01).
The fitness function combines ten signals into one cost (lower is better):
Each house is generated by placing two or three rectangles inside the 10×10 plot, then substituting each rectangular storey with a hand-designed modular structure. Rectangle footprints are chosen from three options: (4×3), (5×5), or (7×4). Each rectangle gets a random story count of 1, 2, or 3, each storey being 5 blocks tall.
The placement of rectangles follows a generate-and-test approach. The first rectangle goes in a random valid position. Each subsequent rectangle picks a random corner of an existing one and applies a random inward offset, so they always overlap enough for the interiors to connect. A small set of offsets that would produce corner-only contact is excluded because those make the interior layout unsolvable. 3-storey blocks are also constrained to attach to the tallest existing rectangle, which prevents double peaks.
Because rectangles are placed in an overlapping arrangement, the internal wall geometry comes out unpredictably. Before decorating, the entire interior needs to become a single connected space. Simply clearing all interior blocks works for overlapping rectangles fails when two rectangles sit side-by-side and only share a wall — the wall stays and the interiors remain separate.
The wall-removal pass traverses every wall block and checks its neighbours. If the block's interior-facing neighbour is interior space, and at least one of its exterior-facing neighbours is also interior space, the wall is redundant and gets removed. This repeats floor by floor until the whole building is open inside.
Once the interior is cleared, wood flooring is laid at ground level across the whole floor plan. Decorations are then placed by scanning the edges of each interior region: a table-and-chair set (oak fence, stone pressure plate, oak stairs) goes wherever three free blocks in a row back onto a solid wall; a prismarine-and-candle decoration fills remaining two-block spots. Finally, a door is inserted in the first exterior wall position that has interior on one side and exterior on the other.
The worship place uses a fixed footprint — a central 11×11 block with four 4×4 corner towers and four smaller side nubs, giving it a cross-like silhouette when viewed from above. Unlike the houses, where the footprint is random, the worship place keeps the same shape every run. What varies is the story count: each component (center and corners) independently gets a random number of stories between 1 and 4, so the overall height profile changes noticeably between runs.
Inside the hall, a chandelier is hung procedurally. From the centre 3×3 section of the ceiling, 3–7 positions are chosen at random. Each grows a column of oak fences downward to a random depth, with a shroomlight at the bottom.
Just before placing any structure, the system samples the Minecraft biome at the centre of that building's footprint. It then looks up a conversion table and swaps blocks accordingly before placing them — oak planks become jungle planks in a jungle biome, cobblestone becomes mossy cobblestone, sand replaces dirt in a desert, and so on.
The lookup table covers over 20 biomes: plains, taiga, jungle, cherry grove, mangrove swamp, savanna, desert, badlands, mushroom fields, crimson and warped forests, deep dark, and several others.