ECE4893A/CS4803MPG – Homework #2

ECE4893A/CS4803MPG – Homework #2

ECE4893A/CS4803MPG: Multicore and GPU Programming for Video Games

Fall 2010

Homework #2: Adding a Dimension

Due: Friday, Oct. 22 at 23:59:59 (via T-square)

Late policy: The homework will be graded out of 100 points. We will
accept late submissions up to Monday, Oct. 25 at 23:59:59; however,
for every day that is it is overdue,
we will subtract 20 points from the total.

We understand thst sometimes multiple assignments hit at once, or other
life events intervene, and hence you have to make some tough choices. We’d
rather let you turn something in
late, with some points off, than have a “no late assignments
accepted at all”
policy, since the former encourages you to still do the assignment
and learn something from it, while the latter just grinds down your soul. The
somewhat aggressive late penalty is not
intended to be harsh – it’s intended to
encourage you to get things in relatively on time (or just punt if you have
to and not leave it hanging over you all semester) so that you can move on to
assignments for your other classes.

Some of the machines in Klaus 1446 have fancy NVIDIA or ATI graphics cards;
small labels on them should indicate which ones have such cards. These machines
should have Visual Studio 2008 and XNA Game Studio 3.1
installed on them. You can also do
work on your own machine, and in fact are encouraged to do so
to lighten the contention on the lab machines. In theory, you should be able
to get Visual Studio from 2008 from

Be sure to download
XNA Game Studio 3.1
you have
Visual Studio 2008 (and its latest updates) installed. (You could also do
it with the free Visual Studio 2008 Express, but as a student registered for
an ECE or CS class you are entitled to get the full Visual Studio 2008, so
you might as well get the complete version.)
Even if your graphics
card is insufficient to run XNA games, you can still edit and compile.
(Different versions of Visual Studio and XNA Game Studio can happily coexist
on the same machine, so if you’d like to experiment with Visual Studio
2010 and XNA Game Studio 4.0, you can do that. However, all of the code
examples we show in lecture and post on the class website will be for XNA
3.1.) If you haven’t used Visual Studio before, you should spend a little bit
of time exploring its features.

Download the content and source files for Prof. Lee’s 2D game that he
showed in lecture. You can find the ZIP file for these on the main webpage.
Make sure you can compile and run the game.
Do this early to make
sure you have it out of the way – don’t e-mail me the day before the
assignment is due and tell me you can’t get it to compile.

Once you are sure you have it running OK, make the following two changes:

1) Add some minor innovation to the gameplay that involves an additional
possibility for user input, such as a hyperspace command
(which teleports the player to a random place on the screen), a smart
bomb command (which destroys all enemies on the screen, but you have a limited
number of smart bombs), a shield that the player can toggle on and off
(which makes the player invulnerable, but can only be used for a limited
time before it needs recharged), or a time warping feature that slows down
the enemies (again, you would want to limit this somehow so the player
couldn’t use it all the time). Feel free to be creative. Do something
interesting but relatively simple to implement. (This part is intended
to make you play with the game input code.)

2) Some modern games employ 2D gameplay conventions but render the scene
elements as 3D assets. Examples include
Smash Brothers Brawl
Fighter IV
, and the Spacewar starter kit that comes with XNA.
Replace the
pictures of Prof. Lee, Prof. Lee’s dog, and
the missile with 3D objects that
you render in 3D using BasicEffect.
Note that we will keep the game mechanics
(motion of the enemies and the ship, etc.)
entirely 2D – gameplay is still taking place on a plane
. Essentially you
will set your camera to look down onto this plane. To make things interesting,
make the enemies spin in 3D. However you want to set up the lighting is up
to you. In terms of what 3D objects to use, you may want to use some of the
assets in one
of the starter kits
, some objects from
some other XNA games you find on the web,
and/or .x or .fbx files from Turbo
. Note you will very likely need to scale your
models to get them to be a reasonable size in your game.
As far as collision detection goes, try to
come up with
something that plays reasonably, but we will not be picky about this.
We recommend using BoundingSphere structures. Do not try to implement any
complex collision detection routines.

Philosophy: Have fun!

Package everything needed to compile and run your upgraded game and upload
it to T-square as a zip file (basically zip up your whole folder, including
whatever executables you create.)
Include “HW4” and as much as possible of your full name
in the filename, e.g.,
(The upload procedure should
be reasonably self explanatory once you log in to T-square.)
Be sure to finish
sufficiently in advance of the deadline that you will be able to work around
any troubles T-square gives you to successfully submit before the deadline.
If you have trouble getting T-square to work, please e-mail your
compressed file to, with “MPG HW #4” and your
full name in the subject line; please only use this e-mail submission as a
last resort if T-square isn’t working.

The midnight due date is intended to discourage people from pulling
all-nighters, which are not healthy.

Note that you do not need to try
running anything on the Xbox 360 at this point.
A fairly complex procedure is involved;
we will cover that on a later homework.

Ground rules: You are welcome to discuss high-level implementation
issues with your fellow students – in particular, feel free to point one
another to appropriate examples online –
but you should avoid actually looking
at one another student’s code as whole,
and under no circumstances should you be
copying any portion of another student’s code.
However, asking another student to focus
on a few lines of your code discuss why a you running into trouble
is reasonable. Basically, these “ground rules” are
intended to prevent
a student from “freeloading” off another student, even accidentally, since
they won’t get the full yummy nutritional educational goodness out of the
assignment if they do.

Looking at code from homeworks done in previous years is strictly