Seeded floor loot and openable chests at POI markers, with tables by location and tier.
Acceptance
Loot is deterministic for a given seed.
A statistics test over 1,000 seeds checks tier distribution and that every player can reasonably find a weapon.
**Depends on:** B7, W4
Seeded floor loot and openable chests at POI markers, with tables by location and tier.
**Acceptance**
- Loot is deterministic for a given seed.
- A statistics test over 1,000 seeds checks tier distribution and that every player can reasonably find a weapon.
claude
added this to the v0.3 Building and Combat milestone 2026-11-09 05:27:03 +00:00
src/sim/loot_set.gd: LootSet.plan() rolls a whole match's loot once from the seeded "loot" stream. Each POI loot marker becomes a sea chest (chance by location) or floor loot (rolls on that location's weapon, consumable, ammo or nothing weights). Weapons roll a tier from the location's tier weights and come with their ammunition. Chests hold a weapon (best of two tier rolls), a consumable and spare ammunition.
Tables are in Tuning.LOOT_SOURCES, one per POI kind plus crate. Shrines and lighthouses lean towards chests and better tiers; hamlets are plentiful but plainer.
Interact opens the nearest closed chest in CHEST_RANGE, unless a pickup is nearer, and spills it as pickups. Washed-up crate props hold one crate roll and spill it when broken, however they break.
If the rolls leave fewer weapons at POIs than LOOT_MIN_POI_WEAPONS (24, one per player in a full lobby), extra weapon rolls are added to floor spots in marker order.
Chest and crate state is in state_hash(). ServerLoop places loot after the drop starts.
Tests (make check passes, 258 tests, smoke p95 0.62 ms with 24 bots)
test_loot (12): same seed gives identical pickups, chests, crates and hash; different seeds differ; floor loot rests at its markers; chest contents; opening once, out of reach, nearer pickup first; crate spill.
Statistics: 1,000 loot seeds over four generated islands (a whole island takes ~0.6 s to generate, so the 1,000 seeds share islands 1–4). Each tier's share is within 2 points of what the tables predict, tiers get strictly rarer, shrines beat hamlets by over half a tier, every match has ≥ 24 POI weapons and ≥ 30 counting crates, spread over ≥ 8 places. Result: mean 45.7 weapons per match, 31 of 1,000 matches needed the top-up.
Follow-ups / gaps
Nothing renders chests or pickups yet (client art is A4/A5). Chests aren't solid.
The total-with-crates floor sits exactly at the threshold on the fixed seeds (30); the top-up guarantees the POI count, not the crate count.
— tidewall-build
Done in 0013a81.
**What changed**
- `src/sim/loot_set.gd`: `LootSet.plan()` rolls a whole match's loot once from the seeded `"loot"` stream. Each POI loot marker becomes a sea chest (chance by location) or floor loot (rolls on that location's weapon, consumable, ammo or nothing weights). Weapons roll a tier from the location's tier weights and come with their ammunition. Chests hold a weapon (best of two tier rolls), a consumable and spare ammunition.
- Tables are in `Tuning.LOOT_SOURCES`, one per POI kind plus `crate`. Shrines and lighthouses lean towards chests and better tiers; hamlets are plentiful but plainer.
- Interact opens the nearest closed chest in `CHEST_RANGE`, unless a pickup is nearer, and spills it as pickups. Washed-up crate props hold one crate roll and spill it when broken, however they break.
- If the rolls leave fewer weapons at POIs than `LOOT_MIN_POI_WEAPONS` (24, one per player in a full lobby), extra weapon rolls are added to floor spots in marker order.
- Chest and crate state is in `state_hash()`. `ServerLoop` places loot after the drop starts.
**Tests** (`make check` passes, 258 tests, smoke p95 0.62 ms with 24 bots)
- `test_loot` (12): same seed gives identical pickups, chests, crates and hash; different seeds differ; floor loot rests at its markers; chest contents; opening once, out of reach, nearer pickup first; crate spill.
- Statistics: 1,000 loot seeds over four generated islands (a whole island takes ~0.6 s to generate, so the 1,000 seeds share islands 1–4). Each tier's share is within 2 points of what the tables predict, tiers get strictly rarer, shrines beat hamlets by over half a tier, every match has ≥ 24 POI weapons and ≥ 30 counting crates, spread over ≥ 8 places. Result: mean 45.7 weapons per match, 31 of 1,000 matches needed the top-up.
**Follow-ups / gaps**
- Nothing renders chests or pickups yet (client art is A4/A5). Chests aren't solid.
- The total-with-crates floor sits exactly at the threshold on the fixed seeds (30); the top-up guarantees the POI count, not the crate count.
— tidewall-build
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Depends on: B7, W4
Seeded floor loot and openable chests at POI markers, with tables by location and tier.
Acceptance
Done in
0013a81.What changed
src/sim/loot_set.gd:LootSet.plan()rolls a whole match's loot once from the seeded"loot"stream. Each POI loot marker becomes a sea chest (chance by location) or floor loot (rolls on that location's weapon, consumable, ammo or nothing weights). Weapons roll a tier from the location's tier weights and come with their ammunition. Chests hold a weapon (best of two tier rolls), a consumable and spare ammunition.Tuning.LOOT_SOURCES, one per POI kind pluscrate. Shrines and lighthouses lean towards chests and better tiers; hamlets are plentiful but plainer.CHEST_RANGE, unless a pickup is nearer, and spills it as pickups. Washed-up crate props hold one crate roll and spill it when broken, however they break.LOOT_MIN_POI_WEAPONS(24, one per player in a full lobby), extra weapon rolls are added to floor spots in marker order.state_hash().ServerLoopplaces loot after the drop starts.Tests (
make checkpasses, 258 tests, smoke p95 0.62 ms with 24 bots)test_loot(12): same seed gives identical pickups, chests, crates and hash; different seeds differ; floor loot rests at its markers; chest contents; opening once, out of reach, nearer pickup first; crate spill.Follow-ups / gaps
— tidewall-build