GALAXY: (Discussion) How to be a GM From: graeme@abekrd.co.uk (Graeme Griffiths) Date: Thu, 02 Mar 1995 16:41:55 +0000 Well, here goes. I've had a number of requests for some help setting up galaxy GMs from scratch. I suggest that anyone who thinks they'd like to have a go has at least played the game before they GM but if you think you can do it... This is, hopefully, going to become the definitive Galaxy GM guide and it will become that if experienced GMs offer their views. I've tried to outline everything but I'm bound to have missed a million things. So, please, if you're interested at all in Galaxy, esp. in the GMing side please read this and tell me what you think. Remember, spelling mistakes, grammatical errors and such by email to me, any views you have on this subject or anything else you'd like to be added post a reply. Hopefully once this is done, we'll get a whole new crop of galaxy GMs ============================================================================== How to be a Galaxy Game-Master ------------------------------ For the past couple of years the PBeM (play-by-Email) game Galaxy, originally written by Russell Wallace and modified by a team of others, has shown a sharp decline in nunber of games running. There are a few games still running (a few 'local' games not open to the general public) and the odd one or two global games, but the fact is fewer games are running. In late 1994 I started collecting names and preferences of people interested in playing Galaxy in the hope of spurring some people into GMing and to some point had success with this. There are at least 5 people who have expressed an interest in GMing and who (IMHO) have the system set-up and presence of mind to eventually do it and a enormous amount of people who wish to play. This document is to help those people who feel they could GM a game (or several) but are unsure as to how to go about it. The BIG question ---------------- Basically, the reason I started GMing and the reason I expect most people do is in order to play Galaxy. I actually intended that my GMing would spur others into following (and I still aspire to that), however some people may want action a little qicker than that. So, the first question every aspiring GM is going to ask is... "Can I play in my own games ?" I'm with Greg Lindahl on this. In his article "So you want to run your own PBM game..." (Aug '94 PBM Fanzine, URL - http://fermi.clas.virginia.edu/~gl8f/pbem_articles/so_you_want) Greg discusses how one would go about running a PBM game. On the subject of "the BIG question" he has this to say: > A GM must be fair, which also means that GM should not play in > their own game. You might find this to be an obvious rule, but some > GMs still break this elementary rule, including a few commercial GMs. I add this, if you are going to play in your own game you should tell prospective players before play starts. That way its at least a little fairer. Having now GM'd for a number of turns I would find it difficult had I been playing as I've browsed a few turn reports to make sure the game is running correctly, plus people ask you question relating to their _specific_ game position. On the same question another way, do you really expect me to add a result to the Hall-of-Fame-and-Infamy with you as GM _and_ winner ? How to start ------------ Initially, the first thing you need to do is get a copy of the Galaxy engine. This _is_ the game itself, its the piece of code that creates games and processes turns. Its available to FTP at cs.utk.edu:/pub/bampton/Galaxy in source (C code) form. There is, I'm told, an executable ported for PCs however I've never seen it and all attempts to find it have been fruitless. Assuming you get the source code the next step is to compile and test the code. The source (IMHO, of course) is not exactly a working-model of object-orientation and is, hence, not the easiest code in the world to port. However, its not rocket-science either and a reasonable knoweledge of C should see the job through. In order to test the code its best to run a game where you are all the players (see "Creating a game" below) and run a couple of turns to make sure it does what you expect. How hard you want to test the code should be based on confidence of your ability to solve any problems encountered on-the-fly as your game progresses. The Galaxy "engine" ------------------- This is the executable produced when you run a make on the galaxy code. It is, as stated above, the game itself. It creates games and runs the turns. If invoked without any options it will run a command shell (the galaxy prompt) from which you can do the following: C - Creates a game (see "Creating a game, below) P - Processes a turn (see "Turn processing", below) G - Allows you to give a position in an already running game to a new player L - Shows you the list of games that would run if you used the P command A - Adds a game to the list of games to run D - Deletes a game from the run-list Q - Quits the program Most of these are really only supported for historic reasons, it is unlikely that many GMs run games this way, instead the command line options can be used. Options: -f file : Run the turn (for each game on the game-list) using file as the orders file. -g game1 game2 ... gamen : Specifies which games to run For example: Assume I am running several games, all in the same data directory. If the schedule dictates I run a turn in game1 (but not any of the other games) I would invoke galaxy with the following options galaxy -f orders.game1 -g game1 where the file "orders.game1" contains the orders for game1 for this turn. If I miss the -g option all the games would run that are in the data directory and, as orders.game1 only contains the orders for game1, all the players of the other games would run with no orders used. The Galaxy "server" ------------------- What I call a Galaxy "server" is not a single entity but a collection of scripts that can be used to deal with running the game. There are a number of ways to approach the task of running a Galaxy game, I will outline the one I use. This is NOT the only way. The server needs to do two main tasks : i) Accept orders from the players, check them and return the checker output to the sender. ii) Run the games turns on a regular schedule and send the turn reports out. My galaxy server has a slight change to the original galaxy code. The original code always ran from the current directory (forcing each script to 'cd' to the directory the data files were in), I changed it to always run from an explicit path. It also allows me to simply add a general and game-specific message-of-the-day file to each turn report as its produced. This "improvment" is not available at the moment, if you want my version of the code I'll send it to you. If I get a fair rew requests I'll try and put the code together as a real release and put it onto the FTP site. My directory structure is $HOME/lib/galaxy/admin holds the reports and nreports directories and the order files. $HOME/lib/galaxy/data is the data file directory. This just allows me to enforce _my_ regiment of directory structures, it doesn't mean everyone else has to. Order processing ---------------- Orders can be assumed to be arriving at a single Email address and/or having a fixed mail subject. A mail filter (e.g. procmail, see later) can be used to pass the incoming mail through a script. This script should run the checker on the input and if the orders are acceptable (i.e. Have #GALAXY and #END lines, even numbers of '@'s and a correct password, player-name and game-name) place the orders into the order file for the correct game. Whatever the outcome of the checker, a reply should be sent to the sender of the orders telling them the status of their orders and if they made any mistakes. Notice that above the term "acceptable" does not mean "correct", the orders are still valid and should be used as orders in the game even if they have some mistakes in them. For the UNIX minded heres an example script: ------------------------------------------------------------------------------ #!/bin/sh BINDIR=$HOME/bin LOGDIR=$HOME/logs TMPDIR=$HOME/lib/galaxy/tmp ADMINDIR=$HOME/lib/galaxy/admin TMP=$TMPDIR/galaxy-orders OUT=$TMPDIR/orders-return LOG=$LOGDIR/checker.log CHECKER=$BINDIR/checker # 'getfrom' is my program for extratcing return addresses from a piece of # mail. You can do this any number of ways. GETFROM=$BINDIR/getfrom MAILER=/usr/lib/sendmail # First put the orders in a temporary file cat > $TMP # Note the arrival in the log file echo >> $LOG echo "Orders received at `date`" >> $LOG # Retrieve the mail address from the header of the orders WHO=`cat $TMP | $GETFROM` # Start composing the reply echo "To: $WHO" > $OUT echo "Subject: Galaxy server output" >> $OUT echo >> $OUT echo "Welcome to Graeme's Galaxy PBeM Server" >> $OUT echo >> $OUT # Run the orders through the turn checker (N.B. This uses gchecker # available as part of the galaxy 3.50 release $CHECKER $TMP >> $OUT 2>>$LOG r=$? # If the checker reports an error, tell the sender. if [ $r -ne 0 ]; then echo "You seem to have attempted to send Galaxy orders to my server" >> $OUT echo "Unfortunately there has been an error" >> $OUT echo >> $OUT case $r in 1) echo "Incorrect game name, re-submit with correct name" >> $OUT ;; 2) echo "Incorrect player name, re-submit with correct name" >> $OUT ;; 3) echo "No #END statement, re-submit with #END added" >> $OUT ;; 4) echo "Incorrect password, re-submit with correct password" >> $OUT ;; *) echo "An undefined error has occurred contact graeme@abekrd.co.uk" >> $OUT echo "with a subject 'Galaxy game error' if you need help" >> $OUT ;; esac echo >> $OUT else # If there was no error store the orders in ther correct orders file # 'getgame' is another script that extracts the gamename from the #GALAXY # line. Its similar to 'grep -i "#galaxy" $TMP | cut -d\ -f2' but makes # sure the output is in lower-case GAME=`cat $TMP | $BINDIR/getgame` if [ $? -eq 0 ]; then echo "Orders for game $GAME" >> $LOG ORDERS=$ADMINDIR/orders.$GAME else echo "Couldn't get gamename $GAME" >> $LOG ORDERS=$ADMINDIR/orders.nogame fi cat $TMP >> $ORDERS fi # If theres a valid recipient send the output, else save it (the save bit # is entirely untested as getfrom has never failed...) if [ "$WHO" != "" ]; then cat $OUT | $MAILER $WHO else echo "No recipient, saving to $SAVE" >> $LOG cat $TMP >> $SAVE rm -f $TMP $OUT exit 1 fi # Remove the temporary files rm -f $TMP $OUT exit 0 ------------------------------------------------------------------------------ Notes: I make no apologies about how it works, it works and thats what counts. No its not that elegant but it does the job and took about 10 mins to write. I don't include the code for getfrom and getgame although I am willing to give them away to anyone who wants them (They're not too tricky to work out) This script cats all the orders received into orders.gamename in $ADMINDIR. If another set of orders is sent they will also be cat'd to the file. This is O.K. because galaxy will use the last orders read from the orders file for each player. Turn processing --------------- Turn processing at its most basic can be done from the galaxy prompt when you fire up galaxy without the -f option. Typing P will prompt you for the name of an orders file and the turn will run. However, if you have many games in the same data directory (as seems sensible to me!) unless you specify a game list (either using A and D at the galaxy prompt or using the -g option on invocation) all the games in the data directory will run. This is fine if you want to run all your games at once but not so good if not. I have never run a turn using the galaxy prompt. I always use the following recipe. To run game "test" I (because of my order processing script) have an orders file "orders.test" and so call galaxy as : galaxy -f orders.test -g test From this I wrote a script to do all the housekeeping: ------------------------------------------------------------------------------ #!/bin/sh BINDIR=$HOME/bin LOGDIR=$HOME/logs TMPDIR=$HOME/lib/galaxy/tmp ADMINDIR=$HOME/lib/galaxy/admin DATADIR=$HOME/lib/galaxy/data # Need to add BINDIR to the path and export it so that the send script can # use it. PATH=$PATH:$BINDIR export PATH if [ $# -ne 1 ]; then echo "Usage: rungalaxy game" exit 1 fi ORDERS=$ADMINDIR/orders.$1 LASTORDERS=$ADMINDIR/last_orders.$1 ORDERSARC=$ORDERS.arc SEND=$ADMINDIR/send # I keep all the old reports tar'd up in an archive directory. turn=`cat $DATADIR/$1/next_turn` DIR=`pwd` echo Tarring old reports echo cd $ADMINDIR/reports/$1 tar cf $ADMINDIR/reports/archive/$1.$turn * rm $ADMINDIR/reports/$1/* cd $DIR echo echo Running galaxy engine echo # This is where galaxy is run $BINDIR/galaxy -f $ORDERS -g $1 >> $LOG 2>&1 # Archive the orders files and clean up directories for next turn. if [ $? -eq 0 ]; then chmod +x $SEND echo Running $SEND. $SEND cat $SEND >> $ADMINDIR/$1.send rm $SEND if [ -f $LASTORDERS ]; then cat $LASTORDERS >> $ORDERSARC fi mv $ORDERS $LASTORDERS else echo Problem with galaxy engine, not sending reports fi exit 0 ------------------------------------------------------------------------------ Notes: This, as yet, can only take one game at a time. I intend to remedy this shortly. Extra server stuff ------------------ Obviously you can add other features to your server, something to automate the registration for new games is useful. Some way of players quizzing the current status of a game is nice. Use your imagination, supply the best service to your players you can. Creating a game --------------- As there is no documentation about the galaxy program, creating a game is a bit of a learning curve. Heres some instructions to get you on your way. i) Make a file containing a list of the players mail addresses like so -------------------- player1@his.domain.wherever another@somewhere.else more@another.place%thru.some.router ... lastplayer@yet.a.further.domain -------------------- ii) When you have this invoke galaxy (no options) iii) Type 'C' to begin creating a game iv) Give the name of the game you want to create, this is used to create data, report and nreport directories so I usually use lower-case for the game name. v) Give the name of the file with the players mail-addresses in it. vi) When asked for the number of planets its time to work out how you'd like the game to go. If you give 2-3 planets per player it will be a fight from the beginning. The more planets you allow per player the more time before people _have_ to start attacking each other for territory (it don't stop 'em attacking anyway...) vii) You then get asked the size of the galaxy. Each homeworld must be at least 20 ly apart and so there is a minimum size its just hard to calculate but 20 x (square root of the number of players) plus a bit will give you an idea. Trial and error can be used (by repeatedly creating a game until it works !) to find the real size of the galaxy. viii) After this it will produce the turn 0 files and a send script, running send will send the reports (Beware, theres a lot of data to send you may cripple your mail-server if your not careful). ix) The game is now created and once the reports have been sent theres no going back... NOTE: One of the most annoying things I find abut galaxy is that it doesn't delete the game directory when it gives up creating a game so if during the above steps you make a mistake, before you can create the same game name you have to delete the data/gamename directory. Backing off a turn ------------------ Inevitably, mistakes will occur, if they do you wil have to back off a turn and re-run it. To do this you simply remove (or more sensibly move) the last data file (they're the numbered files in the data/gamename directory), and change the number in data/gamename/next_turn to be decremented by one (i.e. the number of the file you just moved). Once this is done you're back at the point, effectively, before you ran the turn. You need to find that turns order file and re-run. Procmail -------- To say that I think procmail is _the_ best shareware package I have ever seen and that I want to have Stephen R. van den Berg's children would be an over-statement, but only a slight one. Procmail is simply the best mail filter around, it does everything and it does it quickly and reliably. What procamil does for Galaxy GMs is to allow us to split our incoming mail by Subject (or any other criteria) and hence pass orders (and any other game-related files) through a processing script. If you want to GM galaxy procmail makes it easy, you can do it without procmail but if you don't have to, don't. Graeme Griffiths. (graeme@abekrd.co.uk) 2nd March 1995. ============================================================================== -- Graeme Griffiths, | "I'd love to talk philosophy, but I gotta Abekas Video Systems +44 1734 585421| take a piss. Man that philosophy, runs graeme@abekrd.co.uk | right thru' ya." - Dave Lee Roth 1994 Ge e+ -k++++++ C- o# -d& e?????? B-- i** -t+=%% -e+ M-@ e+ !!!!!! Up