I have a huge FPS drop when moving rigged characters with simple Entity:Move method. The same mesh but collapsed in model settings causes no FPS drop.
100 characters on the top have bones. 100 characters on the bottom were collapsed. When moving bottom characters performance stays the same, when moving upper characters FPS drops from 500 to 100.
There is no lighting in the scene and character material uses not animated shader. So I think that the only difference is extra entities that are moving with rigged characters.
code:
function Script:Start()
chars = {}
for i=1,100 do
local e = Model:Load("models/crawler.mdl")
table.insert(chars, e)
e:SetPosition(math.random(0,10),0,math.random(0,10))
end
objects = {}
for i=1,100 do
local e = Model:Load("models/collapsed.mdl")
table.insert(objects, e)
e:SetPosition(math.random(0,10),0,math.random(-10,-20))
end
end
function Script:UpdatePhysics()
if window:KeyDown(Key.E) then
for k,v in pairs(chars) do
v:Move(-0.1,0,0)
end
end
if window:KeyDown(Key.R) then
for k,v in pairs(objects) do
v:Move(-0.1,0,0)
end
end
end
Can Anything be done about it? I don't need 100 characters, but when I tried 30 characters moving on the navmesh performance was very low compared to when they are standing still.
Project if you want to try: https://drive.google.com/open?id=0B5h7P9bq9NmIQmRDdGp1Y29LdFE