NETKEEN

A multiplayer reverse/hack of Commander Keen : Galaxy

Current version: 2011-02-18

About:

NetKeen was originally an attempt to reverse engineer the Commander Keen Galaxy smooth scrolling engine, using the source code from the Wolf 3D "Id engine" and the keen 4 disassembly by Andy Durdin.  It grew into a actual multiplayer arena deathmatch-style game after the addition of the DoomNet IPX driver.
NetKeen runs in DOS in mode 0Dh EGA 16 colour graphics and 386 instructions in 16-bit real mode.  The smooth scrolling engine, game physics, and keen behaviours are near 100% accurate.  Using the DosBox IPX network emulation, multiplayer games (up to four players) can be played via LAN or over the internet.  Games are quite playable if the sum of the ping from DosBox IPX client A to the DosBox IPX server, and from client B to the DosBox server is under 200 ms.
The source code is included.  It will compile using Borland C++ version 5.0.x (the last one that supports DOS real mode programs), and perhaps using earlier versions as well.


Running:

NetKeen should be run in DosBox.  You MUST read the DosBox instructions on enabling ipx tunneling. Netkeen could run in 32-bit windows (or even on a DOS machine), but the multiplayer component relies on the DosBox IPX network emulation.

To start a local game, type NetKeen.


Switches:
-nodes <players>:	Starts a net game with 1-4 players.  If you don't use this switch, you will start a local game.
-debug:				Logs some stuff (mostly network related).
-ext <GAMEEXT>:		Use a different game extension for your data files. By default, netkeen uses .ck5.

Example: You want to play a three-player game using the CK4 game data.  You would first connect to the other DosBoxen using "ipxnet ... ", then type "netkeen -nodes 3 -ext ck4" at the prompt.

You will need some sort of IRC/Instant Messaging client to communicate with / ridicule your adversaries.


Menu:

The familiar wristwatch menu lets you choose the game options.

NEW GAME:  Start a new game and set game parameters.  Note that you must set the game options BEFORE starting a new game.

-	LOCAL GAME:  Starts a local game (single player, just for testing the levels)

-	HOST/JOIN NETGAME:  Starts a net game.  The machine that is designated host will send its game options to all of the other machines.

-	GAME OPTIONS:  Lets you choose the game parameters:
	-   TEAM GAME: Yes means a 2-team game
	-	NUMBER OF PLAYERS: From 1 - 4, the number of players that will be spawned
	-	LAG BUFFER: Estimate the ping by typing IPXNET PING at the DOS prompt.  The lag buffer should be this amount (in ms)/28.If you're not sure, just try 6.  If the game is lagging, increase this amount.  If the game isn't lagging, but the character feels unresponsive, lower this amount.
	-	EXTRA OPTIONS:
		-	VICTORY CONDITIONS: select the number of whatevers to win the game
		-	MISC OPTIONS:
			-	Starting Ammo/Bombs:  Munitions you are given upon spawning.
			-	Gem door opening time:  The length of time for which a gem door remains open.	

-	MAP SETUP: Select a map
-	PLAYER SETUP:	Lets you choose your character
	-	Keen:	The protagonist of the series.
	-	Lindsey: Princess of the Shadowlands.
	-	Spot:	Keen's trusty Yorp companion.
	-	Mort:   Keen's arch nemesis!

-	DEMO SETUP:  Record demos.  
		If you select a free demo slot, the next game will be recorded so that you can play it back later.  
		You must delete demos from outside the game.
		Note that demos will only work with the version of netkeen under which they were recorded.

CONFIGURE:

	Configure a subset of the game options as per normal.  Here's a few of them:
		THROW: Throw Boobus Bombs.  Note that holding the movement arrows will modulate throw power and angle.  Useful for attacking enemies hiding in pole shafts or beyond a slope.
		Look Up/Down:  These quickly scroll the screen up and down, and the screen returns to normal upon their release
		Status: Display a quick in-game summary of players' scores.
		Look up/down speed:  Speed at which screen will scroll up/down when player is looking up/ducking.  If you use the quick-scroll buttons, you can set this to zero.  If not, you can set it to a higher value so that you don't get wasted while scanning for an enemy.

Game:

The game is a multiplayer deathmatch, (or more appropriately, stunmatch).  Stunning your opponent will garner you one point.  If you succumb to an auto gun or hit a lethal tile, then you will lose one point.  Your health, score, and ammo are displayed in the scorebox in the top left corner.

Damage rules:
A stunner deals 40 hit points, and a purple gun deals 60.  Deadly tiles stun instantaneously.
You can throw bombs which deal 60.
One jar of vitalin restores 5 hit points, and a keg restores 100 hit points.
On spawn, you are given 3 seconds of invincibility, 100HP and 5 shots.

Items:
Stunners yield 5 shots, and a bomb icon is 3 bombs.  Both respawn every 30 seconds.
Vitalin jars respawn every 60 seconds.
Kegs respawn every 5 minutes.
Treasure items work as usual and respawn every minute.
Gems will open doors, however, the doors will close immediately afterwards, so be quick!  Gems respawn every minute.


Note: Pressing Escape in game permanently removes you and brings you back to the watch.


Issues:
	This is an amateurish hack; there's bound to be some bugs.  Here's some notable ones:

Memory errors:  Playing 4 player games with all 4 characters pushes the memory limits.  If you are bombing back to DOS on memory errors, try playing a smaller map with fewer unique tiles.  Or, only play with three characters.
Flaky/long distance connections:  If you're playing over the internet, a bad connection can hang the game indefinitely.  If this happens, HOLD ESC to go back to the watch and try to reset the game.   (In this situation, the tiles should still animate, albeit very slowly).
DOSBOX:  In dosbox.conf, make sure that ipx=true and machine=svga_s3, and that ems, xms and umb are all TRUE.  You might need to forward your ports.  (Read the dosbox connectivity guide for further details).
Network:  earlier versions were known to pause all traffic on a home network.   I think this was fixed.


Making your own graphics:

In general, follow keen 5 rules.  You can use the hacked version of Andy Durdin's modkeen (modkeenN.exe) that comes with this release to import graphics.  
You can make your own maps using the various keen editing tools out there.  Visit www.keenmodding.org to find out how.
If you want to synchronize an animation across the network (FG tiles only), then tiles in the animation loop cannot share the same properties for all frames (i.e., blocking or miscflags must vary between tiles in the animation loop for at least one of the tiles).
Don't put too many respawning items, player spawn points, sprites, or netsynced animated tiles in your level.  (The game should crash with an error if you do.)
If you make bridges, make sure they are at least 4 or 5 tiles in length.  If they are too short and someone is hanging on the left edge when the bridge is close by another player, then the first player will clip through the top of the bridge to the right if he drops.  If they bridge is < 4 tiles wide, this can be erratic...

Credits:

Ceilick, for making the the additional player sprites and nearly all of the maps, and for his extensive testing.
Andy Durdin, for his work in reverse engineering the source code and making tools to edit pretty much everything in keendom.   Much of his reverse-engineering output was used or adapted to make this game.
The Commander Keen IRC channel, for making maps and testing.
Peter Matjeschk, for reversing a few of the keen behaviours.
The original Id team, for making Keen, Wolf3D, and DOOM, and making the source code for the latter two games freely available.

 -Lemm
