Mobile phones are no more used for just making calls and sending messages. It has become a valuable source for entertainment on the move. Creating multiplayer games for mobile using Bluetooth has not created a big craze with mobile gamers, so moving to a global multiplayer game using GPRS which says play from anywhere and with anybody around the world, is going to hit a big market on entertainment industry soon. This idea has just been implemented by some big manufacturers. The idea of going with their option for most multiplayer mobile game developers is a bit unimaginable, because of the cost they charge for each game to interact with their server. This article explains about how to create a great multiplayer game for mobile platform using GPRS.
1. A good web hosting server with a strong database server.
2. A GPRS service that allow http connections.
3. A finished game ready to go globally multiplayer.
4. A bit Server side scripting knowledge.
This is all that are required to develop a global multiplayer mobile game using GPRS connection.
The game server:
The total concept of the game server is to build it like a router which gets data from any client and redirects to the right destination client. Our game server is going to do the same work.
Server client architecture:
The 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.
The Multiplayer game SDK development:
Coming to the development of 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. Additional features like posting high scores and adding communities and rooms are very essential for the game server to reach the large market.
Smackall Games, a mobile game development company with a passion on multiplayer SDK development has developed a game server. The game server and SDK both are for sale. The game server is coded in PHP and J2ME. This is a cross platform game server, where people from a website or PC connected to internet can compete with a person playing on mobile. It has a good high score database and a community management system to review on the game. Get your free project estimation here