Commit graph

244 commits

Author SHA1 Message Date
James R
b275a14ec2 Egg TV: detect Prisons mode 2024-02-12 18:22:59 -08:00
James R
aa4ff315b7 Replays: bump demo version 7 -> 8 2024-02-12 18:14:33 -08:00
James R
b2ce6aebe7 Replays: save Grand Prix info
- grandprixinfo
  - gp
  - gamespeed
  - masterbots
  - eventmode
- player_t
  - lives
  - totalring
2024-02-12 18:14:32 -08:00
James R
6dc8f45df6 Replays: flags UINT8 -> UINT16 2024-02-12 18:14:32 -08:00
James R
5650dde2ac G_DoPlayDemo: fix encoremode boolean on demo playback
Fixes the Title Card using the wrong sound effect
2024-02-12 18:14:32 -08:00
James R.
6b831a0fa2 Merge branch 'fix-show-character-ghosts' into 'master'
Time Attacking: fix "Show Character" option for ghosts

Closes #1013

See merge request KartKrew/Kart!1896
2024-02-09 23:47:50 +00:00
Oni
3a4506dae2 Merge branch 'fix-replay-splits' into 'master'
Fix splitscreen viewport and delay counter carrying over from replays into play contexts

Closes #464

See merge request KartKrew/Kart!1902
2024-02-06 13:21:13 +00:00
Eidolon
92339d36a9 Merge branch 'fix-ghost-fast-forward' into 'master'
Time Attack ghosts: sync with level timer instead of when the player crosses the finish line

Closes #829

See merge request KartKrew/Kart!1895
2024-02-06 01:12:35 +00:00
Oni
4ea946067a Merge branch 'srb2-tidy' into 'master'
Clear out unused SRB2/Kart stuff from info tables

See merge request KartKrew/Kart!1811
2024-02-03 19:40:52 +00:00
James R
4c3bad0b12 G_StopDemo: use D_ClearState
- D_ClearState does the necessary cleanup and more
- Fix splitscreen viewcount not being reset when demo ends
2024-02-01 02:26:42 -08:00
Oni
8aeeae24c3 Merge branch 'fix-demo-ghost-buffer-overrun' into 'master'
Large replay crash mitigation, replay buffer size option, debug command

Closes #656

See merge request KartKrew/Kart!1885
2024-02-01 03:00:26 +00:00
James R
b0538a5271 Time Attacking: fix "Show Character" option for ghosts
- player_t.skin is not set yet, so use cv_skin and
  R_SkinAvailable instead
- Refactor P_LoadRecordGhosts to de-duplicate some code
2024-01-30 19:18:51 -08:00
James R
6123ac3c39 Time Attack ghosts: sync with level timer instead of when the player crosses the finish line 2024-01-30 17:27:34 -08:00
James R
1769b418df Replays: reserve 1 KB of space at end of buffer as a safeguard
This should avoid buffer overruns in the middle of
recording. There is already code that checks for buffer
size around ticcmd and ghost data write. Demo header is
still unsafe with many WAD filenames written, for example.

Ghost data and ticcmd should not come close to reaching
into this extra space. At the time of writing, ghost data
can write up to 102 bytes and ticcmd 20 bytes, per player.
2024-01-29 02:26:15 -08:00
James R
5a86041302 G_WriteAllGhostTics: check buffer size after each player's ghost data
Instead of checking it after ALL player ghost data. This
is less likely to write past the end of the demo buffer.
2024-01-29 02:24:57 -08:00
James R
a879975e83 devmode DEMO: replay buffer usage displayed in real-time on the HUD
- Buffer usage in megabytes, bytes and percentage
- Approximate usage per second
- Estimated time until buffer runs out and replay is stopped
2024-01-29 02:20:26 -08:00
James R
09b90c3cf1 Replays: add netdemo_size cvar, add to Data Options
Controls size of replay buffer when recording
2024-01-29 02:18:46 -08:00
James R
6c2736bd1d Move party construction to G_AddPlayer
- Fixes crash when a player leaves when viewing a replay
- Slightly refactors player joining code (including bots)
2024-01-28 23:02:57 -08:00
Sal
3958c15dfe New Credits 2024-01-28 23:31:30 +00:00
toaster
6fdec66dc3 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into srb2-tidy 2024-01-26 00:29:06 +00:00
AJ Martinez
e6f265c762 Double demo buffer size 2024-01-20 19:49:13 -07:00
James R
dffc48849c Replay consistency: sync bumper count correctly 2024-01-17 03:00:20 -08:00
toaster
325079a39a Delete everything major flagged up by listunusedsprites
Notable deletions:
- Metal Sonic Race
    - Includes all the specialised recording/playback apparatus which made g_demo.c harder to read
- A bunch of hyperspecialised code inside several A_ actions
- EXCEPTION: intentfully left in the spriteless SMK stuff for Sal's add-on down the line.
2024-01-11 01:21:43 +00:00
Oni
0e854b5340 Merge branch 'bad-ghost-crash-fix' into 'master'
Defer ghost deallocation til FreeGhosts

Closes #824

See merge request KartKrew/Kart!1769
2024-01-06 00:51:37 +00:00
Eidolon
3666f370d0 Reset playbackspeed to 1 in G_DoPlayDemo
Fixes KartKrew/Kart#834 and also fixes Attract Mode preserving playback
speed too
2024-01-03 13:42:52 -06:00
Eidolon
746da46321 Read staff ghosts from pk3 directory 2024-01-02 21:05:43 -06:00
Eidolon
133144001d Defer ghost deallocation til FreeGhosts
Fixes KartKrew/Kart#824

The for-loop attempts to read `g` after the object it points to has
already been freed by Z_Free. Instead, we add a new `done` field, and
mark it when hitting the end of the demo, and skip ghosts in the ghost
list which have it set.
2024-01-02 15:26:51 -06:00
Sally Coolatta
abde576c58 Enforce const in bot ticcmds
There were a few remaining cases of bot ticcmd generation editing player structures directly. Fix all of this and make as much of it pass const player pointers so this physically can't be allowed to happen ever again. Appears to improve bot sync in netgames & demos bot support, but I have not tested extensively.
2023-12-22 23:28:08 -05:00
James R
39a7c3b3ad Remove MF_MONITOR 2023-11-13 19:23:54 -08:00
AJ Martinez
06bc06869c Lite Steer profile option, itemstate pflags -> player.itemflags 2023-11-09 17:29:26 -07:00
Oni
3b04bde5b9 Merge branch 'will-it-blend' into 'master'
Will It Blend

See merge request KartKrew/Kart!1589
2023-11-05 18:45:51 +00:00
AJ Martinez
5acfe85542 Fix incomplete ghost fast-forwarding 2023-11-02 16:51:25 -07:00
AJ Martinez
506ab31f7f Mania-style time trials 2023-11-02 06:51:51 -07:00
toaster
bd5fdb3b82 PR_INTERPHUDRANDOM
Fixes several things to do with the boss healthbar.
- Makes its randomised jitter work with interp/pause
- Constantly calling the external PRNG tanks performance, at least on Windows, so this solves that too

Done as a special non-netsynced random class so the author of this commit wouldn't have to create a third suite of duplicated Random functions.
2023-10-25 12:55:44 +01:00
toaster
acad8754c8 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into break-through-them-all 2023-10-17 23:32:08 +01:00
James R
fa89576f34 Move freecam state to camera_t, lets splitscreen players use freecam independently of each other 2023-10-08 14:26:21 -07:00
toaster
8bb41b787b Fix SECRET_SKIN locks preventing Rivals from showing up
Previously, there was a permanent exception for Eggrobo (the default bot skin).
Now that exception is generalised for the specific skin the bot is being assigned, which we assume is intentful and correct.

In addition, the randomclass PR_BOTS now controls K_RetireBots as well, matching the other two random calls done for bot skins.
2023-10-05 18:12:32 +01:00
James R.
42814cea2b Revert "W_InitFile: calculate md5sum on background thread, for startup wads"
This reverts commit 28f2659342.
2023-09-09 16:30:00 -07:00
James R
28f2659342 W_InitFile: calculate md5sum on background thread, for startup wads
Add W_GetFileMD5, blocks calling thread until md5 is
calculated.
2023-09-06 18:32:41 -07:00
Eidolon
203d045dfa Only save demo if demobuf.p is ready
Fixes KartKrew/Kart#648
2023-09-03 18:59:24 -05:00
toaster
e123ed7480 MAJOR cleanup of Spectator set/unset
- G_AddPlayer now contains CL_ClearPlayer, G_DestroyParty, and playeringame set
- Instead of a nasty, complicated block in P_SpawnPlayer, externalise it into G_SpectatePlayerOnJoin
- All mid-game human player-to-spectator transitions are handled by P_SetPlayerSpectator, instead of lots of `spectator = true` and associated boilerplate
    - Simplifies Got_Teamchange MASSIVELY
        - Of course this is helped by also stripping back team change
    - This is called by P_KillPlayer, too
- P_KillPlayer no longer eats DMG_SPECTATOR when lightsnaking or exiting
- G_GametypeHasSpectators condition tidied
2023-08-26 19:48:20 +01:00
James R
6c0b042eed Refactor cvar definitions completely, move everything to cvars.cpp
- No need to call CV_RegisterVar
- Cvar definitions live in only one file, easier to locate
- Organized into sections -- netvars, cheats, etc.
- Use builder pattern to initialize cvars
- Still need to extern if you want to read the cvar value
2023-08-25 17:22:40 -07:00
Oni
bc0a187961 Merge branch 'thing-script-args' into 'master'
Separate script args from mapthing args

See merge request KartKrew/Kart!1405
2023-08-25 23:29:06 +00:00
Sally Coolatta
3c8eb505cc Merge branch 'master' into thing-script-args 2023-08-25 18:32:55 -04:00
Oni
b63f3f6f16 Merge branch 'majin-box' into 'master'
Auto Roulette (resolves #618)

Closes #618

See merge request KartKrew/Kart!1411
2023-08-25 19:24:42 +00:00
Sally Coolatta
f02e6dbe3c Final thing args code cleanup
- Fix the last few bugs I could find with thing args
- Move version update code
- Rename internal variables to `thing_[string]args` to make older code merge issues more obvious
2023-08-22 02:14:09 -04:00
AJ Martinez
3900189199 Auto Spin -> Auto Roulette 2023-08-20 16:26:34 -07:00
AJ Martinez
fbfc75df71 Item box autospin 2023-08-20 05:08:53 -07:00
James R
8a72f42818 Split G_ExitLevel into G_BeginLevelExit and G_FinishExitLevel
- Save retry condition in G_BeginLevelExit
- Apply condition in G_FinishExitLevel

Preparation for ACS level end scripts, since the exit
condition will need be known when the countdown starts,
not when it ends (that'd be too late to do anything in the
level).
2023-08-20 00:36:00 -07:00
James R
83f02231e3 Replace spectator movement with demo freecam 2023-08-19 05:01:40 -07:00