|
3 registered members (AndrewAMD, juanex, Grant),
1,018
guests, and 8
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
bytes per second and sending files
#350936
12/20/10 14:40
12/20/10 14:40
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
I've read somewhere (maybe it was the multiplayer tutorial) that you should not go higher than 2000bps in an online game. The more interesting point is IMO, how many bps (reliable <-> unreliable) are okay for an active and moving player? I want to support ~16 players and I'm using the native gamestudio mp, if that makes a difference.
@EDIT: Is it possible to send a file from a server to a client without uploading it somewhere?
Last edited by Superku; 12/20/10 16:15.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: bytes per second and sending files
[Re: Superku]
#350981
12/20/10 18:42
12/20/10 18:42
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Yes, it's possible. Multiple ways I can think of:
a) code it yourself. This would be the most flexible way I guess. It will consume traffic, but so would any other way of sending files. I'd open the file in binary and start reading around 100 characters at a time, then send those to the clients. The clients receive the file and put it back together, then save it to the harddrive and then load it like a normal 3dgs resource. b) use ANet...
I use ANet's filesending function, that works, but I don't think gamestudio has those functions... correct me if I'm wrong. So the only way to do it in 3dgs that I can see is coding it yourself...
I have no idea about the traffic. I've never had enough players connected to test that. I don't know if it works for you that way, but I coded my function so that everything relies on a variable which holds the time between two updates. So the clients interpolate between positions and estimate future positions using that update time variable, and the server sends the update after the same interval. That way, if I should ever notice that the time interval is too short (it's 2 ticks, so 1/8 of a second atm) I'll have an easy time changing it. Maybe that approach would work for you? Also, should it become necessary I can easily add a function which changes the variable during the game, which would allow the game to adapt a little to slower connections. I'm no expert at this, but it's worked so far.
Hope that was of any help...
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: bytes per second and sending files
[Re: Germanunkol]
#351014
12/21/10 00:25
12/21/10 00:25
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Thank you very much for your response, Germanunkol! a) Yes, that should be possible, maybe I'll give it a try. (Or I will choose option c) and make a feature request.) Traffic: I do it the same way and I only send updates every 2 ticks, too. I interpolate (more or less linear) between positions, but the time/ update variable sounds like a nice idea. The "only" problem is the avoidance of extrapolation on sudden stops that happen quite often in my game. Also, should it become necessary I can easily add a function which changes the variable during the game, which would allow the game to adapt a little to slower connections. Funnily, I've thought several times about this possibility, too, and I will probably implement it soon.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: bytes per second and sending files
[Re: Spirit]
#351077
12/21/10 17:06
12/21/10 17:06
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
Expert
|
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
When you have sudden stops that you need to handle, I'd try to send an extra event/variable when there's a stop instantly. There's usually no way for the other players to predict a sudden stop, so sending a variable might work. This can result in a tint more traffic (one variable a stop) but that is so little that it wouldn't matter. And that way, the client's shootover over the correct position where the other client stopped will be limited.
Http functions: If the up and download only happens before the actual game (i.e. during the loading process), that would be a neat solution, I think. But I believe you'll need to thread them as http functions are quite slow and can freeze the game while they wait for responses?
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: bytes per second and sending files
[Re: Germanunkol]
#351087
12/21/10 19:15
12/21/10 19:15
|
Joined: Jul 2005
Posts: 1,930 Austria
Dark_samurai
Serious User
|
Serious User
Joined: Jul 2005
Posts: 1,930
Austria
|
@Germanunkol: The http functions are running in a seperate thread (in ANet and in GS). With ANet's file functions, you have the possibility to limit the traffic that is used for file sending. => Playing should be possilbe even if files are downloaded. The advantage of this method is that you don't need another server (expansive, you don't need to manage the server, you have the risk of a breakdown of the server => game won't be playable,...) and your game also works if you have a lan server (because I guess no one want's to install a ftp server to play the game in lan  ).
ANet - A stable and secure network plugin with multi-zone, unlimited players, voip, server-list features,... (for A7/A8)! get free version
|
|
|
|