AppWeek

Originally posted to Shawn Hargreaves Blog on MSDN, Friday, June 12, 2009

Toward the end of every Game Studio development cycle, we schedule some time to down tools, install the latest daily build, and use it to make a game. This serves as a sanity check (does our product actually work?) and also a learning exercise (what things suck the most? What should we try to improve in the next version?)

That's the theory, anyway. And in theory, there is no difference between theory and practice  :-)

We did an AppWeek shortly before shipping Game Studio 1.0, which produced minigames by Dean and Minjie, plus a bunch of stuff that was too unfinished or too much of an IP violation to release. Every subsequent release had an AppWeek in the original schedule, but when push came to shove things just took too long and the bug pile was too big, so AppWeek ended up on the cutting room floor.

Until now. I am happy to report that AppWeek 3.1 took place as originally scheduled. Here's the title screen from the game I made:

title

This is an online multiplayer game, inspired by Capture the Flag but with cats instead. Players are divided into red and blue teams. Each team has a base which is marked by a plume of colored smoke and occupied by a cat. The objective is to infiltrate the other team's base, steal their cat, and take it back to your own base without being killed.

I borrowed from many samples to stitch this together, making it more of a Frankenstein remix than an original piece of programming. One of my goals was to investigate how well our sample code holds up if you use multiple samples in a single game (verdict: this worked well for me).

I started with the Network State Management sample for the main program structure and menus, and added code from the Network Prediction sample to synchronize object positions during gameplay. I used the Heightmap Collision with Normals sample for terrain rendering and collision, and the Generated Geometry sample to create the sky from a photo I took on Orcas Island. I tarted up the terrain rendering by adding a normalmap (using the NormalMapProcessor from the Sprite Effects sample to convert it from a grayscale displacement map), and threw in the Bloom and Lens Flare samples for graphical bling. My player character used an avatar animation system that Dean wrote for a GDC demo (which is not yet a sample, but will hopefully someday become one), plus the Skinned Model sample to provide fallback character rendering on PC and for players who have no avatar. Add a camera (taken of course from the Chase Camera sample) and we have the beginnings of a game:

avatar

I needed weapons to liven things up, and figured vehicles wouldn't hurt either. I used the tank model and turret rotation code from the Simple Animation sample, and added the ability for players to get in the tank and drive it around. For smoke plumes, weapon trails, and explosions, I used the Particle 3D sample, plus the Authoring Particle Systems using XML tutorial so I could easily tweak the particle settings:

tank

Not satisfied with just one type of vehicle, I also included hoverships, using the Custom Model Effect sample to render them with an environment map:

ship

I borrowed more code from the Picking sample (for drawing gamertags above players), the 3D Audio sample (for drawing billboarded cat sprites) and the Safe Area sample (the SafeAreaOverlay component).

It was interesting how my development resembled a scaled down version of working on a commercial game. I spent the first couple of days writing nice code, refactoring as I went, and creating a robust Internet-ready network protocol. Then on Friday I switched into "gotta be done by 2:45 PM" mode, and started hacking as fast as possible. Forget design principles: I made things public any time I needed to access them. Forget network efficiency: I took the easy way out and made the host responsible for all empty vehicles, cat capture status, and scoring.

It worked, at least with two players. In theory it should support up to sixteen, but I didn't have time to test that many. I suspect it uses too much bandwidth for many players to work over the Internet without more optimization, and I have no idea what the rendering perf would be with more going on. The weapon damage amounts and collision radius are less carefully tweaked than I would have liked, and I didn't have time to implement shadows, gameplay sounds, vehicle respawning, or a radar/map.

But hey. Not bad for 4 days work. I continue to be impressed by how productive programming in C# can be!

Blog index   -   Back to my homepage