Release Notes for JFDuke3D

Release date: 10 March 2013

New Features and Improvements

Known Issues

Individual User Profiles

Previous versions of this port supported old versions of Windows where storing game configuration and save data in the game directory along side the EXE and GRP files was accepted practice. Since Windows 9x, ME, and even XP are well beyond their supported life, I have switched the behaviour of this port to storing user-specific data in the user's profile directory. This directory can be found at:

If you are upgrading from an older version of this port, you may want to move your duke3d.cfg and gamen.sav files to the appropriate new location.

Multiplayer games

Multiplayer games are started via command-line parameters passed to DUKE3D.EXE. This is a short guide to getting a multiplayer game running between these three hypothetical computers:

Host nameIP address
faye192.168.1.2
asuka192.168.1.5
kaoru192.168.1.6

Keep in mind that the networking features are still being refined and there are certain issues and caveats to be aware of when using it. The basic syntax of the network command line is like so: DUKE3D (normal game parameters) /net (network parameters)

Network parameters
/nx:y Game comm type. x = 0 for master/slave or 1 for peer-to-peer.
If unspecified, y defaults to 2. For more than two players in a master-slave game, you have to indicate the number on the master. eg: /n0 or /n0:4
/px Overrides the default port (23513) with x being the new port value.
address:port An address of a machine. See the items below for more information.

Master/Slave mode

This mode is the easiest mode for use with Internet play since it requires only the address of the master of the game (the person hosting the game) be specified by each slave who joins. Here are example command lines each machine must run to join the game hosted by the machine named 'asuka':

asukaDUKE3D.EXE /net /n0:3
fayeDUKE3D.EXE /net /n0 192.168.1.5
kaoruDUKE3D.EXE /net /n0 192.168.1.5

Peer-to-peer mode

This mode is often useful for playing on a LAN where it is easier to coordinate and organise the order of peers in the game. This mode will become simpler to set up in the future but for now this is how to do it. Peer-to-peer mode requires each machine specify the addresses of each other machine in the game in the same order, but indicating its own position in the sequence with the /n1 option.

asukaDUKE3D.EXE /net /n1 192.168.1.2 192.168.1.6
fayeDUKE3D.EXE /net 192.168.1.5 /n1 192.168.1.6
kaoruDUKE3D.EXE /net 192.168.1.5 192.168.1.2 /n1

Addresses and ports

The networking code is capable of resolving WINS host names (on Windows) and DNS names to their corresponding addresses, so if your network is configured with such services, instead of having to specify raw IP addresses, you can give the computer's WINS host name or a DNS host name.

The default port the game communicates on is 23513. Some users may find it necessary to set up a forward through their Internet firewall in order to get games working when playing across the Internet. You can override the default port via the /p??? switch where ??? is the new port number. If a master is running a game on a port other than the default, the slaves will have to specify the alternative port with address:port notation, eg. 192.168.1.5:20000

NAM Support

Because it was trivial to do so, the commercial Duke3D-based game “NAM” is now supported directly by JFDuke3D. Here is how to use it:

  1. Find the GAME.CON and NAM.GRP files from your copy of NAM.
  2. Rename GAME.CON to NAM.CON and put it in the JFDuke3D directory.
  3. Copy NAM.GRP to the JFDuke3D directory.
  4. Run JFDuke3D and select NAM from the Game tab in the "Game or Addon" list. If you have disabled the startup window from automatically showing, you can run DUKE3D.EXE passing the -setup switch to display it, or enable the "Show startup window" option in the Options → Game Options menu inside the game, or you can run DUKE3D.EXE passing the -nam to enable NAM mode directly.

DEF-file Language

Documentation of the DEF file language can now be found on my website as the information there is common to all JFBuild-based ports.

Map Hack scripts

"Map Hack" scripts are files that override certain aspects of a map file when it is rendered in OpenGL Polymost mode. Currently they allow for angle adjustment on sprites, and the ability to prevent particular sprites from being drawn as a model. These are useful for making small corrections to ornamental sprites in a way that doesn't require modifying the original map.

The game will automatically load a map hack script whenever a map is loaded. The script should have the same base name as the original .MAP file, but with an .MHK extension. The map hack language is described below. It uses the same parser as DEF files, so you can use comments in the same way.

sprite number
Begins a sprite definition. number is the sprite number to affect. You can find this in the Build editor by highlighting the sprite in 2D mode and pressing Control+Tab. The next group of commands describe the changes to make to the sprite.
notmd
notmd2
notmd3
Prevents the sprite from being drawn as a model. It gets drawn as a regular sprite instead. notmd2 and notmd3 are synonyms for notmd.
nomdanim
nomd2anim
nomd3anim
Prevents model animation from playing if the sprite is being drawn as a model. nomd2anim and nomd3anim are synonyms for nomdanim.
angleoff angle
angoff angle
Adds angle to the angle of the sprite just before it is rendered. This is good for fixing up things like toilet sprites that are facing the wrong way. angoff is a synonym for angleoff.

Here is an example map hack script:

// Map hack file for JFDuke3D
// Level: E1L2.MAP (Original Atomic Edition version)
// Prepared by jf@jonof.id.au

// Invisible switch behind hand dryer in toilet of porn shop
sprite 191 notmd2

// Invisible switches on telephones near billiards room in club
sprite 254 notmd2
sprite 517 notmd2

// Toilet in restroom in club
sprite 478 angoff -512

Hightile

This release features the "Hightile" texturing improvements to Polymost. Hightile allows Polymost to use true-colour textures instead of the artwork in the game's usual .ART file.

Replacement textures can be saved as JPEG, PNG (alpha channel supported), TGA, BMP, CEL, GIF, and PCX formats. Hightile uses Ken Silverman's picture library to provide rapid picture file loading.

Hightile textures are defined in the DUKE3D.DEF file. See the DEF-file language reference for information on how to specify Hightile textures.

Limitations to Hightile

ZIP file support

Duke (and Build games in general) can load game resources from a ZIP file.

ZIP files are used in Duke in the same manner as extra GRP files are specified. Use the "/g" command-line switch to specify the ZIP to load. eg. DUKE3D.EXE /gMYFILE.ZIP

Polymost

Polymost is a full 3D implementation of the Build engine renderer, with hardware acceleration capability, and perspective in six degrees of freedom. In Ken's own words (copied from POLYMOST.C in my Build engine source distribution):

"POLYMOST" code written by Ken Silverman
Ken Silverman's official web site: http://www.advsys.net/ken

Motivation:
When 3D Realms released the Duke Nukem 3D source code, I thought somebody would do a OpenGL or
Direct3D port. Well, after a few months passed, I saw no sign of somebody working on a true
hardware-accelerated port of Build, just people saying it wasn't possible. Eventually, I realized
the only way this was going to happen was for me to do it myself. First, I needed to port Build to
Windows. I could have done it myself, but instead I thought I'd ask my Australian buddy, Jonathon
Fowler, if he would upgrade his Windows port to my favorite compiler (MSVC) - which he did. Once
that was done, I was ready to start the "POLYMOST" project.

About:
This source file is basically a complete rewrite of the entire rendering part of the Build engine.
There are small pieces in ENGINE.C to activate this code, and other minor hacks in other source
files, but most of it is in here. If you're looking for polymost-related code in the other source
files, you should find most of them by searching for either "polymost" or "rendmode". Speaking of
rendmode, there are now 4 rendering modes in Build:

    rendmode 0: The original code I wrote from 1993-1997
    rendmode 1: Solid-color rendering: my debug code before I did texture mapping
    rendmode 2: Software rendering before I started the OpenGL code (Note: this is just a quick
                hack to make testing easier - it's not optimized to my usual standards!)
    rendmode 3: The OpenGL code

The original Build engine did hidden surface removal by using a vertical span buffer on the tops
and bottoms of walls. This worked nice back in the day, but it it's not suitable for a polygon
engine. So I decided to write a brand new hidden surface removal algorithm - using the same idea
as the original Build - but one that worked with vectors instead of already rasterized data.
	

Polymost is the default renderer choice for any video mode with a colour depth greater than 256 colours.

NOTE: If your computer does not have an OpenGL graphics card, Polymost in OpenGL mode will most likely use the default Windows OpenGL rasterising facility which does all rendering in software. This may be extremely slow. If your Windows installation doesn't have any form of OpenGL rendering ability, Polymost will probably crash.

NOTE 2: OpenGL Polymost has been tested on an nVidia Riva TNT 16MB, an nVidia GeForce2 GTS 32MB, an nVidia GeForce4 Ti4600 128MB, an nVidia GeForce 6800GT 256MB, an ATi Radeon Mobility 9000 64MB, and a 3D-Labs Oxygen GVX420 128MB (minor texturing issues).

Console Commands

This is a list of console commands and variables and their purpose:

changelevel <episode> <level>
Warps to a new level.
dumpbuildinfo
Displays the compilation information for the game when it was built.
echo <text...>
Displays to the console what is passed as parameters to the command.
fileinfo <filename>
Displays some information about a given file, eg. size, CRC-32 checksum.
glinfo
Displays some information about the OpenGL driver.
glredbluemode <0 or 1>
Enables or disables the red-blue stereovision mode in OpenGL. This mode is experimental at this time. We know the flicker is nasty and the menu background will mix into the screen. To avoid the menu bug, run the game in fullscreen mode and type "glredbluemode 1" AFTER beginning the game. Sorry, there is no way to change parallax or separation. Do not contact us about bugs with this mode... if you do, we'll think twice about documenting hidden features in future releases. :P
gltextureanisotropy <level>
Sets the OpenGL anisotropic filtering level.
gltexturemode <mode-number>
Sets the OpenGL texturing mode. Valid values are:
0GL_NEAREST (looks rather like the original software renderer)
1GL_LINEAR
2GL_NEAREST_MIPMAP_NEAREST
3GL_LINEAR_MIPMAP_NEAREST (bilinear)
4GL_NEAREST_MIPMAP_LINEAR
5GL_LINEAR_MIPMAP_LINEAR (trilinear)
glusetexcompr <0 or 1>
Enables or disables the use of OpenGL texture compression for hightile textures. You need to use 'restartvid' to apply any changes to this value.
god
Enables God mode.
help <name>
Displays a help message for a particular console variable or command.
listsymbols
Displays the names of all commands and variables available in the console.
map <mapname>
Loads a user map.
noclip
Disables player collisions with world objects.
novoxmips <0 or 1>
Disables or enables the use of voxel mipmaps to improve voxel visual quality.
osdrows <num>
Sets the number of visible lines of the console when it is open.
quit
Exits the game.
restartvid
Resets the video system, reinitialising the video mode.
screencaptureformat <0 or 1>
0 = Targa, 1 = PCX
setrendermode <mode>
Sets the current Polymost render mode.
setstatusbarscale <percent>
Sets the size of the status bar as a percentage of its original full-width size. Minimum size is 10%, maximum 100%.
showcoords <0 or 1>
Same as typing "DNCOORDS" cheat.
showfps <0 or 1>
Shows/hides the framerate counter. Same as typing "DNRATE" cheat.
spawn <tile-number or name> [pal] [cstat] [angle] [x y z]
Places a sprite of the given tile number or name at the current position, or if given, the "x y z" location. A name is a label defined in the CON code. The sprite may be spawned with a specific palette, cstat value, and angle if those parameters are given.
usegoodalpha <0 or 1>
If 1, a lower alpha cutoff value is used when rendering textures with transparency, which gives better looking transparent textures at the expense of some sprites behind the transparent item potentially being invisible in certain circumstances. 0 is a more compatible value (and is the default) for this option but slight visual degradation will result.
usehightile <0 or 1>
Disables or enables the use of Hightile textures in GL Polymost mode if any are defined.
usemodels <0 or 1>
Disables or enables the use of 3D models in GL Polymost mode if any are defined.
usevoxels <0 or 1>
Disables or enables the use of voxels in the classic renderer if any are defined.
vidmode [xres yres] [bpp]
Changes the current video mode. You may pass either a new resolution (eg 640 480), a new colour depth (eg 32), or both a resolution and colour depth (eg 640 480 32).
bpp <colourdepth>
Sets the display colour depth. Does not apply it immediately though. You need to use 'restartvid' after setting this if you want to apply the change.
Happy Duke'ing!
Jonathon Fowler (jf@jonof.id.au)