Console Games Are Just Like Mobile Games* (* well, not really. But they are more alike than you think ) Hi, I m Brian Currently a Software Architect at Zynga, and CTO of CastleVille Legends (for ios/android) Professional Game Developer since 1995 (gasp!) Started making PC games, moved to console games (8 different platforms), then Facebook, now mobile Worked on some high-profile titles, including games in the Tomb Raider and Tony Hawk series. (Please interrupt me with questions as I go ) 1
Making Games Is All About Constraints All development is about constraints, really. Always constrained by time, money, or people. Games are also constrained by hardware. That s why it s all smoke & mirrors. It doesn t need to behave exactly like smoke. It just needs to look mostly smoke-like. Smoke, water, physics, even lighting. Doing it right isn t always practical (or even possible). So you always have to walk the line between looks good enough and performs well enough. Performance, Performance, Performance! A great game that runs slowly is going to suck have a sub-optimal user experience. A game that has a choppy / inconsistent frame rate is also unpleasant. Often worse than one that is slow & steady. Depends on the genre of game. More important for a fighting game than a puzzle game (usually). Which brings us to our first real constraint 2
Constraint #1: Frame Time To run at 60Hz, you get 16.6ms / frame. Period. Because of graphics card refresh rates, and TV scan rates, etc., you can't really run at 59Hz w/o tearing. If you take too long, you drop to 30Hz, which is noticeable. Fixed number of CPU cycles - gets complex with a GPU running in parallel, but the idea is the same. Runtime "engine" takes some of that as overhead, so you need to budget for rendering, UI, AI, game logic. (Recall Dan s talk about runtime? ) Big burst of particles & sound effects does that tank the framerate? Can you spread them across multiple frames? Applies to all platforms -- Facebook games, PC games (generally only on minimum hardware), mobile & console. What are some ways to make things use less CPU? Cache The Data! Instead of calculating everything every frame, calculate it once, and store the result until it changes. Fewer calculations -> less CPU used. That s the classic trade-off: speed versus memory used. This brings us to our second big constraint 3
Constraint #2: Memory Footprint Pro tip: on mobile devices and consoles, there's no virtual memory. Think about that for a second That means memory allocations can fail. That means that in addition to a CPU budget, you also need a memory budget. Some amount for textures, models/meshes, animation, sounds, game data structures, particles, etc. Even on Facebook games, this becomes an issue! Next time you're playing a game in a browser, open up task manager, and see how much memory it's using. 1Gb? You're probably thrashing the cache pretty hard, possibly causing performance issues? Quick Recap: Constrained by time/money/staff: All software Management issue, more than a technical issue. Constrained by CPU/GPU: All games. Less so for PC/social games, but still an issue. Constrained by memory: All games. Less so for PC/social games, but still an issue. So let s assume you solve these, and you actually have a completed game! Congratulations! This brings us to our next constraint: how do you get people to play it (and ideally buy it)? 4
Constraint #3: Distribution Facebook: just toss it up on my game server. Seriously. Does this scale to hundreds of users? Thousands? Millions? Facebook pretty much doesn't care, as long as they get their 30% of revenue. Although they do come after you retroactively if you break the rules they have laid out. Advertising to get people to play it? You effectively have to buy users initially. Viral features to spread the word without ads. PC: put it on Steam (somehow? I have no experience with Steam as a distribution platform, so I don t know about approvals ) Android: put it in Google Play store! Relatively few restrictions. But if you want "featuring", there's a list of other things you need to do. Advertising, to get people to play it. Constraint #3: Distribution (Part 2) Apple: put it in App store! Well, sorta. There's an approval process. And it can take an unknown amount of time to get approved. And surfacing in the App Store? Top games? What does that mean? Most downloads? Most active players? Best ratings? _nobody knows_. Don't forget they get 30%, too! And you have to buy ads Console: Certification process is intense. Insane? Hundreds of requirements - what to do if the user unplugs the memory card while you're writing to it, etc. Often takes many weeks. Much more emphasis on code quality, because it's much harder to patch a game. Console manufacturers don't get 30%, but they do get a fixed $$ / boxed copy. There s also a concept approval phase. And you have to be a certified developer to even get dev kits. 5
Aside: Console Publishing And Retail What is a publisher? What is a developer? IP licenses versus original IP? Holiday-driven market. Shelf-space, product line-ups, and Wal-Mart! Oh, my! Another Aside: Relevant CS Classes Aside because you ve probably already got this covered. Not getting a kickback from the university for saying this. Graphics and AI are the obvious game-related classes Data structures / algorithms are critical 3D math comes up all the time Networking Multi-threading / multi-core / multi-processor Computer architecture (hardware) Compilers and/or assembly language Databases. Really! Big data & analytics! 6
Wrap-Up: Hopefully I still have time for questions! Hopefully you re still awake enough to ask them! 7