loenn-mcp

v5.2.0
loenn-mcp Checked 3 days ago Published 5 months ago

Celeste map editor for AI agents — MCP server for reading, editing, previewing, and procedurally generating .bin map files

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_maps

List all .bin map files in the project.

ParameterTypeDescription
subdirstringSubdirectory to search (default: "Maps")

read_map_overview

Parse a .bin map file and return a summary of rooms and structure.

ParameterTypeDescription
map_path *stringPath to the .bin file (relative to workspace or absolute)

read_room

Get detailed data for a specific room: tiles, entities, triggers.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name (with or without 'lvl_' prefix)

get_room_tiles

Get the complete tile grid for a room as text.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name
layerstring"fg" for foreground (solids), "bg" for background

add_entity

Add an entity to a room and save the map.

ParameterTypeDescription
entity_name *stringEntity type (e.g. "player", "MaggyHelper/KirbyBoss")
map_path *stringPath to the .bin file
room_name *stringRoom name
x *integerX position in pixels
y *integerY position in pixels
entity_idintegerEntity ID (-1 to auto-assign)
heightintegerEntity height (0 if inapplicable)
propertiesstringJSON object string of extra properties
widthintegerEntity width (0 if inapplicable)

remove_entity

Remove an entity from a room by its ID.

ParameterTypeDescription
entity_id *integerEntity ID to remove
map_path *stringPath to the .bin file
room_name *stringRoom name

add_trigger

Add a trigger to a room and save the map. Triggers are rectangular regions that fire effects when the player enters them (dialog, camera moves, music changes, flag toggles, etc.). Trigger IDs are auto-assigned to be unique across both entities and triggers in the room.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name
trigger_name *stringTrigger type (e.g. "everest/dialogTrigger", "2.5DHelper/StarterFlagTrigger")
x *integerX position in pixels
y *integerY position in pixels
heightintegerTrigger height in pixels (default 16)
nodesstringJSON array of {"x": int, "y": int} objects for triggers that need path/target nodes (e.g. cameraTargetTrigger). Default "[]".
propertiesstringJSON object string of extra properties (e.g. '{"dialog_id": "MAP_INTRO"}')
trigger_idintegerTrigger ID (-1 to auto-assign)
widthintegerTrigger width in pixels (default 16)

remove_trigger

Remove a trigger from a room by its ID.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name
trigger_id *integerTrigger ID to remove

set_room_tiles

Set tile data for a room. Each row is a line of characters ('0'=air).

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name
tiles *stringTile data (newline-separated rows, 1 char per tile)
layerstring"fg" for foreground (solids), "bg" for background

add_room

Add a new empty room to a map.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name (prefixed with 'lvl_' if needed)
darkbooleanWhether the room is dark
heightintegerRoom height in pixels (multiple of 8)
spacebooleanWhether the room has space physics
widthintegerRoom width in pixels (multiple of 8)
xintegerRoom X position in pixels
yintegerRoom Y position in pixels

remove_room

Remove a room from a map.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name to remove

create_map

Create a new empty Celeste .bin map file.

ParameterTypeDescription
map_path *stringPath for the new file (relative to workspace)
package_namestringMap package name (e.g. "Maggy/PCG/MyMap")

list_stylegrounds

List all stylegrounds (foreground + background effects) in a map. Stylegrounds live under Style/Foregrounds and Style/Backgrounds. Each entry is shown with its top-level index (used by remove_styleground / update_styleground), the effect type, and a few key attributes. Children of `apply` group elements are listed indented underneath their group.

ParameterTypeDescription
map_path *stringPath to the .bin file

add_styleground

Add a styleground effect to a map. Stylegrounds are layered visual effects (parallax backgrounds, custom Lua effects like 2.5DHelper/VoidBg, snow/dust overlays, etc.) rendered behind or in front of every room. They live under Style/Foregrounds or Style/Backgrounds — auto-created if missing.

ParameterTypeDescription
effect_name *stringEffect type (e.g. "parallax", "2.5DHelper/VoidBg", "WhiteholeBg", "apply" for a group element)
map_path *stringPath to the .bin file
indexintegerPosition to insert at (-1 appends to the end)
layerstring"bg" / "background" / "backgrounds" (default), or "fg" / "foreground" / "foregrounds"
propertiesstringJSON object of effect properties (e.g. '{"texture": "bgs/01/bg", "only": "lvl_a-01"}')

remove_styleground

Remove a styleground from a map by its index in the layer. Use list_stylegrounds first to see the current indices.

ParameterTypeDescription
index *integer0-based index of the styleground in that layer
layer *string"fg"/"foregrounds" or "bg"/"backgrounds"
map_path *stringPath to the .bin file

update_styleground

Merge properties into an existing styleground without replacing it. Existing keys in `properties` overwrite the styleground's values; keys not present in `properties` are left unchanged. To clear a key, pass its value as null.

ParameterTypeDescription
index *integer0-based index of the styleground in that layer
layer *string"fg"/"foregrounds" or "bg"/"backgrounds"
map_path *stringPath to the .bin file
properties *stringJSON object of properties to merge in

list_entity_definitions

List available Lönn entity definitions from the project.

ParameterTypeDescription
filter_textstringOptional text to filter filenames

get_entity_definition

Read a Lönn entity Lua definition and extract its properties.

ParameterTypeDescription
entity_file *stringFilename (e.g. "kirbyBoss" or "kirbyBoss.lua")

list_trigger_definitions

List available Lönn trigger definitions.

ParameterTypeDescription
filter_textstringOptional text to filter filenames

list_effect_definitions

List available Lönn effect definitions.

ParameterTypeDescription
filter_textstringOptional text to filter filenames

analyze_map

Get detailed statistics about a map file.

ParameterTypeDescription
map_path *stringPath to the .bin file

visualize_map_layout

Generate an ASCII visualization of all room positions in a map.

ParameterTypeDescription
map_path *stringPath to the .bin file

preview_map_section

Generate an ASCII preview of a map section, like a Lönn mini-map. Shows room boxes with names, borders drawn with box-drawing characters, checkpoint markers, and entity counts. Zoom into a specific area by providing a room prefix (e.g. "g-") or a center room name.

ParameterTypeDescription
map_path *stringPath to the .bin file
center_roomstringCenter the view on this room name
colsintegerTerminal width for the preview (default 140)
prefixstringOnly show rooms whose name starts with this (e.g. "g-", "h-")
rowsintegerTerminal height for the preview (default 60)

render_map_html

Render an interactive HTML map preview with zoom, pan, search, and detail panel. Features: zoom/pan (wheel, drag, pinch), hover tooltips, click-to-select room detail panel (entity/trigger breakdown), live search filter, minimap with viewport indicator, toggleable grid and labels, keyboard shortcuts.

ParameterTypeDescription
map_path *stringPath to the .bin file
output_filestringOutput HTML filename (default: map_preview.html in Temp/)
prefixstringOnly show rooms matching this prefix (e.g. "g-", "w-")

build_pattern_library

Scan local .bin maps and extract room patterns into a reusable library. The library is saved as JSON and is used by generate_room_from_pattern. Run this once (or whenever you add new reference maps) to populate the pattern pool.

ParameterTypeDescription
attributionstringFree-text attribution / author credit stored in each extracted pattern (useful when building from mod maps).
map_pathsstringJSON array of map paths relative to the workspace, e.g. '["Maps/01_City.bin","Maps/02_Cliffs.bin"]'. Pass "" to scan every .bin file under Maps/.
output_pathstringOutput JSON path (relative to workspace). Default: "PCG/patterns.json"

generate_room_from_pattern

Generate a new room using patterns from the library and a randomness strategy. Picks the best matching pattern for the chosen strategy, generates a tile grid and entity set with seeded randomness, then writes the room to the map.

ParameterTypeDescription
map_path *stringPath to the .bin file to write the room into. The file must exist (create it with create_map first).
room_name *stringName for the new room (lvl_ prefix added automatically).
heightintegerRoom height in pixels (multiple of 8, default 184).
library_pathstringPath to the pattern library JSON (default: PCG/patterns.json).
model_profilestringSeed-selection profile — creative/deterministic/architect.
seedintegerInteger seed >= 0 for reproducible output; -1 = auto.
strategystringGeneration strategy — balanced/exploration/challenge/speedrun.
widthintegerRoom width in pixels (multiple of 8, default 320).
xintegerRoom X position in pixels.
yintegerRoom Y position in pixels.

validate_room

Check a room for common playability problems. Reports issues such as: missing player spawn, no floor tiles, entity positions outside room bounds, or invalid dimensions. An empty warning list means the room passed all checks.

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_name *stringRoom name (with or without 'lvl_' prefix).

ingest_external_map

Download a Celeste map from an external URL and extract room patterns.

ParameterTypeDescription
source_url *stringURL to a .bin file, .zip archive, or GameBanana mod page.
attributionstringAuthor / licence credit (required for good practice).
confirm_downloadbooleanMust be True to actually download. Pass False to do a dry-run that shows what would happen.
library_pathstringPath to the pattern library JSON (default: PCG/patterns.json).
tagsstringComma-separated or JSON-array tags to apply to extracted patterns.

generate_map_from_image

Convert a color-mapped image into a full playable Celeste map. Each pixel (or pixel block when scale > 1) in the source image is interpreted as one 8×8 tile in the map. Colors are mapped to tile types and entities using either the default color map or a custom one.

ParameterTypeDescription
image_path *stringPath to the source image (PNG, JPG, BMP, etc.) relative to the workspace.
color_map_jsonstringOptional custom color map as JSON object. Keys are hex colors (e.g. "#FF0000"), values are role strings (solid/air/spike/spawn/jumpthru/ strawberry/spring/refill/cr…
output_pathstringOutput .bin map file path (relative to workspace). Default: auto-generated from image filename.
package_namestringCeleste map package name (default: "ImageMap").
room_height_tilesintegerMax room height in tiles (default 23 = 184px).
room_width_tilesintegerMax room width in tiles (default 40 = 320px).
scaleintegerPixels per tile — 1 means each pixel = one tile. Use higher values for large images (e.g. scale=4 means every 4×4 pixel block = one tile).
toleranceintegerColor matching tolerance (0-255). Higher = more lenient matching. Default 64.

generate_terrain_map

Generate a procedural Celeste map using Perlin noise and Voronoi biomes. Creates a complete playable map with terrain shaped by Perlin noise and biome regions defined by Voronoi diagrams. Inspired by procedural map generators that combine noise-based heightmaps with regional variety. Each room is assigned a biome (mountain, forest, plains, lake, cave, summit) based on its Voronoi region and local noise value. Tile density, platform placement, hazards, and collectibles are all biome-aware.

ParameterTypeDescription
biome_setstringComma-separated or JSON array of biomes to use. Default (empty): use all biomes. Example: "mountain,cave,summit" or '["forest","plains"]'
difficultyinteger1-5 difficulty scale (default 3). Affects hazard count and tile density.
frequencynumberPerlin noise frequency — lower = smoother terrain. Range 2-32 recommended (default 8).
height_roomsintegerNumber of rooms vertically (default 3).
output_pathstringOutput .bin map file path (relative to workspace). Default: auto-generated as "Maps/TerrainGen/seed_<N>.bin".
package_namestringCeleste map package name (default: "TerrainGen").
room_height_tilesintegerTiles per room height (default 23 = 184px).
room_width_tilesintegerTiles per room width (default 40 = 320px).
seedintegerInteger seed for reproducible generation. -1 = generate random seed.
voronoi_pointsintegerNumber of biome region centres (default 12). More points = smaller, more varied regions.
width_roomsintegerNumber of rooms horizontally (default 4).

preview_terrain_biomes

Preview the biome layout for a terrain generation without creating the map. Shows an ASCII grid of which biome each room would get, useful for trying different seeds and parameters before committing to generation.

ParameterTypeDescription
biome_setstringComma-separated or JSON array of biomes.
frequencynumberPerlin noise frequency.
height_roomsintegerNumber of rooms vertically.
seedintegerInteger seed for the preview.
voronoi_pointsintegerNumber of Voronoi biome centres.
width_roomsintegerNumber of rooms horizontally.

read_map_metadata

Read high-level metadata from a map without listing all room contents. Returns package name, room count, total entity/trigger counts, world bounds, and style information.

ParameterTypeDescription
map_path *stringPath to the .bin file.

search_entities

Search for entities across all rooms (or a specific room) by type and/or position.

ParameterTypeDescription
map_path *stringPath to the .bin file.
entity_typestringFilter by entity type name (substring match). Empty = all.
max_xintegerMaximum X position filter.
max_yintegerMaximum Y position filter.
min_xintegerMinimum X position filter.
min_yintegerMinimum Y position filter.
room_namestringSearch only in this room. Empty = all rooms.

search_triggers

Search for triggers across all rooms by type.

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_namestringSearch only in this room. Empty = all rooms.
trigger_typestringFilter by trigger type (substring match). Empty = all.

compare_rooms

Compare two rooms in the same map side-by-side. Shows differences in size, entity counts, tile coverage, and difficulty.

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_a *stringFirst room name.
room_b *stringSecond room name.

update_entity

Update properties of an existing entity by ID.

ParameterTypeDescription
entity_id *integerID of the entity to update.
map_path *stringPath to the .bin file.
properties_json *stringJSON object of properties to set/update. Example: '{"x": 100, "y": 50, "width": 16}'
room_name *stringRoom containing the entity.

move_entity

Move an entity to a new position.

ParameterTypeDescription
entity_id *integerID of the entity to move.
map_path *stringPath to the .bin file.
room_name *stringRoom containing the entity.
x *integerNew X position.
y *integerNew Y position.

update_room

Update room-level properties (music, dark, wind, etc.).

ParameterTypeDescription
map_path *stringPath to the .bin file.
properties_json *stringJSON object of properties to update. Example: '{"dark": true, "windPattern": "Left"}'
room_name *stringRoom name (with or without lvl_ prefix).

clone_room

Clone an existing room to a new name and position.

ParameterTypeDescription
map_path *stringPath to the .bin file.
new_name *stringName for the cloned room.
source_room *stringName of the room to clone.
xintegerX position for the clone (-1 = place to the right of source).
yintegerY position for the clone (-1 = same Y as source).

batch_add_entities

Add multiple entities to a room in one call.

ParameterTypeDescription
entities_json *stringJSON array of entity objects. Each must have "__name". Optional: x, y, width, height, etc. IDs are auto-assigned. Example: '[{"__name":"strawberry","x":100,"y":50},…
map_path *stringPath to the .bin file.
room_name *stringTarget room name.

list_decals

List all decals in a room (foreground or background).

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_name *stringRoom name.
layerstring"fg" for foreground decals, "bg" for background decals.

add_decal

Add a decal to a room.

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_name *stringTarget room.
texture *stringDecal texture path (e.g. "decals/1-forsakencity/flag_a00").
x *integerX position.
y *integerY position.
layerstring"fg" or "bg".
scale_xnumberHorizontal scale (default 1.0).
scale_ynumberVertical scale (default 1.0).

remove_decal

Remove a decal by index.

ParameterTypeDescription
index *integerDecal index (from list_decals output).
map_path *stringPath to the .bin file.
room_name *stringRoom name.
layerstring"fg" or "bg".

analyze_entity_usage

Analyze entity usage across the entire map. Shows total counts, unique types, and per-room breakdown of entity usage.

ParameterTypeDescription
map_path *stringPath to the .bin file.

analyze_difficulty

Estimate room or map difficulty from hazard density, nav aids, and tile coverage.

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_namestringSpecific room to analyze. Empty = analyze all rooms.

find_entity_references

Find all occurrences of an entity type across the map.

ParameterTypeDescription
entity_type *stringEntity type to search for (exact match).
map_path *stringPath to the .bin file.

detect_map_patterns

Detect gameplay design archetypes (linear, hub, collectible-rich, etc.). Analyzes room layout, entity distribution, and map structure to identify design patterns.

ParameterTypeDescription
map_path *stringPath to the .bin file.

analyze_room_connectivity

Analyze room adjacency graph showing isolated rooms, dead ends, and hubs. Rooms are considered connected if they share an edge (within 8px tolerance).

ParameterTypeDescription
map_path *stringPath to the .bin file.

suggest_improvements

Suggest improvements for a room based on analysis. Checks for missing spawns, missing floors, difficulty balance issues, and empty rooms.

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_name *stringRoom to analyze.

compare_maps

Compare two maps and show structural differences.

ParameterTypeDescription
map_path_a *stringPath to first .bin file.
map_path_b *stringPath to second .bin file.

wiki_save

Save analysis results or notes to the local wiki cache. The wiki provides persistent local storage for analysis results so repeated queries are instant.

ParameterTypeDescription
content *stringText content to store.
key *stringUnique key for this entry (e.g. "difficulty/01_City_A").
tagsstringComma-separated tags for searching (e.g. "analysis,difficulty").

wiki_list

List all entries in the wiki cache.

wiki_get

Retrieve a specific wiki entry by key.

ParameterTypeDescription
key *stringThe entry key to look up.

get_mod_info

Get information about the current mod project. Reads everest.yaml/everest.yml if present, lists map count, and shows workspace structure.

validate_map

Validate an entire map for playability issues. Checks all rooms for common problems: missing spawns, no floor tiles, entities out of bounds, invalid dimensions.

ParameterTypeDescription
map_path *stringPath to the .bin file.
auto_fixbooleanIf True, automatically fix issues where possible (adds spawns, floor tiles, clamps entities).

get_trigger_definition

Read the source of a Lönn trigger definition .lua file.

ParameterTypeDescription
trigger_name *stringName of the trigger (searches in Loenn/triggers/).

get_effect_definition

Read the source of a Lönn effect definition .lua file.

ParameterTypeDescription
effect_name *stringName of the effect (searches in Loenn/effects/).

export_room_json

Export a room as a JSON file for external editing or sharing.

ParameterTypeDescription
map_path *stringPath to the .bin file.
room_name *stringRoom to export.
output_pathstringOutput JSON path (default: auto-generated).

import_room_json

Import a room from a JSON file into a map.

ParameterTypeDescription
json_path *stringPath to the JSON file (exported by export_room_json).
map_path *stringPath to the .bin file to import into.
new_namestringOptional new name for the room (overrides name in JSON).
xintegerX position override (-1 = use position from JSON).
yintegerY position override (-1 = use position from JSON).

summarize_map_diff

Create or compare a structural snapshot of the map. First call (or with new snapshot_key): saves current state to wiki. Subsequent call with same key: shows what changed since the snapshot.

ParameterTypeDescription
map_path *stringPath to the .bin file.
snapshot_keystringKey to identify this snapshot (default: map filename).

batch_validate_and_fix

Validate all rooms in a map and optionally auto-fix issues. Checks for: missing spawns, no floors, entities out of bounds, invalid dimensions. Auto-fix adds spawns, floor tiles, and clamps entities to room bounds.

ParameterTypeDescription
map_path *stringPath to the .bin file.
auto_fixbooleanIf True, apply automatic fixes.

get_room_settings

Get all editable settings for a room (music, physics, wind, camera, flags). Returns all metadata properties including music tracks, physics flags (dark/space/underwater), wind pattern, camera offsets, and music layers.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name (with or without 'lvl_' prefix)

update_room_settings

Update room settings (music, physics, wind, camera, flags) by merging a JSON object.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name
settings *stringJSON object of key/value pairs to update, e.g. '{"music": "event:/music/lvl2/beginning", "dark": true}'

rename_room

Rename a room in a map.

ParameterTypeDescription
map_path *stringPath to the .bin file
new_name *stringNew room name (lvl_ prefix added automatically if missing)
room_name *stringCurrent room name

move_room

Move a room to a new world-space position.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name
x *integerNew X position in pixels
y *integerNew Y position in pixels

resize_room

Resize a room (snaps to 8-pixel grid, preserves tile data).

ParameterTypeDescription
height *integerNew height in pixels (must be multiple of 8, min 40)
map_path *stringPath to the .bin file
room_name *stringRoom name
width *integerNew width in pixels (must be multiple of 8, min 40)

get_map_metadata

Read the map-level metadata block (Everest/celeste.yaml meta settings). Returns the meta node that stores settings like wipe type, intro type, heart texture, cassette song, and other map-wide overrides.

ParameterTypeDescription
map_path *stringPath to the .bin file

set_map_metadata

Set map-level metadata properties (Everest meta block). These properties control map-wide behaviour like wipe type, mountain colours, intro cutscene, heart/cassette song overrides, etc.

ParameterTypeDescription
map_path *stringPath to the .bin file
settings *stringJSON object of meta key/value pairs to set, e.g. '{"Wipe": "Mountain", "Dreaming": true}'

get_map_dependencies

Read the mod dependencies list from a map's everest.yaml or meta node. Scans the workspace for an everest.yaml alongside the map file, and also reads the Deps child element of the meta node if present.

ParameterTypeDescription
map_path *stringPath to the .bin file

set_map_dependencies

Write or update the mod dependency list in the map's everest.yaml. Creates or replaces the everest.yaml file in the same directory as the map.

ParameterTypeDescription
dependencies *stringJSON array of dependency objects, each with "Name" and "Version" fields. Use "Celeste" and "Everest" as base deps. Example: '[{"Name":"Everest","Version":"1.0.0"},…
map_path *stringPath to the .bin file

install_loenn_manager

Install the Lönn MCP Manager plugin into the Lönn plugins directory. Writes loenn_mcp_manager.lua to the specified directory. Drop this plugin into your Lönn plugins/ folder or your mod's Loenn/plugins/ to enable live two-way communication between Lönn and this MCP server.

ParameterTypeDescription
target_dirstringDirectory to install into (default: Loenn/plugins)

get_loenn_manager_source

Return the source code of the Lönn MCP Manager plugin. Use this to inspect or copy the plugin code without writing it to disk.

analyze_map_assets

ML-style analysis of a map's assets against the Maddie480 graphics dump. Extracts all texture references (parallax backgrounds, decals, entity textures) from the map and cross-references them against the known Celeste graphics dump from maddie480.ovh/celeste/graphics-dump-browser. Also validates entity names against the Lönn source entity catalog and detects unknown / missing assets that would cause in-game errors.

ParameterTypeDescription
map_path *stringPath to the .bin file
check_entitiesbooleanValidate entity names against Lönn catalog
check_texturesbooleanValidate parallax/decal texture paths
check_tilesetsbooleanValidate tileset character references
fetch_asset_indexbooleanIf True, attempt to fetch the asset index from maddie480.ovh (requires network access). If False, uses the built-in known-asset catalog.

ai_analyze_map

Analyze a map using Claude AI and get improvement suggestions. Requires ANTHROPIC_API_KEY environment variable. Get your API key from: https://console.anthropic.com/

ParameterTypeDescription
map_path *stringPath to the .bin file
analysis_typestringType of analysis - "general", "difficulty", "visual", "flow"
modelstringClaude model (default: claude-3-5-sonnet-20241022)

ai_describe_room

Generate an AI-powered narrative description of a room. Requires ANTHROPIC_API_KEY environment variable.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name (with or without 'lvl_' prefix)
modelstringClaude model (default: claude-3-5-sonnet-20241022)
stylestringDescription style - "atmospheric", "technical", "story", "brief"

ai_suggest_entities

Get AI suggestions for entity placement in a room. Requires ANTHROPIC_API_KEY environment variable.

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name
goalstringSuggestion goal - "improve_flow", "add_challenge", "reduce_difficulty", "add_secrets"
modelstringClaude model (default: claude-3-5-sonnet-20241022)

pcg_mdmc_presets

List all available MdMC configuration matrix presets. Returns the preset key (9-char matrix string) and its human-readable description. Pass one of these keys as the ``configuration`` parameter to pcg_markov_fill or pcg_pipeline.

pcg_skeleton_generate

Generate a skeleton room layout and add empty rooms to an existing map. Lays out non-overlapping rooms connected edge-to-edge (paper requirements 1-3). The first room is START (player spawn), the furthest room is END (golden berry destination). Rooms are added with solid border tiles and empty interiors — run pcg_markov_fill afterwards to fill the tiles.

ParameterTypeDescription
map_path *stringPath to the .bin file to add rooms to
ensure_loopbacksbooleanAdd extra connections to create loops in the layout
max_retriesintegerMax placement attempts per room before skipping
max_room_height_tilesintegerMaximum room height in tiles (×8 px)
max_room_width_tilesintegerMaximum room width in tiles (×8 px)
min_exit_width_tilesintegerMinimum exit width in tiles (default 3 = 24 px)
min_room_height_tilesintegerMinimum room height in tiles (×8 px, min 5)
min_room_width_tilesintegerMinimum room width in tiles (×8 px, min 5)
name_prefixstringPrefix for generated room names (e.g. skel_0, skel_1 …)
room_countintegerNumber of rooms to generate (default 12)
seedintegerRandom seed (-1 = random each run)
validate_connectivitybooleanWarn if any orphaned rooms are detected

pcg_markov_fill

Fill rooms with tiles using the MdMC/WFC algorithm (Markov Level Generator). Trains a Multi-dimensional Markov Chain (MdMC) or Wave Function Collapse (WFC) model on existing rooms in the map, then generates tile layouts for the specified rooms with backtracking, cleanup, auto-tiling, playability repair, and entity placement.

ParameterTypeDescription
map_path *stringPath to the .bin file
auto_tilebooleanBlend tile edges for smooth transitions
cleanup_passesintegerNumber of cleanup passes (remove isolated tiles)
configurationstring9-char MdMC matrix string (see pcg_mdmc_presets)
decal_densitynumberDecal density (0-1)
difficultyintegerDifficulty level 1-5 for pattern mode
ensure_playablebooleanPlatformer repair pass (BFS reachability + corridor carving)
generate_bgbooleanAlso generate background tiles
generation_modestring"mdmc", "wfc", or "hybrid"
hazard_densitynumberDensity of spikes (0-1)
max_backtrack_depthintegerMax tiles to backtrack on unseen n-gram
max_retriesintegerFull-room generation retries per room
min_interestingnessnumberMinimum interestingness to accept a generated room
place_decalsbooleanPlace background and foreground decals
place_entitiesbooleanPlace player spawn, strawberries, spikes after generation
place_triggersbooleanPlace camera/spawn triggers
room_namesstringComma-separated room names to fill (empty = all rooms)
seedintegerRandom seed (-1 = random each run)
spring_densitynumberDensity of springs (0-1)
train_sourcestring"all_rooms" (train on all rooms) or comma-separated names
trigger_modestring"camera", "spawn", "all", or "none"
use_enhanced_bgbooleanDepth-appropriate BG fill
use_pattern_modebooleanPattern mode (marioGen-v2 style) instead of MdMC
w1numberWeight for global NLE density in interestingness score
w2numberWeight for local NLE density (AOI) in interestingness score
w3numberWeight for NLE diversity (Shannon entropy) in interestingness score

pcg_score_room

Score a room's interestingness and difficulty (paper §4.2, §4.3). Interestingness I = w1·global_NLE_density + w2·local_NLE_density + w3·entropy Difficulty D = z1·hole_frequency + z2·local_LE_density + z3·NLE_scarcity NLE = Non-Linear Element (air cell with ≥2 solid neighbours, indicating branching or complex geometry). LE = Linear Element (straight solid run).

ParameterTypeDescription
map_path *stringPath to the .bin file
room_name *stringRoom name (with or without 'lvl_' prefix)
w1numberWeight for global NLE density in interestingness (default 1.0)
w2numberWeight for local NLE density (AOI) in interestingness (default 1.0)
w3numberWeight for NLE diversity (Shannon entropy) in interestingness (default 1.0)
z1numberWeight for hole frequency in difficulty (default 1.0)
z2numberWeight for local LE density in difficulty (default 1.0)
z3numberWeight for NLE scarcity in difficulty (default 1.0)

pcg_pipeline

End-to-end PCG pipeline: skeleton → MdMC/WFC tile fill → repair → entities. Combines the Celeste Skeleton Generator and Markov Level Generator into a single one-shot generator. Trains on existing rooms in the map, generates a skeleton of non-overlapping rooms, fills each room with tiles using the chosen algorithm, runs playability repair, and places entities/decals/triggers.

ParameterTypeDescription
map_path *stringPath to the .bin file (rooms are added to this map)
auto_tilebooleanBlend tile edges for smooth transitions
carve_exitsbooleanCarve 3-tile-wide doorways between adjacent rooms
cleanup_passesintegerNumber of cleanup passes
configurationstring9-char MdMC matrix string (see pcg_mdmc_presets)
decal_densitynumberDecal density (0-1)
difficultyintegerDifficulty level 1-5 for pattern mode / hazard density
ensure_playablebooleanPlatformer repair pass
generate_bgbooleanAlso generate background tiles
generation_modestring"mdmc", "wfc", or "hybrid"
hazard_densitynumberDensity of spikes placed on walkable surfaces (0-1)
max_backtrack_depthintegerMax tiles to backtrack on unseen n-gram
min_interestingnessnumberMinimum interestingness to accept a room (0 = accept any)
name_prefixstringPrefix for generated room names (gen_0, gen_1 …)
place_decalsbooleanPlace background/foreground decals
place_entitiesbooleanPlace player spawn, strawberries, spikes, springs
place_triggersbooleanPlace camera/spawn triggers
probanumberSkeleton pathway/labyrinth parameter. 0=pathway (chain), 1=labyrinth (random attach), 0.5=balanced
room_countintegerNumber of rooms to generate (default 8)
room_height_tilesintegerHeight of every room in tiles (×8 px)
room_width_tilesintegerWidth of every room in tiles (×8 px)
seedintegerRandom seed (-1 = random each run)
spring_densitynumberDensity of springs in vertical passages (0-1)
tries_limitintegerFull-room generation retries per room
trigger_modestring"camera", "spawn", "all", or "none"
use_enhanced_bgbooleanDepth-appropriate BG fill
use_pattern_modebooleanPattern mode (marioGen-v2) instead of MdMC
w1numberInterestingness weight — global NLE density
w2numberInterestingness weight — local NLE density (AOI)
w3numberInterestingness weight — NLE diversity (Shannon entropy)
z1numberDifficulty weight — hole frequency
z2numberDifficulty weight — local LE density
z3numberDifficulty weight — NLE scarcity