Files
tidewall/src/sim/tuning.gd
T
claudeandClaude Opus 5.5 27e08db51d F5: Simulation core and player command stream
Add the fixed-tick Simulation, the EntityRegistry with never-reused IDs, SimRng's named
seeded streams, and the 14-byte PlayerCommand used by humans, bots and the network.
state_hash is a SHA-256 over a canonical encoding of the state. Movement is a flat
placeholder until the v0.2 character controller. Tests replay a 24-player command log
over 10,000 ticks and scan src/sim for unseeded randomness and presentation code.

Closes #5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 17:16:03 -05:00

109 lines
3.9 KiB
GDScript

## The one table of gameplay numbers. See docs/GDD.md for what they mean.
## Using constants means a typo is a parse error instead of a silent default.
class_name Tuning
extends RefCounted
# Simulation
const TICK_RATE_HZ: int = 30
## Commands further ahead of the current tick than this are rejected.
const MAX_COMMAND_LEAD_TICKS: int = 60
## Width and depth of the playable world. Positions are clamped inside it.
const WORLD_SIZE_METRES: float = 1024.0
# Match sizes
const SOLO_PLAYERS: int = 24
const DUO_TEAMS: int = 12
const DUO_TEAM_SIZE: int = 2
const REVIVE_SECONDS: float = 6.0
# Player
const PLAYER_MAX_HEALTH: int = 100
const PLAYER_MAX_ARMOR: int = 100
const BREATH_SECONDS: float = 12.0
const INVENTORY_SLOTS: int = 5
# Movement, in metres and seconds
const WALK_SPEED: float = 4.0
const SPRINT_SPEED: float = 6.5
const WADE_SPEED: float = 2.5
const SWIM_SPEED: float = 2.0
const CROUCH_SPEED: float = 2.0
const JUMP_VELOCITY: float = 7.5
const GRAVITY: float = 20.0
# The tide. `hold` and `rise` are seconds, `level` is metres above the starting sea,
# `drown_dps` is damage per second underwater once breath runs out. The last level
# must exceed ISLAND_MAX_HEIGHT, so that every match ends.
const ISLAND_MAX_HEIGHT: float = 70.0
const TIDE_PHASES: Array[Dictionary] = [
{"hold": 150.0, "rise": 60.0, "level": 8.0, "drown_dps": 2},
{"hold": 100.0, "rise": 50.0, "level": 18.0, "drown_dps": 4},
{"hold": 80.0, "rise": 45.0, "level": 30.0, "drown_dps": 6},
{"hold": 60.0, "rise": 40.0, "level": 42.0, "drown_dps": 8},
{"hold": 45.0, "rise": 35.0, "level": 54.0, "drown_dps": 12},
{"hold": 30.0, "rise": 30.0, "level": 64.0, "drown_dps": 16},
{"hold": 20.0, "rise": 40.0, "level": 75.0, "drown_dps": 25},
]
# Building
const GRID_CELL_METRES: float = 4.0
const MATERIAL_CAP: int = 500
const HARVEST_PER_HIT: int = 15
## Material units each piece costs. Health and build time come from MATERIALS.
const BUILD_PIECES: Dictionary = {
"wall": {"cost": 10},
"floor": {"cost": 10},
"ramp": {"cost": 10},
"roof": {"cost": 10},
"breakwater": {"cost": 30},
}
const MATERIALS: Dictionary = {
"driftwood": {"health": 150, "build_seconds": 2.0},
"stone": {"health": 300, "build_seconds": 5.0},
"salvage_iron": {"health": 500, "build_seconds": 9.0},
}
const BREAKWATER_MAX_HEAD: float = 6.0
const BREAKWATER_WEAR_PER_METRE: float = 2.0
const BREACH_FLOW_METRES_PER_SECOND: float = 1.5
# Weapons. Falloff is linear from full damage at `range_full` to `falloff_min`
# (a fraction of damage) at `range_max`.
const WEAPONS: Dictionary = {
"boathook": {
"damage": 20, "fire_rate": 1.5, "magazine": 0, "reload": 0.0,
"range_full": 2.5, "range_max": 2.5, "falloff_min": 1.0, "rarity": 0,
},
"fowling_piece": {
"damage": 9, "pellets": 9, "fire_rate": 1.1, "magazine": 6, "reload": 4.0,
"range_full": 6.0, "range_max": 25.0, "falloff_min": 0.2, "rarity": 1,
},
"dock_carbine": {
"damage": 27, "fire_rate": 6.0, "magazine": 30, "reload": 2.4,
"range_full": 40.0, "range_max": 120.0, "falloff_min": 0.5, "rarity": 1,
},
"signal_revolver": {
"damage": 38, "fire_rate": 2.2, "magazine": 6, "reload": 2.0,
"range_full": 30.0, "range_max": 80.0, "falloff_min": 0.5, "rarity": 0,
},
"whalers_longgun": {
"damage": 105, "fire_rate": 0.5, "magazine": 1, "reload": 2.6,
"range_full": 120.0, "range_max": 350.0, "falloff_min": 0.7, "rarity": 2,
},
"line_thrower": {
"damage": 0, "fire_rate": 0.6, "magazine": 3, "reload": 3.0,
"range_full": 45.0, "range_max": 45.0, "falloff_min": 1.0, "rarity": 2,
},
"powder_keg": {
"damage": 80, "structure_damage": 400, "blast_radius": 6.0, "fuse": 3.0,
"fire_rate": 0.8, "magazine": 1, "reload": 0.0,
"range_full": 0.0, "range_max": 30.0, "falloff_min": 1.0, "rarity": 2,
},
}
# Consumables
const ITEMS: Dictionary = {
"sailcloth_bandage": {"heal": 25, "use_seconds": 3.0, "stack": 6},
"brine_tonic": {"heal": 60, "use_seconds": 8.0, "stack": 3},
"cork_vest": {"armor": 50, "use_seconds": 5.0, "stack": 2},
}