Skip to content

Scale Level 0 poolrooms stair spawn frequency with corruption #81

@aebrer

Description

@aebrer

Summary

Level 0 stairs to the Poolrooms (lobby_to_poolrooms_stairs) currently spawn in every origin chunk (0, 0) with 100% probability. This was left in place for debugging and playtesting during Level 1 development, but it is not the intended long-term behavior. Players should have to explore and build up some corruption before the route to Level 1 appears.

Current Behavior

  • Level0Generator._place_poolrooms_stairs unconditionally places stairs in chunk (0, 0)
  • A TODO comment in scripts/procedural/level_0_generator.gd acknowledges this: "Currently forced in origin chunk for debugging. Should scale spawn probability with corruption"

Proposed Behavior

  • Stairs to Level 1 should be rare at low corruption and become more likely as corruption increases
  • The spawn probability should be tunable per level config
  • Tutorial stairs (tutorial_to_lobby_stairs) should remain guaranteed — the tutorial must always have an exit
  • Level 1 return stairs (poolrooms_to_lobby_stairs) should remain guaranteed in chunk (0, 0) — you always need a way back
  • This design should work alongside future two-way persistent stairwells (see issue 78)

Acceptance Criteria

  • Level0Generator no longer unconditionally places lobby_to_poolrooms_stairs in every origin chunk
  • Stair spawn probability is configurable (e.g., level_0_config.stair_spawn_probability or similar)
  • Probability scales with corruption level: e.g., base_probability + corruption * scaling_factor, clamped to a max
  • At corruption 0, stairs are rare (e.g., 5-10% chance in origin chunk)
  • At high corruption (e.g., 1.0+), stairs are common but not guaranteed (e.g., 60-80%)
  • The existing TODO comment is removed once implemented
  • The change is validated through gameplay testing — stairs don't feel too common or too rare

Related Issues

  • Issue 78 — When exiting between floors, exit location should be unique per-stairwell. The stairwell spawn frequency designed here should complement the two-way persistent stairwell system. If stairwells become persistent landmarks, having too many spawn too early would clutter the level and reduce the strategic value of remembering where each stairwell leads.

Context

  • PR 75 introduced the explicit stair routing system and the lobby_to_poolrooms_stairs entity
  • ChunkManager tracks corruption per level via corruption_tracker
  • Level configs already define corruption_per_chunk for each level

Technical Notes

  • ChunkManager._check_player_chunk_change increases corruption when entering a new chunk
  • ChunkManager.get_corruption(level_id) returns the current corruption value
  • The generator has access to world_seed for deterministic RNG
  • Consider adding a stair_spawn_probability or exit_rarity field to LevelConfig or ProceduralLevelConfig

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions