Game Development Community

Noob Networking Optimization

by Faraz Ahmed · in Torque Game Engine · 02/22/2006 (4:24 am) · 2 replies

I'm developing a sports type simulation that has a maximum of two players competing against each other at any given time. The core object types during the interaction between the two players is a slippery pointer (RigidShape), a ball (RigidShape) and an AIPlayer. When one player is controlling the pointer, the other one is controlling the AIPlayer. The pointer is eventually used to launch the ball at the AIPlayer.

I tested a skeleton simulation of the system with a friend on another continent and experienced significant lag while playing against him (he was the host). The interaction was playable but not smooth, I also noticed his AIPlayer bobbing and almost vibrating at one spot (which doesn't happen for the host).

Assuming that my connection to the friend and the code written around the game logic is optimized, what are the general strategies and options available for optimizing the networking of the core objects mentioned? There is no scaling factor to consider here because there will always be just two players, a pointer and a ball. I'm hoping there is some kind of network prioritization I can do to ensure maximum possible smoothness and response time during the pointer, ball and AI interaction. Thanks for your advice.

p.s. the RigidShape class was adopted from this resource: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5495

#1
02/22/2006 (3:29 pm)
There are settings for the net code that can be set to optimize for your connection speed.. if you have a good connection you can up the packet size from 200 to 400 and increase the bit rate from client to server and from server to client .. I think mine are set to 32 for both. Dialup would have problems with 400 and 32, 32, as the settings, but experiment with it and see if you can gain some ground. It eliminated allot of the AIplayer jittering in the game we are working on. These changes can all be done in your client/prefs.cs file and server/prefs.cs file. Look for the settings that are part of the NET::preferences about half way down in the file.

Good Luck!
Rab
#2
02/22/2006 (10:03 pm)
Thanks! Exactly what I needed.