#233: open with fewer enemies, of one kind, arriving in sequence
Measured before changing anything. The ticket's two halves needed opposite
fixes, and the first one made the second worse.
TOO COMPLEX. Variety was gated on fleet size alone, so a player who had
grown early met two kinds of trouble in the first wave they ever saw - a
fleet of four opened on two lancers and three chasers. Each roster entry now
carries a min_wave as well, so the openings teach one enemy at a time
whatever the fleet already looks like.
That alone pushed wave 1 against a fleet of six from a mixed six to SEVEN
chasers: budget that used to buy a lancer now bought two more chasers. So an
early wave also has a size ceiling, 2 + wave_number * 2. Wave 1 is four
chasers at any fleet size; the cap stops binding by wave 6 and nothing about
later balance moves.
before wave 1 fleet 4 -> 2 lancers, 3 chasers
wave 1 fleet 6 -> 1 sniper, 2 lancers, 3 chasers
after wave 1 fleet 4 -> 4 chasers
wave 1 fleet 6 -> 4 chasers
ARRIVE AT THE SAME TIME was literal: the whole wave spawned inside one frame
as a closed ring around the fleet, which reads as a wall rather than as an
attack. The first hull still lands immediately so a wave is never felt as
late, and the rest follow every 0.45s. Same enemies, same bearing, same
total - they simply do not all exist at once.
Four existing cases objected, and each was right to: they encode intents
that still hold LATER - a large wave must be varied, fleet growth must open
more kinds, a wave can field a lancer at all, and killing a wave must bring
the quiet back. The first three now ask at a wave number where variety is
permitted rather than being weakened. The fourth runs the arrivals out
before killing anything, and gained an assertion that doing so ADDS enemies
- which fails if the staggering ever collapses back into one frame.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
This commit is contained in:
parent
885f977768
commit
cb3650e3a9
4 changed files with 138 additions and 21 deletions
|
|
@ -262,6 +262,12 @@ func _process(delta: float) -> bool:
|
|||
# the player now is a wave, so that is what has to be able to
|
||||
# produce one - and it must not have displaced the chaser while
|
||||
# doing it.
|
||||
# Read past the openings: #233 gates each kind behind a minimum
|
||||
# WAVE as well as a minimum fleet, so the first waves are chasers
|
||||
# only however large the fleet is. This case is about whether a
|
||||
# wave can field a lancer at all, not about when it starts to.
|
||||
var settled_wave: int = game_state.wave_number
|
||||
game_state.wave_number = 8
|
||||
var kinds: Dictionary = {}
|
||||
var lancer_at: int = 0
|
||||
for size in range(1, 12):
|
||||
|
|
@ -269,6 +275,7 @@ func _process(delta: float) -> bool:
|
|||
kinds[id] = true
|
||||
if id == "lancer" and lancer_at == 0:
|
||||
lancer_at = size
|
||||
game_state.wave_number = settled_wave
|
||||
if lancer_at == 0:
|
||||
return _fail("no wave against a fleet of 1..11 contains a lancer")
|
||||
if not kinds.has("chaser"):
|
||||
|
|
|
|||
|
|
@ -108,12 +108,34 @@ func _state_cases() -> bool:
|
|||
game_state.wave_number = before_number
|
||||
if later.size() <= small.size():
|
||||
return _fail("wave 21 against one vessel is no bigger than wave 1 - there is no escalation")
|
||||
# A big wave must not be the same swarm at greater length.
|
||||
# A big wave must not be the same swarm at greater length - but read at a
|
||||
# wave number where variety is ALLOWED. #233 gates each enemy kind behind
|
||||
# a minimum wave as well as a minimum fleet, so that the openings teach
|
||||
# one enemy at a time however big the fleet already is; a fleet of nine
|
||||
# meeting only chasers in wave 1 is now the intent, not the swarm this
|
||||
# case is guarding against.
|
||||
game_state.wave_number = before_number + 6
|
||||
var varied: PackedStringArray = game_state.wave_composition(9)
|
||||
game_state.wave_number = before_number
|
||||
var heavy_kinds: Dictionary = {}
|
||||
for id in large:
|
||||
for id in varied:
|
||||
heavy_kinds[id] = true
|
||||
if heavy_kinds.size() < 2:
|
||||
return _fail("a large wave is %d copies of one enemy" % large.size())
|
||||
return _fail("a large wave at wave %d is %d copies of one enemy" \
|
||||
% [before_number + 6, varied.size()])
|
||||
|
||||
# And the openings really are single-kind, whatever the fleet looks like.
|
||||
game_state.wave_number = 1
|
||||
var opener: PackedStringArray = game_state.wave_composition(9)
|
||||
game_state.wave_number = before_number
|
||||
var opening_kinds: Dictionary = {}
|
||||
for id in opener:
|
||||
opening_kinds[id] = true
|
||||
if opening_kinds.size() != 1:
|
||||
return _fail("wave 1 against a fleet of 9 already mixes %d kinds" % opening_kinds.size())
|
||||
if opener.size() > game_state.wave_max_enemies():
|
||||
return _fail("wave 1 sends %d enemies, past the %d an opening wave may" \
|
||||
% [opener.size(), game_state.wave_max_enemies()])
|
||||
if large.size() > GameState.WAVE_MAX_ENEMIES:
|
||||
return _fail("a wave of %d exceeds the %d cap" % [large.size(), GameState.WAVE_MAX_ENEMIES])
|
||||
print("fleet 1 -> %d enemies, fleet 9 -> %d enemies of %d kinds" \
|
||||
|
|
@ -140,15 +162,23 @@ func _state_cases() -> bool:
|
|||
# Explicit sizes rather than BASE_FLEET_SIZE + n: #219 moved the starting
|
||||
# capacity to 1, and this is about the roster's own thresholds (4, 5, 6),
|
||||
# not about where the fleet happens to begin.
|
||||
# Read past the opening waves: #233 also gates each kind behind a minimum
|
||||
# WAVE, so that the first waves teach one enemy at a time whatever the
|
||||
# fleet looks like. This case is about the roster's FLEET thresholds, so
|
||||
# it asks at a wave number where every kind is already permitted.
|
||||
var settled: int = game_state.wave_number
|
||||
game_state.wave_number = 8
|
||||
var previous_kinds: int = 1
|
||||
for size in range(3, 8):
|
||||
var kinds_here: Dictionary = {}
|
||||
for id in game_state.wave_composition(size):
|
||||
kinds_here[id] = true
|
||||
if kinds_here.size() < previous_kinds:
|
||||
game_state.wave_number = settled
|
||||
return _fail("a fleet of %d meets %d kinds, fewer than the %d before it" \
|
||||
% [size, kinds_here.size(), previous_kinds])
|
||||
previous_kinds = kinds_here.size()
|
||||
game_state.wave_number = settled
|
||||
if previous_kinds < 3:
|
||||
return _fail("a grown fleet still only meets %d kinds of enemy" % previous_kinds)
|
||||
print("enemy variety climbs with the fleet, reaching %d kinds" % previous_kinds)
|
||||
|
|
@ -244,6 +274,22 @@ func _process(delta: float) -> bool:
|
|||
print("wave %d arrived: %d enemies, nearest %.0fpx away" \
|
||||
% [game_state.wave_number, arrived, nearest])
|
||||
|
||||
# #233 lands a wave over several seconds rather than in one
|
||||
# frame, so "the whole wave" is not on the field yet. Run the
|
||||
# arrivals out first - otherwise this kills the one hull that
|
||||
# has landed and calls that the wave cleared.
|
||||
for i in range(40):
|
||||
spawner._process(GameState.WAVE_MAX_SECONDS)
|
||||
if spawner.arriving.is_empty():
|
||||
break
|
||||
if not spawner.arriving.is_empty():
|
||||
return _fail("%d hulls never finished arriving" % spawner.arriving.size())
|
||||
var landed: int = _enemy_count()
|
||||
if landed <= arrived:
|
||||
return _fail("running the arrivals out added nothing (%d then %d) - the wave is not staggered" \
|
||||
% [arrived, landed])
|
||||
print("the rest of the wave followed: %d -> %d enemies" % [arrived, landed])
|
||||
|
||||
for enemy in get_nodes_in_group("enemies"):
|
||||
if is_instance_valid(enemy):
|
||||
enemy.queue_free()
|
||||
|
|
|
|||
Loading…
Reference in a new issue