procedural-generation
Algorithmic technique for generating game content like terrains and levels using noise functions and rules.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o procedural-generation.zip https://jpskill.com/download/22223.zip && unzip -o procedural-generation.zip && rm procedural-generation.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/22223.zip -OutFile "$d\procedural-generation.zip"; Expand-Archive "$d\procedural-generation.zip" -DestinationPath $d -Force; ri "$d\procedural-generation.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
procedural-generation.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
procedural-generationフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
目的
このスキルは、OpenClaw が Perlin ノイズやルールベースシステムなどのアルゴリズムを使用して、地形やレベルといったゲームコンテンツをプログラムで生成することを可能にし、手作業によるデザインの労力を削減します。
使用する場面
ローグライクや無限ランナーゲームにおけるプロシージャルワールドのように、可変性が重要となるゲームの動的なコンテンツにこのスキルを適用してください。また、リソースが限られたプロジェクトで、リプレイ性とアセット効率を最適化する場合にも適しています。
主な機能
- ノイズ関数(例:Perlin、Simplex)を介して2D/3D地形を生成します。スケール、オクターブ、パーシステンスのパラメータを設定できます。
- セルオートマトンによる洞窟生成や、二分空間分割によるダンジョン生成など、ルールベースのアルゴリズムを使用してレベルを作成します。
- 再現可能な出力のためにカスタムシード値をサポートし、Unity や Godot などのゲームエンジンと統合します。
- リアルタイムアプリケーションでのパフォーマンスのために、マルチスレッド生成を処理します。
- メッシュの場合は JSON、ハイトマップの場合は PNG など、さまざまな形式で結果をエクスポートします。
使用パターン
一貫性を保つために常にシードで初期化し、迅速なプロトタイピングには CLI を、統合には API を使用してください。デフォルト値を避けるために正確なパラメータを指定してください。
例1:ゲームワールドの Perlin 地形を生成する:
- CLI コマンド:
openclaw generate terrain --noise perlin --seed 42 --width 256 --height 256 --output terrain.json - コード内 (Python):
import openclaw; terrain_data = openclaw.api.generate_terrain({'noise': 'perlin', 'seed': 42, 'width': 256})
例2:ルールを使用してプロシージャルレベルを作成する:
- CLI コマンド:
openclaw generate level --rules '{"min_rooms": 5, "max_rooms": 10}' --seed 123 --output level.yaml - コード内 (JavaScript):
const openclaw = require('openclaw'); const level = openclaw.api.generate_level({rules: {min_rooms: 5}, seed: 123});
コマンドを連結することでパターンに従ってください。例えば、生成してから検証する: openclaw generate terrain ... && openclaw validate output.json。
一般的なコマンド/API
OpenClaw CLI または REST API を使用してください。$OPENCLAW_API_KEY 環境変数で認証します。
-
CLI コマンド:
openclaw generate terrain [flags]: フラグには--noise [type](例: perlin)、--seed [int]、--scale [float]が含まれます。例:openclaw generate terrain --noise perlin --seed 42。openclaw generate level [flags]: フラグには--rules [JSON string]が含まれます。例:openclaw generate level --rules '{"type": "dungeon"}'。openclaw validate [file]: 生成された出力をチェックします。例:openclaw validate terrain.json --check integrity。
-
API エンドポイント:
- POST /api/procedural/generate: ボディは JSON 形式です。例:
{"type": "terrain", "params": {"noise": "perlin", "seed": 42}}。ヘッダーAuthorization: Bearer $OPENCLAW_API_KEYが必要です。 - GET /api/procedural/status: ジョブステータスを照会します。例:
GET /api/procedural/status?job_id=123(認証ヘッダー付き)。
- POST /api/procedural/generate: ボディは JSON 形式です。例:
設定形式: API ボディには JSON を使用します。例: {"noise": "perlin", "octaves": 4}。CLI の場合は、フラグまたはファイルとして渡します。例: --config config.json (ここで config.json は {"seed": 42} です)。
統合に関する注意点
呼び出しの前に $OPENCLAW_API_KEY を環境に設定してください。OpenClaw SDK をインポートし、非同期関数を呼び出すことでゲームループに統合します。Unity の場合は、C# ラッパーを使用します: OpenClawAPI.GenerateTerrain(new Dictionary<string, object> { {"noise", "perlin"} });。Godot の場合は、スクリプトにフックします: var result = OpenClaw.generate_level({"rules": {"min_rooms": 5}})。SDK 設定を介してエラーロギングが有効になっていることを確認してください。例: openclaw.config.log_level = 'debug' を設定します。
エラー処理
API/CLI 呼び出しは常に try-catch ブロックで囲んでください。無効なパラメータやネットワークの問題などの一般的なエラーをチェックしてください。
- CLI の場合: 標準出力からエラーを解析します。例えば、
--noiseが無効な場合、「Error: Unknown noise type」が返されます。スクリプトで処理します:if [ $? -ne 0 ]; then echo "Generation failed"; fi。 - API の場合: HTTP エラーをキャッチします。例えば、Python では:
try: response = openclaw.api.generate_terrain({...}) except openclaw.APIError as e: print(e.code) # e.g., 400 for bad request。 - 特定のケース: シードが非整数の場合、API は 422 を返します。まず入力を検証してください。例:
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)。
グラフの関係
- 関連するスキル: level-design (レベル構築を組み合わせるためのゲーム開発クラスターを共有)、asset-creation (生成されたコンテンツを入力として使用)。
- 依存するスキル: noise-libraries (基盤となるノイズ関数用)、game-engines (統合フック用)。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
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 headerAuthorization: Bearer $OPENCLAW_API_KEY. - GET /api/procedural/status: Query job status; e.g.,
GET /api/procedural/status?job_id=123with auth header.
- POST /api/procedural/generate: Body as JSON, e.g.,
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
--noiseis 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).