Slimwaffle Posted September 13, 2018 Share Posted September 13, 2018 Is there some kind of FPS lock or some code somewhere in the dafault scripts that is locking FPS. My game runs at 24 FPS on a 2gb card and exactly the same fps on a 4gb card. I need to find a way to unlock this framerate and let the gpu take over. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 13, 2018 Share Posted September 13, 2018 context->Sync(false) 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...
Josh Posted September 13, 2018 Share Posted September 13, 2018 If your game is CPU-limited, then the GPU won't make a difference. 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...
Slimwaffle Posted September 13, 2018 Author Share Posted September 13, 2018 Using context:Sync(false) causes crazy screen flashing because it affects all of the printed to screen commands in the post render (context) function and it messes with the menu. I just put the line of code in the world update function. Because when actually playing I want fps to unlock. When checked against task manager my game uses hardly any cpu and ram. And when I play it from steam. The more complex tasks that are memory dependant run super quick. Its purely FPS and GPU I am having issues with. Quote Link to comment Share on other sites More sharing options...
Slimwaffle Posted September 13, 2018 Author Share Posted September 13, 2018 Even turning off shadows does nothing to boost FPS. I can get FPS to drop easily but it never increases past 30fps. Quote Link to comment Share on other sites More sharing options...
Josh Posted September 13, 2018 Share Posted September 13, 2018 I can't diagnose a verbal description of a game I have never seen But I am happy to try the game out if you give me access to it. 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...
Slimwaffle Posted September 13, 2018 Author Share Posted September 13, 2018 Sure thing I will send you a steam key in private message. If you need access to the project itself let me know in private message. Quote Link to comment Share on other sites More sharing options...
Slimwaffle Posted September 14, 2018 Author Share Posted September 14, 2018 I have been doing some testing my end. It seems to be some kind of scene overload. Non scripted entities I can have as much as I want with very little impact. But prefabs of the same entites with scripts attached slow everything down significantly. I can load 100 or 200 prefabs not a problem and still get around 40fps. But when I try to generate the 1000 or 2000 I am aiming for this halves. I think I need to come up with a way to make the computer ignore entities until they are in range. I am thinking some kind of distance check to show and hide them. I'm just not sure on the best way to do it. Because a world loop in the UpdateWorld function would also slow the fps significantly. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted September 14, 2018 Share Posted September 14, 2018 You can use this function to get a list of entities that are visible: https://www.leadwerks.com/learn?page=API-Reference_Object_World_ForEachVisibleEntityDo Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted September 14, 2018 Share Posted September 14, 2018 If you're not already, you can also use instancing, that may help. Quote Link to comment Share on other sites More sharing options...
Slimwaffle Posted September 14, 2018 Author Share Posted September 14, 2018 This will sound stupid but what is instancing? Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted September 14, 2018 Share Posted September 14, 2018 Instancing An instance of an entity will use the same geometry data within the GPU. You load one main mesh, then instance it to create hundreds more, rather than copying each objects data. The GPU still has to render each object, but its data is gathered from one place rather than several. The terrain vegetation system uses instancing as to not use huge amounts of memory. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted September 14, 2018 Share Posted September 14, 2018 I was under the impression that instancing is the default. Meaning, if you load goblin.mdl to model1 and then the same to model2, model2 will automatically be an instance. And you need to use the copy function to force separate copies. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted September 14, 2018 Share Posted September 14, 2018 I'm not too sure... might need Josh to clarify... Quote Link to comment Share on other sites More sharing options...
Josh Posted September 14, 2018 Share Posted September 14, 2018 entity:Copy() = slow entity:Instance() = fast 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...
SpiderPig Posted September 14, 2018 Share Posted September 14, 2018 When loading models, by default each one is unique as if copied through entity:Copy() ? Quote Link to comment Share on other sites More sharing options...
Josh Posted September 14, 2018 Share Posted September 14, 2018 By default, instancing is always used. 1 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...
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.