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

Saturday, November 08, 2014

Fun and Balance mod for EU4 1.8.0 Art of War

goodbye by gioiadeantoniis from flickr (CC-NC-ND)
Another patch, another round of mod upgrades. 1.8.0 patch is unusually big, so many previous rebalance decisions the mod made that did well in testing on earlier versions could use some revisiting.

Direct downloads:
  • Fun and Balance for EU4 1.8.0 - Download
  • Fun and Balance for EU4 1.8.0 and Extended Timeline (0.11.1 version) - Download. Extended Timeline mod is only partly ported to 1.8 so it's fairly glitchy - present day bookmark is reasonably OK, older bookmarks have a lot of map issues. I'm posting it anyway, as Fun and Balance does no map changes, so you'll be able to play Fun and Balance with it as soon as they fix the map.
  • Shattered Europe did not upgrade to 1.8 yet, I'll release Fun and Balance for it as soon as it does.

Tweaks to new Art of War features

These are somewhat speculative and only went through limited testing, so future versions of the mod might revisit them.
  • Waiting period for allies to show up before you can get 100% warscore by fully occupying war target is reduced from 5 years to 2 years. The feature is understandable, but implementation was definitely excessive.
  • Autonomy level on diploannexation changes from 75% to 50%. It felt really weird that it's worse to legitimately integrate a country than to conquer it without claims (for which you get 50%).
  • Broke march opinion penalty lowered from -200 (3/year decay, no cap for up to 67 total years) to -100 (3/year decay) with 10 year cap. March bonuses are really weak in the first place, marches lose them if they grow big enough (while keeping all penalties), so making them basically unannexable for over half a century after they outgrow their usefulness is just completely ridiculous. At least they had decency of making them optional, unlike protectorates (which the mod disables completely).

Fun and Balance features now in vanilla

One really interesting thing about this mod is how many times vanilla later did exactly the same change as I did in the mod first, or otherwise tried to address same problem areas.

The CB to return subject cores originally introduced by Fun and Balance (or Crusader Kings 2) is no longer necessary as you can push for any of your subject's CBs.

Vassals now happily fabricate claims, and will buy provinces up to 50% overextension, not just one province as they used to.

Size-dependent coring time penalty is now gone for good.

Vanilla lowered diplo points cost of annexation from 15/bt to 10/bt. I absolutely hate idea of expanding via monarch points (they're fine for technology, stability, events etc.), and I'd love to bring early EU4's system of using time and diplomacy for it, but since it's impossible to mod, I'm doing the next best thing and setting diploannexation cost at 1/bt. New autonomy system and harsher rebels both nerf diploannexation significantly anyway.

And congratulations for finally fixing monster culture groups. About the only remaining issue I have with it now is that Zhou/Shun cores make very little sense now with new China and should probably be replaced by each Chinese culture getting its own releasable regional minor.

Retired Fun and Balance features

Muscovy got back its free colonist from national ideas - between stronger Novgorod, stronger hordes, and 50% autonomy minimum on all of Siberia they're hopefully not as overpowered and inevitable as they used to be.

Increased revolt risk penalties for non-accepted cultures and lack of religious unity are not converted into increased unrest penalties, pending further testing. Rebels are supposedly much more difficult to deal with in this version, so very high numbers which were fine under old system might be too high now. Foreign rebel support unrest increase (4% to 6%) is still in game.

Cleansing of Heresy CB reverted to vanilla due to new features related to religious wars, and lower cost of forced religious conversions in vanilla.

Changes to Fun and Balance features

These aren't related to 1.8.0 patch, just things that needed to be done already.
  • Missions of other countries can enter your pool if you fulfil some geographic criteria. Now one of them is that original country no longer exists (previously just taking over their capital was often enough). They also have 50% lower weights for anyone except their original country.
  • Missions to get holy site require that you get it, not just someone from your religion. This prevents tons of claims remaining there after it's done.
  • Accidental 1000% republican tradition reward fixed to 10%. (in mod files legitimacy uses 0-100 scale, republican tradition 0-1 scale, in UI they both look the same)
Enjoy the game.

How to configure OSX 10.10 Yosemite for software development

One Happy Kitty by andedam from flickr (CC-NC-SA)

It's been a few OSX updates since I wrote my guide for 10.5 and about half of it changed. Here's updated list of steps necessary to turn fresh OSX 10.10 into a sensible machine for creating software.

The guide below is based upon my preference, so details will vary for you, but a lot of Apple's default settings are uncontroversially horrible, so you're probably better off starting with a guide like this than trying to figure out where are all the options yourself.


  • Install some sensible browser like Chrome or Firefox.
  • Install some kind of AdBlock. If you sign in into your Google account with Chrome it might even install AdBlock for you.
  • Install whichever cloud sync service you're using like Dropbox, Copy, etc. And start syncing your stuff.
  • Install iTerm2 for sensible terminal emulator.
  • Clean up all crap from dock. Other than Launchpad and System Settings, everything else should be gone. Add iTerm2, your browser, and your text editor, and any application you wish to install there instead of stock Apple crap.
  • It's also a good idea to disable Spotlight as soon as possible by running sudo mdutil -i off / - before it tries to index all of your dropbox and generally ruin performance of your machine.


Install some sensible text editor like Sublime Text (requires license key).

Whichever editor you choose, you'll definitely need to configure it to your liking.

Then symlink it so you can use it from command line

  mkdir -p ~/bin
 ln -s "/Applications/Sublime" ~/bin/subl.


Default Mac settings are totally awful, time to fix that.
  • Max brightness
  • Settings > Security > Allow apps downloaded from: > Anywhere
  • Settings > Mouse > Max out "Fast" setting on everything
  • Settings > Keyboard > Key Repeat > Fast
  • Settings > Keyboard > Delay Until Repeat > Short
  • Settings > Keyboard > Use all F1, F2, etc. keys as standard function key
  • Settings > Sound > Disable "Play user interface sound effects"
  • Settings > Sound > Alert volume > 0% (for Terminal ping)
  • Settings > Trackpad > Scroll & Zoom > Disable "Scroll direction: natural"
  • Settings > Energy Saver > Disable "Automatic graphics switching"
  • Settings > Energy Saver > Power Adapter > Computer sleep > Never
  • Settings > Energy Saver > Power Adapter > Display sleep > Never
  • Settings > Displays > Turn off "Mirror Displays"
  • Settings > Displays > Set "Best for display" for every external monitor
  • Settings > Displays > Built-in Retina Display > Disable "Automatically adjust brightness"
  • Settings > Displays > Arrangement > drag and drop your external monitors into desired order
  • Settings > Dock > enable "Automatically hide and show the Dock"
  • Menu bar > Battery icon in task bar > Enable "Show Percentage"
  • iTerm > Preferences... > Profiles > Terminal > Unlimited Scrollback


OSX already includes drivers for laptop itself, but you might need some for peripheral hardware.

If you need any keyboard drivers like for Microsoft Keyboard (otherwise Cmd key is in the wrong place) or just about any external keyboard, get necessary drivers.

If you need any special keyboard layouts, get them too.

Standard paths

OSX renames a lot of directories. While in theory scripts could just use env vars to find proper paths, it's more reliable to symlink all the things:

  sudo ln -s /Volumes /mnt
  sudo ln -s /Volumes /media
  sudo mv /home /home-old
  sudo ln -s /Users /home

Development tools

First, you'll need Xcode, which annoyingly requires App Store login these days. Then select "Command Line Tools (OS X 10.10) for Xcode" package or run xcode-select --install from command line to do so.

Now it's time for a package manager. They're all somewhat disappointing if you're used to apt-get. homebrew seems somewhat more popular than others these days, so you might just as well try that.

You'll also need X11 server like XQuartz.

Create new SSH key pair

Open Terminal and run ssh-keygen to create ~/.ssh/id_rsa, then upload the generated key to any place that needs to know about it like github, bitbucket, or whatever else you use.

Checkout your dotfiles

Hopefully you're storing your dotfiles somewhere. If it's a git repository, or your Dropbox account, get them now and symlink them all properly.

If there are any other repositories you might need, checkout them too.

Install homebrew packages

Your list might vary. Here's mine (fun story - order you install homebrew packages matters, every packaging system that's not apt-get sucks so hard):

brew install mongodb mysql postgresql rbenv ruby-build wget htop unrar mc mplayer coreutils libxml2 libxslt bash poppler redis qt youtube-dl trash rabbitmq pcre exiftool lame id3v2 sox jq git bash-completion p7zip

Then enable all services you installed, unless you want to start them manually:

  ln -sfv /usr/local/opt/*/*.plist ~/Library/LaunchAgents/

And install non-system ruby, so you can install gems without sudo:

  rbenv install 2.2.0-dev
  rbenv global 2.2.0-dev

Due to OSX limitations you'll need to make htop suid if you don't want to use it with sudo every time. Instructions for that will be printed during installation or you can get them with brew info htop.

Sane bash and coreutils

bash version shipped with OSX is ancient and BSD utilities are all awful. In previous steps you installed proper versions, now you need to tell the system to use it.

Add homebrew version of bash as allowed shell by appending /usr/local/bin/bash at end of /etc/shells

Then set it as your shell: chsh -s /usr/local/bin/bash $USER

Then make sure to add GNU coreutils to your PATH:

  export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
  export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"

You'll also probably want to touch ~/.hushlogin to prevent some worthless spam on every open terminal tab.

Install gems

Again, your list my vary. Here's mine:

gem install beeminder moneta octokit term-ansicolor pry-plus rak objectiveflickr hpricot color nokogiri bundler

All other software

Sadly OSX window manager is extremely dubious for keyboard use. Fortunately programs to make it usable exist. I recommend installing these two:
* ShiftIt - for tiling by keyboard shortcuts.
* HyperSwitch - for sane alt-tab window switching. (there's also Witch, but it has issues with 10.10)

Giving them necessary access moved in 10.10. Now you'll need to:
* Settings > Security & Privacy > Privacy > Allow the apps below to control your computer > enable them both

You'll probably need these or similar programs:
* Any number of IM programs (unless you use in-browser hangouts only)
* Tor Browser
* Transmission - torrent client
* OpenOffice - office software
* VLC - media player
* MplayerX - another media player
* Xee - image viewer (only older version is open source)
* GitX (L) (original GitX is abandoned, this is reasonably alive fork)

Open Source Mac website contains links to other software you might need.

You'll probably need Java for something.


Once you go through this list, and successfully get everything going, I'd recommend modifying it to your liking and reposting your version on your blog. Everybody's needs are different, so guide like this is just a starting point.

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.

Thursday, August 14, 2014

Beeminder resolution problem

Cute squirrel monkey by **Mirm** from flickr (CC-NC-SA)
Beeminder tries to be two distinct things at once:
  • quantified-self system - helping you tracking relevant information about yourself
  • self-improvement system - nudging you towards better behaviour
These two tasks are highly entwined - you can't nudge yourself meaningfully without tracking your progress; and things you want to track tend to be things you care about improving, or at least maintaining at certain level, so it ought to make sense to have one tool for both.

The primary reason it doesn't work all that well in practice is that optimal resolution for tracking is drastically different from optimal resolution for commitment.

You generally want to track things at high resolution, but commit at low resolution. What you want to commit to is "getting enough exercise". What you want to record are things like "10 km on a bike", "30 minutes on a treadmill", or "10 sets x 10 reps with dumbbells". It's common to make the mistake of setting each such activity as a separate goal, enforced every week, which inevitably leads to mass derailing pretty quickly, even if you are getting decent amounts of exercise.

Instead, what you need do is throwing these data points all together into a single "exercise" commitment goal. They don't come in the same units, so you need to convert them somehow - to hours, intensity-adjusted hours, some kind of per-exercise point system, daily did/didn't exercise points, or something more creative. Whichever way to aggregate them you pick, what you want to commit to is low-resolution aggregate of high resolution tracking data.

This kind of aggregation is not supported too well by beeminder. What if you want to change from one way to aggregate data to another? Editing data for current goal is not only tedious manual process, it will most likely retroactively derail you. Or you could archive current goal and start a new one, eventually ending with "exercise-17" goal. There are ways within the system, but it's not helping you.

This might not be a huge deal if all you want from beeminder is some help with akrasia - for this past data is not a huge deal since it's already done its job nudging you. If you care about long term data, your choice is messiness of manual aggregation, or huge number of microgoals with frequent derailing.

I used "exercise" as an example, but that's actually one the easiest goals to aggregate. What if you wanted to commit to "work", "education", "doing new fun things" or some other difficult to measure goal? Hours of effort, which work tolerably for exercise, are really bad measure for most other goals, and point systems will require frequent tweaking. (I wonder how many programmers have "lines of code written" as beeminder goal - it might still be less crazy than "hours spent coding").

Resolution is not the only case where what you want to track is not what you want to commit to. For just about any area of life you'd like to improve, you want to commit to effort, and track outcomes. It's a miserable experience if you commit to an outcome like weight loss, school grades, earnings, or whatever else you're concerned with, put serious effort into it, and derail anyway because of one unlucky week.

On the other hand what good is committing to certain number of hours of effort, if you're not getting results you want even long term?

Beeminder is trying to do something new, and even in its imperfect state it's still highly useful. It still has very long way to go.

Thursday, August 07, 2014

Fun and Balance mod for EU4 1.7.3

6381 by 阿 light from flickr (CC-NC-ND)
Previous version of Fun & Balance mod works perfectly fine with 1.7.3 hotfix since it's an exe-only change and should be compatible with all the mods, but I'll use this opportunity to release a few minor features.

For complete list of changes, check this post for previous version. For reasoning behind them, check all the previous posts about the mod - however you're the final judge and you can selectively pick and choose whichever chances from the mod you like.

You can download it here.

Balance tweaks

Building monarch point cost reduced from 10 to 5. 10 was sensible if all these conditions were met:
  • Your empire was at most medium sized (like Scandinavia)
  • You had no extra sources of income (like with trade ideas)
  • You had no significant discounts on build cost (like with economic ideas)
If any of these conditions were true, and especially if two or more were true, then building instead of being about equally constrained by money and monarch points became purely monarch-point constrained and money became irrelevant. Changing cost down to 5 seems reasonably balanced for most countries, and you can get it further down to 4 if you take quantity ideas.

Partial westernization (going up to Muslim tech) now requires no rebel-occupied provinces. Apparently Ming somehow manages to get required stability +2 even while half of it is occupied by peasants.

Return Subject Core CB

Coming right from Crusader Kings 2 - if another nation occupies cores which rightfully belong to your subject (vassal, junior PU partner, or colonial nation), you now get CB on them, at the end of monthly tick.

CB is relatively weak if you want to use it for anything else than returning subject cores. It gives 0 dip cost for full annexation, since that's the only one you can get subject cores from OPM, you'd still need to have your vassal occupy their capital to get the whole deal for 0 dip.

There's no way to press any other subject CBs like fabricated claims, holy wars etc.

More reformable countries

Almost every culture's primary country is now reformable. Conditions are pretty strict:
  • you must have the right primary culture
  • you must own and have cores on every single province of that culture
  • admin tech at least 10
  • not subject, not tribal, not at war, at least 3 provinces
  • country you want to switch to isn't already formable in some other way (then use whichever way is already provided by the game)
  • your current country isn't on blacklist (Holy Roman Empire, Papal State, Hindustan, Mughals, Spain, France, Germany, Byzantium, Bukhara, Italy, Russia, Scandinavia, Persia, Great Britain, Polish-Lithuanian Commonwealth, Egypt, Vijayanagar) - it's here to prevent cycles of tag switching and other weirdness
  • you can't form Muscovy, which is technically Russian's primary culture - you should try to form Russia instead
  • you can't form Shun or Zhou - technically primary cultures of Han and Cantonese cultures - that would just feel really weird
Changing tag this way gives you centralization modifier for 20 years (+1 revolt risk, +10% tax), switches your idea group, and gives you 25 prestige. It's quite weak reward relative to effort, it's mostly here if you want to roleplay unusual scenarios.

Existing tag changing decisions are divided about switching idea group or not, and for some switches it makes more sense to go one way or the other. Here I'm switching it every time to provide you with a way out in case you start as someone with generic or otherwise really awful ideas.

AI will take this decision as well if condition are met. This doesn't happen often since conditions of controlling every province of given culture is pretty strict, but it happens from time to time. Naples forming Sicily is probably the most likely one to happen - and it makes a lot of sense as they were literally calling themselves "kingdom of Sicily" the whole time.

Everything is optional

As usual, all changes are independent from each other as much as possible, so you can cherrypick whichever changes you like and disregard the rest.

Compatibility with other mods

The mod is currently only guaranteed compatible with UI-only mods.

I've been asked multiple times about compatibility with CK2 imports, EVE, Extended Timeline, and other mods. Right now it requires manual merging, which shouldn't be too much work, and people have successfully done so.

I might someday write a script to merge these automatically and provide packages with both, but that's just a vague plan for now.

Thursday, July 17, 2014

Fun and Balance mod for EU4 1.7.0

~Cookiecat Green Eyes~ by ~Sage~ from flickr (CC-NC-ND)
The new patch is in, and the new version of my mod to fix everything about it follows!

Full list of changes this mod does with brief explanations follows. For more extensive discussion refer to posts for older versions.

You can download it here. (link updated, original release missed one election event and it was giving vanilla republican tradition penalty)



  • Truces last 5 years period.
  • Coring time independent of size
  • Bad events due to OE scale with OE instead of hard cliff at 101% OE


  • Can't reduce WE while at war
  • WE affects defensiveness and morale like it used to
  • AE decay restored to 4/year
  • No naval attrition due to time at sea, since AI already doesn't get any. You still get some from being at open sea.


  • Claim and core expiration times doubled
  • Foreign rebel support increased from +4 RR to +6 RR
  • Improve relations mission gives meaningful rewards, not just 3 prestige


  • No hard base tax max for diplovassalization, just regular squared penalty
  • Baseline free diplomatic relations doubled from 4 to 8
  • All ideas giving +1 diplomatic relations increased to +2
  • Emperor diplomatic relations bonus increased from +1 to +2
  • Annexed vassal penalty capped at -100 to avoid creating eternally unannexable vassals
  • Diploannexation cost lower to 1/bt since it's the last thing we want is making everything rely on monarch points more than it already does
  • Vassals can fabricate claims
  • Vassals willing to go up to 50% OE buying provinces they want, just like other AI countries
  • No protectorates ever


  • CK2-style holy sites system - if someone of your religion holds its holy site, you get +0.2% missionary strength modifier. It's extra +1% missionary strength and +1 prestige/year if all 5 sites are in hands of countries of your religion. You can conquest mission on holy sites if they're hold by your neighbour or if you have religious ideas.
  • Religious conversion rates rebalanced into flat +2% heretic, +1% heathens, +4% pagans instead of really complex systems that make it easier to turn Catholics into Sunni than Shiites into Sunni and was generally awful.
  • 50% discount on enemy core creation on pagans restored
  • Cleansing of heresy CB gives 25% cost for forced conversion so you can convert country of any size with 100% warscore, but it no longer any discounts on taking provinces
  • Religious center down from -5% to -2% missionary strength
  • Religious conversions allowed between all branches of Christianity, all branches of Islam, all branches of Eastern, and cross-group between Hindu and Buddhist (you can chain Sikh-Hindu-Buddhist-Shinto if you really want to). As in vanilla Muslim conversions cost stability, others just prestige.
  • Missionary strength bonus from stability increased from 0.5% to 0.7%
  • RR due to lack of religious increased from +2 to +5, scaled proportionally


  • Culture gain/loss threshold both at 10% instead of 20% gain/10% gain, so it's more predictable
  • Non-accepted culture revolt risk increased from +2 RR to +4 RR
  • Culture conversion cost reduced from 25/bt to 10/bt


  • Imperial Ban CB lowers AE to 10% for imperial provinces
  • HRE members converting to and from emperor's religion affect IA


  • "Ruler of Burgundy dies" nonsense killed completely
  • Burgundy capital moved so it starts in HRE like it did in EU3 and real history, and doesn't get crushed by France immediately every campaign


  • Muscovy no longer gets free colonists from national ideas, they need to take expansion or exploration for it


It tested well with previous EU4 versions where republics were ridiculously weak, I'm not sure if this plus 1.7 / Res Publica changes won't make republics a bit too powerful.
  • Republican annexations cost only -3 tradition not -10
  • EU3 style elections - random instead of fixed candidates, reelections don't give any stat boost, but only cost -3 instead of -10 tradition.


  • Steppe horde bonuses increased to +100% manpower, +100% force limits, -50% land maintenance (it sounds like much but they still lose hard most of the time, since they never get new units, tech slowly, and have massive succession problems)
  • Manchu can form Qing, Timurids can form Mughals, and hordes with correct culture can form Persia even if tribal - then they become despotic monarchy
  • Other hordes can reform government without any idea groups (since AI is hardcoded not to take them ever, so basically AI never reformed horde government). Stability 3 requirement lowered to stability 2 at admit tech 8.

Rest of the World

  • Westernization time does not depend on country size
  • Advisor cost increases 0.5%/year not 1%/year, it was too brutal for non-Western countries
  • Partial Westernization decision - you can go Muslim tech if you neighbour Muslim or higher tech nation, and have stability 3 (or stability 2 at admin tech 8+), at cost of 10 years of Western influences, -5 stability, and -250 of each monarch point.


  • Potential policies are displayed when (UI only change)

Choose your own destiny

  • If you want to form Byzantine empire as Ottomans, or HRE, the game will no longer stop you

Country management

  • Policies don't cost monarch points and you can have up to 10 of them active, to make them more relevant and to help AI which picks them at random.
  • Moving trade port reduced from 300 to 100 dip since many countries start with trade ports in wrong places
  • Peasant war trigger conditions made more meaningful
  • Level 1-4 buildings are not destroyed on conquests

Monarch points

  • Monarch power pools increased to 1500 to reduce micromanagement around ahead of time penalty

Everything is optional

As much as possible, each change in the mod is independent from everything else, so if you like you can cherrypick changes you want while keeping vanilla values, or values of your own choosing otherwise.

Thursday, July 03, 2014

Fun and Balance mod for EU4 1.6.2

Here's the new update. You can download it directly here.

For full list of changes read 1.6.1 (b) and 1.6.1 (a) release notes.

Philosophy of this mod is to move focus towards mechanics which lead to fun gameplay without requiring overly gamey tricks from the player, and to restore balance by helping the too weak, more than nerfing the too strong.

Other than taking away Muscovy's free settler (which isn't even a huge deal, since AI Muscovy takes exploration ideas first), there aren't really any outright nerfs included.

Helping Burgundy

Burgundy starts in extremely perilous position between hostile HRE and extremely powerful France, and even with event that magically split it between France and the emperor (at 0 AE, free cores etc.) removed, it still rarely succeeds.

To give it better chance, the mod now moves Burgundy's capital to Franche-Comte, so it's a legal HRE member.

Historical situation is somewhat ambiguous here as feudal relations were complex, but making Burgundy HRE member as it vas in EU3 should greatly increases its chances of early survival against the Big Blue Blob without making it too powerful.

Helping Republics

Integrating a vassal no longer costs any republican tradition, only legitimacy. Tradition is extremely hard to get compared with legitimacy, penalties for it start as soon as you go below 100% (instead of only below 50%), and republics are really weak even with the mod reversing the most extreme nerfs, so there's no reason to punish them in another way by making significant vassal annexations impossible.

Helping AI

Advisor cost increase by year cut in half. It was extremely brutal, especially to non-Western tech countries, as incomes increase with tech level not with time, and not that fast even then. Even relatively sizeable non-player Western-tech countries had trouble paying for advisors, so only players with their vast and optimized empires were able to afford good advisors.

And now it's possible to have up to 10 active policies (instead of up to 5), and they no longer cost any monarch points. That's mostly here to help AI, as most policies are borderline worthless (-1 dip/month for -10% shipbuilding time etc.) and AI picks them basically at random, but it makes sense to reward different combinations of idea groups instead of making policies so expensive (in terms of most important resource - monarch points) that they'd almost never see any gameplay.

Deemphasize Unfun Mechanics

The mod uses 1.6.1's AE decay values (4/year), not 1.6.2's (2/year). It's easy to get very high AE levels now that vassalization generates huge amounts of AE, but at least decay was quite fast, so it balanced out somewhat.

With high AE from vassalizations with slow decay the game would end up with permanent global coalition against the player like it did in many previous patches, and that's not a fun place to be.

Emphasize Religion

Negative consequences of less than full religious unity increased from +2% revolt risk to +5% (+100% stability cost remains where it was), scaled proportionally. Conversion is usually (not for everyone) slightly easier in this mod due to missionary strength rebalance, and in recent patches there are many ways to increase religious unity even without conversion, so it's much easier to achieve high religious unity than it used to. In my experience religious unity is one of more fun mechanics, and its vanilla values are just too low, so it deserves a big boost.

And to give player more control over their destiny, more religious conversions are possible. Orthodox and Coptic can convert to and from all other Christian denominations. Eastern religions (Shinto, Confucianism, Buddhism) can convert to each other, and additionally Hinduism and Buddhism can convert to each other crossing religious group divide (so you can build a chain Sikhism-Hinduism-Buddhism-Shinto if you really want to).

Muslims can also now convert to each other, except the cost is -100 piety and -2 stability instead of -100 prestige, in line with already existing decisions to flip between Shia and Sunni (which has unnecessarily difficult preconditions).

Pretty much all the conversions enabled here happened multiple times historically, and they just give more gameplay options without breaking balance.

I tried to make sure that religion-specific country modifiers which ought to clear do clear, but it's very likely that I missed some of them. If you see a country modifier remaining which should be gone after conversion, just report it as a bug.

Emphasize Other Fun and Underused Mechanics

Mechanics which lead to interesting gameplay but don't see much action got emphasized.

War Exhaustion now reduce morale and defensiveness as it did before pre-1.6. In vanilla 1.6 War Exhaustion has no military significance whatsoever, it's basically just revolt risk increase, and that makes its offensive use basically pointless.

Culture conversion cost is lowered to 5/bt from previous values of 10/bt (which was still too high) and vanilla's completely insane 25/bt. I still don't expect it to be used much.

Improve relations mission gives 10 prestige and 25 diplo instead of just worthless 3 prestige. It might be a little much, but then insult rival mission is way easier and gives similar amounts, and a mission without meaningful rewards is just wasting mission slot - you should always have 3 meaningful missions to choose from.

Other Tweaks and Fixes

Vassal annexation relationship penalty capped at -100, as it led to far too many ridiculous situations at -200, where vassals became pretty much permanently unannexable and had to be released from vassalage , annexed, and released as new vassals if you ever wanted to annex them.

Various bugs in tribal government reforms should now be fixed.

Everything is optional

I isolated each change as much as possible, so you can pick whichever parts of it you like and skip the rest. Pretty much the only part that's a bit harder to isolate is rebalancing missionary strength, but even that is not that hard.

The mod is not tested for compatibility with any other mod. It should work with UI-only modes, but it will probably require manual fixing for anything more complex.

Saturday, June 28, 2014

Fun and Balance mod for EU4 1.6.1 - now with holy sites and partial westernization

Tired white tiger cub by Tambako the Jaguar from flickr (CC-ND)
So I just finished full campaign as Dai Viet with this mod, and while I liked a lot of things, a few really need changing, so I'm releasing new version of the mod.

I'm not sure if I should keep calling it "minimod" since it's getting more and more content with each patch, but I'm still trying to keep the spirit "like vanilla except fixed", not going into totally different experience, but I'm not above stealing good ideas from EU3 and even occasionally CK2.

You can read about previous version here.

For just download click here.

Minor changes

First, a bunch of minor bugfixes, balance tweaks, and in particular reverting ridiculous westernization nerfs the 1.6.x patch introduced.
  • Correctly got rid of protectorates this time.
  • Forming Qing/Persia/Mughals now changes government to despotic monarchy.
  • Peasant War trigger conditions made more relevant. Now if it happens it's really your fault, not just the game being mean to you.
  • Neighbour bonus increased to -5%/tech level (1.5 levels), with max increased to -50% (to make westernization worthwhile)
  • Completely removed size-based westernization speed penalty
  • Tribal government reform stability requirement moved from +3 to +2 (effect does -5) - AI can't plan to get to +3, so it wouldn't do that even if it ought to.

Religion rebalancing

1.6 introduced separate missionary strength bonuses against heathens and heretics, so it's now finally possible to fix a lot of ridiculousness of vanilla - like Catholics being trivially easy to convert to Sunni, but Shia to Sunni being pretty much impossible.

All ad-hoc per-religion missionary bonuses are thrown away. Previously base values were:
  • Pagans 4%
  • default 2%
  • Orthodox, Sikh 1%
  • Muslim, Shinto, Coptic 0%
Now base strength modifiers are:
  • Pagans 4%
  • Heretics 2%
  • Heathens 1%
which improves gameplay basically everywhere different religions meet, while making far more sense.

Some other tweaks to conversion rates:
  • Important religious center is only -2% penalty, not -5% like vanilla (already in previous versions of the mod, just repeating it here for context)
  • Positive stability gives +0.7%/level, up from +0.5%/level, so if you really want to burn your admin points to speed up conversion, you're welcome.

Holy Sites

And most of all - EU4 now has holy site system very similar to CK2. Each holy site religion controls gives +0.2% to missionary strength. If a religion has all its holy sites, all countries of that religion get +1.0% missionary strength and 1 prestige/year on top of that (that is 0.0%, 0.2%, 0.4%, 0.6%, 0.8%, 2.0% going from 0 to 5).

Getting all five is not supposed to be easy - more a serious mid-game goal. Bonuses for partial control should give you interesting reasons to support other countries of your religion in their fights against infidels - something that vanilla EU4 was severely lacking, unlike CK2.

All sites are intended to have some level of historical plausibility while leading to some interesting gameplay. I'm definitely looking for suggestions, but gameplay takes priority over historical plausibility every time.

All Muslims:
  • Mecca
  • Jerusalem
  • Cordoba
  • Constantinople
  • Karbala
Medina is a pretty obvious one missing, but it would be too easy and sitting next to already existing holy site. Since Constantinople falls within first few years of the game anyway, including Mecca, Medina, Jerusalem, and Constantinople (as we'd like) would get really close to completing the set with very little effort, so for gameplay reason one of them needs to go, and Medina it makes most sense to cut Medina.

Karbala is a Shiite holy city, so it would lead to some fun Sunni-Shiite conflict. Cordoba is included to make Muslims somewhat interested in face of Granada and reconquista - something that was completely irrelevant usually.

All Christians share Jerusalem, Rome, and Constantinople for obvious reasons, and additionally:

  • Macedonia (Mount Athos)
  • Kiev (mostly for gameplay reasons)
  • Alexandria (for gameplay reasons)
  • Tigray (location of Ark of the Covenant)
Catholics, Protestants, and Reformed:
  • Galicia (Cathedral of Santiago de Compostela)
  • Kent (Canterbury, mostly to give Protestants something to do here)
I don't see how any Christians could not have Jerusalem and Rome as holy sites, and Constantinople is really good for both historical plausibility and gameplay, but the remaining two are a bit random. Choosing Protestant and Reformed sites also runs into a problem that reformation in game can start in very different places than it historically did.

For Hindus/Sikhs I just picked some plausible shared sites (based on just a bit of Wikipedia research) with a bit of geographical spread:
  • Jaunpur (Varanasi - Hindu)
  • Coromandel (Chidambaram - Hindu)
  • Gujarat (Palitana - Jain)
  • Siem Reap (Angkor Wat - Hindu and Buddhist)
  • Punjab (Harmandir Sahib - Sikh)
And likewise for Buddhist/Confucians/Shinto:
  • Bihar (Bodhgaya - Buddhist)
  • Shandong (Qufu - Confucian)
  • Owari (Ise Jingu - Shinto)
  • Siem Reap (Angkor Wat - Hindu and Buddhist)
  • Gyeongsang (Bulguksa - Buddhist)
I'm definitely looking for better ideas here, and they don't need to share same sites with other religions in their group. However, remember that gameplay wins over historical plausibility, so we don't want 5 Shinto holy sites all in Japan.

Pagans don't get any, since "Animist/Shamanist/Totemist" are not real religions, just some loose agglomerations of vaguely related beliefs.

You can get missions to conquer holy sites held by infidels if you're neighbour of their holder (even if you don't neighbour the site directly) or you have Deus Vult religious idea. AI in tests has been fairly bad at doing such missions, but then AI can't usually even get its cores back.

Partial Westernization

And for the second big change - any country with less than Muslim tech can now partially westernize up to Muslim tech as long as it has Muslim or higher tech neighbour, loads of points and stability it's willing to lose, and is willing to take 10 years of Western influences (+10% revolt risk, +50% advisor cost). Nomads can't use it as they have their unique "Reform the Government" decision which also upgrades them to Muslim tech, and works along very similar lines.

It doesn't matter if you're ahead or behind on tech - that part never made much sense to me, and nomads can already move to Muslim tech without any such conditions by reforming their government, so I don't see why others couldn't.

Muslim tech means you no longer suffer from -1 or -2 monarch point production penalty, just tech penalty, and that's huge. Going from Muslim, Eastern, or Ottoman up to Western will require regular westernization - or you could just go for full westernization without intermediate steps if you prefer.

AI is surprisingly good at using this decision. Sometimes it collapses to rebels, but often it manages to survive rebellions and use its new tech group to its serious advantage.

Everything is optional

Different changes in the mod are isolated as much as possible, so if you like only some of them and not others you'll be able to cherry pick to your liking relatively easily.

Saturday, June 14, 2014

Samsung Galaxy Note 10.1 2014 Edition first impressions

Galileo by Erick Nava Riefenstahl from flickr (CC-NC)
It's not a serious review, just a collection of observations from two day with the tablet.

We need to stop designing for mobiles. When I did some browsing on it, far too many websites autoredirected me to their "mobile" domain which was awful shit compared to the desktop version. There's an option in the browser to make it request desktop version, but it doesn't always work. Every year "mobiles" get closer and closer to desktop quality. Instead of wasting all the time designing "for mobiles" just wait and the problem will solve itself. Remember garbage like WAP early adopters of mobile web did? All gone. Remember all low-resolution designs? All mid-level or higher phones and tablets are 200ppi+ these days, usually closer to 300ppi. 10"+ tablets should be treated the same as laptops today, end of story. For smaller tablets or high-end mobiles it makes some sense to have special mobile version, but the win isn't really that big for most sites. Low-end or old smartphones still sort of need those mobile sites, but unless you're targeting Nigerian market, just wait couple years and everybody will upgrade their phone to something decent.

Samsung should just reassign to another position whoever is coming up with names like "Samsung Galaxy Note 10.1 2014 Edition" before they release "Samsung Galaxy Note 10.1 Early 2015 Edition Gangnam Style Special Deluxe Edition".

It's insane how many passwords I have to enter to get everything running. I'm so grateful for each app which I can just authorize via my Google account. Of course when everything on the Internet can be accessed via Google authorization, NSA won't even have to bother to hack everyone, they'll just hack Google (or find a hole in oauth2) to authorize themselves as you to everything.

VLC for Android does exactly what I want, that is fast playback with pitch correction (you need to turn on pitch correction in settings). I know I probably sound obsessed about that, but there's only 24 hours in a day, and the last thing I want to use them on is slow narrators.

Maximum sound volume of the tablet is surprisingly low, and VLC doesn't go over 100%, which it very much should if the source is encoded at very low volume (like most stuff off youtube).

It's confusing that it's charged via USB cable, but I need to use special charger, not a PC or a regular charger. I understand technical reasons - USB puts limits on how much current devices can request, and tablet's huge battery just wants a lot more - but it's extremely annoying. Wasn't USB3 standard supposed to fix this?

Twitter's Android app is phone-only and doesn't work with tablets, and they don't have official tablet app. That's so weird. I'll have to give all the unofficial client apps a try.

I'll need to get myself some kind of folding case like Kindle Fire has, so I can watch stuff in bed while eating with one hand and petting the cat with the other. That's sort of why I got myself a tablet.

I wanted to read comic books on the tablet, but a lot of scans are very low res, so on high res screen I can see JPEG artifacts better than text itself. Fairly disappointing.

It is way better for reading PDFs (mostly research papers, which tend to be high quality PDFs, not low quality scans) than epaper Kindle I tried for it before.

Airdroid is pretty bad at transferring big video files over wifi, and doesn't know how to resume. It's just faster to connect the damn USB cable than retrying a few times.

XCOM for Android is confused by high resolution and keeps zooming up far too close. It looks like an OK game, but I can't get myself to play with it - not only due to lack of Enemy Within, mostly due to lack of Second Wave options I unlocked ten fucking times on desktop (Steam) version. Absolutely Critical (should be unlocked!!!) and Aiming Angles (unfortunately Enemy Within only) double tactical depth of the game. I wish there were more games on that - most genres don't map that well into tablet interface, but strategy games like Civilization 5 would be just awesome.

My cat likes the tablet a lot more than the laptop. I still need to hold the tablet is awkward positions sometimes for cat's convenience, but it's better than trying to watch something on a laptop while the cat is sitting on its warm keyboard.

SwiftKey keyboard is much less convenient to use than on the phone - on the phone gestures are relatively fast and require just finger movement, but swiping your fingers through tablet keyboard requires moving the whole hand, and it's not great.

Rockbox - just another Open Source UX design failure

Two freebies with my shipment from Xerox (Cosmo and Wanda) by cseeman from flickr (CC-NC-SA)
Rockbox is an Open Source replacement for various "digital music players" I tried on my Sansa Clip Zip recently.

Their choice of words here is interesting - originally these devices were fairly accurately known as "mp3 players", but it got a bit silly since they could play audio files in a lot of other formats.

Wikipedia simply calls them digital media players, which is very sensible since many of them can play video as well (usually badly), but since it's a fringe use and they're generally used for just audio, why not call them "digital music players"?

Because audio is not just music. And Rockbox is designed as if it all was.


And that's a single word summary of everything that's wrong with Rockbox - audiobooks. It doesn't have dedicated audiobook mode like stock Sansa, or pretty much every other media player these days. And the reason a player would need an audiobook mode is that while from technical point of view playback of an audiobook chapter file is pretty much the same as of music file, UX has nothing in common.

In audiobook mode:
  • You absolutely need high speed playback, pitch correction being highly desirable
  • You absolutely need automatic per-audiobook resume function
  • You never want random navigation - it's always whole audiobook start to finish
  • You probably want filesystem navigation
  • You want UI lock while it's in your pocket, since it's a massive pain if one click resets you to start of the chapter or even audiobook
  • For podcasts it's the same except you might want per-chapter instead of per-audiobook resume if you're listening to multiple podcasts from the same source simultaneously
In music mode:
  • You absolutely need to play at normal speed and pitch
  • Nobody cares where you were last
  • You probably want shuffle most of the time
  • You might want playlists, including on the go playlist you can add things to while they play
  • You might want per-song repeat
  • You might want per-artist per-album or per-genre navigation
  • You probably want per ID3 tag navigation, not filesystem navigation
  • You don't care about accidental keypresses
  • If you go shuffle, you want your entire music collection, but you definitely do not want audiobooks and podcasts in the mix
In Rockbox by default everything is set up for playing music. If you decided to start listening to some audiobooks instead you'll need to spend a minute in menus to fix all settings (shuffle/repeat off, speed 150%) then manually create bookmark when you want to stop listening to an audiobook at do something else. Now that bookmark thing is totally insane, so fortunately I found some way to make them autoresume.

It still seems to lack functional lock system (Sansa's lock by short press on power button does not work any more), no pitch correction (there were some patches, never merged, no longer apply), it resets speed settings to 100% when it goes to sleep sometimes, and I just gave up on using it as music player ever.

The only reason stopping me from just restoring stock firmware is that Rockbox can go to higher playback speeds than Sansa's "Fast" (about 140%), and that's probably worth slightly more than having audiobook player also play music, but I'll probably end up doing that anyway.

It's Open Source, why don't you fix it?

Well, I have neither time, nor any desire to touch C code unless I absolutely have to. And even if I did, how many times an Open Source project accepted third party fixing their UX design? I can't think of a single such case.

Monday, June 09, 2014

UK income tax bands

Presenting His Royal Highness King Milo the First! by Malingering from flickr (CC-NC-ND)
You'd think that a question like - what are the income tax bands and rates in UK - would have an extremely straightforward answer you can check on government websites or Wikipedia. And you'd be wrong.

Between income tax, National Insurance (second income tax), and personal allowance phaseout the rates are nothing like what they seem at first (20%, 40%, 45% - yeah right).

Here are the rates I calculated:
  • £0-£7955 - 0%
  • £7955-£10,000 - 12%
  • £10,000-£41,860 - 32%
  • £41,860-£41,865 - 22% (yes, it's a £5 wide tax band)
  • £41,865-£100,000 - 42%
  • £100,000-£120,000 - 62%
  • £120,000-£150,000 - 42%
  • £150,000+ - 47%
In other words - WTF?

The tiny 22% tax band is an artifact caused by the primary income tax being calculated based on annual income, and the second income tax based on weekly income. Assuming 52 work weeks a year, their bands are just slightly misaligned, but if you work fewer weeks a year, this band can widen and you could be paying a lot less in taxes. I'm not entirely sure how that works in practice.

Conversely, 12% band is due to much larger misalignment between two income taxes, and it could widen a lot if you have high weekly wages, but work less than full year, so you'd end up paying no income tax, but lot of NI.

Even weirder case is the 62% band. It's regular 40% rate + 2% NI rate + 50% reduction of personal income allowance which gets retaxed from 0% rate into 40% rate, which is de facto third income tax of 20% applicable only for income between £100k and £120k.

Now, there are many legitimate arguments against income taxes in general, including:
  • high income taxes (especially that 62% rate) generate serious disincentive to work
  • taxing annual income means self-employed people whose income changes from year to year end up paying a lot more than people with stable income
  • taxing income instead of wealth means rich people can technically have low "incomes" and pay very little, while people with just salary and no wealth whatsoever and paying a ton
  • tax bands make no adjustment for cost of living depending on region - so a person living in London will end up in higher tax band at standards of living much lower than a person living in the middle of nowhere - resulting in another way how London subsidises the rest of UK
  • bankers making millions are probably all paying much lower rates than the middle class since they can hire some tax avoidance lawyers and there are convenient tax shelters located just next to the UK.
But even ignoring all that, why the hell can't we just fold three taxes all into a single tax, with monotonic bands?

In all these calculations I'm ignoring 4th income tax - employer's NI contribution, as it's technically not part of gross wages, even though economically it doesn't matter what numbers are printed on the payslip, only how much employer pays before taxes, and how much employee receives after taxes.

And a bonus question for behavioural economics exam: Would marginal income tax rates be more or less disincentivizing if people have no idea how much tax they're paying because taxes are so damn complicated?

Monday, June 02, 2014

Fun and Balance minimod for EU4 1.6.1

Wild Kitty 5, 30 May 14 by Castaway in Scotland from flickr (CC-NC)
Here's updated version of the Fun and Balance minimod. 1.6.1 introduced a lot of changes to the game, unfortunately also breaking it in half. Here I'm trying to salvage whatever is good about it while fixing the rest as much as possible.

The goal of this minimod is not to make any sweeping changes - just do the least necessary to make the game balanced and fix unfun mechanics.

I sometimes feel I do more balance playtesting of my minimod than Paradox does of their patches (as in - some is more than zero).

Download link.

New changes in this version

  • Coalitions - previous versions of the mod removed them, but I'm going to keep them this time. AE levels got totally rebalanced, and they seem to be much less excessive, so it might be worth a try. If they turn out to be still broken, AE could be tweaked, or they could just go away completely again.
  • Free relations increased from 4 to 8 (previously 6), all bonuses which got nerfed from +2 to +1 in the patch back to +2. Even increased it was pretty low, and the patch makes acquiring and keeping vassals more expensive than before.
  • Diploannexation costs reduced from completely ridiculous 15/bt to 1/bt
  • Cost to move primary trade port reduced from 300 to 100 dip, mostly because so many countries start with misplaced trade ports (and moving capital is only 200 adm)
  • No diplovassalization base tax cap - since penalty is quadratic in size, it's very hard to abuse this.
  • Muscovy/Russia does not get free colonist from national ideas. They got massive boost by annexing Perm a lot faster, which ends up in them colonizing all of Siberia much earlier than in previous patches. This somewhat balances that out, but even with the nerf Muscovy is still way too strong way too early.
  • You don't need any idea groups to reform tribal government, just 200 adm, 90 legitimacy, and +3 stability. Forming Mughals / Qing / Persia also reverted to not require reformed tribal government. It was already extremely hard for AI to do that.
  • Pirates who annoyed me so much are no longer there, replaced by the new privateer system! (well, if you have all the DLCs at least)

What I couldn't fix about the new patch

I wanted to make diploannexation to take longer (that why I want it cheap and with high limit - so you keep more vassals longer instead of mass annexing them ASAP), but that's hardcoded. This isn't really a huge deal, and if annexing vassals turns out to be too easy vassal annexed diplomatic penalty can simply be tweaked higher to make things right.

I also wanted to allow wider selection of rivals, but that's hardcoded as well. I really like power projection system, the only problem with it is how narrow and forced rival selection is. If you could choose from more potential rivals, it would be really good, but right now it only gets halfway there.

Previous changes

Detailed explanation in older posts - 1.5.0, 1.5.1.
  • Buildings level 1-4 not destroyed on change of ownership
  • Important religious center penalty reduced from -5% to -2% missionary chance
  • Steppe Horde bonuses increased to +100% manpower, +100% land force limit, -50% land maintenance.
  • Non-accepted culture penalty increased from +2RR to +4RR - this might be too much with new nationalism system
  • Can't reduce war exhaustion while at war
  • No naval attrition due to time at sea at any tech
  • Cleansing of Heresy CB doesn't allow any province taking, but allows forced conversion at 25% cost
  • Imperial Ban CB only generates 10% AE for illegally held provinces
  • EU3 style republican elections (3 random candidates + incumbent, no skill changes or tradition loss on reelection)
  • No Burgundian inheritance events
  • High OE events increase with OE smoothly instead of massive cliff at 101% OE
  • Foreign rebel support increased to 6% (3% in old patches, 4% in current patch)
  • Accepted culture gain/loss thresholds both 10% for greater predictability
  • Monarch point pool increased to 1500 to reduce tech micromanagement
  • Culture change cost reduces from 25/bt to 10/bt
  • Cores and claims last twice as long
  • Coring time does not depend on size (supposedly new patch already does it)
  • No protectorates, can vassalize anyone
  • Vassals allowed to fabricate claims
  • Vassals will buy provinces from overlord if they would as independent countries (it seems new patch already has that)
  • Vassals will buy provinces up to 50% OE just like independent countries (limit was bugged in previous patch and they'd buy at any OE)
Enjoy. I fixed what I could, but for truly balanced experience we'll need a lot more modding support from Paradox.

Saturday, May 31, 2014

Bechdel test and Magic: the Gathering

Warning: Do not treat this post seriously.

Bechdel test is a famous test for female presence in movies, but it can apply just as well to any other work of fiction.

So I had this thought - Wizards of the Coast has pretty good reputation when it comes to gender balance in their storyline, but how well would actual Magic: the Gathering decks do at passing the Bechdel test? So here's the equivalent test for decks:

  • It contains cards representing at least two female characters - creatures, planeswalkers, or spells clearly featuring female characters in name, art, and/or flavor text (multiple cards representing the same character like Chandra, Pyromaster and Flames of the Firebrand only count once); the character does not have to be named or human (but it should generally be some kind of humanoid at least)
  • which interact with each other
  • and the interaction is not about some man (like both counting as devotion to the same male God)
And let's now evaluate a bunch of decks.
The deck is one big sausagefest - all of its creatures are either male or monstrous and of unspecified gender, and their only interaction is being devoted to Erebos, God of the Dead and his Gray Merchant of Asphodel.

The only female presence in the deck is an occasional Pharika's Cure sideboard, but that card doesn't really count since it actually shows Solon, (male) acolyte of Pharika, and even if it did it won't be curing any of course creatures.

Score: Fail. (and its Bg and Bw variants aren't any better)
The central character in the deck is Thassa, God of the Sea, and some of her supporting characters like Tidebinder Mage and Hypnotic Siren are female as well, and between their devotion, and Thassa making them unblockable and helping them with her Bident, interactions are pretty strong.

Score: Pass.
This deck depends on the build. The deck is very light on creatures, and central two characters are Elspeth, Sun's Champion and Jace, Architect of Thought. Other popular characters are Aetherling, Nyx-Fleece Ram, Mutavault - none of them female.

The deck occasionally plays sideboard Archangel of Thune, and Elspeth's ultimate sort of interacts with her, or Archangel's ability can help Elspeth's soldiers (but not Elspeth herself). This could count if Archangel was a common mainboard card, but it feels too weak.

Score: Fail (some builds arguably weak pass).
The deck doesn't feature them directly, but Chandra and Aurelia both feature in art of many cards.

Cards in the deck rarely interact with each other, other than by all burning opponent's face, but Warleader's Helix bringing back Chandra's Phoenix from the grave technically counts. 

Score: Pass.
People were totally obsessed asking if Domri Rade is a boy or a girl, but word of god is that he's a he - it would have made matters simpler if they decided otherwise, since Domri interacts with every creature in your deck, but let's look at the rest of it.

Sylvan Caryatid and Courser of Kruphix seem female, as far as I can judge plant and centaur anatomy, and Caryatid can tap for mana to cast Courser, which is a fairly weak interaction.

Looking at sideboard, the deck sometimes features Nylea's Disciple, Vraska the Unseen, and Chandra, Pyromaster. Nylea's Disciple interacts with all your green cards via their shared devotion to Nylea, God of the Hunt, and Chandra's synergy with Courser of Kruphix is just amazing.

These interactions aren't very strong or involve SB-only cards, but there's lot of them.

Score: Pass.
This deck is just filled with creatures but except for Thrill-Kill Assassin (also knows as Massacre Girl) none of them are women.

Score: Fail.
The deck features Bassara Tower Archer and Gladecover Scout, but the very point of the deck is that they're hexproof and don't interact with anybody ever. They only make exception for Ajani.

Score: Fail
The deck generally includes Pharika, God of Affliction, and all the creatures in it are devoted to her, and she returns the favour by turning their dead bodies into poisonous snakes... People can be weird like that sometimes.

Some builds try to work without Pharika, and while there are some minor interactions, I'd say they generally fail the test.

Score: Pass (for Pharika builds).


Of decks I checked 4/8 passed. That's honestly a lot more than I expected.

While I was checking various decks another thing became clear - while other colors have decent cast of female characters, black seems to be very heavily male-dominated. Think of it what you will.

Friday, May 30, 2014

Gain more time by consuming media faster

TJ by mag3737 from flickr (CC-NC-SA)
Pretty much everybody spends inordinate amount of time consuming various forms of media. In the era of TV and paper books you had very little choice about the pace at which you can consume the media, and they were designed with low speed so that even people who process things more slowly (like all the old people) could handle it.

Fortunately we moved way past that era, and now you can simply speed things up.
  • For podcasts / audiobooks, your mp3 player (here's one I use) probably already has a function to speed things up. Use it.
  • If it doesn't, or it provides insufficient control, you can also use external utilities to adjust speed. I wrote a really simple one for OSX / Linux. 1.4x speedup is a sensible default for me.
  • For youtube videos, first download them (also saves you all the time waste of youtube UI), then play them in any video player which supports faster playback, like mplayer. For artsy stuff like movies 1.2x is probably the most you want before it starts to derail artistic intend, for informational stuff like news and let's plays 1.4-1.5x is fine.
  • If you want to watch on your phone, there are player for that too. (YMMV here, DicePlayer did some crashing for me, so feel free to recommend any alternatives)
  • Ebooks are typically faster to read than paperbooks due to less physical manipulation necessary.
  • Audiobooks might not be as fast than paperbooks/ebooks, but there's a lot more time a typical day when you can't really read a paperbook or ebook, but can listen to something, which is another way to increase your media consumption speed. Make use of all the commuting / shopping / waiting for tests to finish time. A big problem with that kind of segmented time is that books which were not designed for it might be really difficult to keep track of what's going on, since you're basically reading a few pages at a time. Most podcasts, lectures, and other nonfiction work perfect, as does quite a bit of fiction depending on writing style.
  • If you spend a few hours a week doing low/medium intensity exercise (as recommended by the doctors etc.), it's often possible to setup some audiobook or (for stationary exercises like treadmills) some relevant video to keep your mind engaged. Even if you exercise in the gym and not at home you can probably bring a tablet and wireless headset with you - something which was not realistic even just a couple years ago. It depends on what kind of exercise that is, and if it requires high intensity or high focus just stick to music for your safety. 
  • Speeding up video is straightforward and doesn't cause any issues. Many simpler and older methods for speeding up audio alter its pitch, which takes some getting used to, but is really not a big deal. Mplayer speeds up any audio or video without altering pitch - you'll still hear some distortion at 1.5x or faster speeds.
That's going to save you so much time which you'll be able to use to do amazing things you never had a chance to, right? Well, not quite... You're most likely just find a lot more new fun media to consume instead, ending with as little time as you had before, but once you speed things up going back to "normal" speed is like going back to Internet with ads on it.


Saturday, May 24, 2014

Medieval 2 Total War Concentrated Vanilla on github now

Caithlin resting by Finn Frode (DK) from flickr (CC-NC-SA)
I did a bunch of fixes to mod builder:
  • The mod builder searches in a few standard locations for game installation in addition to checking Windows registry
  • included cheri gem manually updated to work with Ruby 1.9/2.0 syntax, so it's now compatible with new versions of JRuby
  • concentrated_vanilla.reg file included so you can tell Steam launcher about the mod even if mod builder doesn't work for some reason
and uploaded it to github together with all the history.

The mod itself didn't change in any way.