• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Building Gameplay
 

Building Gameplay

on

  • 766 views

Discussion of building blocks for implementing expressive, maintainable gameplay.

Discussion of building blocks for implementing expressive, maintainable gameplay.

Statistics

Views

Total Views
766
Views on SlideShare
758
Embed Views
8

Actions

Likes
1
Downloads
5
Comments
0

4 Embeds 8

https://twimg0-a.akamaihd.net 2
https://si0.twimg.com 2
http://us-w1.rockmelt.com 2
https://twitter.com 2

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Building Gameplay Building Gameplay Presentation Transcript

    • Building Gameplay Ben Garney The Engine Company @bengarney bengarney.comTuesday, July 24, 12
    • Introduction • Ben Garney (@bengarney) • http://bengarney.com/ • Founder, The Engine Company • Flash Architect, PushButton Labs • Torque Technologies Director, GarageGamesTuesday, July 24, 12Ask about audience - developer, interest in games, etc.
    • Agenda • Motivation • Surviving Development • Simulation Techniques • Conclusions & QATuesday, July 24, 12Going to talk about different ways to build and think about games, with a specific focus on building blocks for making really goodgameplay
    • • Open source Flash game framework • http://www.pushbuttonengine.com/ • For other open source libs, check out: • http://github.com/bengarney • http://github.com/PushButtonLabsTuesday, July 24, 12Some of my prior work, still out there, use it, it’s good!
    • Mobile Game Technology http://theengine.co/Tuesday, July 24, 12My new project, focused on mobile game technology.
    • What is Gameplay?Tuesday, July 24, 12What do we mean when we say gameplay? Of course the term can cover a wide variety of topics! ButI think there is a core set of development skills that give good experiences, and they can evenextend to non-game applications. (For instance, a car has a very intuitive interface - and itembodies many of the properties of a good game).
    • “A game is a series of interesting choices.” - Sid MeierTuesday, July 24, 12Hopefully you know Sid Meier... he is personally responsible for a TON of great games, SimCity,Pirates, Railroads, Civilization, and many more. He is smart about games.
    • Tuesday, July 24, 12Games stand on their own merits... This guy is operating this computer for some pretty darn goodreason, not because it’s intrinsically fun. Maybe he is calculating the census or he has an obsessivecompulsive disorder relating to buttons. Really this is the same reason we use Word or Excel or evenour web browsers. They are just a way to accomplish a task that we care about, like writing a memoor doing our finances or logging into our banking website.
    • Tuesday, July 24, 12Games stand on their own merits, though. Through a variety of strategies (like responsiveness,visual appeal, social/emotional appeal, or novelty/escapism) they make an activity fun in and ofitself. Typically this is accomplished via the gameplay.
    • Tuesday, July 24, 12Some games are simple and perfect in their gameplay... the original NES Mario, Tetris - these arepurist games.
    • Tuesday, July 24, 12... and others are byzantine. The behind-the-scenes doesn’t necessarily correlate with theperceived complexity (compare a skating game’s gameplay system vs. chess).
    • Tuesday, July 24, 12BTW - this is the same game, displayed with tiles. Amazing the difference art can make! It’s stillbyzantine. The satisfaction for people comes from wrestling with a huge complex system - likehaving an ant farm. This game is Dwarf Fortress, written by Tarn Adams of Bay 12 Games
    • Game making is a muscle.Tuesday, July 24, 12If you want to get good at making games, the best thing to do is make a whole game. You will learna lot. And your next game will be even better. I have learned a ton from every single game project Ihave taken on. Spend a week and make a game and you will be a better game maker.
    • Development RisksTuesday, July 24, 12Of course, with practice you learn about ways you can fail! So let me talk a little bit about thingsthat kill game projects. I will focus primarily on internal factors, not external ones like what to do ifyour company runs out of money...
    • Development RisksTuesday, July 24, 12Of course, with practice you learn about ways you can fail! So let me talk a little bit about thingsthat kill game projects. I will focus primarily on internal factors, not external ones like what to do ifyour company runs out of money...
    • Clients • Can’t see vision. • Aren’t willing to iterate. • Lose sight of fun as goal.Tuesday, July 24, 12Clients are a big factor, and they can be managed in part by showing them great gameplay. But theyalso have risks...
    • Team • Becomes frustrated. • Loses track of priorities. • Wants to over-innovate.Tuesday, July 24, 12Managing the team is tough, and there are lots of things that can steer them astray.
    • Technology • Becomes brittle. • Is unreliable. • Limits design and tweaking.Tuesday, July 24, 12Tech is also a risk, although much less so now than a decade ago.
    • Gameplay • Isn’t fun. • Becomes unbalanced. • Doesn’t match project goals.Tuesday, July 24, 12And ultimately the game HAS TO BE FUN!
    • Development StrategiesTuesday, July 24, 12Games tend to follow one of four big development strategies: iteration, horizontal slice, verticalslice, and reboot. There’s also a fifth strategy, failure, which is what happens when the gamedoesn’t turn out fun.
    • IterationTuesday, July 24, 12Prototyping, sprints/agile, “knowing that you don’t know” - this approach involves buildingsomething simple and rough, finishing it, playing it, and improving it... Repeat until it’s fun! Thisworks best for the most vital loops in a game, like the player’s movement, where you have to get alot of little details right to make a cohesive whole. It works less well for e.g. building out yourgame’s content, where the cost of iterating can be prohibitive and it can be hard to iteratively arriveat an overarching theme.
    • IterationTuesday, July 24, 12Prototyping, sprints/agile, “knowing that you don’t know” - this approach involves buildingsomething simple and rough, finishing it, playing it, and improving it... Repeat until it’s fun! Thisworks best for the most vital loops in a game, like the player’s movement, where you have to get alot of little details right to make a cohesive whole. It works less well for e.g. building out yourgame’s content, where the cost of iterating can be prohibitive and it can be hard to iteratively arriveat an overarching theme.
    • IterationTuesday, July 24, 12Prototyping, sprints/agile, “knowing that you don’t know” - this approach involves buildingsomething simple and rough, finishing it, playing it, and improving it... Repeat until it’s fun! Thisworks best for the most vital loops in a game, like the player’s movement, where you have to get alot of little details right to make a cohesive whole. It works less well for e.g. building out yourgame’s content, where the cost of iterating can be prohibitive and it can be hard to iteratively arriveat an overarching theme.
    • IterationTuesday, July 24, 12Prototyping, sprints/agile, “knowing that you don’t know” - this approach involves buildingsomething simple and rough, finishing it, playing it, and improving it... Repeat until it’s fun! Thisworks best for the most vital loops in a game, like the player’s movement, where you have to get alot of little details right to make a cohesive whole. It works less well for e.g. building out yourgame’s content, where the cost of iterating can be prohibitive and it can be hard to iteratively arriveat an overarching theme.
    • IterationTuesday, July 24, 12Prototyping, sprints/agile, “knowing that you don’t know” - this approach involves buildingsomething simple and rough, finishing it, playing it, and improving it... Repeat until it’s fun! Thisworks best for the most vital loops in a game, like the player’s movement, where you have to get alot of little details right to make a cohesive whole. It works less well for e.g. building out yourgame’s content, where the cost of iterating can be prohibitive and it can be hard to iteratively arriveat an overarching theme.
    • Horizontal SliceTuesday, July 24, 12Build out the WHOLE game, but in a very shallow way. For instance, for an RPG, build out simpleversions of all the major locations, and include all the major battles, but don’t build the whole battlesystem + all items and NPCs. This is helpful in bigger projects to determine pacing and scope, andit can also help show the vision to a publisher/client.
    • Horizontal SliceTuesday, July 24, 12Build out the WHOLE game, but in a very shallow way. For instance, for an RPG, build out simpleversions of all the major locations, and include all the major battles, but don’t build the whole battlesystem + all items and NPCs. This is helpful in bigger projects to determine pacing and scope, andit can also help show the vision to a publisher/client.
    • Vertical SliceTuesday, July 24, 12Build out one scene from the game in as complete detail as possible. For instance, consider a gamelike Monster Hunter or Shadow of the Colossus (Wanda to Kyozo, Wanda & The Colossus). To sell itsunique vision and the intensity of the gameplay, it is necessary to fully experience one of its bossbattles. Once you have that taste, you don’t necessarily need to play the rest of the game tounderstand it. So if you were pitching/demoing a title like that you would build a vertical slice.
    • Vertical SliceTuesday, July 24, 12Build out one scene from the game in as complete detail as possible. For instance, consider a gamelike Monster Hunter or Shadow of the Colossus (Wanda to Kyozo, Wanda & The Colossus). To sell itsunique vision and the intensity of the gameplay, it is necessary to fully experience one of its bossbattles. Once you have that taste, you don’t necessarily need to play the rest of the game tounderstand it. So if you were pitching/demoing a title like that you would build a vertical slice.
    • RebootTuesday, July 24, 12This is the most expensive option, but it can give good results. The classic example in westerngames is Half Life; Valve spent several years building the game, but it wasn’t fun, so they ditchedtheir content and started over. Scary, but worth it. The result was a reinvention of the FPS, anenduring franchise, and the seed that has built Valve into a billion dollar company.
    • RebootTuesday, July 24, 12This is the most expensive option, but it can give good results. The classic example in westerngames is Half Life; Valve spent several years building the game, but it wasn’t fun, so they ditchedtheir content and started over. Scary, but worth it. The result was a reinvention of the FPS, anenduring franchise, and the seed that has built Valve into a billion dollar company.
    • Instant StateTuesday, July 24, 12Instantaneous state, really. This is the simplest kind of gameplay.
    • Instantaneous? • Not based on previous state. • Example: if(buttonDown) shineLaser(); • Simple, solid.Tuesday, July 24, 12 It doesn’t depend on what has happened before. For instance, a laser with a button on it. It is easyto implement and modify.
    • DiscreteTuesday, July 24, 12Let’s start with discrete state. Discrete meaning not continuous - that is, things like symbols,boolean values, etc. that vary all at once, not in stages.
    • Truth Table Button? Laser T T F FTuesday, July 24, 12A truth table is a way to model the behavior of a discrete system. In this case we are saying if thebutton is down, the laser is on, and similarly, if the button is off, the laser is off.
    • Demo “One Button”Tuesday, July 24, 12
    • Example • Controlling a Car... • if(brakePedal) brakeLightsOn(); • else brakeLightsOff(); • if(brakePedal) setAxleFriction(high); • else setAxleFriction(low);Tuesday, July 24, 12A car is a more complex example but it follows exactly the same approach. And when we write it inthe truth table we see that our rules as described here are ambiguous...
    • Truth Table Gas Brake Lights Brake Engine Pedal? Pedal? T T T T F T F F F T F T T T F F F F F FTuesday, July 24, 12Here we see that there’s an interesting case to handle - what if both pedals are down? We canchoose various things depending on what fits for the game. In our case we have braking takepriority.
    • Demo “Two Button”Tuesday, July 24, 12
    • Why Bother? • Uniform way of thinking about problems. • Scales to be arbitrarily large. • Very very simple! • Mostly for booleans but generalizable to other kinds of data...Tuesday, July 24, 12
    • Truth Table Gas Brake Lights Brake Engine Pedal? Pedal? T T on off reverse T F off off high F T on high off F F off off offTuesday, July 24, 12We can also get a bit fancier and specify non-boolean outputs. (Of course in a strict truth table youwould represent this by outputting multiple bits of Brake or Engine.) Now we can have a morenuanced behavior, within the same framework. And in the iterative environment of a game, this isvery very useful!
    • ContinuousTuesday, July 24, 12OK, onto continuous state. This is for representing continuous numerical values, like weight orhealth or speed.
    • Tuesday, July 24, 12Rob Penner’s easing functions. MANY ways to adjust behavior! And of course each one can betweaked in different ways.
    • Curves • Highly controllable “feel.” • Simple - value in, value out. • Chainable.Tuesday, July 24, 12http://hosted.zeh.com.br/mctween/animationtypes.htmlThese curve functions are very powerful. They are simple to work with, they can be combinedendlessly, and they give a huge amount of “flavor” to whatever you apply them to.
    • Demo “One Button With Tween”Tuesday, July 24, 12
    • Parametric State • Full behavior set at beginning. • Takes elapsed time into account. • Simple and reliable.Tuesday, July 24, 12Another big advantage to parametric equations is that they don’t have any variance. Once you setup the start time you can evaluate it at any point from now until forever and know exactly whatyou’ll get. Compare this with using a physics engine where it can be computationally very complexto find out the state at t+100seconds. This is nice because you can evaluate them cavalierly and nothave to worry about getting strange results.
    • x=sin(t) y=cos(t)Tuesday, July 24, 12Parametric equations can control motion, for instance, making stuff move in a circle...
    • pos = -9.8t 2Tuesday, July 24, 12They can also approximate gravity...
    • pos = -9.8t 2Tuesday, July 24, 12They can also approximate gravity...
    • Parametric Rules For... • Visual effects (particles) • Platforms “on rails” • Giving a “feel” to things.Tuesday, July 24, 12And these are powerful building blocks for a variety of things - particles, platforms (SMW), andkinematic dynamic objects.
    • Demo BraidTuesday, July 24, 12
    • Feedback LoopsTuesday, July 24, 12Now that we have some building blocks we can take the next step in complexity, which is to turnthem back on themselves and make a feedback loop.
    • Simulation • v is state vector. • f(x) is state function. • v’ = f(v) to determine new state. • Run at 30Hz and you have a simulation.Tuesday, July 24, 12This glosses over several complexities - like temporal aliasing, numerical stability, and so on - if Iam doing well on time I have a slide a little later on these issues.
    • State Vector • Written x = < state1, state2, state3 > • Represents total state of the system. • For our car example: x = <brake?, gas?, light, brakes, engine> x = <engine?, brakes?, gas, velocity, position>Tuesday, July 24, 12
    • State Function • x’ = f(x) • gas’ -= (engine? ? 0 : 1) • velocity’ = (velocity + (engine? ? 1 : 0)) * 0.9 • position’ += velocityTuesday, July 24, 12Here are the update rules we would use.
    • Demo Kerbal Space ProgramTuesday, July 24, 12
    • Caveats • Timestep • Precision • Stability • ConsistencyTuesday, July 24, 12Of course there are some caveats - inconsistent timestep can introduce error, floating pointnumbers have limited precision, numerical methods can be instable, and if you require identicalresults every time it can be hard to keep things consistent.
    • Truth Table Feedback Old New T F F TTuesday, July 24, 12Truth tables can be used in state functions, too. Really is just a way of writing out a function. Fits intosame model. Just run through the table once per tick. This sets us up perfectly to think about our nexttopic... FSMs.
    • Finite State MachinesTuesday, July 24, 12
    • Tuesday, July 24, 12Let’s go back to 1986 and a classic game called Gradius...
    • Tuesday, July 24, 12... which was tough... and a classic game. It’s also a highly relevant example because it’s the firstinstance of a game using the Konami code, which is a great example for a state machine. TheKonami code was...
    • Tuesday, July 24, 12this sequence of inputs, and you entered it on the start screen to begin the game with all powerupsactive (except for Speed Up, Double, and Laser). In the end maybe a hundred games, and even somewebsites, support the code in one form or another today.
    • Up? Down? Down? s1 s2 s3 s4 Up? Left? IDLE s5 Else? Right? s6 OK! s9 s8 s7 Left? A? B? Right?Tuesday, July 24, 12Here is the state machine for the Konami code. (One link missing, s1->idle, due to limitations inKeynote)
    • Finite State Machine • Powerful way to drive complex game logic. • Many variants: • Hierarchical • Finite/Infinite • Moore/MealyTuesday, July 24, 12Moore - output driven by current stateMealy - output driven by current transition
    • Else Else StopLeft StopRight Left Right? 250ms Right 100ms Left? Right? 100ms Idle StartLeft StartRight ElseTuesday, July 24, 12
    • Demo Super Mario WorldTuesday, July 24, 12
    • Tuesday, July 24, 12This is an example of a complex FSM used to drive an AI character.
    • ConclusionsTuesday, July 24, 12
    • Functions Simulations Truth Table State Vector Parametric Numerical Curves Finite StateTuesday, July 24, 12Summary of various techniques we have learned, “functions” being basic things that can beevaluated and “simulations” being things that are run iteratively to drive game state.
    • Takeaway • Good gameplay code supports... • Faster iterations • + Painless changes • + Happier team • ... equals a fun, successful game.Tuesday, July 24, 12
    • Questions & Answers • Thank you for listening! • @bengarney, bengarney.comTuesday, July 24, 12Books: introduction to Adobe Edge, Web Design with Muse from Adobe, Android App Dev & Design:Learn by Video