Wheeled Vehicles - Don"t Work Over Internet
by Harvey Greensall · in Torque Game Engine · 12/19/2006 (1:19 pm) · 26 replies
Beware....Our wheeled vehicles DO NOT work over the internet.
If anyone can help me out I'd be eternally grateful.
If anyone can help me out I'd be eternally grateful.
#2
Well, in our game, Buccaneer www.stickmanstudios.co.uk we have essentially wheeled vehicles, they're working fine single-player, like a dream over LAN etc. but try as hard as we can, any latency at all kills them over the internet. They sit for 10 to 20 seconds, then zip across half a mile, vanish etc. We've had a few people look into it and they all come back with the same answer. No, wheeled vehicles won't work across the internet Harv, you'll have to set them up as players and steal a bit of vehicle code to make them act like vehicles, or ditch internet play altogether.... If I look through forums, I just come to dead ends like this one http://www.garagegames.com/mg/forums/result.thread.php?qt=18292
Are there any examples of a torque game using wheeled vehicles across the internet? Were the tanks in thinktanks really characters with the turrets adapted from the player head rotating or something?
I don't mind what I have to do to get them looking convincing, even if I have to set them up as characters. But boy I could do with a stiff drink if I'm going to ditch all the work we've put into getting the ship feeling right again etc.
Any help or suggestions would be most welcome.
12/19/2006 (1:51 pm)
Hello!Well, in our game, Buccaneer www.stickmanstudios.co.uk we have essentially wheeled vehicles, they're working fine single-player, like a dream over LAN etc. but try as hard as we can, any latency at all kills them over the internet. They sit for 10 to 20 seconds, then zip across half a mile, vanish etc. We've had a few people look into it and they all come back with the same answer. No, wheeled vehicles won't work across the internet Harv, you'll have to set them up as players and steal a bit of vehicle code to make them act like vehicles, or ditch internet play altogether.... If I look through forums, I just come to dead ends like this one http://www.garagegames.com/mg/forums/result.thread.php?qt=18292
Are there any examples of a torque game using wheeled vehicles across the internet? Were the tanks in thinktanks really characters with the turrets adapted from the player head rotating or something?
I don't mind what I have to do to get them looking convincing, even if I have to set them up as characters. But boy I could do with a stiff drink if I'm going to ditch all the work we've put into getting the ship feeling right again etc.
Any help or suggestions would be most welcome.
#3
12/19/2006 (2:05 pm)
Just two days ago i played another person over the internet in one wheeled vehicle based project we're working on (i was on a really crappy DSL with only 400kbps both ways). It works right out of the box for us. If it doesn't in your project it is either... a) your internet connection or b) code/script changes you made.
#4
12/19/2006 (2:25 pm)
It's good to hear you say that Tom. Like I say, I don't mind doing whatever I have to, as long as it's do-able and I'm not trying to fix something that doesn't want to be fixed.... They do seem very broken though...although as I say fantastic over LAN. we've had some great 10 player LAN battles already (5 a side)... I'd like to think we could do the same over the internet, even push it to 8 a side..... I just hope I can get it working. They do have guns mounted to them and as Pirate Ships they're very big, about 40 meters long. Do you know if this would cause a problem?
#5
12/19/2006 (2:44 pm)
I'm sure the fact that their 40 meters long isn't helping anything, but if their working perfectly fine over Lan, and Single play, thats no reason for them to not work on internet play if you ask me.. Just a thought, but in your client/ folder, in Prefs.cs, what are your LagThreshold, PacketRateToClient, PacketRateToServer, and PacketSize Vars set to?
#6
the tanks in thinktanks are a custom solution. They are not based on the default torque vehicle or player types.
12/19/2006 (2:45 pm)
Quote:Were the tanks in thinktanks really characters with the turrets adapted from the player head rotating or something?
the tanks in thinktanks are a custom solution. They are not based on the default torque vehicle or player types.
#7
I've included the $pref::Master0 too, just to check this is correct.....
$pref::Master0 = "2:master.garagegames.com:28002";
$Pref::Net::LagThreshold = "400";
$pref::Net::PacketRateToClient = "10";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "200";
$pref::Net::Port = 28000;
@ Joe
Are they the same solution as the Tank Pack do you know? It says in the read.me it's been multiplayer tested so could be a fall back if all fails.
12/19/2006 (2:54 pm)
@ MaxI've included the $pref::Master0 too, just to check this is correct.....
$pref::Master0 = "2:master.garagegames.com:28002";
$Pref::Net::LagThreshold = "400";
$pref::Net::PacketRateToClient = "10";
$pref::Net::PacketRateToServer = "32";
$pref::Net::PacketSize = "200";
$pref::Net::Port = 28000;
@ Joe
Are they the same solution as the Tank Pack do you know? It says in the read.me it's been multiplayer tested so could be a fall back if all fails.
#8
That seems all in line, only difference for mine is that the PacketRateToServer is set to 20, shouldn't make any difference though..
Also though, just thinking about it now, how are you hosting the server? is it a dedicated server run by a seperate computer, is one of the players hosting the game while playing, or is one computer hosting a dedicated server, with someone playing on the same computer?
12/19/2006 (3:02 pm)
@ HarveyThat seems all in line, only difference for mine is that the PacketRateToServer is set to 20, shouldn't make any difference though..
Also though, just thinking about it now, how are you hosting the server? is it a dedicated server run by a seperate computer, is one of the players hosting the game while playing, or is one computer hosting a dedicated server, with someone playing on the same computer?
#9
12/19/2006 (3:08 pm)
Hi Max, one of the players is hosting the game while playing......
#10
I bet you that right there is your problem, try having someone host the game with a dedicated server, and no one playing on that specific computer, your lag should dissapear. I've had the same problem a while back, this normally solved it. I'm burnt out from working on my game at the moment, so If need be I can host a dedicated server for your game so you can see if it solves the problem.
12/19/2006 (3:19 pm)
Hey Harvey,I bet you that right there is your problem, try having someone host the game with a dedicated server, and no one playing on that specific computer, your lag should dissapear. I've had the same problem a while back, this normally solved it. I'm burnt out from working on my game at the moment, so If need be I can host a dedicated server for your game so you can see if it solves the problem.
#11
I'll have to test it later in the week, I'm bogged down untill Thursday I think. I take it it's pretty easy to set up a dedicated server huh? I'll dig around in the forums.
So from a practical point of view. Lets say that solves our problem, we'd have to then give people to facility to set up dedicated servers? Or set a few up ourselves or something too, so that the average punter that buys the game will be able to join a game if he's only one PC.
I'll look into it this week and let you know how we get on.
By the way, if it's relevant some testers that are helping us out have had an 8 player game over the internet with a virtual LAN using Hamachi. Obviously not what we'd want to do but interesting ......
12/19/2006 (3:29 pm)
Really? If that's all it is it would be pretty damn cool. It's certainly worth a shot hey?I'll have to test it later in the week, I'm bogged down untill Thursday I think. I take it it's pretty easy to set up a dedicated server huh? I'll dig around in the forums.
So from a practical point of view. Lets say that solves our problem, we'd have to then give people to facility to set up dedicated servers? Or set a few up ourselves or something too, so that the average punter that buys the game will be able to join a game if he's only one PC.
I'll look into it this week and let you know how we get on.
By the way, if it's relevant some testers that are helping us out have had an 8 player game over the internet with a virtual LAN using Hamachi. Obviously not what we'd want to do but interesting ......
#12
Well, I'd say in the begining, after you release the game that is, you'll have to have a few dedicated servers running for people to join and play on with other people, of course they could host their own games, but they could possibly have the lag problem, depending on their pc and internet connection. As I was saying though, after you've released the game, and say that it's a hit and a good ammount of people buy it off the bat, after a little while, people will run their own dedicated servers and you'll be able to take yours down.
12/19/2006 (3:49 pm)
Yup, that should solve your problem as far as I'm concerned.Well, I'd say in the begining, after you release the game that is, you'll have to have a few dedicated servers running for people to join and play on with other people, of course they could host their own games, but they could possibly have the lag problem, depending on their pc and internet connection. As I was saying though, after you've released the game, and say that it's a hit and a good ammount of people buy it off the bat, after a little while, people will run their own dedicated servers and you'll be able to take yours down.
#13
Yeah, if it works, I'll go out and buy a couple of extra PCs. have one at home, one at the studio and set up some dedicated servers. It would probably be wise to disable the option to both Host and Play on a PC for our game do you think?
So am I right in thinking people generally have this problem when trying to Host a server and play on it at the same time? Or just us?
I'm going to hunt around the forums but if anyone has some tips on how to set up a dedicated server, I'd be very grateful. Also, is it best to have a very high spec PC for the server, loads of RAM etc. I can build a couple specifically .... Obviously it'll have a good broadband connection etc.
12/20/2006 (12:34 am)
I hope this fixes it, I'll be a happy man.Yeah, if it works, I'll go out and buy a couple of extra PCs. have one at home, one at the studio and set up some dedicated servers. It would probably be wise to disable the option to both Host and Play on a PC for our game do you think?
So am I right in thinking people generally have this problem when trying to Host a server and play on it at the same time? Or just us?
I'm going to hunt around the forums but if anyone has some tips on how to set up a dedicated server, I'd be very grateful. Also, is it best to have a very high spec PC for the server, loads of RAM etc. I can build a couple specifically .... Obviously it'll have a good broadband connection etc.
#14
What will be your broadband connection? you should look around 100 mb/unmetered connection.
STef
12/20/2006 (12:54 am)
Harvey,What will be your broadband connection? you should look around 100 mb/unmetered connection.
STef
#15
12/20/2006 (1:52 am)
Stephan, I would think latency is more an issue than pure bandwidth. And probably server CPU (as suggested by Max, running a client and server on one machine wouldn't help one bit)
#16
I'd say that you deffinatly shouldn't disable the option to both host and play on a pc for a game, computers out there are getting ever better, and internet connections are getting ever faster. Plus, people love to be able to host their own servers and have their friends join them, it's one of the many pulls of multiplayer games.
Running a dedicated server is one of the easiest things imagineable, the computer you need to run it on should have a decent processor, a gig of ram should be plenty, and graphics card wise, it doesn't even need one for it won't actually even have the game open. When running a dedicated server in torque, all it does is open a small dos window, and writes out everything thats going on in the game, and who's disconnecting, and leaving the server.
To create a dedicated server, you have to make sure you have the torque router ports opened, as does anyone who wants to host a game, I'm assuming you know all about that already though. To create the dedicated server though, all you should have to do is create a shortcut of the exe that runs your game in the same folder, and in the target box define it like this..
C:\Torque\SDK\example\torqueDemo.exe -dedicated -mission physics.fps/data/missions/terrain.mis
Thats just an example, but I'm sure you get the idea.
12/20/2006 (7:07 am)
Harvey,I'd say that you deffinatly shouldn't disable the option to both host and play on a pc for a game, computers out there are getting ever better, and internet connections are getting ever faster. Plus, people love to be able to host their own servers and have their friends join them, it's one of the many pulls of multiplayer games.
Running a dedicated server is one of the easiest things imagineable, the computer you need to run it on should have a decent processor, a gig of ram should be plenty, and graphics card wise, it doesn't even need one for it won't actually even have the game open. When running a dedicated server in torque, all it does is open a small dos window, and writes out everything thats going on in the game, and who's disconnecting, and leaving the server.
To create a dedicated server, you have to make sure you have the torque router ports opened, as does anyone who wants to host a game, I'm assuming you know all about that already though. To create the dedicated server though, all you should have to do is create a shortcut of the exe that runs your game in the same folder, and in the target box define it like this..
C:\Torque\SDK\example\torqueDemo.exe -dedicated -mission physics.fps/data/missions/terrain.mis
Thats just an example, but I'm sure you get the idea.
#17
I'm running an AMD 3800+
1 GIG Ram
8 Meg broadband connection.
I'm going to run some serious tests over the Xmas break to see if I can get around the issue with a dedicated server etc. I'll let you all know how I get on.
12/20/2006 (11:32 am)
Yeah, I got it. Cheers all.I'm running an AMD 3800+
1 GIG Ram
8 Meg broadband connection.
I'm going to run some serious tests over the Xmas break to see if I can get around the issue with a dedicated server etc. I'll let you all know how I get on.
#18
12/20/2006 (1:31 pm)
All seems like good advice, what is the basic frame rate on your host when not dedicated, if it starts to drop below 20 you are only updating every 50ms and things can start to queue up. The vehicles will put more load in terms of data flow but it might be possible to optimise some of that out but generally high frame rate is good. Are you using LODs on your models?
#19
Yes, we're heavily 'LODed up' in the game. On my PC the lowest frame rate I'm getting in normal play is about 20-30 when there's loads of explosions going off..... The average is about 70 but can creep just over 100 if you're just sailing around on your own. I have noticed though that if the framerate is really good while hosting, then someone with a poor connection enters the game, the rate on the host can drop to 5 or 10 frames, but only when they are on screen, it picks up again as soon as they're out of view..... Is this normal?
12/20/2006 (3:03 pm)
Hi!Yes, we're heavily 'LODed up' in the game. On my PC the lowest frame rate I'm getting in normal play is about 20-30 when there's loads of explosions going off..... The average is about 70 but can creep just over 100 if you're just sailing around on your own. I have noticed though that if the framerate is really good while hosting, then someone with a poor connection enters the game, the rate on the host can drop to 5 or 10 frames, but only when they are on screen, it picks up again as soon as they're out of view..... Is this normal?
#20
Is this the ships that are under player control? Or other ships that the player is seeing in the level with them.
If the issues are only with other players ships, I'd look into the interpolation code. It's likely that the client and server are disagreeing on the position of the ship and it's not warping to the new position on the client correctly. Also, if you've changed the code in updateForces, that may cause issues. (Maybe it's not deterministic on the client vs. the server).
Just throwing ideas out there.
12/21/2006 (9:52 am)
Quote:They sit for 10 to 20 seconds, then zip across half a mile, vanish etc.
Is this the ships that are under player control? Or other ships that the player is seeing in the level with them.
If the issues are only with other players ships, I'd look into the interpolation code. It's likely that the client and server are disagreeing on the position of the ship and it's not warping to the new position on the client correctly. Also, if you've changed the code in updateForces, that may cause issues. (Maybe it's not deterministic on the client vs. the server).
Just throwing ideas out there.
Torque Owner Max Thomas