Commit graph

21469 commits

Author SHA1 Message Date
toaster
f91f075a0d ACS: void MapWarp(str mapname, bool showintermission)
An immediate level change on command, to the specified level (via string).
Utilises the existing nextmapoverride and skipstats system, but with skipstats assumed to be the default.
2023-06-02 20:56:27 +01:00
toaster
0bec8317f3 Y_DetermineIntermissionType: Make this function the sole authority on whether an intermission occours or not.
A return to cleanliness in G_DoCompleted.
2023-06-02 20:51:48 +01:00
toaster
82b60cc585 Map types: Make more map ID types consistent as UINT16
- nextmap
- prevmap
- nextmapoverride
- G_GetFirstMapOfGametype
2023-06-02 20:27:38 +01:00
James R
4ebbabc6f5 MF_DRAWFROMFARAWAY: draw sprites from infinitely far away 2023-06-02 04:17:34 -07:00
toaster
b195d43577 Merge branch 'fix-pwr-buffer' into 'master'
Don't trash memory when reading saved PWR

See merge request KartKrew/Kart!1266
2023-06-02 09:08:50 +00:00
AJ Martinez
c716a27454 Don't trash memory when reading saved PWR 2023-06-01 21:46:54 -07:00
Oni
1ee6d196aa Merge branch 'ultra-die' into 'master'
When hit at -20 rings, die

See merge request KartKrew/Kart!1261
2023-06-02 04:44:59 +00:00
Oni
9724144e99 Merge branch 'gamedata-extension' into 'master'
Gamedata Extensions

See merge request KartKrew/Kart!1262
2023-06-02 03:40:57 +00:00
Oni
957453d02f Merge branch 'raise-textcmd-limit-dumb-version' into 'master'
Expand textcmd size byte to 16-bit word, raise MAXTEXTCMD

See merge request KartKrew/Kart!1265
2023-06-02 03:19:44 +00:00
James R
801deafa96 MAXTEXTCMD -> 512
Fixes 4P XD_ADDPLAYER
2023-06-01 20:03:23 -07:00
James R
039a73ce64 Expand textcmd size byte to 16-bit word
Raises hard limit from 255 to 65535
2023-06-01 20:03:23 -07:00
AJ Martinez
4791789bd7 Merge branch 'smooth-gentleman' into 'master'
Smooth out gentleman delay

See merge request KartKrew/Kart!1256
2023-06-01 21:54:56 +00:00
toaster
f86cf71aca Merge branch 'invalid-settargets' into 'master'
P_InitThinkers: Centralise/tidy global mobj pointer handling

See merge request KartKrew/Kart!1263
2023-06-01 12:37:29 +00:00
Eidolon
3dbd9720da Include missing algorithm header in k_collide.cpp 2023-06-01 05:15:38 -05:00
Eidolon
6d94de494e hwr2: Only upload lighttable if currently valid 2023-06-01 05:12:04 -05:00
Eidolon
99bc417978 hwr2: Upload encore lighttable to correct texture 2023-06-01 05:12:04 -05:00
Eidolon
79a01789b8 hwr2: Reset extra lighttable textures 2023-06-01 05:12:04 -05:00
Eidolon
e40b3ac1e3 hwr2: Track colormaps and lighttables tex globally 2023-06-01 05:11:48 -05:00
Sal
3a1103b7f3 Merge branch 'drop-dash-boost-type' into 'master'
Slower Drop Dash boost type (resolves #548)

Closes #548

See merge request KartKrew/Kart!1255
2023-05-31 16:44:08 +00:00
Sal
68f8e7139f Merge branch 'botcontrol' into 'master'
Add DEVELOP cvar "botcontrol" to disable bot actions

See merge request KartKrew/Kart!1260
2023-05-31 16:43:13 +00:00
toaster
bca7449d15 G_LoadGameData; Improve backfilling cup windata to do the job properly 2023-05-31 13:34:18 +01:00
toaster
5f1f3a6fe3 When converting Gamedata, Profiles, and Serverstats files forwards to future versions, create backups.
- Same name, but with a ".bak" appended.
- Also prevents future versions of serverstats from being loaded into older executables.
2023-05-31 13:18:56 +01:00
toaster
1821b4f52d P_InitThinkers: Handle several important mobj cleaning tasks in one place, rather than scattered
- titlecam.mobj cannot have P_SetTarget applied when initially setting to NULL, as its previous occupant is some unknown region in memory, and modifying the reference count could in fact change some random number or address ANYWHERE IN THE ENTIRE PROGRAM.
- So we straight up wipe it rather than referenced-unset it in one place, always, for general tidiness.
- Also move skyboxcenterpnts, skyboxviewpnts, and iquetail/iquehead so it's all centralised.
2023-05-31 12:49:51 +01:00
toaster
ceb1655185 M_DrawCupSelect: Only draw Emerald on difficulties greater than Easy. 2023-05-31 11:55:20 +01:00
toaster
c0e4e4075b M_PopulateChallengeGrid: Fix memory corruption on fresh gamedata creation 2023-05-31 00:53:57 +01:00
toaster
e74d01660f K_GetGradeColor
Colors for grades.
Done as a seperate function so that future other circumstances can utilise it.
But for now, just apply to M_DrawCupSelect windata.
2023-05-30 22:15:08 +01:00
toaster
d9940fdef2 M_DrawCupSelect: Flickering Chaos/Super Emerald icon ala S3 Data Select 2023-05-30 21:23:07 +01:00
toaster
cc29c23ac6 Fix the width of the pending keys for gamedata to prevent unintentional rollover 2023-05-30 21:09:15 +01:00
toaster
0c7d66791b Expand datatype for Unlockables, emblems (Medals + nonmedals), and Conditions.
Made sure there is more than enough headroom for our current purposes.
It should be easy to double again if necessary now that the datatypes have been increased... but that would be obscene at this point
- 1024 Unlockables and 1024 Conditions (these were always tied together in slots)
- 2048 emblems (Medals + nonmedals). If we ship with ~250 maps this permits 8 Medals per map - which is higher than we intend right now but could easily fill out in patches
2023-05-30 21:08:29 +01:00
toaster
9e50fea2dc Now that Super Emerald minimap graphics are in the game, use them on the Sealed Star progression bar. 2023-05-30 13:30:22 +01:00
toaster
782da8c325 K_PlayerFinishGrandPrix: Cap RINGTOTAL to 20 when writing to totalring and grandprixinfo rank
Permitted 109/100 rings at the end of GP !?
2023-05-30 13:12:10 +01:00
AJ Martinez
8c08f759ac Use defined type for wavedash charge calcs 2023-05-30 04:54:51 -07:00
toaster
4387ea2f71 M_DrawCupSelect: Updated visuals for Cup windata per difficulty
- New Rank icons
- Use Minimap-sized Emerald instead of Battle HUD
- Shows associated character you last updated (or matched) the position with
    - Also removes the temporary printout display on G_LoadGameData.
2023-05-30 12:21:42 +01:00
toaster
956b3f985f Do not leave uninitialised memory for dummywindata best_placement emerald collection 2023-05-30 12:21:42 +01:00
toaster
989070c3f1 skinreference_t
Please note this is incompatible with gamedata from previous commits on this branch. As always, keep a backup of your last stable gamedata.

A system for record data to point to either loaded or unloaded skins.
- When writing to gamedata, stores a funny internal reference id on skinrecord_t.
- This ID is then used when writing out subsequent references ala mobjnum.
- As an example, has been attached to cup windata.
    - Also assigned based on profile skin when gamedata importprofilewins event is occouring.
    - Set to your current skin if you complete a Cup, OR if you get equal or better on any existing Cup.
- Successfully reassigned alongside unloadedskin records when a skin is added.
- TEMPORARY: Character ownership of Cup wins are displayed in your latest-log.txt, in lieu of an update to the cupgrid
2023-05-30 12:21:42 +01:00
toaster
a36213c435 G_LoadGameData: Improve indentation for gamedata skins block
Done seperately to reduce complexity of diff for the next commit.
2023-05-30 12:21:41 +01:00
toaster
cd2a4b3807 Move skinrecord_t and unloaded_skin_t to doomstat.h
Unfortunately, they are necessary to have in this already bloated file, to avoid circular dependency in future work.
2023-05-30 12:21:41 +01:00
toaster
1527471678 Character win records
Track wins per character.
- If you have an existing gamedata of minor version 2 or earlier, attempt to import your last-used profile's wins onto the character you last used on that profile, so you're not starting from nothing. It's not quite accurate, but it's something.
- Much like map headers and cups, these are also tracked in an unloaded_skins_t linked list. That work was done in this commit because gamedata is actually loaded before even base-game characters, which is annoying but at least confirmed it was working quicker.
- TEMPORARY: Your per-character wins are displayed in your latest-log.txt, in lieu of an update to the in-game statistics menu
2023-05-30 12:21:41 +01:00
toaster
aa35e249d5 g_game.c: Tidy in anticipation of next commit
- Use WRITESTRINGL and READSTRINGL instead of their N equivalents. These are mostly the same, but the macro length is inclusive of the null terminator, so this prevents one-byte overruns.
- Make sure datatype for iteration over nummapheaders is of sufficient unsigned region
- Make sure hashes are calculated based on final field for guaranteed consistency, not initial buffer
- Additional newlines for spacing
2023-05-30 12:21:41 +01:00
toaster
3e663867b9 Move skin->namehash set to conclusion of R_AddSkins loop just before numskins is incremented, as it's possible to have a default name for a skin that doesn't touch the hash codepath 2023-05-30 12:21:40 +01:00
toaster
0b5124b8c4 G_SaveGameData: Remove the "writtengamedata" secondary counter
Instead, subtract from the associated "numgamedata" variable and check if nonzero to continue.
2023-05-30 12:21:40 +01:00
toaster
8d9b42e49b Skin name search-assistive hashing
More opportunities for early rejection in table-wide searches, in anticipation of future work.
- Many circumstances independently implemented string name comparisons. Most of these have been converted to use R_SkinAvailable, with one exception.
    - M_CharacterSelectInit already needs to iterate over the characters, so produce the skin hash independently.
2023-05-30 12:21:40 +01:00
toaster
0f266198ca ACS_GetColorFromString; Fix copypaste error indexing into skin array rather than color array
Discovered while writing the following commit.
2023-05-30 12:21:40 +01:00
toaster
fde06aace2 CV_SetValueMaybeStealth: Correctly null terminate tmpskin for forcecharacter 2023-05-30 12:21:40 +01:00
toaster
acc5fc85b9 Skin rivals system: Adjust for fixes/consistency
- Previously duplicated across R_AddSkins and R_PatchSkins, now handled in R_ProcessPatchableFields.
- Increase the size of the buffer to SKINNAMESIZE+1, to prevent silent failure for long character names.
2023-05-30 12:21:40 +01:00
toaster
65f679c0bc Unloaded cupheader windata tracking
IMPORTANT NOTE - increments gamedata minor version to 3, as it is necessary to backfill windata to prevent losing existing cup records.

This is essentially commit 1482fd5 but for cups.
- All cups currently loaded with nonzero windata are written on gamedata save.
    - This reduces gamedata size for a player who has not unlocked every cup!
- On gamedata load, if a cup is not loaded, store the extra windata on a linked list.
- On cup header creation, check the linked list to see if an associated unloaded cupheader windata exists.
    - If it does, write the record onto the cup structure directly, and delete the "unloaded cupheader" storage struct!
- Then on the NEXT gamedata save, in addition to all loaded cupheaders, it writes the extra windata kept in long term storage in exactly the same format.
2023-05-30 12:21:39 +01:00
toaster
b186e89353 K_ResetCeremony: Populate results downward in difficulty
Per request, someone who beats a cup on Normal doesn't have to worry about beating that cup on Easy as well unless they want to of their own volition.
2023-05-30 12:21:39 +01:00
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