Log in

View Full Version : Hosting on Linux - Nation IDs and cl arguments


Akela
March 14th, 2009, 11:04 PM
I am a brand new linux admin with a brand new linux server that I'm trying to use to host a game for some friends. I have a couple of questions.

First of all, it seems like the set of command line parameters you might pass to the game the first time you run it are different from the arguments you need to pass when restarting a process for a game already in progress. For example, I am trying to start a new game using the following script (based heavily on Gandalf's work)

#!/bin/sh

GAME=RYA-Middle-Age
PORT=3540
ERA=2

cd /home/dom3/dominions3
DIR=~/dominions3/savedgames/$GAME

touch $DIR/$GAME.log
touch $DIR/$GAME.err

nohup ~/dominions3/dom3 \
--statfile \
--scoredump \
--tcpserver --port $PORT \
--hours 24 \
--quickhost \
--uploadmaxp 4 \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--diffai `echo $RANDOM%94|bc` \
--mapfile glory_multiplayer.map \
--indepstr 6 \
--masterpass masterblaster \
--renaming \
--era $ERA \
--textonly \
$GAME \
>>$DIR/$GAME.log 2>>$DIR/$GAME.err &


Let me start at the beginning. This script is supposed to start a game with 9 random computer opponents. It doesn't, it starts a game with some number of random opponents less than 9. Now I'm assuming that's because I'm getting random numbers that do not match the nations available for that era. I took the number 94 from a script of G's, but it seems pretty high to me, are there really 94 different nations? Also, there only seem to be about 15 to 20 available for any given era, is there a way to know what Nation IDs are available for what era? Or better yet, has anyone ever mapped out the Nations to IDs?

Next question. If I simulate disaster by rebooting the server, when this script runs on startup it usually fails to restart the game, producing an error message about a bad computer opponent. It seems that on the second start it re-rolled all the random numbers (which you might expect since that's what it was told to do). This seems to imply that you do not need all the initial parameters to restart a game than you do to initialize a game. Does anyone know what parameters you need and which ones you don't?

Any help is appreciated.

Thanks,

Akela

Akela
March 15th, 2009, 02:57 AM
Also, there only seem to be about 15 to 20 available for any given era, is there a way to know what Nation IDs are available for what era? Or better yet, has anyone ever mapped out the Nations to IDs?

I count 24 EA nations, 23 MA nations and 21 LA nations when running 3.21, so that's a total of 68. The number 94 came from the usage output when running "dom3 -h" e.g.

--normai X Nation ai controlled X=nation number (0-94)

Presumably this means there are a maximum of 94 nations possible, but only 68 in the vanilla game.

This script is supposed to start a game with 9 random computer opponents. It doesn't, it starts a game with some number of random opponents less than 9. Now I'm assuming that's because I'm getting random numbers that do not match the nations available for that era.

That was part of the problem, also my script will sometimes create the same random number twice, wherein the game ignores that player.

is there a way to know what Nation IDs are available for what era? Or better yet, has anyone ever mapped out the Nations to IDs?

Through simple experimentation I have determined that the nations are simply numbered from 0 to 67 in order from EA through LA.

First of all, it seems like the set of command line parameters you might pass to the game the first time you run it are different from the arguments you need to pass when restarting a process for a game already in progress.

Well, now that I look closely I see that the output from "dom3 -h" specifies "New Game Options", which implies that they are not needed when restarting a game in progress. However, about half of the options under "Network Options" seem to be unnecessary as well, everything from --nonationsel on down.

Akela

lch
March 15th, 2009, 05:55 AM
There are 95 (0-94) available nation slots. About 70 of them are being used by the game already, the others can be used by mod nations. The slots that the game uses so far are:

0 EA Arcoscephale
1 EA Ermor
2 EA Ulm
3 EA Marverni
4 EA Sauromatia
5 EA T'ien Ch'i
6 EA Machaka (not yet, announced)
7 EA Mictlan
8 EA Abysia
9 EA Caelum
10 EA C'tis
11 EA Pangaea
12 EA Agartha
13 EA Tir na n'Og
14 EA Fomoria
15 EA Vanheim
16 EA Helheim
17 EA Niefelheim
18 EA Kailasa
19 EA Yomi
20 EA Hinnom
21 EA Atlantis
22 EA R'lyeh
23 Special Monsters
24 Special Monsters
25 Independents
26 EA Oceania
27 MA Arcoscephale
28 MA Ermor
29 MA Pythium
30 MA Man
31 MA Ulm
32 MA Marignon
33 MA Mictlan
34 MA T'ien Ch'i
35 MA Machaka
36 MA Agartha
37 MA Abysia
38 MA Caelum
39 MA C'tis
40 MA Pangaea
41 MA Vanheim
42 MA Jotunheim
43 MA Bandar Log
44 MA Shinuyama
45 MA Ashdod
46 MA Atlantis
47 MA R'lyeh
48 MA Oceania
49 LA Arcoscephale
50 LA Ermor
51 LA Man
52 LA Ulm
53 LA Marignon
54 LA Mictlan
55 LA T'ien Ch'i
56 LA Jomon
57 LA Agartha
58 LA Abysia
59 LA Caelum
60 LA C'tis
61 LA Pangaea
62 LA Midgård
63 LA Utgård
64 LA Patala
65 LA Gath
66 LA Atlantis
67 LA R'lyeh
68 EA Lanka
69 MA Eriu
70 LA Pythium
71 LA Bogarus

That a game doesn't start with 9 nations for you if you pick random numbers is likely because the nations are partitioned into three eras. The era that you use decides which nations you picked are being used. You either need to only roll nations from a specific era, or use a mod which places all nations into the same era, so that it works like you want.

Gandalf Parker
March 20th, 2009, 07:37 PM
Hi, I run the Dom3Minions.com server (debian linux).

The impai does checks to insure that the AIs are acceptable. So 23, 24, 25, nations not in the era of the game, and mod-point nation numbers with no mod adding them to that era, would all error.

But a change to the dom3 code blew this up for me also. Even that amount of use I couldnt get to work right. I had to switch to:
generating or copying a .map file
generating the AIs
appending them to the .map file as #computerplayer commands

The code I use painstakingly chooses nations applicable to the era of the game (avoiding 23, 24, and 25) but you will find that with the #computerplayer does allow you to add any nation number. Even 23, 24, 25 (indepts and special monsters) and the mod nation numbers.

The mod nation numbers create a very limited opponent when played without a mod but it can be fun to toss into large maps as kindof a treasure for players to go after. You might want to look into using map commands to also set the AIs gods, scales, and castle defenders. Particularly for 23, 24, 25, and 72 thru 94

Gandalf Parker
--
per peer-pressure preoccupation
My maps, mods, and mullings can be found at
http://www.Dom3Minions.com