Commit graph

291 commits

Author SHA1 Message Date
toaster
5a3ed5464e P_Ticker: Do not start position music or play noises if gametype has no time between intro and start 2023-06-03 14:18:01 +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
Sally Coolatta
60e80d876d Improve quake effects
- Quake epicenter + radius now work.
- Since quake epicenter works, removed the display player check on all of the quakes, so other players can feel them.
- Multiple quake effects are stored in a linked list and dynamically created/freed, so they can stack together.
- Made in china
- Made the quake effects only work on the z axis.
- Quakes now alternate their intensity and dampen it over time, instead of randomly picking values.
- Added quake effects for offroad and stair-jank
- Disabled quakes in reducevfx
- Removed actionmovie and windowquake (sorry jartha)
2023-05-01 14:24:32 -04:00
toaster
3d9d9ba1e6 P_Ticker: Do not run antigrief detection if there are no waypoints 2023-05-01 17:10:02 +01:00
toaster
ab68be49e1 cv_antigrief
- Increments a timer on human players who aren't making progress, does it even faster if they're going backwards.
    - Only applies in:
        - Netgames
        - GTR_CIRCUIT after the timer starts
        - If there's no timelimit, pointlimit, or K_Cooperative (because unproductive behaviour there will be punished by other rules)
    - The rate at which this changes needs trial and error, but getting the feature functional is more important to start out with.
- If this timer reaches cv_antigrief's value in seconds , the player gets a "Grief Strike"
    - This doesn't happen if:
        - There's only one active player in the server, so FREE PLAY permits mappers to test what increments/decrements the counter
            - Turn `debugwaypoints` on to observe this
        - The cvar is set to 0
    - Less than 3 grief strikes is a forced spectate
    - Anything more is a kick via "automatic grief detection"
        - Unless your node is the host (or an admin)
    - Remove grief strike strike for finishing normally

# Conflicts:
#	src/d_clisrv.h
2023-05-01 16:57:35 +01:00
toaster
d4dbc1fe30 P_Ticker: Seperate out local player device rumble handling into its own inlineable function
Clears some space for antigrief handling
2023-05-01 16:57:34 +01:00
toaster
83fc8110ba Versus music: *Also* begin at tic 1, not 3 2023-04-30 21:48:02 +01:00
toaster
581567dfae musiccountdown
A system for level completion jingles.
- G_Ticker
    - Call P_EndingMusic after a certain amount of time has elapsed to begin a jingle
    - Play O_RACENT after the jingle's completion instead of baking it or an equivalent into the music
- P_EndingMusic
    - Change the function signature to not take a player
    - Pick from a series of const char* jingles, instead of sprintfing into a buffer
        - _first
        - _win
        - _lose
        - RETIRE
    - Simplifying logic to handle intermission music
2023-04-30 21:47:07 +01:00
toaster
f65471f609 P_Ticker: Encore map intro hum starts at tic 1, not 3, after experimental intro timer merger 2023-04-30 20:31:07 +01:00
James R
e8a8064da9 P_Ticker: update view interpolation at the start of a tic
This lets R_ResetViewInterpolation only need to be called
once from game logic.
2023-04-22 20:40:35 -07:00
toaster
43b1686abf Controller rumble if Stairjank is affecting your momentum directioning
Uses the same strength as offroad because of how it's functionally equivalent in Sealed Star stages
2023-04-12 23:08:50 +01:00
James R
9eab5317f3 Stop calling P_NullPrecipThinker
In levels with tens of thousands of precipmobjs, the
overhead of running a thinker for all of them is too much,
no matter how small the thinker is.

ALL thinking is done inside the renderer now, where it can
be limited by distance. Precipmobjs track the last
leveltime they thunk, so interpolated frames don't think
twice.
2023-04-08 13:34:42 -07:00
toaster
8c58cde072 Rumble: Also vibrate on the first half-second of a sneaker (panel), attenuating in strength with numsneakers. 2023-04-03 00:13:17 +01:00
toaster
6942298862 Adjustments to Rumble
- Cause more intense rumble for damage/damage-causing hitlag
- Reduce intensity for offroad/bananadrag rumble
2023-04-02 23:55:16 +01:00
toaster
380beaa023 Refactor Rumble condition check to iterate over splitscreen players once in p_tick.c, instead of players*splitscreen players in k_kart.c 2023-04-02 23:49:45 +01:00
Oni
dec66ee9b1 Merge branch 'jam-project' into 'master'
Stereo Mode

See merge request KartKrew/Kart!1097
2023-03-31 01:07:38 +00:00
Sal
83b5b26a12 Merge branch 'packet-hack' into 'master'
Experimental: Improve level load processing

See merge request KartKrew/Kart!1077
2023-03-28 23:41:33 +00: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
James R
2547ba6d6b Merge branch 'fix-faulty-references-false-positive' into 'master'
Fix false positive P_RemoveThinkerDelayed warning

See merge request KartKrew/Kart!1087
2023-03-27 12:07:40 +00:00
Oni
b9bbb6cb8a Merge branch 'conditions-cascading' into 'master'
Conditions Cascading

Closes #366

See merge request KartKrew/Kart!1053
2023-03-23 23:51:30 +00:00
James R
1949e9eebb PARANOIA: delay P_RemoveThinkerDelayed warning by 2 tics
MT_ITEMCAPSULE_PART can be delayed by this much it seems.
2023-03-23 15:23:09 -07:00
Chromatian Keiske
fd122e7d62 Merge branch 'paranoia-mobj-reference-count' into 'master'
Tune up PARANOIA warnings for mobj reference count

See merge request KartKrew/Kart!1070
2023-03-23 08:11:04 +00:00
Sally Coolatta
ffb65a3583 Experimental: Improve level load processing
- P_PreTicker ("defrosting") is dead. Levels now actually start on tic 0 instead of tic 2.
- Netxcmds are ran before G_Ticker, instead of after.
- All netxcmds are required to be processed before the level will finish loading (up to 5 gametics, to prevent any possible lock-up from malicious clients).
2023-03-22 10:59:29 -04:00
James R
15edab5e85 Delay spawning level sign posts, do not use youfuckedup face for tied sign posts
- Sign post spawning is delayed until after thinkers have
  run. This lets ties be tallied.
- Spawn normal (non error) sign for ties.
2023-03-20 20:59:12 -07:00
James R
17aaf178d5 PARANOIA: fix faulty references warning
- Print mobj address and mobj type in addition to
  reference count
- Print negative reference counts correctly
- Don't print warning twice for the same mobj (don't spam
  the console)
2023-03-20 19:57:00 -07:00
James R
509a023329 PARANOIA: add debug to P_SetTarget if references go negative
Prints mobj address, mobj type, thinker function,
reference count and source code line number.
2023-03-20 19:57:00 -07:00
James R
55467d190a Fix code formatting in P_SetTarget 2023-03-20 19:40:57 -07:00
toaster
4c0077e07c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-19 13:01:06 +00:00
toaster
3e900d7f57 G_DirtyGameData: Dirty bit only applied in I_Error and signal handlers, nowhere else
- Unfortunately, the way this system previously worked, the unlock was given to you for free if you accidentially opened two copies of the game at once.
- Instead, open the file in r+ mode, shimmy along 5 bytes, and write a `true` to be read later.
- Far more memory safe than rewriting the entire gamedata out on crash.

ALSO:
- crashflags has been split into boolean evercrashed and UINT8 musicflags.
    - We don't need to track if the LAST session was a crash, at least not right now.
    - Opens the floor up to other music like Loser Club happening on the Challenges menu.
2023-03-17 14:42:06 +00:00
Sally Coolatta
c8ccb13614 Add additional script types
- POSITION: Runs when POSITION period ends. Has no activator.
- OVERTIME: Runs when the time limit runs out. Has no activator.
- EMERALD: Runs when the Special Stage UFO's Chaos Emerald is grabbed. The activator object is set to the player that grabbed it.
2023-03-14 08:02:57 -04:00
toaster
01f6eb71f5 Optimisation: reduce the number of calls to M_CheckUnlockConditions
- For P_Ticker()'s calls to M_UpdateUnlockablesAndExtraEmblems
    - Do not check non-UCRP_REQUIRESPLAYING conditions
        - Controlled by a new `boolean doall` parameter to M_UpdateUnlockablesAndExtraEmblems
        - Most other contexts have this as true
        - Forced true if update is meant to be silent
    - Only check UCRP_REQUIRESPLAYING conditions if a relevant property has been touched
        - Controlled by a new `boolean checkthisframe` property on roundcondition_t
        - Set in all contexts where roundcondition_t is modified
        - Would also be set on lap change, but that case is already covered by the following
- Check all conditions, both UCRP_REQUIRESPLAYING and not, on:
    - local player K_HandleLapIncrement
    - local player P_DoPlayerExit
    - local player P_DoTimeOver
    - Controlled by a new `boolean deferredconditioncheck` property on gamedata_t
2023-03-12 13:52:28 +00:00
toaster
d2c36c952a Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading
# Conflicts:
#	src/k_grandprix.c
#	src/k_grandprix.h
2023-03-07 19:37:46 +00:00
toaster
1e67f75f14 P_Ticker: Adjust bracketing of Gamedata save conditional to handle deferred saves even during intro turnaround 2023-03-05 21:00:27 +00:00
Sally Coolatta
9c264b3736 K_UpdateAllPlayerPositions
Call this whenever we need accurate player positions. In addition to before player think, is now being used for exiting as well as immediately when the player is spawned.
2023-03-05 14:59:11 -05:00
toaster
80555e3738 P_Ticker: Do not evaluate interesting player conditions during introtime 2023-03-05 19:51:33 +00:00
Sally Coolatta
dddc992e24 Fix camera tilting in podium 2023-03-03 16:09:57 -05:00
Sally Coolatta
2d84837e5b Use ceremony gamestate when warping to podium on startup
Doesn't spawn the bots for some reason still, but I need this for quicker prototyping
2023-03-03 16:09:57 -05:00
toaster
db52c22a83 More NULL handling for gamedata
Partial duplicate of MR 1010, but 1) wanted to guarantee no merge conflicts before I forgot and 2) I added things in previous commits which needed stronger guarding
2023-03-03 13:59:59 +00:00
toaster
53ce2e4287 Gamedata-related changes + Crash tracking
- Combine multiple adjacent saves
    - Generally could happen during game ticking, combined via gamedata->deferredstate
    - DEFINITELY happened in splitscreen PWR handling, adjust those loops directly
- Write "dirty" state via gamedata->crashflags on everything except safe, intentful unloads
    - Add UC_CRASH, which unlocks dependent on the above "dirty" state being present at gamedata load
    - We can use this for something more useful and less funny later.
- Play "O_LOSERC" on the menu, starting with the Challenges screen, if a UC_CRASH condition has been met.
2023-03-03 13:38:31 +00:00
toaster
5b11179213 A start on in-level empheral conditions
- M_UpdateUnlockablesAndExtraEmblems: If Playing() and GS_LEVEL, call a bunch of funny conditions for every non-spectator splitscreen player.
    - Called every tick in P_Ticker. May be foolish. May duplicate effort. Worth extra attention later.
- Add a bunch of stacking-together UCRP_REQUIRESPLAYING condition types.
    - A collection of PREFIXes
        - Grand Prix
        - Bonus Round
        - Time Attack
        - Break The Capsules
        - Sealed Star
    - A collection of specific prerequisites
        - Current map is [map value]
        - Character is [character string that gets parsed after skin load]
            - M_UpdateConditionSetsPending(), because SOC is bad and loaded before skins
    - A collection of win conditions (TODO: these still work in FREE PLAY)
        - Finish in good standing
        - Break all the capsules
        - No Contest
        - Finish at least [place]
        - Finish at [place] exactly
        - Finish at [time, tics]
        - Finish at [time, tics] exactly
        - Finish with at least [time, tics] left (GTR_TIMELIMIT only)
    - An AND to concatenate them together (literally just for text adjustment)
2023-03-02 23:02:42 +00:00
toaster
f305246311 Cleaned up commenting and conditions for start countdown changes 2023-03-01 17:21:57 +00:00
toaster
5f74d8ca85 Missing else. I am messing up my elses today 2023-03-01 17:15:35 +00:00
toaster
a2b5844ae8 Use S_FadeMusic instead of S_FadeOutStopMusic near starttime
Had no deleterious effect when the I_FadeSong hits 0 volume while paused, and seems to be a possible solution to fixing the music-stopping issue..?
2023-03-01 17:03:47 +00:00
toaster
13a987a0a2 Move starting countdown sounds to p_tick.c
Fixes an issue where the starting countdown wouldn't play in spectator mode or hitlag
2023-03-01 16:32:23 +00:00
James R
061e5b01ec Refactor trackercap
- Don't clear every tic. This is what P_RemoveTracker is
  for.
- Link in P_SpawnMobj. Should cover all cases.
- Remove excess objects. These were leftover from when
  Shrink destroyed items. Just track Jawz, SPB and Break
  the Capsules.
2023-02-21 18:27:46 -08:00
James R
be4c341316 Rename kitemcap to trackercap 2023-02-21 17:48:14 -08:00
SteelT
047b84e3d0 Fix perfstats 4 not working properly 2023-02-16 23:48:37 -05:00
toaster
1df3da8379 G_TickTimeStickerMedals: Do not call in demo.playback 2023-02-05 19:26:18 +00:00
toaster
eb16f9d5a9 G_TickTimeStickerMedals: Move the failed-record sound handling out of K_drawKartTimestamp 2023-02-05 18:31:59 +00:00
Sally Coolatta
75658fd469 Implement thing special
Executes when an object is killed.
2023-01-05 23:58:48 -05:00