[net.sources.games] GALAXY - part 1 of 10

ejb@think.ARPA (Erik Bailey) (04/24/86)

This is GALAXY, a 2-player real time game of interstellar domination.
Warning -- although this game looks great, I have never used it because
it requires ROOT privs.

Enjoy... --Erik

-------------fold, staple, mutilate, line-eater!----------------------
#!/bin/sh
# shar:	Shell Archiver
#	Run the following text with /bin/sh to create:
#	Manifest
#	READ_ME
#	install.sh
#	install_howto
#	galaxy.6
#	galaxy.man
# This archive created: Sat Jun  8 14:16:52 1985
echo shar: extracting Manifest '(1962 characters)'
cat << \SHAR_EOF > Manifest
                       Comments on:
        Why we did what we did and who helped us

                     Mordechai Chachamu
                       Amnnon Horowits

1.  Background

     The idea of galaxy came to me (the  first  author)  few
years  ago.  I  felt  that the video games, and in general -
computerized games,  are  usually  thrilling  only  for  few
times.  They  either  depend on swift reactions and/or sheer
luck, or implement a computerized  versions  of  old  games.
Thus I looked for a game that answers two criteria:

1) It is practically impossible to be played without a  com-
puter.

2) The computer has no influence upon  the  outcome  of  the
game.

     The  way  to  satisfy  those  seemingly   contradictory
requirements  was  to  create  a  game  that  challenges TWO
players sitting at TWO different terminals.  The  game  uses
the  computer  merely  as  a  data  base  manager  and  as a
transmitting media between the two players. Skimming through
the  game's  document  will  soon  reveal  that  there is no
rational way to play this game without a computer.

     As the game evolved, it became clear that it implements
some more principles. Namely -

3) You can never have it all.

4) There is no "best solution".

5) There is always some amount of uncertainity.

     We feel that although the game is hard to get  familiar
with,  once  it's  principles  and  their  implementation is
understood, GALAXY is a very attractive game.

     First attempts to write the game  were  futile,  mostly
because  I  lucked  knowledge in UNIX. At this stage came to
rescue the second author, that managed most  of  the  tricky
parts.

2.  Acknowledgments

     Many thanks to the people in the computer  lab  of  Tel
Aviv  University.   Specially helpful (and encouraging) were
Nir Peleg, On Paradise and Robert Segall.


                        Mordechai Chachamu (mrdch@taurus)
                        Amnnon Horowits (amnnon@taurus)
SHAR_EOF
if test 1962 -ne "`wc -c Manifest`"
then
echo shar: error transmitting Manifest '(should have been 1962 characters)'
fi
echo shar: extracting READ_ME '(968 characters)'
cat << \SHAR_EOF > READ_ME
         What have we got here:

         This directory contains ALL what it takes to install, run and 
 (hopefully) understand the game of GALAXY.

        Files:
 Manifest       - some background motivation and "history".
 install_howto  - detailed description of installing procedure.
 install.sh     - a shell script that does it all. Read it first!!!

      Directories:
src       - GALAXY main source.
src1      - secondary source. command files, response stuff, etc.
man       - manual page.
doc       - galaxy's document.
online    - galaxy's document as it apears on line during the game.

We will be *VERY* glad to receive ANY comment. Mail to:

                {mrdch,amnnon}@taurus                           (BITNET)
                {mrdch,amnnon}@taurus.bitnet@berkely            (ARPA)
                {mrdch,amnnon}%taurus.bitnet@wiscvm.ARPA        (CSNET)
and if all fails, then 
                ...!decvax!humus!taurus!{mrdch,amnnon}          (UUCP)
SHAR_EOF
if test 968 -ne "`wc -c READ_ME`"
then
echo shar: error transmitting READ_ME '(should have been 968 characters)'
fi
echo shar: extracting install.sh '(1909 characters)'
cat << \SHAR_EOF > install.sh
# This is the galaxy maker.
# Be sure to set the following shell-variables before you run this
# command file.
# Since this file has to use super-user privileges, be sure to read
# it before you use it.
# Good luck.

SDIR=.
#SDIR=/users/guest/galaxy/distr
SOURCES=$SDIR/src
SOURCES1=$SDIR/src1
LIBDIR=/usr/games/lib/galaxy
MAN=$SDIR/man
DOC=$SDIR/doc
ONLINE=$SDIR/online

cat << Funny
Warning: Read this file before running it!

Warning: This file must be run with super_user priviliges.
         Before running it , create a user named galaxy,
         group - games.  

Shall I proceed ?
Funny
read answer
if [ "$answer" != y ]; then
        echo GoodBye
        exit 1
fi


if [ ! -d $LIBDIR ]; then
        mkdir $LIBDIR
        chuser galaxy $LIBDIR
        exit 1
fi

cd $SOURCES; make galaxy
cd $SOURCES1; make all
mkdir $LIBDIR/online ; chuser galaxy $LIBDIR/online
cp $ONLINE/* $LIBDIR/online ; chuser galaxy $LIBDIR/online/*
# install all files in library directory....
cd $LIBDIR
cp $SOURCES/galaxy galaxy.out                  # galaxy main program
chuser galaxy galaxy.out
chmod 4111 galaxy.out
cp $SOURCES1/pager pager                       # call the second user
chuser galaxy pager
cp $SOURCES1/local local                       # 2 terminal I/O handler
chuser galaxy local
cp $SOURCES1/galaxy.motd galaxy.motd           # general note
chuser galaxy galaxy.motd
cp $SOURCES1/galaxy.csh /usr/games/galaxy      # command file.
chuser galaxy /usr/games/galaxy
chmod 755 /usr/games/galaxy
cp $SOURCES1/okgalaxy /usr/games/okgalaxy       #  response program
chuser galaxy /usr/games/okgalaxy
echo > galaxy.scor                              # score file.
chuser galaxy galaxy.scor
echo > wizards                                  # wizard file.
chmod 644 wizards
chuser galaxy wizards
cp $MAN/galaxy.6 /usr/man/man6/galaxy.6         # manual
cp $DOC/galaxy.doc /usr/doc/galaxy              # document
SHAR_EOF
if test 1909 -ne "`wc -c install.sh`"
then
echo shar: error transmitting install.sh '(should have been 1909 characters)'
fi
echo shar: extracting install_howto '(7263 characters)'
cat << \SHAR_EOF > install_howto
***************************************************************
*          PLEASE NOTICE THE FOLLOWING CONDITIONS             *
***************************************************************

As the authors of the game, we would like to make some 
requests and remarks concerning the game installation.

1. The sources contained hereby are distributed free, for the 
   much hoped enjoyment of all game lovers.

2. Being in public domain, anyone is entitled to change/add/delete
   anything he wishes.

3. We make a distinction between two kinds of changes:
   "Bug fix" - a change that brings the game to act closer to
                the way it should. (As defined in the document).
   "Enhancement" - a change that alters the way a player THINKS
                during the play.
   As a test to distinguish between the two, one should answer
   the question:
   "Will I play differently BECAUSE of that change?"

4. We would appreciate hearing about changes of the first kind.
   If possible, please mail them to us.

5. If a change of the second kind is introduced, we expect the
   person to compile it under a DIFFERENT name.
   (However similar to the origin). In addition, we would like
   to hear about it, and the reasoning behind it.

7. The game may be redistributed on the condition that no file
   from the original distribution will be left out.

8. The reason for the requests above is:
      Galaxy is different from many computer games, by involving
   TWO players at the same time. It is our wish that two
   people from different SITES will be able to compete one
   against the other. This can be achieved ONLY if the rules and
   conditions specified in the document remain intact.

9. On the other hand, we are eagerly waiting for reactions
   of any kind. If there will be some public opinion concerning
   the way the game SHOULD be, we will correct it on future
   versions.

***************************************************************
*          END OF CONDITIONS. NOW THE FUN.                    *
***************************************************************

  Installing galaxy - Three ways to treat a lady.

1. Run the install.sh in this directory. It must be run with
   Super User privileges, so at least read it before typing
   the command.
2. Refer to the end of this document, which outlines a step by
   step procedure.
3. Read further, and possibly gain more insight to the structure
   of this game.

Contents of the distribution directory.

The distribution directory contains several subdirectories: 
"Src" holds the source for the main program and "src1" has the
source for miscellaneous programs.
"Man" holds the manual page, for general reference.
"Doc" contains the complete documentation for the novice and 
experienced player.
"Online" is the same document in small pieces, that can be viewed
during the game.
After compiling the source two programs are obtained:
"Galaxy" and "okgalaxy".
"Galaxy" is the game itself. Whenever a user wishes to challenge
somebody to this play, he should run "galaxy". If the offer is
accepted, the other user runs "okgalaxy".

Protection

In order to enjoy the game to it's full potential, ALL relevant
files should have their access bits set so that NO forgery 
is possible. When a game is saved, the saved file belongs to 
"galaxy", and it's mode set to 600.

The two runable modules belong to galaxy.
Their mode should be 4111.
The directory "/usr/games/lib/galaxy" is to be owned by galaxy too,
and have it's mode bits set to 700.

Manuals

"Nroff" the document and the manual page. Place them in their
appropriate place.

(The "galaxy.doc" at "/usr/doc" and "galaxy.nrf" in "/usr/doc/nroffed").
        
The "online" holds the entries for the online "help" facility of
the game. It should be copied entirely to "/usr/games/lib/galaxy/online"
directory.


Terminals

The screen is a vital instrument here. The game looks for the type
of terminal used, as defined by TERM in the environment. It then 
extracts some entries from the "termcap" data base. If the
terminal lacks some basic capabilities, the session will be aborted.
        ***** High baud rates are recommended. *****
One feature of the game is it's ability to make good use of
2 screens terminals. There is NO entry for "FLip to the next page" and
"Flip Back to the previous page" in termcap(5). In many new terminals
such capability exists. If such is the case at your place, add those
two entries. We have defined them as "fl" and "fb" respectively.

Installation - step by step

The procedure outlined here is a detailed version of the
command file install.sh in this directory.


It is assumed that a uid named "galaxy" is created, within the 
"games" group. To avoid use of super user privileges, all files
belong to galaxy.

The variables outlined here can be freely changed. 

SDIR     =  /users/guest/galaxy/distr           ; the "home" dir.

; subdirectories within "home" directory.

SOURCES  =  $SDIR/src
SOURCES1 =  $SDIR/src1
MAN      =  $SDIR/man
DOC      =  $SDIR/doc
ONLINE   =  $SDIR/online

; where most of the game will reside

LIBDIR   =  /usr/games/lib/galaxy

; create LIBDIR with galaxy ownership

        mkdir $LIBDIR
        chuser galaxy $LIBDIR

; compile the programs

cd $SOURCES; make galaxy
cd $SOURCES1; make all

; transfer them to their place and take care of mode bits

cd $LIBDIR
cp $SOURCES/galaxy galaxy.out           # galaxy main program
chuser galaxy galaxy.out
chmod 4111 galaxy.out
cp $SOURCES1/pager pager                # call the second user
chuser galaxy pager
cp $SOURCES1/local local                # 2 terminal I/O handler
chuser galaxy local
cp $SOURCES1/galaxy.csh /usr/games/galaxy  # command file.
chuser galaxy /usr/games/galaxy
chmod 755 /usr/games/galaxy
cp $SOURCES1/okgalaxy /usr/games/okgalaxy       #  response program
chuser galaxy /usr/games/okgalaxy

; create the score file

echo > galaxy.scor                              # score file.
chuser galaxy galaxy.scor

; take care of documentation

cp $MAN/galaxy.6 /usr/man/man6/galaxy.6         # manual
cp $DOC/galaxy.doc /usr/doc/galaxy              # document

; and the online documentation

mkdir $LIBDIR/online ; chuser galaxy $LIBDIR/online
cp $ONLINE/* $LIBDIR/online ; chuser galaxy $LIBDIR/online/*



; The following suggestions are not essential, but recommended.

    make a file in /usr/games/lib/galaxy by the name "wizards".
    This file should contain login names of people who would
    like to experiment and debug (???) things in that game.

    Copy the sources to /usr/src/games/galaxy

    Read the "Terminals" paragraph above, and see if you can do
    something about it.

    We cannot over-emphasize our request for comments criticism and,
    yes, even encouragements. 
    
                        Please mail them to 

Our address:
                {mrdch,amnnon}@taurus                            (BITNET)
                {mrdch,amnnon}@taurus.bitnet@berkeley            (ARPA)
                {mrdch,amnnon}%taurus.bitnet@wiscvm.ARPA         (CSNET)
and if all fails, then 
                ...!decvax!humus!taurus!{mrdch,amnnon}           (UUCP)

                                        Mordechai Chachamu
                                        Amnon Horowits
SHAR_EOF
if test 7263 -ne "`wc -c install_howto`"
then
echo shar: error transmitting install_howto '(should have been 7263 characters)'
fi
echo shar: extracting galaxy.6 '(2121 characters)'
cat << \SHAR_EOF > galaxy.6
.TH GALAXY 6 MRDCH&AMNNON
.SH NAME
galaxy, okgalaxy \- A two player duel in space
.SH SYNOPSIS
.B /usr/games/galaxy
[ \-t \-a \-m user ]
.br
.B /usr/games/okgalaxy
.SH DESCRIPTION
.I Galaxy
is a game of strategy and cunning for two players.
It is played on two different CRT terminals, which must be
from among those supported by vi(1). The game displays a map of a remote
part of the universe, with two identical galaxies on each terminal.
Each player owns one galaxy. The aim of the game is to conquer the
opponent's Capital, which is the center of his galaxy.
.I Both players
give commands simultaneously, without knowing the enemy's position
and intentions.
.br
There are quite a few commands, that enable each player
to perform various tasks. Refer to the
.I Galaxy's
document for specification. The "help" command enables online
review of major parts from that document.
.PP
To play the
.I
galaxy
game, run /usr/games/galaxy.
You will be asked
who do you want to play with.  You should specify a logged in user name.
That user will receive a message asking him to accept the challenge.
If he accepts, he should run /usr/games/okgalaxy
within some reasonable time. Only then the game starts.
.PP
If you wish to practice
.I
galaxy
you can enter "-null" instead of a real user name. You then have
the ability to see and/or command the "other" side by giving the
"cp" (change player) command. You can switch back easily
by the same command.
.PP
To see the scores obtained so far, run /usr/games/galaxy with the following options:
.br
\-t     \- show the top 10 players and related statistics.
.br
\-a     \- show all games played so far.
.br
\-m     \- show all the games played by you.
.br
user    \- show all games played by 'user'.
.br
Further documentation may be found in
.I
Galaxy's
document.
.SH FILES
/usr/games/lib/galaxy           library directory.
.SH SEE ALSO
M. Chachamu and A. Horowits
.I Galactical War
.SH BUGS
Infinity is a good approximtion.
The document is lengthy and lacks humor.
.br
.I Please
mail any bugs or comments to the authors at taurus.
.SH AUTHORS
Mordechai Chachamu
.br
Amnon Horowits.
SHAR_EOF
if test 2121 -ne "`wc -c galaxy.6`"
then
echo shar: error transmitting galaxy.6 '(should have been 2121 characters)'
fi
echo shar: extracting galaxy.man '(2661 characters)'
cat << \SHAR_EOF > galaxy.man



GALAXY(6)           UNIX Programmer's Manual            GALAXY(6)



NAME
     galaxy, okgalaxy - A two player duel in space

SYNOPSIS
     /usr/games/galaxy [ -t -a -m user ]
     /usr/games/okgalaxy

DESCRIPTION
     _G_a_l_a_x_y is a game of strategy and cunning for two players.
     It is played on two different CRT terminals, which must be
     from among those supported by vi(1). The game displays a map
     of a remote part of the universe, with two identical galax-
     ies on each terminal.  Each player owns one galaxy. The aim
     of the game is to conquer the opponent's Capital, which is
     the center of his galaxy.  _B_o_t_h _p_l_a_y_e_r_s give commands simul-
     taneously, without knowing the enemy's position and inten-
     tions.
     There are quite a few commands, that enable each player to
     perform various tasks. Refer to the _G_a_l_a_x_y'_s document for
     specification. The "help" command enables online review of
     major parts from that document.

     To play the _g_a_l_a_x_y game, run /usr/games/galaxy.  You will be
     asked who do you want to play with.  You should specify a
     logged in user name.  That user will receive a message ask-
     ing him to accept the challenge.  If he accepts, he should
     run /usr/games/okgalaxy within some reasonable time. Only
     then the game starts.

     If you wish to practice _g_a_l_a_x_y you can enter "-null" instead
     of a real user name. You then have the ability to see and/or
     command the "other" side by giving the "cp" (change player)
     command. You can switch back easily by the same command.

     To see the scores obtained so far, run /usr/games/galaxy
     with the following options:
     -t     - show the top 10 players and related statistics.
     -a     - show all games played so far.
     -m     - show all the games played by you.
     user    - show all games played by 'user'.
     Further documentation may be found in _G_a_l_a_x_y'_s document.

FILES
     /usr/games/lib/galaxy           library directory.

SEE ALSO
     M. Chachamu and A. Horowits _G_a_l_a_c_t_i_c_a_l _W_a_r

BUGS
     Infinity is a good approximtion.  The document is lengthy
     and lacks humor.
     _P_l_e_a_s_e mail any bugs or comments to the authors at taurus.



Printed 6/8/85            MRDCH&AMNNON                          1






GALAXY(6)           UNIX Programmer's Manual            GALAXY(6)



AUTHORS
     Mordechai Chachamu
     Amnon Horowits.




















































Printed 6/8/85            MRDCH&AMNNON                          2



SHAR_EOF
if test 2661 -ne "`wc -c galaxy.man`"
then
echo shar: error transmitting galaxy.man '(should have been 2661 characters)'
fi
#	End of shell archive
exit 0
-- 

Erik Bailey        -- 7 Oak Knoll                 (USENET courtesy of
ihnp4!think!ejb       Arlington, MA  02174        Thinking Machines Corp.
ejb@think.com         (617) 643-0732              Cambridge, MA)

	   It takes thought to make a program that thinks.
	   But it takes work to make a program that works.