More on the Mouse Lag Issue

THE PROBLEM
===========

The mouse lag issue [1][2] for Direct3D games is a known issue and can be seen in many Direct3D renderable games such as Halflife, UT, etc. [3][4][5]

The lag is due to the buffering that your video card is doing. Since they have eliminated any synchronization calls in the video card instruction buffer, it keeps on taking input from the CPU until the buffer is full. So your video card at any point in time may be rendering a frame that you fed it 1-3 frames beforehand, which would explain the mouse lags when at lowered framerates. In this way the CPU (via mouse events) is lagged from what is seen on the screen. [6][7]

Okay so why dont you see this in Single Player? In single player the game speed is slowed as your FPS drops, so the events take the same number of frames and appear smooth. This is typically done on every SP console game also. This effectively means that your CPU is slowed to be in sync. with your GPU. In MP this CANNOT happen, since time is constant and global (otherwise one client would time-lag the whole server, although this happens on listen servers πŸ˜‰ ).

GRAPHICS CARD DEVELOPERS
========================

ATI acknowledge the problem and their fix for Direct3D games with mouse lag is…. to use OpenGL or software rendering πŸ™‚..unless the developer forces GPU-CPU sync. themselves at the point of rendering rather than pre-rendering. This is effectively removing the pre-rendering buffer as we do in the fix.

http://www.ati.com/support/infobase/3308.html <- Unreal http://www.ati.com/support/infobase/3655.html <- Halflife (NOTE: In OpenGL you can call glFinish() to synchronise CPU and GPU after each frame. Most OpenGL games have this option) NVIDIA offer some advice to developers on the subject in their developer FAQ. http://developer.nvidia.com/object/General_FAQ.html#G4

Saying The most obvious solution would be to lock the back buffer for each frame in Direct3D, which is essentially fix presented on Pkeuro. This ensures that all pending graphics commands are completed by the GPU before the CPU moves on..

Thats why UT2003/4 had to resort having a reduce mouse lag options which is basically forces syncronisation between the CPU and the GPU, overriding the pre-rendering buffer limit.

The pkeuro fix will work for Direct3D games for this reason. You may experience a slight FPS drop, since nvidias need for a large amount of pre-rendering is based on the fact their pre-rendering code is not optimised for D3D so much. That said fps-lag is much more playable than mouse-lag.

THE FIX
=======

Click Here.

References
==========

[1] Savage General
[2] ESR
[3] Battlezone 2
[4] Unreal
[5] ElderScrolls
[6] Developer Forum #1
[7] Developer Forum #2

FRJ

One of the main criticisms of PK is the simplified movement. While being complex compared to 95% of games out there, compared to QW/CPM the movement in PK is relatively simple. That being said, there are some good features about it, and some complex things that can be done. However, with things like the in-built Forward Rocket-Jump option, the options are decreased.

The way the FRJ works in PK, is by firing a rocket directly behind you. By looking down towards the floor, you set the angle the rocket will come out of your ass. Therefore, by looking directly ahead, the rocket flies out directly behind you. So not only does it remove the skill of FRJ’ing manually (which is fairly difficult), it also removes the skill of doing a 180 and continuing bunnyhopping so you can fire behind you (also difficult). To be honest, these are the two hardest manouevres possible and the only challenge presented by the PK movement system, so in my opinion the FRJ bind should be disabled on the servers (which it currently is not).

PK offers something unique that most games out there don’t, a (somewhat) higher level of depth and complexity and potential skill – why take that away? Isn’t that what attracted us to PK in the first place?

[PCF]Adrian update

[PCF]Adrian made another visit to #painkiller.euro this evening and passed on the following information:
————————————-
[18:45] * [PCF]Adrian has joined #painkiller.euro
[18:46] *[PCF]Adrian* Ok, hit me…
[18:46] * mute hits adrian badly
[18:46] *[PCF]Adrian* Let me feel the pain…
[18:46] * dmnk slaps [PCF]Adrian around a bit with a large trout
[18:46] * x4-rayfood slaps [PCF]Adrian around a bit with a large trout
[18:46] *x4-rayfood* πŸ™‚
[18:46] *dmnk* πŸ™‚
[18:46] * TeeJay stabs [PCF]Adrian in the face
[18:46] *[PCF]Adrian* Yeah we deserve that…

[18:47] *[PCF]Adrian* Anyway, in short… I WILL NOT be giving any dates, we’ve learnt the lesson, *but* we’re finishing 1.15 in about an hour.

[18:47] *[PCF]Adrian* The only good thing about 1.1 released in PL is that we’ve squashed a couple of more bugs and improved prediction code further.
[18:48] *[PCF]Adrian* So anyway, luckily DC has a hard time finding new bugs, so we keep our fingers crossed. Once again, no date, but IMHO it’s ready.

[18:48] *W4rh0g* Adrian
[18:48] *W4rh0g* do we all need to buy 3ghz pcs to play the game?
[18:49] *W4rh0g* I dont have a 3ghz pc for the prediction code
[18:49] *[PCF]Adrian* No you don’t. Average PC in the company is 1.7 GHz Athlon.
[18:49] *W4rh0g* yeah but yaten said it will grind on a 1.8ghz
[18:49] *[PCF]Adrian* Yaten is panicking πŸ˜‰
[18:49] *[PCF]Adrian* For no reason πŸ˜‰

[18:50] *[PCF]Adrian* Yaten just msged me they’re doing the installer. Ok, just dropped by to give your some progress info, gtg send the patch to DC, l8r all.

[18:50] *mute* Adrian, we saw this 1.15 server and the map was “dm6” as far i can remember. what about this map?
[18:50] *[PCF]Adrian* Yeah new map is in the works, DM_Fallen, but that’s for 1.2
[18:50] *[PCF]Adrian* Cheers.
[18:50] * [PCF]Adrian has quit IRC (Read error: EOF from client)
————————————
We’ll see whether DC find any bugs in this patch release. Fingers crossed that they’ve been reduced to an acceptable level.

[PCF]Yaten forum post

Translation to english of the post made recently on the pk.pl forums:
————————————-
1st mail. 04.05.04 13:23

Hello

Few words about patch 1.1 (I know, there are lot of bugs but it could help)

1) It’s true that you can’t move the player while on your own server and prediction is on. This is my major bug and I’ve fixed it. Problem will be resolved in 1.15 (which is going to be out within a few days or after 3 AM tonight).

Fix: On a server, prediction must not be turned on. Clients with prediction enabled can connect to the server with prediction disabled without any problems. Just run the server without prediction enabled, turn clients prediction on and it should work. Server is identical with or without prediction in this case.

2) How does prediction work? Like in QW but Havok does great change. How big? It takes as much as 20% CPU power without prediction enabled. 20ms passes, 20ms of simulation ahead, 20% more CPU usage.
If prediction is enabled:
-let’s take a 50 fps server, packet frequency 20ms and ping 100ms. Every time a packet arrives, the game must take back these 100 ms and count physics again 100ms ahead. Each 20ms we count 100ms of physics. Havok takes 5 times normal!!!
And let’s take server 100 fps and ping 200… oho.
Even in QW physics takes 5 times normal, but counting it in QW is CPU cycles we can ignore so there is no lag.

Fix: (it could be, theoretical)
We can not do anything with ping, but update from server…
Even if server sends the information frequently, we have 4 parameters: updateparams_myplayer ‘delay’, analogical updateparams_players, updateparams_physicsitems and updateparams_projectiles. ‘delay’ tells us how frequently the server sends information to the client. Without prediction it should be 0.01, because delays are smaller. With prediction enabled client does not check server so frequently, so it could be that with 0.1 or 0.2 things can run beautiful. And this means that the data from the server reaches the client only 10 times per second, Havok does not ruin our PC and fps does not drop to 2. BTW: stronger PC, better effect of prediction. 3 GHz and up, prediction is acceptable as it is, but after tweaking updateparams it could run even on 800 Mhz.
If you have big fps drops, then turn prediction off. It will not help in this case.

3) There are bugs with voting too. Game drops to desktop. We’re chasing this bug as we searching this one with final table. I cannot guarantee what will be with these bugs. One of them has been harassing us for 2 months and we cannot track it. πŸ™

4) English and Polish patches were completed at the same time. Polish was put on the web and English was stopped by Dreamcatcher after additional testing. Maybe if we are not in a hurry at 3 AM because β€žwe must release”, next patches will be free of bugs.

2nd mail. (2 minutes later)

Aha, I think that Adrian will murder me for public statements. Why in this thread? Why on this webpage? Why not on other sites? Who is going to take offence? etc. It’s why I am giving hints here. Well. I don’t have time , I’m writing code, fixing bugs and I’ve read this thread by accident. It could be any other place where people talks about PK bugs.
All.
3rd mail 04.05.04 18:17

I think you’ll not be worried if I tell you that we test here on 1.8 GHz machine. It was high end machine when we were starting project. πŸ™‚
Probably bug with desynchronization of server and client after 10 minutes of gaming on same map has been removed. With a large amount of effort but its effective. We see this while testing. πŸ™‚ Unfortunately QW solution is now not possible. Too much to change. I’ll think about it later.

If it works on 3 GHz I am glad. Here we test it on LAN and it works great so far.
———————————–

Patch Info from Adrian

[PCF]Adrian dropped by #painkiller.euro just a short time ago and provided us with some information on the upcoming patch. I’ve tried to split the IRC log into some kind of meaningful Q&A format. Hope its readable for you. Here goes:

—————————————–
[22:49] *[PCF]Adrian* so listen, here’s the scoop
[22:50] *[PCF]Adrian* quite sadly, we did find one bloody bug that we’ve been tracking for a whole day
[22:50] *[PCF]Adrian* with no luck… but we’re closing in on the bastard.
[22:50] *[PCF]Adrian* it’s just this one thing that holds the release
[22:50] *[PCF]Adrian* on a bright side
[22:51] *[PCF]Adrian* Krystian wrote the prediction code that now I cannot play without. It’s really good.

[22:51] *Hutchy* are u allowed to release what the bug is out of curiosity?
[22:51] *[PCF]Adrian* yeah
[22:51] *[PCF]Adrian* I can describe the bug
[22:51] *[PCF]Adrian* tell me if you have it in 1.00
[22:51] *[PCF]Adrian* it’s crash to desktop when the final scoretable is displayed

[22:51] *W4rh0g* we get crash to desktop everynow and again anyhow
[22:52] *W4rh0g* I think thats a known bug in 1.0 tho
[22:52] *[PCF]Adrian* does anyone experience that in 1.00?
[22:52] *Blowfish* yes, I had that a few times
[22:52] *Hutchy* i do recall others having occasional crash to desktop
[22:52] *[PCF]Adrian* yeah it happens at the end of the match
[22:52] *W4rh0g* we get when joining server
[22:52] *[PCF]Adrian* it’s annoying and a bitch to find
[22:52] *W4rh0g* as well
[22:52] *Hutchy* yeh ive had a joining one on occasion πŸ™‚
[22:52] *Blowfish* I’ve had it once when I didn’t even play, just left it in ‘spec’ mode on the scoreboard
[22:52] *Hutchy* will be good to fix that one at least
[22:53] *W4rh0g* apparently the crash to desktop happens when SP is played too
[22:56] *cK-blood|wrk* Adrian, one main CTD that ive found is upon joining that map with the Mansion
[22:56] *cK-blood|wrk* i think its DM_Psycho
[22:56] *cK-blood|wrk* when joining server, right when scoreboard is displayed u get CTD
[22:57] *cK-blood|wrk* thats the only map its happened to me
[22:57] *cK-blood|wrk* and ONLY when im connecting to server with that map
[22:57] *cK-blood|wrk* but if im already in the game and it loads that map im fine
[22:57] *cK-blood|wrk* but if i leave game and connect back i get ctd
[22:57] *[PCF]Adrian* weird, but I assume that is fixed, we play that map a lot… though I must admit

DM_Cursed is my fav map atm

[22:52] *[PCF]Adrian* all other bugs seem to be fixed
[22:52] *[PCF]Adrian* the bugfix log is 2 gigs long πŸ˜‰

[22:53] *W4rh0g* could u give us a short resume on weapon damage changes adrian?
[22:53] *W4rh0g* RL splash?
[22:53] *W4rh0g* stake power?
[22:53] *W4rh0g* we all want to hear the stake power at spawn
[22:53] *[PCF]Adrian* we fixed ElectroDriver, so now it’s actually useful πŸ˜‰

[22:54] *W4rh0g* what value for stake did u end up at?
[22:54] *[PCF]Adrian* we didn’t change the stake so far, why?
[22:54] *W4rh0g* well
[22:54] *W4rh0g* one of the main critiscms of the current weapons
[22:55] *W4rh0g* is the ability to kill a fully loaded player
[22:55] *W4rh0g* v quick with the spawn weapon
[22:55] *W4rh0g* we understodd u may be lowering the damage
[22:55] *W4rh0g* from 200

[22:55] *[PCF]Adrian* stakes cannot kill someone 100/150…
[22:55] *[PCF]Adrian* …but…
[22:55] *[PCF]Adrian* what we did is we added more items on maps, so now it’s a little easier to get armored

etc.
[22:56] *W4rh0g* so the stake damage will stay the same
[22:56] *W4rh0g* well
[22:56] *W4rh0g* is there a chance this could be changed per server settings?
[22:56] *[PCF]Adrian* just a little πŸ˜‰

[22:56] *[PCF]Adrian* we have really done A LOT of work on this patch, it’s like a new game now

[22:58] *W4rh0g* any chance you could tell us what kind of voting will be allowed adrian?
[22:58] *W4rh0g* referee/rcon
[22:58] *W4rh0g* ?
[22:58] *[PCF]Adrian* like what?
[22:58] *W4rh0g* like a server admin can modify server settings thru the console
[22:58] *W4rh0g* or a referee can change match settings
[22:59] *[PCF]Adrian* no, we don’t want zillions of servers with different settings… it happened to MoHAA

and killed the scene slowly. But wait, lemme give some info on CALLVOTE
[22:59] *cK-blood|wrk* there wont be a zillion settings, tournaments will get a standard
[22:59] *cK-blood|wrk* for instance, CPL usually sets the standards

[22:59] *[PCF]Adrian* Server (commands available on server and for voting):
[23:00] *[PCF]Adrian* sec it’s a long list πŸ˜‰
[23:01] *[PCF]Adrian* here goes:
[23:01] *[PCF]Adrian* map *map_name*, timelimit *value*, fraglimit *value*, kick *name*
[23:01] *[PCF]Adrian* ankick *name*, maxplayers *value*, maxspectators *value*
[23:01] *[PCF]Adrian* powerupdrop *0/1*
[23:01] *[PCF]Adrian* powerups *0/1*, weaponsstay *0/1*, teamdamage *0/1*
[23:01] *[PCF]Adrian* allowbunnyhopping *0/1*, allowbrightskins *0/1*, allowforwardrj *0/1*
[23:02] *[PCF]Adrian* gamemode *ffa/tdm/pcf/tlb/voosh*
[23:02] *[PCF]Adrian* reloadmap
[23:02] *[PCF]Adrian* that’s it

[23:00] *esc\Sui* is their anychance that u can add map name to the loading screens?
[23:02] *[PCF]Adrian* it’s added
[23:02] *[PCF]Adrian* map name shows now

[23:02] *esc\Sui* can it be made possible
[23:02] *esc\Sui* to connect ctrl+v in console
[23:02] *esc\Sui* with ips
[23:08] *W4rh0g* is copy pasting ips into the console when in a multiplayer game now possible?
[23:08] *[PCF]Adrian* don’t know, write me email about it so I can double check tomorrow

[23:03] *W4rh0g* when is the linux server due for release?
[23:03] *[PCF]Adrian* yeah I know… everyone wants that… we plan on that as well, but it won’t be that soon

:/
[23:03] *W4rh0g* is it tough to implement adrian?
[23:04] *[PCF]Adrian* yes, because we’re still working A LOT on the code
[23:04] *W4rh0g* ok
[23:04] *W4rh0g* will be a while then
[23:04] *Blowfish* is the Havok licence the problem for linux build? (aside from directx)
[23:05] *[PCF]Adrian* license is not a problem (but it does cost ;))

[23:04] *[K]EtoS* adrian, how bout client side brightskin settings and not server side?
[23:04] *[PCF]Adrian* client side is unfair
[23:04] *[PCF]Adrian* but
[23:04] *[PCF]Adrian* you can CALLVOTE that πŸ™‚

[23:05] *W4rh0g* we understand that client prediction has been added
[23:05] *W4rh0g* does it REALLY help netplay?
[23:05] *W4rh0g* in your opinion
[23:06] *[PCF]Adrian* yes it does, BUT this code is experimental… 2 things:
[23:07] *[PCF]Adrian* a) it uses more processor power, so unless you have a good PC remember to set gfx to low

to have as much free computing power for Havok prediction
[23:07] *[PCF]Adrian* b) er… I forgot what was that… sec…

[23:07] *Blowfish* any chance of a female player model for female gamers?
[23:07] *[PCF]Adrian* we hope to have a fat slut in 1.2
[23:08] *[PCF]Adrian* because all models need to use the same ragdoll for collision

[23:08] *W4rh0g* have you managed to tweak havoc right down to help netplay
[23:09] *Maniax* yes, everyones main concern is more or less netcode, is it majorly tweaked in 1.1 or just

minor?
[23:09] *[PCF]Adrian* yes, hence the prediction code. As I said, you need more processor power now, because we

predict Havok or shit, no idea, programmers tried to explain that to me with no luck πŸ™‚

[23:09] *[PCF]Adrian* so
[23:09] *[PCF]Adrian* guys
[23:09] *[PCF]Adrian* bottom line is
[23:10] *[PCF]Adrian* I bet there will be 1.2, and 1.1 has its faults, it’s still not perfect game, BUT it’s

HELL OF a lot better than 1.0 and you should like it.

[23:10] *[K]EtoS* will you be at QuakeCon this year Adrian? anyone else from PCF/dc going?
[23:11] *[PCF]Adrian* no idea atm
[23:11] *[PCF]Adrian* I would like to see PK gimps in action, but I just don’t know atm

[23:11] *hp|47* will the bug with the scores be fixed ? when a player is scoring points for the team and he

leaves the server the team loses those points (frags), that is a big problem if we would have a situatuion

like that in a league mach
[23:11] *hp|47* ?
[23:11] *[PCF]Adrian* ok, so just a little patience plz, one last bug and we’re done. Can’t wait to hear your

opinion. Yes this team bug is fixed as well.

[23:12] *[PCF]Adrian* Ok thanks for your support ppl and ttyl
[23:12] * [PCF]Adrian has quit IRC (Read error: EOF from client)
—————————————–