12,930 Commits over 2,345 Days - 0.23cph!
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
Marked FishSwarm as client only, was profiling as 0ms but it was still running a coroutine so might as well nuke it on the server
Merge from main
Only conflict is cake.entity, auto resolved
Remove SimpleFloatingEntity and associated prefabs, they were never used
Magnet crane can now sleep
Seems to take a couple of tries to actually settle once a player dismounts
Had to add some box colliders to replace the wheels otherwise the crane would sink into the ground once the wheels were disabled
The one magnet crane on the map was taking 0.28ms each fixed update even when not in use and was the slowest part of the fixed update, now takes 0.06ms once sleeping
Merge from farm_plant_respawn_fix
Reduce underwater_drag_budget_ms default to 0.05 (was 0.1)
Disable nav mesh obstacle carving on LootContainers spawned in the deep sea (can be controlled with debug.disableLootNavObstaclesInDeepSea convar)
Strip all NavMeshObstacles on floating cities
JunkpileWaterWorkQueue frame budget now defaults to 0.05ms (was 0.25)
▆▉▇▇ ▌▊▄█▆ ▌▍█▊▊▇ ▌▍▇▌▄█▄ ▋▅▇▋▉ ▅▄▍
Merge from nav_optimisation
Bump radius to 200m just to be safe
Move the player check up to ScientistNP2 and disable the FSM as well
Don't run LimitedTurnNavAgent if there are no players within 150m
Check every 5s
Static planter boxes in the deep sea (farm barge) spawn their plants ripe and will respawn them every 2 minutes
Fix casino npc not hooked up to vending machine
S2P all floating cities
Adjust scale of deep sea ghost ship markers
Fixed warning spam on space LR
Merge from lr_canvas_rework
Hooked up low ammo and burst indicators
First pass on overhauling the space LR readout to work with regular renderers and not canvases as canvas world space rendering completely breaks down at world edges and in the deep sea
Baked out a texture for the LCD font, made a material and quad per digit