- Built off g_fast_forward to utilise a lot of existing structure
- Only does steps of 5 seconds and therefore isn't precise, but that's better than having to rewatch/fastforward through the entire thing
- No single frame step back or general in-motion rewind preview, but that was all overkill
- Demos/Ghosts that end before ticking once are now correctly ignored. (ResolvesKartKrew/RingRacers#168)
- There was code for discovering it on read! It was just placed slightly too early, probably due to the conversion for netreplays! I'm very mad!
- As a preventative measure, demos *recorded* before ticking will simply not save in the first place.
- This was also a frustratingly easy fix for the amount of headache it's caused us.
- Reduced the amount of copypasted boilerplate by simplifying the places where DEMOMARKER can be written (and therefore read).
- Previously, like half the write functions tried to guess their own output size and potentially end the demo at any point.
- At best, this will grant us a few tics of reprireve for large netgames and MAYBE a handful of seconds for time attack, The Mode In Which The Aim Is To Go Fast.
- Instead, double the size of the deadspace buffer extension and just check to see if we've crossed into that territory.
- Name buffers are the same size as everywhere else
- Billiards Cactus no longer gets cut short
- Long player names no longer get cut short
- System in place to allow easily changing the buffer
sizes across all the demo code
- This was causing Aquatic Cathedral and Aqua Tunnel staff
replays to get confused for one another
- Because for both RR_AQUATICCATHEDRAL and
RR_AQUATUNNEL, the first 8 chars are RR_AQUAT
- Now uses the lump id directly instead of the name, which
entirely circumvents the problem
- Fixed:
- Time Attack menu "Replay Staff" option
- Attract mode
- Credits
- If tally is skipped, the replay will be cut short
- Just stop reading the demo if this happened after the
tally started
- It's okay to let the level continue without any input
because the player already finished (we know the result)
- Most R_SkinAvailable calls should be returning index into demo.skinlist (same numerical value as when demo was recorded), for demo sync
- A handful of general things permit exception for this
- Expose `replaynumskins` (calculated as `(demo.playback ? demo.numskins : numskins)`) to Lua
- There's *always* more that can be done for this, but this is the minimum spec that can at least be somewhat stable
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.
FixesKartKrew/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.
- 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
- UINT8 *buffer for AddGhost must now be allocated and filled externally.
- Introduce P_TryAddExternalGhost helper function for existing external ghosts.
- Call vRes_Free(curmapvirt) later, and NULL to make incorrect usage immediately obvious.
- Demos are VERY large and should not be cached for every map in the game all at once.
- Instead, store a small amount of data related to staff ghosts for later reference.
- best time (for use in Medals)
- best lap (maybe use for Medals too)
- player name (for use in Time Attack menu)
- Should support custom gametypes, but haven't been thoroughly testing those
- Custom gametypes must now be unique by name
- Custom gametypes now have a maximum name length of 31