• 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.

dasaard200

Major
10 Badges
Feb 3, 2017
728
157
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Field Marshal
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: La Resistance
  • Battle for Bosporus
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
I need a list of STATES and the number of provinces within that state .
It should read like this : Volkov (??) ; as some states range from itty, bitty 1 tile islands, to HUGE tracts of land like Siberia ...
Anybody know how to find such a listing ??

Right now, I'm watching Germany's AI tear through Soviet AI like a chainsaw on a microwaved chicken !
 
Mr_Dimento, I am glad that I made your day gloriously happy !

I found that list, and it was almost complete; except for province count in state .
Somebody's going to have to fix that ...
 
Mr_Dimento, I am glad that I made your day gloriously happy !

I found that list, and it was almost complete; except for province count in state .
Somebody's going to have to fix that ...
If the template gets changed to fit, people might gradually fill it up. At nearly 800 provinces, it's a bit too much labor for a single person to do it all in one go, at least as far as most hobbyists are concerned.
 
I got sidetracked in-game watching the Germans turn the corner of Poland (neutral, and still IS), in Feb'40, for a frosty Barbarossa; and started to track German AI vs. Soviet AI, as the '41 summer offensive kicked off [28/jun/41] on a weekly peek ...by [11/nov/41] Soviet #3 capital, Leningrad is cut off from ANY hope of rescue, leaving the rest of Soviet troops out-of-supply and S-O-L .

That said, I hadn't expected to run into VOLOGDA with its 60+ provinces !!
 
Mr_Dimento, I am glad that I made your day gloriously happy !

I found that list, and it was almost complete; except for province count in state .
Somebody's going to have to fix that ...

@dasaard200

If you would provide a spreadsheet type list of the province counts by state, then I would be willing to update the wiki country list.
 
@Mister Analyst I got the script working and added the province count, with the following caveats:
  • the script still does not recognize cosmetic tags (Manchukou, Dutch East Indies, etc.) and uses the free country names instead (Qing China, Indonesia etc.)
  • the population numbers the script takes out of the files are very slightly different to the current wiki numbers for all states, not sure which ones are correct
  • the script reports the base resource amount, excluding infrastructure bonuses (this one should be fixable)
I pasted the current output here until these differences are sorted: https://hoi4.paradoxwikis.com/User:Bitmode/List_of_states

Edit: wiki is acting up again with access denied, so I'll drop the creation notes here for now before I forget
Code:
The table is auto-generated, using the script from: https://github.com/ajul/pyradox/blob/master/scripts/hoi4/states.py with the following diff:
 <nowiki>diff --git a/pyradox/config.py b/pyradox/config.py
index fbf4208..4a86010 100644
--- a/pyradox/config.py
+++ b/pyradox/config.py
@@ -10,7 +10,7 @@ prefixes = [
     r'/Program Files*/Steam/steamapps/common/', # windows
     r'/Steam/steamapps/common/',
     r'~/Library/Application Support/Steam/steamapps/common/', # mac
-    r'~/*steam/steam/SteamApps/common', # linux
+    r'/home/*/.steam/steam/steamapps/common', # linux
 ]
 
 game_suffixes = {
diff --git a/pyradox/filetype/table.py b/pyradox/filetype/table.py
index 1c8c842..2c97a09 100644
--- a/pyradox/filetype/table.py
+++ b/pyradox/filetype/table.py
@@ -86,7 +86,7 @@ def guess_is_numeric(s):
         return True
      
     try:
-        float(s)
+        float(s.replace(',', ''))
     except ValueError:
         return False
     return True
diff --git a/scripts/hoi4/states.py b/scripts/hoi4/states.py
index eb64293..e8feee8 100644
--- a/scripts/hoi4/states.py
+++ b/scripts/hoi4/states.py
@@ -26,7 +26,9 @@ for filename, country in pyradox.txt.parse_dir(('history', 'countries'), game =
     country = country.at_time(date)
     tag, name = compute_country_tag_and_name(filename)
     country['tag'] = tag
-    ruling_party = country['set_politics']['ruling_party'] or 'neutrality'
+    ruling_party = 'neutrality'
+    if country['set_politics']:
+        ruling_party = country['set_politics']['ruling_party']
 
     country['name'] = pyradox.yml.get_localisation('%s_%s' % (tag, ruling_party), game = game)
     countries[tag] = country
@@ -43,6 +45,7 @@ for state in states.values():
     state['owner'] = history['owner']
     state['owner_name'] = countries[history['owner']]['name']
     state['human_name'] = pyradox.yml.get_localisation(state['name'], game = game)
+    state['provine_count'] = state.count('provinces')
     country = countries[tag]
 
     country['states'] = (country['states'] or 0) + 1
@@ -78,7 +81,8 @@ columns = (
     ('Country', '{{flag|%(owner_name)s}}'),
     ('Tag', '%(owner)s'),
     ('{{Icon|vp}}', '%(victory_point_total)d'),
-    ('{{Icon|pop|(M)}}', lambda k, v: '%0.2f' % ((v['manpower'] or 0) / 1e6) ),
+    ('Provinces', '%(provine_count)d'),
+    ('{{Icon|pop|}}', lambda key, row: '{:,}'.format(row['manpower'])),
     ('{{Icon|infra}}', '%(infrastructure)d'),
     ('State category', '%(state_category)s'),
     ('{{Icon|Building slot}}', '%(building_slots)d'),</nowiki>
 
Last edited:
All the states are also in the game files (History -> States).
For example, here's what Poznan looks like:
Code:
state={
    id=86
    name="STATE_86"
    manpower = 2106500
    
    
    state_category = city
    history={
        owner = POL
        victory_points = {
            6558 10
        }
        buildings = {
            infrastructure = 6
            industrial_complex = 1
            11232 = {
                bunker = 1

            }
            9532 = {
                bunker = 1

            }
            3381 = {
                bunker = 1

            }
            air_base = 3
        }
        add_core_of = POL
        1938.3.12 = {
            add_claim_by = GER
        }
    }

    provinces={
        17 388 3381 3460 3532 6558 9532 11232 11558
    }
}
 
@bitmode & @dasaard200

I currently lack the skill to work scripts.

My current method is "old school" which does not involve scripts. It involves the creation of a master Excel workbook via a combination of game text file conversions (includes history file), wiki download conversions, and in-game confirmation. I used this master Excel workbook as a reference to update the wiki countries list and states list line by line to HOI4 version 1.7. This method is tedious, but it works for me.

I am now in the process of adding the provinces to the master workbook. The progress has been quite slow, due to the massive amount of data, and it is not even half done. Therefore, I am not in a position to perform the province counts, but am willing to add the province counts to the wiki countries and/or states list if someone provides them.

I have also created some smaller supporting Excel spreadsheets to proof the master workbook. These were created taking the existing game files and converting them via text file to csv file to xlxs files. The supporting files are rocket sites, airports, supply areas, and strategic regions. I am considering adding these to the wiki. Do either of you think that there is a use for these smaller supporting excel spreadsheets to be incorporated into the HOI4 wiki?
 
I currently lack the skill to work scripts.

My current method is "old school" which does not involve scripts. It involves the creation of a master Excel workbook via a combination of game text file conversions (includes history file), wiki download conversions, and in-game confirmation. I used this master Excel workbook as a reference to update the wiki countries list and states list line by line to HOI4 version 1.7. This method is tedious, but it works for me.
I know, I saw it in the edit log. This is why I proposed to use the script again, to make the process much less tedious, and went on to update it.

I was just asking about the remaining differences in the output. If the consensus is that they are important, I'll try to further update the script to match the current state of the page more closely, while @dasaard200 already has the desired province numbers in the mean time.

For the population counts, the game seems to do a monthly growth right at the start of the game, which may or may not be a bug.

I have also created some smaller supporting Excel spreadsheets to proof the master workbook. These were created taking the existing game files and converting them via text file to csv file to xlxs files. The supporting files are rocket sites, airports, supply areas, and strategic regions. I am considering adding these to the wiki. Do either of you think that there is a use for these smaller supporting excel spreadsheets to be incorporated into the HOI4 wiki?
I think there's not too much value in those extra pages, especially in list form. Showing the province IDs of rocket sites/air ports is only useful with the console command goto_province. Supply areas are more interesting because not all of them are visible in the game by default, but without having the visual information where they are and what they are adjacent to doesn't seem useful to me. Apart from their weather patterns, the only thing to be said about strategic regions is which states they contain, right? There is also the area of the region, which is used in air superiority. I think it needs be extracted out of the map images though.
 
BY THE HAIR of the SMOKING FISH, my eyes are tired !!

I think I have all but NW Siberia and NE Siberia states listed with provincial counts; it may be somewhat scatter-shot, but here are 96 states, NOT in alphabetical order :

ODESSA-9, VINNYTSIA-7, KHMELNYTSKYI-6, ZHYTOMYR-12, MOZYR-10, BOBRUYSK-8, MINSK-10, VITEBSK-11, NEVEL-13, PSKOV-12, LUGA-12, LENINGRAD-5, VOLKOV--8, NOVGOROD-14, SMOLENSK-16, ROSLAVL-9, GOMEL-13, KIEV-11, CHERKASY-14, MIKOLAIV-7, DNIPROPETROVSK-12,KHERSON-8, ZAPOROZHE-9, POLTAVA-10,CHERNIGOV-14, BRYANSK-17, RZHEV-24, TIKHVIN-27, OLONETS-19, ONEGA-35, MURMANSK-34, ARCHANGELSK-43, VOLOGDA-71, KALININ-17, MOSCOW-25, KALUGA-16, OREL-13, TULA-14, SUMY-11, KURSK-14, BELGORAD-13, KHARKOV-11, STALINO-10, VIROSHILOVGRAD-10, ROSTOV-8, CRIMEA-9, KRASNODAR-26, VOLGODONSK-19, MILLEROVO-19, MIKHAYLOVKA-23, SARATOV-25, STALINGRAD-20, STAVROPOL-23, CAUCAUSUS MTN,-19, GEORGIA-18, GROZNY-18, ARMENIA-9, AZARBAIJAN-17, ELISTA-19, ASTRAKHAN-20, GURYEV-19, URAL'SK40, EMGELS-24, ORENBURG-25, UFA-18, KAZAN-28, LIPETSK-17, RYAZAN-24, IVANOVO-31, YAROSLAVL-23, TAMBOV-19, GORKI-37, CHERBOKSARY-25, PENZA-31, ULYANOVSKY-20, KUIBYSHEV-19, KIROV-57, IZHEVSK-21, SYKTYVKAR-22, PERM-29, ZLATOUST-13, MAGNITOGORSK-17, AKTOBINSK-32, UST URT-12, ASHKHABAD-28, N.URALS-10, PECHORA-19, VORONEZH-21, URGRENCH-25, SAEKHARD-8, TOBOLSK-19, SVERDLOSK-21, CHELYBINSK-15, KUSTANAY-27, KYZYL ORDA-40, TASHKENT-12, STALINABA-12, PAMIR-17, ALMA-ATA-10, AYAGUZ-17, AKMOLINSK-28, TYUMEN-19, SURGUT-19, TOMSK-23, OMSK-11, SEMIPALATINSK-29, BARNAUL-12, GOMO-ALTAYSK-5, KEMEROVO-14, KRASNOYZRSK-16, YEMISEISK-25, BRATSK-18, IRKUTSK-15, KIRENSK-13, YAKUTSK-24, OKOTSK-14, KAMCHATKA-6, BODAYBO-15, ULAN UDE-12, CHITA-16, AMUR-14, NIKOLAYEUSK-18, BIROBIDZHAN-19, KHABAROVOSK-24, VLADIVOSTOK-31 . !!

Somebody else, of a kindness, can count trees in NW Siberia and NE Siberia !!!
Anyhoo, that's my list and it took damn near all day ; I hope it is good enough for the Wikilist .
 
Last edited:
I am NOT very 'computer literate', so old school is fine by me (pre- APOLLO era); I got the computer for games !

For @bitmode, I was going originally by the German AI spread v. Soviet AI, as of 1 January,42; and then kinda went whole-hog doing states, first to the edge of G. spread, then to the Urals, then to Capital #4 Vladivostok .
I might've missed some states, I'm not sure .
No, I had not seen your listing; I had looked up on Wiki 'states' page, but there were no province counts ... yet .
 
Last edited:
@bitmode

Nice work on adding the province count to the list of states!
Thanks, but before I copy it into the real page I'm still looking for opinions on above points:
  • the script generated version does not use cosmetic names/flags (Manchukou, Dutch East Indies etc.) and afaict it would be a big pain to integrate those. Should we manually fix up those names after each update or do we just leave the non-cosmetic names (Qing China, Indonesia etc.) as the script produces them?
  • The population numbers are off by 0.12% compared to what they currently are at the start of the game. Should I multiply the numbers in the script with 1.0012 or is it too small to matter?
  • Should the table report the base resource amounts or the infrastructure-modified amounts? I could see use cases for both, but the table realistically only fits one or the other
 
Thanks, but before I copy it into the real page I'm still looking for opinions on above points:
  • the script generated version does not use cosmetic names/flags (Manchukou, Dutch East Indies etc.) and afaict it would be a big pain to integrate those. Should we manually fix up those names after each update or do we just leave the non-cosmetic names (Qing China, Indonesia etc.) as the script produces them?
  • The population numbers are off by 0.12% compared to what they currently are at the start of the game. Should I multiply the numbers in the script with 1.0012 or is it too small to matter?
  • Should the table report the base resource amounts or the infrastructure-modified amounts? I could see use cases for both, but the table realistically only fits one or the other
@bitmode

All good questions. In my opinion, the tables should reflect what the game screen presents to the user at game start.

It would seem to depend on a number of factors such as who is the audience (gamers or modders)? Gamers would probably want to see the information as it shows on screen while modders would probably want the base information. Another factor is which wiki volunteers will be doing the updates and what is their skill level? Scripts can be a great timesaver, but most people do not have the skill and would prefer to manually update the wiki (myself included).

Are the population numbers actually off by 0.12% or is it closer to 0.125% as that is the monthly growth reported by the wiki per https://hoi4.paradoxwikis.com/State#Population. At any rate, the population figures that I had previously edited on the wiki country list were in the form of xx,xxx,xxx and the wiki moderators revised every figure to x.xxM (the wiki moderators left the list of states population in the form of xx,xxx,xxx). My conclusion is that more precise numbers would be rounded by the wiki moderators anyway.

However, extra columns could be added to the tables to accommodate both gamers and modders. A column each for "base population", "starting population", "base resources", and "starting resources" could be added. An alternative would be to talk to the wiki moderators and get an agreement to post an extra columns expanded precision table with that information on the modders section of the wiki only. The modders tables may also be more technical such as having columns for "locked" manpower, "total" manpoower, and "history" (game start) manpower.
 
It would seem to depend on a number of factors such as who is the audience (gamers or modders)? Gamers would probably want to see the information as it shows on screen while modders would probably want the base information.
I think we can disregard modders here, because they might just as well look at the files themselves? Then again I didn't know why players would want to look at such a list either until dasaard200 asked about it :p
Guess I'll just use the effective numbers then.
Another factor is which wiki volunteers will be doing the updates and what is their skill level? Scripts can be a great timesaver, but most people do not have the skill and would prefer to manually update the wiki (myself included).
Looking at the revision history, there don't seem to be many people manually editing it, apart from fixing the cosmetic tags repeatedly. But the data should definitely not be in a format that requires running a script to update it.


Are the population numbers actually off by 0.12% or is it closer to 0.125% as that is the monthly growth reported by the wiki per https://hoi4.paradoxwikis.com/State#Population.
Yes, it's exactly one monthly growth of difference between the files and the in-game start.
At any rate, the population figures that I had previously edited on the wiki country list were in the form of xx,xxx,xxx and the wiki moderators revised every figure to x.xxM (the wiki moderators left the list of states population in the form of xx,xxx,xxx). My conclusion is that more precise numbers would be rounded by the wiki moderators anyway.
I suspect the moderators were just using a script too, which outputs the numbers in millions by default. There's one for countries as well if memory serves. In my opinion, millions as a unit doesn't make too much sense for states as about half are below 1 million, causing leading zeros. xx,xxx,xxx on the other hand makes the column slightly wider, with horizontal space at a premium in this table. Using thousands as units and discarding the fractional part for large numbers would be another option.

Btw, I would also ditch the "tag" column to save some space because it has no real purpose here. People who know the tags should also know the real names of countries.
However, extra columns could be added to the tables to accommodate both gamers and modders. A column each for "base population", "starting population", "base resources", and "starting resources" could be added. An alternative would be to talk to the wiki moderators and get an agreement to post an extra columns expanded precision table with that information on the modders section of the wiki only. The modders tables may also be more technical such as having columns for "locked" manpower, "total" manpoower, and "history" (game start) manpower.
As noted above I wouldn't add anything for modders here because I don't expect a demand for it. The population numbers are too close to each other to warrant two columns anyway. Adding six more columns for resources sounds like a lot and might be confusing, but I'll try how it looks like. In that case I'd use the maximum resource amounts (infra 10) instead of base, because that's the application of the base value that matters to the player.

For @Mister Analyst and @bitmode,
Did I miss any USSR states beyond NE and NW Siberia ?
Comparing your list (ignoring typos) with the table, you missed the following:
  • north sakhalin
  • northeast siberia
  • northwest siberia
  • novosibirsk
If your goal was to get the total number of victory points in the Soviet Union, you can also just use the console command "tdebug" and hover over the country, which shows that the Soviet Union has 7749 VP total.
 
Last edited: