README FILE FOR XTANKBATTLE 15th Dec 1992 MULTI-PLAYER, MULTI WORKSTATION TANK BATTLE GAME. ================================================= WHAT YOU NEED TO HAVE ===================== An X11R3 or greater X server. (It might work on earlier X11 releases, but I havn't tried) A display of at least 1024(W)*800(H) pixels. (1080 pixels wide is better) A three button mouse (It's playable with a two button mouse). A fastish (and unloaded) CPU and reasonable drawing speed. (X terminals may have problems) A fastish network. Nothing better to do. Software that supports the following system/library calls and UDP sockets. Socket/network related socket(), bind(), connect() ,gethostbyname() ,htonl() ,ntohl() Timing related gettimeofday(), setitimer() General gethostname(), getpwuid() Machines with non 32-bit int's could be a problem (Sorry). Two or more players. (The more the better). The program works on mono, greyscale and colour displays, and looks exactly the same on each (I havn't got a colour node :-( ). COMPILATION OPTIONS =================== If you have more than 10 people wanting to play, try increasing the value if MAXUSERS in "defs.h" up to a maximum of 24. This should work, but is untested. COMPILING ========= You may need to edit the Makefile to point to where your X11 include files and X11 librarys live. Type make This should create three programs, xtb, xtbd and rtb. STARTING THE GAME ================= Pick a node (can be any machine with or without X) and run the server (xtbd). hostname% xtbd For each player at a workstation run the client (xtb). workstation% xtb -h hostname (ignore messages about datagrams and fielddata) (It seems that on HP-UX if you want to refer to your own host, you must use the hostname 'localhost') RUNNING TWO (OR MORE) PLAYERS ON THE SAME NODE ============================================== For second and further players *on the same workstation*, should pick different port numbers to the default (and each other). eg the second player might type workstation% xtb -h hostname -i 1624 To run two or more servers on the same node, use a different port number to the default. eg. hostname% xtbd -p 1627 to contact this server the player would need to type workstation% xtb -h hostname -o 1627 ROBOT TANKS =========== If you are short of people or want to practice, the program rtb adds robot tanks. To create 4 robot tanks type robothost% rtb -h hostname -n4 Robots re-start when killed after a 5 second delay. The -i and -o flags for xtb that change the port numbers used are also valid for rtb. For 'n' robots 'n' port numbers are used. Note: Robot tanks can use a lot more network bandwidth than human players. SHELL VARIABLES =============== The shell variables are overridden by the command line options. XTB_SERVER The hostname of the server to contact by default. XTB_INPORT The input (client) port number to use. XTB_OUTPORT The output (server) port number to use. KNOWN TO WORK ============= Known to work as a server Sun 4, DecStation 3100, Microvax 2, Sun 3, HP 9000s827 Known to work as a client (display) Sun 4, DecStation 3100, HP9000s710 (With X dev. kit) Works as a client with only a small number of players Sun 3 OPTIONS ======= The -w flag turns on warping of the mouse cursor on scrolling. The default is for the mouse cursor not to be moved when the screen is scrolled (ie. the square under the cursor remains the same.) (Use what you find intuitive) For xtb the -p and -b flags change the method used to draw tanks. -p uses polygons (as per previous versions) -b (default) uses bitmaps (pixmaps), this takes much more X server memory, but seems faster on most machines. PLAYING ======= The display has several areas, the main battlefield, (you appear as a solid black tank, all others display their id) the radar, a damage display, a message window, a quit button and a list of players and their id's. The controls are simple. Left button -> Fire (in the direction the tank is facing) Middle button -> Reverse Right button -> Forward If you only have a two button mouse, you can use the keyboard to reverse the tank motion, any key press causes the motion to be reversed, any key release returns to normal. If you have auto-repeat on your keyboard (most do), use a key that does not auto repeat (ie. shift,control etc) This will not work for a window manager that does not implement the input (push-focus) window manager hint. The tank will rotate towards the mouse cursor when the cursor is in the main field. The solid black squares are obstacles, and cannot be moved through or fired through. The hatched areas are rough ground, you can only move at half speed across these. The shells have a range of about four squares, you cannot fire again for 2.5 sec after firing. Explosions do damage according to the (inverse square of the) distance from the explosion. Two direct hits is sufficient for a kill, near misses cause smaller amounts of damage. Killing another player clears your own damage (to encourage friendly play!). Quitting should be done using the quit button (NOT the window manager frame) It is possible to shoot through the diagonal of two blocks. NOTES ===== This was only my third ever X11 program, initially written only with the on-line manuals for reference. If I were to re-write it, I'd probably do it differently. One of the design specifications was that the program should be easy to install, configure and run, so it does not use any files (other than the executables) or require require root permissions to install/run. The program is entirely mouse controlled (unless you only have a two button mouse) The program comes with no warranty. I would like the conditions that apply to GNU software to apply to this software. Bugs fixed in version 8 ======================= Now works on hosts with hostnames of up to 63 chars. xtbd now works on HP-UX, (used to fail with 'Alarm clock') You are now notified immediatly when your damage is zeroed when you kill another player (Fixed by Jonathan Bayer (jbayer@ispi.COM)) Now works properly on NCD X terminuals (Fixed by Martin Boyer (mboyer@ireq-robot.hydro.qc.ca)) There is a work around (in this REAME file) for the problem with using your own host for xtb and xtbd on HP-UX. I have now changed the README file to make it more obvious when you need to specify port numbers to xtb/rtb/xtbd. (ie. you shouldn't need to in most cases) Note that version 7 programs won't work with version 8 programs. If you mail me about problems/bug-reports/suggestions for improvement, please say what type of machine you are using, which revision of the operating system, and what verson of X-windows you are using. Good Luck! Bernard Hatt bmh@terminus.ericsson.se Camtec Electronics (Ericsson), Leicester, England, LE1 4SA.