android - multiplayer game using surfaceview for drawing and bluetooth for multiplayer (performance) -


i'am building game android. game works using same architecture google's lunar lander. studied bluetooth api , bluetooth chat app. make game can played 2 devices ageanst each other using bluetooth.

i'am making pong style game. have ball , 2 paddles. 1 each player. i'am using thread updating game , redering surfaceview. i'am using thread sending position of paddle other device. game runs @ 50 fps. means 50 writes on bluetooth. method works, there huge delays...

how should improve bluetooth performance? type of input , outputstream shoud use?

kind regards

you shouldn't rely on connection good, expect variable delays.

you need kind of time synchronization, , timestamp events when other side late, can calculate ball should @ moment, , game stays in sync.

as understand it, minimum should send/timestamp pallet position while hits ball and/or outgoing vector of ball, on other device can calculate on own happen until hits ball en same. pallet updates on supplementary.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -