Commit graph

17 commits

Author SHA1 Message Date
7b942c77cf Server-side demo recording and playback (netdemo) — unified
Complete netdemo feature as a single commit on implant2:

Recording:
- svdemo_record/svdemo_stop commands
- Delta-compressed entity states and player states
- Server command capture (chat, prints)
- Configstring change tracking
- Keyframes at configurable interval for seeking
- Auto-record on map load (svdemo_autorecord)
- Auto-stop on map change, clean shutdown handling

Playback:
- svdemo_play loads map, spectator auto-connects
- Free camera with client-owned PmoveSingle (real-time, works paused)
- Player follow mode with full HUD
- Scoreboard with recorded player scores
- svdemo_pause with frozen trajectories and smooth unpause
- svdemo_seek (fast, keyframe-accurate) and svdemo_seekexact (precise)
- Seeking works from paused state
- SNAPFLAG_RESET_ENTITIES for clean map_restart and seek transitions
- Proper session/cvar/configstring handling across transitions
- svdemo_pauseEmpty waits for spectator before starting

Engine changes:
- usercmd_t: optional origin field for client-owned PVS
- msg.c: serialize optional usercmd origin
- cl_parse.c: SERVERCOUNT time delta reset for seek/unpause
- CG_SETCLIENTORIGIN trap for cgame-to-engine origin communication

cgame changes:
- Client-owned spectator camera (svDemoCameraPs)
- CS_SVDEMO configstring detection
- SNAPFLAG_RESET_ENTITIES entity interpolation reset
- Backwards time handling for seeking
- Local entity cleanup on seek
- Pause detection from frozen snapshot time
- Suppress connection interrupted during demo playback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 00:54:32 +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
9b0bd3c03f Input sticky buttons fixed 2026-03-21 20:51:28 +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
b9a0ada275 Add spaced build dir names (Debug TA/, Release TA/) to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:18:11 +08:00
Sergei Shubin
a82244334c Build system cleanup: rename to quake3live.exe, fix DLL loading, default to missionpack
- Rename output binary from quake3.exe to quake3live.exe across all configurations
- Add DLL_ONLY define to Release TA and Debug TA configs to force native DLL loading
  (VM_CallCompiled was a stub returning 0, causing "ui version 0" errors)
- Default fs_game to "missionpack" so the engine loads from workdir/missionpack/
- Add AfterBuild copy for ui.vcxproj to deploy uix86.dll to workdir
- Fix .gitignore: add Debug_TA/, remove *.exe/*.dll/*.lib/*.map patterns that were
  hiding real SDK tools in code/win32/mod-sdk-setup/bin/
- Remove q3_ui project from solution (not used in TA builds)
- Increase hunk/zone memory defaults for modern systems

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 18:17:28 +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
05441103fa Ignore workdir/ (build outputs and game data)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 14:50:22 +08:00
Sergei Shubin
85fdc88c72 Force vm_game/vm_cgame/vm_ui to DLL-only (0) when DLL_ONLY is defined
Default was 2 (JIT/QVM), causing fallback to ui.qvm when DLL not found.
Use CVAR_INIT|CVAR_ROM to prevent config files from overriding back to QVM.
Mirrors the same pattern used for sv_pure in sv_init.c.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 14:04:12 +08:00
Sergei Shubin
37f0bc95eb Define DLL_ONLY for all configurations; fix vm_x86.c guard
Add unconditional ItemDefinitionGroup in quake3.vcxproj to define DLL_ONLY
for all configurations, disabling QVM interpreter/JIT in favour of DLLs.

Fix vm_x86.c: VM_Compile was outside the #ifndef DLL_ONLY guard while
VM_CallCompiled was inside it, causing a duplicate symbol link error.
Extend the guard to cover VM_Compile as well.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 14:00:29 +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
111dce16ab Upgrade mouse input from DirectInput 3 to DirectInput 8
- Use DirectInput8Create() instead of dynamic dinput.dll loading
- Switch to LPDIRECTINPUT8 / LPDIRECTINPUTDEVICE8 types and DI8 macros
- Replace custom MYDATA data format with c_dfDIMouse2 (8-button support)
- Use DIMOUSESTATE2 in GetDeviceState (correct size, 8 buttons)
- Add MOUSE5 button mapping via DIMOFS_BUTTON4
- Link against dinput8.lib; define required GUIDs inline to avoid dxguid.lib conflicts
- Fix .gitignore: remove Win32/ pattern that was shadowing code/win32/ source dir

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 13:44:21 +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