All Rust commits from Facepunch
Update: codegen Tests: none
Bugfix: fix invalid index assigned to a projectile on projectile removal from cache Copy paste mistake, happy we got unit tests Tests: ran ProjectileTests.TestConsistency - it passes
Merge: from main
Clean: consolidate player-related state cache growth to AddToPlayerCache Tests: compiles
Clean: make the code clearer around maintianing packed order Using better names for vars, easier to understand ifs and a safety assert Tests: compiles
Update(tests): add TestMovePlayer - bugfix for missing to copy an extra tick/reset point in TickInterpolatorCache.MovePlayer - added more docs to StableObjectArray Tests: ran new unit test
Optim: replace BasePlayer.SparsePlayers with PlayerCache.Objects now that indices always match packed order Tests: 2p on Craggy with disconnects of 2nd player
Update: repack player cache and dependent state as players are removed Should allow us to clean up a bit of indirection and optimize things further Tests: 2p session on Craggy with disconnects and being kicked for flying under terrain
Clean: projectiles now internally iterate over their cache rather than instance list Tests: unit tests, 2p on craggy
Update: ensure projectile stable indices are packed This simplifies code and opens up the door for better cache utilisation & simd processing, but currently savings are on the noise level Tests: unit tests + shot around player with 2 clients connected
Clean: cache span from ActiveTriggers.Objects Tests: none, trivial change
Merge: from main
Optim: Avoid double indirection when looking up active triggers - enabled by use of invalidating RemoveAtSwapback TriggerParent.StableIndex is only const during a frame, it now can change between frames Tests: built a 3-piece boat with a ladder, jumped around it
Update: StableObjectArray.RemoveAtSwapback can now optionally invalidate stable indices - added unit tests Should help us maintain packed state of dependent arrays - will start converting current use cases next. Tests: ran unit tests