A couple glitches:
You're installing Glest and GAE to /usr/local
without using sudo which, in most linux out-of-the-box distros will not work, since /usr is owned by root and thus are all of its sub-folders.
Sollutions:
A) Use
sudo before every command (including the ones after the
; character) starting from step:
mkdir /usr/local/games/glest
This will however pose a security risk, as in order to actually play the game, you will have to run prefix it with sudo too (i.e. you will be running glestadv as root)! If you don't, no files can be written to /usr/local/games/glest and Glest will crash right on startup for not being able to create the file glest.log (and so will GAE I assume). And that file is not the only problem - the game will be unable to save anything to that folder.
It is unwise to run any command as root (e.g. prefixing it with the sudo command) unless it actually needs to be run so - in other words, something that would be a minor bug or glitch in GAE, with limited impact on your system might become a huge bug with serious consequences or even a possible backdoor for some malintended exploit.
See sollution for this sollution below.
B) Replace step:
mkdir /usr/local/games/glest
with this:
sudo mkdir /usr/local ; sudo chown $USER:$USER /usr/local ; mkdir /usr/local/games/glest
This will make /usr/local owned by user/group <your-user>/<your-user-group>. From then on, all commands run inside /usr/local/games/glest can be run by your regular user (instead of root) and you won't need to run GAE (or Glest) as root.
HOWEVER, that raises another security-problem. Though Glest/GAE now has limmited access to your system and hence is able to do little damage, it can still damage your personal files and folders - this is usually an "acceptable risk" as all programs are enabled some control over your system (otherwise they would be pointless).
But the problem now is that you can write to that executable file (glest or glestadv)! Binaries in Linux are usually owned by root and only root can change them; but usually everyone can execute them (there are exceptions) which is fairly safe. But now you've allowed a ton of programs and other exploit-doors to change your program! Hence, though the damage is limmited, the risk of someone malintendedly messing with your file has been increased.
Sollution for the problem with sollution A:-> Have a folder you can safely write to and make it used by Glest/GAE as the default data and settings directory!
The .deb package available from Ubuntu repos implements this through a small shell-script (that also takes care of other stuff). This is the version I changed to work with the /usr/local directory we installed GAE/Glest to, instead of the Ubuntu package default directories, /usr/share and /usr/lib:
Vanilla Glest:
#!/bin/sh
# glest
MAINDIR=/usr/local/games/glest
DIR=$HOME/.glest
[ -d $DIR ] || mkdir $DIR
cd $DIR
if [ -f glest.ini ]; then
# Update for Glest 3.2.1
sed -i 's/\.lng//' glest.ini
language=$(cat glest.ini | grep Lang | cut -d'=' -f2)
[ -f $MAINDIR/data/lang/${language}.lng ] || \
sed -i "s/${language}/english/" glest.ini
else
cp $MAINDIR/glest.ini .
fi
[ -h glest ] || ln -s $MAINDIR/glest .
[ -f servers.ini ] || cp $MAINDIR/servers.ini .
for i in data docs scenarios techs tilesets; do
[ -h $i ] || ln -s $MAINDIR/$i .
done
[ -d maps ] || mkdir maps
cd maps
for i in $MAINDIR/maps/*; do
[ -h `basename $i` ] || ln -s $i .
done
cd ..
exec ./glest
GAE:
#!/bin/sh
# glestadv
MAINDIR=/usr/local/games/glest
DIR=$HOME/.glest
[ -d $DIR ] || mkdir $DIR
cd $DIR
#if [ -f glestadv.ini ]; then # I could NOT get this to work properly for GAE. Hence
# # Update for Glest 3.2.1 # I just commented this out, which means that, if you
# sed -i 's/\.lng//' glestadv.ini # happen to messup your language settings, this script
# language=$(cat glestadv.ini | grep Lang | cut -d'=' -f2) # will not automatically fix it for you. You'll have to
# [ -f $MAINDIR/data/lang/${language}.lng ] || \ # manually fix it yourself.
# sed -i "s/${language}/english/" glestadv.ini
#else
# cp $MAINDIR/glestadv.ini .
#fi # End of commented-out language-setting routine.
[ -h glestadv ] || ln -s $MAINDIR/glestadv .
[ -f servers.ini ] || cp $MAINDIR/servers.ini .
for i in data docs scenarios techs tilesets gae_scenarios ; do
[ -h $i ] || ln -s $MAINDIR/$i .
done
[ -d maps ] || mkdir maps
cd maps
for i in $MAINDIR/maps/*; do
[ -h `basename $i` ] || ln -s $i .
done
cd ..
exec ./glestadv
As you can see, I got some problems with automating the language settings for GAE. Hence I just commented that part out. If you can find a sollution, please post it (
note: I did try and make a link english -> english.lng or english.lng.lng, also tried putting english.lng in the $HOME/.glest/glestadv.ini file instead of english. Either of these do solve the initial problem of glestadv crashing on startup; however, if you then go to the "Options" menu-item, GAE will crash with a somewhat similiar message as before).
Another issue regards the GAE Scenarios with Glest 3.2.2 - I could not get the Glest scenarios to work with it. For details, see
this post.