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