Conquest of Elysium 3 is an old school fantasy strategy game. You explore your surroundings conquer locations that provides the resources you need. Resources needed vary much depending on what character you are, e.g. the high priestess need places where she can gather human sacrifices, the baron needs places where tax can be collected and where iron can be mined. These resources can then be used for magic rituals and troop recruitments. The main differentiator for this game is the amount of features and special abilities that can be used. The game can be played on Windows, Linux (x86 and raspberry pi) and Mac OSX (intel and powerpc).

Forum Thread
  Posts  
CoE3 Multiplayer Linux Server Script (Games : Conquest of Elysium 3 : Forum : Tutorials : CoE3 Multiplayer Linux Server Script) Locked
Thread Options
vladikus
vladikus The Lazy One
Feb 24 2012 Anchor

Here is a script for linux users hosting multiplayer text servers. For a singleplayer version of this script, see Indiedb.com

Last updated: Feb 24th, 1:33 PM -- altered script so that it works on any terminal

The only thing you will have to change before running the script is the variable COE3_EXE: this variable should be the path to your CoE3 executable (e.g. I use COE3_EXE='/usr/games/coe3_x86')

Features are as follows:

  • Gamelogs and autosaves are prefixed with the year, month, day, and time
  • Files are well organized and correspond with one another (user is encouraged to put gamelogs in their own folder in ~/.coe3)
  • Your public IP address is shown when server is created (must have wget installed)
  • The command to run the CoE3 executable is followed by quick reference for changing multiplayer settings
  • Allows for commenting and uncommenting different server configurations so you can quickly set up a certain type of game (right now it includes an allied game on a small map, a quick FFA for 4 players, and settings for a 1 vs. 1). As the community creates maps and scenarios, they can easily be preloaded in for quick play and little setup
#!/bin/bash

# This script is by vladikus and is intended for running a text mode server for Conquest of Elysium 3.
# It is meant to allow the host to set up multiplayer games with little hassle or effort as well
# as keep good records of gamelogs and their corresponding autosaves.

# Features are as follows:
# Gamelogs and autosaves are prefixed with the year, month, day, and time
# Files are well organized and correspond with one another
# Your public IP address is shown when server is created (must have wget installed)
# The command to run the CoE3 executable is followed by quick reference for changing multiplayer settings
# Allows for commenting and uncommenting different executable configurations so you can quickly set up a certain type of game (right now it includes an allied game on a small map, a quick FFA for 4 players, and settings for a 1 vs. 1). As the community creates maps and scenarios, they can easily be preloaded in for quick play and little setup.

# IMPORTANT:
# The following variable should point to your COE3 executable, which is currently set to my own default.
# This script will be useless until you put in the correct path.

COE3_EXE='/usr/games/coe3_x86'

# Check to see if there is a directory for gamelogs in the user's CoE3 home folder (keep things organized)
# Gamelogs are best kept in their own directory. This script suggests ~/.coe3/gamelogs/

if [ ! -d ~/.coe3/gamelogs ]; then
  echo -e "\nDirectory ~/.coe3/gamelogs not found. Shall I create it?"
  echo "Please enter Y/N: "
  read ans
  if [ "$ans" == "y" -o "$ans" == "Y" ]; then
    echo "Creating a gamelog directory..."
    mkdir ~/.coe3/gamelogs
    GAMELOG_DIR="/home/$USER/.coe3/gamelogs"
    echo "Gamelogs are now located in ~/.coe3/gamelogs"
  else
    echo "Putting gamelog in ~/.coe3 directory"
    GAMELOG_DIR="/home/$USER/.coe3"
  fi
else
  GAMELOG_DIR="/home/$USER/.coe3/gamelogs"
  echo -e "\nPutting gamelog in ~/.coe3/gamelog directory"
fi

# Prefix autosaves and gamelogs with the year, month, day, and time
AUTOSAVE_DATE=$(date +"%Y-%m-%d_%R")_autosave_multiplayer
GAMELOG_DATE=$(date +"%Y-%m-%d_%R")_gamelog_multiplayer

cd $GAMELOG_DIR

# Tell user their public IP (using wget, command taken from http://www.go2linux.org/what-is-my-public-ip-address-with-linux)
echo -e "\nYour public IP address is: "
wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

# By default, this runs a server in text mode with the following settings: 
# small map, clustered start, common cause, and renaming

$COE3_EXE --autosave=$AUTOSAVE_DATE --gamelog=$GAMELOG_DATE -t -S --rename --mapw=40 --maph=28 --clusterstart --commoncause

# Here is a multiplayer game for a quick FFA game of about 4 players
# small map, renaming, battlereports
# $COE3_EXE --autosave=$AUTOSAVE_DATE --gamelog=$GAMELOG_DATE -t -S -b --rename --mapw=40 --maph=28

# Here is a server for a one-on-one faceoff
# tiny map, renaming, battlereports
# $COE3_EXE --autosave=$AUTOSAVE_DATE --gamelog=$GAMELOG_DATE -t -S -b --rename --mapw=30 --maph=20

# Below are some additional settings for quick reference

# Map size
# Tiny 30 x 20 (e.g. --mapw=30 --maph=20)
# Small 40 x 28
# Large 50 x 36
# Huge 60 x 44
# Enormous 70 x 52

# List of common multiplayer switches followed by explanations
# -b Doesn't show battles, but creates reports
# --loadgame=FILE  Replace FILE with a path to the autosave or saved game you want to use (.coe3/saves/)
# --loadmap=FILE   Replace FILE with a path to a map for the game (.coe3/maps/)
# --society=NBR    Replace NBR with (0 - Random; 1 - Dark Ages; 2 - Agricultural; 3 - Empire; 4- Fallen Empire; 5 - Monarchy; 6 - Dawn of a New Empire)
# --northpart=NBR  Percent of map for northern type terrain (80 is default)
# --clusterstart   Allies/teams start in same area of the map
# --commoncause    A player only loses if the entire team loses

The most recent version of this script can be downloaded from here: coe3_mp.sh

Edited by: vladikus

Feb 24 2012 Anchor

WOW. Nice work.
I should have you rewrite my kludgy Dom3 admin scripts.

Feel free to make suggestions on any other switches you feel we need.

Feb 24 2012 Anchor

nice script, just too bad it depends on gnome-terminal. a bit more agnostic would be nice :)
like, instead of gnome-terminal, just "cd" to the gamedir and just run it from the bash script (without gnome terminal).

gnome-terminal --working-directory="$GAMELOG_DIR" -e "$COE3_EXE --autosave=$AUTOSAVE_DATE --gamelog=$GAMELOG_DATE -t -S --rename --mapw=40 --maph=28 --clusterstart --commoncause"

do this instead:

cd $GAMELOG_DIR 
$COE3_EXE --autosave.... etc...

Edited by: zweck

Feb 24 2012 Anchor

I like that too. I tend not to allow any GUI on my linux servers. Too much overhead.
But then again Im an old DOS expert which made text mode linux just feel like home.

vladikus
vladikus The Lazy One
Feb 24 2012 Anchor

Thanks so much!! This teaches me a lot. I have done as zweistecken suggested and Gandalf favored--the script can now be run in the terminal of your choice (no need for GNOME). Enjoy and keep the feedback coming (I'm sure there a few things that still need fixing). The top of this thread contains most recent update to the script; the link to download it has been updated as well.

--

Slackware 14.0
Debian 6.0.6

Oct 17 2012 Anchor

Excuse me :)

How are you supposed to shutdown, safely, a multiplayer (text) server part way through a game i.e. the game needs saving so you can return to it later.

The server does not appear to have 'save' or 'exit' type functions, so I've just been hoping that autosave works, Ctrl-C out of it, and trust that no corruption occurs.

edit: clarification that this is a text based server query and apologies for the off-topicness

Edited by: Machinista

Oct 17 2012 Anchor

The autosave occurs on each hosting. So killing the game at any point should be fine as long as its not in the middle of a hosting.

Oct 17 2012 Anchor

Thanks for the reassurance :)

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.