# How Building Style Presets Define Aesthetics in Arnis: RESIDENTIAL_WALL_OPTIONS and COMMERCIAL_WALL_OPTIONS Explained

> Discover how Arnis building style presets like RESIDENTIAL_WALL_OPTIONS and COMMERCIAL_WALL_OPTIONS define Minecraft aesthetics by mapping OSM categories to distinct block palettes for unique residential and commercial looks.

- Repository: [Louis Erbkamm/arnis](https://github.com/louis-e/arnis)
- Tags: deep-dive
- Published: 2026-03-20

---

**Building style presets in arnis are predefined arrays of Minecraft block types that map OpenStreetMap building categories to specific aesthetic palettes, ensuring residential structures use warm, varied materials while commercial buildings employ sleek, modern blocks.**

The `arnis` project transforms real-world geographic data from OpenStreetMap into detailed Minecraft worlds, and building style presets serve as the critical bridge between abstract OSM tags and concrete visual aesthetics. These presets determine whether a generated house appears cozy and brick-lined or whether an office tower renders as glass and polished stone.

## What Are Building Style Presets in Arnis?

Building style presets are static constants defined in [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs) that contain arrays of `Block` enum values from [`src/block_definitions.rs`](https://github.com/louis-e/arnis/blob/main/src/block_definitions.rs). Each preset represents a curated palette of aesthetically compatible Minecraft blocks. When the generator processes an OSM building element, it categorizes the structure and then randomly selects a block from the corresponding preset array to use as the wall material.

### Residential Aesthetics: RESIDENTIAL_WALL_OPTIONS

The `RESIDENTIAL_WALL_OPTIONS` constant, located at lines 54-79 in [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs), defines the "warm, homey materials" aesthetic for houses and apartments. This array includes:

- **Brick variants** (`BRICK`, `STONE_BRICK`, `RED_NETHER_BRICK`)
- **Terracotta shades** (`WHITE_TERRACOTTA`, `ORANGE_TERRACOTTA`, `RED_TERRACOTTA`)
- **Natural stone** (`SANDSTONE`, `COBBLESTONE`, `MOSSY_COBBLESTONE`)
- **Quartz and concrete accents** (`QUARTZ_BLOCK`, `WHITE_CONCRETE`, `LIGHT_GRAY_CONCRETE`)

This diverse palette ensures residential neighborhoods appear organic and varied, mimicking the eclectic materials found in real-world housing developments.

### Commercial Aesthetics: COMMERCIAL_WALL_OPTIONS

The `COMMERCIAL_WALL_OPTIONS` constant, found at lines 81-90 in the same file, creates a "modern, clean look" appropriate for offices, hotels, and retail spaces. This restricted palette favors:

- **Modern concrete** (`WHITE_CONCRETE`, `LIGHT_GRAY_CONCRETE`, `GRAY_CONCRETE`)
- **Polished stone** (`POLISHED_ANDESITE`, `POLISHED_DIORITE`, `SMOOTH_STONE`)
- **Refined quartz** (`QUARTZ_BLOCK`, `QUARTZ_BRICKS`, `SMOOTH_QUARTZ`)
- **Clean brickwork** (`STONE_BRICKS`, `BRICKS`)

By limiting the selection to these sleek materials, commercial districts automatically achieve a contemporary, uniform appearance that distinguishes them from residential areas.

## How Building Style Presets Drive Visual Output

The aesthetic translation from OSM data to Minecraft blocks occurs through a deterministic selection process defined in [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs).

### Category Detection

The `BuildingCategory::from_element` method analyzes OSM tags to classify structures. Residential tags like `building=residential` or `building=house` map to `BuildingCategory::Residential`, while commercial tags like `building=commercial`, `shop=*`, or `office=*` map to `BuildingCategory::Commercial`.

### Palette Selection via get_wall_block_for_category

The `get_wall_block_for_category` function, located at lines 1004-1010, implements the preset selection logic:

```rust
match category {
    BuildingCategory::House | BuildingCategory::Residential => {
        RESIDENTIAL_WALL_OPTIONS[rng.random_range(0..RESIDENTIAL_WALL_OPTIONS.len())]
    }
    BuildingCategory::Commercial | BuildingCategory::Office | BuildingCategory::Hotel => {
        COMMERCIAL_WALL_OPTIONS[rng.random_range(0..COMMERCIAL_WALL_OPTIONS.len())]
    }
    // …other categories…
}

```

This pattern matching ensures that a residential building never uses commercial concrete blocks and vice versa, maintaining aesthetic consistency within districts.

### Deterministic Randomness

The `rng` parameter is seeded per-building based on the structure's OSM ID and coordinates. This ensures that the same real-world building always generates with the same wall material, providing world persistence while still allowing variety across different buildings.

## Code Implementation Examples

### Accessing Residential Wall Options Directly

To manually select a wall block from the residential palette:

```rust
use arnis::element_processing::buildings::{RESIDENTIAL_WALL_OPTIONS, get_wall_block_for_category};
use rand::thread_rng;

let mut rng = thread_rng();
let wall = RESIDENTIAL_WALL_OPTIONS[rng.gen_range(0..RESIDENTIAL_WALL_OPTIONS.len())];
println!("Chosen residential wall block: {:?}", wall);

```

### Generating Walls Based on Building Category

To use the public API for category-based wall selection:

```rust
use arnis::element_processing::buildings::{get_wall_block_for_category, BuildingCategory};
use rand::thread_rng;

// After parsing OSM tags to determine category:
let category = BuildingCategory::Commercial;
let mut rng = thread_rng();

let wall_block = get_wall_block_for_category(category, &mut rng);
println!("Generated commercial wall: {:?}", wall_block);

```

Both examples draw from the constants defined in [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs), ensuring the selected blocks match the intended aesthetic for the building type.

## Summary

- **Building style presets** are static arrays in [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs) that map OSM categories to Minecraft block palettes.
- **RESIDENTIAL_WALL_OPTIONS** creates warm, varied aesthetics using bricks, terracotta, and sandstone for homes and apartments.
- **COMMERCIAL_WALL_OPTIONS** enforces modern, clean visuals through concrete, polished stone, and quartz for offices and retail.
- The `get_wall_block_for_category` function at lines 1004-1010 selects random blocks from these presets based on the detected `BuildingCategory`.
- Per-building RNG seeding ensures consistent materials for the same real-world structure while maintaining district variety.

## Frequently Asked Questions

### How does arnis determine which building style preset to use?

Arnis analyzes OpenStreetMap tags through the `BuildingCategory::from_element` method to classify structures. Tags like `building=residential` trigger `RESIDENTIAL_WALL_OPTIONS`, while `building=commercial` or `shop=*` tags trigger `COMMERCIAL_WALL_OPTIONS`. This classification happens in [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs) before any block placement occurs.

### Can I modify the building materials used for residential or commercial buildings?

Yes, you can edit the constant arrays in [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs). `RESIDENTIAL_WALL_OPTIONS` spans lines 54-79, and `COMMERCIAL_WALL_OPTIONS` spans lines 81-90. Add or remove `Block` enum values from [`src/block_definitions.rs`](https://github.com/louis-e/arnis/blob/main/src/block_definitions.rs) to change the available materials. Recompiling the project will apply these aesthetic changes to newly generated worlds.

### Why do the same real-world buildings always generate with the same wall colors?

Arnis uses deterministic randomness to ensure world consistency. The RNG seed for each building derives from the structure's OSM ID and coordinates, passed through `get_wall_block_for_category`. This means the same building always selects the same index from `RESIDENTIAL_WALL_OPTIONS` or `COMMERCIAL_WALL_OPTIONS`, preserving the aesthetic across regeneration sessions while maintaining variety between different buildings.

### Are there building style presets for other categories like industrial or religious buildings?

Yes, [`src/element_processing/buildings.rs`](https://github.com/louis-e/arnis/blob/main/src/element_processing/buildings.rs) contains additional wall-palette constants for other `BuildingCategory` variants. While `RESIDENTIAL_WALL_OPTIONS` and `COMMERCIAL_WALL_OPTIONS` handle the majority of urban structures, specialized categories like Industrial, Religious, and Farm have their own curated block arrays. The `get_wall_block_for_category` function handles all these variants through exhaustive pattern matching on the category enum.