Game Development Community

AIPlayer and Flying Vehicles

by Robert Seeman · in Torque Game Engine · 12/14/2006 (9:25 am) · 4 replies

When mounting an AIPlayer to a flying vehicle and setting $aiplayer.setmovedestination("x y z"); I notice that the vehicle will move in a somewhat jerky fashion almost like it is jumping from spot to spot along its path.

This occurs even in a single player / local game on a system with very high specs (3 GHz multi-thread with Radeon X1300) and I have seen it occur on other systems as well. I must assume it is not network related so it must be something with the AI movement.

Does anyone have any suggestions on how to overcome this particular issue or, at least, do you know why this happens?

Thanks in advance!

-Robert

#1
01/19/2007 (10:38 am)
We had a problem similar to this. In our case it helped to increase the distance in the CameraScopeQuery
function. The jump seems to be related to the network updates. Player messages have higher priority than
vehicles, unless the vehicle is mounted by real player. We also increased the priority of vehicle messages.
#2
01/21/2007 (10:46 pm)
Thanks Gilbert. I'm sure this will get me on the right track. Do you know where these priorities would be modified in the code? I'm running Torque 1.5

Thanks again!

Robert
#3
01/21/2007 (11:04 pm)
@Gilbert: I second that request. Can you give some example?

I see this as well - both on our ships and planes. Mostly when AI controlled, but I *think* also sometimes under heavy load on our player controlled planes. Unsure if its the same issue, or a matter of a physics sync bug.
#4
03/19/2007 (11:11 pm)
Thought I'd update this post. I was able to eliminate the jerky movement through sheer brute force.

I tinkered around with the $pref::Net settings in prefs.cs.

$pref::Net::PacketRateToClient = "32"; // was set to "10"
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "450"; // was set to "200"

For a FPS-type space sim, this works great. All packets are local so you're really only sending 28.8 kilobytes per second to yourself. Note: 450*(32*2) = 28800 bytes * 8 = 230 kilobits per second. Thats a very nice amount of data sent every second compared to the previous 16 kilobits (200 * 10 * 8) and for me it's helped smooth out the movement very noticably.

However, this setting gets a bit heavy even if you only have 10 people connected into a server. It would be 1.1 megabits per second total sent "up" to the clients and 1.1 megabits per second to the server from the clients. You would probably be in for on some lag.

Average DSL: 1.5 megabits down, 384 kbits up
Average Cable: 10 megabits down, 768 kbits up
T1: 1.54 megabits up and down
T3: 40 megabits up and down
LAN: 100 megabits up and down / 1 gigabit up and down (Full duplex)


Anyway, I hope some of you find this helpful.

-Robert