Jump to content

Help me trace the unknown lag


L B
 Share

Recommended Posts

My game runs nicely at about 50-60 FPS (30/60 if full-screened). The FPS is constant, and the triangle count is always of about 250k-300k, which is perfectly OK for LE (yay us).

 

I have a spectator code and a third person controller code. I can switch between any of these while exploring my scene by pressing tab.

 

However, at RANDOM times (not coinciding with more triangles, a regular interval or a recurring operation), I get a major (-20 FPS) drop, for about 1 second. The movement gets jaggy then smooth again. This happens every 10 to 20 seconds.

 

It cannot be my scene or amount of triangles, because the drop does not occur depending on the amount of triangles on screen. (I get the lag at 100K tris jut as often than at 300K tris).

It cannot be my spectator code, because the drop occurs on the third person controller as well.

It cannot be my third person controller code, because the drop occurs on the spectator code as well.

It cannot be my networking, because it is on another thread and nothing happens at all in it. No packets sent or received.

It cannot be the creation of any class or object, as, well, nothing gets created in code at random intervals.

 

I highly doubt it is .NET or some kind of garbage collector that would act upon LE or my code. Again, nothing gets created at random intervals, and most of the code is static, so there wouldn't be any need for garbage collection. If you are a .NET performance hater, please ignore this sentence and move on as if I was coding in C++ or BlitzMax. I don't want to base the whole thread on a .NET performance debate. Actually, I had really smoothly running demos before with C#/.NET.

 

PLEASE (and I'm begging here) help me locate the source of this lag. It is extremely unpleasant and annoying, both on the eye and on gameplay, because it is not perpetual but "coming-and-going" randomly.

Link to comment
Share on other sites

So desperate I actually benchmarked it (see attachment). If you have Excel, I recommend you use it. It shows colors for the drops: red for the drop and green around it, to show that it worked fine before. If you don't, just open the CSV, and look for the lower values (20 FPS) between the high values (30 FPS).

 

Note: The FPS doesn't go higher than 30 because of the sync. I get to actually 54 if it's not synced full-screen. In these cases, the drop goes down to about 38 FPS.

Benchmark.zip

Link to comment
Share on other sites

Have you got a virus scanner running in the background?

One virus scanner I used would lag some games for a split second at regular intervals.

Intel Core i7 975 @ 3.33GHz, 6GB ram, GTX 560 Super OC, Windows 7 Pro 64bit

Link to comment
Share on other sites

If you are relying heavily on Lua it is possible this could be due to the Lua garbage compiler, but I doubt that is the case. My initial thought was some other process running in the background. The easiest way to test this is to run your app on some other machines.

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

I have no antivirus running in the background, nor any recurring task program for that matter.

I barely rely on Lua, each model has only the "base script" to allow me to edit its properties.

 

I do not have a LE capable machine at hand A.T.M. And since compiling in .PAKs seems to be currently unsupported because of Lua, I cannot redistribute it to a friend for license purposes.

Link to comment
Share on other sites

.PAKs seems to be currently unsupported because of Lua,

[/quote

 

This depends on how you are using the models and lua. For example I create a base lua script like character, where one of the properties is the filename of a model. Now the model can be inside a pak file and secure.

Link to comment
Share on other sites

I have no antivirus running in the background, nor any recurring task program for that matter.

I barely rely on Lua, each model has only the "base script" to allow me to edit its properties.

 

Are you using Raycast, I have seen lags in raycast moving across objects, i.e. moving from one object to another... still trying to work out why... but just a consideration?

If it's not Tactical realism then you are just playing..

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...