Commit graph

795 commits

Author SHA1 Message Date
Sally Coolatta
4a735470b9 Even more SRB2Kart netcode improvement ports
- Prevent connection timeout during the waiting gamestate from the last commit.
- Keep client connections alive during fades / other internal loops.
- More consistently timeout clients when they reach the end of BACKUPTICS.
- Dedicated servers will not run any game logic if no nodes are sending packets to it, to reduce CPU usage when there is no one interacting with your server.
  - Unlike SRB2Kart, the amount of time is configurable with the "dedicatedidletime" console variable. Setting this to 0 will disable this feature.
- CL_SendClientCmd uses exact packet types instead of magic number offsets.
2023-07-17 00:44:34 -04:00
Sally Coolatta
80bf4d6c2d Port SRB2Kart join on intermission fix
All gamestates besides GS_LEVEL are unsupported by the save game functions. This commit forces players joining during these gamestates into GS_WAITINGPLAYERS, which is a basic gamestate that just maintains the connection until we can enter the start of a new one. Also provides an extremely simple drawer for GS_WAITINGPLAYERS so the joining player knows what's going on.
2023-07-16 20:53:28 -04:00
spherallic
1cc870485d Increase unlockable limits:
- MAXUNLOCKABLES from 32 to 80
- MAXEXTRAEMBLEMS from 16 to 48
- COMPAT_GAMEDATA_ID is used to account for the old values to prevent
losing records.
- Also fixes linedef actions 319/320.
2023-06-13 01:53:50 +02:00
sphere
0dea372336 Merge branch 'the_elder_skyscroll' into 'next'
Rewrite F_SkyScroll to fix overflows

Closes #1008

See merge request STJr/SRB2!1985
2023-06-12 23:36:37 +00:00
Sally Coolatta
d8f6ad217c Don't give completion emblems when getting a game over in multiplayer (or any other kind of level reset) 2023-06-02 16:06:48 -04:00
Sally Coolatta
ffe591afee Tie emblem spawning to Coop gametypes 2023-06-02 16:06:45 -04:00
Sally Coolatta
ffb76334ff Don't check time attack emblems in multiplayer
(Maybe some day...)
2023-06-02 16:06:45 -04:00
Sally Coolatta
29c61fac88 Allow completion emblems in multiplayer 2023-06-02 16:06:44 -04:00
Sally Coolatta
303d636f8e Individual emblems mode 2023-06-02 16:06:43 -04:00
Sally Coolatta
49fa46d80e Online emblems
Currently, emblems share with everyone. Will add an option to toggle this.
2023-06-02 16:06:43 -04:00
sphere
369d39a859 Merge branch 'stuckonyou' into 'next'
Allow targeting invulnerable bosses & don't break targeting when they take damage

See merge request STJr/SRB2!1917
2023-05-25 23:48:56 +00:00
Zwip-Zwap Zapony
b2313aa4bd Rewrite F_SkyScroll to fix overflows 2023-05-25 14:55:21 +02:00
MascaraSnake
e4933b3e94 Merge branch 'allow-modified-saving' into 'next'
[SUGOI] Allow saving in modified games.

See merge request STJr/SRB2!1749
2023-05-24 05:04:26 +00:00
spherallic
d6cafea571 Don't force FLS to false after a pre-map cutscene 2023-04-28 15:30:02 +02:00
spherallic
e5a1fee759 Adjust default look/turn axis for new SDL2 version 2023-04-19 00:21:10 +02:00
spherallic
930b1355ed Don't call P_ResetCamera when spawning a bot 2023-04-14 12:03:21 +02:00
sphere
2df3fb53da Merge branch 'strong-lua-command-restrictions' into 'next'
Fix up Lua command/cvar safety

See merge request STJr/SRB2!1943
2023-04-12 17:50:01 +00:00
spherallic
1470d099e3 Update copyright year & credits 2023-03-31 14:53:31 +02:00
James R
ff0f6e9b74 Add CV_ALLOWLUA to a bunch of cvars
These cvars can be modified by Lua.

- advancemap
- allowexitlevel
- allowjoin
- allowmlook
- allowseenames
- allowteamchange
- autobalance
- basenumlaps
- cam2_adjust
- cam2_centertoggle
- cam2_curdist
- cam2_curheight
- cam2_dist
- cam2_height
- cam2_lockaimassist
- cam2_lockedinput
- cam2_orbit
- cam2_rotate
- cam2_rotspeed
- cam2_shiftfacingchar
- cam2_simpledist
- cam2_simpleheight
- cam2_speed
- cam2_still
- cam2_turnfacingability
- cam2_turnfacingchar
- cam2_turnfacinginput
- cam2_turnfacingspindash
- cam2_turnmultiplier
- cam_adjust
- cam_centertoggle
- cam_curdist
- cam_curheight
- cam_dist
- cam_height
- cam_lockaimassist
- cam_lockedinput
- cam_orbit
- cam_rotate
- cam_rotspeed
- cam_shiftfacingchar
- cam_simpledist
- cam_simpleheight
- cam_speed
- cam_still
- cam_turnfacingability
- cam_turnfacingchar
- cam_turnfacinginput
- cam_turnfacingspindash
- cam_turnmultiplier
- color
- color2
- competitionboxes
- cooplives
- coopstarposts
- countdowntime
- exitmove
- flagtime
- forceskin
- friendlyfire
- gravity
- hidetime
- inttime
- itemfinder
- killingdead
- matchboxes
- maxplayers
- mute
- numlaps
- overtime
- pausepermission
- playersforexit
- pointlimit
- powerstones
- respawndelay
- respawnitem
- respawnitemtime
- restrictskinchange
- ringslinger
- runscripts
- scrambleonchange
- seenames
- servername
- showhud
- showinputjoy
- skin
- skin2
- specialrings
- startinglives
- tailspickup
- teamscramble
- timelimit
- touchtag
- tv_1up
- tv_bombshield
- tv_eggman
- tv_forceshield
- tv_invincibility
- tv_jumpshield
- tv_recycler
- tv_ringshield
- tv_superring
- tv_supersneaker
- tv_teleporter
- tv_watershield
2023-03-15 16:40:21 -07:00
Eidolon
e5dea805fa Revert "Merge branch 'gamepad-refactor' into next"
This reverts commit 696e2ab909, reversing
changes made to d98d59494f.
2023-01-26 19:26:28 -06:00
Eidolon
366ee4ad92 Revert "Merge branch 'gamepad-refactor-lua-features' into 'next'"
This reverts commit 7f1cafcd3d, reversing
changes made to 696e2ab909.
2023-01-26 19:26:24 -06:00
Eidolon
7ad54af89f Revert "Fix axis inversion and camera look inversion"
This reverts commit 6428d6fc61.
2023-01-26 19:26:17 -06:00
Eidolon
bbd4cff75c Revert "Merge branch 'gamepadtweaks' into 'next'"
This reverts commit 96bfd8cea7, reversing
changes made to 24f9ec4ec4.
2023-01-26 19:24:21 -06:00
LJ Sonic
379cc4207a Revert "Merge branch 'netcode-refactor' into merging"
This reverts merge request !1920
2023-01-15 17:57:23 +00:00
LJ Sonic
41fb0c8943 Merge branch 'netcode-refactor' into merging 2023-01-15 17:45:06 +01:00
LJ Sonic
7c2fe20cd5 Move tic and net command handling to new files 2023-01-05 22:51:17 +01:00
katsy
3a04e11743 allow targeting invulnerable bosses 2023-01-05 14:11:54 -06:00
Arthur
bc519ad132 Fix for issue #933 - special stage tokens should divert player until after the special stage with a custom exit map 2022-12-31 22:07:22 -05:00
LJ Sonic
717e0d5a17 Move netcode files to a new folder 2022-12-31 14:10:19 +01:00
spherallic
1964869c69 Remove redundant control axes & cleanup 2022-12-22 01:40:33 +01:00
spherallic
a85876d0c2 Change gamepad defaults again, post-refactor 2022-12-16 01:25:54 +01:00
Eidolon
6428d6fc61 Fix axis inversion and camera look inversion 2022-12-08 21:25:10 -06:00
Eidolon
7f1cafcd3d Merge branch 'gamepad-refactor-lua-features' into 'next'
Add gamepad library and hooks for Lua scripting

See merge request STJr/SRB2!1871
2022-12-09 02:17:03 +00:00
Eidolon
696e2ab909 Merge branch 'gamepad-refactor' into next
Some hacks from the snake minigame patch have been removed as they are
no longer needed.

See STJr/SRB2!1870

# Conflicts:
#	src/g_game.c
#	src/g_input.c
2022-12-08 20:00:41 -06:00
LJ Sonic
ddc708ac87 Remove shift+F12 shortcut
This would conflict if your shift key is bound to a control =((
2022-11-25 22:40:28 +01:00
LJ Sonic
28dba7f3c1 Add a separate control for switching to the previous viewpoint 2022-11-23 18:44:58 +01:00
Sally Coolatta
a22fa1c455 Compromise on cheats setting modified game
Instead of modifying the game, cheats now set a separate "cheats were used in this session" variable, which returns some of the old behavior.

HOWEVER, cheats will STILL allow spawning / collecting emblems & unlocking unlockables. Cheats will purely prevent saving progress. (It was always frustrating that devmode would make debugging unlockable features harder...)

Lastly, the function to set no-saving was exposed to Lua (`G_SetUsedCheats(silent)`). Just thought it'd be useful for large-scale gamedata-using mods that want to add their own cheat commands.
2022-11-16 11:14:31 -05:00
Sally Coolatta
bcfe0da8fc Use old modded behavior when loading old files, instead of ignoring
Let's not pretend script-kiddie edited old files are now perfectly A-OK :p
2022-11-16 11:14:30 -05:00
Sally Coolatta
1b43cdddd5 Allow saving in modified games. 2022-11-16 11:14:29 -05:00
LJ Sonic
98d2dc4b71 No longer spam the console with viewpoint switching notices 2022-11-16 10:21:59 +01:00
LJ Sonic
d34d90b78b Enable reverse-iterating through viewpoints with shift+F12 2022-11-16 10:21:39 +01:00
LJ Sonic
aba5b953b2 Move viewpoint switching to its own function 2022-11-16 10:11:39 +01:00
Jaime Ita Passos
3e088e4e78 Use displayplayer instead of consoleplayer in G_GetInputPlayer 2022-11-15 23:36:32 -03:00
Jaime Ita Passos
f0c3de6976 Add gamepad library and hooks for Lua scripting 2022-11-14 02:18:24 -03:00
Jaime Ita Passos
46f7fa406f Refactor gamepad code
Implements the SDL Game Controller API, haptics, and axis bindings.
2022-11-14 00:37:08 -03:00
Alam Arias
1b5dd687d2 Cleanup whitespace changes from master branch 2022-11-11 20:31:41 -05:00
Eidolon
6d1a3bfce0 Reset camera when moving player to spawn/starpost 2022-11-08 18:48:50 -06:00
Eidolon
d511857675 Reset view interp in preticker 2022-05-05 19:43:55 -05:00
Eidolon
f0d7d8467f Refactor timing code even more
System layer is greatly simplified and framecap
logic has been moved internally. I_Sleep now
takes a sleep duration and I_SleepDuration
generically implements a precise sleep with spin
loop.
2022-05-01 00:32:46 -05:00
Eidolon
e79654a33a Completely refactor timing system
Time is now tracked internally in the game using I_GetPreciseTime
and I_UpdateTime. I_Time now pulls from this internal timer. The
system code no longer needs to keep track of time itself.

This significantly improves frame and tic timing in interp mode,
resulting in a much smoother image with essentially no judder at
any framerate.
2022-04-30 16:33:23 -05:00
Eidolon
3e5cec7e72 Intialize interpolator list at a better time 2022-04-26 20:56:31 -05:00
Eidolon
9c8d0a3b6f Add sector plane level interpolations 2022-04-26 20:56:30 -05:00
Eidolon
8908dcccde Only swap view interp state if a tick is run 2022-04-26 20:31:39 -05:00
Eidolon
b625076c87 Implement interpolation at the renderer level
Instead of interpolating thinkers, we interpolate mobjs inside the
renderer. Further interpolation is TBI.
2022-04-26 20:31:37 -05:00
spherallic
14295ac7de 2022 2022-03-03 20:24:46 +01:00
sphere
c79c6531e6 Merge branch 'server-bots' into 'next'
Improve bots (resolves #710)

Closes #710

See merge request STJr/SRB2!1679
2022-02-19 20:24:12 +00:00
LJ Sonic
9c5427555b Merge branch 'fix-exitgame-ztarget-crash' into 'next'
Fix lock-on crash (Resolves #746)

Closes #746

See merge request STJr/SRB2!1704
2022-02-06 17:24:01 +00:00
lachablock
1a5995968c Revert server-sidedness of bots 2022-01-19 00:48:25 +11:00
lachablock
4af820e82c Restore a cast I didn't realize used to be there 2022-01-13 09:56:47 +11:00
lachablock
70a1dd6db0 Merge remote-tracking branch 'origin/next' into server-bots 2022-01-13 09:52:38 +11:00
lachablock
8ed18a12a4 Merge remote-tracking branch 'origin/next' into server-bots 2022-01-11 20:04:22 +11:00
GoldenTails
e0afc2d2b6 Add a player->mo check before attempting to account for ztargetting. 2022-01-09 17:09:57 -06:00
spherallic
0a38fef147 Several changes to default control settings:
- Renamed Simple to Automatic, and made it the default
- Renamed Standard to Manual
- Changed some camera settings to make Automatic easier to control
- Changed most default gamepad controls, to fit Automatic playstyle
- Changed a few default keyboard controls
- Added default binds for custom actions 1-3
- Removed forced camera settings in the tutorial (to account for
upcoming tutorial update)
- Also lowered default sound/music volume a little bit
2021-12-29 19:29:36 +01:00
katsy
effcb948ad Don't count bots in playersforexit 2021-12-29 09:59:54 +00:00
lachablock
1eb1ad2677 Fix compile warning 2021-12-22 19:46:16 +11:00
lachablock
2794727201 Improve bot handling:
- bot ticcmds are generated and sent by the server only
- fix issue where server would not send all ticcmds to clients if bots were in the game
- fix bots still responding to P1's inputs while P1's controls are locked
- fix bot player's directional controls being rotated when controlled by P2
2021-12-12 18:52:27 +11:00
LJ Sonic
1acd0f6bac Merge branch 'starstruck' into 'next'
Null gamestate before map transition to prevent unwanted interactions with the map (resolves #601)

Closes #601

See merge request STJr/SRB2!1624
2021-12-03 18:02:06 +00:00
katsy
ed5942a0b6 fix tailsbot controls 2021-09-22 23:18:54 -05:00
katsy
791b981fd8 null gamestate during pre-intermission to prevent unwanted interaction 2021-09-22 16:22:47 -05:00
Tatsuru
6ed063dcce Merge branch 'polish-lua-inputs' into 'next'
Polish the Lua input library

See merge request STJr/SRB2!1598
2021-09-11 14:59:41 +00:00
LJ Sonic
5340db5f67 Make gc_ constants uppercase 2021-08-15 16:15:28 +02:00
LJ Sonic
5bc0ce7a62 Give fields in event_t better names 2021-08-14 23:42:39 +02:00
LJ Sonic
c2907b89f7 Pass a keyevent_t userdatum to key hooks 2021-08-14 20:34:59 +02:00
Jaime Ita Passos
1a84f1bcba Minor changes and fixes 2021-08-10 15:17:22 -03:00
Jaime Ita Passos
2aa9bb59ef Memory management fixes
Date:      Mon Aug 9 15:57:07 2021 -0300
2021-08-09 15:57:35 -03:00
CobaltBW
22f42efb61 Cleaned up leftover comments 2021-07-15 15:09:02 -07:00
CobaltBW
48514ee88d Fixed G_RemovePlayer crash in players.iterate
This was done by storing flag-for-removal status as a boolean inside the player struct.
Bot players are instead removed at the start of G_Ticker, rather than being removed immediately by G_RemovePlayer.
2021-07-15 15:04:24 -07:00
CobaltBW
4f04097066 Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2.git into addplayer 2021-06-29 14:32:46 -07:00
CobaltBW
c3fa9bea0f ri# mified: src/tazx# mofied: src/tazx# modified: src/tazx# modified: src/tazxc 2021-06-29 14:07:49 -07:00
Shane Ellis
09f445f227 Merge branch 'next' into 'addplayer'
# Conflicts:
#   src/g_game.c
2021-06-19 20:20:45 -04:00
LJ Sonic
e3a5da3f6f Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2.git into HEAD
# Conflicts:
#	src/lua_hook.h
#	src/lua_hooklib.c
2021-06-19 20:49:12 +02:00
LJ Sonic
cfa48574be Merge branch 'next' into 'lua-inputs'
# Conflicts:
#   src/lua_script.c
2021-06-19 10:34:48 -04:00
sphere
786516fa5f Merge branch 'kart-latency' into 'next'
Kart cmd->latency port

See merge request STJr/SRB2!1470
2021-06-09 10:53:09 -04:00
James R
4d22b9f17f Merge remote-tracking branch 'origin/next' into hooklib-refactor 2021-06-07 18:12:52 -07:00
Shane Ellis
18c47afc76 Merge branch 'next' into 'addplayer'
# Conflicts:
#   src/lua_baselib.c
#   src/r_skins.c
2021-06-02 11:47:11 -04:00
sphere
2df75610e6 Merge branch 'allow-lua-to-override-special-stages' into 'next'
Allows Lua to transport you to a different map in place of a Special Stage.

See merge request STJr/SRB2!1368
2021-06-02 11:16:15 -04:00
SteelT
ad2b4b1809 Merge branch 'save-skin-names' into 'next'
Save skin names in save files instead of skin numbers

See merge request STJr/SRB2!1503
2021-05-28 22:05:20 -04:00
SteelT
2cb920a5a6 Merge branch 'failed-level-lua' into 'next'
[SUGOI] Make stagefailed more useful, add linedef executor to toggle, and expose to Lua

Closes #361

See merge request STJr/SRB2!1463
2021-05-28 21:51:00 -04:00
Sally Coolatta
d136c60a3f Add some comments, write an empty string instead of a boolean determining if the bot skin exists or not.
I was a little scared of doing this at first, but after a bit of thought & some testing that it'll be fine.
2021-05-07 20:13:16 -04:00
Sally Coolatta
dc6851dabc Save skin name instead of skin number into save files
Allows you to save a game as any character, and you don't have to load the files in a specific order to access the save file.
2021-05-07 19:41:44 -04:00
LJ Sonic
d325c7e6d3 The year is 2021 2021-05-07 17:45:56 +02:00
Tatsuru
4f2f94d02d Compatibility with the current identifier 2021-04-21 22:22:37 -03:00
Tatsuru
da56e84d2c Change TOL_ERZ3 identifier 2021-04-21 22:17:16 -03:00
Sally Coolatta
57d81ddb21 Kart cmd->latency port
Nev3r was talking about something that would've been drastically improved with this, and it is really simple, so I ported it :)
2021-04-21 19:58:14 -04:00
Sally Coolatta
d59f25a6cd stagefailed is more useful
- Can now apply to normal stages, simply defaults to "false" in normal stages.
- Post-level cutscenes are now always skipped when the stage was failed.
- Exposed the boolean as a Lua read+write global.

Desired for SUGOI, as it allows for visited flags not be updated, and level completion emblems to not be awarded. Which means a lot less crappy non-ideal workarounds.

Normal stage intermission currently does not reflect failure state at all. Maybe it could always skip, never award score bonuses, have different text... etc. Probably would leave that up to vanilla dev opinion.
2021-04-18 12:59:49 -04:00
Steel Titanium
33b7075d46 bruh 2021-04-05 22:50:22 -04:00
Steel Titanium
397fdef034 Load intermission patches in Y_LoadIntermisionData 2021-04-05 22:34:52 -04:00
SwitchKaze
3895c02330 Revert "Remove key stuff"
This reverts commit a439e569
2021-04-02 15:46:08 -05:00
SwitchKaze
0db07cef0e Adjust joystick axis enum 2021-04-02 15:46:08 -05:00
SwitchKaze
cb3a8f7a58 Remove key stuff 2021-04-02 15:46:08 -05:00