skills/game-dev/procedural-generation/SKILL.md
Algorithmic technique for generating game content like terrains and levels using noise functions and rules.
npx skillsauth add alphaonedev/openclaw-graph procedural-generationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill allows OpenClaw to programmatically generate game content, such as terrains and levels, using algorithms like Perlin noise and rule-based systems, reducing manual design effort.
Apply this skill for dynamic content in games where variability is key, like procedural worlds in roguelikes or infinite runners, or when optimizing for replayability and asset efficiency in resource-constrained projects.
Always initialize with a seed for consistency; use CLI for quick prototyping and API for integration. Provide exact parameters to avoid defaults.
Example 1: Generating a Perlin terrain for a game world:
openclaw generate terrain --noise perlin --seed 42 --width 256 --height 256 --output terrain.jsonimport openclaw; terrain_data = openclaw.api.generate_terrain({'noise': 'perlin', 'seed': 42, 'width': 256})Example 2: Creating a procedural level with rules:
openclaw generate level --rules '{"min_rooms": 5, "max_rooms": 10}' --seed 123 --output level.yamlconst openclaw = require('openclaw'); const level = openclaw.api.generate_level({rules: {min_rooms: 5}, seed: 123});Follow patterns by chaining commands, e.g., generate then validate: openclaw generate terrain ... && openclaw validate output.json.
Use the OpenClaw CLI or REST API; authenticate via $OPENCLAW_API_KEY environment variable.
CLI Commands:
openclaw generate terrain [flags]: Flags include --noise [type] (e.g., perlin), --seed [int], --scale [float]; e.g., openclaw generate terrain --noise perlin --seed 42.openclaw generate level [flags]: Flags include --rules [JSON string]; e.g., openclaw generate level --rules '{"type": "dungeon"}'.openclaw validate [file]: Checks generated output; e.g., openclaw validate terrain.json --check integrity.API Endpoints:
{"type": "terrain", "params": {"noise": "perlin", "seed": 42}}; requires header Authorization: Bearer $OPENCLAW_API_KEY.GET /api/procedural/status?job_id=123 with auth header.Config formats: Use JSON for API bodies, e.g., {"noise": "perlin", "octaves": 4}; for CLI, pass as flags or files, e.g., --config config.json where config.json is {"seed": 42}.
Set $OPENCLAW_API_KEY in your environment before calls; integrate into game loops by importing the OpenClaw SDK and calling async functions. For Unity, use a C# wrapper: OpenClawAPI.GenerateTerrain(new Dictionary<string, object> { {"noise", "perlin"} });. In Godot, hook into scripts: var result = OpenClaw.generate_level({"rules": {"min_rooms": 5}}). Ensure error logging is enabled via SDK config, e.g., set openclaw.config.log_level = 'debug'.
Always wrap API/CLI calls in try-catch blocks; check for common errors like invalid parameters or network issues.
--noise is invalid, it returns "Error: Unknown noise type"; handle with scripts: if [ $? -ne 0 ]; then echo "Generation failed"; fi.try: response = openclaw.api.generate_terrain({...}) except openclaw.APIError as e: print(e.code) # e.g., 400 for bad request.if not isinstance(seed, int): raise ValueError("Seed must be an integer").for attempt in range(3): try: openclaw.api.generate(...) except: time.sleep(1).tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui