Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Vehicle game multiplayer #240205
12/09/08 23:26
12/09/08 23:26
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline OP
Serious User
croman  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
Hey,

I'm working on vehicle(physics) multiplayer game with ANet plugin and so far it works but when testing over internet it's very very laggy.

When testing over localhost (1 host, 1 client) i get 48kb/s sent and 48kb/s received for host and 22kb/s sent and 22kb/s received data for the client. this is a lot, right? smile

each car is moved on it's own pc and then it its entity on other clients + 4 tires also.

does anyone know how can i make that traffic smaller? where should i do car movement and how should i update its position?

______________________________________________________________
p.s. you dont need to be familiar with ANet., just if you know any good idea or how it is done on all other car MP games, please let me know



Ubi bene, ibi Patria.
Re: Vehicle game multiplayer [Re: croman] #240247
12/10/08 08:23
12/10/08 08:23
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
If you send 48000 bytes thats every second, you definetely send 99% unnecicary data to display a car movement.

As rough example: 5 position updates for each car per second with x,y,z, angle and velocity values would need only about 160 bytes per second for the actual data, for 4 cars 640bytes + the overhead.
Lets say with sending other information plus the requires overhead, 1 to 2 kiloby/second should be an optimal target.


Moving a car on the client has the advantage of fast reachtion, but will give you problems with synconous interaction (like collisions),
so:

-Move all cars only on the server.
-send 5 to 10 times per second the x,y,z,pan,tilt,roll and x,y,z velovity values to the clients
-interpolate the data manually, and position the cars on the clients

-clients only send the movement commands 5 to 10 times per second to the server

Re: Vehicle game multiplayer [Re: Oxy] #240319
12/10/08 14:08
12/10/08 14:08
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
Moving something on the server is realy chewy on the client that moves the car. Just imagin, it will need the whole ping (to the server and back) until he sees his car moving.

I would still move the car on the client. Collision is not a big problem if you use collision detection also on the client when interpolating (Of course this could create wrong positions but if you update the positions from time to time, this shouldn't be a problem).

There are a lot of methods and tricks how something could be done. You should do a little testing, and playing around to see which one works best for you!

You could also search the net for good ideas.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Vehicle game multiplayer [Re: Dark_samurai] #240329
12/10/08 14:47
12/10/08 14:47
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
This really depends on the target-latency.
For LAN games, a pure server control is the easiest sollution

For internet games, the client-movement might be the better sollution, but requires much more manual optimization

Re: Vehicle game multiplayer [Re: Oxy] #240330
12/10/08 14:50
12/10/08 14:50
Joined: Jul 2005
Posts: 1,930
Austria
Dark_samurai Offline
Serious User
Dark_samurai  Offline
Serious User

Joined: Jul 2005
Posts: 1,930
Austria
You are rigth, I thought he want's to develope for the internet, because he said that he tested it over the internet.


ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)!
get free version
Re: Vehicle game multiplayer [Re: Dark_samurai] #240345
12/10/08 15:21
12/10/08 15:21
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline OP
Serious User
croman  Offline OP
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
thnx both of you for your ideas/comments.
my main target is playing over internet.

i'll try your method now, Oxy



Ubi bene, ibi Patria.

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1