Shot lag?

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Shot lag?

Postby drwbns » 2011-03-24, 09:42

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?
User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Shot lag?

Postby Carsten » 2011-03-24, 11:43

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.)
Best regards,
Carsten
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Re: Shot lag?

Postby drwbns » 2011-03-24, 14:59

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.
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Re: Shot lag?

Postby drwbns » 2011-03-24, 15:19

User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Shot lag?

Postby Carsten » 2011-03-24, 20:44

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).
Best regards,
Carsten
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Re: Shot lag?

Postby drwbns » 2011-03-25, 08:55

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
User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Shot lag?

Postby Carsten » 2011-03-25, 15:48

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.
Best regards,
Carsten
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Re: Shot lag?

Postby drwbns » 2011-03-26, 09:35

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/
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Re: Shot lag?

Postby drwbns » 2011-03-26, 10:25

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).
User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Shot lag?

Postby Carsten » 2011-03-27, 11:26

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.
Best regards,
Carsten
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Re: Shot lag?

Postby drwbns » 2011-03-27, 19:27

ok I'll get back to you Carsten. Thanks for all the help!
User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Shot lag?

Postby Carsten » 2011-03-28, 13:51

I just found that in fact I can reproduce this here!
Sorry for the earlier confusion.

I'll look into it.
Best regards,
Carsten
drwbns
Posts: 31
Joined: 2011-03-17, 23:57

Re: Shot lag?

Postby drwbns » 2011-03-28, 16:56

I verified this also happens with the null soundsystem.
HWGuy
Posts: 95
Joined: 2011-05-31, 07:37

Re: Shot lag?

Postby HWGuy » 2011-10-01, 21:13

I get the same problem with the 2009 and 2010 and 2011... a deadly bug that's been around for 3 years.
User avatar
Carsten
Site Admin
Posts: 2007
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Re: Shot lag?

Postby Carsten » 2011-10-02, 23:21

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: )
Best regards,
Carsten

Return to “Cafu Engine Support and Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests