ECE291

Computer Engineering II

Spring 1998

scorch.gif (7717 bytes)

Assignment: To write our own machine problem
Due Date for Demo: Thursday, April 30
Final Due Date: Friday, May 1
Purpose: Create an improved version of Scorched Earth that incorporates a 3D world, networking, graphics, and sound
Project Goal: Create an awesome game, get an A, and take home all those nifty awards and prizes

Group Members and tasks:


Problem Description

This project combines challenges seen in previous MPs such as graphics rendering, player movement, input/output, as well as new challenges like networking and sound integration.  It also adds the most obvious and probably the hardest challenge - working as a group to complete the project.  Completing and testing an individual section of the program, such as all the tasks that were assigned to a member, does not mean that section is complete.  It must still be integrated with the routines written by the other members.  After integration, the whole program must be thoroughly tested to ensure that the combined procedures interact and function properly with all the other procedurs.  We are planning on finishing the individual routines a week before demonstration to allow a full week for integration.  If all goes well, we will finish integration early and have some extra days before the demonstration to add a few features we had to hold off on during planning.

We will have to design our own engines for every aspect of the game.  The hardest of them being the graphics engine.  It will have to render the overhead view, side view, and of course the hardest part, the forward looking view.  Another difficult aspect will be integrating the networking with the rest of the program.  Juggling packets from multiple players and interpreting all of them within a given time period will require excellent programming and thorough testing.  Another challenge, the user interface, needs to combine ease of use with functionality.  After all, if no one can get past the main menu, the can't play the game.  Another difficult part of the program will be the game play itself.  Keeping track of up to ten tanks and ten weapons along with a constantly changing terrain all at the same time is difficlut a task.   Add to that the control of the computer AI, and you've got quite a challenge.   Mixing the correct sound effects to flow smoothly with the action adds an important aspect that is needed for any good game.  All good games also require an introduction sequence that grabs the user's attention.  Creating the correct sequence is another formidable task.


Game Description and Operation

This project implements an improved version of the classic Scorched Earth game.  It combines a real time game taking place in a 3D world with 320x200 VGA graphics, sound, single player against the computer, or multi-player over a network.   The game starts with an introduction screen followed by the main menu with game type options and game setup options.  The actual game screen is divided into a large display showing the view from the front of the tank, two smaller displays showing an overhead shot of the whole battlefield and a side view much like the original Scorched Earth screen, along with a section dedicated to tank status such as turret angle, weapon power, inventory, health, fuel, etc.

The play will use both the mouse and keyboard (with user defined keys) to control all aspects of the game play.  During the game, the user will be able to change the view angle, switch weapons, adjust turret angle and weapon velocity, and navigate the terrain with the mouse and keyboard controls.  After targeting an enemy, the player can select from an arsenal of purchased weapons and let one fly.  The real time nature of the game is somewhat limited in order to preserve the strategic element of the original game.  Due to reload time, players may only shoot their weapons every 10 seconds.  Another complication with the weapon system, which is still left unexplained by the tank's engineers, prevents two weapons from the same player to be in flight at the same time.  Attempting to fire a second weapon causes the first one to be destructed.  If utilized correctly, this "feature" as the engineers prefer to call it can be used to detonate a near miss directly over an enemy's head, causing considerable damage.

The battle continues until only one tank is left standing, at which point the winner of that round is declared, and players receive their money based on performance in the previous round.  The game then enters the buying screen where players may spend their hard earned money on better weapons, increased shields, and fuel.  After all players (including the computer) have replenished and upgraded their stockpile of weapons and supplies, the next round begins.  Battle after battle are fought until the previously determined number of rounds have been played, after which the overall winner is decided and rewarded with a congradulations screen.  After the battles, all the players are returned to the main menu where another battle may be set up to settle once and for all who the best player is.


Implementation

This program was written entirely in assembly, completely from scratch (excluding a few adapted functions), including all graphics.  The first task was to divide the game areas between all the members, and each come up with procedures, variables, and data structures necessary to complete our part of the game.  We came up with five major sections (which is good becaue we have five people in our group) to break the game into: User interface - I/O & menues, Graphics and sound, Networking, Game play & AI, and the Game play graphics - 3D rendering.

Next we started on a preliminary game loop that tied together everyone's functions and gave a good idea exactly what needs to be done.  The next task was to split up and each write our functions, keeping in mind that they need to interact with eachother's procedures.  The main goal for the first week of programming was to get basic working functions so they can be put together as early as possible.  But that phase ran over the first week, and into the second.  We were finally ready to start integrading code on the Saturday before the project was due.  The integration turned up countless bugs in everyone's procedures that had to be fixed before we could continue.   This continuous integration of new code with the already functional base code continued until the due date.

We had a playable, yet very buggy alpha version finished by Tuesday night.  It didn't include the forward looking 3D screen, any type of AI (all computers took the same shot every time), or sound.  The 3D rendering was completed late Wednesday night, the AI was finialized around 4:00 Thursday morning, and the sound was integrated around 7:00 Thursday morning.  Other additions to the alpha were an improved menu structure, game play that included a dynamic terrain, and other fixes with the tank and weapon movement and calculation.  The beta version came together at 8:45 Thursday morning, just in time for the 9:00 handin.   This beta still didn't include tanks in the main 3D screen (although they were visible in the two side screens), networking, or economics.  Our demonstration of the beta Thursday night was flawless.


Screen Shots

Image1.gif (7565 bytes)

One of the first working alpha's

Image2.gif (7719 bytes)

First playable alpha. All the numbers in the main scren are for debugging the tanks and weapons

Image3.gif (8893 bytes)

Another shot of the playable alpha. This time the numbers are used for debugging the AI.

Image1.gif (7565 bytes)

The playable beta

Image3.gif (8893 bytes)

Another of the beta

Image3.gif (8893 bytes)

Yet another one

Image3.gif (8893 bytes)

This is the last one, don't worry


Main Procedure


Miscellaneous Procedures

_SetUpTables


SetUpProgram


FinishProgram


RandVal


QuickRand


WorldHeight


CalculateWorldPosition


ChooseHostRandoms


ChooseClientRandoms


ChooseSingleRandoms


_CalculateTerrain


Graphics Procedures

Intro


Outro


ZoomLogo


MLoadPCX


MShowScreenBuffer


MoveScreenDn


Fade


_InstKey


_DeInstallKey


MyKeyInt


_ClearBuffer


DelayProc


Sound Procedures

ProgramDSP


ProgramDMA


DSP_Reset


PlayWave


InstallSBISR


DeinstallSBISR


DSP_IRQdone


PlayMidi


GetSBSettings


SetDMA

 


GamePlay Procedures

CalculateMovement


CalculateWeapon


CalculateWorldDamage


SetUpWar


SetUpBattle


ResetBattleLoop


CheckBattleDone


AI Procedures

ComputerBuy


CalculateAI


CalculateCloseShot


CalculateBetterShot


ComputerShot


Graphics and Rendering Procedures

RenderGameText


RenderOverhead


RenderSide


Render3D


CastBack


WorldHeight


ScaleSprite


Network Procedures

ProcessInfo


GenerateGame


JoinGame


SendRandoms


GetHostRandoms


CheckNetworkReady


WaitNetworkReady


SendPosition


SendBattlePacket


I/O Procedures

_InstKey


_DeInstallKey


_MyKeyInt


_UpdateGlobalIO


Main_Menu


Blit_Char


Blit_Integer

DrawBars


Constants

Tank Related

TANK_ARRAY_SIZE EQU 63
WEAPON_ARRAY_SIZE EQU 19
TANK_START_TIME EQU 300
TURRET_SPEED EQU 1
TURRET_MAX EQU 90
POWER_SPEED EQU 1
POWER_MAX EQU 1000
POWER_START EQU 200
HEALTH_START EQU 100
TANK_SPEED EQU 3
TURN_FAST EQU 6
TURN_SLOW EQU 1
DEGREE_0 EQU 0
DEGREE_360 EQU 360*3

 


Global Variables and Structures

Keyboard/Mouse variables


Store information about Tanks and Weapons


Special Thanks:


This page is created and maintained by Mike Soukup
This page was last updated Friday, May 1, 1998