procedural-generation
Algorithmic technique for generating game content like terrains and levels using noise functions and rules.
What this skill does
## Purpose
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.
## When to Use
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.
## Key Capabilities
- Generate 2D/3D terrains via noise functions (e.g., Perlin, Simplex) with parameters for scale, octaves, and persistence.
- Create levels using rule-based algorithms, such as cellular automata for cave generation or binary space partitioning for dungeons.
- Support custom seed values for reproducible outputs, integrating with game engines like Unity or Godot.
- Handle multi-threaded generation for performance in real-time applications.
- Export results in formats like JSON for meshes or PNG for heightmaps.
## Usage Patterns
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:
- CLI command: `openclaw generate terrain --noise perlin --seed 42 --width 256 --height 256 --output terrain.json`
- In code (Python): `import openclaw; terrain_data = openclaw.api.generate_terrain({'noise': 'perlin', 'seed': 42, 'width': 256})`
Example 2: Creating a procedural level with rules:
- CLI command: `openclaw generate level --rules '{"min_rooms": 5, "max_rooms": 10}' --seed 123 --output level.yaml`
- In code (JavaScript): `const 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`.
## Common Commands/API
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:
- POST /api/procedural/generate: Body as JSON, e.g., `{"type": "terrain", "params": {"noise": "perlin", "seed": 42}}`; requires header `Authorization: Bearer $OPENCLAW_API_KEY`.
- GET /api/procedural/status: Query job status; e.g., `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}`.
## Integration Notes
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'`.
## Error Handling
Always wrap API/CLI calls in try-catch blocks; check for common errors like invalid parameters or network issues.
- For CLI: Parse errors from stdout, e.g., if `--noise` is invalid, it returns "Error: Unknown noise type"; handle with scripts: `if [ $? -ne 0 ]; then echo "Generation failed"; fi`.
- For API: Catch HTTP errors, e.g., in Python: `try: response = openclaw.api.generate_terrain({...}) except openclaw.APIError as e: print(e.code) # e.g., 400 for bad request`.
- Specific cases: If seed is non-integer, API returns 422; validate inputs first, e.g., `if not isinstance(seed, int): raise ValueError("Seed must be an integer")`.
- Use retries for transient errors: In code, `for attempt in range(3): try: openclaw.api.generate(...) except: time.sleep(1)`.
## Graph Relationships
- Related to: level-design (shares game-dev cluster for combined level building), asset-creation (uses generated content as inputs).
- Depends on: noise-libraries (for underlying noise functions), game-engines (for integration hooks).
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.