I am currently working on a zombie system with goal of achieving 1000 zombies at 144+ FPS. I have optimized their behavior, and replication, but got stuck with movement as I am sitting at 45 FPS.
I use BulkMoveTo for movement, it takes ~6 ms a frame, which is excessive, but the engine also has notifyVisuallyMovingPrimitives taking up ~3 ms of additional frame time. Rendering itself takes ~6 ms. To reach 144 FPS, I got ~7 ms to finish a single frame, I am currently way above that.
Movement code boils down to this snippet:
local parts: {BasePart} = {}
local cframes: {CFrame} = {}
local function onUpdate()
table.clear(parts)
table.clear(cframes)
local index = 0
for _, zombie in zombies do
if shouldUpdate(zombie) then
index += 1
parts[index], cframes[index] = zombie.Root, zombie.CFrame
end
end
workspace:BulkMoveTo(parts, cframes, Enum.BulkMoveMode.FireCFrameChanged)
end
The shouldUpdate function is used to throttle updates to reduce the number of zombies that are updated per frame, it takes distance and visibility into account.
Before you reply:
- I use custom R6 rig that looks and functions like one, but it is optimized and designed to work without
Humanoid.
- I do NOT use
Humanoidinstance. - All parts have their
CanCollide,CanQuery,CanTouch, andAudioCanCollideset tofalse. - All parts are set to be
Masslessand have theirCollisionFidelityset toBox. - The
PrimaryPartis set to the root part, which isAnchoredand hasRootPriorityof1. - Assemblies are created by the client, fully client-sided.
- Each assembly is made up of 18 instances, specifically:
MeshPart(10x)Motor6D(6x)WeldConstraint(3x)SurfaceAppearance(5x)AnimationController(1x)Animator(1x)Model(1x)
- I tried using Parallel Luau but
BulkMoveTois not thread-safe. - Some important
Workspaceflags:SignalBehavior=DeferredRenderingCacheOptimizations=EnabledClientAnimatorThrottling=Enabled
- What is
notifyVisuallyMovingPrimitives, and what can be done to lower its frame time? - What can be done to lower
BulkMoveToframe time? - Are there any other optimizations I can employ without reducing the zombie count?







