Victoria 3

Victoria 3

View Stats:
Moid Mar 17, 2023 @ 5:33pm
2
3
4
Sorry, But No Modern Day Mods for Victoria 3: Simple Oversight by Paradox Limiting Modding Possibilities
TL;DR: The game doesn't like numbers larger than 2.1 billion. This makes it impossible to model realistic figures for population, GDP, etc., meaning no modern day or Cold War mods will be possible without some ugly abstraction.

I am a member of a large team currently working on a total conversion modding project for Victoria 3. We have put a significant amount of work into this project throughout a year-plus of conceptualizing and designing systems that we wanted to realize in Victoria 3 upon release. (That's not really important, but just an explanation for how we've come to figure this out and why we decided to post this.)

Imagine a situation in which you want to utilize figures that may have a number larger than 2.1 billion. This figure can represent a nation's GDP, or the population of a country, or some other concept. For example, consider the context of a modern day mod, where the Earth has a population of over 7 billion, and some countries have GDPs reaching into the tens of trillions.

In Victoria 3, this is impossible to model. Why?

Complex explanation: Some variables used in the game logic to hold data, most pertinently variables which store population data, are 32-bit signed integers. These variable cannot store a number larger than 2,147,483,647. If that variable's stored data surpasses that figure, then the number overflows and "wraps" into a negative number. When this occurs, this breaks the game.

Simplified explanation: due to a programmer's decision, the 'population' or the 'GDP' value in your game cannot handle a number of that size, and it bugs out in a way that breaks the game.

How is this fixed?

For a value that can be represented without decimal points (like a human population), the variable data type is changed from an integer into a long. A long has a maximum value of 9,223,372,036,854,775,807 (that's nine quintillion), which would solve all overflow issues for any reasonably-scaled mod.

Why should I care?

Modern day mods and Cold War mods are some of the most exciting possibilities in Victoria 3's modding community. The ability to manage a complex economy with its supply chains, and interact with the politics that drive these nations are salient with the long-requested features for a Paradox Cold War title.

Without the ability to truly represent the figures necessary for balancing and populating the countries in this timeframe, these mods will simply not be able to express the scale of the period.
The most creative modders would have to rely on abstractions as seen in Stellaris, where populations of billions are represented by single 'pops', and manage to rebalance all other aspects of the mod (trade good prices, employment figures, GDP per capita, etc) to match that abstraction. That is a tall ask, and not quite what most people want in a realistic simulator.

Is there anything we can do ourselves to solve this issue?

No, other than the abstraction detailed above. This is not an issue that can be edited away by a modder working in the game directory files.

Anything else worth sharing?

I strongly recommend everyone take a dive into Victoria 3 modding. Try experimenting with some new features and see what you can create. The new modding system in Victoria 3 is woefully undocumented; so it'd be great to see some more community resources, some new innovations and some workarounds for these kinds of issues.
Last edited by Moid; Mar 17, 2023 @ 5:34pm
< >
Showing 1-15 of 18 comments
MUR Mar 17, 2023 @ 5:35pm 
Thank you for your hard work and dedication. I hope Paradox takes your suggestions to heart and makes the necessary fixes.
grandmuff Mar 17, 2023 @ 5:39pm 
A shame, I was greatly looking forward to the Victoria 3 Modern Day mod. I hope that Paradox can solve the issues you've mentioned in order to allow for the mod, and other mods that would benefit from such changes, to be able to function in full capacity.
lazycat519 Mar 17, 2023 @ 5:44pm 
As a member of Moid's innovative team, I absolutely CANNOT stress enough how much this suggestion rings true and would revolutionize the Victoria modding community FOREVER. Please read this post -- then read it again!
Don't care. If your mod isn't on LoversLab, It ain't ♥♥♥♥.
Burma Jones Mar 17, 2023 @ 5:44pm 
Thanks for all the work and thought you put into this. This is bad news, even mods are hamstrung from making the game better. =\
Lemurian Starseed Mar 17, 2023 @ 5:44pm 
As a contributor to the Victoria III Modern Day Project Mod, I must wholeheartedly concur with the OP (Original Poster.) Unfortunately, it is simply unfeasible to model the intricacies of the modern day within the structure of Victoria III. I regret wasting my time on this; for it seems Victoria III cannot even handle the Victorian Era.
Mick9330 Mar 18, 2023 @ 10:02am 
Originally posted by Moid:
TL;DR: The game doesn't like numbers larger than 2.1 billion. This makes it impossible to model realistic figures for population, GDP, etc., meaning no modern day or Cold War mods will be possible without some ugly abstraction.

I am a member of a large team currently working on a total conversion modding project for Victoria 3. We have put a significant amount of work into this project throughout a year-plus of conceptualizing and designing systems that we wanted to realize in Victoria 3 upon release. (That's not really important, but just an explanation for how we've come to figure this out and why we decided to post this.)

Imagine a situation in which you want to utilize figures that may have a number larger than 2.1 billion. This figure can represent a nation's GDP, or the population of a country, or some other concept. For example, consider the context of a modern day mod, where the Earth has a population of over 7 billion, and some countries have GDPs reaching into the tens of trillions.

In Victoria 3, this is impossible to model. Why?

Complex explanation: Some variables used in the game logic to hold data, most pertinently variables which store population data, are 32-bit signed integers. These variable cannot store a number larger than 2,147,483,647. If that variable's stored data surpasses that figure, then the number overflows and "wraps" into a negative number. When this occurs, this breaks the game.

Simplified explanation: due to a programmer's decision, the 'population' or the 'GDP' value in your game cannot handle a number of that size, and it bugs out in a way that breaks the game.

How is this fixed?

For a value that can be represented without decimal points (like a human population), the variable data type is changed from an integer into a long. A long has a maximum value of 9,223,372,036,854,775,807 (that's nine quintillion), which would solve all overflow issues for any reasonably-scaled mod.

Why should I care?

Modern day mods and Cold War mods are some of the most exciting possibilities in Victoria 3's modding community. The ability to manage a complex economy with its supply chains, and interact with the politics that drive these nations are salient with the long-requested features for a Paradox Cold War title.

Without the ability to truly represent the figures necessary for balancing and populating the countries in this timeframe, these mods will simply not be able to express the scale of the period.
The most creative modders would have to rely on abstractions as seen in Stellaris, where populations of billions are represented by single 'pops', and manage to rebalance all other aspects of the mod (trade good prices, employment figures, GDP per capita, etc) to match that abstraction. That is a tall ask, and not quite what most people want in a realistic simulator.

Is there anything we can do ourselves to solve this issue?

No, other than the abstraction detailed above. This is not an issue that can be edited away by a modder working in the game directory files.

Anything else worth sharing?

I strongly recommend everyone take a dive into Victoria 3 modding. Try experimenting with some new features and see what you can create. The new modding system in Victoria 3 is woefully undocumented; so it'd be great to see some more community resources, some new innovations and some workarounds for these kinds of issues.

Ah, like CoD zombies. Yeah, Paradox coding is hit or miss. But that's a really bad error. 2 Billion people were on earth around 1936. So the game literally willdie at the end if the growth is modeled accurately.

I would say there's a few ways to go about this. Either, cut out all other pops besides working pops to count for what pops are, or perhaps have an event that reduces world populations but gives countries bonuses based on how much they had, to somehow model it like they have more. Probably better ideas, these are just what I thought on top of my head.

The best solution is like you said though, changing the values to long-integers.
Inquerion Mar 18, 2023 @ 11:25am 
Originally posted by Moid:
TL;DR: The game doesn't like numbers larger than 2.1 billion. This makes it impossible to model realistic figures for population, GDP, etc., meaning no modern day or Cold War mods will be possible without some ugly abstraction.

I am a member of a large team currently working on a total conversion modding project for Victoria 3. We have put a significant amount of work into this project throughout a year-plus of conceptualizing and designing systems that we wanted to realize in Victoria 3 upon release. (That's not really important, but just an explanation for how we've come to figure this out and why we decided to post this.)

Imagine a situation in which you want to utilize figures that may have a number larger than 2.1 billion. This figure can represent a nation's GDP, or the population of a country, or some other concept. For example, consider the context of a modern day mod, where the Earth has a population of over 7 billion, and some countries have GDPs reaching into the tens of trillions.

In Victoria 3, this is impossible to model. Why?

Complex explanation: Some variables used in the game logic to hold data, most pertinently variables which store population data, are 32-bit signed integers. These variable cannot store a number larger than 2,147,483,647. If that variable's stored data surpasses that figure, then the number overflows and "wraps" into a negative number. When this occurs, this breaks the game.

Simplified explanation: due to a programmer's decision, the 'population' or the 'GDP' value in your game cannot handle a number of that size, and it bugs out in a way that breaks the game.

How is this fixed?

For a value that can be represented without decimal points (like a human population), the variable data type is changed from an integer into a long. A long has a maximum value of 9,223,372,036,854,775,807 (that's nine quintillion), which would solve all overflow issues for any reasonably-scaled mod.

Why should I care?

Modern day mods and Cold War mods are some of the most exciting possibilities in Victoria 3's modding community. The ability to manage a complex economy with its supply chains, and interact with the politics that drive these nations are salient with the long-requested features for a Paradox Cold War title.

Without the ability to truly represent the figures necessary for balancing and populating the countries in this timeframe, these mods will simply not be able to express the scale of the period.
The most creative modders would have to rely on abstractions as seen in Stellaris, where populations of billions are represented by single 'pops', and manage to rebalance all other aspects of the mod (trade good prices, employment figures, GDP per capita, etc) to match that abstraction. That is a tall ask, and not quite what most people want in a realistic simulator.

Is there anything we can do ourselves to solve this issue?

No, other than the abstraction detailed above. This is not an issue that can be edited away by a modder working in the game directory files.

Anything else worth sharing?

I strongly recommend everyone take a dive into Victoria 3 modding. Try experimenting with some new features and see what you can create. The new modding system in Victoria 3 is woefully undocumented; so it'd be great to see some more community resources, some new innovations and some workarounds for these kinds of issues.

@Moid
You should put that on their official forum. Devs don't read Steam forums.

Thanks for your dedication. I love mods.

Sad to hear that Cold War/Modern Day Mods are not really possible for Victoria 3.

For example, Victoria 2 Cold War Mod is already good, but is also limited by modding limitations in that very old version of Clausewitz Engine.

Similar story with Modern Day Mod for Hearts of Iron 4 (this particular mod also suffers from overcomplicated economy that can't be really properly represented by Hoi4 UI).

I thought that Victoria 3 will be perfect for Modern Day/Cold War era since it's already focusing on economy so much. Sad to hear about these modding limitations in V3.
Last edited by Inquerion; Mar 18, 2023 @ 11:26am
slovenian89 Mar 19, 2023 @ 12:01am 
Yeah, I would definitely post this on their official forums. I was under the impression that this is a problem on their engine, I recall things overflowing in HoI4 as well - I distinctly recall having infantry weapons overflowing to the negatives. Hopefully this can be fixed because I was really hoping for a good Cold War or Modern Day mod for Victoria 3! Appreciate the modders a ton!
gotaa Mar 19, 2023 @ 9:30am 
Originally posted by Mick9330:
Ah, like CoD zombies. Yeah, Paradox coding is hit or miss. But that's a really bad error. 2 Billion people were on earth around 1936. So the game literally willdie at the end if the growth is modeled accurately.

My guess is that the data is never combined into some sort of total population value (as an integer) ever, so it's less of a problem. Theoretically (assuming pop growth never stops) a single country's population in the game could pass the integer limit and cause an overflow, that is unlikely to happen though between the start date and the end date.

I'm sad to hear about this technical limitation since I was waiting for a modern day mod for this game.

If one wants some more perspective; the US GDP today is $25 trillion in size. That is 2500 billion. In Victoria 3; reaching a 1 billion GDP (1000 million) is considered a feat (you get an achievement for reaching it).
Last edited by gotaa; Mar 19, 2023 @ 9:38am
Moid Mar 19, 2023 @ 10:33am 
Originally posted by gotaa:
Originally posted by Mick9330:
Ah, like CoD zombies. Yeah, Paradox coding is hit or miss. But that's a really bad error. 2 Billion people were on earth around 1936. So the game literally willdie at the end if the growth is modeled accurately.

My guess is that the data is never combined into some sort of total population value (as an integer) ever, so it's less of a problem. Theoretically (assuming pop growth never stops) a single country's population in the game could pass the integer limit and cause an overflow, that is unlikely to happen though between the start date and the end date.

I'm sad to hear about this technical limitation since I was waiting for a modern day mod for this game.

If one wants some more perspective; the US GDP today is $25 trillion in size. That is 2500 billion. In Victoria 3; reaching a 1 billion GDP (1000 million) is considered a feat (you get an achievement for reaching it).

In terms of total world population, it won't be so much of a problem since that is not a metric that is displayed on screen.

However, imagine a situation where you play as China, or India, and grow your population naturally past the 2.1 billion mark. Or, consider another scenario: you're attempting a world conquest, and conquering 'too much' means you overflow and break the game.

Limitations like this would create hard ceilings on what the player can do in the game, which diminishes the possibilities of a mod of this time period.
Mick9330 Mar 19, 2023 @ 10:55am 
Originally posted by gotaa:
Originally posted by Mick9330:
Ah, like CoD zombies. Yeah, Paradox coding is hit or miss. But that's a really bad error. 2 Billion people were on earth around 1936. So the game literally willdie at the end if the growth is modeled accurately.

My guess is that the data is never combined into some sort of total population value (as an integer) ever, so it's less of a problem. Theoretically (assuming pop growth never stops) a single country's population in the game could pass the integer limit and cause an overflow, that is unlikely to happen though between the start date and the end date.

I'm sad to hear about this technical limitation since I was waiting for a modern day mod for this game.

If one wants some more perspective; the US GDP today is $25 trillion in size. That is 2500 billion. In Victoria 3; reaching a 1 billion GDP (1000 million) is considered a feat (you get an achievement for reaching it).

Yes this is true, but I assumed population had its own signed integer value and others had larger values. If its true all of it is based off of signed integers, it makes me question Paradox's people beyond how I already question them. That's a huge oversight in that case.
HyperCynic Mar 19, 2023 @ 12:00pm 
Is it not possible to simply scale to 4 or 5 digit long numbers to represent the various elements? Is it truly necessary to calculate every last individual person and dollar to make a balanced experience? Simply listing values as "Per 1000" or whatever amount is decided, is how most games deal with large numbers. It's not really necessary to exponentially inflate the calculations to 11+digits in value if there isn't a specific need for it.

Do they actually represent GDP or population in exact numbers? I would assume all values are truncated by at least 3 digits or more. Then again, I haven't coded in years so maybe I'm old and thinking too archaically. If I were to code a game like this with tens of thousands of numerical values changing constantly though, I would be rounding them all to the smallest digits necessary to represent a change you can really "feel" in the game.

Again, maybe I'm missing something here.
Grahor Mar 19, 2023 @ 3:35pm 
Originally posted by HyperCynic:
Is it not possible to simply scale to 4 or 5 digit long numbers to represent the various elements?
Again, maybe I'm missing something here.

It all depends on how the game is structured and how much of its structure is hardcoded, but broadly speaking, adding the level of abstraction should provide necessary workarounds. There are no nations on Earth with GDP smaller than 50 millions per year, so, say, making the smallest unit of GDP equal to 1 mil, whole world's GDP would comfortably fit into 2.1 billion number. And so on.

This abstraction level complicates coding, but I'm pretty sure it is already implemented in the main game anyway, because it's just simpler to model large systems using approximations rather than real numbers.

I'm not sure about the reason for that limit, but generally the smaller the number is, the less demanding it is on processor and memory and faster any calculations with it work. If it is a concern, and it probably is, "simple" switching to another cathegory may make calculations work 10 to 1000 times slower and, say, AI turns similarly longer.

Anyway, I'm pretty sure, at that point nobody in their right mind will even consider switching something such basic and low-level engine's architecture decision as variable sizes. Who knows how game engine will even react to such change? What unintended consequences will emerge? Are people making that decision and coding it into the first iteration of the engine even work in the company, still?

Considering how many executive meetings and brainstorms of the whole team happen when similar decisions are made in the field where I work, I'd rather think the team's decision would be "this limitation is supposed to be overcome through abstraction layer, it's not really hard, deal with it."
Jeffy Nov 16, 2023 @ 1:38am 
Has this been resolved with latest patches?
< >
Showing 1-15 of 18 comments
Per page: 1530 50

Date Posted: Mar 17, 2023 @ 5:33pm
Posts: 18