ECE291 Computer Engineering II Lockwood, Spring 1999

Contra Wars

Contra Wars is a multi-player three-team combat game, with the look of Super Contra III for the SNES (shown below). A real screenshot from our game is shown on the Graphics page.

The object of the game is to annihilate all members of opposing teams, who are differentiated by their sprites' colors. The locale is a sunny island in the sea and six players is the maximum amount allowed on a team. There is no single-player mode: at least two players have to be on opposite teams before any action can take place. The players can rotate in all directions and fire bullets. The implementation and some obstacles are described below:

Controls -

The up, down, right, and left arrow keys on the keyboard move the player's sprite up, down, right and left on the screen. The direction keys can be held down simultaneously to travel diagonally. The Ctrl and Alt keys or the left and right mouse buttons can be used to rotate the player's gun and body to face in any direction he chooses. The spacebar or left shift keys can be used to fire at another player. After looking at some previous games that implemented this, we decided to rotate our basic player sprite in 32 different directions to allow him a wider and more flexible range of motion. The player can rotate and fire in any direction, independent of the direction he's moving in.

Graphics -

Contra Wars runs in real mode with mode 13h graphics (320 X 200 X 256). It's a tile-based game with double buffering and we synchronized our "blitting," sending graphics out to the screen buffer, with the vertical retrace period (the period when the physical monitor is not being drawn on). The player's movement is animated by using three different sprites and interchanging them. Current statistics during the game are located on the side of the screen. The players are drawn on the screen by accessing an array with all the players' statistics. Tiles are clipped appropriately before they're drawn on the screen so tiles can be partially onscreen, allowing smoother gameplay.

Networking -

The game runs using NETBIOS in multicast mode. Our routines are based on the code used for mp5 in the NetLIB.asm file. Messages are sent to begin and end the game, to update positions of players, and to indicate that a player fired a bullet. Each client takes care of his own position, but the bullets' positions and movement are calculated by every client. In other words, any bullet fired by one client is tracked and updated by every other client. This allows for the update-bullet message to only contain the intitial position and direction at which the bullet was fired. Only one of these messages is sent per bullet fired, lessening the network load.

Sound -

The sound is run using PMIDPAK. There are sound effects for bullets firing and players dying. The background music is from Super Contra III. The interrupt driven version of MIDPAK was playing the music very slowly so we used the polled version of MIDPAK.

The procedures used are detailed in the web pages linked below. Each member's procedures and documentation are on these pages. The body of the main loop is here. All variables are global, but certain subsets of the set of variables are used only by the networking, graphics, and sound engines. These are listed in the following linked pages. The global variables and constants that are used by more than one of these modules are listed in the last page, game input and logic.

The group's members and their areas are:

- Michael Schwarzlose: Graphics

- Brandon Miller: Networking and Sound

- Ajay Kosaraju: Game input and logic