Determining whether a map or cup is unlocked or not is now linear-time.
- Attempted to cache SECRET_SKIN et al as well, but skins are loaded after unlocks... oh well.
- Was staring down the barrel of a triple-nested loop for implementing SECRET_ALTMUSIC, so did this first to set good precedent.
- `Condition1 = MakeRetire Eggrobo`
- Fires when:
- Not a cooperative context
- You've finished in good standing
- Another player has both
- PF_NOCONTEST
- The skin specified in the condition
Also makes rivalname-handling for K_InitGrandPrixBots `const char *`, since the author of this commit had to reference that code.
- Remove pointless "BUILDCONDITIONTITLE" macro for M_BuildConditionTitle
- Replace simple R_SkinUsable checks with M_GetConditionCharacter
- Supports knowing a character's name via them being the Rival for a currently unlocked character, if that Challenge doesn't require them unlocked to interact
Currently exists for:
- Generating a Chao Key
- Attempting to use a Chao Key on a Major Challenge
- Only shows after Generating a Chao Key just so it doesn't fire before you know what's going on
Text is preliminary
- M_UpdateChallengeGridExtraData: Register whether major unlock tiles have had every surrounding Challenge cleared (CHE_ALLCLEAR)
- M_DrawChallengeTile: For locked tiles with CHE_ALLCLEAR, show a little dot (temporary drawer)
The prepended colour list passed to M_Shuffle_UINT16 was off by one, leading to possible pollution of the region with an uninitialised value.
For some reason, some people's machines guarantee clean stack memory on game startup, while other people's do not. This is why some people were crashing on Spray Can list generation and some weren't.
The stack memory was DEFINITELY not clean by the time you could navigate to the gamedata clear menu, which is why that was crashing without fail.
Just in case I don't get to do a major pass on adding a ton of extra unlockable conditions later, this is an easy, quick add featuring a stat gamedata and the statistics menu has been tracking for a while.
Instead of being specific to each level, Spray Cans are stored in a list on gamedata that will be stepped along each Spray Can you collect.
They are only assigned to a level on collection - which prevents you from farming the same easy location for every colour in the game.
In addition, this new system is one step short of dehardcoding them entirely. Now only Spray Cans specifically asked for by the existence of UC_SPRAYCAN will be put in the list, and if a secondary parameter is either "Yes" or "True", it will be put at the head of the list. This could technically support custom skincolours one day, but the author of this commit doesn't care to do the last bit of work necessary to make it happen.
There's a slight extra overhead in that skincolor_t now also holds a `cache_spraycan` (renamed from `cachedcan`, which maps had previously)
Currently, there's no safeguard against grabbing it on a custom course - you'll lose the Spray Can as soon as you load a fresh game again - but I consider that easy to fix (tomorrow) and necessary before merger, because the author of this commit does NOT want complaints on release because we forgot to protect users who keep on losing their skincolors.
Increments gamedata minor version, be aware
- M_AssignSpraycans
- Called in M_FinaliseGameData.
- Attaches a hardcoded set of colours to all race maps in cup order, stopping once we run out.
- The colours are shuffled, with some "freebies" always at the head of the list.
- Integrates partial lists pretty well.
- In DEVELOP builds, I_Errors if it produces corrupted state.
- G_LoadGameData, G_SaveGameData
- Save & Load is implemented for these assignments
Creates a central landing point where gamedata loads/creates can be finalised properly.
In addition, gamedata wipes caused by data erase or custom SOC gamedata can no longer be saved in a partway corrupted state if they were to crash midway through.
- The function is back to producing zone-allocated memory copies, like its precursor V_WordWrap
- The author of this commit got rid of that dependency originally because it seemed like a fair part of the API, and meant static buffers could be used in certain circumstances, but it was necessary to revert for the following change.
- Newlines can now be inserted mid-word, treating the width provided as ironclad except in the case of single characters wider than the region.
- This will be necessary for future work with the in-game chat.
- Reserves 8 characters at first, then Z_Reallocs double that every time it runs out.
Moves WordWrap to the font/V_GetFontSpecification system.
Much healthier long-term for our purposes, including the possibility of changing fonts for various contexts freely.
Also makes gamedata save/load a little more forward compatible longterm by making a UINT32 bitfield for various once-event flags, with increased minor version
- Four evaluation modes.
- Perfect
- Currently no visual implementation
- All others have a cool set of visuals
- Multi-stage animation of a glowing threat and a Star that's Sealed
- If they're relevant, show the gems you HAVEN'T grabbed
- Three modes here
- No gems
- For Easy mode, asks you to brave a higher difficulty
- Chaos Emeralds
- Not all 7 chaos emeralds? Push your rank harder!
- Super Emeralds
- Not all 7 super emeralds? Further challenge awaits!
- `useBlackRock` to make evaluation context less specific for custom material is replaced with `useSeal` option
- M_CheckCupEmeralds(difficulty)
- Returns the Emeralds you have for that difficulty
- Obviously returns 0 for Easy
- Makes the method of checking collected Emeralds for cup contexts significantly easier
I considered restricting it even further to "unlock every minor unlock that can be unlocked by a Chao Key", but decided that if you haven't "completed the game" yet, you should still be periodically reminded of it.
Replaces existing musicflag system, which only had one flag, with a priority system that overrides menu music in general.
Also adds the CHAO KEY FREE DDL WORKING 2023 goofy music for matchesplayed Chao Key generation.
Attempts to recover Challenge Grids that aren't quite appropriate for the current suite of unlocks.
- If there's multiple small tiles pointing to the same unlock, turn the later ones empty.
- If there's a small tile that SHOULD present on the grid and an empty spot, put the needed tile in that spot.
- Otherwise, regenerate the entire grid.
This will permit us to change the number of unlockables without forcing people to run with the command line param `-resetchallengegrid` to see 'em.
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
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
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).
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.
- Make the check consistent between HUD and Challenge conditions by revolving both around M_NotFreePlay.
- The HUD appearance checked every individual component of K_CanChangeRules, so just straight up do that here.
- If the rules can be changed, battleprisons is always FREE PLAY no matter how many players are present (because it can change quickly).
- Cooperative gametypes do not count as FREE PLAY
- Sealed Stars count as a Cooperative gametype
- Fix Battle Fullscreen having had inverted presence of FREE PLAY since bosses were added