Commit graph

23086 commits

Author SHA1 Message Date
toaster
eb26f9fda4 Unloaded mapheader record tracking: Manage memory usage by dropping unimportant stats
Only persist the full data while unloaded if player has explicitly achieved something on that level, rather than merely visited (such as in a netgame).
Achieving something counts as:
- Getting a best time
- Getting a best lap time (Race only)
- Getting MV_SPBATTACK (completing an SPB run)
- Completing the level IF the level has LF2_FINISHNEEDED (finish level in GP/MP before you see it in Time Attack)
2023-05-30 12:21:39 +01:00
toaster
3027d254fe Rollover protection for unloaded mapheader record tracking system
You will run into memory limits before this happens, but... if you have major quantities of unloaded mapheader record data, avoid a rollover in the counter of records to write.
2023-05-30 12:21:39 +01:00
toaster
28677da5b9 Unloaded mapheader record tracking system
In the previous entry in the series, due to level header records existing in a NUMMAPS-sized table always saved and loaded in full, Time Attack times persisted even across game loads without the relevant custom levels added.
However, this was changed with the long map name system. Map records were assigned to level headers, which were only created on level load.
This new system brings Ring Racers up to parity (or better, due to the reduced incidence of header conflicts!)
- All levels currently loaded with records attached are written on gamedata save.
    - This reduces gamedata size for a player who has not unlocked every level!
- On gamedata load, if a level is not loaded, store those extra records on a linked list.
- On level header creation, check the linked list to see if an associated unloaded mapheader record exists.
    - If it does, write the record onto the map structure directly, and delete the "unloaded mapheader" storage struct!
- Then on the NEXT gamedata save, in addition to all loaded mapheaders, it writes the extra records kept in long term storage in exactly the same format.
2023-05-30 12:21:39 +01:00
toaster
4682f03f91 On reflection, whether a map is visited should be cleared at the same time as its time attack record data, not seperately. 2023-05-30 12:21:39 +01:00
toaster
4c34d04f8a recorddata_t handling adjustments
Preperatory work for the next feature on my agenda.
- No longer independently allocated.
    - This was a byproduct of the previous NUMMAPS-based implementation. It's just cleaner to have it live directly on the mapheader_t, no caveats about it.
- Now contains mapvisited bitflag array.
    - Now all to-gamedata properties on a mapheader's struct are grouped together.
        - I was of two minds about it, but decided that this would have cleaner guarantees for compartmentalisation, saving, and loading.
        - They can still be wiped independently (G_ClearRecords for time/lap and M_ClearSecrets for mapvisited).
2023-05-30 12:21:39 +01:00
toaster
533508d7b0 Level and cup header information: Hashing for referencing by name
Foundational assistive work.
Also guarantees a consistent cup name length in memory, as some places read/wrote 15 bytes, and some places read/wrote 16 bytes. We settle on the latter (including null terminator) for the broadest backwards compatibility.
2023-05-30 12:21:39 +01:00
Oni
ff23501e74 Merge branch 'podium-bugsquoosh' into 'master'
Podium BugSquoosh

See merge request KartKrew/Kart!1258
2023-05-30 03:10:18 +00:00
Oni
3f8ca964c7 Merge branch 'instashield' into 'master'
Instashield (and Guard!)

See merge request KartKrew/Kart!1242
2023-05-30 01:36:45 +00:00
toaster
36d81d7996 Final lack of smoothness in camera cutaway killed: A one-frame window where focus angle/pitch was incorrect due to not having thunk yet 2023-05-30 01:12:59 +01:00
toaster
f24df4f38d Remove the interp-caused jitter from cutaway camera behaviour
It is preferable that smash cuts reset view interpolation IMO
2023-05-30 01:05:20 +01:00
toaster
f9b1bdf2bc K_CalculateGPGrade: Do not penalise for a cup that has no Prisons/Laps at all, so Sealed Star can be reached with numlaps 0/custom Cup with no battle levels 2023-05-30 00:41:28 +01:00
toaster
5e76ea6f8f K_StartCeremony: Directly modify spectator status for bots as early as possible
The problem with bots randomly going towards the same spot in podium was...
- If you failed a Sealed Star, K_UpdateGrandPrixBots wouldn't make the puppies non-spectators
- P_SpawnPlayer catches the spectator status...
- ...but it's in a loop that calls K_GetPodiumPosition...
- ...which ignores spectators...
- ...which means this is too late to catch it, so we simply have to do it earlier.
Also short circuits P_SpawnPlayer's and K_UpdateGrandPrixBot's attempts to set so the author of this commit can be certain what is being done is correct
2023-05-30 00:40:00 +01:00
AJ Martinez
47a63e1ca2 If I ever see another macro I'm going to burn down John Carmack's house 2023-05-28 16:07:32 -07:00
AJ Martinez
4c927b09d1 Review fixup 2023-05-28 15:12:08 -07:00
toaster
8240dbe4e6 pflags_t, PF_NOFASTFALL: Compilation fix -- 1<<31 is not a valid enum value because it's all signed 2023-05-27 16:47:33 +01:00
Sal
94b2deb4de Merge branch 'twerk-b-gone' into 'master'
One fastfall per input

See merge request KartKrew/Kart!1253
2023-05-26 22:53:17 +00:00
Sal
c7aabfd431 Merge branch 'hexdump-debugfile' into 'master'
debugfile: replace mixed string/control character notation with hexdump

See merge request KartKrew/Kart!1250
2023-05-26 22:43:45 +00:00
AJ Martinez
c7bae4a06b Also prevent fastfall on ebrake ground-to-air 2023-05-26 06:47:22 -07:00
AJ Martinez
1871cad1d9 Require new input to fastfall after bouncing 2023-05-25 23:21:19 -07:00
Oni
9b8306c91b Merge branch 'menu-pokes' into 'master'
Menu Pokes

See merge request KartKrew/Kart!1248
2023-05-26 05:53:16 +00:00
AJ Martinez
691311ab14 Merge branch 'instashield' of git.do.srb2.org:KartKrew/Kart into instashield 2023-05-25 22:49:23 -07:00
AJ Martinez
20f57d7efa Don't drop emeralds unless it's a new hit 2023-05-25 22:49:14 -07:00
Sally Coolatta
ce7e083e13 Bots: Add instashield behaviors
Also tidied up some of the ring usage code.
2023-05-25 15:31:33 -04:00
James R
3ad30c0c7a debugfile: replace mixed string/control character notation with hexdump
Example of old notation:

    [10]O[0,0]jartha[0,254,142,131]c[133]hL^{[170][[251,199]+E[181]U+t[247,183,129,165,152]#$[164,22,10,169]r[150,212,3,232,3,0,0,2,0,0,0,8,0]0[8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,9,2,0,0,1,0,217,161,192] D[0,0,0,0,0,0,0]

Example of new notation:

         0:  01 0e 6a 61  72 74 68 61  00 57 00 09  5a 00 42 00  ..jartha.W..Z.B.
        16:  02 01 00 b7  6a d4 20 6f  2b 45 b5                  ....j. o+E.
2023-05-24 18:33:22 -07:00
Eidolon
d2482287a9 Merge branch 'read-exact-span-vec' into 'master'
io: Specialize read_exact for Span/VecStream

See merge request KartKrew/Kart!1247
2023-05-24 22:35:16 +00:00
James R
f35de20c72 io: Fix name lookup for read_exact friend specializations 2023-05-23 23:05:44 -07:00
Eidolon
a2ea3bfd6c io: Specialize read_exact for Span/VecStream
These will always enter infinite loops in read_exact under correct use
when there is not enough data in them to read to the buffer, so we can
throw out early for EOF in those scenarios.
2023-05-23 23:04:34 -07:00
Eidolon
a8e122c36b Merge branch 'revert-palette-manager' into 'master'
Revert "hwr2: Track colormaps and lighttables tex globally"

See merge request KartKrew/Kart!1249
2023-05-23 14:46:36 +00:00
Eidolon
b8dabe82cf Revert "hwr2: Track colormaps and lighttables tex globally"
This reverts commit aa48237928.
2023-05-23 09:05:23 -05:00
toaster
8845f36a3d HU_DrawRankings: Adjust slightly
- Only show `Lap 0/Lap 1` if numlaps > 1, to match other circumstances where laps aren't real
- Only show player roundscore if gametype supports roundscore
- Otherwise accept a blank right side of the player bar in custom gametypes. (one day for Lua..?)
2023-05-22 15:32:07 +01:00
AJ Martinez
d9dda87586 Hide hitbox on nocollide whip 2023-05-20 16:30:35 -07:00
toaster
a0f0c83975 M_DrawMenuTyping: On Virtual Keyboard, highlight when system button presses occour
- A
- B/X
- C
- Start
2023-05-21 00:14:11 +01:00
toaster
04d87bfb6c M_MenuTypingInput: In Virtual Keyboard mode, assign some buttons as shortcuts
- Start: closes the menu
- B/X: backspace
- C: Toggle shift/caps lock
2023-05-21 00:04:45 +01:00
toaster
f24a640e04 Increase reliability of menuKey system
The intersection between processed buttons and raw keyboard data is a messy one and will probably never be perfect, but it is now consistent.
- Never overwrite a valid keyboard menuKey recieved this frame with a -1 if a different type of event is recieved as well.
- Store previous state of dpad_lr and dpad_ud on menucmd struct.
    - Previously, if `a` was bound to Turn Left, it could produce a valid menuKey for one frame, then be considered a leftward input - switching from manual keyboard to Virtual Keyboard.
    - It still only produces a valid menuKey for one frame... but we simply filter out leftward inputs that are older than this frame to keep things (relatively) clean.
2023-05-20 22:37:31 +01:00
AJ Martinez
18d84c6c2c Fix instawhip follow hitlag 2023-05-20 14:35:48 -07:00
toaster
df31f7cf3a M_HandleMenuInput: Fix incorrect menuKey comparison that was preventing the Virtual Keyboard from ever being activated on first opening 2023-05-20 21:03:23 +01:00
toaster
fb578d7da2 Add-ons menu: Add name and tooltip for Search/filter field
Now visible via Virtual Keyboard.
2023-05-20 20:43:41 +01:00
toaster
38ddfeeef8 Make virtual keyboard even stronger
- Show a textbox (with highlighted border) so the console font is more likely to be legible.
    - Increases the width of the virtual keys to match this.
- Show menu entry name and tooltip on faded view (if they exist), for additional context for what you're writing
- Make the text entry and the virtual keys slide seperately
2023-05-20 20:43:00 +01:00
Eidolon
2918f9b61c Merge branch 'more-rhi-stuff' into 'master'
More RHI improvements for HWR2

See merge request KartKrew/Kart!1246
2023-05-20 15:45:34 +00:00
AJ Martinez
85bfd5be12 Really, really drop emeralds from monitors dead center on the ground 2023-05-20 02:53:13 -07:00
AJ Martinez
3b947ebf85 Instawhip: On mutual contact, clash! 2023-05-20 02:39:05 -07:00
AJ Martinez
211e28611b Instawhip: No mercy 2023-05-20 00:15:05 -07:00
AJ Martinez
53a2a999d2 Whoops, that's a testing condition 2023-05-19 23:45:52 -07:00
AJ Martinez
2c44bafe74 Misc fixup 2023-05-19 23:43:53 -07:00
AJ Martinez
de8f4812cf Split instashield and guard cooldown 2023-05-19 23:30:20 -07:00
AJ Martinez
cac02bb01a Emerald fixups 2023-05-19 22:51:06 -07:00
AJ Martinez
bfcc453d56 Guard Break FX 2023-05-19 21:14:47 -07:00
Sal
15dce65efb Merge branch 'bot-game-speed' into 'master'
Bots: Rebalance rubberband speeds

See merge request KartKrew/Kart!1244
2023-05-20 03:59:03 +00:00
Sal
9bb474378e Merge branch 'rings-from-below' into 'master'
Add MF_PICKUPFROMBELOW to rings

Closes #446

See merge request KartKrew/Kart!1245
2023-05-20 03:58:25 +00:00
AJ Martinez
f6407d03d0 More guard sfx 2023-05-19 19:45:20 -07:00