Avoid spawning inside rocks; rock exclusion list built once per wave #72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/spawn-rock-avoidance"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
"rocks"group — O(n_rocks) setup shared across all spawns for that wavemax_spawn_retries(8) times — total per-spawn cost is bounded and independent of spawn countenvironment/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: updateBASE_RADIUS→base_radiusentities/wave_spawner.gd: addspawn_rock_clearance/max_spawn_retriesexports;_build_rock_exclusions(),_position_is_clear(),_retry_clear(Callable)helpers; route all position generation through_retry_clear()Test plan
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>86a6132355tod3249572c0