README revision 1.1
11.1SmrgWhat *is* hunt?
21.1Smrg
31.1Smrg	Hunt is a multi-player search-and-destroy game that takes place
41.1Smrg	in a maze.  The game may either be slow and strategic or fast
51.1Smrg	and tactical, depending on how familiar the players are with the
61.1Smrg	keyboard commands.
71.1Smrg
81.1SmrgDistribution Policy:
91.1Smrg
101.1Smrg	Hunt is part of the user-contributed software distributed by
111.1Smrg	Berkeley in 4BSD.  The sources are copyrighted by the authors
121.1Smrg	and the University of California.  You may redistribute freely
131.1Smrg	as long as the copyright notices are retained.
141.1Smrg
151.1SmrgWords of Warning:
161.1Smrg
171.1Smrg	hunt uses the socket mechanism of 4BSD Unix, so if you are on
181.1Smrg		System V (my sympathies), you're on your own.
191.1Smrg	If your machine does not permit non-setuid-root processes to
201.1Smrg		broadcast UDP packets, then hunt uses a *very* inefficient
211.1Smrg		method for locating the hunt server: it sends a packet
221.1Smrg		to every host on your network.  If your machine falls
231.1Smrg		into this category, we strongly recommend that you use
241.1Smrg		either standalone or inetd mode *and* start hunt by
251.1Smrg		specifying the hunt server host.
261.1Smrg	hunt can be configured to use Unix-domain sockets, but that
271.1Smrg		code has not been tested in recent memory.  Also, since
281.1Smrg		4.2BSD Unix-domain sockets are buggy, running hunt on
291.1Smrg		4.2BSD with Unix-domain sockets will probably crash
301.1Smrg		your system.  If you want to experiment, feel free to
311.1Smrg		do so.  However, don't say I didn't warn you :-).
321.1Smrg	hunt uses a fair amount of CPU time, both in user time (for
331.1Smrg		computing interactions) and system time (for processing
341.1Smrg		terminal interrupts).  We found that a VAX 750 can
351.1Smrg		support about three users before the system is
361.1Smrg		noticeably impacted.  The number goes up to about 8 or
371.1Smrg		10 for a VAX 8650.  On a network of Sun 3/50's with the
381.1Smrg		server running on a 3/280, things work much more
391.1Smrg		smoothly as the computing load is distributed across
401.1Smrg		many machines.
411.1Smrg	hunt may be dangerous to your health.  "Arthritic pain" and
421.1Smrg		"lack of circulation" in fingers have been reported by
431.1Smrg		hunt abusers.  Hunt may also be addictive, and the
441.1Smrg		withdrawal symptoms are not pretty :-)
451.1Smrg
461.1SmrgInstallation:
471.1Smrg
481.1Smrg	1. Edit file "Makefile" and make sure the options selected are
491.1Smrg		reasonable.  There are four "make" variables that you
501.1Smrg		should check: GAME_PARAM, SYSCFLAGS, SYSLDFLAGS, and DEFS.
511.1Smrg		GAME_PARAM controls what features of the game will be
521.1Smrg		compiled in (e.g. reflecting walls).  The optional features
531.1Smrg		are listed in comments above where GAME_PARAM is defined.
541.1Smrg		If you want to try them, just add the ones you want to the 
551.1Smrg		GAME_PARAM definition.
561.1Smrg
571.1Smrg		DEFS is where most system configuration is described.
581.1Smrg		If your system is 4.3BSD, Sun, Ultrix, Convex, HPUX
591.1Smrg		v6.0.1, or SGI, you're in luck.  We provide the
601.1Smrg		appropriate definitions for these systems and you just
611.1Smrg		need to select one of them (e.g. if you have an Ultrix
621.1Smrg		system, just change the line
631.1Smrg			DEFS=	$(GAME_PARAM) $(DEFS_43)
641.1Smrg		to
651.1Smrg			DEFS=	$(GAME_PARAM) $(DEFS_ULTRIX)
661.1Smrg		).  If your system is *not* listed above, then you may
671.1Smrg		need to do some experiments.  All of the options are
681.1Smrg		documented in the Makefile, be brave.
691.1Smrg
701.1Smrg		SYSCFLAGS and SYSLDFLAGS are used for "unusual" systems
711.1Smrg		and you probably won't need to deal with it.  An
721.1Smrg		example of an unusual system is the Silicon Graphics
731.1Smrg		IRIS, which keeps the network socket code in a BSD
741.1Smrg		emulation library that is in -lbsd.  Edit these only if
751.1Smrg		you *know* your system is "different."
761.1Smrg
771.1Smrg	2. Edit file "Makefile" and look at the "install:" target.  By
781.1Smrg		default, files are installed in /usr/games,
791.1Smrg		/usr/games/lib, and /usr/man/man6, which are "standard"
801.1Smrg		locations for games.  If your system has a local games
811.1Smrg		directory, you'll need to change these.
821.1Smrg	3. Edit file "pathname.c" and make sure the file names and port
831.1Smrg		numbers are reasonable.  You can ignore the first set
841.1Smrg		of variables as they are used only for debugging
851.1Smrg		purposes.  The second set is used in the installed
861.1Smrg		version of hunt.  The important variables are "Driver"
871.1Smrg		(where the server is kept), "Test_port" (the Internet
881.1Smrg		UDP port number that new players should use to contact
891.1Smrg		the server), and "Stat_file" (where scoring statistics
901.1Smrg		and body counts are written).  The only tricky variable
911.1Smrg		here is "Test_port".  The default value is chosen so
921.1Smrg		that it is unlikely to conflict with other service port
931.1Smrg		numbers, but you can change it if you want to.
941.1Smrg	4. Type "make install", which will compile and install the
951.1Smrg		programs and manual pages.  Now you're almost ready to
961.1Smrg		go (see next section).  There may be some warnings during
971.1Smrg		compilation.  Ignore them.
981.1Smrg
991.1SmrgSetting up the network:
1001.1Smrg
1011.1Smrg	Hunt may be set up in one of three modes: standalone, inetd, or
1021.1Smrg	nothing.  In "standalone" mode, there is always a hunt server
1031.1Smrg	running on a server machine.  All players who enter the game
1041.1Smrg	will be talking to this server.  This is the mode we use at
1051.1Smrg	UCSF.  The cost is one entry in the process table on the server
1061.1Smrg	machine.  In "inetd" mode, the server is started via inetd.
1071.1Smrg	Again, only one machine should be set up to answer game
1081.1Smrg	requests.  The cost is having to edit a few system files.  In
1091.1Smrg	"nothing" mode, no server is running when there is no one
1101.1Smrg	playing.  The first person to enter hunt will automatically
1111.1Smrg	start up a server on his machine.  This, of course, gives him
1121.1Smrg	an unfair advantage.  Also, there may be race conditions such
1131.1Smrg	that players end up in different games.  The choice of which
1141.1Smrg	mode to use depends on site configuration and politics.  We
1151.1Smrg	recommend using "standalone" mode because it is simple to set
1161.1Smrg	up and starts up rapidly.
1171.1Smrg
1181.1Smrg	-----
1191.1Smrg
1201.1Smrg	FOR STANDALONE MODE, put these lines in /etc/rc.local on the
1211.1Smrg	server machine.  THERE SHOULD ONLY BE ONE SERVER MACHINE!
1221.1Smrg
1231.1Smrg	# start up the hunt daemon if present
1241.1Smrg	if [ -f /usr/games/lib/huntd ]; then
1251.1Smrg		/usr/games/lib/huntd -s & (echo -n ' huntd')	>/dev/console
1261.1Smrg	fi
1271.1Smrg
1281.1Smrg	Also, you should start one up (on the off chance that you will
1291.1Smrg	want to test this mess :-) by typing "/usr/games/lib/hunt -s".
1301.1Smrg
1311.1Smrg	-----
1321.1Smrg
1331.1Smrg	FOR INETD MODE, then things get more complicated.  You need to
1341.1Smrg	edit both /etc/services and /etc/inetd.conf.  In /etc/services,
1351.1Smrg	add the line
1361.1Smrg
1371.1Smrg	hunt		26740/udp
1381.1Smrg
1391.1Smrg	26740 corresponds to the default "Test_port".  If you changed
1401.1Smrg	that variable, then you should put whatever value you used here
1411.1Smrg	as well.  In /etc/inetd.conf, add the line
1421.1Smrg
1431.1Smrg	hunt	dgram	udp	wait	nobody	/usr/games/lib/huntd	huntd
1441.1Smrg
1451.1Smrg	This works for 4.3BSD.  I don't remember the configuration file
1461.1Smrg	format for 4.2BSD inetd.
1471.1Smrg
1481.1Smrg	See the huntd.6 manual page for more details.
1491.1Smrg
1501.1Smrg	-----
1511.1Smrg
1521.1Smrg	FOR NOTHING MODE, do nothing.
1531.1Smrg
1541.1SmrgTesting:
1551.1Smrg	Now you are ready to test the code.  Type "/usr/games/hunt" or
1561.1Smrg	whatever you call the hunt executable.  You should be prompted
1571.1Smrg	for your name and team.  Then you should get the display of a
1581.1Smrg	maze.  At this point, you should read the manual page :-).
1591.1Smrg
1601.1Smrg======
1611.1Smrg
1621.1SmrgHunt is not officially supported by anyone anywhere (that I know of);
1631.1Smrghowever, bug reports will be read and bug fixes/enhancements may be
1641.1Smrgsent out at irregular intervals.  Send no flames, just money.  Happy
1651.1Smrghunting.
1661.1Smrg
1671.1Smrg					Conrad Huang
1681.1Smrg					conrad@cgl.ucsf.edu
1691.1Smrg					Greg Couch
1701.1Smrg					gregc@cgl.ucsf.edu
1711.1Smrg					October 17, 1988
1721.1Smrg
1731.1SmrgP.S.  The authors of the game want to emphasize that this version of hunt
1741.1Smrgwas started over eight years ago, and the programming style exhibited here
1751.1Smrgin no way reflects the current programming practices of the authors.
176