branchrust_reboot/main/autoturret_improvementscancel
14 Commits over 0 Days - ∞cph!
- Fixed turret not starting with Vector3.up when offline - still needs a little tweak
- Constantly face to correct target
- If not being controlled turn off client idle tick
Ensure a turned off turret won't try to predict movement on the clientside
Run rotate at 10hz rather than 20hz.
Run send aim direction at 10hz rather than 20hz.
Run look for targets at 5hz rather than 10hz.
main -> autoturret_improvements
Split Autoturret into multiple work queues:
Ammo,
Scan,
Tick
Keep Aiming/Rotating code in the 66hz loop
Move TargetAquisition/Thinking/Firing to a 10hz work queue scheduling loop
Around a 0.3ms in improvement (in spikes) on idle with 500 turrets.
Split off autoturret ammo updating into its own queue
No need to sort rays - we are looping over them all anyway
I'm sure theres some minor concerns with the relevant collider 'usually' being first, but the loop isnt the expensive bit
The scale of the sorting is
Don't need to check peekers if the target isn't a player. Should save us some cycles
main -> autoturret_improvements
Fixed turrets not following proper aim direction if it doest have a target (on the server code), so its ready to auto snap when we swap back to the server auth side
- Compile fix
Dirty aim direction angle changed from 0.03 (it basically never ran) to 1
- Instantly reduced turret snapshots when aiming to a target
- Lerped on the client anyway so it doesnt make too much of a difference apart from reducing packets
Make the Autoturret idle animation run only on the client.
This prevents turrets constantly sending network aim direction update packets constantly even when they have no target or are around no players
Saves roughly 20KB/s for our big turret base save