This section contains some of my programming projects that were created for courses at RIT. These projects tackle some common programming problems like networking and user interfaces. Other examples demonstrate techniques typically used in games (like physics, path-finding, or graphics programming).
Java GUI and Networking
This game was the final project for my freshman programming sequence. The goal for the assignment was to make a multi-player, networked board game using a client and a server. This assignment combined some of the important things that we had learned in the programming sequence such as networking and user interfaces. The game is called Breakthrough and is somewhat similar to checkers, but the goal is only to get one of your pieces to the other side of the board, while stopping the other player from doing the same.
I implemented a GUI, game logic and networking for both the client and server applications. I also added some cool extra features, like the ability to choose a theme for your game pieces and the ability to trace back the path of all of the game pieces after the game was over.
One of the goals for this project was for the entire class to use the same network protocol. This would make it possible for any student to use their client to connect to any other student's server and vice versa. I ended up designing the protocol that dictates the client-server interactions, which was successfully used by my entire programming class.
This demo shows some examples of the A* path-finding algorithm. There are two different programs that I wrote to demo this algorithm.
The first is a flash version. This version has some nice interactive elements and animation. When any key is pressed, the red circle will find its way to the blue circle as long as there is a possible way to get there. Clicking on the grid will add or remove walls from the grid spaces.
The second version is in Java and was written for an AI assignment. This version shows a more practical application of the algorithm in plotting a course between two actual cities on a map. The user can pick start and end city on a map of the United States and compare breadth-first, depth-first and A* search results.
I wrote these programs after I took a game algorithms class where I learned some of the math necessary to do 3D graphics. I became interested in doing 3D programming for Flash because there is no built-in support for 3D graphics. It was a good environment for starting from scratch to show that I could really understand the whole process. My code interfaces with Flash's 2D drawing API to actually render the 3D objects to the screen.
The first program allows the user to create and edit surfaces and vertices for 3D shapes, and to select more shapes from a list of presets. Attributes of the shape, such as color, are also editable. The shapes can also be exported to XML, so they can be saved.
After I wrote the first program, I decided that I wanted 'real' models that were more complex than anything I was going to produce with my own dinky, cumbersome model maker. I wrote a program that parsed FBX files (which is a file format usable by Maya, 3DS Max, etc) and saved them to a stripped-down binary file format of my own specification. I then wrote a Flash model viewer that built on top of the old model maker program and could read this format. This new version incorporates some new optimizations and texturing.
This program was created for Intro to Gameplay Programming. The assignment was to create AI for a Checkers. Because Checkers is a two-player zero-sum game, I chose to implement a Minimax algorithm to govern the AI opponent's decisions. Before each move, the algorithm generates a heuristics-based score for a series of potential moves, and then chooses the best one.
Once I got that working, I added some more fun features. The players have the ability to toggle AI on and off for either player, making it possible for human players to pick up or put down the game whenever they want, and just have the computer take over for them the rest of the time. I also did some animation to show the computer player's hand icon picking up the pieces and moving them to give the computer a more human feel.
Click to enlarge:
2D Billiards Physics in Flash
This game was an assignment for a game algorithms class. The goal of the assignment was to create a Billiards simulation where all the balls on the table had realistic physics-based interactions. These interactions include some collision detection, and transfer of momentum.
I also played with some of the sound API in ActionScript 3.0 to get the right feel with the sounds (the volume of the sounds is based on velocity). The game is modeled after billiards, but the normal rules don't really apply... just hit all the balls in!
This program was an assignment for Programming for Digital Media. The objective of the assignment was to make several autonomous characters on the screen that used some of the Boids flocking behaviors and do some obstacle avoidance. In this demo, the steering of the characters is governed by some vector math (dot products etc.).
For the characters, I chose to use Pac-Man and the blue ghosts that he can eat. There are three Pac-Man characters, several hundred ghosts, and some cherry obstacles that all of the characters avoid.
An example of a flocking behavior would be how the Pac-Man characters use separation so that they don't bump into each other. This behavior creates the effect of having the hungry Pac-Men characters competing with each other for food. On the other hand, the ghosts do not use separation. This creates the effect of having swarms of ghosts that look like schools of fish.
The other thing that is different about this program is that the characters are all generated using bitmap images instead of vectors. Instead of rasterizing vector drawings, the program creates a sprite sheet for each character to quickly copy over the images to a bitmap that is drawn to the screen.
This game was another game algorithms assignment. The game loads in a random image and then cuts it up into smaller pieces in order to make the puzzle. This game was an exercise in creating the data structures that group different clusters of data (puzzle pieces in this case).
The images for this game are all randomly selected from Google image searches.
This demo was a project for a game algorithms class. The assignment was to take an existing physics engine and make something new out of it. I chose to work with a particle system that was a part of that engine. I modified the system to achieve a compelling visual effect where each particle spawns more particles after a certain amount of time.
This program is was an assignment for a Visual C++ class. For this assignment we were told to make a 'GUI from Hell'. The assignment gave each student the freedom to implement whatever ridiculous ideas came to mind in hopes of getting each student interested in learning how to implement their own GUI.
My concept for this assignment was to create a user interface that would repeatedly get hit by a series of natural disasters. The disasters cause the components of the interface to move around the window in various different ways. This includes tornadoes, tsunamis, earthquakes, volcanic eruptions etc.
After working on several games, I had become accustomed to programming in an environment where you constantly update the state of the program, then redraw the screen. However these GUI's were set up to use an event driven model. To solve this issue, I added a timer to my GUI which called an update function at a fast enough frequency to create some convincing animation. I was then able to animate all of the elements of my GUI.
This program was for an assignment meant to demonstrate threading. The user can choose a number of cars, which then race across the window.
Each car is running on a separate thread, which constantly increments the car's position. The purpose of this assignment was to demonstrate the varying and unpredictable nature of timing with threads.