branchrust_reboot/main/projectile_jobscancel
28 Commits over 30 Days - 0.04cph!
clarified water trace setup
Gather trace commands in a job, requires copying some data into a native container first but it's still twice as fast overall
Test: projectile tests all still passing
clear benchmark timers after recording results, stops accumulating time between runs
jobified transform readback for effect updating, still slow to update scaled renderers though
pooling HitInfo for Projectile DoHit and don't string concat for every ricochet fx fire
moved most of HitTest generation to a transform job
further batched projectile improvemenets
- jobified position/rotation writeback, 10x faster
- adjusted HitTest to only populate some fields once for a projectile's lifetime (based on flag reset when it is pooled), some improvements
Tests: all projectile tests passing
reworked PlayerCache into a generic StableObjectCache to re-use it for batched Projectiles, making use of it for reading batches of projectile transform data which speeds it up by roughly 8x-10x compared to going through managed properties (cached or otherwise)
Tests: re-ran all projectile and PlayerCache tests, adjusted to new interface
added batched water tracing and various supporting features
- GamePhysics.UseBatchedWaterRays convar to disable for perf comparison, will remove eventually
- NativeArray/NativeList expansion can optionally use power of two expansion
- Added native-friendly query structures for TerrainHeightMap and ShoreVectors, can add more querying functionality as needed but keeping it lean for now
- Modified test cases to be more lenient on float comparisons as Burst compilation introduces variance of around 1e-8 in position results on waves which is more than acceptable
fixed potential break in TraceWaterRays/TraceWaterSpheres logic that would cause casts to miss water traces if an earlier one had hit the max number of colliders
sharing more data between batched projectile effect processing - only accessing transform pos/rot once per projectile and only checking retrieving local player entity data once per batch
added Projectile.UseBatched ClientVar to switch between serial and batched tick for projectiles
Jobified trace-testing in HitboxSystem, also replacing local NativeArray helper function with existing Expand static extension
corrected InitializeVelocity on projectile to keep Projectile performance test consistent between runs (increased run-count)
Optim: reduced unnecessary Transform reads in batched position/rotation update, also added AddRange(BufferList<>) function to BufferList to change to that for marginally faster loop speed
Test: consistency tests passing with serial using old method still
Added extra sanity checks to projectile consistency testing
added missing effects update on batched projectiles and retiring into the prefab pool
clear static test field in pet-test teardown
cached native allocations, batched projectiles now save between 30% - 50% of the runtime compared to serialized in performance tests (gains increase with projectile count)
multiple significant fixes to GameTrace, new Projectile and GameTrace tests are passing but seeing a slight differences in projectile counts with performance test that's indicating some untested edgecases
initial pass on batched projectiles, functional except for LOS checks but failing consistency tests which needs more diagnosing
- added batch support to multiple tests for comparison