#Hello! How would I go about making an object pool in netcode for entities?
1 messages · Page 1 of 1 (latest)
Entities are already pooled by default. You really only want to avoid structural changes so using Enableable Components is better than add/removing entities or components
are they pooled/allocated on the network as well?
Its just how entities works, they are allocated in 16kb chunks I believe. If you Instantiate the ghost prefabs, they will be replicated to the clients
what's the best way to reduce lag when spawning thousands of units?
Are you seeing lag when instantiating ghost prefabs? You can set the Importance of ghosts to each client depending on distance so ghosts farther from the player update less frequently
yeah I am - is that just the importance field on the ghostauthoring component or is there ways I can tweak it? Currently have them set at 1 - but there are only the one prefab for now