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

EU4 - Development Diary - 27th of February 2018

Good day all. Tuesday rolls around as it often does and we're back with another Dev Diary for Europa Universalis IV. Today we'll talk about 2 things: Improvements to the Naval AI and the new National Ideas of the various Irish Earldoms.

Firstly the AI. For this I will pass the mic to the living legend among AI programmers @Chaingun

#####

Hello, I am Chaingun aka. Skynet, although my real name is Petter (non-Swedes feel free to pronounce as Peter). Today’s dev diary will put the lens on what kind of new AI bugs (and occasionally WAD behavior) you may expect from the 1.25 update accompanying Rule Britannia.

The main [AI] focus of 1.25 has been to sort out the less than ideal naval behaviors. Some of you may have the perception that France transporting all their troops to an island in the Pacific is a recent thing, though in fact the AI’s logic has always permitted that to happen. It has been showcased far more frequently beginning when @Gnivom fixed overseas war declarations, due to the increased frequency of AI troops transport attempts overseas.

This overall situation is interesting because it highlights some of the many perplexities of game AI development, of which I would like to recap:

  • Fixing an issue can make the AI worse indirectly because of another latent issue, as the naval transport situation illustrates. Another example would be reducing the AI’s siege army sizes to reduce attrition when it doesn’t understand how to distribute cannons in their armies.
  • Fixing an issue can make the AI worse because we actually create another issue by breaking something.
  • A symptom often has multiple causes. An example is the famous sleeping army bug which is in very general terms can be explained as the AI getting into an external or internal state it cannot handle, resulting in all the commands it attempts (if any) being invalid.
  • A cause can have multiple symptoms that seem entirely disconnected or otherwise have very far-fetched causal dependencies. Ottomans falling behind massively in tech due to AI refusing to invade a rebel held island (due to having fewer transports than rebel regiments times a constant) would be an example.
Game AI programming is not a recommended job if you don’t like hearing how stupid you are on the forums forever afterwards not tweaking for their pet issue when working on a fixed time schedule. The line between bug and feature is thin indeed.

Returning to transport issues; in 1.25 the naval invasion AI is constrained from moving more than 50% of their troops “abroad”, where abroad is defined as a different landmass on a different continent, and army divisibility is not subject to said restriction (so if France does just have one army, it may be found in South America all the same). However, this is just the naval invasion logic… the land army AI may still decide to walk across Eurasia with all their armies for obscure reasons. It’s something I would like to rectify in the future if I get time for it.

Another big problem with the naval AI of previous patches is that it’s simply extremely slow in transporting troops. This issue turned out to be complex, and a number of sub-issues were identified and dealt with to various degrees:

  • There were several bugs where AI fleet and/or an army awaiting transport actually would be forever stuck until reload or even after.
  • The AI can now actually split a fleet if not all transports are required.
  • Sailors had been rebalanced to actually matter for some countries. Nobody had taught the AI this, resulting in many large countries having 0 sailors all the time, in turn leading to fleets spending most of their time in repair. As this was a surprise to me as well, and the issue is highly complicated to fix, the AI may now cheat on sailors by conjuring them out of thin air if they run out. This allows seamlessly working towards fixing the sailors handling without the naval AI being utterly handicapped in the meantime.
  • The AI’s transport fleet (of e.g. Spain) would often be found sailing around in Indonesia or some other far away place, taking years to respond to anywhere else. For Great Britain, this was even worse as the warships that were needed to defend against invasion partook in said expeditions. A fairly intense rework in how the structure their fleets has been made as detailed in the next paragraph.
Initially, when I set out to improve the AI’s fleet response times, I thought it would be a matter of having fleets based in appropriate ports around the world. Unfortunately, the AI (and neither do human players) have enough ships for this. Even the largest colonizers in the world can at most field a couple of hundred warships and transports. Splitting up warships lightly can therefore be disastrous.

The solution settled for has been to make the AI place the bulk of its warships into a Home fleet, which is forbidden from venturing far from the home coast, and does not contain any transports. Because it does not contain transports, it will never be busy transporting troops. This behavior is conservative, but conservative behavior is better for AI in practice. Europeans will not attempt to challenge Ming with a large fleet of heavy ships, they do however pose a token challenge to someone attempting to land troops on their shores.

So were these changes enough to make the AI a formidable force at sea then? Astute players may have noticed the AI barely built any ships whatsoever. During Christmas, the AI’s economy was tweaked to build far more warships, force limit buildings, and float less money. It was bloody perfect for a while with the Ottomans fielding 1.5 million men. Much later, new army maintenance costs came into the picture later as a surprise wrecking AI economic balance, so the 1.25 release may have regressed in this regard. Still, it should be better than it was on the naval front.

The implication of this rework on the whole makes the AI a bit more capable at naval stuff. Its micromanagement is still terrible, and skilled players will still be able to play “lure the fleet away” tactics to invade Great Britain with ease. Players using house rules or otherwise not exploiting AI behavior may however find some challenge in making naval invasions sometimes where previously they would not.

It’s worth some amount of extraposition explaining why the human player will always beat the AI as it’s coded in EU4. The crux is, the AI in Paradox games is using a fixed manual coded strategy. The extent to which is changes its behavior in response to what a human opponent does is limited to the exact tactics pre-programmed by the human author. Merely the fact the AI will not change is enough for the human to pick counter-strategies that are very effective against whatever the AI is doing, whereas they can not go into the same extreme degree of specialization against another human opponent.

Lastly, let me state I’ve been here since the Autumn on EU4 as a consultant (I was working with PDS full time until around 18 months ago), but I am being reassigned from EU4 to SECRETPROJECT, still at PDS, where I have freedom to create many new and wondrous AI bugs, or maybe even let the AI create the bugs itself, as any intelligent being would.

That’s all for now.

#####

Cheers Chaingun. Next up we'll look at New National Ideas for the Irish. Ireland is one of those places that could honestly be divided up but we are satisfied with the setup we have reached in 1.25. The following National Ideas have been either added or amended, with credit to @macd21 who made considerable contributions to these:
  • Leinster
  • Kildare
  • Clanricarde
  • Tyrone
  • Ulster
  • Maccarthy
  • Ormond
  • Faly
  • Tyrconnell
  • Repurposed group set for united Ireland
With this the entire Island's nations have their own unique National Ideas, with a formable Ireland having their own set. Let's pick 3 to look at: Meath, Kildare and Ireland

MTH_ideas = {
start = {
fort_maintenance_modifier = -0.2
global_garrison_growth = 0.25
}

bonus = {
leader_siege = 1
}

innefectual_overlords = {
global_tax_modifier = 0.10
"The English government in Dublin and their Irish Parliament puppets have been weakened as result of England's many conflicts in the Hundred Years War and the War of the Roses. Their influence no longer holds any sway over the true lords of Ireland, and now is the time to strike out for our independence."
}
foreign_nationals = {
diplomatic_reputation = 1
"In 1487, the Irish lord John de la Pole, Earl of Lincoln, invited a host from Burgundy to Dublin to support the crowning of Yorkist English pretender Lambert Simnel. Ireland would make for a fine base of resistant against the English mainland, and forever keep the would-be occupiers at bay. We may also one day gain powerful supporters, such as the Kingdom of Spain."
}
mth_parliament_of_ireland = {
stability_cost_modifier = -0.10
"When the English were expelled from Dublin, they left behind an institution called the Parliament of Ireland. Meant as an instrument to subjugate us, we will instead use it to organise our efforts to resist a return of English rule."
}
mth_englishtown = {
culture_conversion_cost = -0.15
"Once known as Irishtown and a ghetto for native Irish in Dublin, we have turned the tables. The district is now relegated to the Englishmen who remain, there being forced to integrate into the new order."
}
mth_the_cess = {
global_tax_modifier = 0.1
"The Cess is a special tax for the purpose of maintaining the extraordinary garrisons required to keep our towns safe. The people resent the tax, but understand its necessity."
}
mth_trinity_college = {
adm_tech_cost_modifier = -0.1
"Ireland lacks an institution of higher learning. A Catholic university in Dublin would put Ireland on the academic map."
}
mth_siege_mentality = {
defensiveness = 0.20
"The people of Dublin and Meath have had to endure many sieges through the years. We understand how to survive them and how to resist them."

KID_ideas = {
start = {
global_unrest = -1
defensiveness = 0.20
}

bonus = {
prestige = 1
}

kid_lords_of_ireland = {
diplomatic_reputation = 1
"Through strategic marriages and alliances with both Gaelic and Anglo-Irish families, the rulers of Kildare maintain a degree of influence throughout the island of Ireland unmatched by any of their rivals. Such is their power that successive English monarchs appointed them as their Lords Deputy over the island."
}
kid_ear_of_the_king = {
improve_relation_modifier = 0.2
"Despite repeatedly betraying the crown, the FitzGeralds of Kildare talk their way out of trouble, returning home with a pardon and a promotion."
}
kid_silken_finery = {
land_morale = 0.10
"When Thomas FitzGerald renounced his allegiance to the English king, he did so accompanied by his retinue of armoured gallowglasses, who were bedecked with silken fringes on their helmets. When Thomas wavered in his course of action, an Irish bard recited to him a poem, calling upon the Silken Lord to avenge his father’s death."
}
wizard_earl = {
technology_cost = -0.05
"The 11th Earl of Kildare spent many years abroad, studying and learning much of the world. When he returned home, he brought with him a keen interest in alchemy. Such was his knowledge that his neighbours referred to him as the wizard earl, for he was thought to have magical powers."
}
the_curragh = {
cavalry_power = 0.1
"The wide open plains of the Curragh have long been used as a gathering place for armed forces, but also make it a popular site for horse racing, and later, horse training."
}
kid_architects_of_nation = {
build_cost = -0.1
"The ancestral seat of the FitzGeralds at Carton House is grand, but our fortunes have improved of late. We have drawn up plans for an even grander residence, that could serve not only as a family seat but also as the Earl's court."
}
kid_royal_irish_army = {
global_manpower_modifier = 0.1
"The forces sent by the King of England to subdue the Irish can easily be repurposed by the Peerage. By simply offering better pay the Earldom of Kildare could command a sizable force of English soldiers."


irish_ideas = {
start = {
land_morale = 0.1
trade_efficiency = 0.1
}

bonus = {
legitimacy = 1
republican_tradition = 0.5
}

irish_endurance = {
shock_damage_received = -0.1
"Decades of disease and famine have mostly pushed the English invaders from our lands. Meanwhile, the Irish people grow all the stronger from their harrowing experiences. Yes, there is no stronger man on God's green earth than an Irishman!"
}
the_clanns = {
same_culture_advisor_cost = -0.2
"The Clanns of Ireland make up a strong political body for land and family management. In smaller families, the family elected chieftain is in charge of maintaining the family and protecting their lands. Land and leadership is passed through the family electorate system of Tanistry. From the royal clanns the symbolic high king of Ireland is elected, creating a bond of union between the Irish families."
}
more_than_irish = {
global_unrest = -2
"Heartily did the Norman invaders embrace the Irish traditions; so much so that it was said they put on the airs of being 'More Than Irish'. The very nature of our culture is contagious, and for centuries yet will men embrace our way of life."
}
loyal_catholics = {
papal_influence = 1
global_heretic_missionary_strength = 0.02
"While the English may toil and spin in the winds of the Reformation, the Irish people as a whole are determined to remain under the wing of their lord The Pope."
}
ire_abundant_harvests = {
global_trade_goods_size_modifier = 0.10
"Now that the greedy, neglectful English landlords have been driven out of Ireland, our farmers are finally able to manage their produce in peace. Blights and crop failures are addressed as matters of critical state importance rather than as peripheral concerns of an irrelevant colony."
}
unconquerable_ireland = {
war_exhaustion = -0.02
"No English lord could contain the will of the Irish for long. Despite all efforts, rebellion after rebellion sprouted in an attempt to displace English rule. Insurgency after insurgency will spring up in their path, and Ireland shall never truly be theirs. And, as they sail from our lands, we shall further influence resistance against the protestant imperialists to on our eastern flank."
}
ire_gallowglasses = {
discipline = 0.05
"Formerly loose mercenary bands, the Gallowglasses are being consolidated into a national army. Their institutional experience is almost unrivalled, and their septs are the perfect foundations for regiments."


And that's our lot for today. Well, if I don't add an image then the front page won't be happy, so here we go:

meathinks the time for change is uppon England.jpg


Next week we'll show off the new unit models and music which will both be included as part of Rule Britannia. See you then!

Don't miss today's Rule Britannia Feature Stream with DDRJake on our twitch channel at 15:00 CET - the stream will as usual be available on Youtube if you can't make the livestream
 
Last edited by a moderator:
Are you saying that Flanders and Wallonia have more in common with each other than with their respective neighbours?

Traditonally yes. Don't forget that the definition of Flanders and Wallonia have changed a lot in the last century and a half.

The ruling houses of Flanders and Hainaut were closely related and, together with french flanders had a shared culture. Just like Limburg and Liege have a common history with eachother. And Brabant with itself. The current north/south division is a rather modern situation.

The name Belgium would be used througout the period as a synonim for the Netherlands.

https://www.maphouse.co.uk/photos/m2479.jpg for example.
 
Last edited:
Are you saying that Flanders and Wallonia have more in common with each other than with their respective neighbours?

As a 'Vlaming' I've always felt closer to the Walloons than I did to the Dutch. In my opinion, the only thing we have in common with them (The cheeseheads) is our language, and even that's very different. Sure, the Flemings living near the Dutch border might not feel the same way I do, but I still believe that Belgians are Belgians and not just 2 peoples thrown together. It's mostly the foreigners who make these claims, cause we aren't going to say those things for the very simple reason that most of us simply don't care about the whole Flanders vs Wallonia stuff.
 
Cheers for the DD DDRJake and all the AI work Chaingun :D. That goes for everything on EU4 and everything on this new Secret Project you're working on - it's been a while between drinks for new PDS titles (although the constant updates to old ones goes a long way to reducing unrest :D) and there are lots of us keen to know what you're squirrelling away on.

Great to hear the naval AI is getting some love as well :D. Totally appreciate the fixed schedules, (insanely) difficult job and all that, and anything that can be done is greatly appreciated. New changes sound mostly good, and while they sound like they might hamper the AI's capability to project power over water a bit (based on a rough guess - watch me be totally wrong ;)), as you well say conservative is the best place to start with these things.

As for those Irish ideas, look out world - if any of those Irish nations get going, it looks like they'll really get going :).
 
Scandinavia is a region with some common ethnic and cultural heritage but there was never "a Scandinavia" as a sovereign state. There was the Kalmar Union yes, but that was a personal union not a nation state. There was no dominant Scandinavian nationalism present in it, people still identified as Danish, Norwegian and Swedish.
Westphalia is just a region in Germany that has never had any desire of creating an independent state. The region even has a lot of historic, cultural, lingual, religious differences.

So including "formable nations" like those, of which some never even existed or are based on vague common heritage, I think it's only fair to include Belgium as well. The region that encompasses present day Belgium too has a common ethnic, cultural and historic heritage. Sure we speak both dutch and french but does that mean we should be part of France or the Netherlands purely based on language? If that's the case then Brazil should still be part of Portugal.

Belgium is as much an artificial state as many other 19th century states that emerged. I recommend you read The Invention of Tradition by the famous historian Eric Hobsbawn instead of jumping on the "Belgium is a fantasy state" -meme train.

yes, Scandinavia indeed never existed, but there was a concept, where is the concept of Belgium in 1444 or even in 1821?
also, Yes you actually gave me another argument because in 1821 Brazil was still part of portugal (actually in a personal union so even Brazil being formable is actually more historical in Eu4 than Belgium) and yes Wallonnia was part of what was considered French and Flandres was still considered to be part of the HRE or even the Netherlands.

Oh, good that you recognize that belgium is artificial, so we are on the same page, why should it be included again?
Sidenote: "Belgium is a fantasy state" is a meme because adding Belgium to the game would be so anacronistic that the thought of it is funnier than serious
 
Last edited:
As a 'Vlaming' I've always felt closer to the Walloons than I did to the Dutch. In my opinion, the only thing we have in common with them (The cheeseheads) is our language, and even that's very different. Sure, the Flemings living near the Dutch border might not feel the same way I do, but I still believe that Belgians are Belgians and not just 2 peoples thrown together. It's mostly the foreigners who make these claims, cause we aren't going to say those things for the very simple reason that most of us simply don't care about the whole Flanders vs Wallonia stuff.
Oh thank you, of course as a person that lives in the Modern Age Flandres you really enlighthen our view of how people thought of each other and is totally not being biased by 200 years of union

The name Belgium would be used througout the period as a synonim for the Netherlands.
Yes, because the Romans named their province there Belgica so the Latin name for the ND was Belgium, it didn't keep the same after the nation of Belgium was created tho
 
I don't really think that's a realistic problem. If he managed to create an AI smarter than a human at playing a grand strategy game like EU4 he would probably win a Nobel prize and be recruited as chief software engineer by Google.
There is no Nobel prize for CS. He'd get a Turing award instead.

Anyway. I feel like transports indeed might be redundant too, and removing them would make the game simpler for the AI to handle and play - these ships are basically deadweight, I barely see AI having enough ships to transfer troops adequately and have some combat ships left.
 
Last edited by a moderator:
yes, Scandinavia indeed never existed, but there was a concept, where is the concept of Belgium in 1444 or even in 1821?
also, Yes you actually gave me another argument because in 1821 Brazil was still part of portugal (actually in a personal union so even Brazil being formable is actually more historical in Eu4 than Belgium) and yes Wallonnia was part of what was considered French and Flandres was still considered to be part of the HRE or even the Netherlands.

Oh, good that you recognize that belgium is artificial, so we are on the same page, why should it be included again?
Sidenote: "Belgium is a fantasy state" is a meme because adding Belgium to the game would be so anacronistic that the thought of it is funnier than serious

You really don't read a lot of history books do you? You could work for Paradox! :D
 
You really don't read a lot of history books do you? You could work for Paradox! :D
If I had a degree in History I could, but how that help the case for or against Belgium?
Also, good for you that reads lots of books, but it'd be good if you actually had some good argument for the inclusion of Belgium that is not pure "whataboutism"
 
Last edited:
yes, Scandinavia indeed never existed, but there was a concept, where is the concept of Belgium in 1444 or even in 1821?
also, Yes you actually gave me another argument because in 1821 Brazil was still part of portugal (actually in a personal union so even Brazil being formable is actually more historical in Eu4 than Belgium) and yes Wallonnia was part of what was considered French and Flandres was still considered to be part of the HRE or even the Netherlands.

Oh, good that you recognize that belgium is artificial, so we are on the same page, why should it be included again?
Sidenote: "Belgium is a fantasy state" is a meme because adding Belgium to the game would be so anacronistic that the thought of it is funnier than serious

Obviously there was a concept of Belgium in 1821 if there was a Belgian Revolution in 1830
 
What's the reason to think so? just the date being 9 years after the end of the game?
Yes. clearly there had to be some Belgian sentiment that built up. the south of the Netherlands was a mix of Flemmings and Walloons, both Catholics and both underrepresented after Maurice-Jean de Broglie passed a law in 1815 preventing them from working for the new government.
 
I mean, Westphalia is more of a "silly" country than Belgium is. The only reason it exists in game AFAIK was because client states weren't a thing yet and there needed to be something in western Germany for France to be able to create late game/in the Napoleon start. Belgium has a geographical meaning and did actually kind of create itself in history, in 1830 (and the circumstances that led to it had existed for centuries).

As a formable for Flemish and Walloon nations I don't exactly see a strong argument against in gameplay terms either, which is the more important point after all.

the only thing we have in common with them (The cheeseheads) is our language, and even that's very different.

Ok this is completely off topic but are they really all that different? I thought they were, until last year, when I actually lived with some (mostly Francophone) Belgians. One was effectively bilingual in French and Flemish, as well as having excellent English and could speak to Dutch people in Flemish (who also had fantastic English) just fine. They both said it was easier than switching to English and they all, including the Dutch, described Flemish as "Dutch but with less of an accent".

By contrast, I also knew a Swede and a Dane a few years ago with not as good English (although still pretty damn solid) as the Dutch people and the Belgian who would still switch to English to talk to each other rather than use their native languages, similar though the Scandinavian languages may be.

Plural of anecdote not being data obviously so I'm not sure this says anything other than "languages are complicated" but hey.

To bring us back on topic, the Irish ideas look fun and its always good to hear whats happening with the AI.
 
Oh thank you, of course as a person that lives in the Modern Age Flandres you really enlighthen our view of how people thought of each other and is totally not being biased by 200 years of union
I wasn't really trying to say how they felt 200 years ago, I was simply saying how we feel today as I felt that people were about to make the whole 'We should just split Belgium up' argument again. But just to say my opinion of adding Belgium as a formable nation. I think, considering there are a lot of fantasy nations you can form, we should be able to. Before you bring up the whole 'Belgium as an idea didn't exist so it's impossible to add it and it will ruin the game' argument why wouldn't there be a powerful duke or lord who rules over the Belgian area decides to unite these lands as a nation (taking the old Roman name) to compete with the Dutch, English and French? In EU4 standards, that's something that could happen. You need to remember that this game is about creating a new and alternate history, not just about reliving it. Why would the southern Netherlands NOT unite? They were rich, well populated and had important centers of trade. I think adding it would create a whole new challenge to the game, one that might unbalance it though. Which is why it will never be added, unless through mods. Now, to clarify my opinion as a whole. Belgium will never be added and it doesn't really need to be added as I'm already happy to see the Flemish culture + the new ideas, I do not want to anger people nor do I want to start a fight, this was just my humble opinion.

Ok this is completely off topic but are they really all that different? I thought they were, until last year, when I actually lived with some (mostly Francophone) Belgians. One was effectively bilingual in French and Flemish, as well as having excellent English and could speak to Dutch people in Flemish (who also had fantastic English) just fine. They both said it was easier than switching to English and they all, including the Dutch, described Flemish as "Dutch but with less of an accent".

By contrast, I also knew a Swede and a Dane a few years ago with not as good English (although still pretty damn solid) as the Dutch people and the Belgian who would still switch to English to talk to each other rather than use their native languages, similar though the Scandinavian languages may be.

Plural of anecdote not being data obviously so I'm not sure this says anything other than "languages are complicated" but hey.

To bring us back on topic, the Irish ideas look fun and its always good to hear whats happening with the AI.

Well it really depends on which version of "Flemish" you use. All people in Flanders are taught the standard Dutch in school, which is about 98% the same as the Dutch version of the standard Dutch. The biggest difference tho is in the spoken language. I've spoken to many Dutch people and everytime they had to ask me what I meant, simply because they didn't understand the dialect I was speaking. Even in chats it's sometimes difficult as the Dutch use many words where we have a french variant of. For exemple: Flanders: Chauffage Netherlands: Radiator. There are tons of these different words that the Dutch would probably never understand . The thing is, our language is the same but it's the way that we pronounce it and use different small words that really makes it seem like different at times (Just look at how we pronounce the 'G' compared to the Dutch). But yes Flemish and Dutch people understand eachother perfectly cause we are taught the same language in school (Altough there are very small differences here and there). But as it does with every language, it really depends on the dialects. Dutch dialects are sometimes so different from Flemish ones you'd think they're not just 2 different language, but just 2 different language groups. If you're really interested in that I suggest you look it up a bit (But I know you're not cuz why would you ^^). Anyway, this whole thing has been REALLY of toppic and I don't even remember how we managed to get here to be honest.
 
So, does this mean, that forming Ireland, it will be a republic then? or will it still be a kingdom? Will it get it's own fanciful government? Do the Irish governments in this one get fanciful features? The DNs that showcased this were a bit... lacking on that front. England looks grand but I want to know Ireland's edge to unify and keep England at bay.