3DUEL_2.EXE:  A 3d Quasi-Newtonian Confrontational Rocket-Ship game for 2 players
      by JJ Robinson II, MKIA Research, (c)1997,98
	http://www.geocities.com/SiliconValley/Way/7155/

(Permission granted for any non-commercial use.  Others contact   mkia1@geocities.com for information.  Do not publish or redistribute the 3Duel_2 simulation in any type of medium without  my credit information in the source files.  If you redistribute the game and/or project files, include this unmodified text file.)

Contents of 3Duel_2_Game.zip (I've kept all of the resources as separate files for easy access by programmers/developers.  All of these (except the *.txt file) need to be in the game's directory for the program to run properly.)

	3Duel_2.txt			This file
	3Duel_2.exe			The game executable
	ship5.x			Host ship model
	ship6.x			Guest ship model
	torp2.x			Torpedo model
	Blast4.bmp			Explosion decal graphic  
	goldwv.bmp			Texture for torpedo
	Ship1.bmp			Texture for host ship
	Ship2.bmp			Texture for guest ship
	icon1.ico			Game icon
	explode.wav			Explosion sound (taken from the sound of a lightning strike-					 with apologies to my acquaintances at JSC)
	thrust1.wav			Main engine sound effect  (from a Saturn V booster)
	thrust2.wav			Thruster sound effect	(also from a Saturn V booster)
	torp.wav			Torpedo running effect	(from a fire truck with a lot of 					 reverb)

Contents of 3Duel_2_Project.zip: (These are the MSVC++ 6.0 project files)

	3Duel_2.dsp			MSVC++ 6 project file
	3Duel_2.dsw			MSVC++ 6 workspace file
	3duel_2.cpp			Source file of main game module
	3duel_dp.cpp		Source file of DPlay network module 
	dialog.cpp			Source file of network connection dialog and callback module
	lobby.cpp			Source file of lobby connection module 
	wave.cpp			Source file of DSound player module
	3Duel_2.rc			MSVC++ 6 resource file
	3duel.h
	3duel_3.h
	3duel_dp.h
	resource.h
	wave.h
As usual, throw DXSDK libraries at it until it works.  Remember to include Winmm.lib, Ddraw.lib, D3drm.lib, Dplayx.lib, and Dsound.lib.

The Game:
Each player has a ship; the host ship is red, the other player's ship is yellow.    The ships move in a quasi-newtonian arena; everything simulates normal physics in a gravity-less environment, except that wall collisions are perfectly elastic, and top speed is limited.  Players control the pitch, yaw, and main thrust of their ships, while firing unguided torpedoes at each other.  The game displays a score for each player, system messages, and a frame-rate statistic (this is a programming development demo, after all).  Collision with the walls of the imaginary cube cause both ships and torpedoes to bounce off.  Collision with a torpedo (including your own) or the other ship destroys the players ship and cause it to be reset to the start position.  

How to play:
Ships are controlled from the keyboard:

	ESC		=	Quit the game
	Keypad 2,8	= 	Pitch up, down
	Keypad 4,6	= 	Yaw left, right
	Keypad 5	=	Main engine thrust
	Keypad 0	=	Fire torpedo
	Space bar	= 	Cancel all rotational velocities of the ship ("panic" button)

The Program:
This is a pretty old demonstration program that I wrote to learn how to use DirectX ((c)Microsoft) facilities in a real, if somewhat simplistic, 3D game.  It was crafted (hacked?) out of my original 3DUEL one-player demonstration, with a network layer built on top of the MS "DPChat" sample.  It is written in C (much like the MS Samples), using C++ features and syntax where convenient.  It was originally written with Borland C/C++ 5.01, but has been rewritten to accommodate MS Visual C/C++ 6.0.  As of initial release, all of the graphic and network interfaces have been updated to DX 6.0, which is required to make it work (isn't backward compatibility a wonderful idea?)  It demonstrates:

-Use of MS DirectX D3D Retained-Mode, DirectPlay, and DirectSound in a two-player game   environment.
-Simulation of real physical properties with the D3D vector math functions (as in 3Duel).  
-Ballistic, predictor-corrector, or "dead-reckoning" synchronization in a distributed  computing system.  In other words, each computer manages it's own game functions and  display.  It "predicts" the position and orientation of the other player's "ship", based   on its last known position, velocity, and rotational velocity (ballistics).  It   periodically recieves an information packet from the other computer which tells what that   ship was actually "doing" when the packet was sent.  The position, etc. of the remote   ship is then "corrected" with the packet information.  This system is used to synchronize   both the ships and their torpedoes.
-Frame-rate synchronization.   The frame rates of CPU's running at different speeds are  adjusted by a correction factor derived from the Multimedia Timer (TimeGetTime()).  The  correction is transmitted with each game information packet.  
-Bounding sphere collision detection.  This is very simplistic, but the effect seems   visually adequate for a torpedo-shooting game with fairly symmetrical objects.
-Sound effect generation and control.  Sound effects which are needed without delay  (engine, thruster, and torpedo) are left on constantly at zero volume until needed.   Other sounds (explosion) are started as required.  
-Confrontational fire control and explosion effects.

I've included new ships with this game, modeled in Hash Animation Master 6.1h, and exported as *.dxf's.  They need some more work, but they look better than the old "chess-piece" from the original demo.

To do list :
12-7-98 (Initial Release):
 -Test lobby and serial play (If it doesn't work, maybe I'll release a patch, just like 	the big game companies!) 
 -Make winning player's machine responsible to determine kills.  Kill scoring is currently 	"democratic", and scores sometimes don't agree.
 -Improve viewing of system messages
 -Implement chat function (especially needed to facilitate internet play)

If you have have comments or constructive suggestions, or if you come up with an interesting modification or feature for the game (your rights will be limited to credits if I post it), please contact me at mkia1@geocities.com.   