MMO (Massively Multiplayer Online) games are the ones where large number of players are present at a time and interact with each other. One such popular game is World Of Warcraft. Today several MMOs have been released in the market, and many of them have been successful. One type of MMO is MMORPG which has become very popular. This type of game involves an element of RPG with MMO.
Developing MMORPG can be a lot easier with AppWarp because as a developer you will need to focus only on the Story and GamePlay of your MMORPG regardless of the server implementation.
Recently, we developed a MMO game with AppWarp for Flash Platform. The game is called SpaceWarFare and is open source. The github repo is located here.
To play it, click here.
Use arrow keys to move and click mouse to shoot.
The game is built using Flixel Game Engine and has been integrated with Facebook.
GamePlay:
As a player you can move around in the room. There are five items that are always present in the room: Bullets, Health and 3 Diamonds. Diamonds give you score, Health increases your health and Bullets give you some more bullets. Whenever you see the other player, you can shoot him with your gun. Whenever a player is shot, his health is reduced. When health reaches 0, the player is dead. To recover health, he has to pickup health icons.
Implementation
A single room was created statically from the AppHQ panel. The player is always joined and subscribed to that room. The 5 items described above are stored as room properties. Whenever a player moves, his information is sent through sendChat() function. We are sending JSON data to describe a player’s movement. The JSON sent is
{
type : 1,
x : ‘the x component of player’s position’,
y : ‘the y component of player’s position’,
name : ‘the display name of player’
}
Whenever a player shoots the other player, another JSON message is sent describing this information. The JSON sent is
{
type : 2,
p : ‘the player that has been shot’
name : ‘the display name of the player’
}
The first challenge was: how often the position messages should be sent. If we send messages every time a player is pressing a key, there will be a lot of messages, and if we send messages whenever a player releases a key, there will be very less messages leading to a jerky movement on remote player’s game. Hence we decided to divide the game into a grid of 25×25, movement information is only exchanges when a player moves from one block to another.
The next challenge was to place the items. Since there is no authoritative server, the question was who will place the item. So we came up with a solution that places items very cleverly. Whenever a player obtains an item, he places them randomly in the room, so the player, who obtains it, is actually responsible for the next location of that item. Since we have used room properties to store the location of items, those items remain at the last location they were placed even when there is no player present. The items are stored in JSON format as a room property. The example of property being used is
{
"item1": {"x": 9,"y": 10},
"item2": {"x": 5,"y": 8},
"item3": {"x": 20,"y": 14},
"item4": {"x": 15,"y": 18},
"item5": {"x": 25,"y": 10}
}
The game is integrated with Facebook. Hence, the player needs to have a Facebook account. The Facebook Id is used to connect with AppWarp server. The name of player is obtained from the GraphAPI of Facebook SDK.
Further Improvements
SpaceWarFare was a basic demo game built to showcase the capability of AppWarp but it can be easily extended into a complete MMORPG game.
Multiple rooms can be created and then players can easily be divided into those rooms. Rooms can also be integrated with the story of the game such that as the story goes on more rooms are unlocked and players sharing the same part of the story are in the same room. Also, there can be rooms where players with specific skills only are allowed.
Another great improvement in the game can be maintenance of player profiles. By integrating the game with App42, one can create profiles and save user’s progress. Leaderboards can also be added into the game through App42.
One more interesting improvement can be addition of objectives. As the game goes on, new objectives will be unlocked.
if you have any questions or need any further assistance,please feel free to write us at support@shephertz.com.
Leave A Reply