Page 1 of 2

Shot lag?

Posted: 2011-03-24, 09:42
by drwbns
I was wondering if anyone else is getting a firing "lag". Like it's taking a long time to compute a ray trace or something. It seems the further away the shot is fired, the more the lag time. Anyone?

Re: Shot lag?

Posted: 2011-03-24, 11:43
by Carsten
drwbns wrote:I was wondering if anyone else is getting a firing "lag". Like it's taking a long time to compute a ray trace or something. It seems the further away the shot is fired, the more the lag time. Anyone?
To the best of my knowledge, at least the ray tracing should not cause any delay: It's implementation is very fast, and the engine runs dozens of ray traces at any frame anyway.

When you try the same shot a second time, is the second shot equally delayed as the first? If not so, it's possibly a matter of initializing additional resources like sounds and textures. (Most textures including sprites are loaded in advance though, so maybe it's the sound driver that needs extra time to initialize a new sound before it's first played.)

Re: Shot lag?

Posted: 2011-03-24, 14:59
by drwbns
It's delayed every shot by at least a slight amount, some delay more than others, most delay in outdoor area of techdemo map. I'm uploading a video to youtube so you can see it.

Re: Shot lag?

Posted: 2011-03-24, 15:19
by drwbns

Re: Shot lag?

Posted: 2011-03-24, 20:44
by Carsten
Ok, thanks for the movie.
Unfortunately, it's difficult to tell what causes the lag, but it still looks to me like some kind of resource bottleneck.

When you continue to run around in the TechDemo island, does the lag still occur?
Does it also occur when you leave the building and enter the open space without firing a shot?

Then, what system specs do you have? (Type and Speed of CPU, main RAM, GPU RAM, ...)
This really looks like some kind of RAM was depleted and the system resorted to swapping things around, e.g. from GPU RAM to main RAM, or main RAM to hard-disk, etc. (you can tell the latter if a lot of hard-disk activity is involved at the same time, or much better of course, if you use perfmon).

Re: Shot lag?

Posted: 2011-03-25, 08:55
by drwbns
Yeah, it's really strange, I don't really have this problem in other games when shooting. And the framerates are smooth when I don't shoot, only right after I click the mouse, it freezes for a split second then continues the frames. I'm on a intel dual core 2.6 with 4Gb ram

Re: Shot lag?

Posted: 2011-03-25, 15:48
by Carsten
drwbns wrote:Yeah, it's really strange
Yes, indeed. The problem is that I cannot see the problem here (even on the low-spec systems that I regularly use), so the helpl that I can give you is very limited.
But if you're interested enough, it's certainly possible to isolate or narrow the problem down by running various tests, e.g. does it happen also with the "Null" sound system?, does it also happen in smaller maps?, etc.

Re: Shot lag?

Posted: 2011-03-26, 09:35
by drwbns
Sorry, but what is the null soundsystem? To answer your question about whether or not it happens when running around the map, the answer is a definite no. It's totally smooth as long as I don't fire. Also, I have startup errors in the console when running the game from a build. How do I output the console?

screenshots here -

http://img823.imageshack.us/i/pic0001a.jpg/

http://img28.imageshack.us/i/pic0002gc.jpg/

Re: Shot lag?

Posted: 2011-03-26, 10:25
by drwbns
I wanted to add that this "pause" also happens when resolution is set to 800 x 600 and it also happens with the Pulse rifle (every shot lags).

Re: Shot lag?

Posted: 2011-03-27, 11:26
by Carsten
You can log the console messages to a file by running Cafu with -log:logfile.txt parameter.
The ones that you've shown though are not a problem.

If you're using a self-compiled edition of Cafu, try running it with parameter -clSoundSystem:

Code: Select all

build\win32\vc10\x86\debug\Ca3DE\Cafu.exe -clSoundSystem:Libs\build\win32\vc10\x86\debug\SoundSystem\SoundSysNull.dll
Note that you possibly have to edit the path details (build\win32\...) for your system, and that the same changes must be made both for the ...\Cafu.exe part as well as the Libs\...\SoundSystem\SoundSysNull.dll part.

This will turn off the sound system. If the shot delay is then gone, it was likely caused by the sound system. Otherwise we should have another look at the graphics resources.

Run Cafu with parameter --help to see additional available command-line options.

Re: Shot lag?

Posted: 2011-03-27, 19:27
by drwbns
ok I'll get back to you Carsten. Thanks for all the help!

Re: Shot lag?

Posted: 2011-03-28, 13:51
by Carsten
I just found that in fact I can reproduce this here!
Sorry for the earlier confusion.

I'll look into it.

Re: Shot lag?

Posted: 2011-03-28, 16:56
by drwbns
I verified this also happens with the null soundsystem.

Re: Shot lag?

Posted: 2011-10-01, 21:13
by HWGuy
I get the same problem with the 2009 and 2010 and 2011... a deadly bug that's been around for 3 years.

Re: Shot lag?

Posted: 2011-10-02, 23:21
by Carsten
HWGuy wrote:I get the same problem with the 2009 and 2010 and 2011... a deadly bug that's been around for 3 years.
Ok, thanks for the feedback!
I guess this is a performance issue with tracing a rays against the terrain...

I've recorded this issue in Ticket #74 to make sure that it is not forgotten, and will look into it as soon as possible.
(Any help is welcome though! :up: )