Proving correctness of a multiplayer game server

841 views

Published on

Session Presented at 2nd IndicThreads.com Conference On Software Quality held on 25-26 March 2011 in Pune, India
WEB: http://Q11.IndicThreads.com

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
841
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Proving correctness of a multiplayer game server

  1. 1. Proving correctness of a multiplayer game server Nirmalya Sengupta Freelance Software Technologist Nirmalya Sengupta
  2. 2. Background <ul><ul><li>Dutch company, decided to enter Online Poker market </li></ul></ul><ul><ul><li>Indian start-up given the job of development, deployment and support </li></ul></ul><ul><ul><li>Scope: an entire betting game environment </li></ul></ul><ul><ul><li>First version to be deployed in 12 months’ time </li></ul></ul>Nirmalya Sengupta
  3. 3. Application: a bird’s eye view Nirmalya Sengupta Player Portal Game Server Lobby Server Tournament Server Database RabbitMQ
  4. 4. Servers must be ... <ul><ul><li>Robust </li></ul></ul><ul><ul><li>Network ready </li></ul></ul><ul><ul><li>Support for ‘ Statefulness’ </li></ul></ul><ul><ul><li>Easy to interface with external systems </li></ul></ul><ul><ul><li>Highly threaded </li></ul></ul><ul><li>RedDwarf (previously Darkstar) </li></ul>Nirmalya Sengupta
  5. 5. Important aspects of Server <ul><ul><li>Reactive to Events : Events give rise to other Events </li></ul></ul><ul><ul><li>Actions on Events are taken by Tasks (piece of code) </li></ul></ul><ul><ul><li>Tasks are scheduled (asynchronous), not executed immediately </li></ul></ul>Nirmalya Sengupta
  6. 6. Important aspects of Functionality <ul><ul><li>Randomness : legal requirement </li></ul></ul><ul><ul><li>Arbitrarily fired Timer s: necessity </li></ul></ul><ul><ul><li>Network connection with player can drop anytime: game must continue </li></ul></ul><ul><ul><li>Multiple simultaneous tables & tournaments </li></ul></ul><ul><ul><li>Game History must be retained : legal requirement </li></ul></ul>Nirmalya Sengupta
  7. 7. Important aspects of Design <ul><ul><li>Home-grown binary protocol between client and server </li></ul></ul><ul><ul><li>Application waits for and reacts to Event s only </li></ul></ul><ul><ul><li>Accurate detection of network connection’s availability </li></ul></ul><ul><ul><li>Tasks handle Event s ( asynchronously ) </li></ul></ul><ul><ul><li>Database plays an adjunct role (post-facto) </li></ul></ul>Nirmalya Sengupta
  8. 8. Picture: player joins while game is continuing Nirmalya Sengupta
  9. 9. Picture: Player plays on two tables, leaves one Nirmalya Sengupta Real World (Player using client software) Virtual World (Player represented in server software) Network connection
  10. 10. How to test a software which.. <ul><ul><li>is distributed </li></ul></ul><ul><ul><li>is completely asynchronous </li></ul></ul><ul><ul><li>is asking testers to be good Poker players </li></ul></ul><ul><ul><li>is affected by Timers (arbitrariness) </li></ul></ul><ul><ul><li>Must withstand tens of thousands of simultaneous Players </li></ul></ul><ul><ul><li>is expected to display minimum latency always </li></ul></ul>Nirmalya Sengupta
  11. 11. Steps taken to increase testability <ul><ul><li>Gamerules and Business rules contained in a FSM </li></ul></ul><ul><ul><li>Robot s written which could play Poker </li></ul></ul><ul><ul><li>Binary protocol carried Roundtrip time data </li></ul></ul><ul><ul><li>Facility to fire pre-configured Timers </li></ul></ul><ul><ul><li>Specialized Sniffer tasks deployed </li></ul></ul><ul><ul><li>Handcrafted cards were dealt to players </li></ul></ul><ul><ul><li>Deployed Event pattern detection ( Esper ) </li></ul></ul>Nirmalya Sengupta
  12. 12. Our observations <ul><ul><li>Designer must consider phases of QA , Deployment and Support while designing structure and feature </li></ul></ul><ul><ul><li>Asynchronous, Event-driven software offer different challenges and benefits </li></ul></ul><ul><ul><li>QA team of programmers: considerable benefits </li></ul></ul><ul><ul><li>Automation: functionality and performance </li></ul></ul>Nirmalya Sengupta
  13. 13. Questions? Nirmalya Sengupta

×