Commit graph

244 commits

Author SHA1 Message Date
James R
8809ab02fc democam: remove unnecessary fields 2023-08-19 05:01:40 -07:00
James R
dbca307ad4 Fix sound handling in demo freecam
- Object sounds are audible from the location of the
  camera
- Certain HUD sounds should no longer be audible
  - For instance, lap complete sfx
2023-08-19 05:01:40 -07:00
toaster
859b3fa350 On second thoughts, let's be EXTRA careful to avoid any potential double frees. 2023-07-22 13:17:17 +01:00
toaster
bf8d09980d G_DoPlayDemo: Make sure buffer is NULL so you can watch replays immediately after recording them.
This is yet another g_demo.c-specific hack, and has been marked as such.
2023-07-22 13:17:16 +01:00
toaster
6c6306889a M_StartMessage revamp
Immense 25-file diff, so spun off into its own branch.
- Improved appearance
    - Not just a big block of text on a blue background
    - Well, OK, the main part is, but some stuff has been spun out into its own fields
        - Title text
        - Text and button prompt for Yes/No or OK
    - Slides with pow on and off the screen
- Disabled MM_EVENTHANDLER, which has always been dog but got considerably worse after newmenus to the point nothing's using it anymore
    - Required in order to reduce the reliance on FUNCPTRCAST, which prevents Eidolon from compiling some stuff because it's not valid C++
2023-06-09 19:23:36 +01:00
Oni
82a4af03e2 Merge branch 'demo-fix-custom-maps' into 'master'
Search for map and gametype after addons are loaded when watching replays

See merge request KartKrew/Kart!1211
2023-04-30 23:44:45 +00:00
Sal
7990842da3 Merge branch 'G_LoadDemoInfo-dont-crash' into 'master'
G_LoadDemoInfo: don't read outside of the buffer if the file is too small

See merge request KartKrew/Kart!1205
2023-04-29 17:00:35 +00:00
James R
8b81478e39 G_DoPlayDemo: search for map and gametype after addons are loaded 2023-04-29 01:16:48 -07:00
James R
a10c9fea39 G_DoPlayDemo: let argument be const 2023-04-26 14:12:29 -07:00
James R
c54f1a52bd G_LoadDemoInfo: don't read outside of the buffer if the file is too small 2023-04-25 18:49:31 -07:00
toaster
2d46112c58 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into round-queue
# Conflicts:
#	src/d_netcmd.h
2023-04-17 20:08:37 +01:00
Sally Coolatta
668d832ca1 Delete respawn command, put Ring shooter on Y 2023-04-17 00:23:06 -04:00
toaster
19ef96351a roundqueue
A general purpose system that permits cacheing of GP progression in one place, but which permits future expansion and brings Online GP a little closer to reality.
- Stores a bunch of levels, gametypes, encore state, and restricted-by-rank-ness in sequence.
    - Initialised on GP cup select.
    - FUTURE WORK: Open to being initialised by other methods
- Digests its way through that sequence as maps are completed.
- Stores round number instead of `grandprixinfo`.
- Map commands as sent over the wire have been adjusted.
    - Sends round number and size of/position in roundqueue.
    - Now figures out GP Event Type from gametype.
        - Can be swung in the direction of a Special Stage with a hint flag.
        - This hint flag replaces "fromlevelselect", which was functionally vestigal.
2023-04-11 17:18:27 +01:00
Sally Coolatta
15f60a1f14 Split thing voting screen to a new file 2023-04-03 20:57:31 -04:00
toaster
4c0077e07c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-19 13:01:06 +00:00
James R
4974b04ddd g_demo.c: fix skip of EZT_ITEMDATA
blame f86f794d2
2023-03-18 03:41:23 -07:00
toaster
3e900d7f57 G_DirtyGameData: Dirty bit only applied in I_Error and signal handlers, nowhere else
- Unfortunately, the way this system previously worked, the unlock was given to you for free if you accidentially opened two copies of the game at once.
- Instead, open the file in r+ mode, shimmy along 5 bytes, and write a `true` to be read later.
- Far more memory safe than rewriting the entire gamedata out on crash.

ALSO:
- crashflags has been split into boolean evercrashed and UINT8 musicflags.
    - We don't need to track if the LAST session was a crash, at least not right now.
    - Opens the floor up to other music like Loser Club happening on the Challenges menu.
2023-03-17 14:42:06 +00:00
toaster
2e1efaff0c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading
# Conflicts:
#	src/k_battle.c
#	src/k_hud_track.cpp
#	src/k_kart.c
#	src/p_inter.c
2023-03-14 21:59:19 +00:00
toaster
01f6eb71f5 Optimisation: reduce the number of calls to M_CheckUnlockConditions
- For P_Ticker()'s calls to M_UpdateUnlockablesAndExtraEmblems
    - Do not check non-UCRP_REQUIRESPLAYING conditions
        - Controlled by a new `boolean doall` parameter to M_UpdateUnlockablesAndExtraEmblems
        - Most other contexts have this as true
        - Forced true if update is meant to be silent
    - Only check UCRP_REQUIRESPLAYING conditions if a relevant property has been touched
        - Controlled by a new `boolean checkthisframe` property on roundcondition_t
        - Set in all contexts where roundcondition_t is modified
        - Would also be set on lap change, but that case is already covered by the following
- Check all conditions, both UCRP_REQUIRESPLAYING and not, on:
    - local player K_HandleLapIncrement
    - local player P_DoPlayerExit
    - local player P_DoTimeOver
    - Controlled by a new `boolean deferredconditioncheck` property on gamedata_t
2023-03-12 13:52:28 +00:00
toaster
fea235d8a7 UC_REPLAY
Save a replay after finishing a round.
Basically another tutorial unlock condition like UC_ADDON
2023-03-10 21:44:48 +00:00
James R
c781780ff8 Lose bumpers when using the respawn command 2023-03-08 19:01:03 -08:00
James R
f86f794d20 g_demo.c: track player mobj health instead of bumpers
Lord have mercy on my soul!!!
2023-03-07 22:29:49 -08:00
toaster
0f715454fa Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-05 19:51:48 +00:00
toaster
0c75c40060 Rework how Bots handle their skin availabilities
Before we can add extra unlock features, we need to make sure we're not building on a house of sand.
- R_SkinUsable: Use Net Unlock system if playernum is -1
- R_BotDefaultSkin: Move to r_skins.c, cache skin search
- R_GetSkinAvailabilities: Use Net Unlock when called for bots (and always permit R_BotDefaultSkin)
- Got_AddBot: Call R_GetSkinAvailabilities for summoned bots to guarantee sync status of available skins
- K_UpdateMatchRaceBots: Tidy up to match grand prix bot skin selection system, hiding server-locked skins and defaulting to R_BotDefaultSkin if you don't have enough unlocked for the remaining player slots
2023-03-05 18:06:09 +00:00
AJ Martinez
79d8e4e109 WIP: SPB Attack - temp menu draws OOB, no unlocks 2023-03-03 12:14:58 -08:00
AJ Martinez
41be94ec5f Use correct ziptic size parsing RA ghosts 2023-02-27 23:10:14 -07:00
AJ Martinez
7788fa116f Review fixes 2023-02-26 14:55:41 -07:00
AJ Martinez
69d100ac53 We are no longer out of ziptics 2023-02-25 03:16:27 -07:00
AJ Martinez
432be46a2f Please god just fucking work 2023-02-24 20:04:36 -07:00
AJ Martinez
7c08634f7e WIP: Turn towards local camera (midgame join broken right now) 2023-02-24 16:59:22 -07:00
James R
fdddbcfd82 g_demo.c: ensure demobuf is always freed before use 2023-02-14 04:17:04 -08:00
toaster
c6dde48245 g_demo.c, M_EndModeAttackRun, D_ClearState - Unset demo.title in one specific place
Fixes returning from title demo to titlescreen
2023-02-04 17:13:07 +00:00
toaster
59f9609160 G_AddGhost, G_LoadRecordGhosts: Re-add support for loading staff ghosts.
- 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.
2023-02-04 15:46:15 +00:00
toaster
29ddf06f1e G_DoPlayDemo: Add support for replays stored inside map vres 2023-02-03 18:18:43 +00:00
toaster
1efc5883e0 G_DoPlayDemo: Remove memory leak in pdemoname 2023-02-03 18:16:18 +00:00
toaster
99bf1c10e8 staffbrief_t
- 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)
2023-02-03 00:55:34 +00:00
toaster
2d5d5343b1 M_EndModeAttackRun bugfixes
- Correctly restore menu state after failed record attack run
- Making things easier for future work - use demo.title as signifier to go back to title screen
2023-01-31 14:00:21 +00:00
toaster
05301d0825 Repair demos that finish without crashing inexplicably returning to titlescreen after their completion
It's because of cv_cheats' default value in DEVELOP builds...
2023-01-28 23:18:50 +00:00
toaster
ede0f56819 Revert all instances of P_SaveBufferFree(&demobuf) for now
g_demo.c is officially No Man's Land
2023-01-05 23:44:40 +00:00
James R
5c51ad77f6 Use P_SaveBufferFree everywhere
- Fixes PR_SaveProfiles calling stdlib free on zone
memory.
- Also touched g_demo.c
2023-01-03 23:23:34 -08:00
toaster
80d19a8458 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into save_p-unglobal-alt
# Conflicts:
#	src/g_demo.c
2023-01-03 19:45:18 +00:00
Sally Coolatta
aa4fd8ab13 Add functions to initialize savebuffer_t
g_demo.c is mostly unaltered because it is made of twigs.
2023-01-02 19:47:59 -05:00
Sally Coolatta
761be01dbb Contain end & size into savebuffer_t
I would've liked to make it use a single allocate function to do this very cleanly, but these cases were very clearly not meant to be standardized and use wildly different methods to allocate & free...
2023-01-01 00:23:23 -08:00
James R
77d54a09fe Remove global lua_save_p and use savebuffer_t for LUA_Archive / LUA_UnArchive 2023-01-01 00:23:23 -08:00
James R
061f8b0587 g_demo.c: use savebuffer_t 2023-01-01 00:23:21 -08:00
Sally Coolatta
38a35b6f78 Make save_p / savebuffers not global
This caused some scary issues with P_SaveNetGame the other day, and it's making ACS net sync harder. Let's just cut this off right now.

Also fixed some scary mix-ups in some of the Lua archiving code.
2023-01-01 00:22:56 -08:00
toaster
52040c1248 Replays (net and timeeattack) now recognise gametypes by name
- 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
2022-12-29 23:13:51 +00:00
toaster
834150585b Rework demo time/laptime handling
* `ATTACKING_` constants have been changed to be flags
    - `ATTACKING_TIME` contains time data for all gametypes
    - `ATTACKING_LAPS` contains laps data for `GTR_CIRCUIT` on maps with more than 1 lap
* `demoflags` now contains raw `ATTACKING_` flags
* Best time/best lap demo files will now be saved properly again (broken since `new-menus`)
* Ghosts will now be loaded properly again (broken since `unlockables-undefeatable`)
2022-12-29 21:30:04 +00:00
toaster
6d3a812ff3 Fix some G_BuildMapTitle memory leaks (found while writing the next commit) 2022-12-12 16:44:40 +00:00
toaster
fefaee1982 SECRET_FOLLOWER
Completely clientside, unlike SECRET_SKIN. Followers have no gameplay function, and it saves us having to write even more to our demos/netsaves. Replaces SECRET_WARP.
Also:
- Now don't apply skins or followers from profiles if the skin is locked - instead, get the closest skin in stats. (Same function as from demos!)
- If you're looking at a profile and the skin or follower are locked, make them solid colour (TC_BLINK).
- Don't show the ring cursor before you've selected a profile.
2022-12-04 01:09:08 +00:00