Game Programming Portfolio

NightSky

NightSky running on an iPad. In the video, I play through some of the early areas in the game, then the credits, and finally a few much harder Alternative mode levels, using the swipe control mode.

In 2012 I worked on contract for Nicalis, Inc. to create a port of the PC game NightSky to iOS. I did all of the programming for the port, starting from a PC version (NightSky HD) written in C++.

A large number of aspects had to be tweaked or completely rewritten, including image loading for PNGs, rendering in OpenGL ES, audio streaming, menu functionality, and all of the in-game controls. In the process I also fixed pre-existing bugs and added many iOS-specific features.

Features

  • Universal (runs on iPhone, iPad, or iPod Touch with one version)
  • Retina optimized
  • Unique touchscreen control scheme
  • 46 Game Center achievements
  • Great compatibility with old devices

Controls

I built three separate control modes to suit the iOS platform: Swipe, tilt, and digital. I improved previous versions by adding analog input in the swipe and tilt modes. Direct touch control was added to many of the objects in the world, such as cannons, removable blocks, and pinball flippers, in place of the PC game's somewhat contrived button controls.

NightSky running on an iPhone 5.

Swipe is the default control mode, and is very intuitive. As one reviewer describes it, "If you're looking for a game that shows how simple, touchscreen-focused controls can create an elegant, hugely entertaining experience, then NightSky is well worth your time."

A player controls the sphere by sliding or flicking on the screen like a trackball. The sphere's powers are used automatically based on finger movement. When a finger is stopped or sliding slowly, friction (braking) is used. When sliding quite quickly, boost is used. When swiping upward or downward, gravity is reversed or returned back to normal, respectively. This gives a great degree of control, while only requiring use of one finger to play through the entire game.

Tilt and Digital control are more straightforward translations of the original game's controls, using virtual buttons or the device's accelerometer for movement. Areas that don't use a particular button will automatically hide that button.

Compatibility

I ported the game with compatibility in mind, as I am frequently frustrated to find games that don't support my older devices. The game is universal and will run well on any iOS device released in 2009 or later. However, the performance is better on devices released in 2011 or later, since the game can run at 60 frames per second on newer devices. Since the game was originally designed for a widescreen aspect ratio, it runs fullscreen on 4" retina devices such as iPhone 5 and 5th gen iPod Touch. On other devices, it runs in a letterbox mode.

The game also has an Android version which I was not directly involved with. The Android version uses all my my iOS code for the user interface, but I didn't work on it so it may have issues I don't know about.

Get NightSky

Important: Installers are not provided for the following games, so you will need to install the prerequisites below manually in order to run them.

XNA Prerequisites

Axe Cop: Fwinky Dog

This project was a combination fan work and student project, based on a subplot from the web comic Axe Cop. The goal was to create a 3D scene that looked like it came out of a comic book.

I used several graphical techniques in recreating this scene: Soft shadow mapping, image post-processing, and Perlin noise.

Soft Shadow Mapping

A comparison of my soft shadows (left) against ordinary aliased shadows. The underlying shadow maps are exactly identical.

In the process of creating this scene, I created a technique for soft shadow mapping, where shadows which are closer to the object casting the shadow have a harder edge, simulating the penumbra of a shadow. This approximation is far less vulnerable to aliasing and other artifacts than many shadow mapping techniques, and does not require much shadow map resolution to look good.

The technique is flexible in that it can also be used to create completely hard-edged shadows with smooth contours or completely soft-edged shadows. It does not suffer from noisy artifacts, whereas other techniques that use stochastic sampling may. It is similar to Percentage Closer Filtering (PCF) but unique in its smoothing techniques. By applying a 3x3 box blur in texture space to shadow samples and bilinear filtering those blurred shadow values, I am able to generate a perfectly smooth representation of a shadow's edge with no visible discontinuities or sharp corners. I then apply variable thresholding based on the distance from the shadow caster to vary how sharp the shadow's edge is.

This method is not appropriate when accuracy is important, since it softens fine details in the shadow, and the maximum softness is dependent on the shadow map resolution.

Further tweaks could still be made to reduce artifacts like "shadow acne" and "Peter Panning" and to optimize the pixel shader.

Image Post-Processing

A close-up sample of the behavior of the halftone effect.

In order to give the scene a comic book feel, I decided to try creating an effect which rendered the scene as if it were printed with halftone patterns, to give the illusion of the printed image. This technique is particularly striking on displays with high pixel density.

The pattern uses real properties of halftone printing such as a CMY color model and different screen angles for the different colors. Initially the shader used a CMYK color model, but it was too difficult to make the colors match well in the limited development time.

Unfortunately, the effect degrades poorly in video compression unless a very high bitrate is used, and YouTube gives no control over encoding quality, so it had to be omitted from the videos on this page. However, the effect is enabled in the downloadable version.

Perlin Noise

In order to add visual interest to some of the effects (the explosions and smoke clouds) I decided to use Perlin noise. To help match the desired comic book feel, I applied simple toon shading to the noise intensity, which created interesting shapes and outlines, but flattened out the colors too much. So, to complete the effect, I blended the toon-shaded noise with the original noise to add a bit more texture variation.

Controls

  • Right arrow key - Next scene
  • Space - Toggle halftone effect
  • Up/down arrow keys - decrease/increase halftone DPI
  • Maximize/resize the window normally to change the display resolution.

Downloads

This application uses graphics, scenes and characters from Axe Cop, which is Copyright © Ethan Nicolle. Used with permission.

GalacTex

This teapot has UV seams along its center line through the spout and handle, but the texture is rendered so that the seams are not visible.

GalacTex is a lightweight framework that allows users to bake 2D textures for any arbitrary 3D mesh, similar to the texture baking tools in Blender and other 3D art programs.

Some advantages of this system are that it allows a game to be distributed with just the model and shader files, and that the texture is generated at load time, at any resolution. Shader code is extremely compact, which reduces the file size on disk, and texture sizes can be selected to better optimize performance depending on the user's hardware.

Although this set-up is significantly slower than reading the same texture from disk, it can be run in parallel with conventional asset loading, and rendered textures can be cached on disk after the first run.

The system works by transforming the model into UV space in the vertex shader and passing the position, normal, and other information as texture coordinates. The pixel shader can use that data to generate the texture. The framework handles expanding the edges of UV islands in such a way that the UV seams are not visible on the textured model.

Downloads

Fractal Kaleidoscope

A simple GPU-accelerated Julia fractal visualizer with several interesting effects. The user can manipulate and navigate Julia fractals freely.

It offers several color schemes and the ability to view the fractal mirrored in such a way as it would appear if seen through a kaleidoscope. The colors are sampled from a linear texture to make it easy to create new color schemes.

It also features an automatic mode where the fractal smoothly shifts through the regions of the most interesting shapes, by moving Julia's seed using a noise function and keeping it from moving too far with a simple spring constraint.

Downloads

R.T.Chess

The goal of this project was to create an RTS with a computer opponent that made use of pathfinding and simple AI.

Turns pass periodically, and multiple pieces can move simultaneously. The player gives abstracted orders such as attacking a specific piece or defending from a position rather than assigning individual moves. Each chess piece uses A* pathfinding to find its way to its destination square or target piece without player intervention. The game ends when a king is captured.

For fairness, the computer player has the same capabilities as the human player: to periodically give an order to a single piece.

Downloads

Imagination Stations

A video playlist (five videos) of the front-end, FSR, and PWND games. Use the "Next" button to the right of the Play/Pause control to skip to the next video. Narrated by the project lead, Dr. Tim Chamillard.

The Imagination Stations were commissioned by the University of Colorado at Colorado Springs in partnership with Peak Game Studios. The goal was to create interesting and interactive displays which would get touring K-12 students interested in science and engineering topics through presentations and educational games.

The games are on display on several HDTVs on campus, in the Science & Engineering building. All the software is controlled via one to four wired Xbox 360 controllers (PWND can be played cooperatively with up to four players).

I was on the teams that developed the front-end, and the PWND and FSR games. Other departments and teams supplied media such as videos, PowerPoint presentations, and simpler games.

Most of my work was on 3D graphics: modeling, texturing, rigging, and animating 3D objects; rendering and batching image sequences for 2D games, and writing rendering code for 3D games. All of the graphics were designed for a 1080p HD resolution.

Related links

Rhombi II

Rhombi II gameplay footage (480p or 720p quality recommended)

Rhombi II is a PC puzzle game built in Game Maker. The player moves the blue square using the arrow keys. As the player moves, they leave a trail of blocks behind. Those blocks are consumed over time by a tail of fire. The player's goal is to destroy every block and reach the end of the level.

Since turns only pass when the player moves (similar to Roguelike games), the player can pace their play style however they like, slowing down to plan paths through tricky sections.

The first version of Rhombi was inspired by a mini-game "Square" in the WiiWare game MaBoShi's Arcade. It was later enhanced to add menus and power-ups, which can be used to play as a two-player cooperative experience, or for occasional assistance when playing solo.

Controls

  • Arrow keys - movement
  • Left mouse button - Select power-up, use power-up

Download

Sample code

The source code to the projects R.T.Chess, GalacTex, and a small Flash game called Nerf Spy are available in the download below.