Jump to content

Soldier nationality and ethnicity chances


steelgonads

Recommended Posts

Hello, I've recently started modding Xenonauts adding nationalities that were missing and correcting what i viewed as incomplete things in the already existing ones.

I already know how to use the modular system and i think i have a good comprehension of the MODMERGEATTRIBUTE and MODMERGE attributes of the soldiernames.xml.

What I'd like to discuss is how the chances of getting a nationality and the chances of ethnicity work. I know what I'm going to say is probably not news for most of you, but I couldn't find a thread where this specific issue had an answer.

To find out how the chances work, i made a small test mod that deleted all nationalities and introduced my own testing nationalities. Things I've found:

1- There's a bunch of custom soldiers (from the Kickstarter backers) that you cannot ever eliminate. They will keep showing up in your roster with some unknown probability. Somewhere else on the forums I've found that this is hardcoded.

2- The "chance" attribute in the Nation element, doesnt seem to be a percentage. With two fictional nations, both having a chance of "2", I got more or less 50% soldiers from each nation. With one of the nations with a "3" and another with a "1", i got (after several New Games) more or less a 3 to 1 proportion. Finally, with very high numbers the behavior is the same, so with one nation with "300" and another with "150" i got a 2 to 1 proportion.

<Nation MODMERGEATTRIBUTE="name" MODMERGE="insert" name="Nation1" chance="150" flag="ussr">

<Nation MODMERGEATTRIBUTE="name" MODMERGE="insert" name="Nation2" chance="300" flag="ussr">

It seems to be an absolute number that gets added to all the other nation "chances" to form a total which then will be the denominator used to calculate the true percentage. In the last example the probability of the first nation would be 300 / (150 + 300) = 67% and of the second nation 150 /(150+300) = 33%.

This makes modding really easy, since you can for example just put the population of that country in millions (10 for Hungary, 80 for UK, 130 for USSR, etc) and the game will calculate the percentage accordingly.

3- The "chance" attribute in the Ethnicity element, works in a similar way, but only in the scope of a single Nation. This means that it calculates the total contained in the Ethnicity nodes of ONE nation.

For example:

<Nation MODMERGEATTRIBUTE="name" MODMERGE="insert" name="Nation1" chance="150" flag="ussr">

<Ethnicity name="nor" chance="2" />

<Ethnicity name="med" chance="2" />

<Ethnicity name="asi" chance="2" />

<Nation MODMERGEATTRIBUTE="name" MODMERGE="insert" name="Nation2" chance="150" flag="ussr">

<Ethnicity name="nor" chance="100" />

<Ethnicity name="med" chance="100" />

<Ethnicity name="asi" chance="100" />

You'll have a 50-50 distribution in the nationalities and within each nationality 33% of chance of getting Nordic, Mediterranean or Asian ethnicity.

4- You can "force" common names and surnames to show up more often. I say force, because the XML file will look weird. For example, in the Portuguese soldiers mod i made I was getting as many "Saturnino Zebedeu" (very rare name) as I was getting "Joao Silva" (John Smith). You can fool the game by just repeating the same name over and over again.

<FirstName>Saturnino</FirstName>

<FirstName>Joao</FirstName>

<FirstName>Joao</FirstName>

<FirstName>Joao</FirstName>

<FirstName>Joao</FirstName>

<FirstName>Joao</FirstName>

<LastName>Zebedeu</LastName>

<LastName>Silva</LastName>

<LastName>Silva</LastName>

<LastName>Silva</LastName>

<LastName>Silva</LastName>

<LastName>Silva</LastName>

This got me 5 times more Joao and Silva than Saturnino or Zebedeu.

It's ugly and it'll make the files much bigger, but it works.

In the hopes of doing this in a sleeker way, i tried addind a "chance" attribute to the FirstName and LastName elements, but the game just ignored it.

That's it for now, thanks for reading

Link to comment
Share on other sites

  • 3 weeks later...

Hey Steelgonad,

I've been using your Soviet and Yugoslavian soldier packs and I really like them!

I like them so much that I thought of modding my own soldier packs but I'm at a bit of a loss on some points:

A) How do I add regiments for new nations? I looked at the files for your Yugo list and it just had "regimentyugo1" or something like that.

B)How many ethnicities are in the game? I know of Nordic, Asian and Mediterranean.

C) What does the "scripts" file do?

Thanks for any help in advance!

Edited by burning_phoneix
Link to comment
Share on other sites

  • 2 weeks later...

Hey there everyone.

burning_phoneix:

A) -To add regiments you need to add them in two diferent files. The soldiernames and soldierfemalenames inside the correspondent nation XML node, after the names themselves:

<Regiment name="regiment.belgian1">

<Experience>experience.none</Experience>

</Regiment>

<Regiment name="regiment.belgian2">

<Experience>experience.none</Experience>

<Experience>experience.belgian1</Experience>

</Regiment>

Then you must add the regiment and experience strings to the file string.xml (using excel), by placing the code in the first column and the correspondent name in the second:

regiment.belgian1 Chasseurs

B) - Those three plus African.

C) - Lua scripts are there to provide some control over events in the game. I haven't dabbled into those yet.

Casaubon and Max_caine:

I'm already cooperating with other people on steam workshop (you can see the contributors list). As for teh Xtended backgrounds, i asked in the thread if there were plans to release it on steam workshop and i got no response. That's when i decided to go ahead and do my own.

Edited by steelgonads
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...