
@@@@@@
@@@@@@
@@@@@@  Special note for this version (1.0.X) only: do not expect to
@@@@@@  be able play empire.  The souce code is currently inconsistent!
@@@@@@
@@@@@@  Only some of the commands are functional.  If you wish to 
@@@@@@  help get things working, pick something that is broken and 
@@@@@@  contact the person who is supposed to be fixing it to make
@@@@@@  sure you don't duplicate effort.  (you can find who is supposed
@@@@@@	to be fixing something by looking in the file "who" and "CHANGES")
@@@@@@
@@@@@@
----------------------
This is a extremely stripped version of Empire 1.0.  It is not possible to play
a game with this version yet.  The transaction manager works, as do the world
creation routines and a few commands.  Updates don't work yet.

To make empire do the following:

cd h; edit misc.h for world size and gamesdef.h for game directory

cd ../empmain
make ../client/version.o
make ../empvers.o
make

cd ../tm
make

cd ../UTIL
make

run 'file' to create world
run 'land' to create map
run 'ore' to distribute sector resources
run 'randpop' to randomly distribute sectors and goods

cd ../tm
run 'tm_server &'

cd ../empmain
run 'emp1' to talk to the server


You've got a working tm, so get hacking.  No more excuses.
---------------------------------------------------------------
If this game wipes your disk, don't blame us.  There may be bugs
in the game, and you use it at your own risk.  It is supplied "as-is"
with no express or implied warranty.

This game has been decompiled from the Feb 1985 PSL empire distribution
by a number of different people.  (PSL stands for Peter S. Langston,
psl@bellcore.com) Any such decompilations are marked with a comment
"from PSL Empire, 1985".  If the file has been changed to a large
degree, there is sometimes an addendum as to who changed it.  If the
file did not come from decompiled PSL code, then it will not have PSL's
name on it.

Some source code was obtained from the 1985 distribution of the game;
such things are some PSL's library calls, and empglb.c.  Many of the
INFO files are still mostly PSL-written -- how many hackers like
to document??

I'm not sure exactly what to call this game; it still retains its
empire "flavor", so I guess it is still Empire.  However, it is not
clear that PSL would agree to many of the changes we've made.
He has not authorized any release of this game, nor has he had
any hand in its development.

Credit is due the following people for their efforts in producing
this version (in chronological order)

	Keith Muller (muller@sdcc7.ucsd.edu)
		came up with the speed hacks of the
		"sector map" and in-memory "nation" file,
		and many other useful ideas.
	Dave Pare (mr-frog@amos.ling.ucsd.edu)
		decompiled 50% of the code, wrote many
		new commands, implemented the update server, 
		and the AF_INET front end/client.
	Jim Reuter (reuter@decwrl.dec.com)
		decompiled the other 50% of the code.
	James Anderson (jwa@k.cs.cmu.edu)
		wrote the world generator.
	Dave Muir Sharnoff (muir@postgres.berkeley.edu)
		fixed hordes of bugs, made it portable,
		documented commands, and generally beta-tested
		the code.

Many thanks are due also to Nick Lai and Chris Guthrie for ideas
and debugging assistance.  Lastly, we mustn't forget to thank the
UCSD and UCB empire crew for their help in discovering (and then
using!) all of the bugs they found.

If you have any bug fixes, or ideas, or suggestions, send
them all to muir@postgres.  He's the one with the most recent
copy.

Dave Pare
Thu Oct  1 13:30:07 PDT 1987

------------------------------------------------------------------

Continued Credits....

	Everyone listed at the top of CHANGES...  (many, many people)

	and...
	    Peter Vukovich (peterv@laila.sun.com)
	    Jeff Anton (anton@postgres.berkeley.edu)
	    Kurt Pires (kjpires@ic.berkeley.edu)

Making and installing empire. 

BASIC CONCEPTS

	This version of empire runs on the server/client model.  In
	other words, there is a central process that does all the work
	and client processes (possibly on other machines) that make
	requests to the server.

	If you do not know how to program in C, you cannot run a game
	of empire.  STOP.

	Time required: empire takes about one hour a day to run and about
	two hours a day to play.  It also takes somewhere between 
	five hours and five months.

	Empire will only run on BSD 4.2 and 4.3 UNIX.  If you want to run
	it on your system V box, you must first upgrade to a real 
	operating system.

WHAT TALKS TO WHAT.

	game player
	  ^  ^	^
	  |  |	|
	  |  |	v
	  |  |	client/ve
	  |  |	^
	  |  |	|
	  |  v	v
	  |  local disk files
	  |    ^   |
	  |    | command output
	  |    |   |
	  |    |   | command scripts
	  |    |   |
	  | commands and command output
	  |    |   |
	  v    |   v
	client/empire
	  ^	v
	  |	|
	  |	| process ID codes via datagram packets
	  |	|
	  |	v
	  |	empserver/killd ***
	  |	^	v
	  |	|	|
	  | text commands and replys with status codes via internet socket
	  |	|	|
	  |\	| pid/code data via pipe. server kills killd when data is ready
	  | \	|	|
	  |  v	|	|
	  |  empserver/empserver
	  |   |		|
	  |   |		/
	  |   | country # via command line args (empserver forks off emp1)
	  |   |	    /	
	  |   |	   / signals are sent when user hits ^C
	  v   v	  v	
	  empmain/emp1
	  ^	    ^ 
	  |	    |
	  | flock(), read(), write()
	  |	    |
	  |	    | nation structure updates and news items
	  |	    | via unix domain socket
	  |	    v
	  |  tm/tm_server
	  |     |
	  |     |  update
	  |	|    |  
	  |	|    | read(), write(), flock()
	  |	|    |  
	   \	| read(), write, flock()
	    \   |    |
	     v	v    v	
	    EMP/DATA/*

    player:		That's you.
    client/empire:	The program that the players run.
    client/ve:		A visual display aid for viewing your country
    empserver/killd:	On machines where out-of-band data doesn't
	work, killd is an alternate way to get ^C's to work.  If you
	are running on a machine where oob data  works, like a 4.3 VAX, 
	then don't compile in the killd (set KILLSERVER = nothing in
	the root Makefile).
    empserver/empserver: The program that checks your password and
	keeps track of who is using what country.
    empmain/emp1:	The computer end of what the player interacts with.
	All the commands are implemented here.  
    tm/tm_server:	This program maintains a cache of the nation
	data structures.  It also caches the 
    update:		The program that "updates" the world periodically

    ***: killd is probably not going to be used much longer... It is not 
	needed now that -DOLDSOCKETS exists


WHAT TO DO TO BUILD EMPIRE:

	Edit Makefile
		most of the other makefiles are modified by Makefile
		automagicly.
	Edit gamesdef.h 
		directories must agree with main Makefile.
	Edit empmain/empglb.c
	Edit client/globals.c, change EMPIREHOST to be the name of your server.
	make everything
	make newworld
		read UTIL/README if you want to do it by hand
	make start

	Don't bug me, or anyone else about your problems until you have
	    spent at least 40 hours working on empire.

WHAT THE DIRECTORIES ARE

	empmain
		The source to emp1 lives here.  A lot of the code is used
		by the tm_server also.
	empmain/gen
		general use subroutines
	empmain/SUBS
		Source to low-level subroutines of emp1.
	empmain/COMS
		Source to commands.
	tm
		Source to the transaction manager.
	empserver
		Source to the login server and kill daemon.
	lib
		Source for a couple of PSL supplied library routines.
	client
		Source for the client program.
	UTIL
		Source for a bunch of database manipulation programs.
	BIN
		Executables of database manipulation programs.
	EMP
		killd and emp1 executables and various log files live here.
	EMP/BIN
		empserver and tm_server executables live here.
	EMP/INFO.nr
		nroff'ed info pages.
	INFO
		Source to empire info pages.
	INFO/Docs
		Some more empire documentation... 
	client/ve
		Source to the ve (visual empire) playing aid
	client/tools/
		a collection of empire playing tools written by players.
		some are very useful.
	UTIL/skill
		Source of the super kill/ super nice program
	UTIL/scripts
		contains misc junk that various people have found useful
	UTIL/vfix
		source for a much better way to hack on the world data.
		If you are curious how to use it, read main.c and menu.c

BACKUPS

	Many, many, games have been ruined because something happened that
	messed up the database.  In one game that I was in, all of the 
	sea sectors turned into land!   When I run a game, I back the data
	up each night and I keep four or more nights of old data around.

CHANGES
	
	if you modify/fix something, please send it to me immediately.  

DISTRIBUTION

	The current distribution point is ftp@ucbvax:pub/empire 
	Updates are in the form of self-applying patches called
	shupars.  The shupars are also sent to a mailing list;
	send mail to ucsd-empire-patches-request@postgres.berkeley.edu 
	to get on the list.  Make sure that you tell me what the 
	message size limit is for mailing things to you!  If you 
	don't tell me, I will assume that it is 64K and you will 
	get a lot of little messages where you might have gotten away
	with one big one.

COORDINATION

	I am trying to keep this version of empire from suffering from
	version fork()s.   To facilitate this, I've set up a mailing
	list of those who are hacking on the game.  Eventually this
	might be moved elsewhere, but for the time being, you can get on
	this list by mailing to ucsd-empire-request@postgres.berkeley.edu.  
	If you change files other than gamesdef.h, empmain/empglb.c or
	client/globals.c and your changes are for the better then I 
	probably want to hear about them.

MACHINE SPECIFIC NOTES

	DO NOT RUN EMPIRE VIA NFS.  VERY VERY BAD.  In fact, avoid NFS
	entirely if possilbe.

	On the HP Bobcat (HP9000/300) running BSD4.3+NFS, empire should
	run unchanged.

	On Vaxen running Berkely UNIX, empire should run unchanged.  (though
	I'm not sure anyone has tried empire on a VAX lately so let
	me know if it still works...)

	Empire runs on the Encore Multimax 320 (4.2 UMAX) unchanged.

	On Sequents, getopt(3) is in /usr/lib/libseq.a rather than /lib/libc.a
	and you must do something to compensate.  Only one thing in UTIL
	uses getopt(3).

	Empire is rumored to run on Elexi hardware.

	Empire runs under SunOS 3.x unchanged, but there seem to be some
	problems gettting it to run under SunOS 4.0.X.

	On the HP Precision Architecture, aka Spectrum, aka HP9000/800,
	running HP-UX version 2.1, empire should *NOT* work with just a bit 
	of work...  add "-Dindex=strchr -Drindex=strrchr" to GLOBALCFLAGS
	If you have problems, talk to Tor Lillqvist 
	(tml%hemuli.uucp@santra.hut.fi).    **update** Jeff Okamoto 
	(okamoto%hpccc@hplabs.hp.com) has empire running on HP-UX.

	Gregory Paris (gmp@rayssd.ray.com) has empire up on a Pyramid. 
	He isn't quite done with the port.  To get empire to run on a
	pyramid, you will need assemble and link in lib/pyramid.c -- a
	pyramid version of alloca().

	Carl Hommel (carlton@apollo.COM) has empire running on Apollo's
	SR10.2 (bsd env).  There is a compiler bug (fixed with the
	next version) that prevents the first fields of the castr 
	structure from compiling.  The patch is to evaluate the 
	expressions by hand!
		the code:
			struct  castr   ca[]    = {
			    NSC_CHAR | NSC_OFF | OS(sct_min),"minerals",
		the error message:
			(1<<18) | (2<<16) | ((long) (&((struct sctstr *) 0) 
				-> sct_min)),"minerals",
			Line 279 of "empglb.c": [Error #096]  Constant 
				value "1" cannot be evaluated at compile time.


	Note: my development system is currently a Sequent Symmetry running
	DYNIX 3.0.12+NFS so that is what I support (kinda).

CHANGING CONSTANTS

	Don't be surprised if changing a constant causes thing to break.
	World sizes of 64x64, 128x128 and 256x256 are supposed to work.
	Up to 256 countries are supposed to work, but 32 countries is safest.

BUGS

	In TODO and INFO/bugs a lot of problems with the game are
	mentioned.  In general, fix the ones in TODO and take the
	ones in INFO/bugs with a grain of salt.  INFO/bugs was 
	compiled (for the most part) by Tom Tedrick (playtester
	galore) and he doesn't always know what has been fixed. 
	Please send me bug fixes.

Sat May  6 19:29:34 PDT 1989
