rng-seeding-patterns

Manage seeded and unseeded RNG with deterministic game logic patterns.

2|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/pmarashian/cursor-agent-skills --skill rng-seeding-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rng-seeding-patterns
Source: https://github.com/pmarashian/cursor-agent-skills/tree/main/rng-seeding-patterns
Command: npx skills add https://github.com/pmarashian/cursor-agent-skills --skill rng-seeding-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of managing random number generation (RNG) in game development, ensuring predictable and reproducible outcomes when needed for testing, debugging, or specific gameplay mechanics.

Core Features & Use Cases

  • Seeded vs. Unseeded RNG Guidance: Clearly defines when to use deterministic (seeded) or non-deterministic (unseeded) RNG.
  • Seed Management Patterns: Provides practical patterns for managing RNG seeds, including scene-level, URL parameters, and test modes.
  • Deterministic Logic Examples: Illustrates how to implement deterministic game logic for maze generation, enemy spawning, and item placement.
  • Test Patterns: Offers methods for testing RNG behavior, verifying deterministic outputs and seed regeneration.

Quick Start

Use the rng-seeding-patterns skill to document when to use seeded vs. unseeded RNG, provide patterns for RNG seed management, include examples of deterministic game logic, document seed regeneration patterns, and provide test patterns for RNG behavior.

Frequently Asked Questions about rng-seeding-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make random number generation deterministic in game development?

Deterministic random number generation uses a managed seed to ensure predictable, reproducible outcomes for testing and debugging specific gameplay mechanics. This skill provides patterns for implementing seeded RNG to generate identical sequences across game sessions.

When should I use seeded versus unseeded RNG in game logic?

Use seeded RNG when you need predictable, reproducible outcomes for testing or deterministic mechanics like maze generation, and unseeded RNG for non-deterministic gameplay elements. This skill defines clear guidance on choosing between them based on your feature requirements.

What are the best patterns for managing RNG seeds across game scenes?

Effective seed management patterns include utilizing scene-level configurations, URL parameters, and dedicated test modes. This skill illustrates how to implement these strategies to maintain deterministic logic for entity placement and maze generation.

How do I test random number generation behavior in my game?

Testing RNG behavior involves verifying deterministic outputs and documenting seed regeneration patterns. This skill provides test patterns to validate that your random number generation produces expected, reproducible results during automated testing.

Can I implement seeded random number generation using Phaser's built-in capabilities?

Yes, you can use Phaser's built-in capabilities alongside custom seeded RNG implementations. This skill provides code examples covering both approaches for managing deterministic game logic and entity spawning.

Why are my procedurally generated mazes generating differently on reload?

Procedural generation differs on reload when random number generation is unseeded or the seed is not persisted. Implementing deterministic logic with seed management patterns ensures maze generation and entity placement remain reproducible across sessions.