Genebris Posted May 14, 2017 Share Posted May 14, 2017 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 Quote Link to comment Share on other sites More sharing options...
macklebee Posted May 14, 2017 Share Posted May 14, 2017 I would expect 100 rigged crawlers to have a more significant expense when moving than 100 collapsed crawlers. The rigged crawler has 24 bones, so the engine is having to update not just 100 models but 2500 entities when you perform a Move(). Same idea with the navmesh navigation. And it may be worse with the character models you are trying- how many bones do they have? Then add animation ontop of that... One way to lessen the animation costs is to perform animation only in the Script:Draw() function. The only thing that might lessen the navmesh navigation is if Josh implements model LOD's at some point (like we had in LE2) - where at some distance the model can be swapped for a non rigged version of the model. As far as FPS though - that's very subjective and will vary from computer to computer, but IMO if you can still achieve a fairly stable 60 fps then you are probably alright. And in some games, you might not need it that high, depends on the game/gameplay, etc... 2 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Genebris Posted May 14, 2017 Author Share Posted May 14, 2017 I'm getting 60 FPS on a decent computer with pretty much empty scene and 30 characters moving on navmesh. I don't think it's a good result. After adding level geometry and lighting it will become 30 if not less. I can reduce draw distance and shadow distance but it doesn't help, FPS is low even when characters aren't rendered. And this scene is even without animations. Good idea about switching to non rigged models, I'll try that. Quote Link to comment Share on other sites More sharing options...
macklebee Posted May 14, 2017 Share Posted May 14, 2017 http://www.leadwerks.com/werkspace/blog/1/entry-1866-common-bottlenecks/page__st__20#commentsStart\ ... and you would probably save more performance with bones than with reducing polygons, although I would do both. You could disable the skeleton at the wrist and ankles at lower resolutions, and the mesh would just be weighted to the 100% to the parent bones. Of course this would do nothing for performance when a lot of characters were immediately surrounding you. I don't recommend trying to make Left 4 Dead with Leadwerks, but if someone develops a commercial game that heavily uses a lot of characters onscreen at once it is something I will try my best to support. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Einlander Posted May 14, 2017 Share Posted May 14, 2017 On my system any more than four skinned characters causes massive slowdowns. 1 Quote Link to comment Share on other sites More sharing options...
tournamentdan Posted May 14, 2017 Share Posted May 14, 2017 A couple things to remember here. If you are going to have a lot of characters moving about. You would be best suited by creating an LOD system for them. It would help out tremendously. Reducing shadow quality can help. Also, the end goal for your games fps should be around 60. Game development usually consists of building the world. Then finding ways for it to perform around 60 fps. 1 Quote Link to comment Share on other sites More sharing options...
Genebris Posted May 14, 2017 Author Share Posted May 14, 2017 Documentation says that hidden entity won't be updated when parent moves, but I tried hiding the bones or entire model and it didn't help whatsoever. Is it correct behavior or a bug? How can I switch from rigged model to non rigged if not by hiding the model with bones? http://www.leadwerks.com/werkspace/page/api-reference/_/entity/entityhide-r181 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.