building game cloud with python
TRANSCRIPT
![Page 1: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/1.jpg)
做遊戲學python用python打造的遊戲雲
![Page 2: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/2.jpg)
About me
● yyhuang● a.k.a 黃小鴨
● Game programmer of IGS (鈊象電子)
![Page 3: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/3.jpg)
Scalable Game Cloud for Mobile & Social Games
![Page 4: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/4.jpg)
Game Cloud For...
● Save all game records○ game progress○ level, exp, energy, ...○ virtual money
Hay Day - Supercell
![Page 5: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/5.jpg)
Game Cloud For...
● Play from any device○ PC○ iPhone○ iPad○ Android○ Windows Phone○ ...
Puzzle & Dragons - GungHo
![Page 6: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/6.jpg)
Game Cloud For...
● Social feature○ invite friends○ messages○ gifts
● Competition○ leaderboards○ tournaments
Candy Crush Sage - King.com
![Page 7: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/7.jpg)
Game Cloud Features
![Page 8: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/8.jpg)
Login and Authentication
● Facebook account● Auto generate ID from mobile hardware● Allow concurrent access or not
![Page 9: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/9.jpg)
Communication Manager
● HTTP-based communication○ apache + php○ wsgi○ gevent + bottle
● Serialize/Deserialize messages○ amf○ json○ ...
![Page 10: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/10.jpg)
Communication Manager
● Message sequence check○ Queue requests
● Dispatch message to game servers○ RabbitMQ○ Python Queue module
● Callback interface for client○ Asynchronized○ Synchoronzied
![Page 11: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/11.jpg)
Game Database
● Usually interested in data of one player● NoSQL database
○ Non-relational○ Key-value documents○ Easier to shard
● MongoDB○ pymongo
![Page 12: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/12.jpg)
E-commerce Server
● Real money to virtual money● Multiple currencies in game● Admin interface for setting up item price● Separate logs
![Page 13: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/13.jpg)
Deployment
● git● python package● boto for AWS control● salt
○ deploy commands○ control commands
![Page 14: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/14.jpg)
Architecture
![Page 15: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/15.jpg)
Game Server Development
![Page 16: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/16.jpg)
Games on our platform
● Facebook games○ Airline Fantasy○ Billiard Ace
● Mobile games○ 極速摩托
○ 美髮玩家 1&2○ Slots Paradise
![Page 17: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/17.jpg)
Libraries
● Config loader○ Consistent config rules○ Environment check
● Log libraries○ python logging○ syslog-ng
● Database API wrapper
![Page 18: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/18.jpg)
Environment
● VirtualBox○ Local development environment
● Amazon EC2○ Development
■ Feature test and verify○ Testing
■ Version ready for release○ Release
![Page 19: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/19.jpg)
Development Process
● Scrum○ agile○ iterative○ incremental
● Split user story to the fundamental● Focus on the unknown problem
○ The best part of python
![Page 20: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/20.jpg)
Finally... Life Saver
● unittest● pdb● cProfile● ... and git
![Page 21: Building game cloud with python](https://reader034.vdocuments.mx/reader034/viewer/2022042700/559b63c51a28ab0a258b4641/html5/thumbnails/21.jpg)
Thank you
● Q & A
● Contact○ elmnhuang at gmail dot com