12,954 Commits over 2,345 Days - 0.23cph!
Make cooking tests editor only for now
Update tests to better reflect new update flow
Cache HasAttachedStorageAdaptor
Don't mark items as dirty every update, only when they pass a 5s increment
Eliminates most of the MarkDirty calls and brings the 1000 oven test case under the 0.25ms budget some of the time
Convert ovens to a persistent work queue, budgeted to 0.25ms by default
In the 1000 oven test case this caps out at processing around 40-50 ovens a frame
Added quick add paths for creating byproducts (charcoal) and cooking results (cooked meat or frags, sulphur, etc)
This skips creating a new item and triggering the MoveToContainer process if there is already a stack of that item that we can stack onto
Reorder ConsumeFuel so that the fuel item is only marked dirty once (was happening twice)
Takes the worst case oven cycle for 1000 ovens creating a new item in the same frame from 270kb alloc and 18.3ms to 0b alloc and 4.62ms
Added debug.spawnOvenStressTest, spawns 1000 ovens with wood and metal ore and turns them on
Basic cooking tests, checks smelting ore and cooking food on all ovens
Fixed tutorial island error
Added GetMaterialAtPosition to MeshTerrainRoot, hooked up to evaluate when a position is in the deep sea
This solves footstep sounds and impact fx on the deep sea islands not working as expected
Had to emulate the SetupSplatLookup process from TerrainSplatMap
This will be skipped on the server as MeshTerrainRoot is an IClientComponent, which I believe should be fine since we largely use this for fx
S2P all islands
Fixed GroundWatch not working on small ramps
Merge from main
Merged PlayerModel.IK.cs and party_hat.prefab automatically
Merge from naval_update/industrial_optim
Rework buffer transfers, all tests now pass
Fixed a bunch of tests, buffer transfers still failing
Added 15 industrial tests to the test suite
Covers basic item transfers, splitting, filtering and filter fail/pass IO passthrough scenarios
Parse the conveyor's filters into item/blueprint/category dictionaries for faster lookups
Takes 800 filter checks from 1.4ms to 0.12ms
Disable pipe shadows at 25% of the cull distance
Cuts out a lot of shadow casters on big industrial bases
Big scary industrial conveyor refactor
Main goal here is to try and reduce how many loops are inside loops, as this scales poorly with large item containers (every slot from every input container is iterating over every slot on every output container)
Do a single prepass over all of the input items and run them through the conveyor filters, resulting in a single list of items that we can process, then attempt to move them to the output containers
Improved GetTotalItemAmount as this was a major time sink when using filters with min/max amounts. Now iterates over the items directly rather than using GetSlots (which triggers another full loop over the container for every slot)
Added an IEqualityComparer to ItemDefinition that just compares itemid, should speed things up when comparing ItemDefinitions
Wrapped the new time tracking in editor defines
TC's now cache their allowed construction items in a ListHashSet for faster checks
Not really worth doing in normal circumstances but it seems common to have junk items attempting to transfer into a TC constantly, this saves about 0.01ms on each attempt
Added an Input and Output item list that is populated during a conveyor move, allowing us to read and write items faster without having to use GetSlot (which could potentially iterate over the whole container each call)
Restructure some of the iterators in IndustrialConveyor.Move to iterate over the item list directly instead of using GetSlot
This removes all usages of GetSlot in the conveyor move system which can be called over 3k times in a bad conveyor move
Added a shortcut for LookAtIOEnt to resolve what item a storge cotnainer is attached to when holding the wire tool, resolves the multi second freeze in the editor (was faster in builds, but this should still be faster)
Fix GetUnmountedWaterFactor NRE
Still run UpdateCelestials in headless mode (needed to set IsDay and IsNight on the server which things like solar panels use)
Fixed magnet crane not marked as Can Sleep (I swear I did this last week)
Early return from the DroppedItem underwater check if the attached rigidbody is sleeping (it's unlikely to change submerged state while sleeping)
Removed Vis.Entities from the artificial light and temperature calculations for growables, now queries a Grid of light and temperature sources
These paths are now completely physics free
Merge from relationship_optim
Added PersistentObjectWorkQueueListBacked, a new version of PersistentObjectWorkQueue that can be provided with a separate list to iterate over
Handy for situations where we don't want to maintain a separate list of objects to iterate over, we can now just provide a list and the work queue will iterate over it
Doesn't have Add or Remove methods as it only reads the list
Updated RelationshipUpdateQueue to iterate over player list instead of a separate, identical list
Added an experimental fast path to UpdateAcquaintancesFor that checks the server occlusion state to see if two players can see each other rather than raycasting
Much faster than a raycast, although it will still fall back to that if the server doesn't have occlusion enabled, can be disabled with BasePlayer.allowRelationshipServerOcclusion
Move UpdateContacts in RelationshipManager to a PersistentObjectWorkQueue, budgeted to 0.05ms by default (BasePlayer.relationshipUpdateQueueFrameBudgetMs)
This used to iterate over every player on the server every 1s so would scale poorly, will now gradually update relationships over time
Merge from botcollider_optim
Replace ServerUpdateBots with a PersistentObjectWorkQueue
In a test of 500 bots on the server (about baseline on an empty server) this was taking 0.25ms because it looped over every entity, every frame. The internal logic is time gated so it would only actually check/modify 5-15 each frame
WorkQueue is budgeted at 0.05ms and goes through as many as possible in a frame within that window
As this might result in some bot colliders temporarily being the wrong size for a frame or two I've added manual forced collider size updates when a player state changes that we are otherwise checking in the update process (mounting/dismounting/wounding/crawling) to minimise any delays
Don't do any processing for UpdateReputations if the player's reputation state hasn't changed
Readd nextPlayerCheck to JunkpileWater, we don't need to be running this check every frame on every junkpile
Adjust TOD headless check to work via compiler defines, it seems liike cameras are still present on the server (although not doing anything) so it thought it was running on the client
Should save 0.1ms a frame