360 likes | 424 Views
Online Games: Networking and Data Management. Why do we “network” games?. Playing by yourself is NO FUN! Adds social dimension to gaming But … we have the complexities of distributed computing From a systems perspective:
E N D
Why do we “network” games? • Playing by yourself is NO FUN! • Adds social dimension to gaming • But … we have the complexities of distributed computing • From a systems perspective: • “How do we cope with these physical restrictions, while developing and running our game?”
Taxonomy MMOGs Everquest, WoW Degree of distribution Turn-based Civ, Poker Cooperative Halo, Battlefield 2 Twitch games Doom, etc. Degree of interaction
Lecture Outline • LAN + Internet play • Latency • Scalability • Data management • Tools • Data-driven games
Networked Game “Data” Shared game world
LAN Game Anatomy Client Server Snapshot Physics Physics AI State State AI UI …
“The Duel” Server time
“The Duel” Server work time
“The Duel” Server work time
“The Duel” Server work time
“Massively” Multiplayer • Network latency • E.g. Current TCP/UDP • NYC => Seoul, Korea ~ 150ms one-way • At best speed of light constraint between players: • NYC => Seoul ~= 11000km/c ~= 36ms • Scalability issues • Load balancing • Data dissemination
Network Latency • Two components: • Last-link latency • Server-server latency • Last-link latency is hard to cope with: • Cable-modem => exchange • But no other route…
Dead Reckoning • Predict to overcome latency! • Prediction models: • Newtonian (linear) • Not everything can be predicted … • Developer must think about consequences of failed predictions
“The Duel” Revisited Server time
“The Duel” Revisited Server predict time
Dead Reckoning (in more depth…) • Videos
Data Consistency • Client “cache” • Static data consistency is easy…. • Dynamic consistency is harder… • Ownership issues • “Interest” management
Fairness Models • Who is right, the shooter or the victim? • What are other scoring models? • E.g. everything hurts a lot at first…
Growing the System • Recap the LAN setup: • Suppose we want 1000 players… Client Server
Scalability: Load Balancing • Zone partitioning • Each server may be distributed as a cluster • Server placement and geographical partitioning helps…
Scalability: Data Dissemination • All about saving bandwidth • Tree network between zones • i.e. pub/sub system • Zone transitions: • Artificial impediment to gameplay • “Content-based routing” and “profiles”
Data Dissemination: “Hotplugging” • Open, dynamic systems • Recently attempted by: • WoW • Star Wars Galaxies • Should be seamless!
PlanetLab 645 nodes, 305 sites
Data Management • “What kinds of data are used to build and run games?” • Content: • Visual: models, animations, artwork • Audio: effects, speech, languages • Contextual: plot, missions • Game logic: • Player profiles, inventories, etc. • NPC AI state. • Transient: • Chat, VoIP
Data Management Tools • Expressive, “declarative” approach • High-level triggers and rules • Distribution transparency • Clear-cut specification of game behaviour • Modular frontend and backend extensibility • Automated resource optimization • Scalable • Adaptive • Tolerant to failures
Dataflow Programming • Flow-based representation of program • Based on events and triggers • Game logic defined as triggers • E.g collision induced events • Gameplay from “queries” over events • Supports roles • E.g. “tell me when there are 5 players near my flag”
Dataflow Programming • Borealis Demo • Other distributed middleware kits: • Demonware, Quazcal, ReplicaNet • Opensource: MASSIV, Worldforge
Dataflow Programming • What are good primitives for games? • E.g., collision detection, path planning, etc. • Class-specific primitives? • E.g buy/sell items • Come up with a high-level game template
Data-driven Gaming • Let’s use the data out there! • Content, plot and script generation. • Game “embedding” • Splinter Cell, Battlefield 2 • The Sims • Civilization • “Alternate reality” gaming
Mobile Gaming • Sensors/actuators • Power concerns • Wireless connectivity • Connection range • Interruptions • Data mules • GPS • Camera phones • Google Maps
Data-driven Gaming classify Pirate raid { Mission objective Coastal map Data sources Game level Game entities
Data-driven Gaming Pipeline • Acquisition • News feeds (RSS/Atom) • Integration • Duplicate elimination • Event classification • Morphing • Introducing “dissimilarities” • Consistency checking • Deployment
Conclusions • Latency causes inconsistencies in any distributed game. • Scalable infrastructures to sustain game growth • Data management tools, describing a high-level game representation • Sources of game data
Thanks! yna@cs