The best kittens, technology, and video games blog in the world.

Friday, September 19, 2014

Fun and Balance mod for EU4 - Shattered Europe support and huge mission pack

Cat by Moyan_Brenn from flickr (CC-ND)
Fun and Balance started as a collection of workarounds for the worst issues in vanilla, but it expanded a lot since then - and this is the biggest expansion ever. I'm keeping everything modular, so you can cherrypick whichever parts you like, but if there's demand I might start releasing lite version with just bugfixes separately from full version with extra content.

For detailed explanations of everything else the mod does, check older posts. This is just the new stuff.

Direct downloads:

Mission pack

Anyway, missions in EU4 suck. A few countries - mostly big ones - get some cool early game missions, but most people don't want to play France or Muscovy every time, and in any case even these missions run out real fast. Generic missions tend to be boring, and their rewards are often extremely underwhelming.

Now it's all fixed!

Generic missions now get meaningful rewards. There are no more generic missions which reward you with just some prestige or advisors. You'll get some monarch points or legitimacy/republican tradition at minimum, sometimes even more like stability or base tax in mission province. (I count free CBs on selecting mission as part of reward, so these missions didn't get any extra bonuses)

Most tag-specific missions would make just as much sense for another country in same geographical situation - so that's what happens now! For most countries if you get that country's lands, their missions enter your mission pool! This means you get new missions in the pool even very late game if you expand to some new place, so you'll rarely be limited to just generic ones.

For small countries requirement is simply taking their historical capital. For larger countries, condition is usually a few key provinces and minimum size requirement - for example you'll get Polish missions if you control Krakow and Warsaw, Ottoman missions if you control Edirne, Constantinople, and have minimum of 20 cities, and so on.

Some missions require original country not to exist - nobody gets Timurid or Mughal missions if either of them exists. For a few countries I used different alternative conditions instead of using same geographic condition for all of them. More tweaking is definitely possible here.

Many missions already have extra requirements which have not been removed - for example Genoa's missions all require you to be a merchant republic, so if Venice or Hansa takes over Genoa's capital they'll get them in the pool, but Milan wouldn't unless they change government type.

In testing this rarely led to any crazy results - sometimes mission text sounds a bit silly, but that's already the case with some vanilla missions (try forming Russia as anybody but Muscovy etc., or change your religious group - you'll be getting a lot of nonsensical missions).

Missions which mention another country in any way can't activate for that country.

As an extra bonus you can get Byzantine missions for rebuilding Roman Empire if you're Holy Roman Empire and control both Rome and Constantinople. Go crazy! Ulm can into Roman Empire.

AI fixes

AI in EU4 is really dumb, I can't really fix it completely, so I just added a few small fixes:
  • Length of war unwillingness to peace out goes from -30 to -0, instead of -45 to -0 (in five years). Vanilla value were ridiculously high, and nobody would white peace out of the war ever no matter how hopeless it was - every OPM would fight to their bitter end. I don't want to go all the way to CK2 situation where wars are over at 100% warscore before the opponent had chance to even gather their armies, but EU4 is just crazy, and this is a fairly mild fix - as they still get unwillingness points for strength of alliances, allies in war, controlling their capital etc.
  • Willingness to peace out due to high War Exhaustion increased from 1/level to 2/level. War Exhaustion actually matters in the mod unlike in vanilla where it's just dip point leak.
  • Number of Great Power Allies penalty reduced from -50 to -25. With everybody getting twice the number of diplo relations as in vanilla, it makes sense that they're not just with OPM.
I also reduced +0.7% missionary strength bonus for positive stability back to vanilla value of +0.5% now that missionary strength is fully rebalanced.

Shattered Europe version

There's now also a version that works with Shattered Europe (direct download).

It supports every feature of Fun & Balance mod, except new missions added by Shattered Europe are still tag-specific to Iberian Muslim states. The mod also fixes a few bugs in Shattered Europe code (all reported upstream).

Extended Timeline version

The mod still supports Extended Timeline (direct download). This release does only a few minor tweaks (like AI fixes) over previous release.

Extended Timeline version doesn't currently include extra features like mission pack, religions, partial westernization, holy sites - it's just a rebalance mod. The only new feature included is return subject cores CB.

I might port some of the extra features to Extended Timeline at some point too, especially holy sites.

Technical information

This section is of interest only to other modders.

While pretty much every other mod is written by hand, nothing in this mod was. Everything is done by building or transforming abstract syntax trees using open source software I developed for this.

Benefits of this include much reduced chance of making mistakes, much less effort required to make similar changes in multiple files, ability to generate multiple versions of the mod, and much lower effort required to adapt it to new patches.

This also makes some complex transformations possible - mission code required first replacing all references to original tag with ROOT (which might require collapsing some OR nodes if mission is already for two tags like CAS/SPA), then finding other tags referred in the mission code to exclude them, then building exclusion condition based on original tags, excluded tags, and alternative conditions.

Doing this by hand or by regular expressions... There's a reason nobody bothered to even try before as far as I know.

Now that tools for this exist, some really cool coding could start happening.

Everything is optional

As much as possible, every feature of this mode is independent from every other feature. You can take mission pack, or rebalance bits, or any selection you want and quite easily throw away the rest.

The only major exception is religion-related stuff which applies far too many changes to a single file to disentangle it easily.

Special thanks to Don Sjerven for help with testing. I can only do so much testing myself, so all kinds of bug reports are very welcome.

If you'd like to see Fun & Balance version for other EU4 mods, this is pretty easy to do, so request away.

Sunday, September 07, 2014

Fun and Balance mod for EU4 Extended Timeline

Anabel Leocádia Moreira Pinheiro by Márcio Vinícius Pinheiro from flickr (CC-NC-ND)
The most common request I'm getting for Fun and Balance mod is using it with other mods.

Unfortunately EU4 does not make it easy to run multiple major mods together (to be fair, pretty much no game does, good support for a single mod at a time is already pretty good).

This could always be achieved with manually merging files, and some people did just that, but that's fairly tedious, especially to update it every single time new version comes out. Even for vanilla Fun and Balance it was a bit of a chore to update it for every EU4 hotfix.

Fortunately I already wrote parser for Paradox mod file format, and one thing led to another and Fun and Balance is now a set of transformation scripts I can apply to any mod I want with little effort.

This isn't completely trivial, since some things that make sense in vanilla don't make sense in mods, but progress from applying hundreds of edits with text editors (and hoping I made no typos on the way) to just selecting which mod I want as base, and which features I want to include with a script like this is an amazing improvement.

So the first release - Fun and Balance for EU4 1.7.3 and Extended Timeline v0.10 (here's direct download in case Steam Workshop doesn't work, like on OSX).

Here's Fun and Balance download.

Included features

The following changes from Fun and Balance mod for vanilla are also included in version for Extended Timeline:
  • no truce scaling
  • diplo annex cost 15/bt to 1/bt
  • max active policies 5 to 10
  • policy cost 0
  • rebel support gives +6RR
  • no westernization slowdown due to income
  • accepted culture gain/loss threshold both at 10%
  • monarch point pool up to 15000
  • building mp cost 5 (in mod this is modified by era)
  • moving trade port cost reduced to 100dip
  • culture change reduced 40->15 (instead of vanilla 25->10 reduction - it makes sense for this to be higher due to longer timelines, but baseline cost was crazy high already)
  • double core/claim expiration time
  • no protectorates
  • vassals can fabricate claims
  • vassals will buy provinces up to 50% OE
  • no vassalization base tax cap (just regular quadratic penalty)
  • no WE reduction at war
  • double diplo relations limit
  • positive stability gives 0.7% missionary strength (I'm not totally sure this is needed in either the mod or vanilla these days, it made a lot more sense a few patches ago)
  • revolt risk due to non-accepted culture +4RR
  • revolt risk due to lack of religious unity up to +5RR scaled
  • EU3 style elections - 3 random candidates, 30% republican tradition cost for reelection, no skill gain from reelections
  • buildings not destroyed on ownership change
  • return subject cores CB
  • peasant war conditions made more reasonable
  • faster AE decay
  • annexed vassal opinion capped at -100
  • cleansing of heresy CB gives 25% forced conversion cost instead of discount on conquests
  • imperial ban CB at 10% AE for banned provinces
  • improve relations mission gives meaningful reward
  • no naval attrition
  • reduced religious center penalty to conversions from -5% to -2%
  • HRE member religion change affects IA
  • bad events due to high OE scale smoothly with OE instead of having sharp 101% OE cliff
  • no Burgundy inheritance
  • Burgundy capital in HRE
The following are excluded:
  • always display policies if at least one (mod uses different policy system)
  • form Byzantium decision condition fixes so Ottomans and HRE can do it, extra reformable countries (this would need redoing due to extended history)
  • partial westernization (mod uses different tech groups)
  • extra religious conversions, religious conversion rebalance, and pagan coring modifiers (mod has very different religions)
  • holy site system (this could totally work, I'd just need to go through all of mod's religions and select good holy sites for them)
  • advisor cost increase slowdown (already rebalanced by mod to support playing up to 9999)

Technical notes

Because of the way EU4 loads mods alphabetically, mod name " Fun and Balance for Extended Timeline" starts with a space so it can override files in "Extended Timeline" mod.

Automated build process throws away all comments and formatting in affected files (except defines.lua where it keeps them). I want to make it smarter, so it only does that in changed portions of a file instead of entire file, but that's future work.

Building Fun and Balance versions for other mods - or customizing version of the mod for your experience - is now relatively straightforward - especially if you know a little Ruby.

Build system is not Fun and Balance specific in any way - it could easily be used for other mods, it could probably even be used with other Clausewitz engine games with minor modifications.

If there's any other mod you want to use with Fun and Balance, but you don't know how to use build system, feel free to ask me and I'll take a look.

I did something similar before with Concentrated Vanilla mod for Medieval 2 Total War, but that was messy pile of regexp hacks instead of the much cleaner parser-based approach I'm using here.