Commit graph

670 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
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
Oni
db621c4538 Merge branch 'waypoint-fixes' into 'master'
Big Waypoint Change

See merge request KartKrew/Kart!784
2022-11-27 02:01:43 +00:00
Sally Coolatta
0e654aa2f9 Fix missing currentwaypoint in saveg 2022-11-26 15:27:51 -05:00
Sally Coolatta
b55c67c29d Add currentwaypoint 2022-11-26 02:46:52 -05:00
toaster
e65d17cd4d Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into ironman
# Conflicts:
#	src/g_demo.c
2022-11-21 15:49:29 +00:00
toaster
e7c700a64f Compilation errors from corrupted cherry-pick/porting 2022-11-03 14:32:40 +00:00
Ashnal
1e9b844e88 Unlink non-mobj and non-precip thinkers when loading and freeing
Move globalweather to before P_SpawnSpecials so that specials can properly change weather and have it communicated in savegames

# Conflicts:
#	src/p_saveg.c
#	src/p_setup.c
2022-11-03 13:23:13 +00:00
Ashnal
16300bee84 Attempt to fix use after free bug
with precipitation mobjs on netgame load

# Conflicts:
#	src/p_saveg.c
2022-11-03 13:11:03 +00:00
AJ Martinez
86366b000c HOSTCODE 'ironman' - WIP 2022-11-03 03:38:54 -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
a1fd605a24 Read time fields from net saves 2022-10-27 18:45:16 -05:00
Oni
95096fbc9a Merge branch 'special-stages' into 'master'
[Special stage prep] GP Bonus Stages + timelimit rework + Hitlag ticking fixes

Closes #236

See merge request KartKrew/Kart!739
2022-10-27 03:10:37 +00:00
James R
d284fc0ea6 Savegame terrainOverlay 2022-10-23 14:55:10 -07: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
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
Sally Coolatta
a8ac5a9922 Make Kart Z FOF Thwomp delay use args 2022-10-10 07:00:08 -04:00
Sally Coolatta
df3c077bf1 Block Monsters is a flag again 2022-10-10 01:51:42 -04:00
MascaraSnake
3b971835ee Add Lua backwards compatibility for FOF flags 2022-10-09 01:56:50 -04: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
Sally Coolatta
d19924d96d Merge branch 'master' into duel-stuff 2022-10-01 21:46:02 -04:00
James R
08f9628e6c Remove kartminimap, kartcheck, kartcomeback cvars 2022-10-01 17:04:48 -07:00
James R
1bfccebbe6 Merge remote-tracking branch 'origin/devmode-online' 2022-09-30 15:57:52 -07: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
f3668fbd7c Merge branch 'top-final' 2022-09-29 10:52:45 -07:00
Sally Coolatta
80d9637dda devmode cheat online 2022-09-29 12:19:45 -04:00
James R
23408e7d3b Let savecheckpoint work online, work at all
Actually respawns you at this location! 😃

Uses object Z position instead of floor height.
2022-09-29 06:43:44 -07:00
James R
a6f206cd62 Add topdriftheld and topinfirst to player_t 2022-09-28 02:01:37 -07:00
Sally Coolatta
d7be3d3aca Add Duel objects
- Banana, Eggman Items, Proxi Mine, Land Mine, Hyudoro, and Drop Targets are now placeable in maps.
- By default, will only appear when in 1v1s. (Extra flag can be checked to enable spawning in all modes.)
- Most of these objects will need tweaks to account for being placeable now.
2022-09-27 22:43:45 -04:00
Sally Coolatta
841bcf3619 Allow non-players to water skip/run
Water skipping is enabled for Orbinaut, Jawz, and Ballhog currently. Jawz can water run, as long as their target is on/above the plane they're at -- once their target goes into the water, they'll start skipping.
2022-09-27 12:31:33 -04:00
Sally Coolatta
21d32511a5 Merge branch 'master' into better-splash 2022-09-25 20:01:27 -04:00
Sally Coolatta
ba62851a85 Make entire archive block for RNG
Also moved after Lua to remove the desyncs.
2022-09-25 15:50:41 -04:00
Sally Coolatta
139d6f4a49 Merge branch 'master' into rng-states-2 2022-09-25 14:04:19 -04:00
Sally Coolatta
4b51f12c09 Merge branch 'master' into better-splash 2022-09-25 13:39:55 -04:00
Sally Coolatta
3e4edc534d Remove strange RNG sync hack
Previously it was using P_SetRandSeed, which sets both initial and current seed to the same thing, since it's meant for level load init. It first set all RNG seeds to the current seed, and then it set all of the seeds to their initial value. The comment about this just says its "stupid and hacky", and I have no idea how it even worked before.

Now we send over both init seed and current seed independently and set them both. Hopefully this will fix the desyncs.
2022-09-25 07:02:39 -04:00
toaster
5c36e72115 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into rng-states-2
# Conflicts:
#	src/p_enemy.c
2022-09-24 20:29:53 +01:00
toaster
fe49543456 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into big-large-map-markers 2022-09-24 19:53:36 +01:00
Sally Coolatta
362bef7b3a Add new gate sounds 2022-09-23 17:19:15 -04:00
Sally Coolatta
d582cf0a3f Merge branch 'master' into rng-states-2 2022-09-23 11:23:49 -04:00
Sally Coolatta
f89d8d15c2 Properly separate SPB & Shrink cooldowns
Also refactors some of the result -> type & amount code
2022-09-23 03:35:18 -04:00
toaster
48e9138dda Refactoring ahoy
* Instead of doing constant G_MapNumbers when finding the relationship between maps and cups...
    * Add a cache of level IDs to cups, to go with the strings.
    * Add a cache of the cup pointer to maps, so we don't have to search through all cups to find our map. (done in P_InitMapData)
    * Pre-emptive work: G_IsSpecialStage and P_GetNextEmerald now reference cup data instead of a hardcoded ID set.
* Remove a bunch of old stuff from mapheaderinfo_t/associated, and reorder what stays
    * Countdowntimer? 💥
    * Startrings? 💥
    * sstimer/ssspheres? 💥
    * forcecharacter? 💥 (distinct from forceskin)
    * interscreen? 💥
    * sstage_start/end and smpstage_start/end? 💥💥💥💥
    * You've been blocked
* G_MapNumber now returns a special NEXTMAP_INVALID if not found, for more consistent reference.
* Incorporate a good chunk of the `edit-headers` branch. Can't clear maps individually because of the new restrictions on sequential mapheaders, but we can add a "disable in vote screen, not even for map hell/archive" flag to a map at some future juncture for equivalent functionality...
2022-09-22 17:14:41 +01:00
toaster
abb567ab81 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into big-large-map-markers 2022-09-21 23:06:24 +01:00
Sally Coolatta
0e7d9ba84e Merge branch 'master' into new-spb 2022-09-21 11:18:31 -04:00
Sally Coolatta
dd94b1449e Juicebox gates forward port for SPB 2022-09-21 07:05:26 -04:00
Sally Coolatta
f987d1b601 Add smooth landing vfx 2022-09-20 10:33:24 -04:00
Sally Coolatta
a60d4a13a1 RNG classes, take 2
Redone version of my old branch
2022-09-19 00:04:57 -04:00
toaster
1a284ec7c6 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into big-large-map-markers
# Conflicts:
#	src/d_netcmd.c
2022-09-17 13:57:26 +01:00
toaster
7e17f5456c I_Error in all situations where mapheaders were previously allocated outside of SOC.
Also:
- improved error prints for SOC condition definitions
- improved bounds checking to use `nummapheaders` for iterating over mapheaderinfo
There are still situations that use NUMMAPS like mapvisited, randmapbuffer, etc, which need to be addressed before merger.
2022-09-17 13:07:48 +01:00
Sally Coolatta
fac7bb0627 Merge branch 'master' into item-bungus 2022-09-16 06:56:23 -04:00