The Stratagus Section

Back to main page.

The source code of Wargus, Stratagus and our modules are available here in the file software/stratagus.tar.bz2 on this CD.

Requirements

With our modifications the source code has the been tested with the following dependencies on linux machines based on Fedora Core 3. Basically, the user should be alright with any recent linux distribution with these libraries / programs installed.
  • SCons version 0.96.1 for compilation, available here.
  • Sun Java v. 1.4.2 SDK. Note that our module is not tested with Java version 1.5.0.
  • Lua version 5.0.2, available here.
  • SDL from Fedora Core 3.
  • libogg, libvorbis, libpng, libjpeg and libmikmod from Fedora Core 3.

Installation

The source is extracted via the command
tar xvjf stratagus.tar.bz2
and creates three directories, the jar, stratagus and wargus-2.1 directories.

To compile: change to the stratagus directory and run
scons
If all goes well this will produce the stratagus executable, the class directory containing the compiled java sources and the libstrat.so containing the stratagus engine for use in the Java VM.

Running

To run the original Stratagus engine with the Wargus game use the command
./stratagus -d ../wargus-2.1/data.wc2/

Running our module requires two machines. One to act as server and one to act as client.
The runrada.sh script located in the stratagus/ directory starts the Java VM and embeds the Stratagus engine within.

Starting the server

To start the server the syntax for the script is as follows: ./runrada.sh "map" "screenname" "experiment" "resultfile"
"screenname" is the name used for this player in the networked game.
"experiment" is a numerical value indicating which experiment to run. Possible experiment options are described later.
"resultfile" is the name of the file in which the situation values are recorded.
"map" is the map name to start on. Possible options are:
Option Description
Scen1vs1.pud A simple SSC situation with two opposing melee units
Scen3vs2.pud Two melee units opposing three melee units
Scen7vs7.pud Two squads with four melee and three ranged units each
archer-ambush.pud Two squads with two melee and four ranged units each
captured.pud Three melee and two ranged units surrounded by four melee units and one ranged unit
test.pud Two squads of equal strength.

Example: ./runrada.sh Scen7vs7.pud Master_Jacob 4 my_run.sv

Starting the client

To start the client the syntax for the script is as follows: ./runrada.sh "server" "screenname" "experiment" "resultfile"
"screenname" is the name used for this player in the networked game.
"experiment" is a numerical value indicating which experiment to run. Possible experiment options are described later.
"resultfile" is the name of the file in which situation values are recorded.
"server" is the ip-address or DNS-resolvable name of the server.

The experiment option

The game tree based experiments require more options to the runrada.sh. It requires an option indicating what rule sequence to use and another option that indicates which rating method to use.

Experiment name Numerical value Notes
AttackMove 2 -
AttackNearest 4 -
StandGround 7 Continuously issues stand ground orders to the controlled units
HumanPlayer 8 Enables a human player to control the units while still recording the situation value.
TVGTall 13 Game tree-based and uses the threat matrix rating method. Only rates the children of the root.
KNNGTall 14 Game tree-based and requires a K nearest neighbour rating method. Only rates the children of the root.
NNGTall 15 Game tree-based and requires a neural network rating method. Only rates the children of the root.
TVGTavg 16 Game tree-based and uses the threat matrix rating method. Rates the leaves and assigns the average value of the children to each internal node.
KNNGTavg 17 Game tree-based and requires a K nearest neighbour rating method. Rates the leaves and assigns the average value of the children to each internal node.
NNGTavg 18 Game tree-based and requires a neural network rating method. Rates the leaves and assigns the average value of the children to each internal node.

If "experiment" selects a game tree-based method the full commandline is: ./runrada.sh "server" "screenname" "experiment" "resultfile" "rulefile" "ratingfile"
"rulefile" must be one of the following:
Option Description
Rules/ArchersAssist.rules Selects the ArchersAssist rule sequence
Rules/FocusFire.rules Selects the Focusfire rule sequence
Rules/AttackKNearest.rules Selects the AttackKNearest rule sequence

If the "experiment" option selects a neural network rating method then "ratingfile" must be one of the following:

Option Describtion
classifiers/hidden_10.net A neural net rating method with 10 hidden neurons.
classifiers/hidden_100.net A neural net rating method with 100 hidden neurons.
classifiers/hidden_400.net A neural net rating method with 400 hidden neurons.

If the "experiment" option selects a K nearest neighbour rating method then "ratingfile" must be one of the following:

Option Describtion
classifiers/hidden_10.knn Uses the same training and validation set as hidden_10.net
classifiers/hidden_100.knn Uses the same training and validation set as hidden_100.net
classifiers/hidden_400.knn Uses the same training and validation set as hidden_400.net

If the "experiment" option selects a threat matrix rating method then "ratingfile" can be anything. Foo will suffice.

Example: ./runrada.sh 192.x.x.x master_jacob 14 ../out2.sv Rules/FocusFire.rules classifiers/hidden_400.knn