[Xland was originally created by Dan Bennet. This is a version I hacked ---ts]

Xland is a land creation program for empire version 1.x. It allows a diety
to create a world.  It requires a X terminal which can display at least 5
colors.  (I suspect you could hack it to work with four but less would be a
problem) You may also use greyscale mode by using gxland instead of xland.
(both are made when you compile) If you have only black/white, you can try
using xland, but it's not as easy...

Usage: xland -M <XxY> [-G] [-N] [-S <savefile>]
-G = Generate map from save file only. Don't start X
-S = Set save file name
-N = Not exact. Add miscellaneous small islands

The -M argument is required, and is the size of the world to use, in XXxYY.
(For example 32x32, 64x64, 128x256, etc). Xland works well up to about 256x256.
After that, the boxes become too small to see, unless you have a very high
resolution screen. (But heck, real men don't play in worlds that big, right?)
The size of the initial xland window is based on the world-size, but xland
now understands resizing.

The -G function causes xland to make a world without starting X, from the
default save file ('xland.save') or a file specified by the -S option.

The -S option specifies the save file name to use.

The -N option allows xland to put in miscellaneous small islands.

The world is initalized to all ocean.  Pressing the left mouse button will
allow a diety to "draw" contents, islands, and ocean. The middle button will
count the size of the island under the mouse. The right button will flood-fill
the current land type onto the current area (maximum of 20 sectors so that
you don't accidentally fill the whole map). 

Ocean		- select ocean as current land type to draw with
Land		- select land as the current land type to draw with
Mountain	- select mountains as current land type to draw with
Clear		- reset the world to ocean
Exact		- make the world the exact shape drawn. The default value
			for this button is on. If this mode is off, the world
			will be close to what you draw but not exactly the same.
			(It will create a lot of 1-2 sector islands, and modify
			a few of the sectors you drew)
UnDo		- undo last fill.
Save		- save the current world to xland.output
Load		- load the map in the file xland.output
Quit		- Make the world with the current map. The output sector file
			will be put in xland.sector.dat. This file can be used
			directly as an EMPIRE sector file.

Once you have made a sector file with xland, you can simply move it into your
empire data directory (rename it to sector, the file empire uses), run ore, and
you're all set. (Ore works properly, since xland sets elevation levels
appropriately for all sectors. Hand designating sectors as the deity does not
set them appropriately, which is why ore does not work on a map such as that.)

One caveat. You MUST run xland on a machine with the same type sizes as the
machine you're running Empire on. If one machine thinks ints are 2 bytes and
the other thinks they're 4, you got problems. The easiest way is to run them
on the same machine, or same make of machine, of course. Otherwise, try it
and see...

Note the presence of certain .h files in the directory. These need to be the
equivalent files from your empire source, to make sure xland will generate a
sector file appropriate for your machine & source code. Overwrite the .h files
in this distribution with the ones from your Empire code before compiling.

There is also a utility included, xlandutil. Xland saves worlds in an ascii
file, with the following format:

world_size(XXxYY)
x-row-1
x-row-2
etc.

for example:

16x16
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 2 2 2 2 2 0 0 0 0 0 0
0 0 0 0 0 2 2 1 2 2 2 0 0 0 0 0
0 0 0 0 0 2 2 2 1 1 2 0 0 0 0 0
0 0 0 0 0 0 2 2 2 2 2 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

This save files defines a world with only 1 landmass:

        - - - - -
       - - ^ - -
        - - - ^ ^ -
         - - - - -

There is one line for each YY. This file is human edittable, with 0 being sea,
1 being mountain, and 2 being wilderness. Xlandutil is similar to the -G option
of xland in that it makes a sector file from a save file. It does not, however,
require the presence of X to compile. This allows you to use a convenient X
display to draw a world, and then use xlandutil on the appropriate machine to
make the acutal sector file. It also allows one person to make a map, and send
it to another person to use. (I did the map for the Carnage game in this way)

Thomas Ruschak

[The following comments come from Dan Bennet]

FILES
   Graph*   various files for the Graph Widget.  OK OK this was part of my
	    masters thesis and I want to use it wherever I can.

   Makefile (I dont really want to convert this to gnumake)

   xland.c  the program.

I suppose that this belongs to Kent State but you should feel free to 
hack this at will [I did. :-) --ts].  Jeff Bailey is cordinating the KSU
empire stuff so you should probably send worthwhile hacks, bug reports,
and suggestions for improvements back to me or him.  

bennett@mcs.kent.edu
bailey@mcs.kent.edu
doleh@mcs.kent.edu
empire@mcs.kent.edu

Dan Bennett
