Commit graph

166 commits

Author SHA1 Message Date
Sally Coolatta
5d9e813c5e Fixes for titlemaps
- Removed all old dev title screen remainders that were interfering with titlemaps.
- F_VersionDrawer displays on all title screen types
- SA2 intro sound only plays whenever there's am actual title card to show (before it checked for not GS_CEREMONY?)
- Removed redundant customversionstring check in menus (F_VersionDrawer already handles customversionstring)
2023-10-17 17:56:10 -04:00
Oni
005d05ac15 Merge branch 'threaded-software' into 'master'
Threaded software

See merge request KartKrew/Kart!1553
2023-10-17 09:28:59 +00:00
Eidolon
2d614781eb i_system.c -> cpp, disable mumble 2023-10-14 15:26:52 -05:00
AJ Martinez
680c063e3a "DARKNESS" mapheader option for Shrink lighting 2023-10-12 21:07:04 -07:00
toaster
9076b3c99b Self-review: Correctly initialised gamedata spraycan map id in clear_Levels 2023-08-24 01:16:14 +01:00
toaster
595b3d67d5 Add UC_CHARACTERWINS
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.
2023-08-23 18:58:10 +01:00
toaster
e1b7cb66cb Rework the Spray Can system to ACTUALLY be what we want
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.
2023-08-23 00:46:46 +01:00
toaster
b03c82b8b2 Implement UC_SPRAYCAN condition
Currently impossible to achieve, but will work once I draw the rest of the owl
2023-08-19 15:09:18 +01:00
toaster
1d06637a38 First pass at assigning unique spraycans to level headers
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
2023-08-19 15:08:55 +01:00
toaster
fb8795c8da M_FinaliseGameData
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.
2023-08-19 14:32:11 +01:00
James R
ebba7c327c Add encore variants of LightContrast, LightAngle and SpriteBacklight to level header 2023-08-11 20:30:30 -07:00
toaster
8d7c9dd6ce Menu titles for level headers
For the tutorials. Replaces the no longer visible subtitle, since it's roughly analagous in purpose.
2023-08-10 00:28:17 +01:00
toaster
b669f8484f Realname for Cups
Permits prefixing them like maps AND giving them spaces instead of underscores, fixing the "RECYCLE_A" issue.
2023-08-10 00:28:17 +01:00
toaster
2e395c8b0f Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into more-conversions 2023-07-18 10:52:09 +01:00
toaster
36e0a23c09 Remove console script support from maps
The linedef's behaviour was broken horribly by long map names, and it's not worth the effort to fix it for the following reasons.
- It was considered a security vulnerability to have free access to the console when it was written.
- The game literally had a cvar to disable running console scripts. That's "I am willingly distributing ActiveX Word Documents in 2023" levels of foolhardery.
- Anything GOOD it can do, both Lua and ACS can do better.
2023-07-12 16:32:23 +01:00
toaster
b69a255fe9 readlevelheader: Support lowercase for ZoneTitle
Exposed by increased lowercase prevalence, fix before boarding that up.
2023-07-12 09:00:29 +01:00
toaster
1ec5b74892 Implement SECRET_MEMETAUNTS
Permits "Meme" player taunt voice and "Meme" follower horn options
2023-06-28 19:31:40 +01:00
toaster
e7ee979f1a Horncode
A much more focused replacement for Hornmod, specc'd out by Tyron and Oni working together and implemented by the author of this commit because it's pretty funny.

- Followers have `hornsound` in their SOC configuration.
    - The default sound for all followers without a provided one is sfx_horn00.
- They'll play this sound if you use lookback with one following you, and there's nearby players to get the player looking all the way around.
    - Only the players who are successfully considered for lookback will hear it.
- Has a v1-like visual with less randomisation, but still netsynced.
- Also controlled by the cvar `taunthorns`, which, like `tauntvoices`, takes "Tasteful" (default), "Meme", and "Off".

TODO: make the condition for horn a little delayed, so you have to hold lookback for a little bit.
2023-06-28 17:54:23 +01:00
toaster
1429a91cd9 Increase maximum # of Followers
Surprisingly easy as it requires negative values to mark "None", so it was already out of the range of UINT8
2023-06-28 16:36:36 +01:00
toaster
4344221252 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into seeecret-colors 2023-06-28 12:48:50 +01:00
toaster
3b169c71dc Merge branch 'fixconditionsets' into 'master'
Conditionset is UINT16, not UINT8

See merge request KartKrew/Kart!1302
2023-06-28 11:47:59 +00:00
toaster
a933e7a084 Provide helpful warning for too-large id counts for ConditionSet Condition# lines 2023-06-28 12:17:41 +01:00
toaster
e2669dba0c Correct readcondition helper function as well 2023-06-28 12:16:25 +01:00
toaster
9372f8ff1a Conditionset is UINT16, not UINT8 2023-06-27 23:03:05 +01:00
toaster
5036719280 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into seeecret-colors
# Conflicts:
#	src/k_menudraw.c
2023-06-26 23:25:47 +01:00
toaster
c9817b957a New unlockable type for watching the Credits from start to finish
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
2023-06-26 22:32:47 +01:00
toaster
060c03f011 Ring Racers-specific Evaluation
- 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
2023-06-25 23:49:20 +01:00
toaster
c89048def7 Game End cleanup
- Remove specific gamestate, drawer, etc
- Just add an extra fade straight into G_EndGame
2023-06-25 23:49:19 +01:00
toaster
43044ec032 PlayCredits for Cups
Hilariously broken due to the evaulation gamestate, but the first piece of the puzzle: gets the player into the Credits gamestate after the conclusion of a Podium, if the GP context's cup has this boolean set.
2023-06-25 23:49:19 +01:00
toaster
8d3e828663 AltPodium for cups
We're unlikely to utilise this, but permits creators of custom user-created cups to flex their own style without fighting to replace the default Podium.
2023-06-25 23:49:18 +01:00
toaster
8689e0735e readcupheader: Permit emptying out BonusGame and SpecialStage for an existing cup
Provide a single / and it'll be empty
2023-06-25 23:49:18 +01:00
toaster
12ff436877 Make a first-class feature instead of a passworded secret
- Now called "Grand Prix Backup"
- Filename is now `gpringsav.bkp`
- Since available in standard contexts, do a little extra guarding against unsporting behaviour:
    - In non-DEVELOP builds, delete Grand Prix Backup when returning to the titlescreen/menus.
- "undo your extra work and make it more generic" - Tyron
2023-06-25 23:44:37 +01:00
James R
6b125ea575 Sprite directional lighting, add SpriteBacklight option to level header
- Sprites have directional lighting, like walls
- For normal sprites: contrast is much stronger than walls
- Papersprites look the same as walls

- SpriteBacklight option in level header weakens the contrast for sprites only
  - SpriteBacklight subtracts from LightContrast
  - E.g. SpriteBacklight = 0 would let it match LightContrast
  - E.g. SpriteBacklight = 60 would make the contrast much weaker
  - Negative values make the contrast stronger
2023-06-14 19:56:16 -07:00
toaster
e162fffecf UC_PASSWORD
Unlockable type that supports entering (case-insensitive) string
2023-06-07 17:46:21 +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
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
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
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
Sally Coolatta
c486ec19af SECRET_COLOR 2023-04-25 14:19:52 +01:00
toaster
2f8b8cf532 Follower lists: Fix typing
Should consistently be signed INT16, not unsigned UINT16
2023-04-21 20:52:13 +01:00
toaster
66d8d8757e emblem_t: Add var2/stringVar2 2023-04-21 15:09:49 +01:00
toaster
5f15736626 Mapheader Followers system
Replaces Flicky List system from 2.2.
Specify a list of comma-seperated Followers.
Not used by any systems in this commit, but important to store the data for later.
2023-04-20 23:01:13 +01:00
AJ Martinez
3012839138 Serverside PWR: Completely rip out profile PWR, add PWR to XD_ADDPLAYER 2023-04-11 19:38:02 +01:00
toaster
a85af6339d M_EraseDataResponse: Don't softlock the Stereo on if you're likely no longer able to access it 2023-04-08 12:32:47 +01:00
toaster
e732f37258 levelheader_t: relevantskin property
- On level load for GT_TUTORIAL:
    - Forces to requested skin (or Eggman if not specified).
        - Named `relevantskin` and not `tutorialskin` in case it's useful to use the same apparatus later for Adventure.
    - Also sets default skincolor and disables follower.
2023-04-03 00:28:37 +01:00
toaster
24d8b20124 GT_TUTORIAL
- Replaces `tutorialmode`.
- Forces gamespeed to Easy, with no POSITION.
    - Laps are currently disabled as well, but this can be changed if necessary.
- Hides Free Play.
- Does not count as a played round (except for Chao Keys).

`tutorialmap` has also been removed. This will be replaced in a later commit with something that plays nicer with Ring Racers' existing systems.
2023-04-03 00:28:37 +01:00
toaster
9f1ab11bb1 UCRP_TRIGGER: Since we're not doing the custom condition string, just say the player has to "do something special on [levelname]". 2023-03-31 16:03:52 +01:00
toaster
9a343bd465 mapheader_t: PositionMusic property
A little off-piste, but a trivial addition since I'm changing this part of the code.
- Plays in Position outside of Encore
- Shows up first in the Sound Test sequence for that map
2023-03-28 15:14:09 +01:00
toaster
48eca2d8cf readlevelheader: Correct incorrect associated music debug message 2023-03-28 13:56:55 +01:00