User Tools

Site Tools


Project 2 - Multimedia Game

Abstract & Some Technical Mumbo Jumbo:

    This project entails a simple video game. The two basic component of the project are the game application itself, and a separate program that lets a user send data to the video game over a network connection (from a potentially different computer.) The video game portion is written in the Processing programming language. The program that sends data is written in Pure Data (pd). This Pure Data patch features a series of slider bars which correspond to numerical values, which in turn are periodically sent over the network to the Processing sketch. The game program proceeds to update the game session in real-time, in accordance with the new data.

    The style of the game itself is a top-down perspective dungeon-crawler, in which the player controls a single character and uses the directional keys (up, left, down, right, or alternately, WASD) to navigate him or her around walls and into various rooms or areas. Enemies will spawn when the player enters a new room. If an enemy touches the player, the player loses HP; the amount lost is determined by a formula which takes into consideration the player’s defense power and the enemy’s attack power. On the other hand, if the enemy is hit by the player’s weapon, then that enemy loses health points (based on the enemy’s defense and the player’s attack).

    Graphically, the game works by drawing a background (a series of tiles through which the player’s sprite can pass), walls (tiles through which the player’s sprite cannot pass), the player sprite, the player’s weapon sprite, enemy sprites, and sidebar for displaying information about the game (e.g. the player’s current health level).

    A special feature of the game is the option to activate a video camera if one is connected to the computer on which the game is running, and to move the player’s sprite around on the screen in different directions and at different speeds. The direction and speed is based on numerical values derived from an early version of a motion detection algorithm developed by Nels Oscar (see: Unfortunately, because it is such an early version (much less sophisticated than his current version, as of this writing), it is unreliable, and the motion detection does not work as desired (e.g the player’s sprite should move right when the user makes a right-ward motion in front of the camera). To toggle this mode on or off, press “m” (either lowercase or uppercase).

    The game is pretty silly and has a stupid “Easter egg”. An Easter egg is a hidden joke or feature which can be accessed by performing a specific action. If the user presses “p” (either lowercase or uppercase), the game will toggle on or off a special mode called “Pacman mode”, which poorly mimics the famous Pacman arcade video game. The pd patch can control such game variables as the player’s attack power, defense power, speed, and level of intelligence, as well as the speed at which his or her orbital weapon spins, and its distance from the player. Pure Data - How to use: Make sure to open the file that has a .pd extension with Pd-extended (not “Pd-0.42-5”). In the message box (the box that splits off into two ends to its right, like a banner or a ribbon) that starts with “connect”, change the IP address that comes after to match that of the machine running the Processing sketch. Do not change the number that comes after it (it should be 12000), and be sure to leave a space between the word “connect” and the IP address and between the IP address and the number following. Change the slider bars to some initial value. If the user does not give each bar an initial value, even if the user wants to use the value that the pd patch displays initially (e.g. 0), then the patch will send incorrect data. Additionally, do not set the slider bar labeled “Block Density to 0 or 1 (the smallest and largest values allowed), as Processing interprets those as integers (and it’s really looking for floating point values). Finally, to start sending the data from pd to Processing every 500 milliseconds, click the toggle box (the small box right above the box labeled “metro 500”).

Purdy Screenshots:

(click on the images to see or download the source code!)

Video Game, built with Processing:

Remote Updater, made with Pure Data:

cs276/dhl.proj2.txt · Last modified: 2009/12/11 19:15 by wikiwikwik