## Headless Server
- New entry point: scenes/headless_server.tscn + scripts/headless_server.gd
- Loads multiplayer-fps game, strips UI/rendering, auto-hosts ENet server
- Port config via --port arg, SERVER_PORT env, or default 34197
- RCON admin console on port 28960 (configurable via --rcon-port)
## Netfox Headless Bootstrap
- scripts/netfox_headless_bootstrap.gd — preloads all netfox dependency
scripts in headless mode so class_names register before autoloads parse
- Registered as first autoload in project.godot
- Fixes 'Could not find type' errors for NetfoxLogger, NorayProtocolHandler,
NetworkClocks, etc.
## RCON Admin
- Ported from old project: scripts/rcon/rcon_server.gd (TCP auth layer)
- scripts/rcon/rcon_command_handler.gd (command dispatch)
- Password via config/rcon_password.cfg, --rcon-password, or RCON_PASSWORD env
## Other Changes
- Added GameEvents stub (lan-bootstrapper dependency)
- Updated project.godot features to 4.7
- Added config/server_config.cfg for operator editing
- Updated RCON paths to new project structure
- Copied fps_camera.gd from client/characters/character/ to scripts/characters/
- Updated player.tscn to reference new path
- The client/ directory has its own project.godot so Godot ignores it during export
- Zero export errors now
- Changed run/main_scene to entry.tscn (smart bootstrap detects headless vs display)
- client_main.gd now uses player.tscn instead of old FPS template
- Added mouse look (click-to-capture, escape-to-release) to player.gd fallback path
- Added _gather() call to player.gd fallback _physics_process() so PlayerNetInput
is populated even without NetworkTime singleton (exported builds)
- Re-exported Windows build with same tag v0.1.0-windows
- WeaponData: restored class_name, converted static vars to make() factory
- WeaponDefinitions: updated to use make() instead of static var refs
- Windows export: tactical-shooter.exe + godot-jolt_windows-x64.dll
- Build artifact: build/tactical-shooter-windows-x86_64-v0.1.0.zip
- Fix dead code in server_main.gd (unreachable lag compensation print)
- Remove WeaponData type hints from weapon_server.gd (Resource class_name in Node scripts = headless fail)
- Use preload() instead of WeaponData class_name in weapon_definitions.gd for const refs
- Lazy-init WEAPONS dict (const can't reference preload members)
- Remove duplicate class_name RoundManager from server/scripts/round/round_manager.gd
- Remove DamageProcessor type hints from round/round_manager.gd and bomb_objective.gd
- Add start()/stop()/can_tick()/tick()/spawn_entity()/despawn_entity() to simulation_server_stub.gd
- Fix get_world_3d() → get_tree().root.world_3d in weapon_server.gd Node context
- Fix var data := → var data = for untyped WeaponDefinitions.get_weapon() returns
- Clean export cache and verify server starts with zero parse errors
- Changed player.gd from extending FPSCharacterController (via path) to
extending CharacterBody3D directly, avoiding headless class resolution
error for client/ scripts.
- Removed super._ready() and _set_local_player() calls (FPSCharacterController
specifics not available in CharacterBody3D).
- Replaced super._rollback_tick() with direct simulation guard.
- Removed reset_pose() call (FPSCharacterController-specific).
- All FPSCharacterController features remain in client-side player_netfox.gd
which extends player.gd.
- Verified: 0 SCRIPT ERRORs in headless mode.
- Fixed double-emission bug in network_manager.gd: ENet signal connections
(peer_connected/peer_disconnected) are now only connected when netfox
NetworkEvents is NOT available, preventing duplicate player_connected/
player_disconnected signal emissions.
- Fixed stop() to only disconnect ENet signals when they were actually
connected (mirrors the conditional connection in start_server()).
- Fixed headless parse error in player_net_input.gd: replaced direct
NetworkTime.before_tick_loop reference with Engine.get_singleton()
call, avoiding unresolved type identifier in headless mode.
- netfox_bootstrap.gd added as minimal autoload placeholder.
- Dual-path architecture: netfox NetworkEvents when available (editor),
ENet fallback when netfox unavailable (headless server).
- Broadcast RPCs (spawn, round state, scores) kept as-is since they
work identically through Godot's MultiplayerAPI in both paths.
- Renamed inner class Entity→StubEntity (Godot has native Entity class)
- Added await ServerConfig.config_loaded before reading map_list in server_main.gd
- Config loads via call_deferred, so _ready() must wait for signal
- Replaced TeamData.Team type hints with int in all scripts
- Added explicit preloads for headless mode class resolution
- Created stub LagCompensation and DamageProcessor scripts
- Fixed PluginManager, SpawnManager, EconomyManager, BuyZone,
RoundManager, BuyMenuHandler, BombObjective class_name references
- Updated server config to match ServerConfig.gd format
Gray screen root cause: server scripts failed to parse in headless
mode due to Godot 4 class_name loading order (Resource after Node),
leaving server_main.gd non-functional — accepted connections but
never spawned players.
Replaces the overhead box-mesh view with a full FPS character:
- mouse look, WASD movement, jump (Space), crouch (C), sprint (Shift), lean (Q/E)
- 6 weapons (LMB shoot, R reload, scroll switch, F melee, G drop)
- Crosshair HUD, ammo counter, sprint bar
- Client sends position to server at 20Hz for multiplayer visibility
- Server broadcasts positions to all peers
- Remote players shown as boxes (placeholder)
source: https://godotengine.org/asset-library/asset/2652 (MIT license)
client_main.gd: when server spawns our player, create a player node with authority
- Camera follows local player from 3/4 overhead view
- player.gd WASD input sends position to server via RPC
- Server validates and broadcasts to all peers
Adds:
- bomb_objective.gd: server-authoritative bomb state machine (IDLE→PLANTED→EXPLODED/DEFUSED)
- plant_bomb(player_id, pos) - T-side only, LIVE phase, inside bombsite
- defuse_bomb(player_id) - CT-side only, near bomb, 5s timer
- cancel_defuse(player_id) - if defuser moves or is killed
- bomb_explode() - configurable radius damage (10m lethal, 15m half)
- 40s bomb timer (configurable)
- Full query API: is_bomb_planted(), get_bomb_position(), get_bomb_timer()
- Signals: bomb_planted, bomb_defused, bomb_exploded, defuse_started, defuse_cancelled
- Connected to RoundManager via GameServer for round-end outcomes
- bomb_carrier.gd: client-side bomb carrier UI
- Bomb status/defuse progress UI updates
- Direction indicator to planted bomb
- "Hold E to defuse" prompt for CT near bomb
- "Hold E to plant" prompt for T with bomb in bombsite
- test_range.tscn: BombsiteA (south-west, -20,0,-5) and BombsiteB (north-east, 15,0,20)
- 8x4m Area3D zones with BoxShape3D collision
- PlantPosition Marker3D children
- Group 'bomb_sites' for server discovery
- game_server.gd: BombObjective integration in _ready()
- Creates and wires BombObjective to RoundManager, TeamManager, DamageProcessor
- Registers bomb sites from scene tree
- Connects bomb_exploded/bomb_defused → RoundManager.end_round()
- Connects round_ended → bomb.reset()
Creates the full buy/economy subsystem for a tactical FPS:
- EconomyManager (server/scripts/economy/economy_manager.gd): per-player
money tracking with starting 00, kill/round/objective rewards, spending
validation, escalating loss bonuses, and money_changed signal.
- BuyMenuHandler (server/scripts/economy/buy_menu_handler.gd): server-side
RPC validation of purchase requests — checks weapon validity, buy-zone
membership (scans BuyZone nodes in scene tree), affordability, then
deducts money and grants weapon via WeaponServer.give_weapon().
- BuyMenu (client/characters/weapon/buy_menu.gd): client-side Control UI
with styled panel, money display, weapon grid (name/cost/stats), numeric
key (1-4) and mouse-click purchase, server-driven affordability, and
auto-close after purchase.
- GameServer integration: creates EconomyManager + BuyMenuHandler in
_ready(), registers players for economy on spawn, awards kill rewards
via DamageProcessor.player_killed signal, and unregisters on despawn.
Economy rules: win=+,250, loss=,900 (+00/streak, cap ,900),
kill=+00, bomb_plant/defuse=+00. Weapon costs: pistol=00,
smg=,200, rifle=,700, shotgun=,900.
NEW: server/scripts/combat/lag_compensation.gd
- 128-entry ring buffer of player positions per server tick
- rewind_and_raycast(tick, origin, direction, range, exclude):
saves current positions, rewinds to tick-time positions,
performs PhysicsDirectSpaceState3D.intersect_ray(), restores
- Falls back to normal raycast if history missing for tick
- shot_processed signal
NEW: scripts/combat/damage_processor.gd
- Processes WeaponServer hit results: applies damage, tracks kills
- Optional distance-based damage falloff
- player_damaged / player_killed signals
- Health and kill-count queries
MODIFY: server/scripts/weapons/weapon_server.gd
- fire() now takes tick parameter: fire(tick, player_id, ...)
- _perform_hitscan() uses LagCompensation.rewind_and_raycast()
when lag_compensation reference is set and tick >= 0
- Non-compensated fallback path preserved
MODIFY: server/scripts/game_server.gd
- Adds _current_tick counter, incremented each simulation tick
- Creates WeaponServer + LagCompensation + DamageProcessor as children
- record_tick() called before each tick's simulation
- register/unregister_player_node() for player lifecycle
- _on_player_killed() relays kill events via player_damaged signal
MODIFY: scripts/network/server_main.gd
- _spawn_player() registers node with GameServer.register_player_node()
- _despawn_player() unregisters via unregister_player_node()
- team_data.gd: Team enum (SPECTATOR/CT/Terrorist), constants for names,
colors, starting money, and spawn groups; TeamData resource class
- team_manager.gd: Player-to-team assignment, auto-balancing, score
tracking; round-independent (persists across rounds)
- spawn_manager.gd: Scans scene for Marker3D nodes in spawn_points_ct
and spawn_points_t groups; selects valid spawns (farthest from enemies
with proximity check, fallback to first available)
- buy_zone.gd: Area3D-based trigger zone with team filtering, player
enter/exit tracking and signals
- test_range.tscn: Added 2 CT spawn markers and 2 T spawn markers with
appropriate groups
Add client-side prediction (t_p1_pred) with:
- scripts/network/snapshot.gd — lightweight snapshot resource with
to_dict/from_dict serialization for RPC. Stores position (Vector3),
rotation (Quaternion), velocity (Vector3), grounded (bool).
- scripts/network/client_prediction.gd — prediction/reconciliation
controller. 64-entry ring buffer of local snapshots, sends inputs to
server each physics tick (128Hz, ENet channel 0), detects misprediction
on server state arrival, rewinds and re-applies unconfirmed inputs.
Also supports remote player interpolation.
- scripts/network/network_manager.gd — new RPC endpoints for client
prediction: send_client_input (client->server, ch 0) and
send_server_state (server->client, ch 1). New signals for routing.
- client/characters/character/fps_character_controller.gd — prediction
hooks in _physics_process: on_before_tick() captures pre-input
snapshot, on_after_tick() sends input to server. Client prediction
path uses local movement (instant feedback) instead of reading from
SimulationServer entity.
Architecture:
Each tick: client applies input → predicts new state locally
→ sends input to server → server returns authoritative state
→ client compares and reconciles if mismatch.
- WeaponData resource class with configurable weapon properties and
pre-configured constants for rifle, pistol, shotgun, and SMG
- WeaponDefinitions singleton/static registry with WEAPONS dictionary
- WeaponServer node for server-authoritative weapon logic including
fire rate cooldowns, ammo tracking, reload state machine, and
multi-pellet hit-scan raycasting
- Extended WeaponManager with weapon inventory array, weapon switching,
per-weapon state persistence, fire_animation_triggered signal
Creates test_range.tscn under client/assets/maps/test_range/ as a simple
open-area test map for validating movement, shooting, and networking.
Layout:
- 80×80 open area with grey floor (CSGBox3D, 12 tris)
- Low platform (center, 1 unit high, gold)
- Medium platform (east, 2 units high, gold)
- High platform (north-west, 3 units high, red)
- Ramp (south, tilted ~20°, leads ground to low platform top)
- Enclosure/room (east, 12×12 interior, 4-unit walls, south doorway)
- SpawnPoint (Marker3D) with group 'spawn_points'
- DirectionalLight3D (sun) + WorldEnvironment
- All geometry uses Solid-color StandardMaterial3D placeholders
- Collision enabled on all CSGBox3D shapes
- ~132 tris total (well under 500 budget)
- Restructured kit_demo.tscn from linear demo to enclosed 5.12x5.12 room
with walls, floor tiles, pillar, beam, doorway, window
- Added WorldEnvironment with ProceduralSky for ambient lighting
- Added DirectionalLight3D (sun key light, 45° angle, shadows enabled)
- Added OmniLight3D (warm interior fill light)
- Added ReflectionProbe for interior specular reflections
(box projection, room-sized extents)
- Added LightmapGI with balanced quality settings
(bounces=3, texel_scale=1.0, max_texture_size=2048, denoiser=true)
- Added tool script (kit_demo.gd) that prints bake status in editor
- Added bake_lighting.gd CLI bake script (requires GPU-enabled instance)
- Updated project.godot with reflection atlas and shadow map quality settings
Headless baking note: Godot's standard editor build requires a GPU/display
for LightmapGI.bake(). Open the scene in the Godot editor and click 'Bake
Lightmap' on the LightmapGI node to generate the baked lightmap data.