TheConceptBoy Posted June 26, 2019 Share Posted June 26, 2019 Further testing with leadwerks. I've got to be doing something wrong here. If you press "E" you will create instances of an enemy object, they will be positioned at the T pose character models. There is also a 3rd character with an Actor that is used as the starting template to be Instanced from. There's absolutely no code inside these Actors and yet 6 barely objects in and the performance Tanks. I was looking to spawn anywehre betyween 15- 30 of these Would anyone mind taking a look? I've removed pretty much all objects, effects and anything that could possibly cause this. Some forum posts did say they that for repeated objects you should Instance them, which is what I did. GTX 750, Core 2 Quad Q8300. 8GB of RAM. Any other project test I've done in leadwerks, so far ran like butter. But this one, that involves Actors is severely laggy. I've got to be doing something wrong with handling actor instances. PS: This is a C++ Project so make sure yo Consult the Visual Studio Solution. EDIT: I have uploaded an updated project (Overrun_2). I speculated that the tanking performance could be due to the collision objects getting stuck inside one another and the collision solver is getting overloaded. So I've added a little offset to make sure NO instances are created inside one another or inside the dummy placeholder mesh. Unfortunately still the same results are observed. Overrun.zipOverrun_2.zip 2019-06-26 14-43-25.mp4 Quote Link to comment Share on other sites More sharing options...
reepblue Posted June 26, 2019 Share Posted June 26, 2019 Do these models have bones? If so, might be a reason why. We had a lot of people had issues with models with a full body rig. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 Just now, reepblue said: Do these models have bones? If so, might be a reason why. We had a lot of people had issues with models with a full body rig. yes, these are rigged models. Is there another way to animate characters that I don't know about in LW? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted June 26, 2019 Share Posted June 26, 2019 The character.fbx only has 25 bones, which is very reasonable. That shouldn't be the problem. https://www.leadwerks.com/community/topic/17544-character-fps-test/ Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 2 minutes ago, gamecreator said: The character.fbx only has 25 bones, which is very reasonable. That shouldn't be the problem. https://www.leadwerks.com/community/topic/17544-character-fps-test/ Makes me wonder indeed. An old game like L4D on this very same machine could handle dozens of zombies so I wonder what's happening under the hood that's making them so expensive. Quote Link to comment Share on other sites More sharing options...
Rick Posted June 27, 2019 Share Posted June 27, 2019 From the little text I see in your editor you're in debug mode? Debug mode is horrible. Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 12 minutes ago, Rick said: From the little text I see in your editor you're in debug mode? Debug mode is horrible. Thanks for the suggestion. How do I disable debugging mode? Also what is so horrible about it that impacts the performance so much? Is it the Print to console commands? Quote Link to comment Share on other sites More sharing options...
Rick Posted June 27, 2019 Share Posted June 27, 2019 I don't know exactly what it is about debug mode but don't ever run it and expect good results. It's really bad for that. In VS there should be a dropdown in the toolbar that says Debug and you can change it to Release I think. 1 Quote Link to comment Share on other sites More sharing options...
wadaltmon Posted June 27, 2019 Share Posted June 27, 2019 43 minutes ago, Rick said: I don't know exactly what it is about debug mode but don't ever run it and expect good results. It's really bad for that. In VS there should be a dropdown in the toolbar that says Debug and you can change it to Release I think. Can confirm, ran this project and spawned 33 characters before my frames went down below 30. On debug, I spawned maybe 12 and my framerate went down to single digits. Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 Just ran in release mode. Got the same result as you two, suddenly can spawn hordes of these things on my 10yo machine. What in the name of optimization is going on here? @wadaltmon lmao if Janko was here he'd have a stroke... Also things like timers and counters are totally wrong in release mode, some are too fast. So Debug mode can't be relizably used then, otherwise I'm gonna have to re-code half of the game's time critical events. 1 Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 As the matter of fact, the more Entities I add, the slower my time critical counters are operating, Like camera wobble that uses wibble = sin(wobble_time) however my player movement speed stays the same, as if internally compensated by delta time. This is bizarre. Quote Link to comment Share on other sites More sharing options...
wadaltmon Posted June 27, 2019 Share Posted June 27, 2019 1 minute ago, TheConceptBoy said: As the matter of fact, the more Entities I add, the slower my time critical counters are operating, Like camera wobble that uses wibble = sin(wobble_time) however my player movement speed stays the same, as if internally compensated by delta time. This is bizarre. I remember you were talking about animation time not being 1-to-1 from Blender to LW. Maybe bone-based animation does not abide by delta time, but the physics system does. Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 2019-06-26 22-00-15.mp4 Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 Just now, wadaltmon said: I remember you were talking about animation time not being 1-to-1 from Blender to LW. Maybe bone-based animation does not abide by delta time, but the physics system does. Well actually notice how even as the frame rate drops the hand sprint animation pretty much stays the same? Notice the head bob starting way too fast than what I based it off in the debugging (close resembled when I spawned some entities.) Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 1 hour ago, Rick said: I don't know exactly what it is about debug mode but don't ever run it and expect good results. It's really bad for that. In VS there should be a dropdown in the toolbar that says Debug and you can change it to Release I think. So do you use context and drawing variables as GUI items and widgets to the game context to debug? Quote Link to comment Share on other sites More sharing options...
wadaltmon Posted June 27, 2019 Share Posted June 27, 2019 6 minutes ago, TheConceptBoy said: Well actually notice how even as the frame rate drops the hand sprint animation pretty much stays the same? Notice the head bob starting way too fast than what I based it off in the debugging (close resembled when I spawned some entities.) You spawned your gun as a Model* and your enemies as Entity*. If you change that, does it make a difference? Quote Link to comment Share on other sites More sharing options...
Rick Posted June 27, 2019 Share Posted June 27, 2019 3 minutes ago, TheConceptBoy said: So do you use context and drawing variables as GUI items and widgets to the game context to debug? I mostly work in Lua so I do a lot of System:Print() statements. Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 5 minutes ago, wadaltmon said: You spawned your gun as a Model* and your enemies as Entity*. If you change that, does it make a difference? Enemies are spawned as models too though. The only place where I use entities is when I look through the world entity markers to place enemies on those markers. And that only happens when I press the keyboard key Quote Link to comment Share on other sites More sharing options...
gamecreator Posted June 27, 2019 Share Posted June 27, 2019 7 minutes ago, TheConceptBoy said: So do you use context and drawing variables as GUI items and widgets to the game context to debug? I do but I also use printf/cout to write to the console, which you can enable by right-clicking on your project name in the Solution Explorer, Properties, Configuration Properties, Linker, System, change SubSystem to Console. Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 I guess no spawning hordes of zombies for me then. Gotta use the resources sparingly. Puzzle games and tough enemies it is. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted June 27, 2019 Share Posted June 27, 2019 So what exactly is the problem now? I thought you said above that you could spawn more enemies once you switched to release. Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 27, 2019 Author Share Posted June 27, 2019 1 hour ago, gamecreator said: So what exactly is the problem now? I thought you said above that you could spawn more enemies once you switched to release. More yes. about 15 instances before the performance hit is bad enough to notice and bad enough to complain about if you paid for a game that ran like that. I'd really like to say it's due to my old hardware but at the same time a large part of my Steam library plays fine so. As the matter of fact. I can have a pretty packed level of static objects that run just fine. Add a few actors (since this is a zombie game) and it grinds below 15 fps. Engine should really be able to provide way more head room than than I believe. I have to experiment some more. Quote Link to comment Share on other sites More sharing options...
Daemoc Posted June 27, 2019 Share Posted June 27, 2019 If you can instance static geometry with the same kind of mesh complexity without this issue it would have to be the skinning performance. Leadwerks supports hardware skinning, and while that GPU is not great, it not THAT bad. One other test you could try, although tedious, would be to attach static meshes to each bone rather than using a skinned mesh. Preferably with objects that match the same poly count as the skinned mesh. That would isolate the skinned mesh performance from physics. Also, the hand animation to head bob de-sync might be caused by world update and physics update calls? Are both functions under the same update? Quote Link to comment Share on other sites More sharing options...
gamecreator Posted June 27, 2019 Share Posted June 27, 2019 If you give me a specific model with an animation (something basic, nothing fancy), I'm happy to test it for you using the program I set up in my other thread that I linked to above. I'm on a 780M right now. Quote Link to comment Share on other sites More sharing options...
wadaltmon Posted June 27, 2019 Share Posted June 27, 2019 2 hours ago, Daemoc said: One other test you could try, although tedious, would be to attach static meshes to each bone rather than using a skinned mesh. Preferably with objects that match the same poly count as the skinned mesh. That would isolate the skinned mesh performance from physics. @TheConceptBoy I think you've already done this with one instance. Is it possible to parent an existing or newly created model to a specific bone of an existing rig in LW? 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.