Imperator Development Diary - 15th of April

  • 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.
HOI4 has something called "targeted variables". It's something that allows you to create a variable that's targeted at each country. For example, if someone wanted to add "country opinion" variable. They could and it would work as root.country_opinion@target (target can be any country id or prev/this etc..) and the value of country opinion would change dynamically based on the target country. Is such thing possible in Imperator Rome or can it be done differently?

Also what is the difference between Data System and Scripted GUI? Does the Data System control what's already available in the GUI? Or can you create new GUI/buttons via the Data System?

I hope it's possible to change GUI mechanics or create new buttons via the Data System. Because if the AI can't use Scripted GUI I don't see much use for it at least not yet (I assume AI support may be added later). Some actions would be scope based (like selected state) and it would be hard to trigger them by events for the AI.
 
Last edited:
@Trin Tragula @Meneth @blackninja9939

Is it possible to alter a country's name and flag without changing its tag, similar to Victoria 2?

E.g.: Having a 'Rome' tag with SPQR as its name and flag, and then changing it by event to Imperium Romanum with an eagle flag
 
Wow this is going to be so cool I can't wait to see what moders will be able to do with this.
 
That last one is hilarious. It basically says:
"We have determined that our country sucks, so it's best we give up and pretend we don't exist."
 
The illustrations are gorgeous, but why is the UI so drab and boring?
 
Though the script math is internally done 64-bit rather than 32-bit, and has a max value a bit short of 300 trillion. So briefly going above 2 million in the middle of some math shouldn't mess things up, but if the final result is out of range it'll log an error and clamp it to the allowed range (+/- 2 million).

Values that are 64-bit support the full range of that, of course.
It's good to hear that the internal math will avoid 32-bit limit, but I'm a bit surprised that 32 bit variables are still being supported if the internal math is all 64 bit. Wouldn't it be less error prone (if potentially more up front work) to move to all 64 bit variables and then set a floor/ceiling on a per variable basis?
 
I have a technical question that does not fit with the modding theme of this dev diary, buy I'm unsure it is gonna fit in any future diary. It is regarding the high density of cities in Imperator. The last EU4 diary mentioned that one of the main loads to the performance of the game was the number of provinces, as each new province had to calculate paths to every other single provinces, they called this "the quadratic problem".

How does Imperator allow for such a high density of cities? Doesn't it have this problem? I might be deceived by the high city density, because Imperator represents from Ireland to India while EU4 represents the whole world, and maybe the number of provinces is comparable between the two games?
 
Will it be possible for the map to change during gameplay? Like Island sinking and becoming uninhabitable? Or landbridges sinking beneath the ocean?
 
Wouldn't be particularly difficult to add, but I'm not sure how likely it is that we'd add it. Those operations (except purely integer powers) are very expensive, so it's something to be avoided. Not supporting it at all ensures it is avoided entirely.
Though if there's interesting use cases, we might reconsider that.
Square roots are necessary in order to calculate distances between provinces (unless there is already a command for that). The MEIOU&Taxes mod for EU4 uses that extensively for determining travel distance and communication efficiency of empires. Of course there is no command for square roots in EU4 either, so it is done with the Babylonian method implemented with variable math.
I imagine that must be at least one or two orders of magnitude slower than using a hardware-accelerated square root, so in this case providing a sqrt method would significantly improve performance of such mods.

There are probably some use cases for powers as well, so if it's not too much effort, implementing both would be very appreciated. You can always warn about the performance cost in the documentation.

Edit: Oh and maybe logarithms as well, if you are doing it. I am certain there will be modders creative enough to find a good use for it. I've seen huge binary search trees in mods (nested if else structures), which one logarithm command could replace.
 
Last edited:
10 more days! All ready! Woohoo! Ok, uh, time for dinner. 10 is a bigger number. 10 more days, um, that’s still more than a week away. Oh wait!

1 week away!!! Woohoo!
 
I hope you guys are in touch with Shultays from the HOI4 development team. He's followed closely the use of Scripted GUIs, Variables in the HOI4 community and made several changes/updates that made them way more handy! I hope he'll have some advice for the new Imperator: Rome :)

But here's a few suggestions, at least based on my experimentation with HOI4 variables and scripted GUIs:
  • Please add targeted variables or something of the sort. They are the most useful aspect of variables at least in my experience, especially when you want to work on diplomacy, espionage or interactions between different countries. The ability to use a variable that has a dynamic value that changes based on the target country is really great.
  • I see that you already added the ability to store countries, characters etc.. inside variables which is great! But please also give us the ability to .GetName or something that can extract the name of what you saved in the variable to show it on the GUI or for localisation purposes.
  • Arrays could be something that's useful for the future too. But I think you already said you're working on it!
 
Super-exciting stuff BlackNinja and Meneth, and all involved :D. The possibilities from that amount of flexibility seem very, very impressive, and the ease with which they can be done very alluring indeed. I don't plan to mod Imperator (I can only mod one game at a time, and HoI4's ships are the best :)), but I imagine systems like this will have enabled easier and more interesting content design, and will allow modders of the game to really cut loose :cool:.
 
Can I suggest a 'hide ui' button on that end game scene? If Imperator is like other PDX games the post-game buzz will linger for a while and using that end-game image as a wallpaper would be a good way to bask in that afterglow, even if the end game image isn't all that unique per playthrough.
 
Can you confirm that everything that preserves checksum is "Ironman friendly" and "Achievement compatibile"? In EU4 this Is True, sadly not in Stellaris.
 
HOI4 has something called "targeted variables". It's something that allows you to create a variable that's targeted at each country. For example, if someone wanted to add "country opinion" variable. They could and it would work as root.country_opinion@target (target can be any country id or prev/this etc..) and the value of country opinion would change dynamically based on the target country. Is such thing possible in Imperator Rome or can it be done differently?

Also what is the difference between Data System and Scripted GUI? Does the Data System control what's already available in the GUI? Or can you create new GUI/buttons via the Data System?

I hope it's possible to change GUI mechanics or create new buttons via the Data System. Because if the AI can't use Scripted GUI I don't see much use for it at least not yet (I assume AI support may be added later). Some actions would be scope based (like selected state) and it would be hard to trigger them by events for the AI.
You got an example of targeted variables? In HoI a variable is a lot more limited in what it can contain, in Jomini a variable can be anything at all so not sure if that would cover your use case already.

The data system is the overarching grander system of everything in the gui and localization. The scripted gui is a specific subset of functions in the gui which link into the script system.
For modding needs the terms are relatively unimportant but for us there is a distinction.

I hope you guys are in touch with Shultays from the HOI4 development team. He's followed closely the use of Scripted GUIs, Variables in the HOI4 community and made several changes/updates that made them way more handy! I hope he'll have some advice for the new Imperator: Rome :)

But here's a few suggestions, at least based on my experimentation with HOI4 variables and scripted GUIs:
  • Please add targeted variables or something of the sort. They are the most useful aspect of variables at least in my experience, especially when you want to work on diplomacy, espionage or interactions between different countries. The ability to use a variable that has a dynamic value that changes based on the target country is really great.
  • I see that you already added the ability to store countries, characters etc.. inside variables which is great! But please also give us the ability to .GetName or something that can extract the name of what you saved in the variable to show it on the GUI or for localisation purposes.
  • Arrays could be something that's useful for the future too. But I think you already said you're working on it!
Yep I've been talking a bit with him, the ability to do GetName etc is gonna be in but not for the first release, I had to work around some stuff to make it happen nicely same for displaying lists.
Arrays already exist in the script albeit called lists to keep them more in line with the script list terminology, I've got a prototype for them being shown in the gui which again will not be in for release but should be in "soon"
 
You got an example of targeted variables? In HoI a variable is a lot more limited in what it can contain, in Jomini a variable can be anything at all so not sure if that would cover your use case already.

The data system is the overarching grander system of everything in the gui and localization. The scripted gui is a specific subset of functions in the gui which link into the script system.
For modding needs the terms are relatively unimportant but for us there is a distinction.


Yep I've been talking a bit with him, the ability to do GetName etc is gonna be in but not for the first release, I had to work around some stuff to make it happen nicely same for displaying lists.
Arrays already exist in the script albeit called lists to keep them more in line with the script list terminology, I've got a prototype for them being shown in the gui which again will not be in for release but should be in "soon"

That's great to know! For targeted variable, it may be already supported in your system. I don't know how different it is, but i'll explain:

An example of the use of targeted variables. For example in my mod, I had to create something that's called "Spy Network Strength" that controls the ability to conduct espionage country in the target country (the variable must be equal to 100). it's kinda like EU4 Spy Network...

The goal is to make sure the variable is unique to each target country. For example France's Spy Network Strength in Germany may be 80, but France's Spy Network Strength in Italy may be 90.

To do that I had to use targeted variables in the scripted GUI that looks sort of like: "ROOT.network_strength@THIS". Root obviously refers to the originating/player country, and THIS refers to the selected country.

Such variable would be dynamic based on the selected/target country.

It may be already possible in your system. But if it's not, perhaps it's something worth considering in the future :)
 
That's great to know! For targeted variable, it may be already supported in your system. I don't know how different it is, but i'll explain:

An example of the use of targeted variables. For example in my mod, I had to create something that's called "Spy Network Strength" that controls the ability to conduct espionage country in the target country (the variable must be equal to 100). it's kinda like EU4 Spy Network...

The goal is to make sure the variable is unique to each target country. For example France's Spy Network Strength in Germany may be 80, but France's Spy Network Strength in Italy may be 90.

To do that I had to use targeted variables in the scripted GUI that looks sort of like: "ROOT.network_strength@THIS". Root obviously refers to the originating/player country, and THIS refers to the selected country.

Such variable would be dynamic based on the selected/target country.

It may be already possible in your system. But if it's not, perhaps it's something worth considering in the future :)
Ahhh hmmm I am not sure if that would be possible. I'd rather not go down the @THIS whatever route because its rather obtuse in what it actually is and working with in CK2 was not all that fun either lol, I'll look at trying a solution, I am sure there is some work around already with combining lists and variables and other magic but a cleaner one would be good.