Game Development Community

Choppy client movement... Help

by Peter Simard · in Torque Game Engine · 02/09/2006 (5:27 pm) · 17 replies

Somewhere down the line of my feature coding I seem to have broke the networking part of TGE. The game plays fine in single player, but attempting to connect to a dedicated server (even one running on the same PC), I get horrible jerking in the camera. The ping is low, no packet loss, very low amount of ghost updates. It does this wheather I am connecting to a local dedicated server or remote. It will keep warping the camera and player back like the server is out of sync with the client. I have made no changes to the networking part of TGE. Also viewing wandering AI on the server also appears choppy. I am running TGE 1.4 with the TLK. What could possibly be the cause for something like this? Any help would be much appreciated!

#1
02/09/2006 (5:53 pm)
I see this also with 100% stock TGE 1.3:

it's fine w/ server & client in a single instance,
but w/ server & client in separate instances on a single machine,
the camera is choppy just as you describe.

however,
i've found that running the server on a separate machine clears the problem right up!

so i don't know the cause, but the problem may not be as bad as you think!
#2
02/11/2006 (2:36 pm)
I have the same problem as you Peter. I'm still trying to figure our the problem. I was told it has something to do with some code taking up CPU cycles but have not found a fix. I was also thinking it may have something to do with the server jummping threads on the CPU. I don't think this is the problem however. I set the CPU affinity for my deticated server and client (remote and local) and the problem still existed.

I would also really like to find the reason. Peter if you want to contact me maybe we could figure it out.
#3
02/11/2006 (3:13 pm)
My guess is its something to do with the network layer. If it was code taking up CPU cycles I think the problem would show up in singleplayer games. What we really need to figure out is.. what is the difference in a dedicated server and client on 1 PC and the server and client in one?
#4
02/11/2006 (3:54 pm)
If you've made engine changes to things like movement or the camera, you have to be careful to make sure youv'e done the right things in interpolateTick and updateTime. Also, in the readPacketData code you have to sometimes update dependant variables after the read has happened. Sorry this is so vague, maybe if you outlined what you've done so far, it'll help narrow things down a bit?

bzztbomb -- Knowhere Studios
#5
02/11/2006 (4:25 pm)
I have made no changes other then changes to the Projectile class. The lag existed before I made the changes. (Both TGE 1.3 and TGE 1.4)
#6
02/12/2006 (6:40 pm)
Ok. I don't think it's Torque. One of our team members (AMD User) hosted a deticated server with no lag. I'll continue to look into it.
#7
02/12/2006 (7:32 pm)
My problem is definetly with torque. Ive tested it on about 4 different PCs all with the same problem. Any TGE experts want to earn some extra money and help me degub this? I can give you CVS access.
#8
02/12/2006 (7:44 pm)
I fixed it on my pc. Try setting the CPU affinity of the deticated server to one CPU (and if u are launching it via a bat file - set that to one CPU too).

Worked for me.
#9
02/15/2006 (12:01 am)
I set it to a single CPU and its still lagging. Here is a video i recorded to show how dramatic it is:

www.megaupload.com/?d=4DE5I8OD
#10
02/15/2006 (12:08 pm)
Alright let me take a look.


Same thing I was/am getting. I am almost postivie it has to do with Pentium line of CPU's. Game looks great btw, I am 100% sure it is not Torque related being that I had the same problem, but when another group member hosted, we had no lag.

He had an AMD pc (Hypertransport), I tested on two P4's with Hyperthreading (2.4, 2.66). Try turing off HT in your BIOS. I wish I could be of more help.
#11
02/26/2006 (7:14 pm)
The plot thickens...

I am still having this problem and am tearing my hair out tying to fix it. I replaced my player.cc and gameconnection.cc files with the originals and it still doesnt work. I was however able to get it working by replacing my exe with the original exe.

So, there is definetly something wrong with my C++ code, but replacing the 2 files I figured it would be in didnt help. What other files are involved in interpolating? Also, is there any engine differences to a dedicated server and a non dedicated server.

The offer is still there for anyone who wants to help me debug this, it could be a simple as 1 line of code. I will pay $100 to someone who can fix this for me.

Thanks,
-Pete
#12
02/27/2006 (12:05 pm)
Well, well, well... if there is money in this, I'll see what I can do. ;)
#13
02/27/2006 (12:44 pm)
Send an email to pete@rampid.com if your interested in trying to fix it. Ill set you up with CVS access. First person to find the problem gets the money.

-Pete
#14
02/27/2006 (7:00 pm)
Well. As I said, I'm reciving a problem like this with my game as well (only on some pc's) I'll see if I can fix my problem before I mess with your code.
#15
02/28/2006 (10:53 am)
I had the exact same problem with a p4 & an athlon. All I did to fix it was play around with the following...

$Pref::timeManagerProcessInterval = "0";
$Pref::backgroundSleepTime = "25";

I thought it was too simple to be true but it worked for me. Try it, it may work for you too.

Here's a reference thread
#16
02/28/2006 (11:29 am)
Thanks for the post Tim. After reading that thread I was really excited that would work.. but still no go. It didnt seem to have any effect at all.

I combined that fix with setting the affinity to 1 CPU and that actually did help. Id say about 75% of the shudders are gone, but there is still enough jittering thats its a problem.
#17
02/28/2006 (11:40 am)
Sorry to hear it. I had the exact same problem you described in your original post & those pref values fixed it. I'm concerned it didn't work for you cos that adds to the possibilty this is hardware related which isn't good for any of us. Imagine if someone purchased your game and they we're amongst the group of people who's hardware caused this horrible networking problem.