procedural-gen
यह क्या करती है
यह स्किल नॉइज़ और सीडेड रैंडम नंबर से डंजन, इलाके और लूट टेबल के लिए प्रोसीजरल जनरेशन कवर करती है। यह उन गेम डेवलपर्स के लिए है जिन्हें हर हिस्सा हाथ से बनाए बिना बड़ी मात्रा में कंटेंट चाहिए।
कब इस्तेमाल करें
- ✓जब आप कमरे और गलियारे अपने-आप बनाना चाहें।
- ✓जब आपको नॉइज़ फ़ंक्शन से इलाका या हाइटमैप चाहिए।
- ✓जब डिबगिंग या शेयरिंग के लिए दुनिया सीड से दोबारा बन सकनी चाहिए।
Skill का लिंक
https://github.com/gamedev-skills/awesome-gamedev-agent-skills/blob/main/skills/disciplines/procedural-gen/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं चाहता हूँ कि मेरा गेम हर रन में सीड से नया डंजन बनाए, ताकि खिलाड़ी एक ही डंजन आपस में शेयर कर सकें।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट एक सीडेड रैंडम नंबर जनरेटर बनाता है और उसे जनरेशन कोड में आगे भेजता है। फिर वह कंटेंट के अनुरूप तकनीक चुनता है, जैसे इलाके के लिए नॉइज़ या डंजन के लिए कमरे काटना, और लूट के लिए भारित टेबल इस्तेमाल करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Procedural generation
Generate levels, terrain, and loot from compact rules and a seed. The throughline
of good procgen is determinism: a single seed reproduces the same world, so
bugs are repeatable and players can share seeds. This skill owns the core
algorithms — noise, seeded RNG, dungeon layout, weighted tables; genres like
roguelike and survival-crafting consume it.
When to use
- Use to generate maps, dungeons, terrain heightmaps, item drops, or any content you do not want to author by hand.
- Use when results must be reproducible from a seed (debugging, daily challenges, shareable worlds).
- Use to pick weighted random outcomes (loot rarity, spawn tables).
When not to use: for the engine's tile API to paint the result, use
godot-tilemap or unity-tilemap-2d. For routing AI through the generated map,
use game-ai. For carefully hand-paced levels, use level-design — procgen and
authored design are complementary, not interchangeable.
Core workflow
- Own your randomness. Create one seeded RNG instance and pass it everywhere. Never call the global/static random in generation code — it makes results irreproducible and order-dependent.
- Pick the technique for the content. Continuous terrain/heightmaps → noise. Discrete rooms/corridors → space partitioning or agent-based carving. Outcomes with rarities → weighted tables.
- Generate into a plain data grid/array first, decoupled from rendering.
Generation fills
int[][]or a dict; a separate pass draws it. - Validate before shipping the result to the player. Is every room reachable? Is the spawn safe? Is there a path to the exit? Reject or repair layouts that fail; do not hand the player a broken map.
- Tune with the seed fixed so each parameter change is visible in isolation, then sweep seeds to check the distribution, not just one lucky map.
Patterns
1. Seeded, deterministic RNG (the foundation)
import random
rng = random.Random(seed) # a dedicated instance — NOT the global random.*
room_count = rng.randint(5, 12) # same seed -> same sequence, every run
# RIGHT: thread `rng` through every function that makes a choice.
# WRONG: calling random.randint(...) (global state) — order-dependent, unseedable.
Engine equivalents: Godot 4.7 var rng := RandomNumberGenerator.new(); rng.seed = s
(save rng.state to resume a sequence mid-way); Unity 6.3
new Unity.Mathematics.Random(seed) (a uint, must be non-zero) or
new System.Random(seed). Avoid UnityEngine.Random.InitState for generation:
it seeds the one global generator that every other script also draws from.
Store the seed in the save file so a world can be regenerated.
2. Fractal (fBm) noise for heightmaps
# Sum several octaves: each higher octave has higher frequency, lower amplitude.
def fbm(noise, x, y, octaves=5, lacunarity=2.0, gain=0.5):
total, amp, freq, norm = 0.0, 1.0, 1.0, 0.0
for _ in range(octaves):
total += amp * noise(x * freq, y * freq) # noise() returns ~0..1
norm += amp # track total amplitude
amp *= gain # each octave contributes less
freq *= lacunarity # ...at a higher frequency
return total / norm # normalize back into 0..1
# Redistribute to carve flat valleys / sharpen peaks: higher exp -> more lowland.
elevation = pow(fbm(noise, nx, ny), 2.2)
Use a real noise library (FastNoiseLite, opensimplex,
Unity.Mathematics.noise, or Mathf.PerlinNoise) — do not implement gradient
noise yourself. Seed elevation and moisture with different seeds so a
biome lookup over both fields isn't perfectly correlated. Full biome lookup and
island shaping are in references/noise.md.
3. Weighted loot table (rarity-correct selection)
# Roll proportional to weight: common drops far more often than legendary.
def weighted_pick(rng, table): # table: list of (item, weight)
total = sum(w for _, w in table)
roll = rng.uniform(0, total) # a point on the cumulative line
upto = 0.0
for item, w in table:
upto += w
if roll < upto: # first bucket the roll falls into
return item
return next(i for i, w in reversed(table) if w > 0) # roll == total (float edge)
loot = weighted_pick(rng, [("common", 70), ("rare", 2
अक्सर पूछे जाने वाले सवाल
ग्लोबल रैंडम फ़ंक्शन क्यों नहीं?
स्किल कहती है कि ग्लोबल रैंडम स्रोत नतीजों को दोहराने लायक नहीं रखता और कॉल के क्रम पर निर्भर करता है।
क्या यह हाथ से बने लेवल की जगह लेती है?
नहीं। स्किल कहती है कि प्रोसीजरल और हाथ से बना लेवल डिज़ाइन साथ मिलकर सबसे अच्छा काम करते हैं।
वेव फ़ंक्शन कोलैप्स क्या है?
यह उन डंजन और टाइल जनरेशन तकनीकों में से एक है जिन्हें स्किल कवर करती है।
जानकारी
लेखक का मूल विवरण
Generate game content procedurally — seeded deterministic RNG, value/Perlin/ Simplex noise for terrain and heightmaps, grid dungeon generation (rooms + corridors, BSP, random walk, wave function collapse), and weighted loot/drop tables. Engine-neutral algorithms. Use when the user mentions procedural generation, perlin/simplex noise, random seed, dungeon generator, WFC, heightmap/terrain, or loot tables.
लोकप्रियता
- GitHub स्टार
- 6.6k
- रैंकिंग में स्थान
- #13803
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 28/10/2026
कमेंट
- …
इस repository की और skills
router
6.6kयह आपके एजेंट को इंजन और काम के प्रकार को पहचानकर किसी अनुरोध के लिए सही गेम डेवलपमेंट स्किल चुनने में मदद करती है।
ai-behavior-trees-utility-ai
6.6kयह आपके एजेंट को दुश्मनों और किरदारों के लिए बिहेवियर ट्री और यूटिलिटी AI सिस्टम बनाने में मदद करती है, जो प्राथमिकता और स्कोर से कार्रवाई चुनें।
audio-design
6.6kआपके एजेंट को गेम ऑडियो मिक्सिंग सिखाती है: बस, डेसिबल में वॉल्यूम, डायलॉग में म्यूज़िक धीमा करना और साउंड इफ़ेक्ट की विविधता।
camera-systems
6.6kयह आपके एजेंट को ऐसे गेम कैमरा बनाने में मदद करती है जो सहजता से पीछा करें, लेवल के भीतर रहें, और 3D में घूम या देख सकें।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।