#Hello! How would I go about making an object pool in netcode for entities?

1 messages · Page 1 of 1 (latest)

sharp gale
#

I'm trying to spawn a LOT of units for an RTS (~5000) and was wondering about the best way to do this. Would it be to make an object pool, spawn them on game start, then activate and deactivate them as needed?

Thanks!

tender bobcat
#

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

sharp gale
#

are they pooled/allocated on the network as well?

tender bobcat
sharp gale
#

what's the best way to reduce lag when spawning thousands of units?

tender bobcat
sharp gale
#

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