0% found this document useful (0 votes)
16 views

Gameprog Lect2 Game Development

The document provides an overview of game development, defining computer games as software programs that involve players and require careful planning and design. It discusses key elements of games, such as rules, goals, and player interaction, and outlines the development process, including programming languages and tools used. Additionally, it highlights the importance of performance, modularity, and reliability in creating engaging and functional games.

Uploaded by

abdo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Gameprog Lect2 Game Development

The document provides an overview of game development, defining computer games as software programs that involve players and require careful planning and design. It discusses key elements of games, such as rules, goals, and player interaction, and outlines the development process, including programming languages and tools used. Additionally, it highlights the importance of performance, modularity, and reliability in creating engaging and functional games.

Uploaded by

abdo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 112

Game Development

What is a Game
 A Computer Game is a Software Program
– Not a board game or sports
– Consider: chess vs. soccer vs. Warcraft
» What do you lose? What do you gain?
– Lose: 1) physical pieces, 2) social interaction
– Gain: 1) real-time, 2) more immersive, 3) more
complexity
 A Computer Game involves Players
– think about audience. The game is not for you but for
them.
– Don’t just think about your story or the graphics or the
interface, but consider the players.
‫ملك وكتابة ‪1930‬‬
‫‪‬‬ ‫قصة عملة صدرت عام ‪ 1930‬تحولت‬
‫إلى لعبة شعبية‬
Game Example
 Consider the game
– Three to Fifteen
– 2 player game

 Goal:
– Collect a set of three numbers that add to 15
Rules
 Setup
– Write the numbers 1 through 9 at the top of a sheet of paper
– Below that draw a line to divide the paper into 2 halves
– Choose a player to go first
 Play Progression
– on your turn
» choose a number that has not yet been used
» cross it off the list of numbers at the top
» write it on your ‘half’ of the paper (to show it is yours)
 Resolution
– if either player acquires a set of three numbers that add to 15
then that player wins
– if all the numbers are used and neither player has such a set of three then the
game is a draw
Game tokens
 Anything the player directly manipulates:
cards, pieces, character, etc.
Costikyan: "To give a player a sense that he
controls his destiny, that he is playing a
game, you need game tokens."
Common Game Elements?
 Games (implicitly) have players
 Games are an activity
 Games have rules ) Mechanics

 Games have conflict


 Games have goals
 Games involve decision making
 Games are artificial, safe, outside ordinary life
 Games involve no material gain on the part of the players
 Games are voluntary
 Games have an uncertain outcome
 Games are a representation or simulation of something real but are
themselves make believe
 Games are inefficient
 Games have systems
 Games are a form of art
Other interaction modes
 Multiple Individual Players vs. Game (bingo)
 Multilateral Competition (poker, Quake, etc.)
 Unilateral Competition (tag, Scotland Yard)
 Cooperative Play (LotR board game, EverQuest
co-op quests)
 Team Competition (Battlefield 1942, football)
Goals
Costikyan: "If you have no goal, your
decisions are meaningless."
Categories of Rules
 Three Rule Categories
– Setup
» things done once when the game begins
– Progression
» what can/does happen during the game
– Resolution
» what condition(s) cause the game to end
» how is the outcome measured/determined
based on game state when such conditions
occur
Rules of Play example: Tic-Tac-
Toe

Rules are Subtle
Consider Tic-Tac-Toe
– 2 players
– Setup
» Draw 3x3 grid. Choose who goes first and uses X.
Opponent then is O
– Progression
» On your turn mark an empty square with you symbol
» Play then moves to your opponent
– Resolution
» If you get 3 of your symbol in a row (orthogonally or
diagonally) then you win
» If the board is full and there is no winner then the game is a
tie
Types of Rules
From Rules of Play
 Operational Rules
– “Rules of Play”
– Written rules in traditional games
 Constitutive Rules
– Underlying formal structures
– Consequences and emergent features
 Implicit Rules
– Good sportsmanship
– Let other player “take back” a move
– Explain options and consequences
Typical Production Timeline
Console vs. PC vs. Films
Game Development Example: Gears of War
 Resources
– ~10 programmers
– ~20 artists
– ~24 month development cycle
– ~$10M budget
 Software Dependencies
– 1 middleware game engine
– ~20 middleware libraries
– OS graphics APIs, sound, input, etc
Software Dependencies
Gears
Gears ofof War
War
Gameplay
Gameplay CodeCode
~250,000
~250,000 lines
lines C++,
C++, script
script code
code

Unreal
Unreal Engine
Engine 33
Middleware
Middleware Game
Game Engine
Engine
~250,000
~250,000 lines
lines C++
C++ code
code

Ogg wx ZLib
DirectX
DirectX OpenAL
OpenAL Ogg
Vorbis
Vorbis
Speex
Speex
Speech
wx
Widgets
Widgets
ZLib
Data
Data …
Music Speech Window Compr-
Graphics
Graphics Audio
Audio
Music
Codec
Codec
Codec
Codec
Window
Library
Library
Compr-
ession
ession
Introduction
 Programmers create games
– But many great programmers not great game makers
 With budget shift, emphasis has shifted
– Game content creators are artist and designers
 Programmers can be thought of as providing
services for content
– But fate of entire game rests in their hands
Getting Started
 A game must be planned in the same way
as any other software project.
 Typically, this means someone must:
– Formulate a concept for the game.
– Flush out this concept into requirements.
– Architect design to meet requirements.
– Implement software embodies this design.
– Test and refine software into working game.
Prototype: Red Ninja
Rewards and Punishments
 Value of an item (to an individual) closely
correlates with what it cost to acquire (money,
time, effort).
 A player who has spent time and effort on
completing a task, expects to be rewarded.
 Likewise a player who has failed in an objective,
expects to be punished.
 If actions don't have consequences, then the game-
play is meaningless.
Three Kinds of Code
 Gameplay Simulation
 Numeric Computation
 Shading
Gameplay Simulation
Gameplay Simulation
 Models the state of the game world as
interacting objects evolve over time
 High-level, object-oriented code
 Written in C++ /C# or scripting language
 Imperative programming style
 Usually garbage-collected
Gameplay Simulation – The Numbers

 30-60 updates (frames) per second


 ~1000 distinct gameplay classes
– Contain imperative state
– Contain member functions
– Highly dynamic
 ~10,000 active gameplay objects
 Each time a gameplay object is updated, it typically
touches 5-10 other objects
Numeric Computation
 Algorithms:
– Scene graph traversal
– Physics simulation
– Collision Detection
– Path Finding
– Sound Propagation
 Low-level, high-performance code
 Essentially functional
– Transforms a small input data set to a small output data set, making
use of large constant data structures.
Shading
Shading
 Generates pixel and vertex attributes
 Written in CG/openGl shading language
 Runs on the GPU
 Inherently data-parallel
– Control flow is statically known
– “Embarassingly Parallel”
Three Kinds of Code

Game Numeric Shading


Simulation Computation

Languages C++, C++,… CG, OpenGl


Scripting
CPU Budget 10% 90% n/a

Lines of Code 250,000 250,000 10,000

FPU Usage 0.5 GFLOPS 5 GFLOPS 500 GFLOPS


Code Development Tools
 Compilers (C#, Java, CodeWarrior, GNU)
 Debugger
 Profiler
 Editor
 Revision control (CVS, SourceSafe)
 Integrated development environment (IDE)
 C++, Assembly
 Graphics languages: pixel & vertex shaders…
 Design analysis tools
 Documentation, standards
code

Tools
What To Do, How To Do It
 Programming or scripting?
– If starting from scratch, the game will likely need
to be programmed using a traditional programming
language.
– If using an engine, you may be able to program with a
traditional language, or you may have to use scripting
instead. Depending on the engine!
– While script writing is very much like programming,
it is not done using traditional languages, which
might not be what is wanted for a programming
course.
C++ (1 of 3)
 Since then, C++ language of choice for games
– First commercial release in 1985 (AT&T)
+ C Heritage
– Learning curve easier
– Compilers wicked fast
+ Performance
– Used to be most important, but less so
– Maps closely to hardware (can “guess” what assembly
instructions will be)
– Can not use features to avoid cost, if want (ie- virtual
function have extra step but don’t have to use)
– Memory management controlled by user
C++ (2 of 3)
+ High-level
– Classes (objects), polymorphism, templates,
exceptions
– Especially important as code-bases enlarge
– Strongly-typed (helps reduce errors)
» ex: declare before use, and const
+ Libraries
– C++ middleware readily available
» OpenGL, DirectX, Standard Template Library
(containers, like “vectors”, and algorithms, like
“sort”)
C++ (3 of 3)
- Too Low-level
– Still force programmer to deal with low-level
issues
» ex: memory management, pointers
- Too complicated
– Years of expertise required to master (other
languages seek to overcome, like Java and C#)
- Slow iteration
– Brittle, hard to try new things
– Code change can take a looong time as can
compile
Java (1 of 3)
 Java popular, and recently so for games
+ Concepts from C++ (objects, classes)
– Powerful abstractions
+ Cleaner language
– Memory management built-in
– Object functions, such as virtualization
+ Code portability (JVM)
+ Libraries with full-functionality built-in
Java (2 of 3)
- Performance
– Interpreted, garbage collection, security
- Platforms
– JVM, yeah, but not all games (most PC
games not, nor consoles)
+ Strong for browser-games, mobile
Java (3 of 3)
 Used in:
– Downloadable/Casual games
 Mummy Maze, Seven Seas, Diamond Mine
 Poker, Blackjack

– PC
» Star Wars Galaxies uses Java (and simplified Java
for scripting language)
» You Don’t Know Jack and Who Wants to be a
Millionaire all Java
Scripting Languages (1 of 3)
 Not compiled, rather specify (script) sequence of actions
 Other games may use it lots more

– Control game logic and behavior (Game Maker has


GML)
+ Ease of development
– Low-level things taken care of
– Fewer errors by programmer
- But script errors tougher, often debuggers worse
– Less technical programming required
– Iteration time faster (don’t need to re-compile all code)
– Can be customized for game (ex: just AI tasks)
Scripting Languages (2 of 3)
+ Code as an asset
Script would allow for behavior to be an asset also
» Can be easily modified, even by end-user in “mod”
- Performance
–Parsed and executed “on the fly”
» Hit could be 10x or more over C++
–Less efficient use of instructions, memory
management
- Interface with rest of game
–Core in C++, must “export” interface
» Can be limiting way interact
Scripting Languages (3 of 3)
 Python
– Interpreted, OO, many libraries, many tools
– Quite large (bad when memory constrained)
– Ex: Blade of Darkness, Earth and Beyond, Eve Online,
Civilization 4
 Lua (pronounced: Loo-ah)
– Not OO, but small (memory). Embed in other programs.
Doesn’t scale well.
– Ex: Grim Fandango, Baldur’s Gate, Far Cry
 Others:
– Ruby, Perl, JavaScript
– Custom: GML, QuakeC, UnrealScript
» Implementing own tough, often performs poorly so careful!
What are the hard problems?
 Performance
– When updating 10,000 objects at 60 FPS, everything is
performance-sensitive
 Modularity
– Very important with ~10-20 middleware libraries per game
 Reliability
– Error-prone language / type system leads to wasted effort
finding trivial bugs
– Significantly impacts productivity
 Concurrency
– Hardware supports 6-8 threads
Set up the game environment
What To Do, How To Do It
 2D or 3D?
– 2D game development is typically easier, both in
terms of programming or scripting, but also in terms
of content and asset management.
– 3D game development, conversely, tends to be more
challenging, but more interesting.
– Depending on your language and tool of choice,
however, you might be forced into one of these
options or the other.
Is 3D always better than 2D?
 NO!

Live births by age and race of mother: United States preliminary 2003 Ming Luo

1, 200, 000

1, 000, 000

800, 000
Live births

Al l races
600, 000 Whi t e
Bl ack
400, 000 Ameri can I ndi an
Asi an or Paci fi c I sl ander

200, 000
Asi an or Paci fi c I sl ander
Ameri can I ndi an
0 Bl ack
0- 14 15- 19 20- 24 Whi t e
25- 29 Al l races
30- 34
35- 39 40- 44
45- 54
Age of mother (years)
Is 2D always better than 3D?
 NO!
Getting Started:
What To Do, How To Do It

Screen shots from two games developed at Western, The


Misadventures
of State-Man (2D, left) and Smashocosm Tournament (3D, right).
Both games
2.5D

2D 3D
Architecture of Engines
 Scene Management
 Memory Management
 Event Handling
 Rendering
 Collision Detection
Architecture of Engines
User Specific:
 Importing in Graphics:
– Models
– Animations
– Texturing
– All in specific format and standards
 Tools: Creating Levels, Adding Triggers
 Scripting tools
A look at Engines
 Rendering Engines
– Licensed: C4, XNA; Open Source: Irrlicht,
Ogre 3D
 3D Game Engines
– Unreal, Half Life, Torque, Never Winter
Nights
 2D Game Engines
– Game Maker, Torque
 Differ: Language, Flexibility, tools for visual
design and scripting
Game Maker
 Tools Included:
– Scripting environment
– Level Editing
 No Programming
knowledge required
 Flexiblity:
– art content
– No interaction
model imposed
What you need to know?
 Essential Concepts
– Object programming
– Co-ordinate system
– Physics
– Sprits and 2D animation
 Design Concepts
– Level design
– Adding interaction model
Unreal Engine
 Tools Included:
– Scripting environment
– Level Editing
 Programming knowledge
required
 Flexible:
– art content, Unreal content
supplied
– Interaction model, but
requires a large effort to
change
What you need to know?
 Essential Concepts
– Object programming
– Event Based systems
– Threading
– Navigation
– Good Coding styles
– Inheritance, Reuse, Object Oriented
Programming
– Understanding someone else’s code
– Code Maintenance
– Pipeline
What you need to know?
 Design Concepts
– Architecture design
– Cinematics
– Level design
– interaction model
C4
 It is a library, C++
 Tools Included:
– Level Editing
 Programming knowledge
required
 Flexible:
– Some art content
supplied
– No Interaction model
supplied
What you need to know?
 Essential Concepts
– Programming C++
– Object programming
– Event Based systems
– Threading
– Navigation
– Good Coding styles
– Inheritance, Reuse, Object Oriented Programming
– Understanding someone else’s code
– Code Maintenance
What you need to know?
– Pipeline
– Engine Programming
 Design Concepts
– Architecture design
– Cinematics
– Level design
– Adding interaction model
Alpha: Crash Bandicoot
Development Team Size
 In the 1980’s might be single developer
 Most teams today have 10-60 people
 Programming in now a smaller part of
the complete project than before (need
good software engineering and media
design work)

70
Example 1988
 3 programmers
 1 part-time artist
 1 tester

71
Example 1995
 6 programmers
 1 artist
 2 level designers
 1 sound designer
 Contract musicians

72
Example 2002
 2 producers
 4 programmers
 2 game designers
 1 2D and texture artist
 3 level designers
 1 audio designer
 4 animators
 QA lead and testers
73
Development Milestones:
Development Timeline
 Here are some example development
periods for different platforms:
– 4-6 months for a high-end mobile game
– 18-24 months for an original console game
– 10-14 months for a license / port
– 16-36 months for an original PC Game

74
Software Methodologies
 Code and Fix
 Waterfall
 Iterative
 Agile
Methodologies – Code and Fix
 Really, lack of a methodology
– And all too common
 Little or no planning, diving straight into implementation
 Reactive, no proactive
 End with bugs. If bugs faster than can fix, “death spiral”
and may be cancelled
 Even those that make it, must have “crunch time”
– viewed after as badge of honor, but results in burnout
Methodologies - Waterfall
 Plan ahead
 Proceed through various planning steps
before implementation
– requirements analysis, design, implementation,
testing (validation), integration, and maintenance
 The waterfall loops back as fixes required
 Can be brittle to changing functionality,
unexpected problems in implementation
– Going back to beginning
Methodologies - Iterative
 Develop for a period of time (1-2 months),
get working game, add features
– Periods can coincide with publisher milestones
 Allows for some planning
– Time period can have design before
implementation
 Allows for some flexibility
– Can adjust (to new technical challenges or
producer demands)
Methodologies - Agile
 Admit things will change, avoid looking too
far in the future
 Value simplicity and the ability to change
 Can scale, add new features, adjust
 Relatively new for game development
 Big challenge is hard to convince publishers
Types of Games

80
Genres
 Adventure
– Sub-genres include text-based adventure and graphical
adventure
– Zork by Infocom
– King’s Quest by Sierra
 Action
– Superset of all other action-oriented genres
– Typified by fast-paced combat and movement
– Spacewar, Pong, and Space Invaders helped define the
genre
81
Genres
 Action-Adventure
– Adventure games with action elements
– The Legend of Zelda was first break-out hit
– Jak 3, Metroid Prime 2 Echoes, and Resident Evil 4 are
modern examples of the genre
 Platformer
– Typified by a character running and jumping in a side-
scrolling playing field
– Modern definition has expanded to include 3D
– Super Mario Bros., Sonic the Hedgehog, Pitfall! and
Super Mario 64 are examples

82
Genres
 Fighting
– Players typically fight other players or the computer
using swordplay or martial arts
– Double Dragon is an example of a side-scrolling
fighter
– Virtua Fighter, Mortal Kombat, and Street Fighter.
 First-Person Shooter
– Action game where player is “behind the eyes” of the
game character in a first-person perspective
– id Software’s Wolfenstein 3D and DOOM are the
earliest popular examples
83
Genres
 Real-Time Strategy (RTS)
– Typically, a game in which the goal is to collect
resources, build army, and fight other player/AI.
– Popularized by Westwood’s Dune 2 and Command and
Conquer and Blizzard’s Warcraft
 Turn-Based Strategy
– Like real-time strategy games, but turn-based
– Civilization, X-COM, Master of Orion, and Jagged
Alliance are standouts of the genre

84
Genres
 Role-Playing Game (RPG)
– The video game counterpart to pen and pencil games
like Dungeons and Dragons
– Final Fantasy, Baldur’s Gate and Wasteland are some
popular examples of the genre
 Massively Multiplayer Role-Playing Game
(MMORPG)
– An RPG set in a persistent virtual world populated by
thousands of other players
– Ultima Online in 1997 was the first popular one
– World of Warcraft is currently the most popular one

85
Genres
 Stealth
– Characterized by a focus on subterfuge and planned-
out, deliberate play
– Metal Gear in 1987 was one the first
– Popular modern series include Metal Gear, Splinter
Cell, and Thief
 Survival Horror
– An action-adventure or first-person shooter where
survival elements and fighting undead are stressed
– Resident Evil is easily the most popular series in this
genre
86
Genres
 Simulation
– Based on the simulation of a system
– SimCity and The Sims are example of “God”
simulations where you control the lives many.
– Wing Commander and X-Wing are popular space
combat simulation games
 Racing
– Games that involve competing in a race in a vehicle
– Typically try to re-create a real-world activity
– Pole Position was first popular racing game

87
Genres
 Sports
– Games that simulate the sporting experience
– Breakouts include John Madden Football and Tiger
Woods’ Golf
 Rhythm
– Gauge player’s success based on the ability to trigger
the controls in time to the beat of music
– Sometimes require specialized controllers such as
dance pads or bongo drums
– Rock Band, Guitar Hero

88
Genres
 Puzzle
– Games that combine pattern matching, logic, strategy
and luck with a timed element
– Tetris is the breakout hit of this genre
 Mini-Games
– Short, simple games that exist within the context of a
larger game
– Mario Party and Wario Ware are popular examples of
this genre
– FABLE II, Pub games

89
Genres
 Traditional
– Computerized versions of board, word, and card games
– Battle Chess and Hoyle series are standouts
 Educational
– Games designed to teach grade-school concepts to
children and young adults
– Oregon Trail was the first popular game in this genre
– The Carmen Sandiego series and Mavis Beacon
Teaches Typing are more modern popular examples

90
Genres
 Serious
– A game designed to teach real-world events or
processes to adults
– Most are privately funded
– Popular with the US Government and the medical field
» "Sapphire" simulation trainer

91
Having the Idea
 “How many industries can claim to deal in
daydreams?”
– Dreams are where every game begins
 With an idea, don’t implement or tie down to
technology
 “Genius is 1% inspiration, 99% perspiration” –
Edison
– Enjoy the 1% because everything else is hard work
 Think of many raw ideas to throw into game
– May come up with hybrid
– Look at what can contribute to others so get emergent
game
The Creative Process – The
Beginning
 Once you have an idea
– Is it really good?
– Worth spending time and money on?
– Even if “rehash” should bring improvement to
original and new challenges
– Discuss with someone that can appreciate the
idea
God Games
Brain Train (Nintendo DS)
Librarians congregate in OPAL and in SL to listen to
Michael Stephen's presentation on blogging for the
Alliance Library System, thursday June 15 2006.
Game Trivia
Game Trivia
Game Trivia
Game Trivia
Game Trivia
Game Trivia
Game Trivia
Game Trivia
Game Trivia

You might also like