BotBrain plays a match with the commands a player sends: it picks a landing marker near the barge's route, loots points of interest (following their own walking routes into huts, lofts and piers), fights opponents it can see, bandages itself, and gets to ground the coming tide will leave dry. BotWorld is the map every bot shares: loot markers, routes, and each tide phase's safe ground, which is the dry land joined to the island's highest walkable ground. Three difficulties (Tuning.BOT_DIFFICULTIES) set reaction time, sight range and aim error. The server mixes them unless --bot-difficulty says otherwise. NavGrid labels connected regions when it is built, so a goal that is cut off is turned down without a search of the whole island (about 70 ms each). make bot-matches plays 20 bot-only matches and checks winners, drownings and difficulty. Seeds 101 to 120: 20 of 20 with a winner, 7 of 460 deaths were drownings (1.5%), easy bots placed worst (13.7 against 11.8 and 12.0) and hard bots took the most eliminations (186 against 137 and 132). Closes #28 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
465 lines
24 KiB
GDScript
465 lines
24 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
|
|
|
|
# Match flow, in seconds. See Match and MatchRules, which can override each one.
|
|
## The lobby counts down once this many participants have joined.
|
|
const MATCH_MIN_PLAYERS: int = 1
|
|
## With enough players, the lobby waits this long for more before counting down.
|
|
const MATCH_LOBBY_SECONDS: float = 20.0
|
|
const MATCH_COUNTDOWN_SECONDS: float = 10.0
|
|
## Results stay up this long before the server returns to the lobby.
|
|
const MATCH_RESULTS_SECONDS: float = 15.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
|
|
## Fraction of the gap between current and wanted horizontal velocity closed per tick
|
|
## while airborne.
|
|
const AIR_CONTROL: float = 0.08
|
|
## Ledges up to this height are stepped onto without jumping.
|
|
const STEP_HEIGHT: float = 0.45
|
|
## Walking keeps the feet on ground that drops away by up to this much per tick.
|
|
const GROUND_SNAP: float = 0.35
|
|
## Steeper ground can't be walked up or stood on; players slide down it.
|
|
const MAX_SLOPE_DEGREES: float = 46.0
|
|
## Top speed sliding down ground too steep to stand on.
|
|
const SLIDE_MAX_SPEED: float = 8.0
|
|
const PLAYER_RADIUS: float = 0.4
|
|
const PLAYER_HEIGHT: float = 1.8
|
|
const CROUCH_HEIGHT: float = 1.2
|
|
## Landing from a drop of this many metres or less does no damage. Measured from impact
|
|
## speed, so sliding down a slope is gentler than falling the same height.
|
|
const FALL_DAMAGE_SAFE_METRES: float = 6.0
|
|
const FALL_DAMAGE_PER_METRE: float = 8.0
|
|
|
|
# Water, in metres and seconds. Depths are water over the floor under the player.
|
|
## The sea level a match starts at. The tide raises it from here.
|
|
const SEA_LEVEL_START: float = 0.0
|
|
## Deeper than this, walkers wade at WADE_SPEED and can't sprint.
|
|
const WADE_DEPTH: float = 0.4
|
|
## Water this deep over the floor lifts a player off it to swim.
|
|
const SWIM_DEPTH: float = 1.35
|
|
## A swimmer stands again where the water over the floor is shallower than this.
|
|
const SWIM_EXIT_DEPTH: float = 1.2
|
|
## A swimmer floats with the feet this far under the surface, head out.
|
|
const SWIM_FLOAT_DEPTH: float = 1.3
|
|
## With no stamina left a swimmer sinks until the feet are this far under: head under.
|
|
const SWIM_EXHAUSTED_DEPTH: float = 2.2
|
|
const SWIM_SPRINT_SPEED: float = 3.2
|
|
## Fraction of SWIM_SPEED left to an exhausted swimmer.
|
|
const SWIM_EXHAUSTED_FACTOR: float = 0.6
|
|
## Diving and rising speed, and how fast vertical speed changes in the water.
|
|
const SWIM_VERTICAL_SPEED: float = 2.0
|
|
const SWIM_VERTICAL_ACCEL: float = 12.0
|
|
## Fraction of downward speed kept on hitting deep water.
|
|
const WATER_ENTRY_DAMP: float = 0.25
|
|
## Seconds of paddling a full stamina bar allows. Sprint-swimming spends it faster.
|
|
const SWIM_STAMINA_SECONDS: float = 45.0
|
|
const SWIM_SPRINT_STAMINA_COST: int = 3
|
|
## Ticks of stamina and breath regained per tick out of the water or above it.
|
|
const STAMINA_RECOVERY_RATE: int = 3
|
|
const BREATH_RECOVERY_RATE: int = 4
|
|
|
|
# The drop, in metres and seconds. The sky barge crosses the island on a straight
|
|
# seeded route through a point within BARGE_CENTRE_JITTER of the middle.
|
|
const BARGE_ALTITUDE: float = 150.0
|
|
const BARGE_SPEED: float = 24.0
|
|
## The route starts and ends this far inside the world's edge.
|
|
const BARGE_ROUTE_MARGIN: float = 40.0
|
|
const BARGE_CENTRE_JITTER: float = 140.0
|
|
## Every route crosses at least this much dry land.
|
|
const BARGE_MIN_LAND_METRES: float = 250.0
|
|
## Fraction of the barge's speed a leaping player keeps.
|
|
const LEAP_CARRY: float = 0.4
|
|
const FREEFALL_MAX_SPEED: float = 32.0
|
|
## Horizontal speed a falling player can steer to, before and after the sail opens.
|
|
const FREEFALL_STEER_SPEED: float = 9.0
|
|
const GLIDE_SPEED: float = 13.0
|
|
## How fast horizontal speed changes while steering a fall, in metres per second squared.
|
|
const DROP_STEER_ACCEL: float = 20.0
|
|
## Sink rate under an open wing-sail, and how hard opening it brakes the fall.
|
|
const GLIDE_FALL_SPEED: float = 5.5
|
|
const GLIDE_BRAKE: float = 60.0
|
|
## The sail opens by itself this high above the ground or water.
|
|
const WING_AUTO_DEPLOY_HEIGHT: float = 40.0
|
|
## Within this height of the ground or water, the sail folds and the player drops the rest.
|
|
const DROP_LAND_HANDOFF: float = 1.0
|
|
|
|
# The island. Worldgen fills the whole world square; the island is about a kilometre
|
|
# across, sized for 24 players. Heights are metres above the starting sea level.
|
|
## Spacing of the terrain heightfield, in metres. The grid covers WORLD_SIZE_METRES.
|
|
const ISLAND_GRID_METRES: float = 2.0
|
|
## Mean distance from the world centre to the coast, before the coastline is warped.
|
|
const ISLAND_RADIUS_METRES: float = 400.0
|
|
const ISLAND_MIN_SUMMITS: int = 2
|
|
const ISLAND_MAX_SUMMITS: int = 4
|
|
## Summits are at least this far apart, so each one is a separate fight.
|
|
const ISLAND_SUMMIT_SPACING_METRES: float = 220.0
|
|
## The tallest summit lands between these heights. Both stay under ISLAND_MAX_HEIGHT.
|
|
const ISLAND_PEAK_MIN: float = 58.0
|
|
const ISLAND_PEAK_MAX: float = 67.0
|
|
## The open sea floor, in metres below the starting sea.
|
|
const ISLAND_SEA_DEPTH: float = 12.0
|
|
## Elevation bands, by height above the starting sea. Marsh is wet flat ground below
|
|
## ISLAND_MARSH_TOP; land from there up to ISLAND_FOREST_TOP is forest, then highland,
|
|
## and anything at or above ISLAND_SUMMIT_BAND is summit ground.
|
|
const ISLAND_BEACH_TOP: float = 2.5
|
|
const ISLAND_MARSH_TOP: float = 7.0
|
|
const ISLAND_FOREST_TOP: float = 32.0
|
|
const ISLAND_SUMMIT_BAND: float = 50.0
|
|
|
|
# Points of interest. Each kind places between its min and max on every island, and the
|
|
# total always lands between POI_MIN_TOTAL and POI_MAX_TOTAL.
|
|
const POI_KINDS: Dictionary = {
|
|
"shrine": {"min": 2, "max": 3},
|
|
"lighthouse": {"min": 1, "max": 2},
|
|
"dock": {"min": 2, "max": 3},
|
|
"salt_works": {"min": 1, "max": 2},
|
|
"quarry": {"min": 1, "max": 2},
|
|
"hamlet": {"min": 3, "max": 4},
|
|
}
|
|
const POI_MIN_TOTAL: int = 10
|
|
const POI_MAX_TOTAL: int = 16
|
|
## No two points of interest are closer than this, centre to centre.
|
|
const POI_SPACING_METRES: float = 85.0
|
|
|
|
# Props: trees, scrub, boulders, wrecks and crates scattered over the island. Each kind
|
|
# has health, the material it gives when harvested, and a collision footprint range in
|
|
# metres (`width` x `height`; wrecks are `length` long). Density is props per hectare
|
|
# in each elevation band; groves and clearings modulate it.
|
|
const PROP_KINDS: Dictionary = {
|
|
"pine": {"health": 200, "material": "driftwood", "width": [0.5, 0.7], "height": [7.0, 12.0]},
|
|
"scrub": {"health": 60, "material": "driftwood", "width": [1.1, 1.8], "height": [0.8, 1.3]},
|
|
"boulder": {"health": 400, "material": "stone", "width": [1.6, 3.4], "height": [1.0, 2.4]},
|
|
"wreck": {"health": 500, "material": "salvage_iron", "width": [2.2, 2.8], "height": [1.4, 2.0], "length": [5.5, 8.0]},
|
|
"crate": {"health": 80, "material": "driftwood", "width": [0.9, 1.2], "height": [0.9, 1.2]},
|
|
}
|
|
const PROP_DENSITY: Dictionary = {
|
|
"beach": {"wreck": 5.0, "crate": 6.0, "scrub": 2.0},
|
|
"marsh": {"scrub": 30.0, "crate": 1.0, "boulder": 1.0},
|
|
"forest": {"pine": 70.0, "scrub": 16.0, "boulder": 4.0, "crate": 0.3},
|
|
"highland": {"pine": 14.0, "boulder": 16.0, "scrub": 10.0},
|
|
"summit": {"boulder": 10.0, "scrub": 3.0},
|
|
}
|
|
## Props keep this far from any point-of-interest solid, loot marker or walking route.
|
|
const PROP_POI_CLEARANCE: float = 3.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, "surge": 0},
|
|
{"hold": 100.0, "rise": 50.0, "level": 18.0, "drown_dps": 4, "surge": 40},
|
|
{"hold": 80.0, "rise": 45.0, "level": 30.0, "drown_dps": 6, "surge": 60},
|
|
{"hold": 60.0, "rise": 40.0, "level": 42.0, "drown_dps": 8, "surge": 80},
|
|
{"hold": 45.0, "rise": 35.0, "level": 54.0, "drown_dps": 12, "surge": 100},
|
|
{"hold": 30.0, "rise": 30.0, "level": 64.0, "drown_dps": 16, "surge": 120},
|
|
{"hold": 20.0, "rise": 40.0, "level": 75.0, "drown_dps": 25, "surge": 150},
|
|
]
|
|
## Each island's levels are planned from its terrain (SafeGround): a phase's level is
|
|
## lowered, if need be, to this far under the top of the largest piece of land still
|
|
## dry when it begins, but every phase still rises at least TIDE_MIN_RISE_METRES. The
|
|
## last phase always takes its table level.
|
|
const TIDE_SAFE_MARGIN_METRES: float = 2.0
|
|
const TIDE_MIN_RISE_METRES: float = 4.0
|
|
## When a phase's rise begins, a storm surge does the phase's `surge` damage once to
|
|
## every built piece whose base is below the water plus this height, where that water
|
|
## reaches it. Breakwaters take it too.
|
|
const TIDE_SURGE_HEIGHT_METRES: float = 2.0
|
|
## Sudden death begins when the last rise ends: every player still standing loses this
|
|
## much health a second, armor or not. When it has run this long, the match ends and
|
|
## the winner is decided by Match's tie-break: most health, then highest feet, then
|
|
## earliest to join. So every match ends within the tide's total time plus this.
|
|
const TIDE_SUDDEN_DEATH_SECONDS: float = 60.0
|
|
const TIDE_SUDDEN_DEATH_DPS: int = 5
|
|
## The flood grid's cells are this big, matching the building grid so breakwater edges
|
|
## line up with cell edges.
|
|
const FLOOD_CELL_METRES: float = 4.0
|
|
|
|
# Bot navigation. Bots path over a grid of terrain samples and steer along it with the
|
|
# same commands players send.
|
|
## Spacing of the navigation grid, in metres. Matches the terrain heightfield.
|
|
const BOT_NAV_CELL_METRES: float = 2.0
|
|
## Neighbouring nav points further apart in height than this are a cliff, not a slope.
|
|
const BOT_NAV_MAX_RISE: float = 1.9
|
|
## Path cost multiplier for water too deep to wade: bots swim only when they must.
|
|
const BOT_NAV_WATER_WEIGHT: float = 8.0
|
|
## Most paths the shared grid plans in one server tick; other requests wait their turn.
|
|
const BOT_NAV_PATHS_PER_TICK: int = 1
|
|
## A bot moves on to the next waypoint within this horizontal distance of it.
|
|
const BOT_WAYPOINT_RADIUS: float = 1.3
|
|
## A bot that gains less than this toward its waypoint in BOT_STUCK_TICKS jumps, and
|
|
## after BOT_STUCK_REPATHS tries it marks the waypoint blocked and plans again.
|
|
const BOT_STUCK_PROGRESS: float = 0.5
|
|
const BOT_STUCK_TICKS: int = 20
|
|
const BOT_STUCK_REPATHS: int = 3
|
|
## Each bot re-checks its remaining path against grid changes this often, in ticks.
|
|
const BOT_PATH_CHECK_TICKS: int = 15
|
|
|
|
# Bot brains. Bots loot, fight, heal and keep ahead of the tide with only what a player
|
|
# would know: what they can see, the map's points of interest, and the tide forecast.
|
|
## Per difficulty: `reaction` is seconds between first seeing an opponent and firing,
|
|
## `aim_error` the most their aim wanders off the target in degrees, `sight` how far
|
|
## they can pick an opponent out in metres, and `lead` how much of a moving target's
|
|
## travel they allow for with slow shots (0 none, 1 all of it).
|
|
const BOT_DIFFICULTIES: Array[Dictionary] = [
|
|
{"name": "easy", "reaction": 0.9, "aim_error": 7.0, "sight": 45.0, "lead": 0.0},
|
|
{"name": "normal", "reaction": 0.5, "aim_error": 3.5, "sight": 65.0, "lead": 0.5},
|
|
{"name": "hard", "reaction": 0.25, "aim_error": 1.5, "sight": 90.0, "lead": 1.0},
|
|
]
|
|
## Each bot looks around once in this many ticks.
|
|
const BOT_SENSE_TICKS: int = 6
|
|
## Bots see this far to either side of where they face, and notice anyone this close
|
|
## whichever way they face.
|
|
const BOT_VIEW_HALF_ANGLE_DEGREES: float = 100.0
|
|
const BOT_HEARING_METRES: float = 10.0
|
|
## A bot remembers an opponent it has lost sight of for this long.
|
|
const BOT_MEMORY_SECONDS: float = 4.0
|
|
## A bot's aim drifts to a new error this often, in ticks.
|
|
const BOT_AIM_WANDER_TICKS: int = 12
|
|
## Bots ease off the trigger while bloom is above this, in degrees.
|
|
const BOT_BLOOM_PAUSE_DEGREES: float = 3.0
|
|
## Bots notice items lying within this distance.
|
|
const BOT_LOOT_SIGHT_METRES: float = 12.0
|
|
## The most weapons a bot carries; its other slots are for consumables.
|
|
const BOT_MAX_WEAPONS: int = 3
|
|
## Ground counts as safe from the next tide level when it stands this far above it.
|
|
const BOT_SAFE_MARGIN_METRES: float = 1.5
|
|
## A bot off safe ground leaves when the time to the next rise is less than its
|
|
## distance to safe ground at this speed, plus the buffer.
|
|
const BOT_FLEE_SPEED: float = 1.5
|
|
const BOT_FLEE_BUFFER_SECONDS: float = 20.0
|
|
## With less than this long before the water rises, bots only loot on safe ground.
|
|
const BOT_LOOT_TIDE_SECONDS: float = 30.0
|
|
## Bots give up on a loot spot or an item they can't get to after this long.
|
|
const BOT_LOOT_TIMEOUT_SECONDS: float = 45.0
|
|
const BOT_PICKUP_TIMEOUT_SECONDS: float = 8.0
|
|
|
|
# Building
|
|
const GRID_CELL_METRES: float = 4.0
|
|
## The most of each material a player can carry.
|
|
const MATERIAL_CAP: int = 500
|
|
## Material gained per boathook hit on a prop, whatever the prop.
|
|
const HARVEST_PER_HIT: int = 15
|
|
## Damage a boathook hit does to a prop or a built piece. Players take the boathook's
|
|
## `damage` instead.
|
|
const HARVEST_DAMAGE: int = 50
|
|
## A swing reaches this far past the boathook's range, from the eye, so a prop the body
|
|
## is touching is always in reach.
|
|
const HARVEST_REACH_SLACK: float = 0.4
|
|
## Props are hit if the swing passes within this distance of their box.
|
|
const HARVEST_AIM_SLACK: float = 0.25
|
|
## 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},
|
|
}
|
|
## Pieces are GRID_CELL_METRES on a side and tall, and snap across to the grid. Up and
|
|
## down they snap to levels BUILD_LEVEL_METRES apart, half a cell, so a piece built on
|
|
## the ground is never more than a metre above or below the builder's feet. Level 0 is
|
|
## the starting sea level; levels run from BUILD_MIN_LEVEL to BUILD_MAX_LEVEL.
|
|
const BUILD_LEVEL_METRES: float = 2.0
|
|
const BUILD_MIN_LEVEL: int = -8
|
|
const BUILD_MAX_LEVEL: int = 63
|
|
## A piece's centre must be within this distance of the builder's eye.
|
|
const BUILD_RANGE: float = 9.5
|
|
## Ticks between placements while fire is held: 10 pieces a second.
|
|
const BUILD_INTERVAL_TICKS: int = 3
|
|
## Looking further up than this, in degrees, targets the level above.
|
|
const BUILD_LOOK_UP_DEGREES: float = 35.0
|
|
## Looking further down than this puts floors, ramps and roofs in the builder's own cell.
|
|
const BUILD_LOOK_DOWN_DEGREES: float = 40.0
|
|
const WALL_THICKNESS: float = 0.3
|
|
const BREAKWATER_THICKNESS: float = 0.6
|
|
const FLOOR_THICKNESS: float = 0.2
|
|
## Ramps are stairs of this many steps, so each riser can be stepped up.
|
|
const RAMP_STEPS: int = 10
|
|
## A new piece starts at this fraction of its material's health and reaches full health
|
|
## after the material's `build_seconds`.
|
|
const BUILD_START_HEALTH_FRACTION: float = 0.1
|
|
## Damage per second to a piece other than a breakwater whose base is under the sea.
|
|
const TIDE_STRUCTURE_DPS: int = 4
|
|
## A breakwater holds this much water above its base. Deeper, it fails at once.
|
|
const BREAKWATER_MAX_HEAD: float = 6.0
|
|
const BREAKWATER_WEAR_PER_METRE: float = 2.0
|
|
const BREACH_FLOW_METRES_PER_SECOND: float = 1.5
|
|
|
|
# Inventory and pickups
|
|
## Items picked up or dropped must be within this distance of the player's feet.
|
|
const PICKUP_RANGE: float = 2.5
|
|
## Changing the held slot takes this long before the new item can be used.
|
|
const SWAP_SECONDS: float = 0.25
|
|
## Dropped items land on a ring this far from the player's feet.
|
|
const DROP_SCATTER_METRES: float = 1.2
|
|
## Ammunition, carried apart from the five slots. `cap` is the most a player carries,
|
|
## `pickup` how much one ammunition pickup holds.
|
|
const AMMO: Dictionary = {
|
|
"birdshot": {"cap": 60, "pickup": 12},
|
|
"cartridges": {"cap": 300, "pickup": 30},
|
|
"heavy_balls": {"cap": 30, "pickup": 6},
|
|
"lines": {"cap": 12, "pickup": 3},
|
|
"harpoons": {"cap": 10, "pickup": 3},
|
|
}
|
|
|
|
# Weapons. Falloff is linear from full damage at `range_full` to `falloff_min`
|
|
# (a fraction of damage) at `range_max`. `spread` is the cone half-angle in degrees
|
|
# from the hip; aiming multiplies it by AIM_SPREAD_FACTOR. Each shot adds `bloom`
|
|
# degrees, which decays at BLOOM_DECAY_DEGREES_PER_SECOND while the weapon is ready. `projectile_speed` 0 means
|
|
# hitscan; otherwise shots fly at that speed under `projectile_gravity`. `ammo` names
|
|
# an AMMO type; a weapon with `stack` above 1 is thrown and is its own ammunition.
|
|
# `pull_speed` yanks the shooter towards where the shot lands, at that speed.
|
|
# `structure_factor` scales damage to built pieces and props (default 1).
|
|
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,
|
|
"spread": 0.0, "bloom": 0.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,
|
|
"spread": 5.0, "bloom": 0.0, "ammo": "birdshot", "headshot": 1.5,
|
|
},
|
|
"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,
|
|
"spread": 1.2, "bloom": 0.35, "ammo": "cartridges", "headshot": 1.75,
|
|
},
|
|
"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,
|
|
"spread": 0.8, "bloom": 0.6, "ammo": "cartridges", "headshot": 2.0,
|
|
},
|
|
"rivet_repeater": {
|
|
"damage": 17, "fire_rate": 11.0, "magazine": 35, "reload": 2.0,
|
|
"range_full": 12.0, "range_max": 45.0, "falloff_min": 0.4, "rarity": 0,
|
|
"spread": 2.4, "bloom": 0.25, "ammo": "cartridges", "headshot": 1.5,
|
|
},
|
|
"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,
|
|
"spread": 3.0, "bloom": 0.0, "ammo": "heavy_balls", "headshot": 2.5,
|
|
"aim_spread": 0.0, "projectile_speed": 300.0, "projectile_gravity": 9.0,
|
|
},
|
|
"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,
|
|
"spread": 0.0, "bloom": 0.0, "ammo": "lines",
|
|
"projectile_speed": 90.0, "projectile_gravity": 4.0, "pull_speed": 18.0,
|
|
},
|
|
"harpoon_gun": {
|
|
"damage": 70, "fire_rate": 0.9, "magazine": 1, "reload": 1.8,
|
|
"range_full": 25.0, "range_max": 70.0, "falloff_min": 0.6, "rarity": 1,
|
|
"spread": 0.6, "bloom": 0.0, "ammo": "harpoons", "headshot": 1.5,
|
|
"projectile_speed": 120.0, "projectile_gravity": 6.0, "structure_factor": 2.5,
|
|
},
|
|
"powder_keg": {
|
|
"damage": 80, "structure_damage": 400, "blast_radius": 6.0, "fuse": 3.0,
|
|
"fire_rate": 0.8, "magazine": 1, "reload": 0.0, "stack": 3,
|
|
"range_full": 0.0, "range_max": 30.0, "falloff_min": 1.0, "rarity": 2,
|
|
"spread": 0.0, "bloom": 0.0,
|
|
},
|
|
}
|
|
## Spread multiplier while aiming, unless a weapon sets its own `aim_spread`.
|
|
const AIM_SPREAD_FACTOR: float = 0.4
|
|
## Extra spread while moving, and while airborne or swimming, in degrees.
|
|
const MOVING_SPREAD_DEGREES: float = 1.5
|
|
const AIRBORNE_SPREAD_DEGREES: float = 4.0
|
|
const MAX_BLOOM_DEGREES: float = 6.0
|
|
const BLOOM_DECAY_DEGREES_PER_SECOND: float = 6.0
|
|
## Default damage multiplier for a hit on the head, unless a weapon sets `headshot`.
|
|
const HEADSHOT_MULTIPLIER: float = 1.5
|
|
## The top of a player's body this tall counts as the head.
|
|
const HEAD_HEIGHT: float = 0.35
|
|
## Shots against built pieces and props do this fraction of their player damage.
|
|
const WEAPON_STRUCTURE_FACTOR: float = 1.0
|
|
## Quality tiers, lowest first. Loot rolls a tier for each weapon it spawns. `damage`
|
|
## multiplies every hit and `reload` multiplies the reload time.
|
|
const WEAPON_TIERS: Array[Dictionary] = [
|
|
{"name": "rusted", "damage": 1.0, "reload": 1.0},
|
|
{"name": "seaworthy", "damage": 1.08, "reload": 0.95},
|
|
{"name": "brass_fitted", "damage": 1.16, "reload": 0.9},
|
|
{"name": "captains", "damage": 1.25, "reload": 0.85},
|
|
]
|
|
## A line pull also lifts the puller this fast, so it clears the ground.
|
|
const LINE_PULL_LIFT: float = 4.0
|
|
|
|
# Consumables. Fire with one held starts using it; it takes effect after `use_seconds`
|
|
# unless interrupted. `heal` restores health up to `heal_cap` (default full), `armor`
|
|
# adds armor up to PLAYER_MAX_ARMOR. An item that would do nothing can't be started.
|
|
const ITEMS: Dictionary = {
|
|
"sailcloth_bandage": {"heal": 25, "heal_cap": 75, "use_seconds": 3.0, "stack": 6, "rarity": 0, "loot": 3},
|
|
"brine_tonic": {"heal": 60, "use_seconds": 8.0, "stack": 3, "rarity": 1, "loot": 1},
|
|
"cork_vest": {"armor": 50, "use_seconds": 5.0, "stack": 2, "rarity": 1, "loot": 1},
|
|
"tar_patch": {"armor": 20, "use_seconds": 2.0, "stack": 5, "rarity": 0, "loot": 2},
|
|
}
|
|
|
|
# Loot. Every loot marker at a point of interest holds either a sea chest, with chance
|
|
# `chest`, or floor loot: `rolls` rolls on the source's category weights. Washed-up
|
|
# crates (props) hold one source "crate" roll each and spill it when broken. A weapon
|
|
# rolls its tier from `tiers` (weights, lowest tier first) and comes with
|
|
# LOOT_AMMO_WITH_WEAPON pickups of its ammunition. Within a category, an item's weight
|
|
# is LOOT_RARITY_WEIGHTS[rarity]. Consumables spawn `loot` of themselves (ITEMS), thrown
|
|
# weapons LOOT_THROWN_COUNT, and ammunition one pickup amount (AMMO).
|
|
const LOOT_SOURCES: Dictionary = {
|
|
"hamlet": {"chest": 0.3, "rolls": 2, "weapon": 50, "consumable": 25, "ammo": 15, "nothing": 10, "tiers": [55, 30, 12, 3]},
|
|
"dock": {"chest": 0.4, "rolls": 2, "weapon": 45, "consumable": 25, "ammo": 20, "nothing": 10, "tiers": [50, 32, 14, 4]},
|
|
"salt_works": {"chest": 0.3, "rolls": 2, "weapon": 45, "consumable": 30, "ammo": 15, "nothing": 10, "tiers": [55, 30, 12, 3]},
|
|
"quarry": {"chest": 0.4, "rolls": 2, "weapon": 45, "consumable": 20, "ammo": 25, "nothing": 10, "tiers": [50, 32, 14, 4]},
|
|
"lighthouse": {"chest": 0.6, "rolls": 2, "weapon": 50, "consumable": 25, "ammo": 20, "nothing": 5, "tiers": [35, 35, 22, 8]},
|
|
"shrine": {"chest": 0.8, "rolls": 2, "weapon": 55, "consumable": 25, "ammo": 15, "nothing": 5, "tiers": [20, 35, 30, 15]},
|
|
"crate": {"chest": 0.0, "rolls": 1, "weapon": 35, "consumable": 30, "ammo": 25, "nothing": 10, "tiers": [65, 27, 7, 1]},
|
|
}
|
|
## A sea chest holds this many weapons and consumables, and ammunition for each weapon
|
|
## plus LOOT_CHEST_EXTRA_AMMO random ammunition pickups. Its weapons roll their tier
|
|
## LOOT_CHEST_TIER_ROLLS times and keep the best.
|
|
const LOOT_CHEST_WEAPONS: int = 1
|
|
const LOOT_CHEST_CONSUMABLES: int = 1
|
|
const LOOT_CHEST_EXTRA_AMMO: int = 1
|
|
const LOOT_CHEST_TIER_ROLLS: int = 2
|
|
## If the rolls leave fewer weapons than this on floors and in chests, extra weapon
|
|
## rolls are added to floor spots in marker order: one per player in a full lobby.
|
|
const LOOT_MIN_POI_WEAPONS: int = SOLO_PLAYERS
|
|
const LOOT_RARITY_WEIGHTS: Array[int] = [6, 3, 1]
|
|
const LOOT_AMMO_WITH_WEAPON: int = 1
|
|
const LOOT_THROWN_COUNT: int = 2
|
|
## Interact opens a closed chest whose base is within this distance of the feet.
|
|
const CHEST_RANGE: float = 2.5
|
|
## Loot from one spot lands on a ring this far from it.
|
|
const LOOT_SCATTER_METRES: float = 0.7
|