Commit graph

9 commits

Author SHA1 Message Date
c351be0c22 Replace non-ASCII characters in comments with ASCII equivalents
Em dashes replaced with --, arrows replaced with ->.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 01:01:10 +08:00
a8bfa738b0 Fix seeking: snapshot timing, backwards time, entity cleanup
Server:
- Reset nextSnapshotTime for active clients after seek so
  SV_SendClientMessages doesn't skip sending (was comparing
  future nextSnapshotTime against past svs.time)
- First frame always a keyframe (beginning seekable)
- Keyframes during normal playback only reset delta state,
  no SNAPFLAG_RESET_ENTITIES (no visual glitch every 5 sec)

Engine client:
- Reset cl.oldFrameServerTime on SERVERCOUNT toggle to prevent
  "time went backwards" error in CL_SetCGameTime

cgame:
- Handle backwards time in CG_ProcessSnapshots for demo seek:
  accept the time jump, reset cg.time, clear all entity state
  (currentValid, interpolate, time-dependent fields), clear
  local entities (particles, gibs, smoke), wait for next snapshot
- Prevents CG_InterpolateEntityPosition NULL nextSnap error

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:31:47 +08:00
41f0ca2e50 Show "Playback Paused" instead of "Connection Interrupted"
Suppress CG_DrawDisconnect during server demo playback — connection
can't be interrupted on a local demo. Detect pause from snapshot
serverTime (frozen time = paused) rather than configstrings, since
configstrings are OOB and may not be in sync with snapshots.
Show "Playback Paused" centered on screen when detected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 04:09:47 +08:00
6e13c747ba Client-owned camera for demo spectator
cgame runs its own PmoveSingle for the free camera using real time,
independent of server time. Solves pause freezing — camera moves
smoothly while svs.time is frozen.

Changes:
- usercmd_t: add optional origin[3] with 1-bit flag (zero cost for
  normal gameplay, 13 bytes during demo viewing)
- msg.c: serialize optional origin in usercmd delta encoding
- CG_SETCLIENTORIGIN trap: cgame sends camera origin to engine
- cl_input.c: CL_FinishMove writes cgame origin into usercmd
- cg_predict.c: CG_PredictPlayerState runs local PmoveSingle for
  free camera in svDemo mode, sends origin via trap for PVS
- cg_snapshot.c: detect follow→free camera transition, init camera
  from last known position
- cg_main.c: detect svDemo mode from CS_SVDEMO configstring,
  lazy-init camera from first snapshot's spectator spawn
- g_main.c: G_InitGame sets CS_SVDEMO configstring, G_RunFrame
  copies cmd.origin to ps.origin for PVS instead of ClientThink_real
- bg_public.h: CS_SVDEMO configstring index (26)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 03:51:51 +08:00
c6af63ae42 SNAPFLAG_RESET_ENTITIES: no-interpolation reset without gamestate resend
Replace the gamestate resend approach for map_restart with a custom
snapshot flag (SNAPFLAG_RESET_ENTITIES, bit 4 in snapFlags byte).

Server side (sv_netdemo.c):
- On restart frame, OR the flag into svs.snapFlagServerBit (one-shot)
- Cleared at the start of the next playback frame

Client side (cg_snapshot.c):
- CG_SetNextSnap: clear currentValid for all entities when flag is set,
  making them all "new" — existing interpolation check at line 228
  sets interpolate=qfalse, CG_TransitionEntity calls CG_ResetEntity
- Also set cg.nextFrameTeleport=qtrue to prevent playerstate
  interpolation during follow mode

No loading screen, no lost frames, no gamestate resend. Entities and
playerstate both snap to correct positions on map_restart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 00:19:36 +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