904 B
904 B
| description | globs |
|---|---|
| Standards for map generation, seeding, and textures. | src/generation/*.js** |
Procedural Generation Standards
Core Principles
- Determinism: All generators must accept a seed. Using the same seed must produce the exact same map and textures. Use src/utils/SeededRandom.js.
- Additive vs Subtractive:
- Ruins: Use Additive (Fill 0, Build Rooms).
- Caves: Use Subtractive/Cellular (Fill 1, Carve Caves).
- Playability:
- Always run PostProcessor.ensureConnectivity() to prevent soft-locks.
- Always ensure valid "Floor" tiles exist for spawning.
Texture Generation
- Use OffscreenCanvas for texture generation to support Web Workers.
- Return a composite object (diffuse, normal, roughness) for PBR materials.
- Output textures to generatedAssets object, do not apply directly to Three.js materials inside the generator.