Commit graph

14 commits

Author SHA1 Message Date
fcd5fc6ce8 Fix spectator display and recorded spectator handling
- Set sv_demoplaying before devmap so game module knows during
  ClientConnect/ClientBegin
- Call ClientUserinfoChanged after forcing spectator team so
  CS_PLAYERS configstring has correct team value for cgame
- Record sanitized playerState for spectators (pm_type=PM_SPECTATOR,
  PERS_TEAM=TEAM_SPECTATOR) so they show correctly on scoreboard
  instead of appearing as regular players from follow-mode corruption

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 23:44:22 +08:00
76538c3216 Block team changes during demo playback
Prevent spectators from joining a playing team during demo
playback, which would disrupt the playback state. Prints a
message to the client instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 06:26:28 +08:00
0bd116982a Add player follow mode during demo playback
Call CalculateRanks and ClientEndFrame for the spectator in demo
mode G_RunFrame. SpectatorClientEndFrame copies the followed
player's recorded playerState into the spectator's ps, giving
first-person view with full HUD (health, armor, ammo, weapon).

Standard spectator controls work: mouse1 to cycle, mouse2 to
enter follow from free camera.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 04:52:58 +08:00
1f8c8aea1c Record playerStates for scoreboard and future follow mode
Record delta-compressed playerState_t for each active player per
frame using MSG_WriteDeltaPlayerstate. During playback, inject
into game module via SV_GameClientNum and mark players as
CON_CONNECTED with correct team. CalculateRanks and the
scoreboard now show recorded players with scores.

This also lays the groundwork for player-follow spectating.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 04:46:40 +08:00
a8044aad8b Server-side demo recording and playback (netdemo)
Records full entity state array each server frame, enabling
free-camera demo playback from any viewpoint.

Recording:
- svdemo_record <name> / svdemo_stop
- Captures entityState_t + PVS fields (svFlags, linked,
  currentOrigin, absmin, absmax) for all active entities
- Records configstring changes per frame
- File format: svdemos/<name>.svdm

Playback:
- svdemo_play <name>
- Loads map with maxclients=64, reserves recorded player slots
  (CS_ZOMBIE with safe rate/timing) so spectator gets a high slot
- Injects recorded entities into sv.gentities each frame with
  SV_LinkEntity for PVS visibility
- Re-applies demo configstrings (CS_PLAYERS etc.) after map load,
  skipping CS_SERVERINFO/CS_SYSTEMINFO to avoid latch restarts
- Game module runs in demo mode (sv_demoplaying cvar): G_RunFrame
  only processes spectator movement, skips all entity logic
- Spectator forced to TEAM_SPECTATOR on connect (ClientBegin)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 04:28:55 +08:00
ba1c1b5a60 QL step jump with master gate and projected validation
Add full QL-style PM_StepSlideMove with:
- Master gate: trace from start to final position filters micro-bumps
- Projected position validation: trace down at where player would be
  without collision, rejects walls (startsolid) and confirms stairs
- Air-step friction: 3% horizontal penalty on airborne step-ups
- PM_Jump() call when all gates pass on valid stair geometry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:58:11 +08:00
043e3a2def QL stair traversal: conditional velocity clip + air steps
Two changes to PM_StepSlideMove that transform stair traversal:

1. Remove Q3 velocity[2]>0 gate (QL pm_airSteps): allow step-ups
   while airborne, enabling bunny-hop stair traversal.

2. Conditional velocity clip: only clip velocity to step-down surface
   when moving INTO it (dot product < 0). Skip clip when velocity is
   moving away (dot >= 0), preserving upward momentum through steps.
   This is THE key mechanic for smooth QL-style stair hopping.

Also adds 100ms jump cooldown (lastJumpTime) to prevent same-frame
double-fires during rapid step-ups.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 15:08:16 +08:00
3327e9680c QL movement foundation: auto-hop, PM_Jump/PM_CanJump extraction, lastJumpTime
- Extract PM_Jump from PM_CheckJump for reuse by future step jump code
- Add PM_CanJump gate function (checks respawned, pm_type, upmove)
- Remove PMF_JUMP_HELD gate for QL-style auto-hop (hold jump to bunny hop)
- Add lastJumpTime to playerState_t (networked via msg.c) for jump cooldown
- bg_slidemove.c unchanged (no step jump yet -- needs proper QL analysis)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 05:45:18 +08:00
009dc313d4 Implement QL-style auto-hop (always enabled)
Remove the PMF_JUMP_HELD gate from PM_CheckJump so players can
hold jump to bunny hop continuously without releasing between
hops. The existing Pmove() outer loop already forces upmove=20
when PMF_JUMP_HELD is set, making this the only change needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 04:33:41 +08:00
0602b6ad4b Extract PM_Jump from PM_CheckJump (QL-style refactor)
Separate the jump execution (velocity, event, animation) from the
gate logic (respawn check, upmove threshold, jump-held check).
This prepares the code for QL features that need to trigger jumps
from contexts other than the normal ground jump path (step jump,
double jump, etc). No behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 04:31:49 +08:00
Sergei Shubin
5eb0118ee3 Copy game/cgame/ui to missionpack/ for TA configurations
Debug TA and Release TA configs now copy their output DLLs to
workdir/missionpack/ instead of workdir/baseq3/, matching the
Q3 Team Arena directory layout. MISSIONPACK was already defined
for TA configs; this completes the baseline TA setup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 16:06:35 +08:00
Sergei Shubin
a1fce2ed93 Add AfterBuild Copy tasks to deploy outputs to workdir
game/cgame/q3_ui copy DLLs to workdir/baseq3/, quake3 copies exe to workdir/.
Uses MSBuild <Copy> task with per-config _CopyOutputFile property; Alpha AXP
configs are skipped (no _CopyOutputFile defined).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 13:53:13 +08:00
Sergei Shubin
f85c79bf5a Migrate to Visual Studio 2022: replace .vcproj with .vcxproj, add .gitignore
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 13:36:28 +08:00
Sergei Shubin
4c57221941 Initial commit: Quake 3 1.32b GPL source 2026-03-18 13:32:24 +08:00