The Game Development Process
The Game Development Process
Process
Game Programming
Outline
Introduction
Graphics, networking, AI
Software Methodologies
Methodologies - Waterfall
Plan ahead
Proceed through various planning steps
before implementation
Methodologies - Iterative
Methodologies - Agile
of them
Central location for all code
Allows team to work on related files
without overwriting each others work
History preserved to track down errors
Branching and merging for platform
specific parts
Formal or informal
Two eyes are better than one
Value is programmer aware others read
Asserts
Unit tests
Acceptance tests
Bug database
Outline
(done)
(next)
C++ (1 of 3)
C++ (2 of 3)
+ High-level
Classes (objects), polymorphism, templates,
exceptions
Especially important as code-bases enlarge
Strongly-typed (helps reduce errors)
+ Libraries
C++ (3 of 3)
- Too Low-level
Still force programmer to deal with low-level issues
- Too complicated
Years of expertise required to master (other languages
seek to overcome, like Java and C#)
- Lacking features
No built-in way to look at object instances
No built-in way to serialize
Forces programmer to build such functionality (or learn
custom or 3rd party library)
- Slow iteration
Brittle, hard to try new things
Code change can take a looong time as can compile
C++ (Summary)
When to use?
Java (1 of 3)
+ Cleaner language
Java (2 of 3)
- Performance
Interpreted, garbage collection, security
So take 4x to 10x hit
+ Can overcome with JIT compiler, Java
Native Interface (not interpreted)
- Platforms
JVM, yeah, but not all games (most PC
games not, nor consoles)
+ Strong for browser-games, mobile
Based on Chapter 3.2, Introduction to Game Development
Java (3 of 3)
Used in:
Downloadable/Casual games
PopCap games
PC
Scripting Languages (1 of 3)
Scripting Languages (2 of 3)
+ Code as an asset
Ex: consider Peon in C++, with behavior in C++, maybe art as an
asset. Script would allow for behavior to be an asset also
- Performance
Parsed and executed on the fly
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 (Table 3.2.1 full list)
Lua (pronounced: Loo-ah)
Not OO, but small (memory). Embed in other programs.
Doesnt scale well.
Ex: Grim Fandango, Baldurs Gate, Far Cry (Table 3.2.2
full list)
Others:
Ruby, Perl, JavaScript
Custom: GML, QuakeC, UnrealScript
Macromedia Flash (1 of 2)
Macromedia
Flash (2 of 2)
Timeline Based
Vector Engine
Scripting
Outline
(done)
(done)
(next)
Debugging Introduction
Mini-outline
Is it before or after?
Debugging Tips (1 of 3)
Debugging Tips (2 of 3)
Debugging Tips (3 of 3)
Unexplainable Behavior
Debugging Prevention (1 of 2)
Make general
Alter game variables on fly (speed up)
Visual diagnostics (maybe on avatars)
Log data (events, units, code, time stamps)
Record and playback capability
Debugging Prevention (2 of 2)
Outline
(done)
(done)
(done)
(next)
Introduction to AI
No unintended weaknesses
Introduction
Agents
Finite State Machines
Common AI Techniques
Promising AI Techniques
(done)
(next)
Game Agents (1 of 2)
Sensing
Game Agents (2 of 2)
Thinking
Expert Knowledge
finite state machines, decision trees, (FSM most
popular, details next)
Appealing since simple, natural, embodies common
sense
If you
Search
Machine learning
Agent cheating
Ideally, dont have unfair advantage (such as more
attributes or more knowledge)
But sometimes might to make a challenge
Introduction
Agents
Finite State Machines
Common AI Techniques
Promising AI Techniques
(done)
(done)
(next)
A tta c k
N o Enem y
F le e
Set of states
A starting state
An input vocabulary
A transition function that maps inputs and the
current state to a next state
Problems
Three approaches
Finite-State Machine:
Hardcoded FSM
void RunLogic( int * state ) {
switch( state )
{
case 0: //Wander
Wander();
if( SeeEnemy() )
break;
{ *state = 1; }
case 1: //Attack
Attack();
if( LowOnHealth() ) { *state = 2; }
if( NoEnemy() )
{ *state = 0; }
break;
case 2: //Flee
Flee();
if( NoEnemy() )
break;
{ *state = 0; }
}
}
Finite-State Machine:
Problems with switch FSM
1. Code is ad hoc
Finite-State Machine:
STATE_Attack )
STATE_Flee )
STATE_Wander )
STATE_Wander )
Finite-State Machine:
Scripting Advantages
1. Structure enforced
2. Events can be handed as well as polling
3. OnEnter and OnExit concept exists
4. Can be authored by game designers
Easier learning curve than straight C/C++
Finite-State Machine:
Scripting Disadvantages
Bytecode interpreter
Finite-State Machine:
Hybrid Approach
OnEnter, OnExit
Timers
Handle events
Consistent regulated structure
Ability to log history
Modular, flexible, stack-based
Multiple FSMs, Concurrent FSMs
Finite-State Machine:
Extensions
OnEnter, OnExit
Timers
Global state, substates
Stack-Based (states or entire FSMs)
Multiple concurrent FSMs
Messaging
Introduction
Agents
Finite State Machines
Common AI Techniques
Promising AI Techniques
(done)
(done)
(done)
(next)