Initial commit: Transcience MVP
Top-down twin-stick bullet-hell, Godot 4.7, server-authoritative dedicated server with client-side prediction. Clients send input only; the server resolves every hit for both players and enemies (no PvP). - SimWorld: whole simulation as plain RefCounted objects (no nodes, no physics server), ~0.24ms/tick at peak load -- runs headless for free and drives 78 tests in under a second - BulletPool: struct-of-arrays bullet storage, replicated as spawn/despawn events rather than per-tick state - Emitter framework (Ring/AimedSpread/WallGap/ArcSweep) shared by trash enemies and bosses -- a new boss is data in src/content/content.gd, no simulation changes - The Warden of the Fold: stationary 4-phase boss built entirely on that format - Lobby hub with a portal into on-demand dungeon instances; one process hosts the hub plus every concurrent dungeon - Emergency escape: 3s server-owned channel, cancelled by damage - tools/check.sh, test.sh (GUT), smoke.sh (real server + bot clients over ENet), bench.gd; git hooks wired to the same scripts - docs/ARCHITECTURE.md, NETCODE.md, WORKFLOW.md, ROADMAP.md
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
class_name BossDef
|
||||
extends Resource
|
||||
## A whole boss. Adding a boss to the game is writing one of these plus its
|
||||
## emitter list -- there is no per-boss code path anywhere in the simulation.
|
||||
|
||||
@export var id: StringName = &"boss"
|
||||
@export var display_name: String = "Boss"
|
||||
@export var max_hp: int = 4000
|
||||
@export var radius: float = 44.0
|
||||
## Stationary bosses are the MVP shape; the field exists so a later boss can
|
||||
## move without changing the runtime.
|
||||
@export var stationary: bool = true
|
||||
@export var spawn_pos := Vector2(0.0, -140.0)
|
||||
@export var phases: Array[BossPhase] = []
|
||||
|
||||
|
||||
## Index of the phase that matches [param hp_fraction]. Later entries win, so a
|
||||
## boss at 0.2 hp picks the lowest-threshold phase that still covers it.
|
||||
func phase_index_for(hp_fraction: float) -> int:
|
||||
var chosen := 0
|
||||
for i in phases.size():
|
||||
if hp_fraction <= phases[i].enter_at_hp_fraction:
|
||||
chosen = i
|
||||
return chosen
|
||||
@@ -0,0 +1 @@
|
||||
uid://cakbi458wdkrr
|
||||
@@ -0,0 +1,18 @@
|
||||
class_name BossPhase
|
||||
extends Resource
|
||||
## One stage of a boss fight: a looping timeline of emitters, entered when the
|
||||
## boss drops below [member enter_at_hp_fraction].
|
||||
|
||||
@export var name: String = "Phase"
|
||||
## The phase becomes active once hp/max_hp is at or below this. Phases are
|
||||
## evaluated in array order, so list them from 1.0 downwards.
|
||||
@export_range(0.0, 1.0, 0.01) var enter_at_hp_fraction: float = 1.0
|
||||
## The phase timeline wraps at this many ticks. Emitter [member start_tick] and
|
||||
## [member end_tick] are relative to the start of each loop.
|
||||
@export var loop_ticks: int = 600
|
||||
## Ticks of no fire after entering the phase, so the transition is readable.
|
||||
@export var telegraph_ticks: int = 45
|
||||
## Damage taken while in this phase is scaled by this. Use < 1.0 for armoured
|
||||
## phases rather than adding hit points, so the fight length stays predictable.
|
||||
@export var damage_taken_mult: float = 1.0
|
||||
@export var emitters: Array[BulletEmitter] = []
|
||||
@@ -0,0 +1 @@
|
||||
uid://dfub6sufpvw1n
|
||||
@@ -0,0 +1,36 @@
|
||||
class_name EnemyDef
|
||||
extends Resource
|
||||
## Data-only description of a trash enemy. Behaviour is picked from a small set
|
||||
## of readable, predictable movements -- players should be able to learn an
|
||||
## enemy in one encounter.
|
||||
|
||||
enum Move {
|
||||
## Never moves. Pure turret.
|
||||
STATIC,
|
||||
## Slides along a fixed heading, bouncing off the arena edges.
|
||||
DRIFT,
|
||||
## Circles its spawn point at a fixed radius.
|
||||
ORBIT,
|
||||
## Walks straight at the nearest player, slowly.
|
||||
APPROACH,
|
||||
## Keeps a preferred distance from the nearest player.
|
||||
STRAFE,
|
||||
}
|
||||
|
||||
@export var id: StringName = &"drone"
|
||||
@export var display_name: String = "Drone"
|
||||
@export var max_hp: int = 40
|
||||
@export var radius: float = 14.0
|
||||
@export var contact_damage: int = 10
|
||||
@export var move: Move = Move.DRIFT
|
||||
@export var speed: float = 60.0
|
||||
## ORBIT radius, or STRAFE preferred distance.
|
||||
@export var move_param: float = 120.0
|
||||
## Ticks between direction re-evaluations for APPROACH/STRAFE, so enemies read
|
||||
## as deliberate rather than twitchy.
|
||||
@export var retarget_interval: int = 30
|
||||
## Index the client renderer uses to pick a shape/colour.
|
||||
@export var visual: int = 0
|
||||
@export var emitters: Array[BulletEmitter] = []
|
||||
## The emitter timeline wraps at this many ticks.
|
||||
@export var pattern_loop_ticks: int = 240
|
||||
@@ -0,0 +1 @@
|
||||
uid://njtjcrwckton
|
||||
Reference in New Issue
Block a user