


		Export Empire
		------ ------

To install Empire on your system you need a few source modules, some object
modules, a big pile of info topics, two archive files, a makefile, and
a little editing...

Figure out where you'd like the Empire subtree on your system.  The whole
thing looks like the diagram below although only INFO and UTIL need be
created by you.

	 starting somewhere in your system
		       \
		        \
		       "EMP"
	      (sources, object modules, etc, etc)
	     /           /          \            \
	    /           /            \            \
	 "BIN"        "INFO"        "UTIL"      "DATA"
(most executables)  (info topics)  (misc progs)  (sectors, ships, etc)
(Makefile creates)  (you create)   (you create)  (Makefile creates)

Procedure for bringing up Empire

0) ../glib.a
	Make sure the routines in ../GLIB work okay on your system and that
	they are compiled and archived into ../glib.a

1) empglb.c
	Various pathnames are needed (e.g. nroff, post/mail prog, etc.) so
check over everything in empglb.c.  Note that if you've set up standard games
directory with EMP below it and the file ../gamesdef.h has the GAMESPATH()
definition set up then EMPPATH() won't need to be redefined.

        If you want to allow people to run subshells under Empire you
should set "shllpath" to be the full path name of the shell, "shllnam" to
be the "name" (zeroth argument) for the shell, and "shllarg1", "shllarg2"
and "shllarg3" to be any necessary arguments, (remember to make unused ones
be "= 0").  I usually make "shllnam" be something like "Empshell" so it
will show up on a "ps" to discourage excessive subshell use.

	If you want to avoid the overhead of running nroff each time someone
runs the "info" command then replace each file in INFO with the output of
nroff (using CRT.MAC and INFO.MAC) run on that file and set "nroffil",
"nnrarg", and "nrarg[]" to be the pathname, number of fixed arguments,
and the fixed arguments (respectively) for the favorite local pager.

	Set the miscellaneous "parametric goodies" in empglb.c.  Some of the
interesting ones are:

privuid:    The uid of the Empire super user.  All the files should be
	owned by this uid.  All the Empire files should be readable-writable
	only by the owner (mode 600).  ONLY the program called "empire"
	should be setuid.
>>>> NOTE: Empire no longer uses group permissions to provide security! <<<<

privname:   The "real world" name of the Empire System Mother; this is
	used in various messages and for complaints, etc.

privlog:    The "log" name of the Empire System Mother; this is used for
	mailing trouble reports, etc.

l_cvt:      Set this to 'l' if "%ld" is the proper way to printf a long int
	as a decimal on your system; set it to '-' if "%D" is preferred.

w_xsize:    The width of the world map; must be a power of two and less
	than or equal to 128.

l2w_xsize:  The base two log of w_xsize.  !DON'T FORGET THIS ONE!

w_ysize:    The height of the world map; must be a power of two and less
	than or equal to 128.

MAXNOC:     The maximum number of countries you're going to allow in the
	game.  Must be less than or equal to the value of MAX_MAXNOC (which
	you can't change), defined in "empdef.h".

m_m_p_d:    The maximum number of minutes per day that any one country may
	be logged in to Empire; (to restrain the compulsives).

sct_maxno   This is the number of sector types currently defined.  If you
	add new sector types be sure you increase this number appropriately.
shp_maxno   This is the number of ship types currently defined.  If you
	add new ship types be sure you increase this number appropriately.

s_p_etu     The number of seconds per Empire time unit.  This number is
	normally 1800, but it can be adjusted.  For example, if set to
	180 most parts of the game will speed up by a factor of ten.
	The extreme is when it is set to a value like 4; then Empire becomes
	"Blitz Empire" in which everything moves, grows, etc.  VERY fast.

    Food related parameters.  The food concept is a recent addition to
    Empire and consequently is not very stable.  It is meant to provide
    an external hardship against which people can band together and work
    cooperatively.  I've included mant food parameters so that people can
    experiment (as I'm doing) to find the most reasonable values.  The
    real trick is to establish a balance between surfeit and famine that
    requires some cooperation of countries even if only through loans.
    It appears that the food mechanism puts a strain on the "update-it-
    hen-you-look-at-it" approach that Empire takes.  Unfortunately, I don't
    see any nice alternative yet...

fgrate:     The rate at which food grows.
fcrate:     The rate at which workers can cultivate (gather) food.
eatrate:    The rate at which people eat food.
babyeat:    The amount of food required to feed a baby to adulthood.

ubrate:     The birth rate in urban sectors.
obrate:     The birth rate in other sectors.

bankint:    This is the bank interest rate on gold bars.  Each bar generates
	this much money per time unit.  In the future I hope to have this
	value fluctuate with the number of bars in existence.

enli_max    The maximum number of people that can be enlisted in each sector
	in ine enlist command.  Normally this is set very large, but some
	people prefer to set it to a value like 25 in order to slow down
	massive enlistments.

enli_rate   The maximum proportion of the civilian population that can be
	enlisted in a single enlist command, ignoring the effect of happiness
	(see next parameter).  This number has always been 0.5, but here's a
	chance to experiment.

enli_hfact  A parameter that controls the relationship between happiness and
	the maximum enlistment rate.  At the time of an enlistment the program
	calculates the maximum percentage of the civilian population that is
	eligible by the following formula.
	enli_rate * (happiness + 1.) / (happiness + enli_hfact + 1.)

enli_btu    The cost in BTUs of enlisting one civilian.

enli_happy  The cost in happiness of enlisting one civilian.

powe_cost   Although it costs nothing to view a copy of the last power report
	that has been compiled; it costs this many BTUs to compile a brand new
	one.

dirch[]     The characters typed at the keyboard to indicate
	stop (or end), up-right, right, down-right, down-left, left, up-left,
	view, and bomb, in that order.

Remember, if you change any of these parameters you should also change the
    corresponding info files...

2) empcom.a & 4.2 BSD users
	If you're running 4.2 BSD then replace "info.o" in empcom.a with
"info4.2.o", i.e. change the name of "info4.2.o" to be "info.o".  "info.o"
expects 16 byte long directory entries while "info4.2.o" uses the routines
"scandir", "opendir", "readdir", "closedir", and "alphasort" (whew!) to do
what a few lines of code in "info.o" do.

3) Makefile or run
	Be sure that your current user id is the one which you intend
to have associated with Empire since owner permissions matter.
>>>>>  NOTE: This used not to be the case.  <<<<<
	If you have "make" then a simple "make all" should do what the rest
of this item describes for the poor suckers that don't have "make".
	If you use the Bourne shell move the file "run.BOURNE" to "run";
otherwise if you have a VAX move the command file called "run.VAX" to "run";
otherwise if you have a pdp11 that has separated I&D space, (11/45, 11/70),
move the command file called "run.SEP" to "run"; otherwise (you have a dinky
pdp11) move the command file called "run.NOSEP" to "run".
	Execute "run" with the full path name of your empire directory as
the first argument, the word "VAX", "SEP" or "NOSEP" as the second argument
and, optionally, "-f" as a third argument, (if you don't have a floating
point unit). "Run" will create the BIN and DATA directories, compile and
link all the pieces of Empire and move them into your BIN directory.
Remember that "run" must be passed the complete path name of the Empire
"home directory" as an argument.
	The main program (called "empire") must be made setuid to the owner
of the data files.  It can be kept in "/usr/bin", "/usr/local/bin", or
wherever seems appropriate so that merely typing "empire" to the shell
executes the system.

4) empcre
	Run "empcre" to create a world.  Optional arguments to "empcre" are:
	    ####        A number with no "-" preceding it is used as the
			random number seed.  The default is the low 16 bits
			of the system time.
	    -s=file     Creates the physical world, (sector file), in the
			named file and doesn't create any of the other files.
	    -trace      Display the sector map as the world is created.
	    -cream      Write over any prior data files.
	    -nNAME      Set the name of the Deity, Country 0 to "NAME",
			("POGO" is the default).
	    -rNAME      Set the name of the representative of Country 0 to
			"NAME", ("peter" is the default).  If you accept the
			default here you should change it once the game is
			up since this is the equivalent of a password to
			Country 0.
	You should be logged in as or su'ed to the Empire uid when you run
this, (i.e. whoever you are now determine who owns the data files).
If you have V7, V3.0 or some other version that uses UMASK, make sure
sysinit() (in glib.a) sets it to 0 before you run this.
	Note that you can start playing god by messing around with the table
and the routine in UTIL/creglb.c to get worlds with different characteristics.

5) empchk
	If you are not going to be playing the game yourself you'll probably
want to use the "-trace" option to "empcre" and maybe even log in and take a
look at the world you've created.  If you "see it is good" fine; if not, go
back and run "empcre" again.  If you ARE going to be playing the game you
should probably ignore the output from "empcre", (not use "-trace"), and run
"empchk" to determine the general qualities of the world you've created.
"Empchk" will tell you the average mineral and gold assays and interpret the
"shape" of the world by giving you two sets of figures describing connectivity
differentiated by whether or not you consider a mountain as a "connection".
If you're not happy with the analysis then go back to step 3.

6) empire
	Log in as the deity country, (e.g. run "empire POGO peter"),
change the representative name for the deity, ("change rep"), and the deity
country name if you wish, ("change country-name").  Use the "add" command
to add countries to the game.



A brief description of the function of each module:


	Source Modules

empglb.c	Global storage and initialization of game parameters.

empmod.c	Command dispatch table and allocation of command routines
		to different modules (only one module used on VAXen).


	Header Module

empdef.h        Global definitions (included for compilation of empglb.c)


	Object Modules

empcre.o        The "Creation" - volcanoes erupt and create land masses
		on the earth.  It rains a lot.  The rains dry leaving oceans
		and rivers.  Tectonic activity pushes up ridges.  Etc.
		The "Deity" (country #0) is set up.  An argument (optional)
		will stir the random number generator in a repeatable
		fashion, otherwise the current time stirs it.

empchk.o        Allows inspection of the results of empcre without disclosing
		the actual shapes of continents -- Useful if country #0 is
		also going to "play" the game.  Empchk reports the number
		and sizes of land masses, the distribution of ore and the
		distribution of gold.  A "land mass" is defined as a group
		of adjacent non-sea (also optionally non-mountain) sectors.

empfix.o        Used by Country 0 to make repairs to files that have
		been scrambled, one way or another.

empire.o        The initial log-on to Empire -- identity check, etc.

empdis.o        The command dispatcher that calls the various command
		routines.

emp[1234567].o  The Empire command routines in several pseudo-overlays for
		machines without virtual storage.

visifix.o	A much fancier version of empfix, written by Nick Lai at
		Berkeley.  See note at the end of this file.


	Archive Modules

empcom.a        The individula command routines.

empsub.a        The subroutines used by various Empire progs.


	Data Files

With the exception of "empup" "empdown" and "emphol" these files are all
created by other programs, (like "empcre").

emphol          A listing of the local holidays in a cron-like format.
		Each line is of the form:
		HOD:DOW:MOY:DOM:YR: EXCUSE
		where
		HOD is the hour of the day, (0:23),
		DOW is the day of the week, (0 = sunday),
		MOY is month, (1:12),
		DOM is day of the month, (1:31), and
		YR is year minus 1900.
		Any missing field is considered a "match",
		e.g. the line ":0:::: it's Sunday" will match every Sunday
		while ":5::13:: because ..." will match any Friday that falls
		on the 13th of the month.
		Each field is either a single number or an inclusive pair
		separated by '-', e.g. ":1-5::::" is "Monday through Friday".
		The following might be reasonable "emphol" entries:
	    :0:::: it's a weekend, you sneak!
	    :6:::: it's a weekend, you sneak!
	    ::1:1:: Happy New Year!
	    ::2:22:84: Happy Birthday, George Washington!
	    ::2:20:84: Happy Birthday, miscellaneous President!
	    ::5:21:84: Today is Victoria Day
	    ::5:28:84: Today is Memorial Day
	    ::7:4:: Happy Fourth!
	    ::9:3:84: Happy Labor Day!
	    ::11:6:84: Go out and vote against Reagan!
	    ::11:22:84: Happy Turkey!
	    ::12:25:: Merry Christmas!
	    9-16:1-5:::: Monday through Friday during "prime" time (9 to 5)

empup           This file contains the log in message which is generated
		with the "turn on" command, (see below).

empdown         This file contains the reason why the game has been taken
		down and is created by the "turn off" command, (see below).

emploan         The records of all outstanding loans.

empnat          The information describing the nations in the Empire game.

empnews         Records of all "newsworthy" acts in the recent past.

emppow          The most recently generated "power report".

empsect         The information describing the geography, land use,
		number of civilians, amount of ore, etc., etc., for
		each sector of the world.

empship         The descriptions of ship types, owners, fleets, etc.

emptel##        All outstanding telegrams for country ##.

emptreat        The records of all treaties.


	Miscellany

Makefile        Data file for "make" to do the functions described under
		"run.*".

run.*           Command files used to do all compiles & links
		One must be chosen and executed with the full path name
                of the Empire "home" directory and either "SEP", "NOSEP", or
                "VAX" as arguments.  There is an optional "-f" argument for
		systems without a floating point unit.

INFO/*          The nroff form of all the info files.  Empire nroffs
		them when the user needs them, using macros defined
		in INFO/INFO.MAC.  Note that INFO.MAC is written for
		phototypesetter Nroff/Troff and may require the strip-
		ping of scale indicators (u, v, etc) from numeric and
		number register values if you have an older Nroff.
		Some sites pre-nroff these files and then set up the
		"nroffil", "nnrarg", and "nrarg[]" globals to be the
		pathname, number of flag arguments, and flag arguments
		(respectively) of the favorite local pager.

READ_ME         If you don't already know what this is...


	The executable modules that are formed are:

empcre          The creation process.  After requesting the name and
		representative to be used for country 0 this program:
		makes volcanos which form the land area, spreads minerals
		and gold ore around, and lets rivers carve their paths
		across the land.

empchk          Gives some vague information about the lay of the land
		to help determine whether a world has sufficient variety
		without giving away the specifics of the map.

empire          The entry into the game.  This should be the only setuid
		program in the bunch.  This program, after checking
		the identity of the player, execls emp1.

emp1,emp2,emp3, The game itself.  These modules execl each other as needed
emp4,emp5,emp6, to carry out the commands given by the player.  The VAX
emp7            implementation only uses emp1, the separate I & D version
		uses emp1, emp2 & emp3, the NOSEP version uses all seven of
		these.

empfix		A general tool for performing surgery on the data files.

visifix		Another tool for performing data file surgery (see description
		at the end of this file).


		ADDENDUM I

Several commands are usable only by countries with nat_stat == STAT_GOD;
for that reason no "info" files are provided for them.  Brief descriptions
for these commands follows:

add [a new country]
	You will be asked for country number, (with a prompt about any
	unused country numbers), country name, representative name, and
	country status.  You'll also be asked if you want to "check", "wipe",
	or "ignore" any pre-existing sectors belonging to the "new" country
	number.  "Check" means print a list of their locations; "wipe" means
	return them to the "native" state; "ignore" means don't bother looking.
	If country status is "new" or "visitor" then all the country variables
	will be initialized, (money, technology level, relations with other
	countries, etc).  If status is anything else no initializations will
	be done, (see "fixup" below).
fixup [nations, sectors, etc]
	This command execs BIN/empfix which allows you to twiddle any
	data regarding countries, sectors, ships, treaties, loans, etc.
	It is very useful whenever some tweaking is necessary either to
	correct (disguise) a bug or carry out the will of "god".
	Fixup first prompts for the kind of data you want to modify, then for
	the specific "record", (e.g. which country, what sector, etc).
	It then shows the current value for each attribute and awaits a
	response.  A response of carriage-return means "leave it as is",
	a response of "x" means "skip the rest of the record", a response of
	"w" means "wipe out the rest of the record", any other response is
	taken to be the new value for the attribute.  Attributes that are
	strings of characters are shown in single quotes and any leading
	blanks are stripped from the response, (thus " x" becomes "x" while
	"x" would mean "skip the rest of the record").
	NOTE: if you'd like to use the new program "visifix" (see below) with
	the "fixup" command then simply install visifix as BIN/empfix.

turn [the game] on|off
	This command destroys|creates the "down file" and creates|destroys
	the "up file" either of which contains the Empire logon message.
	Thus, to stop the game while some bug is fixed or some test is
	being run, you would:
    [255:0] Command? turn off
    Enter telegram for The World, end with ^D
    Down to repair sector file.
    ^D
	From this point on, only a country with nat_stat == STAT_GOD
	can log in, and anyone already playing will be thrown off.
	Further, anyone whose uid is privuid can log in by using exactly
	three arguments, e.g. "empire Lumbaga Retief -".
	The message "The game is down" will be printed after each
	command is executed as a reminder.  Once the bug is fixed
	you would:
    [255:0] Command? turn on
    Enter telegram for The World, end with ^D
	  Welcome to Empire
    ^D
	And Empire would be generally available once again.

The following command has an extra optional argument for the Deity:

grant sects recipient miracle
	This is normally used with the first two args to grant land to other
	countries.  The third argument can be either "yes", "no" or missing.
	If it is "yes" any uninhabited sectors will be fully populated
	when they're granted.  If it is "no" they will be left uninhabited,
	which means they rapidly revert to being unowned.  If the argument
	is missing you will be asked whether a miracle occurs each time an
	uninhabited sector is encountered.


Please let me know of any problems you encounter, (preferably after you've
solved them).  Also let me know if you enjoy this madness.

					Peter Langston
					Lucasfilm Ltd.
					P.O. Box 2009
					San Rafael, CA  94912
					ucbvax!dagobah!psl
					Feb, 1984

ANOTHER ADDENDUM


	    VISIFIX -- VISUAL EMPIRE FIX PROGRAM

Visifix is designed to aid the Empire Deity in running Empire games.
It does this in two manners.  First it provides easy access to and
modification of essential Empire structures.  Second, it displays a
wide range of information in a manageable format.  Of paramount
importance is map mode; it allows the Deity to display both the map
and vital statistics for the sectors shown.  This mode can highlight
such important things as plague sectors, mined sea sectors, sectors
of a given user, and ships.  From the map mode the Deity can get
into full edit mode on a sector, or change sector ownership or type,
get rid of playue, induce plague, mine sectors, unmine sectors and
so forth, with one or two keystrokes.  Visifix allows the Deity to
modify all of the essential structures (except for loans and treaties,
which have yet to be implemented), plus news (censorship reigns).
		*	*	*	*	*
There is no other document accompanying this program but you can
get help just about anywhere in the program by typing that most
useful of characters, '?'.
		*	*	*	*	*
Installing vfix is a relatively simple procedure.  One must edit
the included Makefile so that the paths are correct.  In order to
compile vfix, one needs to have the included source, an empdef.h
file, and various libraries that came with your empire distribution.
		*	*	*	*	*
Visifix was written by Nick Lai at UC Bekeley, 1984.  Bugs, comments
and compliments should be mailed to: decvax!ucbvax!ucbcory!lai
                                                Feb 26 1985
