Commit graph

1287 commits

Author SHA1 Message Date
toaster
e7c79ab461 M_CheckNetUnlockByID
System for netsyncing unlocks, inspired by but with nowhere near as many moving parts as (STJr/SRB2!1756).
* `gamedata->unlocked[MAXUNLOCKABLES]` is duplicated to `netUnlocked[MAXUNLOCKABLES]` (or all `true` in `dedicated`
* New `local` boolean for M_SecretUnlocked
* Removed last vestiges of SRB2 special stage token code because it occupied the spot in the netsave we wanted to use.
* Correct typing of multiple `m_cond` functions that returned `boolean` constants as `UINT8`s.
2022-12-09 17:26:52 +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
toaster
6d0637d39d Unlockable skins (in a way friendly to #define MAXSKINS 255)
Mammoth commit, sorry. I only realised halfway through writing it that SECRET_SKIN was only partially merged.

Ports from 2.2:
- Merge SECRET_SKIN (STJr/SRB2!1474)
    - Default skin is now handled by checking all skins for unlock status, and I_Erroring if none are available
    - Don't show skin names on game startup, to keep our secrets hidden
    - Unlockables now have string variables zallocated.
         - For skin names rather than numbers.
    - Correctly clean up memory when freeing unlockables and emblems.

Bespoke code:
- For temporary testing. `unlocks.pk3`
    - Using this for rapid testing gameboot SOC instead of patch.pk3 because of the intent to turn that into scripts.pk3
- Don't not save gamedata in DEVELOP builds, even if you've used cheats!
- `player->availabilities` is now an array of UINT8
    - (MAXSKINS + 7)/8 entries, or 32 bytes.
    - Included with XD_ADDPLAYER instead of XD_NAMEANDCOLOR.
         - Simplifies a lot of logic with respect to demos, skin changes mid-game, etc.
             - Seriously, there's a lot of random places in the code that just iterate over MAXSPLITSCREENPLAYERS and g_localplayers to update availabilities in real time in a way that's not particularly netsafe...
         - Lines up with the plan for handling unlocks when returning to menus.
         - Was included with XD_ADDBOT, but that actually overruns the netxcmd buffer at first mapload with 7 bots. We might need to consider expanding the size of the netxcmd buffer...
    - In demos, can be interpreted as both relative to the original replay and the current skin list depending on boolean context provided to R_SkinUsable.
    - Used for SF_IRONMAN (and will crash if all other skins are inaccessible).
- Grand Prix bot randomisation uses the host's unlocks.
- Don't show locked characters on the fancy new character select.
-  DXD_JOINDATA for demos
    - Replaces the dual-purpose behaviour of DXD_PLAYSTATE
    - Contains availabilities
    - Handles bot material in a different way
- Forceskin restrictions
    - Won't run in demos, because it's assumed recorded DXD_SKIN will handle all the conversions the original match had
    - Won't run if K_CanChangeRules says no
- Correctly set `mapvisited` on level visit, even in [fake gasp] MULTIPLAYER/NETGAMES!! 🥹
- Added updating unlockables and extra emblems on `mapvisited` update.
    - Currently fails to produce the cecho, but that'll be stripped out entirely in a future commit so I'm not bothered.
2022-11-27 22:53:29 +00:00
toaster
8179b39773 ForceAllSkins cleanup 2022-11-27 16:21:45 +00:00
Oni
f292397993 Merge branch 'restartlevel-encore' into 'master'
Restartlevel respects cv_kartencore

See merge request KartKrew/Kart!780
2022-11-27 03:36:20 +00:00
Sally Coolatta
e331910fe3 Reduce VFX toggle
Can be used to disable VFX, so it can only appear if its owner is a display player. If no owner is provided, then it will be removed entirely.

Applied to most things that Ivo asked for
2022-11-26 20:12:00 -05:00
toaster
15a51e370a Restartmap respects encore Auto too
Per jart's suggestion
2022-11-26 16:40:50 +00:00
toaster
5b10fd8d93 Restartlevel respects cv_kartencore 2022-11-25 18:21:19 +00:00
toaster
62bf8458c5 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into servers-16
# Conflicts:
#	src/d_main.c
2022-11-21 15:29:35 +00:00
Sally Coolatta
d0cd25328e Remove decabanana 2022-11-18 02:34:59 -05:00
Sal
e8a6aa7540 Merge branch 'follower-fixes' into 'master'
Followers and Character Select improvements

See merge request KartKrew/Kart!764
2022-11-14 21:30:03 +00:00
toaster
f323a372a6 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into servers-16
# Conflicts:
#	src/d_netcmd.c
2022-11-12 17:30:40 +00:00
toaster
e086b52055 Fix the MP character select being completely busted and sending infinite changenameandcolor packets
Still has weird inappropriate conditions for changing skin, but gets the feature at least WORKING for now.
2022-11-07 20:16:53 +00:00
toaster
2e75012645 Clean up follower setting to handle strings and values just like player->skin
- Fixes defaulting to follower id 0 (previously chao, currently hot robo) when joining a server without going through the menu flow
- No need to store TWO names for a follower, so save a little memory
- Should make it easier to add unlockable followers later
2022-11-07 18:11:45 +00:00
toaster
fa5aa408be WIP: Catch a few places which could be going wrong with followers on joining servers.
Definitely better than it was, but current status: sometimes when joining a server cv_follower[n].value is 0 and I don't know why.
2022-11-07 00:58:55 +00:00
toaster
368a45c674 Change default followercolor to "Match" (from "1") 2022-11-06 22:15:16 +00:00
toaster
1cae2e1502 Fix loading follower default colour
Also corrects an issue where the last two skincolours were not being copied to the followercolor table
2022-11-06 15:21:22 +00:00
toaster
0f471b1cf1 Move some command and cvar registering between D_RegisterServerCommands and D_RegisterClientCommands depending on whether a dedicated server needs them or not 2022-11-06 13:15:17 +00:00
James R
7b2918ae63 Add grayscale command, toggles GRAYPAL palette override 2022-11-03 05:51:39 -07:00
James R
8742a55077 Add cv_palette and cv_palettenum
Cheats; override the current palette
2022-11-03 05:44:33 -07:00
James R
58bb648b0a Merge branch 'udmf-cherrypick' into 'master'
Update our UDMF

Closes STJr/SRB2#862

See merge request KartKrew/Kart!727
2022-10-29 06:54:48 +00:00
Eidolon
2476455195 Loop inclusive for r_splitscreen
r_splitscreen indexes from 0 inclusively
2022-10-27 19:11:35 -05:00
toaster
02884d235c If timelimit is set while being modified (extremely unlikely but technically possible), stop adding extra time. 2022-10-15 15:58:24 +01:00
toaster
52c0e145be Fix pointlimit messages occouring in singleplayer contexts
Still an awful child that hasn't shaped up like their sister cv_timelimit, but this will do for now.
2022-10-15 15:51:57 +01:00
toaster
ca2ecf6e9f Add "allowdemos" option to K_CanChangeRules()
It's been used interchangably as "this is a singleplayer gameplay context" and "This is a no cvar changing context". This addition repairs some behaviour which might have been inconsistent between netgame and netreplay.
2022-10-15 15:15:22 +01:00
toaster
f281f47c6f Support alternate gameplay events during GP
- Implementation details:
    - grandprixinfo.eventmode is the reference point
    - All bots have spectator applied and removed at map start depending on eventmode, and I've done my best to guard against side effects of not removing them entirely
    - You shouldn't turn off grandprixinfo.gp when turning on things like specialStage.active or bossinfo.boss when pursuing eventmode behaviour
    - Probably needs to be integrated into XD_MAP for any future netplay support, is currently disabled.
    - You technically don't have to assign a Capsules map to be the bonus and a Special Stage to be the special. A Capsules map can be assigned to a Special Stage too, and a Boss can be assigned to either of them.
    - Special Stages are still just as incomplete as they were before.
- Break the Capsules has special behaviour.
   - Timelimit starts at 20 seconds.
   - Earn 10 seconds (plus a little extra cheaty time) every capsule you destroy.
   - WIN + extra life if you bust all the capsules, COOL if you get some but run out of time, LOSE if you lose your bumper or run out of time without breaking a single capsule.
   - Supposed to also give you rings, but ran into a LOT of difficulty with this and didn't want to commit half-baked stuff, so it'll be a later project.
Also:
- Fix a long standing bug where totalring was reset between maps, preventing the sum from adding up across GP rounds and depriving you of extra lives you were owed.
- Fix an issue where Break the Capsules record attack was KARTSPEED_HARD.
- Send timelimitintics in savegames, since it's handled seperately now.
2022-10-14 18:34:43 +01:00
toaster
c8471c7c27 Rework exit timing nittygritty
- exitcountdown is now used for both No Contest and regular exits
    - Set in P_DoPlayerExit
    - Handles sending XD_EXITLEVEL in P_Ticker
- player->exiting is now 0 or 1 (we can make it a bool or a new timer later)
- Fixes a longstanding bug where failing a GP round could restart multiple times
Also:
- Fix a possible waiting-in-the-wings issue where mapchanges would occour client-side in K_CheckBumpers
- Add `gptest` cheat - sets numlaps to 1 lap on mapload for quick but legitimate(ish) progression
2022-10-13 17:37:35 +01:00
toaster
243f38227c Rework time limit a bit
- Make timelimitintics handled a bit more like gamespeed, encore, frantic, etc - update on mapload/starttime, not during gameplay
    - Use default setting if can't change rules - this is a surprise tool that will help us later
- Have it properly update when adjusting gametype from the menu
    - Cleaned up SV_StartSinglePlayerServer to do this
- Remove CV_SAVE to prevent time limit bruh moments
2022-10-11 23:00:44 +01:00
toaster
dbc067f87a Use GP difficulty str values instead of hardcoded "Master" exception 2022-10-11 16:47:56 +01:00
toaster
44eb099cfb Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into special-stages 2022-10-11 15:44:32 +01:00
Sally Coolatta
2ac062e5b3 Merge branch 'master' into udmf-cherrypick 2022-10-10 19:34:11 -04:00
toaster
d364e5a5f6 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into rename-kart-commands
# Conflicts:
#	src/d_netcmd.c
#	src/d_netcmd.h
2022-10-10 17:34:28 +01:00
Nev3r
5c9599f0a9 "UDMF: The whole thing" merged
See merge request STJr/SRB2!1714

Barely any RR features reimplemented
2022-10-09 01:13:37 -04:00
Sal
8b58a7563a Merge branch 'cheat-giveitem' into 'master'
"kartgiveitem" -> "give " plus convenience features

See merge request KartKrew/Kart!723
2022-10-08 20:02:36 +00:00
AJ Martinez
224bd9baf3 Don't DEVELOP guard spbtest 2022-10-02 04:12:03 -07:00
AJ Martinez
6a7c5050ad Restore SPB force-seek define as 'spbtest' cvar 2022-10-01 21:46:26 -07:00
Sally Coolatta
4ee46c74d7 Basic start on Special Stages 2022-10-01 21:32:55 -04:00
James R
f891535065 Remove kartdebugcheckpoint, merge into debugwaypoints 2022-10-01 17:44:07 -07:00
James R
c935c42bd1 Rename "kart" prefixed cvars
kartspeed -> gamespeed
kartbumpers -> battlebumpers
kartfrantic -> franticitems
kartdisplayspeed -> speedometer
kartvoices -> tauntvoices
kartbot -> bots
kartdebugdistribution -> debugitemodds
kartdebughuddrop -> debugitemdrop

kartencore -> encore
kartvoterulechanges -> voterulechanges
kartgametypepreference -> gametypepreference
karteliminatelast -> eliminatelast
kartusepwrlv -> usepwrlv

kartdebugitem -> debugitem
kartdebugamount -> debugitemamount

kartdebugwaypoints -> debugwaypoints
kartdebugbotpredict -> debugbotpredict
kartdebugnodes -> debugnodes
kartdebugcolorize -> debugcolorize
kartdebugdirector -> debugdirector
2022-10-01 17:24:26 -07:00
James R
08f9628e6c Remove kartminimap, kartcheck, kartcomeback cvars 2022-10-01 17:04:48 -07:00
James R
925adee72f Rename "item" command to "give"
blame 05ee87ba5
2022-10-01 16:37:59 -07:00
James R
05ee87ba59 Rework and give item command
- "kartgiveitem" renamed to just "item"
- partial item name matches supported, e.g. type "item ring"
- item 0/none to remove your item
2022-10-01 16:20:17 -07:00
James R
8893666b53 Refactor XD_GIVEITEM into CHEAT_GIVEITEM 2022-10-01 16:16:22 -07:00
Sal
e9d2785cc3 Merge branch 'you-have-uncommitted-changes' into 'master'
The programmer took a nap. Hold out, programmer!

See merge request KartKrew/Kart!722
2022-10-01 02:14:15 +00:00
James R
1bfccebbe6 Merge remote-tracking branch 'origin/devmode-online' 2022-09-30 15:57:52 -07:00
James R
40b28d7d1a Merge branch 'rework-rteleport-command' into 'master'
relativeteleport cheat online

See merge request KartKrew/Kart!719
2022-09-30 22:52:23 +00:00
James R
f6b4b9213b Merge branch 'rework-savecheckpoint-command' into 'master'
savecheckpoint cheat online

See merge request KartKrew/Kart!718
2022-09-30 22:52:05 +00:00
James R
ee2302d6ee Merge branch 'noclip-online' into 'master'
Cheat/Debug Commands ...ONLINE

See merge request KartKrew/Kart!717
2022-09-30 22:51:42 +00:00
James R
62b2718261 Print on the title screen and in console if there are uncommitted changes 2022-09-29 15:31:53 -07:00
James R
f3668fbd7c Merge branch 'top-final' 2022-09-29 10:52:45 -07:00