T-106.270 Basic Course in Programming T3 - Project
Project group I

Decent

Decent - Descent from Hell

Authors:

Antti Villberg (kAmy)
avillber@cc.hut.fi
Esa Nuuros (nurtsi)
enuuros@cc.hut.fi
Miro Lahdenmäki (B.o.W.)
mlahdenm@cc.hut.fi
Tuukka Lehtonen (atlas)
tvlehton@cc.hut.fi

Last updated:

Tuesday, 21.05.2002 18:56 - Corrected an error in the e-mail addresses.

Wednesday, 08.05.2002 20:17 - Improved the menu and reduced the size of the images for faster loading time.

Tuesday, 07.05.2002 18:05 - Added a menu and the introduction and architecture sections.

Introduction

Our intention was to create a lightweight version of the game Descent which offered full 6 degrees of freedom, originally by Parallax Software. Three versions of the game have been published so far.

The first episode Descent published in 1994 was a groundbreaking sample of 3D games. It was one of the first games to offer a fully three-dimensional world with free movement.

The next episode Descent 2 was published in 1996. It brought several improvements to the original game, such as SVGA-graphics, better level design and better artificial intelligence.

So far the latest episode of the game Descent 3 was published in 1999. The advancements it offered were the use of accelerated 3D-graphics, a deeper plot and a wide choice of network options.

Architecture

Our goal with the game engine was to create a hardware accelerated 3d-engine using OpenGL and Java. As our intention is to continue the development of the game we designed the game for a fairly modern computer using at least a Geforce2 MX. To optimize the rendering and loading of the level we used binary space partitioning (BSP), portals and potentially visible set (PVS) techniques. Jausoft's GL4Java-package offers OpenGL bindings for use with Java.

Our program roughly consists of three parts.

We use a 3d-modelling software (3d studio MAX) to create supplementary structures. This is done in a time-intensive preprocessing stage. As a result we get a file containing the BSP- , PVS- and portal structures, lightmaps and control points in the map.

Our 3d-game engine is currently quite simple. It contains the basic routines for algebraic calculations, routines for supplying the level data as well as free objects for OpenGL, simple animation routines, sound routines implemented with Java's internal interface and MP3 playing using JavaLayer library and finally simple input management for keyboard and mouse.

We use client-server architecture for all game modes, single player mode included. The same kind of approach is used with the well-known Quake-series which so many 3d-programmers have used as a model. Network game-play is implemented using the UDP-protocol. We also experimented successfully with multicast technique and we'll most likely use it in a future release. It saves server bandwidth. UDP works better than TCP in a real time network game since it is lighter and doesn't require a connection where all the packets are forced to get through. So our game doesn't require that all the packets get though or that they all come in the right order. Data is received and send in separate threads. Data is transferred with a steady pace. Extrapolation is used to smooth the movement of other players. We tried to synchronize the time of the server and the client with an experimental way but as of yet there are still some problems with this method.

Game settings are loaded from an XML-file so changing the game settings doesn't require the compiling of the classes.

Download the program source code for Decent

Decent - Descent from Hell source code is being converted from Java to C++. Download will be available this summer.

You can download the Java version (2.3 MB) that was returned for Basic Course in Programming T3.

Javadoc documentation for Decent

Javadoc web pages and the javadoc.jar (0.6 MB) package.

Installation instructions

Decent requires Java 2 Standard Edition 1.4 (J2SDK140) and the Jausoft OpenGL for Java (GL4Java). Decent is directed for modern computers with a decent 3D graphics card. GL4Java currently only works with some older drivers from NVidia on Linux so we recommend Windows for this release. The new NVidia drivers will work by compiling the cvs-version of GL4Java. The bug appears as a native call crash. One last thing this program needs is the JavaLayer MP3 player.

J2SDK140 - (http://java.sun.com/j2se/1.4/download.html) - Installation instructions are included.

GL4Java - (http://www.jausoft.com/gl4java.html) - You'll find the installation instructions from the Download section.

Compiling GL4Java - Our comprehensive guide to compiling GL4Java - at least on linux.

JavaLayer MP3 player - The needed files are in the jar package

Adjusting the run-time environment.

Before compiling the package put the JavaLayer MP3 player library (found in the jar package) to your CLASSPATH with one of the following:
set CLASSPATH=$CLASSPATH%;jl020.jar

export CLASSPATH=$CLASSPATH:jl020.jar

$ . setenv.unix

Compiling the jar package.

Decompress the jar package
jar xvf decent.jar
Change to the game directory
cd decent
If you have GNU make just type
make or gmake
If you don't have make type
javac Decent.java network/server/DecentServer.java

Running the program.

There are three ways to run the program

  1. Run the client by commanding:
    java Decent client <ip>
  2. Run the server by commanding:
    java network.server.DecentServer
  3. Run both the client and server in combo mode by:
    java Decent server

After a server has been started you can join the game by typing the following on the client's command prompt
join name password

When you're using the combo mode, there is also an AI bot in the game.

You should replace <ip> by the server ip you want to connect to.


Examples

Just to fly around run the client without giving an ip.
java Decent

To start a multiplayer server run the server alone
java network.server.DecentServer

To join a server on your own machine run the client without giving it an ip
java Decent
then join the game
join name password

To join a server on some one else's machine run the client by giving it the ip you want to connect to
java Decent client 123.234.234.123
then join the game
join name password

To play against a bot run the program in combo mode
java Decent server
then join the game
join name password

Instructions on how to use the program

A brief description of the functionality of the program and a short introduction.

With the current release you'll be able to test the very first engine of the game as well as the multiplay portion of the game. You can try out the controls of the game against a bot or human players.

You can change game settings from the configuration file Decent.cfg.

As you start the game at first you can fly around and get comfortable with the controls. When you feel ready you can start the game by starting the server and joining it with your friends.

Controls:

C - cock pit toggle on/off
Space - Spawn

V - Fire

A - left
D - right
W - forward
S - backward
R - upward
F - downward
Q - roll left
E - roll right

Arrow keys:
Up - tilt down
Down - tilt up
Left - turn left
Right - turn right

Mouse controls:
Left button - shoot
Right button + moving the mouse - tilt and pan

Bugs

As we chose such a large-scale project we had several different divisions of the game that required our attention. We tried our best to axe most of the bugs but as there wasn't very much time the following bugs were left behind.

Multicast technique is not in use since there were problems with threads and parallel processing. We didn't want to waste time fixing it since a direct UDP connection worked.

The server does not model the game. It turned out too complicated to model the movement of all the players to improve synchronization of the game by prediction and extrapolation - especially within the project time frame.

The UDP packets are too big at the moment so network play will only work with a very fast connection. This is due to non-fully-optimized data transfer and the fact that we don't prune the data being send by what the player actually needs.

There are some problems with the server keeping track of dropped out players, but it doesn't affect game functionality. Preventive cautions have been taken.

The player can hit himself if he goes forward while firing his lasers. This is because the server and player are not entirely in-synch. The server can create the projectiles within the bounding ball surrounding the player. We didn't have time to fix this one.

The floating items in the levels get collected from too far away. This is due to the size of the bounding ball surrounding the item. The bounding ball calculation routine is probably a little buggy.

There is some roughness in the light maps.

There are quaternion problems with the bot.

Some bugs appear with BPS, PVS and portals in the more complicated maps.

Sometimes the player can get through a wall.

The chat feature doesn't seem to print the messages it receives anymore.

Ammunition sometimes locks itself in a fixed position.

Snapshots of different phases of the game development

Official Decent Wallpaper ;) - 156kB Historical first multiplay snapshot - 10kB First Decent ship - 45kB Some lights and textures from an early stage - 34kB Snapshot from the Cubido map - 29kB Floating item - 22kB

Credits

Some of the 3D models/images by kuman (http://kuman.descent-network.com/)

Some algorithms by bias converted from C++ (http://www.cs.helsinki.fi/u/niemisto/index.html)

This document validates as HTML 4.0 TransitionalThis document validates as CSS

Webmaster Miro Lahdenmäki (B. o. W.)