Commit Graph

69 Commits

Author SHA1 Message Date
Eero
e167a34f32 Make entity lists thread-safe with copy-on-write wrappers
Replaced static entity lists (e.g., HullList, GapList, MapEntityList, etc.) with thread-safe copy-on-write wrappers to improve concurrency and prevent race conditions. Updated usages and related methods to support the new thread-safe collections, ensuring atomic operations and lock-free reads throughout the codebase.
2025-12-28 21:59:03 +08:00
Eero
f485583621 Unstable 0.2 Defer physics operations during parallel updates
Introduces a thread-safe queue for deferring physics operations (such as body creation and transforms) to the main thread, ensuring Farseer Physics is not accessed from parallel contexts. Updates Holdable, Item, MapEntity, and GameScreen to use the new PhysicsBodyQueue for safe physics operations during parallel updates, and refactors PhysicsBodyQueue to support general deferred physics actions.
2025-12-28 15:10:06 +08:00
Eero
49355fe32b Unstable Add thread-safe queue for deferred physics body creation
Introduces PhysicsBodyQueue to safely defer physics body creation to the main thread, addressing thread-safety issues with Farseer Physics during parallel updates. Updates LevelResource, TriggerComponent, BallastFloraBehavior, and MapEntity to use the queue for all physics body creation and refresh operations, ensuring they are processed outside of parallel loops. Also adds cleanup of the queue at round end.
2025-12-28 14:42:17 +08:00
Eero
46595b1399 WIP Make collections thread-safe and add safe iteration
Replaced static lists and dictionaries with thread-safe ConcurrentDictionary or ThreadLocal collections for various item components and systems. Updated all relevant code to use snapshots (ToArray, ToList) for safe iteration, and added helper methods for marking and clearing changed connections. These changes improve thread safety and prevent potential concurrency issues in multi-threaded scenarios.
2025-12-28 04:59:56 +08:00
NotAlwaysTrue
a44d89f953 Revert "Revert back to 1.0.3" 2025-12-27 16:05:20 +08:00
NotAlwaysTrue
b35eee5561 Revert "OBT/1.0.4" 2025-12-27 15:32:16 +08:00
NotAlwaysTrue
7e899d900a Added ClientCount for PerformenceMonitor
Add a marker to help distinguish EP from other SV Executables
Fixed a "Failed to copy object. Source is null." introduced by last update
Uses dynamic ThreadCount instead of fixed 16
Re-Removed most PF support
Re-Parallelzed Level update and Character Update(a conflict warning will be issued
2025-12-27 13:19:36 +08:00
Eero
6032010847 Improve parallelization in map and game screen updates
Refactored update logic in MapEntity and GameScreen to use more granular and conditional parallelization, reducing unnecessary allocations and improving performance. Updates to hulls, structures, items, and physics bodies are now executed in parallel where safe, and item updates are only performed when necessary. Also parallelized submarine and physics body transform updates.
2025-12-26 21:04:07 +08:00
NotAlwaysTrue
e715fdc835 Fixed #10
Fixed #12
2025-12-26 01:16:05 +08:00
eero
5b823d8684 Clarify thread safety in update methods
Updated comments in GameScreen.cs to indicate that StatusEffect.UpdateAll and Character.UpdateAnimAll are not thread-safe and must be executed on the main thread. Also removed a non-English comment from MapEntity.cs for consistency.
2025-12-22 18:07:17 +08:00
eero
b146fa326d Refactor MapEntity.UpdateAll for improved parallelism
Rewrites MapEntity.UpdateAll to use more granular parallelism, reducing contention and improving performance by parallelizing hull, structure, and gap resets, while keeping order-dependent and non-thread-safe updates sequential. Updates GameScreen to pass ParallelOptions to UpdateAll.
2025-12-22 17:48:14 +08:00
NotAlwaysTrue
d98f9de5d4 Updated PM, uses 60s average to match message update time, modified message to display Server Running Time(Total Time Elapsed) in h:m:s.ms format
Readded perviously removed update interval condition
2025-12-22 00:24:33 +08:00
NotAlwaysTrue
f87e943a1a Move a lot of thing around to fix collection was modified.
Note: For now I can only adjust orders and cannot make some real thing. It will take time to check and refactor everything necessary.
2025-12-20 14:16:51 +08:00
NotAlwaysTrue
2f845b40ca Moved Item related stuff to the end of MapEntity.UpdateAll to avoid issues
Added a threadlock to avoid some issue(someday i will take care of)
Add a function that automatically log server performence every 60s
2025-12-20 00:08:42 +08:00
NotAlwaysTrue
fff157d5ca Added a Performence Monitor for debug
Many multi-threading work in ServerSource
2025-12-19 13:43:12 +08:00
Evil Factory
352625af28 Merge remote-tracking branch 'upstream/master' 2025-12-08 12:35:44 -03:00
Markus Isberg
598966f200 Release 1.11.4.1 (Winter Update) 2025-12-08 14:56:47 +00:00
Evil Factory
da13162c60 Merge branch 'master' of https://github.com/Regalis11/Barotrauma 2025-09-25 09:00:20 -03:00
Regalis11
b2d91cde7c Release 1.10.6.0 - Autumn Update 2025 Hotfix 1 2025-09-25 11:11:35 +03:00
EvilFactory
2368640841 Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop 2025-06-17 15:45:16 -03:00
Regalis11
ea5a2bc693 Release 1.9.7.0 - Summer Update 2025 2025-06-17 16:38:11 +03:00
EvilFactory
103871a4e9 Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop 2025-04-10 10:37:09 -03:00
Markus Isberg
a4a3427e4e Unstable 1.8.4.0 2025-03-12 12:56:27 +00:00
EvilFactory
e163f7ed73 Merge remote-tracking branch 'upstream/master' into develop 2024-06-18 12:19:13 -03:00
Regalis11
230d1b6e78 v1.5.7.0 (Summer Update) 2024-06-18 16:50:02 +03:00
EvilFactory
0a9ff43986 Merge remote-tracking branch 'upstream/master' into develop 2024-04-24 12:20:11 -03:00
Regalis11
ff1b8951a7 v1.4.4.1 (Blood in the Water Update) 2024-04-24 18:09:05 +03:00
EvilFactory
448e4cdfbb Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop 2023-12-14 11:56:39 -03:00
Regalis11
b91e85559d v1.2.6.0 (Winter Update) 2023-12-14 16:11:27 +02:00
Markus Isberg
fb5ea537bf Unstable 1.2.4.0 2023-11-30 13:53:00 +02:00
EvilFactory
9838cc59ee Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop 2023-10-19 12:18:30 -03:00
Markus Isberg
cf8f0de659 Unstable 1.1.14.0 2023-10-02 16:43:54 +03:00
EvilFactory
fd74c08a8f Removed GapUpdateInterval (no longer required) 2023-06-15 13:53:28 -03:00
EvilFactory
15daa64f66 Merge https://github.com/Regalis11/Barotrauma into develop 2023-06-15 12:13:50 -03:00
itchyOwl
83de72e3d2 v1.0.20.1 (summer patch) 2023-06-15 16:46:54 +03:00
EvilFactory
4a229c6427 Merge branch 'master' of https://github.com/Regalis11/Barotrauma into develop 2023-03-13 13:32:14 -03:00
Regalis11
bf73ddb6c3 v1.0.7.0 (Full Release) 2023-03-13 10:30:37 +02:00
Regalis11
2c5a7923b0 Faction Test v1.0.1.0 2023-02-16 15:01:28 +02:00
EvilFactory
08f18e2e69 Rename members to use correct case 2022-11-26 22:16:40 -03:00
Markus Isberg
c772b61fc1 Faction Test 100.4.0.0 2022-11-14 18:28:28 +02:00
EvilFactory
77c63541eb Merge branch 'dev' of https://github.com/Regalis11/Barotrauma into unstable 2022-09-29 12:13:55 -03:00
Juan Pablo Arce
3f2c843247 Unstable v0.19.3.0 2022-09-02 15:10:56 -03:00
Evil Factory
c5860d13d5 Merge branch 'master' of https://github.com/Regalis11/Barotrauma.git 2022-07-14 12:25:44 -03:00
Markus Isberg
497045de7e Build 0.18.13.0 2022-07-01 12:16:36 +09:00
Evil Factory
7a09711296 Merge branch 'master' of https://github.com/Regalis11/Barotrauma.git 2022-06-15 13:26:49 -03:00
Markus Isberg
6be757a45b Build 0.18.5.0 2022-06-03 22:29:04 +09:00
Markus Isberg
7547a9b78a Build 0.18.0.0 2022-05-13 00:55:52 +09:00
Evil Factory
c8ec13fb56 added powered update interval 2022-05-05 13:18:50 -03:00
Evil Factory
b7395bedea Refactor and fix #56 2022-04-15 19:08:27 -03:00
Oiltanker
1e6ac68e86 initial cs-lua merge work 2022-04-15 21:25:58 +03:00