Application Design
The design phase of the project consists of two main sections the game play design and the communication protocol design.
Communication protocol
The game is based on two communication protocols namly SMS and Bluetooth. Both protocols are used to exchange the actual state of the game at a given instant. Before starting the game the user will select the kind of communication protocol to use and then the user will continiue to play the game by sending current states.
In the SMS part the application is expected to include a componet that lets the user invite other players. This can be done by providing a UI interface to let the user write a simple message to a friend. When the user recives the message he can start the game by joining the person who invited the user. When joining a game the user will start SMS server on specified port so that he/she can recive sms from other parties and act accordingly.Upon reciept of a game state the local device will make a remote move on behalf of the remote user. This will simplify the implementation of the game protocol and reduce the amount of data to be sent between users.
If the players have saved a game the application uses SMS push mechanism to start a midlet of the other player to resume a game. We have designed a record managment system to store the sate of the game locally. The push registry mechanism enables the user to automatically invoke a midlet to start the game. Using this feature we are able to simplify the communication initiation procedure. Th figure bellow shows the SMS protocol using two players.
The bluetooth part of the game enables devices to srart in either server or client role. If the device starts in server mode it will register a service so that clients can discover the servie and start communicate with it. We have uses the bluetooth serial port profile protocol to communicate with the server. When the client starts it will start by looking of deives around it. when a device is found it will start looking for services with a given UUID. If the required service is found the device will open a connection with the server and the start communicating with IO streams.
Both the communication protocols are tested and implemented using the approprate apis and are tested on various devices including M600i, K500I.
|