userDaniel Pcancel

3,110 Commits over 730 Days - 0.18cph!

13 Days Ago
Bugfix: avoid NRE if bike doesn't have a sidecar Tests: spawned a motorbike
13 Days Ago
Update(tests): TestServer now also creates a dummy BiomeMap Not sure why pre-merge TestMTSave(GrowableEntity) didn't trip over, but sorted now Tests: all TestMTSave
13 Days Ago
Merge: from main
13 Days Ago
Clean: add comments for new perf test Tests: none, trivial change
13 Days Ago
New(tests): SendEntityUpdates perf test, creates a bunch(100, 1000, 10000) of players that get sent to 10 players Runs Jobs 3(parallelize dependency chains) vs Jobs 4(parallelize queues) serialization modes and whether to use network cache. Doesn't create any entity hierarchy (best case for Jobs 3). With network cache, Jobs 4 beats by ~2x (10k: 16ms vs 9ms), without cache Jobs 4 scales much better, up to 3x faster (10k: 62ms vs 14ms). Tests: ran SendEntityUpdates
13 Days Ago
Update(tests): assign prefabIDs to entities created in TestServer Avoids tests derping out trying to save global managers/players Tests: SendEntityUpdates perf test passes
13 Days Ago
Bugfix: fix double-free on a pooled buffer This was causing a buffer to be shared between 2 tasks when it was fetched from the pool, leading to chaos Tests: ran SendEntityUpdates perf test (gonna submit in a bit)
13 Days Ago
Update: Jobs 4 - intercept exceptions from SendAsSnapshot/ShouldNetworkTo and log once per task - Also if ToStream threw, don't save the resulting buffer as a network cache, as that would poison everything Instead of bubling them all up to the top like usual, handle locally by just skipping sending the data, and report error once to avoid filling console Tests: booted into craggy with CCTV fix reverted, no more spam
13 Days Ago
Optim: Implement parallel serialization in Jobs 4 mode - fix CCTV_RC doing GetComponentInParent on an MT path, cache on init - add server.ParallelNetworkQueueBatchSize, controls how many players end up being batched in a task. Higher number - less tasks Offloading ShouldNetworkTo, serialization and sending all to worker threads. Main thread steals last task to run on main thread before spinning for other task completion. Tests: booted craggy, gathered resources, build a base, rode ahorse, shot a gun, drove a car, heli, zipline, built a boat, used codelock
14 Days Ago
Update: rewrite ToStreamForNetwork to be thread safe - EntityMemoryStreamPool is now a concurrent queue Now, theoretically, we just throw it at threads and drink champagne Tests: craggy, built a base and checked decay timer
14 Days Ago
Update: initialize every SaveInfo with ThreadSafeTime.TakeSnapshot - also removed some jobs 2 code I missed previously Tests: on craggy rode a horse, built a base, checked decay timer was updating as I added/removed resources
14 Days Ago
Bugfix: avoid multiple BuildingPrivilege.CalculateProtectedMinutes calls in a frame for 1 entity Atomic latch wasn't correctly checking if it was updating from an old value only, so we could CompareExchange(1,1,1) and pass Tests: none
14 Days Ago
Update: avoid Time calls in BasePlayer.GetUnderwearSkin - UnderweatManifest now initialized in ServerMgr.StartServer Tests: switched to jobs 4 and toggled underwear
14 Days Ago
Update: in UseParallelSaves mode, Ragdol component samples transform handles Tests: on playground enabled Jobs 4 and ragdolled a bunch of times
14 Days Ago
Update: use handles to get pitch and yaw rotations for AttackHelicopterTurret in UseParallelSaves mode - amended test to cover turret saving path Tests: TestMTSave pass
14 Days Ago
Update: move OrientableLight interpolation invoke from Save to rpc + ondeply Scheduling invokes won't be safe in MT Tests: none
14 Days Ago
Update: avoid transform call in TravellingVendor.Save when it's following a spline Tests: none
14 Days Ago
Update: move Privelege caching from DisplayingBoxStorage.Save to OnPrivelegeUpdated We can't have it in Save as it is self-modifying and can call Vis.Entities - lets see how this holds Tests: none
14 Days Ago
Update: force TimeZone caching in WipeTimer.ServerInit While smashing TestMTSave(WipeTimer) I saw it NRE while resolving timezone. Couldn't repro again, but this should make it safe Tests: none, trivial change
14 Days Ago
Update: get rid of WipeTimer rounding to second, just pass DateTime from external source Old version would always have a sporadic fails when serialization test would run across second boundary, this way we can control it in tests Tests: a bunch of times for hacked version of TestMTSave(WipeTimer) that has 1k serialization tasks
15 Days Ago
Update(tests): add various missing TestServer setup and unit testing bypass for entity logic Tests: ran all TestMTSave, no sporadic failures, except WipeTimer - guess my prev fix didn't work >.>
15 Days Ago
Update: made MarketTerminal.Save MT friendly - get rid of TimeUntil aliases from Entity.proto - ran protobuf gen Doesn't need protocol update, as the underlying type/serialization doesn't change Tests: TestMTSave - all 636 tests pass, though gotta work on cleanup consistency
15 Days Ago
Update: WipeTimer now returns time rounded to a second No change for gameplay, but makes serialization tests consistent Tests: 20 runs of TestMTSave(WipeTimer), all pass
15 Days Ago
Update(tests): TestMTSave - move protobuf serialization to worker threads to catch more invalid API usages Revealed 2 failures Tests: ran all TestMTSave - MarketTerminal (TimeUnitl) and WipeTimer(missmatching stream) failed
15 Days Ago
Bugfix: avoid Time call in ChickenCoop.Save to make it MT friendly - added chicken as part of test setup to trigger this path Tests: TestMTSave pass
15 Days Ago
Update: BasePlayer - don't mutate own model state on save We modify the copy as we send it, and the original value should be modified on every tick, so should be safe Tests: none, trivial change
15 Days Ago
Update: make ItemBlueprint.FindBlueprint MT friendly GetComponent is not thread safe, so caching item->blueprint pairs at init time Tests: setup TC, made sure it has right upkeep calculated
15 Days Ago
Bugfix: BuildingPrivlidge(sic) - add GetOrUpdateProtectedMinutes that's MT safe and does a bit of a cheeky If we end up sending this entity to many players in 1 frame, it will update the cached protected minutes only for 1 player, and the rest are in limbo if they got old or new value. This gives us same perf as original lazy-eval solution. Tests: TestMTSave - got 0 fails!
15 Days Ago
Update(tests): patch MapMarkerMissionProvider Tests: TestMTSave passes (down to 2)
15 Days Ago
Update: TestServer now initializes PaintballColorLookup.instance Tests: TestMTSave - 5 -> 3 fails
15 Days Ago
Bugfix: make TravelingVendor.Save MT friendly - get rid of wheel flags processing, they were updated on server and sent over, but not used - cache linear velocity every fixed step (we're missing on interpolation, but we only send the snapshot every fixed update anyway) - use manually interpolated steeringAngle instead of querying the wheel collider Tests: TestMTSave(down to 5 remaining), ran TravelingVendorTest scene and looked at the vendor as it drove around
15 Days Ago
Bugfix: move tin can updates out of Save, as it's not MT safe Tests: TestMTSave and placed it on the ground, walked over and opened inventory
15 Days Ago
Update(tests): TestServer now also initialized TrainWagonLootData and Translate classes Tests: TestMTSave - 13 -> 7 fails
15 Days Ago
Bugfix: batch of bugfixes to Save being not MT safe - removed more Time dependency - replaced Transform access with TransformHandle bypass Tests: TestMTSave - 20 -> 13 fails
15 Days Ago
Bugfix: move Signage.EnsureInitialized from Save to ServerInit, as it's not MT safe Tests: TestMTSave - 25 -> 20 fails
15 Days Ago
Bugfix(tests): batch of patches for unit test spawned entities to avoid NREs in Save Tests: TestMTSave - 28 -> 25 fails
16 Days Ago
Bugfix: move CarvablePumpkin.EnsureInitialized out of Save, since it's not thread safe Tests: TestMTSave(CarvablePumpkin) and spawned and carved one on playground
16 Days Ago
Bugfix: batch of Transform replacements with TransformHandle in save code when using Jobs 4 Tests: TestMTSave - 32 -> 29 fails
16 Days Ago
Bugfix: batch of replacement for Time usage with ThreadSafeTime Only 1 skipped out for now, BuildingPriviledge - that one does lazy-eval, which is problematic Tests: TestMTSave - 42 -> 32
16 Days Ago
Bugfix: BasePlayer - avoid Time.time when evaluating mortarCooldown There's one more issue to resolve, but it doesn't affect unit tests, will resolve later Tests: TestMTSave - 59 -> 42 fails
16 Days Ago
Bugfix: vehicle related Time api fixes - TimeSince and TimeUntil now have a member method allowing to calculate from passed time (to avoid Time.time invoke) - TrainCar uses GetNetworkTime(ThreadSafeTime) overload Tests: ran TestMTSave, 74 -> 59 fails Tests: TestMTSave
16 Days Ago
Bugfix: don't use cached fuel fraction, just calculate it when saving Avoids TimeUntil sample, which isn't safe in MT Tests: TestMTSave(AttachHelicopter) pass
16 Days Ago
Update(tests): another small batch of patches and skips that I missed Tests: TestMTSave 81 -> 75 failures
16 Days Ago
Bugfix: BaseNPC - fallback to original GetNtworkRotation implementation for server side entity It knows how to fetch local rotation in MT-safe way Tests: TestMTSave - 94 -> 81 failures
16 Days Ago
Update(tests, editor): last batch of patches and bypasses to spawn entities - Renamed Prefabs editor script into PrefabTools, as it was conflicting with PRefabs.Misc.GhostShip I can finally get to fixing save issues for MT Tests: relevant TestMTSave pass
16 Days Ago
Update(tests): batch of various patches and prefab spawn skips Got about 10 patches to apply before starting to fix saving for MT Tests: relevant TestMTSave pass
16 Days Ago
Update(tests): skip marker spawning in tests for DeliveryDrone Tests: TestMTSave(DeliveryDrone) pass
16 Days Ago
Update(tests): patch GraveyardFence Tests: TestMTSave(GraveyardFence) pass
16 Days Ago
Update(tests): patch StringFirecracker Tests: TestMTSave(StringFirecracker) pass
16 Days Ago
Update(tests): patch CookingWorkbench Tests: TestMTSave(CookingWorkbench) fails on Save now (realtimeSinceStartup)