Files
zombie-fps/docs/GAMEPLAY-IMPROVEMENTS.md

73 lines
3.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Classic HUD, automatic reload, furniture navigation, death audio
## Work-Death Balance damage tuning
- Player rifle: **17.5 damage** per body hit (previously 35), using the float
`Player.BULLET_DAMAGE` constant. Head multipliers remain zombie ×2.5 / boss ×1.5.
- Grenade explosion: **320 maximum damage** (previously 160), same 5 m linear
falloff, wall occlusion, self-damage and 15 s cooldown. At 1 m it deals 256;
at 2.5 m it deals 160; outside 5 m it deals none.
- Alien Grunt hornet damage is **unchanged**, including its progression by rank.
- `tools/test_rebalance_branding.gd`: 14 checks, including real rifle body/head
hits and exact explosion/self-damage values. All previous gameplay suites pass.
## HUD
`scripts/game_hud.gd` replaces the debug-style text block with translucent black
panels and amber classic-FPS typography. Health and magazine numbers are large,
low health (<=25) and low ammo (<=5) turn red. Reload status is explicit; wave,
score and grenade cooldown are compact at top center. Panels are above touch
controls; every HUD Control ignores mouse events so the Web start gesture works.
Desktop instructions are hidden in touch mode. `30 / 30` means loaded/max magazine,
not a fictional reserve-ammo counter (reloads remain unlimited).
## Automatic reload
The last shot triggers `start_reload()` immediately. An empty magazine detected in
physics also triggers it. Guarded against duplicate requests, full magazines and
death. Existing duration1.57s and reload sounds remain; no refill after death.
Manual R and touch reload are unchanged.
## Shared grid navigation on the room's XZ floor
`scripts/room_navigation.gd` builds a shared35x35 AStarGrid2D with0.5m cells.
Obstacles come from `office_props` box collisions transformed into world-space
XZ rectangles (including rotated chairs). Rectangles are expanded0.60m to protect
the zombie capsule radius0.35m plus grid/edge margin. Diagonals are allowed only
when both adjacent cells are free. Grid setup calls update BEFORE solid flags,
since update clears them.
Targets/start cells inside expanded obstacles are snapped to the nearest free
cell. Each zombie caches direct visibility or an A* route, refreshing approximately
every0.55–0.67s with staggered intervals rather than every physics frame. Clear
routes use direct pursuit; blocked routes follow waypoints. Entry window tween,
animations, gravity, attack range and corpse behavior remain unchanged.
Melee also checks a world-geometry ray below desk-top height: chest-high rays can
pass over tables even when the actors cannot physically approach each other.
This map is for static furniture: moved/new props require rebuilding it. Existing
body collisions still separate zombies, but this is not a full crowd avoidance
solver. No mobile FPS guarantee is made. The algorithm uses the existing simple
flat room and does not require runtime navmesh baking or native extensions.
Reference: https://docs.godotengine.org/en/stable/classes/class_astargrid2d.html
## Death sound
Copied the ORIGINAL local Half-Life `valve/sound/fvox/flatline.wav` to
`assets/audio/fvox/flatline.wav`, no source modification. SHA256:
`6fc00ca83a1310b8ff373a77ff895c5396c35416c00a974a0fa55b3fb14bd772`.
Duration3.994s, mono11025Hz. Played once at-9dB on death alongside the existing
player vocal; nonpositional so it remains audible through the camera fall.
## Verification
`tools/test_gameplay_improvements.gd`: HUD values/colors/touch hints, immediate
last-shot reload, duplicate-request guard, physical pursuits around both desks,
chairs (including rotated chair) and barrel, blocked melee through desk,
idempotent flatline and no refill after death. Passed headless and with real
PulseAudio output. All eight prior test suites pass. Touch screenshot of new HUD
inspected via test_office_atmosphere --screenshot --touch.
Existing test-shutdown resource-in-use warnings remain. Device touch feel and
smartphone performance still need real-device validation.