Click here to Skip to main content
Click here to Skip to main content

Multiplayer Games powered by Azure

, 12 May 2013
Rate this:
Please Sign up or sign in to vote.
Introductory article for my submission in Windows Azure Developer Challenge

Please note

This article is an entry in our Windows Azure Developer Challenge. Articles in this sub-section are not required to be full articles so care should be taken when voting. Create your free Azure Trial Account to Enter the Challenge.

Introduction

I am going to develop some multi-player games and an envelop website for this challenge . Overall all of these Ideas will revolve around multi-player games so this article will also have a brief introduction about multi-player games and some tricks which we are going to use while programming them .

What we are making 

As each stage need a new idea we are doing following 

  1. Phase 1.Writing this article "Getting started" 
  2. Phase 2 :Building an envelop website to contain our two games /a forum /our blog etc.
  3. Phase 3:A real time racing multi-player game where players can race and even sabotage other player races .
  4. Phase 4:A turn based combat multiplayer game .
  5. Phase 5 :A mobile device multiplayer vehicle racing game (Game played against ghost play session of other player ) . 

Azure Benefit

As a individual developer I am low on human resource so Azure can be game changing for me by helping me to scale easily and quickly ,without azure I can not dream of releasing a multiplayer game to public .

Background

Video games that are played against some form of human opponent are multiplayer games .

Multiplayer game types .

On a broad scale multiplayer games are divided under two types . and have many sub types . 

  1. Real time multiplayer games.
  2. Turn based multiplayer games.

The multiplayer games that use low latency network like lan do not need to deal with problem like lag etc .
even with a high latency network the multiplayer games those are turn based does not have much problem due to lag .

For a smooth game play in a real time multiplayer game we need to follow following three things

  1. Input prediction
  2. Lag Compensation
  3. Interpolation

Even a high speed round trip of packet on a 250 ms latency in actual observable by a player in multiplayer game .

Input prediction

If we let a packets round-trip between server and client to decide client action after a key press , it will have a noticeable delay ,to remove this we can immediately process client side input and animate client action ,which will behave as a fog screen till we acknowledged this action by checking it in step too that is lag compensation . This will only effect client own avatar .

Avatar position is updated immediately using client side rules, not waits for server confirmation.

Lag Compensation

After all in this game the server provided data is considered true .So if our predicted position is out of sync with the server provided position out position will be updated with server provided data ,The lag compensation is responsible for the god like kills where you got killed in a death-match even when cant see your opponent , because on server side actually your avatar is in visible range this can occurs due to packet loss or lag . in this case the received frame is considered true and even if we do not roll back client position but will account the received frame for future updating of our game world ,even for consider winner in our final game

Interpolation

As we are predicting our character position so to avoid other players avatar to look jittery we need to interpolate their position between to snapshots which we receive from server . All the other players will see their own avatars immediately where other players avatars would be interpolated and player see a rendering time which is somewhat delayed than its own time. Thus interpolation adds a self created latency to players world on cost of smooth animation ,this should be keep minimum .It is up to us to trade between accuracy and certainty .

Interpolated frame will ease the other avatars animation and will be rendered between received frames.

Phase 2:

I am not to sure what I am developing exactly for phase 2 so this part will be written when I will spend some time developing the website .But at least I can export my WordPress blog"Not updated from a long long time" to azure . 

 

Phase2Update  

The weblink for the ported site is  http://praveenojha.azurewebsites.net/

 

For the deadline I have ported my WordPress blog (http://www.praveenojha.com/)  to azure (http://praveenojha.azurewebsites.net/)

Here is quick how to port a WordPress blog to azure  

1.Preparing your blog for porting . 

    a .) Login to WordPress admin (wp-admin ) of your blog
and  export all contents using export under tools 

download the file ,even you can download the same theme.

2.Create a new WordPress website in azure  . 

a)Using new in website under all items. 

b)Create one from gallery  

c)choose WordPress with new MySQL data base . 

3).After you create website go to the website

a)Create an account and import the file exported in step 1. 

 

b)Install the missing plugins and theme  

Import of your  WordPress site is finished. 

  

Phase 3

Development of a real time multiplayer game .

The racer game will use SQL database to store user progress, exp points, temp playlist of available multiplayer games etc . 

The client will start with the chat /lobby room selection screen ,where player can select a lobby to join ,after joining lobby he/she can chat with players in same lobby and can search for games.

After selection of a lobby player will see lobby /chat screen

where player can search a game to play and can proceed to game screen

*All these image are only for reference actual product will be different and use real artwork .

Technology what will be using to make this game.

The game client will be an html 5 app using websockets .

Where as the server side app hosted on azure platform will use node.js .

Some example to use those can be found at http://socket.io/#how-to-use

Read those if interested in implementing a client server model for your app.

Or wait for a future article which will contain partial source code o my app .

This app will provide real time intersection between users .A player can create a hole behind him to sabotage player behind him where a behind player can find a weapon and can shoot forward player

As being a real time game this game will implement all 3 strategy briefed above.

Phase 4 :

Development of a turn based action game .This is not a real time game .In this type of game each player has a max allowed time to announce its action if announced in time the action will send to other player or the chance is passed to next layer .

This game will have top layers same as game designed in phase 3 , instead we can say this is reuse of code of phase 3 till exact game .

This game is turn based where each players data only travel to other player after its declaration .

Scalability using azure Server instances .

Phase 5

Multiplier Vehicle race game on mobile. This is simplest form of multiplayer game .We will make each user play in his sand box recording his/her inputs and sending them to server after the game finishes .

The player will play again a ghost image of any other player which we will provided to the mobile app at the start of new game ,

The best suited game using this technique is drag racing games so I am making one . As the player starts his vehicle the app will start process the ghost image and the player will win on loose depending on his vehicle and ability .

This game can also incorporate messaging service provided by azure thus user can know about updates offers etc .

Background

I was really interested in making multiplier games for a long time .

I once wrote a client server simple flash game that was a quiz game, can be played here

http://www.mochigames.com/game/quiz_v4/

That was in 2010 and it used amfphp and flash (action script 3 )

but this would be first time I will be going to write any real time multiplier game .

Using the code

No code to show write know but stay tuned and book mark this article as soon there is some really useful code for you if you are into game designing. Coming soon.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

PraveenOjha
Chief Technology Officer InductionLabs
India India
Currently I am an independent developer usually develops under brand name Induction games sometimes under Induction labs ,Can say that I am professionally developing apps for more than 4 years .
 
Some links to my apps in different apps stores are ..
 

Windows Phone
http://www.windowsphone.com/en-US/store/publishers?publisherId=InductionGames
 
Android
1. https://play.google.com/store/apps/developer?id=Induction+Labs&hl=en
2.https://play.google.com/store/apps/developer?id=Induction%20Games
 
Blackberry Store
http://appworld.blackberry.com/webstore/vendor/39848/?lang=en
 
Flash Games :
http://www.mochigames.com/developer/praveenojha/
*my flash portal is no longer active so the quiz game cant be played .
 
Perceptual computing phase 1 first prize Winner app (air piano)
http://software.intel.com/sites/campaigns/perceptualshowcase/air-piano.htm
 
My Blog
http://praveenojha.com

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 12 May 2013
Article Copyright 2013 by PraveenOjha
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid