B5 Inventory and pickups #19

Closed
opened 2026-11-09 05:27:01 +00:00 by claude · 1 comment
Owner

Depends on: F5

A five-slot hotbar with ammunition types, plus world pickups for picking up, dropping and swapping items.

Acceptance

  • All changes are server-authoritative, and tests cover full inventories, swaps, ammo stacks and drop on death.
  • Item definitions are data-driven resources.
**Depends on:** F5 A five-slot hotbar with ammunition types, plus world pickups for picking up, dropping and swapping items. **Acceptance** - All changes are server-authoritative, and tests cover full inventories, swaps, ammo stacks and drop on death. - Item definitions are data-driven resources.
claude added this to the v0.3 Building and Combat milestone 2026-11-09 05:27:01 +00:00
claude added the priority/hightype/feature labels 2026-11-09 05:27:01 +00:00
claude added this to the Tidewall v1.0 project 2026-11-09 15:00:06 +00:00
eric referenced this issue from a commit 2026-11-11 22:19:55 +00:00
eric closed this issue 2026-11-11 22:19:55 +00:00
Author
Owner

Done in e58d614.

What changed

  • ItemDef (a Resource) and ItemCatalog, built from Tuning.WEAPONS, ITEMS and the new AMMO table, so adding an item is a data change only. The boathook stays outside the slots as selection 0.
  • Inventory: five slots (code, count, loaded rounds, tier), ammunition stocks with caps, pickup entities (ARCHETYPE_PICKUP) that rest on the floor under them, pick up / drop / swap, and drop_all on elimination.
  • PlayerCommand.BUTTON_DROP (bit 8). Interact and drop act once per press. A slot change costs SWAP_SECONDS.
  • The simulation marks a player eliminated when health reaches 0, emits an eliminated event naming the last attacker, drops everything, and ignores that player's commands. M3 builds on this.
  • All new player and pickup state is in state_hash().

Tests: test/sim/test_inventory.gd (18 tests): full inventories, swaps, ammo stacks and caps, stacking consumables, reach, nearest-first, once-per-press, swimmers can't pick up, drop on death, and hashing. make check passes: 211 tests at this commit, self-check and smoke.

Follow-ups: pickups have no visuals or HUD yet (A4, A9), and no client sends interact or drop yet (playable client work). Loot spawning is B9.

— tidewall-build

Done in e58d614. **What changed** - `ItemDef` (a `Resource`) and `ItemCatalog`, built from `Tuning.WEAPONS`, `ITEMS` and the new `AMMO` table, so adding an item is a data change only. The boathook stays outside the slots as selection 0. - `Inventory`: five slots (code, count, loaded rounds, tier), ammunition stocks with caps, pickup entities (`ARCHETYPE_PICKUP`) that rest on the floor under them, pick up / drop / swap, and `drop_all` on elimination. - `PlayerCommand.BUTTON_DROP` (bit 8). Interact and drop act once per press. A slot change costs `SWAP_SECONDS`. - The simulation marks a player eliminated when health reaches 0, emits an `eliminated` event naming the last attacker, drops everything, and ignores that player's commands. M3 builds on this. - All new player and pickup state is in `state_hash()`. **Tests:** `test/sim/test_inventory.gd` (18 tests): full inventories, swaps, ammo stacks and caps, stacking consumables, reach, nearest-first, once-per-press, swimmers can't pick up, drop on death, and hashing. `make check` passes: 211 tests at this commit, self-check and smoke. **Follow-ups:** pickups have no visuals or HUD yet (A4, A9), and no client sends interact or drop yet (playable client work). Loot spawning is B9. — tidewall-build
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claude/tidewall#19