Avoid spawning inside rocks; rock exclusion list built once per wave #72

Merged
cammymoop merged 2 commits from feature/spawn-rock-avoidance into master 2026-03-05 10:24:38 -06:00
Collaborator

Summary

  • Rock exclusion data is collected once per wave via the "rocks" group — O(n_rocks) setup shared across all spawns for that wave
  • Each position candidate is checked against the cached list in O(n_rocks); retried up to max_spawn_retries (8) times — total per-spawn cost is bounded and independent of spawn count
  • Both interior (prop) and edge spawn positions are covered
  • environment/rock.gd: add_to_group("rocks") in _ready(); fix pre-existing lint issues (BASE_RADIUS → base_radius, reorder @export/@onready, strip trailing whitespace)
  • environment/round_setup.gd: update BASE_RADIUS → base_radius
  • entities/wave_spawner.gd: add spawn_rock_clearance/max_spawn_retries exports; _build_rock_exclusions(), _position_is_clear(), _retry_clear(Callable) helpers; route all position generation through _retry_clear()

Test plan

  • Headless run exits cleanly with no errors
  • gdlint passes on all modified files
  • Spawner props and edge enemies visibly avoid placing on top of rocks
## Summary - Rock exclusion data is collected **once per wave** via the `"rocks"` group — O(n_rocks) setup shared across all spawns for that wave - Each position candidate is checked against the cached list in O(n_rocks); retried up to `max_spawn_retries` (8) times — total per-spawn cost is bounded and independent of spawn count - Both interior (prop) and edge spawn positions are covered - `environment/rock.gd`: `add_to_group("rocks")` in `_ready()`; fix pre-existing lint issues (`BASE_RADIUS` → `base_radius`, reorder `@export`/`@onready`, strip trailing whitespace) - `environment/round_setup.gd`: update `BASE_RADIUS` → `base_radius` - `entities/wave_spawner.gd`: add `spawn_rock_clearance`/`max_spawn_retries` exports; `_build_rock_exclusions()`, `_position_is_clear()`, `_retry_clear(Callable)` helpers; route all position generation through `_retry_clear()` ## Test plan - [ ] Headless run exits cleanly with no errors - [ ] gdlint passes on all modified files - [ ] Spawner props and edge enemies visibly avoid placing on top of rocks
Rock exclusion data (_rock_excl_centers, _rock_excl_radii_sq) is
collected once per wave via the "rocks" group — O(n_rocks) setup shared
across all spawns. Each position candidate is checked against this
cached list in O(n_rocks); retried up to max_spawn_retries (8) times.
Both interior (prop) and edge spawn positions are covered.

- environment/rock.gd: add_to_group("rocks") in _ready(); fix
  pre-existing lint issues (rename BASE_RADIUS → base_radius, reorder
  @export/@onready, strip trailing whitespace)
- environment/round_setup.gd: update BASE_RADIUS → base_radius
- entities/wave_spawner.gd: add spawn_rock_clearance/max_spawn_retries
  exports; _build_rock_exclusions(), _position_is_clear(),
  _retry_clear(Callable) helpers; route all position generation through
  _retry_clear()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude force-pushed feature/spawn-rock-avoidance from 86a6132355 to d3249572c0 2026-03-04 17:26:13 -06:00 Compare
cammymoop merged commit f3d8af34da into master 2026-03-05 10:24:38 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cammymoop/semi-vibed-game!72
No description provided.