Multiplayer Mobile Games
International Game Developers Association
A Multiplayer mobile game is often a re-branding of a multiplayer games for the PC or Console. Most mobile games are single player mobile games perhaps with artificially intelligent opponents. Multiplayer functionaility is achieved through:
- Infra Red.
Infra Red Connectivity
Most recent mobile phones have infra-red connectivity for data sharing with other phones or PCs. This connectivity is not really good for gaming because of its line of connectiviy should not be disturbed.
Bluetooth multiplayer games
Mobiles are connected through a wireless protocol called Bluetooth using special hardware. The games are designed to communicate with each other through this protocol to share game information. The basic restriction is that both the users have to be within a limited distance to get connected. In this type of connection the game mode can only be one to one or two players more like a peer to peer connection between two PCs.
GPRS multiplayer game
GPRS connection which is common among GSM mobile phones can be used to share the data globally. Developers can connect a mass number of mobile games with a single server and share data among the players. Some developers have achieved cross platform games, allowing a mobile player to play against a PC. GPRS best supports turn based games and small RPG games. (Most of the counties have a weak GPRS speed in their carriers. In these types of games, the game communicates with a global server which acts like a router between the mobile phones.
It is important to note there have been efforts in real time multiplayer games as well, such as Scrabble_mobile and Bejeweled 2.
3G and WiFi
3G and WiFi are just emerging in most of the countries, and has a good speed which is good for gaming. WiFi connectivity can only be used for an intra-networked multiplayer game.
Global multiplayer mobile games using GPRS connection
This portion explains about how to create a great multiplayer game for mobile platform using GPRS.
1. Web hosting server 2. database server. 2. GPRS service allowing http connections. 3. A game ready for multiplayer. 4. Some server side scripting
The game server:
The game server is essentialy a router which gets data from any client and redirects it to the right destination client.
An example Server client architecture:
Our example client SDK, which we are going to develop later, should first post a login username details and wait for the response of the server. The server should add the client details to the queue table and should respond back with a game Id which is unique for each game played. Then the client should wait for the opponents. Till then the client should post for the game status. Whether the game has started or still has to wait for another opponent. Now when the other client logs in, the server responds with the same game id. And the status of the game is changed to â€œstartedâ€. Now for reference the game id and the details of the game like who played when and who started will be stored in a different table. Now both the clients should be removed from queue table and taken to the pairs table which holds the game id and client ids. Now the server allots ip address like on a network. Both the clients should then get their ips from the server. Developers should write a routine which creates ips randomly. Ip here we call is not the actual one which we use in networking. It is similar to a GUID (16 byte value) so that we donâ€™t have to check for uniqueness in the game. Once all these transactions are over, the clients start to exchange there usernames and details to display with whom the player is playing with. These transactions are handled in a different table where each entry represents a data transfer between clients. The details â€œwho has sent to whomâ€ and â€œwhatâ€ will be stored there. Once all transaction has been taken before the game, both the clients transfer the game data to the other client. In SMNA we use acknowledgment make sure the other client has read the previous transaction. Unless a client acknowledges the message the other client will wait for the next transaction to take place. This is to avoid loss of data. To make it a complete featured game server we need to implement a high score list on the server. This is all what we do in SMNA. In this server script we have developed separate url script for every requests and posts, so that the load on the server gets spread during the game.
An example SDK development:
Coming to the development of our example SDK, the developer has almost completed most part of the project. Now having it as SDK will be more useful in the future, so that any game can be made multiplayer easily. The SDK should contain classes and functions like this, login(userdetails), checkForOpponent(), getGameID(), getOpponentName(), getIP(), sendData(), readData(). All these functions should use http post and read the serverâ€™s response back and feed the game routine with the information.