Commit graph

549 commits

Author SHA1 Message Date
Eidolon
22b20b5877 Add netgame voice chat
Implemented using libopus for the Opus codec, same as is used in Discord.
This adds the following cvars:

- `voice_chat` On/Off, triggers self-deafen state on server via weaponprefs
- `voice_mode` Activity/PTT
- `voice_selfmute` On/Off, triggers self-mute state on server via weaponprefs
- `voice_inputamp` -30 to 30, scales input by value in decibels
- `voice_activationthreshold` -30 to 0, if any peak in a frame is higher, activates voice
- `voice_loopback` On/Off, plays back local transcoded voice
- `voice_proximity` On/Off, enables proximity effects for server
- `voice_distanceattenuation_distance` distance in fracunits to scale voice volume over
- `voice_distanceattenuation_factor` distance in logarithmic factor to scale voice volume by distance to. e.g. 0.5 for "half as loud" at or above max distance
- `voice_stereopanning_factor` at 1.0, player voices are panned to left or right speaker, scaling to no effect at 0.0
- `voice_concurrentattenuation_factor` the logarithmic factor to attenuate player voices with concurrent speakers
- `voice_concurrentattenuation_min` the minimum concurrent speakers before global concurrent speaker attenuation
- `voice_concurrentattenuation_max` the maximum concurrent speakers for full global concurrent speaker attenuation
- `voice_servermute` whether voice chat is enabled on this server. visible from MS via bitflag
- `voicevolume` local volume of all voice playback

A Voice Options menu is added with a subset of these options, and Server Options has server mute.
2024-12-13 17:12:14 -06:00
toaster
63aaec65b1 Add roundqueue -show
Reveals the next Round in the queue via server shout message.
Can be used manually, or with automate commands for tournament rulesets that permit foreknowledge of the next Round without requiring the host to work off memory or document.
2024-10-11 13:46:30 +01:00
Sal
653766010d FRIENDCODE (aka, Teamplay) 2024-09-17 01:41:26 +00:00
Sally Coolatta
b43d62367f Nametag stuff
- Enable item spy in all modes
- Add CPU tags
- New CPU indicator for tab screen
2024-08-23 01:51:52 -04:00
AJ Martinez
3c68ab7674 Improved spindash + ebrake 2024-05-01 20:35:49 -07:00
Sally Coolatta
f1f7edbe9a Show last lap time on HUD
Inspired by RoyKirbs' Joypolis journey
2024-04-11 03:05:11 -04:00
toaster
d0724c263a Bring roundsplayed_t into the highest common denominator header
No indirect, hard-to-maintain magic number range in modetimeplayed arrays
2024-04-06 21:01:56 +01:00
Eidolon
23e4df3c90 Add per-map time stats and TA/SPB time stats 2024-04-06 11:25:31 -05:00
Eidolon
c22d6d75db Add several skin record stats, profile rounds 2024-04-06 11:25:31 -05:00
toaster
7f6de407f1 Copyright update: Add Kart Krew (2024) in general for high-traffic inherited sourcefiles 2024-04-02 17:42:38 +01:00
Sally Coolatta
af6340741e Add speed to gametype
Set a specific gamespeed per gametype. KARTSPEED_AUTO for it to be decided by game settings.

Wanted this for a while, but also it makes game speed display logic for DRP very straightforward.
2024-03-22 16:58:36 -04:00
James R
5445d59d57 Replays: larger buffers for player name, skin name, color name; bump demo version 0x0009 -> 0x000A
- Name buffers are the same size as everywhere else
  - Billiards Cactus no longer gets cut short
  - Long player names no longer get cut short
- System in place to allow easily changing the buffer
  sizes across all the demo code
2024-03-19 01:23:51 -07:00
James R
0ce93b2d96 Add g_fast_forward_clock_stop, means to end g_fast_forward early if too much real world time is taken 2024-03-18 02:42:22 -07:00
toaster
6e46f97847 As promised, Encore (alt)music
- `EncoreMusic` on mapheader
    - Supports up to 3 alt musics, as with every other type
- Do not vape/nightcoreify if provided
- To avoid complicating the Alt Music logic too much, uses "side B" of the same Prison Egg CD
    - That is to say, if there are 2 encore tracks and 3 normal tracks, the second Encore track will only play if you've gotten the CD associated with the second normal track

I haven't actually tested it *with* any Encore music, but I've triplechecked literally everywhere to make sure it didn't break standard play
2024-03-10 21:18:15 +00:00
James R
717dcf0209 restartlevel: preserve last map's gametype
- gametype can be changed without changing gamemap,
  through the pause menu option
2024-03-09 05:20:49 -08:00
James R
0707c9e5ec Add g_musicfade, generic system to fade out the level music for a brief period 2024-03-08 17:53:07 -08:00
James R
9f982a574e Add LapsPerSection property to map headers, fixes finish line distance in hybrid section-circuit maps
- It is possible to have a circuit map separated into
  sections, where there are multiple "laps" before making
  a full loop
- Normally the lap count is used to multiply the finish
  line distance, but it fails for these maps
- The LapsPerSection property fixes the calculation by
  specifying how many laps make up a full loop
  - Default = 1 lap (most maps)
2024-03-03 03:06:52 -08:00
James R
1f3b5dea0a Remove cv_showinputjoy (unused) 2024-03-02 00:16:31 -08:00
Eidolon
f4f7c5b1eb Add fault start mapthing 36 and prefer it for TA
Fixes KartKrew/Kart#1063
2024-02-24 19:15:00 -06:00
toaster
7e217b74f5 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into separate-spb-attack-records
# Conflicts:
#	src/g_game.c
2024-02-23 00:57:40 +00:00
Eidolon
b1cf0207bf Remove unused _saveid fields from in-mem gamedata 2024-02-21 18:44:44 -06:00
toaster
3f78c9d2e6 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into separate-spb-attack-records
# Conflicts:
#	src/menus/play-local-race-time-attack.c
#	src/p_setup.cpp
2024-02-11 23:27:33 +00:00
Oni
4ea946067a Merge branch 'srb2-tidy' into 'master'
Clear out unused SRB2/Kart stuff from info tables

See merge request KartKrew/Kart!1811
2024-02-03 19:40:52 +00:00
Sal
3958c15dfe New Credits 2024-01-28 23:31:30 +00:00
James R
ff07b92f18 Gamedata: save SPB Attack times separately from normal Time Attack
Bumps gamedata version! Gamedata version 10 -> 11
2024-01-27 04:23:44 -08:00
James R
05d8d83dcc Refactor recorddata_t and separate into recordtimes_t 2024-01-27 04:13:01 -08:00
toaster
6fdec66dc3 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into srb2-tidy 2024-01-26 00:29:06 +00:00
James R
db4e2e692b Add LobbySize option to level headers, controls whether the map appears in vote, based on player count
- Prevents a map from appearing on the vote screen if
  there are too many players
- LobbySize
  - Duel - 2 players max
  - Small - 5 players max
  - Medium - 10 players max
  - Large - 16 players max (default if not set)
- Future proofing
  - Doesn't count bot players in gametypes that don't
    support bots
2024-01-13 22:56:17 -08:00
toaster
325079a39a Delete everything major flagged up by listunusedsprites
Notable deletions:
- Metal Sonic Race
    - Includes all the specialised recording/playback apparatus which made g_demo.c harder to read
- A bunch of hyperspecialised code inside several A_ actions
- EXCEPTION: intentfully left in the spriteless SMK stuff for Sal's add-on down the line.
2024-01-11 01:21:43 +00:00
Oni
df5c866573 Merge branch 'map-access-flingerdinger' into 'master'
Stronger Course progression restriction

Closes #832, #859, and #839

See merge request KartKrew/Kart!1795
2024-01-09 08:11:12 +00:00
toaster
4994ceef2c Gamedata: A Course only needs to be beaten to be stored as an unloaded mapheader record, not need FinishNeeded/a Time Attack record 2024-01-07 13:59:42 +00:00
toaster
83366b6507 More universal Course restriction based on progression
All courses are restricted in Match Race/Time Attack/Online if not visited in GP UNLESS:
- It is the first Race Course of a Cup
- Course has "NoVisitNeeded = True`
    - The Controls Tutorial and Test Run are the only two stages that will need this

The above replaces:
- A lot of restricted courses having to be marked with `FinishNeeded = True`
    - Hidden Palace
    - Sealed Stars 1-14
        - Once Special Mode is unlocked, it will now be possible to practice Sealed Stars before rematching them in GP
- Almost all Tutorial-specific behaviour, since it was heinously hacky

HOWEVER, `FinishNeeded = True` was left in specifically for future releases, and I reserve the right to use it on Adventure Example again before launch.
2024-01-07 13:57:05 +00:00
James R
df0d342e04 Let level darkness be changed per splitscreen, use player_t variables
Modifies netsave.

- Add darkness_start, darkness_end to player_t
2024-01-05 15:56:24 -08:00
James R
8430489673 Replace darktimer/darkness with g_darkness
Modifies netsave.

- Instead of setting a timer, set a start time and end
  time
- Interpolated darkness value itself doesn't need to be
  netsynced
2024-01-05 15:56:24 -08:00
Eidolon
7521e42e62 Add automedal time configs and calculation 2024-01-03 12:24:33 -06:00
Eidolon
746da46321 Read staff ghosts from pk3 directory 2024-01-02 21:05:43 -06:00
Sally Coolatta
5eaf2613c6 Show rank on intermission 2023-12-13 01:28:22 -05:00
James R
5d0c062785 Add g_reloadingMap, true if the map is restarted/retried 2023-11-27 06:28:29 -08:00
James R
d3f9c6e826 Remove mapmusflags 2023-11-27 05:38:20 -08:00
Oni
25d10e382a Merge branch 'locked-cuprow' into 'master'
Second row of cups is invisible if none of them are unlocked

See merge request KartKrew/Kart!1652
2023-11-22 07:30:36 +00:00
toaster
21f152989d Clear separation between basegame and mods
- Always force a page seperation between the last core files cup and the first modded cup
- Lost and Found sits exactly between them
    - If any cup on the last page of basegame is unlocked, place LnF on the last core page
    - Else, LnF is the first "cup" on the first Modded page
    - It's done this way so no Core material is spoiled if you haven't unlocked it yet. We want people to believe RR contains only 7 cups unless they go above and beyond

Also address Volt's bug report: Prevent the first page of cups from being overridden if everything is locked
2023-11-21 22:59:12 +00:00
toaster
382119b8fb Second row of cups is invisible if none of them are unlocked
- Controlled by M_CupSecondRowLocked
    - Looks for any Cup with associated unlockable that's on the second row
    - Cached on load for both relevant menus - Cupgrid and Challenges
- Custom cups will be stretched out onto more pages
    - Side incentive of unlocking more material: Less annoying interactions with custom material
- Pages with nothing unlocked are completely skipped over

Also moves a bunch of minor things which previously used magic numbers to the CUPMENU_COLUMNS/CUPMENU_ROWS defines, for sanity
2023-11-20 21:09:33 +00:00
toaster
66844457cd gpRank_t: Prevent overflow in stored rank
Resolves most of #772.
- Match maximum size of levels array to ROUNDQUEUE_MAX, to prevent edge cases
- Explicitly check that numLevels does not equal/exceed array size before writing
2023-11-19 16:33:16 +00:00
toaster
0762b93ef2 Tutorial skipping challenge - first pass
- Go to a MainCfg-specified map on its guessed gametype
    - `TutorialChallengeMap = RR_ZonedCity`
- Some unique settings
    - K_CanChangeRules() == false
    - If GTR_CIRCUIT, make it Hard Speed
    - If GTR_BUMPERS, die in one hit
    - If GTR_BOTS, make them all difficulty 13 of the default bot skin
    - No Medals or Spray Cans during the Tutorial Challenge
- Complete the stage in 1st place or don't bother at all
- Has the "Give up" menu option available, but no "Try Again"
- Condition for successfully completing the Tutorial Skip
    - `Condition1 = TutorialSkip`

Related bugfixes:
- Correctly wipe skipstats when returning to the Title/menus
- Typing of `ultimatemode` (hey this isn't accessible by anything right now I wonder)
2023-11-16 21:44:52 +00:00
Oni
3b04bde5b9 Merge branch 'will-it-blend' into 'master'
Will It Blend

See merge request KartKrew/Kart!1589
2023-11-05 18:45:51 +00:00
AJ Martinez
506ab31f7f Mania-style time trials 2023-11-02 06:51:51 -07:00
toaster
e060e9dadc More consistent handling of special event round icons
- Gametypes have "GPpic" and "GPpicMini" parameters
- These are shown in contexts where a Round Number would be shown in GP, but an eventmode is under way.
- Instead of having different rules to show up on the pause menu, titlecard, and tally/intermission...
    - Pause Menu Roundqueue, Tally, and Intermission have all been aligned to the same rules.
    - As long as the titlecard is standard, it will show the GP Pic per those rules. (GTR_SPECIALSTART and GTR_BOSS still have their unique behaviour here)
2023-10-25 20:34:40 +01:00
toaster
de79dfe983 UCRP_MAPDESTROYOBJECTS
You have to destroy all objects of a certain list of types.
UNLIKE OTHER CHALLENGES, this is dependent on a mapheader parameter!!
The author of this commit just didn't want to create too laggy a condition check.
- `Condition1 = MapDestroyObjects RR_ESPRESSOLANE tables & chairs
- Map RR_ESPRESSOLANE
    - DestroyObjectsForChallenges = MT_ESPTABLE,MT_ESPCHAIR
2023-10-19 17:28:55 +01:00
toaster
acad8754c8 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into break-through-them-all 2023-10-17 23:32:08 +01:00
AJ Martinez
680c063e3a "DARKNESS" mapheader option for Shrink lighting 2023-10-12 21:07:04 -07:00