How long does it take sending and receiving data using Gamecenter real time multiplayer?

StackOverflow https://stackoverflow.com/questions/23320574

  •  10-07-2023
  •  | 
  •  

Вопрос

I'm making an iPhone game that runs at 50 fps per second. I'm thinking of implementing multiplayer in my game using Game center. But first I have a question how fast I can send data using gamecenter. I will only send a struct with three floats. Is it possible to send data fast enought to make me receive data every 20ms (1/50)?

Это было полезно?

Решение

It could at best take around 15 milliseconds send data.

Другие советы

The only thing you can depend on when sending stuff across the network from a mobile device is that the connection will be slow and intermittent.

If you assume anything else then you will run into problems.

You should always program for the case where the data takes a "long" time to come through and may not come through at all.

For instance, if you're making a real time multiplayer game then have some way of the opponents character moving in a "best guess" way until the next bit of data comes up. Etc...

Also, your games should be running at 60fps not 50.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top