Building Game Worlds Guide¶
This guide covers everything you need to know about creating and managing game worlds in MAID, from basic room creation to procedural wilderness generation.
Table of Contents¶
- Overview
- Getting Started
- Creating Rooms
- Connecting Rooms with Exits
- Using the Grid System
- Procedural Wilderness Generation
- Zone Management
- Best Practices
Overview¶
MAID provides multiple approaches to world building:
- Manual Building - Create rooms one at a time using in-game builder commands
- Grid-Based Building - Use coordinates for structured layouts like towns or dungeons
- Procedural Generation - Generate wilderness areas on-demand as players explore
- Batch Creation - Script large areas using batch files
Choose the approach that fits your needs:
| Approach | Best For | Complexity |
|---|---|---|
| Manual | Small areas, unique locations | Low |
| Grid-Based | Towns, dungeons, structured areas | Medium |
| Procedural | Large wilderness, infinite exploration | Medium |
| Batch | Mass creation, world seeding | High |
Getting Started¶
Access Requirements¶
Building commands require the BUILDER access level. Contact your server administrator to get building permissions.
Basic Workflow¶
- Navigate to where you want to build (or create a starting room)
- Create rooms using
@digor@create - Describe rooms with
@describe - Connect rooms with exits using
@dig,@tunnel, or@link - Organize rooms into zones with
@zone
Essential Commands Quick Reference¶
@dig <direction> [= room_name] - Create room and exit
@describe here <text> - Set room description
@examine here - View room details
@tunnel <direction> <room> - Connect to existing room
@zone assign <zone> here - Add room to zone
Creating Rooms¶
Using @dig¶
The @dig command creates a new room connected to your current location:
This creates: - A new room named "The Grand Hall" to the north - A bidirectional exit (north from here, south from there)
Without a name, the room gets a default name:
Using @create¶
For rooms not connected to anything (isolated areas, limbo rooms):
Then connect it later with @link or @tunnel.
Setting Room Descriptions¶
Use @describe for single-line descriptions:
For multi-line descriptions, use @edit:
This opens the in-game VI-like editor. Type your description, then use :wq to save and quit.
Room Attributes¶
Set room properties with @set:
Add room tags with @attribute:
Dynamic Room Descriptions¶
For rooms that change based on time, weather, or season, add the ExtendedRoomComponent:
Then configure time variants:
@room time here night "The tavern is quiet, with only a few patrons."
@room time here noon "The lunch crowd fills every table."
@room season here winter "Frost clings to the windows."
@room weather here rain "Rain drums steadily on the roof."
See the Extended Room Features Guide for complete documentation.
Connecting Rooms with Exits¶
Standard Directions¶
MAID supports these directions:
- Cardinal: north, south, east, west
- Diagonal: northeast, northwest, southeast, southwest
- Vertical: up, down
- Special: in, out
Abbreviations work too: n, s, e, w, ne, nw, se, sw, u, d
Creating Exits with @dig¶
@dig creates bidirectional exits by default:
Creates: - Exit "north" from here to Bedroom - Exit "south" from Bedroom to here
Connecting to Existing Rooms¶
Use @tunnel to connect to a room that already exists:
One-Way Exits¶
For trapdoors, slides, or magical portals:
Removing Exits¶
Remove an exit from your current room:
Exit Descriptions¶
Give exits custom descriptions:
For dynamic exit descriptions (hidden doors, locked gates):
# In code or batch file
exit_desc = ExtendedExitDescription(
direction="north",
base_description="A passage leads north.",
state_variants={
ExitState.LOCKED: "A locked iron gate blocks the way.",
ExitState.HIDDEN: "", # Invisible until found
},
hidden_until={"perception": (">=", 15)},
)
Using the Grid System¶
The grid system provides coordinate-based room management with automatic exit creation and pathfinding. Use it for structured areas like towns, dungeons, or buildings.
Enabling Grid Mode¶
In a batch file or content pack:
from maid_engine.core.grid import GridManager, GridCoord
# Create grid manager with auto-exits
grid = GridManager(
world=engine.world,
auto_create_exits=True,
allow_diagonals=True,
)
Creating a Grid Area¶
In-Game Command¶
Creates a 10x10 grid of rooms with coordinates (0,0) to (10,10).
Programmatically¶
from maid_engine.core.grid import GridManager, GridCoord
def create_room(coord: GridCoord):
room_id = uuid4()
# Create room entity with the coordinate...
return room_id
# Create 10x10 grid
rooms = grid.create_grid_area(
GridCoord(0, 0),
GridCoord(9, 9),
room_factory=create_room,
)
Coordinate System¶
- X: East (+) / West (-)
- Y: North (+) / South (-)
- Z: Up (+) / Down (-)
Finding Paths¶
result = grid.find_path(start_room_id, end_room_id)
if result.found:
print(f"Directions: {result.directions}") # ['n', 'ne', 'e']
print(f"Distance: {result.length}")
print(f"Cost: {result.total_cost}")
Terrain Costs¶
Different terrain types affect pathfinding:
# Easy terrain
grid.register_room(room_id, GridCoord(0, 0), movement_cost=0.8)
# Difficult terrain
grid.register_room(room_id, GridCoord(1, 0), movement_cost=2.0)
# Impassable
grid.register_room(room_id, GridCoord(2, 0), blocked=True)
Grid Commands Reference¶
@grid create <min_x> <min_y> <max_x> <max_y> - Create grid area
@grid info - Show grid statistics
@grid block <x> <y> [z] - Block coordinate
@grid unblock <x> <y> [z] - Unblock coordinate
@grid room <x> <y> [z] - Show room at coordinate
@grid path <room1> <room2> - Find path between rooms
@grid export <filename> - Export grid to file
@grid import <filename> - Import grid from file
See the Grid System Guide for complete documentation.
Procedural Wilderness Generation¶
The wilderness system generates rooms on-demand as players explore, creating consistent terrain based on noise algorithms.
Enabling Wilderness¶
from maid_engine.world import WildernessManager, WildernessConfig, Landmark
config = WildernessConfig(
seed=42, # Same seed = same terrain
min_x=-1000, max_x=1000,
min_y=-1000, max_y=1000,
cleanup_interval=300.0, # Clean up empty rooms
room_max_age=600.0,
)
wilderness = WildernessManager(world=engine.world, config=config)
Biomes¶
The terrain generator creates these biomes:
| Biome | Conditions | Movement Cost |
|---|---|---|
| Plains | Default moderate elevation | 0.8 |
| Forest | Moderate moisture | 1.0 |
| Desert | Hot and dry | 1.5 |
| Tundra | Cold | 1.5 |
| Mountain | High elevation | 2.0 |
| Swamp | High moisture near water | 2.0 |
| Water | Low elevation | 3.0 |
Adding Landmarks¶
Landmarks anchor procedural terrain with fixed locations:
# Town that's always at (0, 0)
wilderness.add_landmark(Landmark(
coord=(0, 0),
name="Starting Town",
room_id=town_room_id, # Pre-existing room
radius=5,
biome_override="plains",
))
# Dungeon entrance
wilderness.add_landmark(Landmark(
coord=(500, 300),
name="Dragon's Lair",
radius=3,
description="A dark cave entrance looms ahead.",
metadata={"dungeon_id": "dragons_lair"},
))
Wilderness Commands¶
@wilderness info - Show wilderness statistics
@wilderness biome <x> <y> - Show biome at coordinate
@wilderness preview <x> <y> - Preview terrain
@wilderness landmark add <name> <x> <y> - Add landmark
@wilderness landmark remove <x> <y> - Remove landmark
@wilderness landmark list - List all landmarks
@wilderness cleanup - Manually trigger cleanup
@wilderness generate <x> <y> - Force generate room
See the Wilderness System Guide for complete documentation.
Zone Management¶
Zones (or areas) group related rooms for organization, access control, and events.
Creating Zones¶
Assigning Rooms to Zones¶
Zone Information¶
Zone Properties¶
Set zone-wide properties in batch files or code:
zone = Zone(
name="Darkwood Forest",
level_range=(5, 15),
respawn_rate=300.0,
pvp_enabled=False,
flags={"outdoor", "wilderness"},
)
Zone-Based Features¶
Zones enable:
- Level-appropriate spawns: Monsters scale to zone level range
- PvP control: Enable/disable PvP per zone
- Weather: Zones can have independent weather
- Events: Zone-wide events (invasions, festivals)
- Access control: Restrict entry by level or faction
Best Practices¶
Naming Conventions¶
| Type | Convention | Example |
|---|---|---|
| Rooms | Title Case | "The Grand Hall" |
| Zones | Title Case | "Darkwood Forest" |
| Exits | lowercase | "north", "secret_door" |
| Tags | snake_case | "safe_zone", "no_teleport" |
Organization Tips¶
- Plan before building: Sketch your area layout first
- Use zones early: Assign rooms to zones as you create them
- Consistent descriptions: Maintain a consistent tone and style
- Test navigation: Walk through your area as a player would
- Document landmarks: Keep notes on important locations
Performance Considerations¶
- Batch creation: Use batch files for large areas
- Wilderness limits: Set reasonable boundaries
- Room cleanup: Enable wilderness cleanup for procedural areas
- Grid size: Consider memory when creating large grids
Testing Your World¶
@goto #room-uuid - Teleport to test locations
@find room name=*test* - Find test rooms
@purge type:item --global - Clean up test items
Example: Creating a Small Town¶
Here's a complete example of creating a town:
# Start at the center
@create room Town Square
@describe here The central square of the town, with a well at its center.
@zone create Riverside Town
@zone assign "Riverside Town" here
@attribute here add safe_zone
@attribute here add no_combat
# Create surrounding buildings
@dig north = The Rusty Tankard
@describe here A cozy tavern with a roaring fireplace.
@zone assign "Riverside Town" here
@dig up = Guest Rooms
@describe here A narrow hallway with doors to small guest rooms.
@zone assign "Riverside Town" here
@dig down # Back to tavern
@dig south # Back to square
@dig east = General Store
@describe here Shelves lined with various goods and supplies.
@zone assign "Riverside Town" here
@attribute here add shop
@dig west # Back to square
@dig south = Town Gate
@describe here The main entrance to the town, flanked by two guards.
@zone assign "Riverside Town" here
@dig south = Forest Road
@describe here A dirt road leading into the dark forest.
# Don't add to town zone - it's wilderness
@dig north # Back to gate
@dig north # Back to square
@dig west = Temple of Light
@describe here A serene temple with stained glass windows.
@zone assign "Riverside Town" here
@attribute here add safe_zone
@attribute here add heal_point
Related Documentation¶
- Building Commands Reference - Complete command reference
- Grid System Guide - Detailed grid documentation
- Wilderness System Guide - Procedural generation details
- Extended Room Features - Dynamic room descriptions
- Advanced Command System - Building command customization