For today’s mobile apps, it is quite important to provide interaction among the end users. Consider a game application have users from both Android and IOS and you want them to play together. How about scalability? low latency? user state management? Definitely, there were lots of things you had to deal with so far. On this session, I will try to simplify the things and prepare the sample apps for both IOS and Android talking each other.
2. Mobile application development frameworks
Oguz Bastemur
Phonegap (HTML + JS + CSS) RGB*
Xamarin (C#)
Corona SDK (lua)
and more..
ob@zondig.com (ZONDIG)
Time is
money
friend!
3. Game engines for mobile platforms
Oguz BASTEMUR
Unreal Engine
Unity 3D
Cocos 2D-x
and more!
ob@zondig.com (ZONDIG)
4. Networking for your application
Oguz BASTEMUR
Node.JS (framework)
Parse (service)
PokeIn (framework)
StackMob (service)
+/+
Amazon / Azure / Rackspace ?
ob@zondig.com (ZONDIG)
7. Problems
Oguz BASTEMUR
Client – Server Distance (higher ping rate)
Cross Platform Custom Logic
Load sharing – Scalability
Ease of programming (IDE, Debugger..)
Environment Capabilities
ob@zondig.com (ZONDIG)
8. From App to Server
Oguz BASTEMUR
C#
public void joinGame(int w, int h)
.
Objective - C
NSArray *arr = [[NSArray alloc] initWithObjects:width, height, nil];
[_client send:@"Server.joinGame" withParameters:arr];
.
Java
client.Send("Server.joinGame", w, h);
ob@zondig.com (ZONDIG)
9. From Server to App
Oguz BASTEMUR
C#
CometWorker.SendToClient(playerId,
EXTML.Method("playerShot:andY:andWidth:andHeight:", xs, ys, oppo
nentSize.Width, opponentSize.Height));
.
Objective - C
- (void) playerShot:(NSString *)xs andY:(NSString*) ys
andWidth:(NSNumber *)w andHeight:(NSNumber *)h
.
Java
public void playerShotandYandWidthandHeight(String xs, String
ys, Integer wo, Integer ho)
ob@zondig.com (ZONDIG)
10. Problems
Oguz BASTEMUR
Client – Server Distance (higher ping rate)
Cross Platform Custom Logic
Load sharing – Scalability
Ease of programming (IDE, Debugger..)
Environment Capabilities
ob@zondig.com (ZONDIG)
11. Problems
Oguz BASTEMUR
Client – Server Distance (higher ping rate)
Cross Platform Custom Logic
Load sharing – Scalability
Ease of programming (IDE, Debugger..)
Environment Capabilities
ob@zondig.com (ZONDIG)
12. Problems
Oguz BASTEMUR
Client – Server Distance (higher ping rate)
Cross Platform Custom Logic
Load sharing – Scalability
Ease of programming (IDE, Debugger..)
Environment Capabilities (.NET or JS?)
ob@zondig.com (ZONDIG)
13. Problems
Oguz BASTEMUR
Hello!
This is only
A mobile phone!
fireShot(x, y) -> 8 times per second!
Don’t forget, you are under a different thread!
ob@zondig.com (ZONDIG)
14. Problems
Oguz BASTEMUR
Group ‘em all!
CCARRAY_FOREACH(arrMY, ob){
Jobs *po = dynamic_cast<Jobs*>(ob);
sprintf(xs, "%s;%d",xs,po->x);
sprintf(ys, "%s;%d",ys,po->y);
}
SEND xs and ys every 0.30 seconds!
ob@zondig.com (ZONDIG)
15. Tricks!
Oguz BASTEMUR
- Game timer (cluster wide)
- Timed sensing (basic collision detection won’t help!)
- Multiple connections (double our pipe!)
- Ping your server!
ob@zondig.com (ZONDIG)
16. Tricks!
Oguz BASTEMUR
- Game timer (cluster wide)
- Timed sensing (basic collision detection won’t help!)
- Multiple connections (double our pipe!)
- Ping your server!
ob@zondig.com (ZONDIG)
17. Tricks!
Oguz BASTEMUR
- Game timer (cluster wide)
- Timed sensing (basic collision detection won’t help!)
- Multiple connections (double our pipe!)
- Ping your server!
ob@zondig.com (ZONDIG)
18. Tricks!
Oguz BASTEMUR
- Game timer (cluster wide)
- Timed sensing (basic collision detection won’t help!)
- Multiple connections (double our pipe!)
- Ping your server!
ob@zondig.com (ZONDIG)
19. Tricks!
Oguz BASTEMUR
- Game timer (cluster wide)
- Timed sensing (basic collision detection won’t help!)
- Multiple connections (double our pipe!)
- Ping your server!
Don’t update your opengl objects from multiple threads!
ob@zondig.com (ZONDIG)
20. Finally
Oguz BASTEMUR
Cheers!
Source codes for the games:
RGB Game : http://visualjs.net
Gondor Game :
https://github.com/obastemur/cocos2dxMultiPlayer
ob@zondig.com (ZONDIG)