Jump to content

FPS lock


Slimwaffle
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...