1 / 34

BATTLELOG

BATTLELOG. //Building scalable web sites with tight game integration. Johan Mjönes & Joakim Bodin. BATTLELOG. What is battlelog? Battlefield 10 year anniversary soon Battlelog becoming the community hangout Integrate game launching for PC players. BATTLELOG. Features Friend-centric

seda
Download Presentation

BATTLELOG

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BATTLELOG • //Building scalable web sites with tight game integration • Johan Mjönes & Joakim Bodin

  2. BATTLELOG What is battlelog? • Battlefield 10 year anniversary soon • Battlelog becoming the community hangout • Integrate game launching for PC players

  3. BATTLELOG Features • Friend-centric • Easy communication • Current stats and history • Activity log • PC Menu • News / Forums

  4. SCALING

  5. TECHNOLOGY

  6. TECHNOLOGY ESN PLANET

  7. TECHNOLOGY ESN PLANET OVERVIEW

  8. TECHNOLOGY Languages • Developing Battlelog means developing in Python, Java, C++ • The Battlelog Web is written primarily using Python • Plugin, game components in C++ • Python allows for rapid web development (e.g. remote access console)

  9. TECHNOLOGY Partitioning Horizontal (sharding) Vertical Battlelog Battlelog Lab Feature 1-7 7-14 ... User ... ... User DBs (slices and shards) Different processes

  10. TECHNOLOGY Persistence & Index • MySQL • No joins • Used as indexed KVS • Apache Solr • Full text search for forums • Other uses in the future • Fast!

  11. TECHNOLOGY Server to client push • Uses ESN Beaconpush • Allows delivery of messages from web server to client browser. • Uses long polling or websockets (or flash) • AV / anti-malware software + push = • Blocks all websockets • Injects Javascript into the DOM • Etc...

  12. TECHNOLOGY Caching with Memcached • Great framework support • Service methods cached via annotations • Invalidation using method signature instead of key • Allows populating cache directly after modification • Dog pile prevention

  13. TECHNOLOGY EA Services • Nucleus • Users • No user info in Battlelog DB! Success! • Personas • Soldiers • Entitlements • Licenses • Blaze • Game Servers reports to Blaze • Events to Battlelog • Game Server information • Asynchronous responses (e.g. matchmaking) • REST • Stats

  14. TECHNOLOGY Nucleus Details Web Soldiers Licenses Nucleus Accounts Entitlements Web Backend HTTP

  15. TECHNOLOGY Game Servers Blaze DB Blaze Details • Uses Web Access Layer (WAL) • WAL client generated from TDF • TDF is a API definition language • Blaze events (XML over HTTP) Blaze Events WAL Thrift Web Frontend Web Backend Real-time Events AJAX Web Browser

  16. BATTLELOG FEATURES

  17. BATTLELOG FEATURES Friends • Started out normalized • Unmanagable amount of rows • Ended up as one blob per user • Packed user ids • A lot easier to cache properly

  18. BATTLELOG FEATURES Server Browser • Custom search server (Java) • Custom query language, minimal message overhead • Fast update, fast search

  19. BATTLELOG FEATURES Joining a game

  20. BATTLELOG FEATURES

  21. BATTLELOG FEATURES Joining a game: plugin details Web Browser Game Client Pipe Plugin Game UI JS

  22. BATTLELOG FEATURES Battle Reports • Game report from Blaze (HTTP XML event) • Parse and divide per player • One report per player via internal message queue • Look for unlocks, rankups, medals, awards etc • Add to feed, send real time updates • Invalidate player stats caches • Compile Battlereport (& pre-cache it) • Send notification to involved (logged in) users

  23. LOAD TESTING

  24. LOAD TESTING Background • Load tested using Locust • Open Source (MIT License) • https://github.com/cgbystrom/locust • Built by ESN (& others) • Battlelog tested with 2.7 million PSU with 36 million players • That’s 40,000 requests per second • The tests was successful

  25. LOAD TESTING Pre-pass • Planet dev bar • Timing • Queries • No point in load testing if there are apparent issues with a single user

  26. LOAD TESTING Realistic load testing • Some testing tools simply hammer certain URLs • Locust allows for realistic usage scenarios • Many players go away for 20 minutes while playing, receiving notifications • Updated tests using actual usage data from alpha trial / open beta • Coordinated testing • Same user spans • Overpopulate tables to simulate fragmented MySQL indices

  27. LOAD TESTING What did we find? • Bugs • Bottlenecks • Never assume where your bottlenecks are • Test to find out • Network related • Saturated network, not CPU • Keep the traffic within the rack! • Software related • Best practices be damned, cheat if neccessary • Lazy loading data in controllers • Client side rendering • Surface + History API + JSON =

  28. GAME + WEB DEVELOPMENT

  29. GAME + WEB DEVELOPMENT Being a part of the pipeline • Data driven games • Battlelog has its own pipeline • Written in Python • Imports data from the game pipeline • Weapons, vehicles, levels, dog tags, etc • Assets include images, text, data • Resolving unlocks and dependencies • Generates python structs and javascript structs • Generates many helper maps. Some might only be used once. • DLC friendly! • Result of many iterations

  30. GAME + WEB DEVELOPMENT User Interface • Separate UI from consoles / in game menu • Having the same wouldn’t make sense, different UX • Adapt to different devices • Web features • Easily accessible, e.g. Sharing • Extendability with browser extensions, user styles etc • Access on any platform (play on console, have Battlelog on iPad) • Easy to iterate over UI changes

  31. THE FUTURE

  32. THE FUTURE Battlelog will evolve • Agile: Easy to update • Big things: • DLC • Public APIs • Other things we can’t talk about • Small things • Improvements based on community feedback

  33. YOUR TEAM WON

  34. QUESTIONS? Johan Mjönes @nollbit Joakim Bodin @jbripley The Battlelog team is hiring! http://dice.se/hiring.asp jobs@dice.se Technical Director Development Director Backend Frontend

More Related