• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

nath

Recruit
42 Badges
Jan 30, 2020
2
0
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Distant Stars
  • Stellaris: Leviathans Story Pack
  • Stellaris: Megacorp
  • Europa Universalis IV: Golden Century
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Europa Universalis 4: Emperor
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Stellaris
  • Europa Universalis IV
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV: Cadet
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
Hi everybody,

I'm working on a French Localization of the Random empire name generator.
I'm facing some difficulties to understand how they're generated.

Below you can see a type of generation wich could be used.
Code:
# Democratic Militarist 5
empire_name_format = {
    random_weight = {
        factor = 0
        modifier = {
            add = 2
            has_government = "gov_military_commissariat"
            is_pirate = no
            is_primitive = no
            NOT = { is_country_type = fallen_empire }
            NOT = { is_country_type = awakened_fallen_empire }
        }
    }
    format = "format.dem_mil.5"
    noun = "[This.GetSpeciesName]"
    prefix_format = "[This.GetSpeciesName] <democratic_mil>"
    # Human Star Empire

The [Noun] can reffer to the Capital Planet, to the Capital Star System or to the Species Name.
The order between the [Noun], the [Descrtiptive] and <empire_type> depends on wich number you write in the "add = #" line :
1 : <empire_type> of [Noun] : Empire of Earth
2 : [Descriptive] [Noun] <empire_name> OR [Noun] [Descriptive] <empire_name> : Human Star Empire OR Stellar Human Empire
5 : [Noun] <empire_type> : Earth Empire

So I need to change the order of these and also translate the "of" but I can't find where all of those format are. Any help would be very appreciated.

I'm a beginner in modding so don't be harsh if it's obvious.

There's also numbers besides the <empire_type> and [Descriptive] used words :
Code:
# Democratic Technocracy
empire_name_parts_list = {
    key = "democratic_tech"
    parts = {
        "Republic" = 3
        "Alliance" = 3
        "Commonwealth" = 3
        "Confederation" = 3
        "Confederacy" = 3
        "Union" = 3
        "League" = 3
        "Mandate" = 2
        "Coalition" = 2
        "Assembly" = 2
        "Council" = 2
        "Cooperative" = 2
        "Technocracy" = 4
        "State" = 1
        "Nation" = 2
        "Sovereignty" = 1
        "Commonality" = 1
        "Concordat" = 1
        "Accord" = 1
        "Polity" = 1
        "Administration" = 1
        "Consensus" = 6
    }
}

### Descriptive

# Imperial Materialist Descriptive
empire_name_parts_list = {
    key = "imperial_mat_desc"
    parts = {
        "Interstellar" = 1
        "Galactic" = 3
        "United" = 3
        "Great" = 3
    }
}

It's probably related, but i don't understand how.
 
Hello, fellow translator!
I'm also working for a better localization, and it seems I'm a little more advanced than you! For instance, I'm about enabling grammar accord for empire names (« République unie » v « Impérium uni » v « États unis »).

However, I will compile all that I made out or be hinted toward, in hope someone could correct any misunderstanding.
The major help was from other modded localisations like Chinese and German, btw, and they never know how much they helped me.
I'm not a modder myself but I begin building some basic knowledge about script files.

Random empire name generator:
/common/random_names/00_empire_formats.txt

  • For each created empire, all the empire_name_format = {} are evaluated before the dice are rolled. Each such format comes with a weight, depending on the empire's authority for the most part. These weights are chances that a particular empire format will be drawn when dices are rolled.
- weight for Democratic Military 5 is initialized at 0.

- weight is increased by 2, but only if the five next conditions are all met, thus only in the case of a non-pirate, non-primitive, non-FE/AE, military commissariat governement type.

- any other case will thus lead to a 0 weight and won't have any chance to draw Democratic Military 5 empire format.

- let's say that Dem Mil 5 has a weight of 2, that 4 more formats have a weight of 2, and 1 format has a weight of 5 (all the others at 0), that should mean that Dem Mil 5 has 2 chances out of a total of (2+2+2+2+2+5 =) 15 to be drawn, or a 13.3% chance.
  • In case this empire format is drawn and elected for this empire, then 3 keys/attributes are assigned a value; format, name, prefix_format. We can also see that THIS script's scope is the empire for which a format is being chosen. We see also three different formats used to assess a key: "" is to copy an existing value, [] to retrieve the value of a dynamic key defined within a script's scope (as explained in the wiki), and <> to evaluate another scripted object ( like object = {} ), but I'm not sure.
- format = the value of format.dem_mil.5 (see after), that is the formatted empire name that is displayed everywhere in game, on the galactic map, in diplomacy messages, etc.

- name = the value of the GetSpeciesName predefined dynamic key/attribute, that is attached to any empire, the name of its founder species (only because the current scope, or object currently being focused on, is an empire). I don't know what it's used for, only as you say that it can be; home world, home star, founder species, and that it depends on the word used in the empire format ("Human Empire" or "Empire of Sol" or "Empire of Terra").

- prefix_format = the character string made of the same string as name above, plus a space, plus a string assessed in the democratic_mil script. I was told that it could be used to form the naval prefix of this empire (such as "UNS"), in which case I'd figure that only the initial letter of each name in the whole string is taken. I've not tested this yet, but a quick glance at /localisation/english/prescripted_l_english.yml and /localisation_synced/prescripted_country_names.yml didn't confirm this (however, theses empires aren't randomly generated, to be fair): "TIS" for the Tzynn Empire (or perhaps Tzynn Imperium)?

Empire format composer:
/localisation_synced/empire_formats.yml
This file is a database contening all the string values for all the possible empire format formulae in the game. But these values are dependent on randomly assessed strings (i.e. values of scripted object) in another file! Which turns to be... the same /common/random_names/00_empire_formats.txt, as you made it.
  • Each empire format is expressed as a string composed of one core/key name (e.g. "Hegemony"), possibly one descriptive (e.g. "Galactic"), always one identifier (e.g. "Human"), and as many additional words or suffixes as needed by the localization. It's here where you can change the order of these words. You can also make some grammar accords, if you are sure of the random assessments of the <> objects.
- format/formula for Democratic Military 5 is fixed as:
"[This.GetSpeciesName] <democratic_mil_mid_desc> <democratic_gen>" (e.g. "Human Democratic Confederation").

- here, you can alter the order of the strings at will: "<democratic_gen> <democratic_mil_mid_desc> [This.GetSpeciesName]" (e.g. "Confederation Democratic Human") to prepare for French localization.

- we keep with "mid" in the object name because it's still in the middle, but don't hesitate to change this, should the localized format move it elsewhere in the string.

- note that I already reported that the English version wrongly uses GetSpeciesName instead of GetSpeciesAdj or GetAdj, but they won't change anything as "a Human" and "a Human being" are spelled the same in US-English. Note also that the use of a generic name inside a military format is probably an oversight, but let's keep it.

- finally, we get after proper localization: "<democratic_gen> <democratic_mil_mid_desc> des [This.GetSpeciesNamePlural]" (e.g. "Fédération démocratique des Humains") or "<democratic_gen> <democratic_mil_mid_desc> [This.GetSpeciesAdj]e" (e.g. "Fédération démocratique humaine"). Note how the "e" suffix I added may lead to errors, as I'm not sure (yet) that the key names are always feminine singular.

Random empire name parts generator:
/common/random_names/00_empire_formats.txt
  • The head of this file contains list of name parts: key names and descriptives (both prefixed or middle in English) to be randomly chosen according to the empire format composition formula. First work is to translate (and eventually add) all the strings inside "", as you guessed it already.
  • How does the random generator exactly works is only a guess, but let's try. When an empire format calls for a script here, it provides a key and only the empire_name_parts_list scripts that share the same key are used. In vanilla file, there's only one list per key. The figures are the weights associated with name parts. A localizator could rightfully question some weights; I didn't. When the dices are rolled, a name part is chosen, using the weights as compared to their sum in this list. The script ends, returning this string value to the calling script, that is... in the same file, to assess the value of the key defined in the other file.
  • You can also split parts lits, as German modders and I did. Although I don't know if this is really required, you have then to split formats in empire_formats.yml, because one key is likely to correspond only one parts list. Anyways, AFAIK, this separation is the only way to get proper grammar accord compliance in the end. Then, you may want to keep weights for individual name parts as close to vanilla weights as possible (German modders didn't). It's "quite" simple to implement this by altering the "add" values, given how ratios and probabilities work.
- Democratic Military 5 script needs to assess format.dem_mil.5 value, that needs to call the random generator twice in a row: first time with the democratic_gen key and parts list, second time with the democratic_mil_mid_desc key and parts list.

- democratic_gen: sum of the 20 weights is (3x7 + 1x13 =) 34; "Council" thus has 1 chance out of 34 (3%) to be chosen, while "Republic" has 3/34 (8.8%) to be chosen (the seven most weighted names have 21/34 (62%) to be chosen).

- democratic_mil_mid_desc: given the weights, "Democratic" has a 7% chance of being chosen (it would be 12.5% for a materialist democracy).

- all in all, we should have a 3%*7% = 0.21% chance of drawing "Human Democratic Council".

- note that I followed German modders in splitting parts lists according to their parts' gender and number (masculine, masculine plural, feminine, feminine plural). I plan on splitting them further according to their initial letter (vowel/consonnant) in order to settle the irritating case of "La Accord Stellaire de Terra".

- as I said, you have to split format composition formulae in /localisation_synced/empire_formats.yml as well. In case you also want to keep vanilla global weights, you have to consider chances of drawing a masculine singular name, etc. For example, you may want that "la Fédération"/"der Verband" roughly keeps the same weight as "the Confederation" in English for the same Democratic Military 5 authority. My guess is that changing the "add = " lines in the Empire format generator, and keeping the weights in the parts lists as they are, does the trick. I have no tested this, however. For instance, in French, the 20 names in the democratic_gen parts list (total vanilla weight of 34) are separated into 5 masculine singular names (total vanilla weight of 5) and 15 feminine singular names (total vanilla weight of 29), in two new lists, corresponding two new keys: democratic_gen_masc and democratic_gen_fem. Vanilla chance for a masculine name in democratic_gen_masc is 5/34; vanilla chance for a feminine name in democratic_gen is 29/34. We have a 2/15 vanilla chance of drawing Democratic Military 5. We want to have this same 2/15*5/34 chance of drawing a masculine singular name for that format...

I know this is quite a long text to read, full of not always accurate jargon ('script' or 'scripted key'?), but you should then be able to properly localize your game.
As you begin, I think that reading another of wall of text could benefit you.



PS: if you are ready to invest some time, I could hand all my files to you, in order to alphatest, criticize, and co-edit them. My goal is to submit them to Paradox, at least for the 46 lacking localized files in /common/ and /localisation_synced/, not to build yet another localization mod. I understand if you want to train on your own files at first, or instead.
 
Last edited:
Wow thank you so much ! Very complete answer !

Don't worry, I've already found some localizations mod files that helped me to understand a bit more all this setup.

Now lets get back to work !