Commit graph

319 commits

Author SHA1 Message Date
Boondorl
fae43b8120 Added ready system to screen jobs for multiplayer
Readds the feature to allow players to ready up during stat screens and intermissions instead of autoskipping based on whoever closed it. Comes with a variety of ways to tweak this behavior such as percentage-based auto starting (with a timer), the ability to unready as needed, and who can control it. Players will still be able to skip through individual screen jobs within the runner while waiting to ready up.
2025-06-28 14:39:19 -03:00
Boondorl
fc7a480fe8 Tweak tic catchup mechanic
Always chase the available tics.
2025-06-28 14:38:19 -03:00
Boondorl
c36ea479a8 Move engine verification to front end
This can't be in the backend since it uses game-specific information.
2025-06-26 00:24:19 -03:00
Boondorl
e981064e5c Fixed BT_RUN getting toggled off on command clear
This doesn't get delta'd when networking so its state has to be kept between wipes since it's built entirely from client data.
2025-06-14 14:04:44 -03:00
Boondorl
58809a3689 Fixed up game id
Store it in a proper buffer.
2025-05-09 20:39:56 -03:00
Boondorl
7877018471 Added CRC to packets
Verify that data is correctly ordered and reject packets that aren't. Also generates a random game id to ensure packets are coming from legitimate clients.
2025-05-09 20:39:56 -03:00
Ricardo Luís Vaz Silva
9e2b1f9c4c
Bone Getters Part 2/3, plus fixed warnings for MSVC
* add getters for frame poses

* fix missing joint in GetJointPose

* clean up models_iqm.cpp

* clean up usage of I_GetTimeFrac, split out matrix calculation into its own function

* clean up SetModelBoneRotationInternal

* clean up a few float <-> double and unsigned <-> signed warnings

* fix more warnings

* further clean up warnings

* split mode ObjectToWorldMatrix stuff

* initial work on bone getters, matrix hell

(the matrix/vec3 multiplications are probably wrong af, just gotta add more stuff 'till i can test it)

* clean up matrix math

* GetBone/TransformByBone

* fix GetBoneFramePose

* fix ObjectToWorldMatrix

* fix missing array resize

* raw matrix getters (for use with gutamatics/etc)

* reverse matrix mult order

* replace GetBoneLength/GetBoneDir with GetBoneBaseTRS

* fix GetBonePosition, remove GetBoneWorldMatrix as it's useless

* GetBonePosition

* deduplicate code

* rename GetBonePosition to GetBoneBasePosition to avoid confusion

* GetBoneBaseRotation

* GetBonePosition helper function

* forgot include_offsets
2025-05-09 17:06:16 -03:00
Sally Coolatta
ac42aa8337 cl_debugprediction console variable
Makes `gametic` run behind `ClientTic` by n ticks, and forces player prediction code to run. Only works if you are in a singleplayer session.

This is intended to be useful for mod development, as you can quickly test prediction issues without creating a multiplayer server. It may also come in handy if any improvements are made to the prediction code in the future.
2025-03-25 10:24:44 -04:00
Boondorl
154eea56e6 Update all players' acks in packet-server mode
Fixes potential issue when host switching in packet-server mode
2025-03-24 22:42:04 -03:00
Boondorl
134e8f2d60 Fixed potential softlock in packet-server mode
Make sure to send over the lowest player's data we got as the ack and not whatever the host specifically had
2025-03-24 22:42:04 -03:00
Boondorl
7e410fd5d8 Added cvar for cool downs on repeatable actions when playing online
Currently only applies to doors.
2025-03-12 13:05:31 -03:00
Boondorl
a07a6e7922 Fixed first consistency check 2025-03-12 13:05:24 -03:00
Boondorl
a7fd3852e2 Slow down host if they're too far ahead of the world
Makes packet splitting recover more elegantly during rough net conditions.
2025-03-12 13:05:24 -03:00
Boondorl
918b4a8834 Fixed clients after host not getting quitters 2025-03-12 13:05:24 -03:00
Boondorl
b213b81c92 Auto split packets in packet-server mode
Avoid fragmentation by trying to keep data in each packet to <1500b. Helps avoid possible issues with fragmentation with large player counts and bad network conditions.
2025-03-12 13:05:24 -03:00
Boondorl
f7e62a8cd6 Added client-side Thinkers
Adds support for client-side Thinkers, Actors, and ACS scripts (ACS uses the existing CLIENTSIDE keyword). These will tick regardless of the network state allowing for localized client handling and are put in their own separate lists so they can't be accidentally accessed by server code. They currently aren't serialized since this would have no meaning for other clients in the game that would get saved. Other logic like the menu, console, HUD, and particles have also been moved to client-side ticking to prevent them from becoming locked up by poor network conditions. Additionally, screenshotting and the automap are now handled immediately instead of having to wait for any game tick to run first, making them free of net lag.
2025-03-11 10:14:28 -03:00
Boondorl
e4081df0db Run net events on load barriers 2025-03-10 17:59:38 -04:00
Boondorl
ad3bcfddba Lobby Overhaul
Rewrote lobby to unify common and Doom-specific packet structure, allowing for saner handling of in-game joining. Added a new per-client stage system that allows individual clients to be handled at a time when gathering and sharing info. Reworked lobby UI to display user info and added kick/ban functionalities. Bans are only a temporary per-game IP ban (use passwords to keep unwanted users out). Increased max player count to 64 and unified engine constant.
2025-03-07 20:32:52 -05:00
Boondorl
94be307225 Netcode Overhaul
Rewrote netcode to be more stable and functional. Packet-server mode has been restrategized and will now be the default netmode when playing with 3+ non-LAN players. TryRunTics has been cleaned up with older tick control behavior removed to account for the rewritten renderer. The main thread is now more consistent when playing online to prevent potential slow downs and lock ups. Load barriers are better accounted for to prevent spikes on level transition. Improvements to chat and lobby systems including a force start game button. Added a suite of new host options such as kicking and controlling who can pause the game. Max players increased from 8 to 16 since the new code can now handle it.

Note: Demo functionality is untested. This will be rewritten at a later time alongside improvements to GZDoom's playback features (e.g. freecam mode).
2025-03-05 12:52:52 -05:00
inkoalawetrust
b54da619ad Added spawn origin flags.
- Added new spawn flags that allow for checking if an actor was spawned by the level, the console, or ACS/DECORATE/ZScript.
2025-02-20 04:13:36 -03:00
Rachael Alexanderson
047e1e8b74
- remove priority changing code entirely - replace with vid_lowerinbackground which activates FPS capping in background 2025-02-08 21:42:39 -05:00
Rachael Alexanderson
6f927d60c8 - don't allow vid_dontdowait if neither vid_vsync is true nor vid_maxfps is set, in order to prevent coil whine 2025-01-04 12:22:47 -05:00
Rachael Alexanderson
3efaca262d - address adaptive sync flicker issue (disables 35 fps cap during game pause) 2025-01-04 12:22:47 -05:00
Ricardo Luís Vaz Silva
023328da04 allow summon to work with visual thinkers 2024-12-20 22:23:49 -03:00
Boondorl
f0aa0acf08 Fixed changeskill being unnetworked 2024-04-25 20:37:16 -04:00
Christoph Oelckers
a938e9c66c moved the NetworkEntityManager into the backend code. 2024-04-21 18:30:19 +02:00
Christoph Oelckers
ebd4ebf298 StringTable cleanup and improvements
cleaned up function interface to avoid referencing the file system in the worker functions.
replaced StringTable's operators with functions.. The main reason is that these are far easier to look up when browsing the source.
This also fixes a premature translation in SBARINFO that was done in the parsing stage, not the printing stage.
2024-04-21 10:34:44 +02:00
Boondorl
38f14ccd56
Tweaked net ID file management
Should now be easier to stub network entity functions for Raze.
2024-04-20 19:14:29 -04:00
Boondorl
8d0d130dc9
New API for assigning unique network ids to objects 2024-04-20 19:14:29 -04:00
Rachael Alexanderson
ef10467ff8
- revert changes in backend code which will not sync properly with raze
This is a combination of 2 commits.

Revert "New API for assigning unique network ids to objects"

This reverts commit e37c19b5b4.

 This is the commit message #2:

Revert "Fix for Morph virtual"

This reverts commit 0ef042562e.
2024-04-17 14:48:02 -04:00
Boondorl
e37c19b5b4 New API for assigning unique network ids to objects 2024-02-26 06:23:12 -05:00
Boondorl
5895b88799 Fixed bytes being written incorrectly 2024-01-06 15:40:31 -05:00
Boondorl
df9b2cd9bf Added 64-bit networking support
Mainly for use with doubles as ZScript can now take advantage of it. Enforced sizing on ints passed to and read from net functions.
2024-01-05 23:33:15 +01:00
Boondorl
a8e350aed8 Renamed Networking Functions
New names more appropriately match the size of the value they write to/read from the stream.
2024-01-05 23:33:15 +01:00
Boondorl
202d0d747f Added NetworkBuffer
Allows for a command to be built before sending it off. Added wrapper functions for certain data types. Changed command from a number to a Name.
2024-01-05 16:42:13 +01:00
Boondorl
9565c94cd2 Added SendNetworkCommand
Allows for a custom message to be sent over the network without the need for SendNetworkEvent. This includes all the possible valid types of byte, word, long, float, and string.
2024-01-05 16:42:13 +01:00
Christoph Oelckers
48ba63c022 added even more explicit GetChars() calls. 2023-10-03 15:55:08 +02:00
Christoph Oelckers
b695e845e1 - eliminated several pointless string copies in network code. 2023-08-12 10:56:34 +02:00
Christoph Oelckers
ee5b6e45f8 - made D_WriteUserInfoStrings memory safe.
Its callers are anything but for now but this function was the main blocker for refactoring so it had to come first.
2023-03-26 09:27:26 +02:00
Boondorl
7517b64aee Updated to Interface Event
Changed SendConsoleEvent to SendInterfaceEvent to make functionality clearer. Added InterfaceProcess virtual to EventHandlers. Added CCMD for sending interface events.
2022-11-13 21:04:38 +01:00
Christoph Oelckers
ff37d710e2 - overhaul of savegame path management.
* use a different subfolder for each IWAD's saves.
* do not allow load and save CCMDs to escape the save folder. Absolute paths and '..' are being blocked now.
* unified savegame path and filename generation in one single function. All ad-hoc file name generation was replaced.
* -loadgame will also use the designated savegame folder now.
2022-11-05 13:28:31 +01:00
Christoph Oelckers
8aaab153fa - add a system interface for CheckCheatmode and moved some sound code to the backend. 2022-10-02 16:48:56 +02:00
Christoph Oelckers
12adee5256 - fixed a few includes 2022-10-02 13:57:36 +02:00
Christoph Oelckers
f0fbdba593 - disable implicit conversions from float to TAngle 2022-08-26 18:01:26 +02:00
Christoph Oelckers
aaf9618e61 - make sure ticdup is initialized.
Apparently sometimes it still does not happen.
2022-06-22 10:30:09 +02:00
Christoph Oelckers
86a5545fa8 - fixed division by zero with unvalidated ticdup values. 2022-06-09 08:36:11 +02:00
Christoph Oelckers
d6886ed44f - route the StartScreen#::Net... functions through a global interface.
These will require different treatment later, so best only have one place where each method is called.
2022-06-01 08:37:00 +02:00
Christoph Oelckers
390bf58698 - first stage of migrating intermissions to screenjobs. 2022-04-26 20:50:35 +02:00
Christoph Oelckers
1d0aed219e - replaced MIN/MAX in all non-common code. 2021-10-30 10:16:52 +02:00
Christoph Oelckers
6406427eb7 - added check for M_IsAnimated to TryRunTics. 2020-12-11 11:51:52 +01:00