Herobot Posted June 23, 2017 Share Posted June 23, 2017 I've been having performance problems with my Leadwerks projects since the 4.4 update. Some of my levels are experiencing massive fps drops, sometimes locking up completely, when they ran at 60 fps on 4.3. I can't pinpoint the cause but it seems to tied to the number of models in the map, any more than 4 (with or without scripts) seems to cause the slowdown. The slowdown seems worse as the player gets closer to the models. I've also had trouble with crashes using self.entity:Release(). Once released, the game crashes with a "game.exe has stopped working" message. It seems to happen most when the entity was copied with control+C in the editor. Has anyone else experienced these problems? What could I look for to try and fix them? Quote Link to comment Share on other sites More sharing options...
Christian Clavet Posted July 1, 2017 Share Posted July 1, 2017 I have a similar issue with NPCs that are seeing the player and become active, then game "lock" for less than 1 second. If they don't see the player, the FPS maintain. I'll try to see if I put a mesh model with no script if it still will do this. EDIT: Done a quick tests with some props in my 1024 sized map and still good. No frame drop when I'm far or near them. This only happen with NPC for me. EDIT: Hi, most of the problems I had came because I was using an old map (updated at each release). Did you tried to make a new project and new map using Leadwerks 4.4. It might fix the issue you have... 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 5, 2017 Share Posted July 5, 2017 Overall, the post-processing shaders (especially SSAO) are going to be slower in version 4.4 because they were updated to give better quality. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Herobot Posted July 8, 2017 Author Share Posted July 8, 2017 I've done some more digging on this problem. On 2017-07-01 at 1:45 PM, Christian Clavet said: I have a similar issue with NPCs that are seeing the player and become active, then game "lock" for less than 1 second. If they don't see the player, the FPS maintain. I'll try to see if I put a mesh model with no script if it still will do this. EDIT: Hi, most of the problems I had came because I was using an old map (updated at each release). Did you tried to make a new project and new map using Leadwerks 4.4. It might fix the issue you have... I've tried making a completely new project and map, unfortunately both the slowdown and crashing persist. Although i did discover that my enemy models were still using the old animation manager function, switching them over to using entity:PlayAnimation seemed to delay the slowdown after they aggro the player. On 2017-07-04 at 6:32 PM, Josh said: Overall, the post-processing shaders (especially SSAO) are going to be slower in version 4.4 because they were updated to give better quality. Are these shaders on by default, and is there a way to turn them off so I can see if it affects the slowdown? I've also discovered that the crash with entity:Release seems to occur when an entity that's the child of a model calls the function that releases the crashing entity. There's no crash if there's new keyboard or mouse input in between calling the function and the entity:Release. I can get around the crash by using entity:Hide instead of entity:release, however in debug mode this causes a different crash: Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2017 Share Posted July 8, 2017 2 hours ago, Herobot said: I've done some more digging on this problem. I've tried making a completely new project and map, unfortunately both the slowdown and crashing persist. Although i did discover that my enemy models were still using the old animation manager function, switching them over to using entity:PlayAnimation seemed to delay the slowdown after they aggro the player. Are these shaders on by default, and is there a way to turn them off so I can see if it affects the slowdown? I've also discovered that the crash with entity:Release seems to occur when an entity that's the child of a model calls the function that releases the crashing entity. There's no crash if there's new keyboard or mouse input in between calling the function and the entity:Release. I can get around the crash by using entity:Hide instead of entity:release, however in debug mode this causes a different crash: Please post an example project I can test. I would like to examine this. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Herobot Posted July 8, 2017 Author Share Posted July 8, 2017 15 hours ago, Josh said: Please post an example project I can test. I would like to examine this. Sample project (new project/map): https://www.dropbox.com/sh/cilz45238qotaho/AAAmvDfzZBKZpUTTdcsL-OT3a?dl=0 Hope this helps! Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2017 Share Posted July 8, 2017 20 minutes ago, Herobot said: Sample project (new project/map): https://www.dropbox.com/sh/cilz45238qotaho/AAAmvDfzZBKZpUTTdcsL-OT3a?dl=0 Hope this helps! When running it I get "Failed to load map demo2.map" Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Herobot Posted July 8, 2017 Author Share Posted July 8, 2017 4 minutes ago, Josh said: When running it I get "Failed to load map demo2.map" My bad, I think It should be fixed now https://www.dropbox.com/sh/cilz45238qotaho/AAAmvDfzZBKZpUTTdcsL-OT3a?dl=0 Quote Link to comment Share on other sites More sharing options...
macklebee Posted July 8, 2017 Share Posted July 8, 2017 The only crash i get is when I melee the boxes. But I can see if i let this run for awhile there will be issues as the script memory is just constantly rising even when not doing anything. My guess that the issues are somewhere inside the 3 separate player entities with their own scripts you have sitting ontop of each other? 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...
Herobot Posted July 8, 2017 Author Share Posted July 8, 2017 8 minutes ago, macklebee said: The only crash i get is when I melee the boxes. But I can see if i let this run for awhile there will be issues as the script memory is just constantly rising even when not doing anything. My guess that the issues are somewhere inside the 3 separate player entities with their own scripts you have sitting ontop of each other? That could have something to do with it. I just tried making the weapon a child of a separate crawler model, and the crash doesn't occur (whether the separate model has a script or not). I also tried having the weapon use a global variable to tell if it should deal damage, with it's only link to the player being it's child, and the crash still occurs. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2017 Share Posted July 8, 2017 48 minutes ago, Herobot said: That could have something to do with it. I just tried making the weapon a child of a separate crawler model, and the crash doesn't occur (whether the separate model has a script or not). I also tried having the weapon use a global variable to tell if it should deal damage, with it's only link to the player being it's child, and the crash still occurs. Are your saying a child is deleting its own parent in a script? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Herobot Posted July 8, 2017 Author Share Posted July 8, 2017 2 minutes ago, Josh said: Are your saying a child is deleting its own parent in a script? I don't think that's the case. --This is used for hit detection for the players weapon. Script.playerModel = nill function Script:Start() --empty-- System:Print("Ref Count: "..self.entity:GetRefCount()) end function Callback(entity,extra) if entity.script ~= nil and entity.script.targetable ~= nil then entity.script:Hurt(1, extra) elseif entity.script ~= nil and entity.script.repairable ~= nil then entity.script:Repair(1, extra) end end function Script:UpdateWorld() if self.playerModel.script.attacking == true then local aabb = self.entity:GetAABB(Entity.GlobalAABB) local v = Vec3(1,0,0) local world = World:GetCurrent() world:ForEachEntityInAABBDo(aabb,"Callback",self.entity) end end This is the player weapon script. (self.playerModel is set during the start function of the character controller) What i tried to do is while attacking, the weapon checks for entities in it's aabb, and if they have a script, and a self.targetable or self.repairable variable then it calls the entity's Hurt script. This worked in 4.3, and i double-checked to make sure that the weapon's parent (the player model) doesn't have a self.targetable or self.repairable variables. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2017 Share Posted July 8, 2017 Okay, I fixed one thing that would cause the blue boxes to crash. The Leadwerks boxes are crashing because when they are hidden they get removed from the list that you are iterating through in the ForEachEntity command! What I can do is make a copy of the list and iterate through that, to make this safer. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Herobot Posted July 8, 2017 Author Share Posted July 8, 2017 17 minutes ago, Josh said: Okay, I fixed one thing that would cause the blue boxes to crash. The Leadwerks boxes are crashing because when they are hidden they get removed from the list that you are iterating through in the ForEachEntity command! What I can do is make a copy of the list and iterate through that, to make this safer. Wonderful! Thanks for looking into this Josh and everyone else. 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.