270 likes | 287 Views
Research and Pedagogy of Low-Latency Distributed Interactive Multimedia Collaboration Systems. Dylan McNamee Department of Computer Science and Engineering Oregon Graduate Institute. Using Video Games to Motivate Computer Science Education and Research. Taxonomy of video games
E N D
Research and Pedagogy of Low-Latency Distributed Interactive Multimedia Collaboration Systems Dylan McNamee Department of Computer Science and Engineering Oregon Graduate Institute
Using Video Games to Motivate Computer Science Education and Research • Taxonomy of video games • Computer Science of Video Games • Research Areas
Taxonomy of video games • The Classic [Crawford, 1980]: • “genre” • maze games • shoot-em-ups • puzzles • simulations • Worked for a while, but is now broken • All 3-D games are simulations, most are puzzles, many involve shooting in mazes
An implementation-based taxonomy • Measure attributes of “model” and “view” orthogonally, fit games to matrix: View Model
Teaching computer science with games • Perfect capstone course • Games apply almost every aspect of CS • graphics, linear algebra, ... • operating systems - scheduling, networking, ... • OO programming (and general programming) • compilers, interpreters, language design • architecture, ISA, memory hierarchies, ... • algorithms and data structures • artificial intelligence, artificial life, … • Did I leave anything out?
Example applications • Algorithm Design and Analysis: • performance of algorithms in games is critical • a game’s goal is at least 25 frames per second • serious action games strive for 60 fps • modest machines can perform 50 MIPS • ~2 million instructions per frame • asymptotic analysis, O(n), O(n2), …
Asymptotic performance • How big a problem can be solved per frame?
Effects of scaling processor speed • Assume we use a faster machine or language - 500 MIPS
Another angle at scaling • The evolution of Intel’s microprocessors: • Four orders of magnitude in 28 years 4004 (1971) 8088 (1979) PentiumIII (1999) 486 (1989)
Impact on games programmers • this gets their attention! • traditionally have been “hit the metal” kind of low-level hackers, but: • assembly code buys at most a constant factor speed improvement • asymptotic complexity dominates any constant • time to market matters a lot
Recent developments • classic algorithm analysis analyzes instruction counts, but is this the bottleneck? • today, memory accesses often dominate performance (cache misses) • analyze cache effects of algorithm design • some surprising results • Mergesort, O(N log N) can outperform radix sort O(N), due to radix sort’s poor locality
Simple DS & A application: mazes • Data structure for a maze? • Simple: 2D matrix of cells, but walls? • Forget cells, just store walls • Random maze, using Disjoint Sets ADT: • Pick a random wall • If cells on either side are in a different set • Remove wall, and Union the two cells • Java demo
Aside: union-find for equivalence relations • A set of elements and a list of known equivalence relations (e.g., reachable, not <) • Query whether two elements are related (find) • find(a) == find(b) • Establish equivalence (union) • Brute force: an array a[i] = # of set i is in • Find is O(1), but Union is O(N)
Union-find • Elegant: nodes point to elements in set • In find, collapse nodes to point to root • Complexity becomes quite good: • Worst-case Q (Ma(M,N)), wherea = 1/Ackerman(M,N) , where A(1,j) = 2j for j>=1A(i,1) = A(i-1, 2) for i >=1A(i,j) = A(i-1, A(i,j-1)) for i,j >=2
Projects • Goals - incorporate a broad range of issues • algorithms, OS issues, OO programming, … • Suitable framework: interactive simulations • original motivation for OO programming • natural platform for multithreading • simulation scale stresses algorithms and data structures
Bridge to research issues • Games provide a natural transition to studying current research • an abundance of distribution issues • games on consoles are operating systems • managing shared resources • developing abstractions • soft real-time issues • synchronization • Embedded extension languages are common (e.g., Quake-C, Crobots), safety, speed.
Distribution issue: interaction latency • Goal: users interact with perceived zero latency • Environment: one server, many clients, with star topology • Interaction mode: users deliver projectiles at each other • Problem: high and/or variable latency to server
Solution: client caching • Clients cache players’ motion vectors • Allows piecewise prediction of future position • Server sends position/vector updates • Client display accumulates increasing error • Collision detection performed at client
Client-cached motion vector predictions observation
Problem: cache consistency • Sharp turns or changes in velocity invalidate cached state • Client collision detections are not final • Server arbitrates disputes adaptively • field-weapons: decreased damage • spot weapons: high coherence, thus are less responsive • Dynamic, Adaptive Relaxed Consistency Policy (!)
Another research issue: time • Lots of software doesn’t care about when things happen - faster is better • Excel, Word, Netscape, … • Other applications really do care about time - faster is not better for: • Video game logic, streaming media, ... • Airplanes, cars, medical equipment • Soft vs. hard “real time”
Real time software • Specifies to the operating system when things should run, and for how long • Video frame decode, physics model computation • Guarantees vs. best effort • hard vs. soft real-time • The interface is low level, and hard to use • How to get the system to make it easier?
Real-rate — a new abstraction for systems software • Applications are “pipelines” of processes • One pipeline element is a real-time driver • The system allocates resources to match the application’s rate requirements network client server Display–30 fps
Real rate & software feedback • System uses feedback to monitor and allocate resources • Monitors progress of each connection • Allocates more or less of each resource to keep up with rate requirement network client server Display–30 fps
OGI’s Quasar research applied to games • More axes of adaptivity • sound, richer video adaptivity, consistency as a QoS parameter • Enhancing scalability • Distributed filters embedded in active network • Hybrid media handling • synthetized and real-time audio/video combined • adaptive mixing
Questions? • Other ideas?