The Art and Science of Game Programming
Max B. Kazemzadeh
Department of Computer
School of Visual Arts
Center for Advanced
Science & Engineering
University of North Texas
University of North Texas
Denton, TX, USA
University of Louisiana at
Denton, TX, USA
Lafayette, LA, USA
for employment in companies including Acclaim Entertain-
ment, Ensemble Studios, Gathering of Developers, Glass
The University of North Texas has for many years o?ered
classes in game programming to Computer Science students
Eye, iMagic Online, Ion Storm, Klear Games, NStorm, Ori-
and classes in game art and design to art students. A key
gin, Paradigm Entertainment, Ritual, Sony Entertainment,
feature of these classes is the opportunity for these diverse
Terminal Reality, and Timegate Studios.
communities of students to collaborate on joint projects. We
Despite a rocky beginning, game programming is now
gaining acceptance in academia (see, for example, Adams ,
describe the features that make these classes unique.
Becker , Faltin , Feldman and Zelenski , Jones ,
Moser , and Sindre, Line, and Valvg ), resulting in a
Categories and Subject Descriptors
proliferation of new classes and programs both internation-
K.3.2 [Computing Mileux]: Computers and Education-
ally and nationwide and a move towards a professionally
Computer and Information Science Education[Computer sci-
recommended curriculum in game studies . In contrast to
institutions such as Digipen, Full Sail, and SMU’s Guildhall
that o?er specialized degrees or diplomas in game program-
ming, UNT o?ers game programming as an option within a
traditional computer science curriculum, and game art and
design as an option in their progressive art curriculum. A
key characteristic of our educational approach is to bring
together computer science and art students in joint projects
that enhance the educational experience for both types of
Game programming, graphics, undergraduate education
student, while grading both types independently according
to the metrics of their particular discipline.
2D and 3D Game Design is presently o?ered to School
of Visual Arts undergraduates and graduates as a Junior-
In 1993 we introduced a game programming course to the
Senior-Graduate elective in collaboration with the game pro-
undergraduate computer science program at the University
gramming course in the computer science department. With
of North Texas. At the time this was a di?cult task, both
each new semester the art based game design course logisti-
because there were no course materials, books, or web pages
cal challenges are similar to that of the game programming
available, and because the industry-driven focus of the class
course primarily due to the fact that the game design course
and the perceived trivial nature of entertainment comput-
is a technology driven course. With each year new game
ing made the subject matter controversial. Interestingly, the
design books and software must be investigated and the ex-
objections came from faculty - both the students and the ad-
isting course curriculum must be updated and rede?ned to
ministration were in favor of the class. Since 1993 the initial
keep up with evolving technology and the technical processes
game programming class has evolved with the fast-moving
used in the game industry. With each new software version
game industry, and spawned a second, advanced game pro-
release comes new improvements with usability as well as
gramming class. After more than a decade of operation,
new formats for output, which require research and testing
our game programming classes have positioned our alumni
so as to seamlessly integrate the art student’s 2D and 3D as-
sets with interfaces used in the game programming course.
UNT’s School of Visual Arts (SOVA) is a progressive con-
ceptual art school that successfully challenges the norms and
Permission to make digital or hard copies of all or part of this work for
traditions of present day studio art praxes. SOVA is divided
personal or classroom use is granted without fee provided that copies are
into commercial design, studio art, and educational prac-
not made or distributed for pro?t or commercial advantage and that copies
bear this notice and the full citation on the ?rst page. To copy otherwise, to
tice. There is presently no degree in electronic media art
republish, to post on servers or to redistribute to lists, requires prior speci?c
or gaming, however, the integration of game design into the
permission and/or a fee.
SOVA course structure is being carried out with enthusias-
SIGCSE’06, March 1–5, 2006, Houston, Texas, USA.
tic support from both the faculty and the administration.
Copyright 2006 ACM 1-59593-259-3/06/0003 ...$5.00.
Course o?erings relating to technology are rapidly expand-
ing and the school is hiring new technologically savvy pro-
fessors who will teach courses relating to art and technology.
A new curricular structure for art and technology is forming
at SOVA that references characteristics of innovative inter-
active art programs such as Carnegie Mellon’s Trans-Media
Program, NYU’s Interactive Telecommunications Program,
Parsons School of Design’s Design and Technology Program,
and MIT’s Media Lab.
2D/3D Game Design is presently supported by SOVA
electronic media art course o?erings that train students in
the areas of interface design, web-based art and interactiv-
ity, broadcast motion graphics and video-e?ects, animation,
and site-speci?c digital installation or physical computing.
Game design is an iterative process of de?ning a set of
rules, prototyping a system for interaction, and building
game characters, environments, and animations necessary to
Figure 1: Screen shot of Ned’s Turkey Farm.
an interactive narrative. With a broader de?nition of game
design, art and gaming programs can maintain the neces-
A typical class begins by running the demo and pointing out
sary ?exibility to adapt to the evolving industry environ-
the new features, followed by a powerpoint slideshow de-
ment, while providing a stimulating environment to explore
scribing the new demo, its new features, the theory or prin-
and discover new possibilities of what a game can be.
ciples behind them, and any implementation details, but at
Keeping in mind that many institutions are starting game
a high level without getting bogged down in the code. This
programs, and many of them are designing their curricula
is followed by running windi? and going through the code
in an ad hoc manner, the purpose of this paper is to share
changes in more or less detail depending on the complexity
some of what we have learned from experience over the last
and di?culty of the code. Often, we run Visual C++ to
decade by describing our game programming and game de-
show students in real time the e?ects of minor code tweaks.
sign classes, the philosophy behind them, and some of the
The code for Fall 2004 and Fall 2005 was organized into
twelve incremental demos as follows:
Demo 0, Getting Started: Demo 0 is, for many stu-
INTRO GAME PROGRAMMING
dents, their ?rst Windows application. It ?res up a black
The Introductory game programming class was introduced
fullscreen window with a text prompt and waits for user to
in 1993 as a special topics class. Despite some initial resis-
hit the ESC key to exit. Students learn how to register a
tance from faculty, it received its own course code and cat-
fullscreen window, create it, draw graphics on it using the
alog entry in 1997, e?ective in Fall 1998. It is o?ered once
Windows GDI, respond to user keyboard input, and shut
a year in Fall semesters.
down the application gracefully. They are introduced to the
The students in the intro game programming class are
concepts of Windows messaging and the message pump.
usually seniors in the computer science program, who are
Demo 1, Introduction to Direct3D: Demo 1 is our
technologically savvy and experienced programmers. They
?rst Direct3D application. It starts Direct3D and displays
are usually quite capable of reading the DirectX documenta-
a shoebox background consisting of a ?oor and a backdrop.
tion themselves. For them, the biggest road-block is picking
It may be run either fullscreen or windowed by changing a
the small subset of techniques that they actually need from
the wealth of options available. The lectures focus on get-
Demo 2, Scripting and Debugging: The executable
ting started, and leave exploration of options in the more
for Demo 2 looks the same as Demo 1, but there is a lot more
than capable hands of the students.
under the hood. We add XML scripting using TinyXML.
We have used a teaching technique called incremental de-
Now the students can change the behaviour of the demo
velopment. Rather than going through the DirectX docu-
by editing Ned.xml in an XML editor instead of having to
mentation, we teach using a basic game called Ned’s Turkey
recompile the code. This allows the art students to change
Farm, a simple side-scroller in which the player pilots a bi-
some of the settings in the game easily.
plane and shoots crows (see Figure 1). The aim is not to
Debugging may seem like a moot issue until students se-
teach this game per se, but rather to teach the development
riously start creating their own game. The problem with
of games in general using this engine as an example. It is
DirectX fullscreen debugging is that DirectX takes complete
designed to have many of the features of a full game in pro-
control of the screen. The Visual Studio debugger is the ?rst
totype form so that students can use code fragments from it
line of defense, but some bugs will crash the debugger. The
as a foundation on which to build their own enhancements.
debug code in Demo 2 will let the programmer read debug
The students are graded on the basis of a project, which is
output in real time in a client console application on a sec-
to create a sprite-based game in groups together with art
ond monitor, or on the screen of a second computer. It will
students from the concurrent game art and design class.
also save the debug output in a ?le, and display it in the
The code is currently organized into a sequence of eleven
Visual Studio debugger’s Output window. It accepts printf-
code demos. Each demo is built on top of its predecessor. A
like parameters, and it can be disabled with two keystrokes
?le di?erence application, such as windi? is used in class to
by commenting out a single #define.
highlight the changes in code that must be made to add the
Demo 3, The Sprite: Demo 3 is our ?rst attempt at
new features. An average of one demo is presented per week.
simple real-time animation. A plane sprite moves across the
background. F1 tabs between game view and eagle-eye view,
score list, enter a new name typed in by the player into high
in which the camera pulls back so the programmer can see
score list, and manage the stored high score list.
what is happening “behind the scenes”.
Demo 4, Managing Objects: Demo 4 has more ob-
ADVANCED GAME PROGRAMMING
jects, managed by a sprite manager and an object manager.
The advanced game programming class was introduced in
The object manager is a ?rst draft only in that it can create
2000 as a special topics class. It received its own course
objects but not yet delete them. Sprites are now animated
code and catalog entry in 2003, e?ective in Fall 2004. It is
with multiple frames of animation. There is now a continu-
o?ered once a year in Spring semesters. The introductory
ous, in?nite scrolling background with the camera in motion
game programming class is the sole prerequisite.
to keep the plane in the center of the screen.
Advanced Game Programming covers real-time 3D ani-
Demo 5, Arti?cial Intelligence: In Demo 5, crows
mation. The majority of the grade for the class is for a 3D
now have simple rule-based arti?cial intelligence with some
game created in groups, a typical group consisting of two
randomness thrown in to make them behave slightly di?er-
programming students and two art students from the con-
ently. They try to avoid the plane as much as they can given
current game art class taught in the School of Visual Arts.
a limited attention span. Flocking can be seen as emergent
An increase in the number of art students per group over
behaviour. The plane ?res a bullet when the player hits the
the introductory classes is required because of the increase
space bar. Bullets have a ?xed lifetime. When a bullet hits
in work needed to produce 3D models. Programming stu-
a crow, the crow explodes and turns into a falling corpse,
dents are also permitted to use art work from the web, but
which disappears when it hits the ground. The object man-
this has a number of disadvantages, including:
ager now has full functionality, in that it can now delete
objects and recycle their space.
1. Quality: Models often have inappropriate triangle count
Demo 6, The Game Shell: In Demo 6 there is a game
(too high or too low) and topological defects (degen-
shell wrapped around the game engine, consisting of an intro
erate, detached, or sliver triangles, for example).
sequence (a logo screen, a title screen, and a credits screen),
and a menu screen. The player can click out of any of the
2. Post-processing: Models often require signi?cant post-
intro screens. From the menu screen one can play a game or
processing, for example, they may not be located at
quit by pressing the appropriate key on the keyboard. After
the origin, and may have triangles listed in the wrong
each game, the player is returned to the menu screen after
order for back-face culling.
they kill the last crow, or pre-emptively by pressing ESC.
From there the player can re-enter the game engine. We
3. File format: Models are often posted in various for-
show how to gain direct access to the back bu?er to blit the
mats, for which loaders must be written or adapted
intro screens there directly.
from other code. File format converters exist, but they
Demo 7, Sound: Demo 7 introduces sound, managed by
are typically expensive, buggy, or produce low-quality
a sound manager class. Since DirectSound will not allow a
results that require post-processing.
sound to be played multiple times simultaneously, the sound
4. Motivation: Programming students are more excited
manager keeps multiple copies of each sound, sharing the
about their games, and hence better motivated, if they
sound data, and automatically selects the ?rst copy that is
can have custom art created on-the-?y in response to
not currently playing. The plane engine sound loops.
group design decisions. Our experience has shown that
Demo 8, DirectInput: Demo 8 uses DirectInput to give
downloading art from the web typically results in dis-
faster access to input hardware. We start by using it for the
satis?ed students and lackluster games.
keyboard and mouse instead of using the Windows messages
like in previous demos. We also add some 2D animation for
The biggest drawback to having students create a custom
clickable buttons on the menu page. The mouse is used to
3D game engine is the amount of work involved. It is imper-
press menu screen buttons, as a joystick, and to ?re the gun.
ative that students use some basic utilities, for example, the
The buttons on the main menu are drawn as 2D sprites.
D3DXUtil library provided in the DirectX SDK. We have
There is a custom DirectInput mouse cursor.
used a set of improved utilities (including a basic rendering
Demo 9, The Joystick: Demo 9 adds joystick control
engine, a model importer, and implementations of Euler an-
to the DirectInput code, and adds a device selection screen
gles, matrices, vectors, quaternions, axially aligned bound-
with radio buttons.
ing boxes), published in Dunn and Parberry . Students
Demo 10, Onscreen Text: Demo 10 adds more com-
who wish a di?erent experience are permitted to download
plexity to the game, and introduces the drawing of text in
and use any free game engine.
screen space. We add multiple levels, with more crows as
As with the introductory game programming class, one of
level number increases, and a success screen in between lev-
the key elements of this class is the excitement generated
els. Player can now be hit by crows, which reduces health
by having programming students work with art students.
and ultimately kills the player.
The player’s health and
In the advanced game programming class, however, there is
number of lives are managed by a score manager. We add
a signi?cant barrier to communication between the artists
text on the screen showing the level number, number of
and the programmers: the model ?le format problem. The
crows, health, lives and score.
art students can work with sophisticated 3D modeling tools
Demo 11, Persistence: Demo 11 stores in the Windows
such as Maya, Lightwave, and 3D Studio Max, but unfortu-
registry the game settings that should persist from one ex-
nately the native ?le formats generated by these programs
ecution of the game to the next. We start with the high
are proprietary and di?cult to load. The programming stu-
score list and the initial input device. Checksums are used
dents work with Microsoft DirectX, which has strong sup-
to detect tampering. New code is added to display the high
port for its own ?le format, called ”.x”.
We have found
The following discusses the impact of these decisions on
the Game Design and Art class.
In reference to the ?rst question, the options were a sin-
gle project course in which the grade is primarily for a large
project designed in groups, versus a supplemental projects
course where the instructor teaches hands on implementa-
tion techniques daily, have regular spaced out small projects,
an optional mid-term covering terms and techniques, and
the ?nal project. We chose the latter supplemental projects
course due to the fact that most students were new to tech-
nology and needed to be given smaller organized projects to
encourage the practice of techniques covered in class.
On the second question, the 2D and 3D courses require
that di?erent software be used. For the 2D course, we use
Adobe Photoshop, Adobe Imageready, Adobe Illustrator,
Painter programs, Macromedia Flash, and a small amount
Figure 2: Screen shot of Ned’s Turkey Farm 3D.
of Director. We chose to use Painter, Photoshop, and Il-
lustrator to develop the imagery (characters, props, envi-
ronments), Adobe Imageready to implement/prototype an-
this disconnect between the ?le formats used by the artists
imations and to optimize imagery for output, Macromedia
and the programmers the most di?cult gulf to bridge. All
Flash to create a working prototype of the game with ani-
of the plug-ins, exporters, and ?le converters we have tried
mations and behaviors, and Macromedia Director to study
have the disadvantage of being expensive or unreliable, or
the basics of how object oriented programming works so as
both. Worse still, they fail annually when SOVA upgrades
to provide art students with a better understanding of what
its subscription to the 3D modeling tool of choice, leading
to a last-minute scramble to provide software tools in time.
At the beginning of the semester, we have a non-digital
Our current solution is to use the S3D ?le format proposed
prototyping workshop to practice working with a set of ma-
in Dunn and Parberry  which has the advantage of being
terials, de?ning a set of rules, and creating a system of play,
a text format, so that programmers can open the ?les with
to stimulate students to begin thinking about game-play.
a text editor to check ?rst hand for errors such as mangled
For the 3D course, we use Maya software, Painter, Adobe
texture ?le path names, model origin, and scale. The ?le
Illustrator, and Adobe Photoshop for textures, and Adobe
format, C++ code for a model reader, and plug-ins for Maya
Imageready, Premier, and After E?ects for prototyping ani-
and 3D Studio Max are available online.
mations. In the future, we plan to practice creating a MOD
As with Intro Game Programming, we bring 2 or 3 guest
version of a game so that students are able to see their mod-
lecturers from the game industry to class, but this time the
els/animations in the 3D environment.
focus is on technical material. In addition, we have found
On the fourth question, whether students should be al-
that requiring students to give a technical presentation to
lowed to design and implement a game in any genre, we
class on an advanced topic of their choice is a way to promote
have discovered the same outcome to be true as in the game-
independent learning. In Spring 2006, we plan to teach the
programming course. Restricting the student in any way
class using a 3D version of Ned’s Turkey Farm (see Figure 2)
seems to inhibit development and timely completion. When
currently under development .
students collaborate with their teams on a gaming concept,
there is a degree of ownership that they have for their idea.
GAME DESIGN AND ART
They seem to be more excited about their project, and there-
fore more willing to carry it through to completion.
In addition to becoming pro?cient in the software taught,
On the ?fth and ?nal question, while 2D and 3D art stu-
each student in the game art and design classes use the series
dents are not taught to write their own game engine, they
of game design steps in Crawford  as a blueprint for how
are encouraged to implement a game prototype of some kind
to prepare, plan, and implement a fully functional, playable
on their own within the course of the semester. It gives them
game by the end of the semester. These steps include: (1)
a rough sense of how potential characteristics of the com-
Choosing a Goal and a Topic, (2) Research and Preparation,
pleted game will look and behave, and will allow artists to
(3) Design Phase, (4) I/O Structure, (5) Game Structure,
make necessary changes in scale, animation, and tweaks in
(6) Evaluation of the Design, (7) Pre-Programming Phase,
their model. It also becomes a tool for artists to communi-
(8) Play-testing, and (9) Post-Mortem.
cate desired e?ects to their programming team members.
Parberry, Roden, and Kazemzadeh  list the following
key decisions in the development of a game programming
class that a?ect the outcome in a fundamental way:
Providing a dedicated game programming laboratory proved
1. Should the classes be theory based, or project based?
to be an important requirement, since the standard open
2. What software tools should be used?
laboratories provided by UNT were unsuitable for the game
3. Where do programming students ?nd art assets?
programming classes for several reasons.
4. Should students be free to design any game in any
genre, or should their choices be limited?
• The bureaucratic process of updating software was slow
5. Should students write their own game engine, or work
and cumbersome, since our open labs catered to a wide
with a pre-existing engine?
range of students from the sciences and liberal arts.
• The graphics and sound cards were not up to standard.
• Students developing and playing games proved dis-
We have had great success over the last decade with a two-
tracting to other lab users, and game development stu-
course sequence in game programming in a traditional com-
dents soon ran afoul of rules against game playing.
puter science undergraduate curriculum, and a two-course
• Since game students are required to work in teams with
sequence in game art and design in the School of Visual Arts.
other programmers and artists, a substantial amount
The classes are project based, and feature cross-disciplinary
of team meetings debugging need to be actually at the
keyboard. The open labs are designed for students who
work alone, and in general have a policy of silence.
Game development students are excited about what
they do, and in consequence tend to be rowdy.
 J. C. Adams. Chance-It: An object-oriented capstone
• A dedicated game development space provides a place
project for CS-1. In Proceedings of the 29th SIGCSE
where students can meet and work with other students
Technical Symposium on Computer Science Education,
who share their interest. The area becomes a crucible
pages 10–14. ACM Press, 1998.
for independent learning and experimentation that in-
 K. Becker. Teaching with games: The minesweeper
spires students to greater e?orts and achievements.
and asteroids experience. The Journal of Computing
in Small Colleges, 17(2):23–33, 2001.
 F. Dunn and I. Parberry. 3D Math Primer for
Graphics and Game Development. Wordware
We started with a small room with three computers in
1993. As space became available, we moved to larger quar-
 N. Faltin. Designing courseware on algorithms for
ters in 1994 and 2001, ?nally moving into the current loca-
active learning with virtual board games. In
tion in which we have 570 square feet, 15 computer work-
Proceedings of the 4th Annual Conference on
stations, and a ?le server. We opted for computers built
Innovation and Technology in Computer Science
and maintained by the university, which provides free, fast
Education, pages 135–138. ACM Press, 1999.
onsite maintenance. The computers are on a 2-year upgrade
cycle, as opposed to the standard 4-year upgrade cycle, paid
 T. J. Feldman and J. D. Zelenski. The quest for
for by course fees from the game programming classes. The
excellence in designing CS1/CS2 assignments. In
current computers are 3GHz Intel Pentium 4, with Nvidia
Proceedings of the 27th SIGCSE Technical Symposium
6800 Ultra video cards and dual monitors.
on Computer Science Education, pages 319–323. ACM
We found that the best organization for the lab is the “bull
pit” model, with computers around the outside of the room.
 IGDA Curriculum Framework. Report Version 2.3
The center of the room has tables arranged for conferences
Beta, International Game Developer’s Association,
and meetings, and for laptops that use the building’s wire-
less network. The computer workstations are connected to
 R. M. Jones. Design and implementation of computer
the wired network through the ?leserver, which serves as a
games: A capstone course for undergraduate computer
?rewall to prevent packet ?oods generated by rookie game
science education. In Proceedings of the 31st SIGCSE
programmers from swamping the building’s network.
Technical Symposium on Computer Science Education,
To foster interaction between students and provide an
pages 260–264. ACM Press, 2000.
inviting club-like atmosphere, one corner of the room has
 R. Moser. A fantasy adventure game as a learning
been set up with a sofa, a TV, and several game consoles.
environment: Why learning to program is so di?cult
A typical day will ?nd people playing a game on the con-
and what can be done about it. In Proceedings of the
sole, playing networked PC games, writing code for their
2nd Conference on Integrating Technology into
own game engines, and engaged in vigorous discussions on
Computer Science Education, pages 114–116. ACM
subjects ranging from linear algebra to graphics using one
of the four large whiteboards.
 I. Parberry, E. Carson, J. Nunn, and J. Scheinberg.
Finally, the location of the lab is important. Currently it
SAGE: A simple academic game engine.
is across the hall from the ?rst author’s o?ce, which since
the o?ce and lab doors are usually open, encourages inter-
 I. Parberry, T. Roden, and M. Kazemzadeh.
action between faculty and students. The space is located
Experience with an industry-driven capstone course
away from the other faculty o?ces where the noise gener-
on game programming. In Proceedings of the 2005
ated by the students will not cause a problem for more sober
ACM Technical Symposium on Computer Science
and sensitive colleagues.
Education, pages 91–95. ACM Press, 2005.
To ensure that the lab software is kept up-to-date and
 G. Sindre, S. Line, and O. V. Valv?
that the hardware does not get stolen, we hire a student
experiences with an open project assignment in an
as lab monitor. He or she is required to keep the lab open
introductory programming course. In Proceedings of
for 20 hours per week. The job usually goes to one of the
the 25th International Conference on Software
alumni of the game programming courses so that he or she
Engineering, pages 608–613. ACM Press, 2003.
can provide help to the current crop of students. In addition
to this paid position, several trusted students also have lab
access on the understanding that they provide additional
informal open hours by allowing other students to use the
lab while they are there. The lab door is ?tted with an
electronic card-swipe lock that monitors and records entry.