taw's blog

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

Tuesday, September 29, 2015

Modern Times mod for Crusader Kings 2 - feudal politics of 1818-2015

A few weeks ago I released very alpha version of Modern Times mod. It's been since updated, and now spans the whole 1818-2015 period, nearly whole century more than it originally did. A lot of countries got historical rulers, a lot of bugs have been fixed, and many mechanics like de jure realms and automatically generated vassals are now much more sensible.

If you're impatient, you can get it from Steam Workshop (more screenshots over there as well) or as direct download. Enjoy the game.

If you're interested in some behind the scenes information, keep reading.

What Modern Times mod is about

The mod intends to extend CK2 timeline. It originally just covered 1900-2015 period, currently extended to 1818-2015, but there's no special reason to stop there. I would like it to eventually extend back further.

I'm not sure how far back it will go. Probably not all the way to end of CK2 timeline, but there's no good reason to stop in 1818. It could easily go all the way back to Peace of Westphalia someday.

The mod has no plans to ever be AGOT style total conversion. Right now it touches very little other than province history. It will eventually add some period-appropriate mechanics for flavour, but it will be the same game.

The mod definitely doesn't intend to be "realistic". It is inherently silly.


The mod currently uses vanilla map, and tries its best to model independent countries on it. There's a lot of cases which are difficult to model. Most tiny countries like Kosovo, Lichtenstein, or small HRE minors are not included, but a few with particular historical significance like Free City of Danzig and Vatican are extended to cover whole county around them. Many real world borders cross province boundaries, so in game borders will look a bit weird.

It's often not clear who counts as independent country. Vassals and protectorates are mostly simply included in liege country. The mod currently doesn't use tributaries.

Border changes generally taken at peace treaties, or at least long term truces, so mid-war changes generally not taken into account.

Vassals are almost all automatically generated - with every de jure duchy getting one vassal (duke if liege controls majority of duchy, multicount otherwise).

A few notable exceptions like Soviet member Republics, Egypt under Ottomans, Jordan under United Kingdom, and devolved Scotland follow historical patterns, but for now this is exception rather than rule. British India is divided into vassal kingdoms ruled by locals as a somewhat messy workaround for vassal limit.

High levels of historical accuracy is probably not possible with vassals, as we have very few tiers to work with, most countries were historically divided into far more subdivisions than we have vassal limit to work with, and even for some really obvious subdivisions (like Sweden/Norway PU) it wouldn't make much sense to have junior partner as vassal.

Some countries have been renamed to better fit history - like "Wendish Empire" to "Commonwealth", or "kingdom of Bavaria" to "kingdom of Austria". For now no new countries have been added. Many historical "kings" and "dukes" went down a tier to better match their actual size. De jure map was adjusted somewhat, but it mostly follows CK2.

International organizations are not modelled in any way. For that matter if mod extends to times before HRE dissolution, HRE probably won't be modelled as a country, as it was a largely titular thing for very long time by then.


Mod currently includes 428 historical characters as well as 26565 automatically generated characters - rulers for countries without history, vassals, and some randomly generated children for everybody. Most important countries (including all empire-tier countries) all have historical rulers.

Rulers are generally monarchs, so you won't find people like Bismark and Mussolini. Presidents are generally preferred over prime ministers, but for a few countries prime ministers are used as a lot more prominent. As CK2 doesn't support gaps between rulers, aggressive backdating is applied, so for example Konrad Adenauer starts ruling Germany as soon as WW2 ends.

Automatically generated children are very important, as that's the only way dynastic politics can happen right away, instead of only starting with second generation - as is sadly the case in vanilla CK2, where almost nobody has any daughters.

For historical characters parent-child information should generally be present, but more distant relationships aren't, as they would require adding non-ruler characters, something we don't currently do. Game engine doesn't have any way to mark one king as brother, nephew, or grandson of another without reconstructing their family tree.

This also means that currently marriage alliances between different countries are not modelled. This might change.

Cultures and religions

The mod does very little modelling here - Protestants are modelled as various Catholic heresies, and no new cultures are added.

This results in somewhat excessive amount of religious infighting. It would probably be better to give Protestants their own branch of Christianity, but I'm not sure what would be good mechanics for that.

A few extra cultures might be helpful, but no plans to go into EU4 style twenty kinds of Germans.

Borders between cultures and religions are adjusted in a few places, but they're extremely rough, and they're especially wrong in Germany.

I'm considering adding some mechanic similar to EU4 Nationalism CB, which would allow some kind of national unification wars, as well as more elaborate independence/autonomy revolts than in vanilla CK2. Any such mechanic needs to be fairly restrictive as to not change feudal character of the game.

I've been trying to strike a balance between countries being overly stable and falling apart too easily. The mod is definitely not there yet, but then again, neither is vanilla.

Game Mechanics

Right now the only major mechanic is inclusion of Suez Canal minimod.

Pretty much all the complex code is in script generating history files.

Minor mechanical changes mod does is disabling dynastic names for all countries (so it's "Iran" not "Khameini"), and startup script to setting up sensible laws (no more gavelkind).

Saturday, September 26, 2015

Reviewing Magic sets is still hard

A while ago I wrote a post with a lot of examples of pros making rather embarrassing mistakes in card evaluations for Constructed.

It's been a few sets since then, and examples keep coming four times a year.

The usual disclosures apply - I'm posting it to show that reviewing sets is hard, and you should take whatever people say with a grain of salt, not to mock anyone.

Fate Reforged - Gurmag Angler

Constructed: 0.5

Technically can be a one mana 5/5, but I think the other delve options are just better, even going back to cards like Hooting Mandrills.

Khans of Tarkir - Treasure Cruise

Constructed: 2.0

I suspect Dig Through Time has made Treasure Cruise nearly obsolete, but Treasure Cruise is more splashable and is better raw card draw, so there’s a chance it sees some play.

Khans of Tarkir - Dig Through Time

Constructed: 2.5

I want this to be good and I’m going to spend a lot of time digging to make that happen, but it’s still an 8-mana spell to begin with. [...] It’s not quite Sphinx’s Revelation.

Magic 2015 - Aggressive Mining

Constructed: 3.0

This is an aggressive rating for a very interesting card. I could see this seeing zero play, because it certainly is hard to utilize (and very dangerous when implemented incorrectly), but the card is just so powerful that I can’t help but imagine it being awesome in the right deck. One way to approach this is to play it as the top of the curve in a deck that really doesn’t need lands past three or four. Playing this on seven lands makes it close to a draw six, and that really isn’t that bad.

Born of the Gods - Brimaz, King of Oreskos

Constructed: 4.0 (the only such rating in the entire set)

Brimaz is going be the one king to rule them all, at least in terms of white beatdown decks. In Standard, he's going to be an auto-include in Plains-heavy aggressive decks, and is powerful enough to try many different builds of such decks. He's even purrfect for some different Modern decks, and it's funny that both Bitterblossom and Wild Nacatl could both potentially be paired with Brimaz to great success. The size, cost, and abilities all line up so well here that Brimaz is just impossible to ignore.

Journey Into Nyx - Mana Confluence

Constructed: 5 (Fives are ever-present cards that heavily warp a format or see heavy play across multiple formats. Jace, the Mind Sculptor, Deathrite Shaman, and Tarmogoyf are good examples of fives.)

Many might not realize why this is so strong. It is because having perfect fixing for a three to five color deck found in a single land is worth some damage over the course of a game. Decks that play this will either have access to life gain, to offset the downside, or will be very proactive and aggressive, like combo decks, so that they don't care that they did three damage to themselves before killing you. This will be moderately played in Standard but heavily played in older formats wherever City of Brass has popped up in the past.

Friday, September 25, 2015

CK2 Modern Times: Take that Von Habsburg AAR

This campaign was mostly a test run for Modern Times mod, and it ended a bit earlier than I thought it would, but you might find this AAR enjoyable nevertheless.

Post 1 - Originally published on Google+ on 2015-09-05 20:19:36 UTC

Take that Von Habsburgs: Part 01: 2015-2021: Crusade for Constantinople

Time to playtest Modern Times mod, together with my usual tweaks, which are not included in Steam Workshop version, as they are matter of taste and not terribly related to Modern Times mod itself (the relevant ones - suez canal and no dynastic names - are both included in workshop version). Other mods used are DLC music for everyone and anime portraits.

There are some obvious ideas like playing Greece into Byzantium or ISIS into Blobbasids, but I have something even better in mind - taking what's left of Austria in 2015 and showing Habsburgs how it's really done.

The goal is to expand to all the lands Austrian Habsburgs had or wanted to have, that is at least all the Balkans, Bohemia, South Germany, South Poland, West Ukraine, and North Italy. I don't absolutely need North Germany, Netherlands, or Spain, but if I happen to accidentally marry into a claim on them, I'm going to press it.

Not playing with ruler designer, so my starting family is (all fairly poor stats, as random characters tend to):

• 45 year old emperor Filibert von Abensberg
• 25 year old princess Heilwiva
• 23 year old prince Ludolf
• 22 year old prince Werner
• 21 year old prince Udalrich

That of course means 5 marriage alliances:

• emperor Filibert von Abensberg - princess Maria Merkel of Germany
• princess Heilwiva - prince Cesare Ramberti of Italy
• prince Ludolf - princess Hodierne d'Altaville of France
• prince Werner - princess Adelajda Olelkowicz of Poland
• prince Udalrich - princess Helene Attikos of Greece

I spent ridiculous amount of time deciding these.

Before I even got the answers, pope called for crusade for Greece against Turkey. Of course I'll join, with my 12k against their 36k or so. I sent my troops there, did some fighting, and got hit by 12k fraticelli uprising at home, so I had to head straight back. At least the heretics had decency to lose half their units to first winter before I even got home.

Second attempt. It was fairly difficult to not only defeat a much larger army without losing my own troops (as my trust in my vassals' loyalty was not that high, and I've been bleeding gold fast while at war, so not a chance of setting up any kind of emergency merc fund), I also needed to make sure I have highest contribution - and apparently top criterion is how many troops you've lost.

Bektashi Order and ISIS joined Turkey's defense. I managed to destroy Turkey's troops without too many losses, but against ISIS I lost majority of my army - fortunately completely wiping out all their event troops.

Sadly the pope is greedy, so even though he absolutely loves me, he would not give me even one gold.

Prince Caesare of Italy went celibare after making one baby with Heilwiva, and somehow divorced her or something? I'm not sure what happened exactly. I remarried her to king of Greece, even thought it was a redundant alliance, as at 30 years, she wasn't that great of a match for people around 16, and other people close to her age were mostly already married.

And in six long years we finally managed to get it, with about 30% warscore constibution I got Constantinople, a city Habsburgs could only dream of taking.

All my cute plans about dealing with Balkan minors first got really delayed.

Of course that's not the only holy war happening - Germany is trying to take Skane, Greece got Cynenaica, Italy got Tunisia, Spain got Algeria, France is somehow losing against Switzerland, Israel got Damascus, Iraq goh Nefoud, Iran got Turkmenistan and half of Uzbekistan. Basically Sunnis are getting wrecked everywhere, other religions are more or less in balance.

I'm really tempted to follow up the crusade by attacking Turkey to kick them even harder while they're down. Or I could take a break until levies in liberated lands replenish a bit.

There's of course huge awkward problem that my lands of Austria and East Greece are completely disconnected.

And it's no longer clear that I should just move my capital there - it's all tech level 5 to Vienna's 7. After all, these are modern times.

Post 2 - Originally published on Google+ on 2015-09-06 14:21:48 UTC

Take that Von Habsburgs: Part 02: 2021-2033: First succession

The game is called Crusader Kings, and in I don't even know how many campaign this is probably the first time crusade is actually the key event.

My 3 adult sons got a duchy each - one of them died quite soon afterwards. I have since added two more daughters - Helene and Emma - Emma being somehow unjustly suspected of being a demon child. Seriously, people still believe such nonsense in 21st century?

I put a son of 1945-1960's king of Romania on its throne. It was race against time as by the time he got the throne he was 73 years old. France finally managed to take West half of heretic Switzerland in holy war, so I declared cleanup war before anybody else had a chance. He managed to have a daughter before dying two years later, but she had a tragic accident, and I now have to rule Romania.

My daughter Heilwiva, wife of king of Greece, died in her sleep, which somehow made Emma really happy. King of Greece's sister Helene died of pneumonia, so that alliance is over now. I have two girls of my dynasty with weak claim on Greece, but there's a strange lack of civil wars out there.

My 8 year old daugher Helene got infirm from stroke in similar circumstances. Come on people, how am I supposed to do dynastic politics when my daughters keep dying?

My wife Maria Merkel died in childbirth, so that's another alliance down. The best I could do was queen of Bohemia's younger sister.

Seriously, what is it with this literally medieval healthcare situation in 21st century?

Well, I didn't have any good claims, so I just did some minor wars - de jure county war on Slovakia, claimant county war on Bulgaria, and tributary war on Serbia. All three were allied, so I'd be fighting them all at once anyway.

Actually I had a very good claim - my youngest son had a weak claim to empire of Germany which was in civil war, but then I'd be spending I don't even know how long trying to keep him on that damn throne.

It was a very messy war as half of my troops were on one side, half on the other, with enemies (and winter attrition) in between.

To prove that some things never change, France got into war with the biggest blob on the map - United Kingdom, using interesting strategy where France sent all their troops to siege London, UK sent all their troops to siege Paris, and France took English heir hostage, presubaly in the siege.

And then, emperor Filibert dide at ripe (by medieval standards) age of 63, while trying to turn Serbia into his tributary, succeeded by emperor Udalrich.

Udalrich is 6/11/13/0/3, or in other words completely hopeless, and due to usual AI stupidity when his wife Helene princes of Greece died, he remarried some awful lowborn Turkish woman, and pope would of course not grant me a divorce with her.

His only redeeming quality is that his son and heir Filibert has weak claim to Greece, but with 0 intrigue that doesn't seem very pressable. Austria's only alliance left is now with France, thanks to marriage between Filibert's brother and French princess. Of course given typical life expectancies, that's probably not going to last long.

Oh and ISIS is trying to jihad king of Israes for Jerusalem and somehow losing, even though by numbers (Turkey, Arabia, Jordan, and some random count are in it in addition to ISIS) they should completely overwhelm it. Turkey is going for Bulgarian one county in Karvuna for some reason instead... It's a bit silly, but then again Bulgaria is not very strong and they believe in wrong kind of Jesus so nobody will help them.

Oh and Constantinople and my other Greek holdings are getting highly developed really quckly. It went from 5.0 to about 5.8 already, they will catch up with Vienna's 7.0 levels in no time, or about 25 years I guess.

Now in 3 instead of 2 parts

UK-France war

Post 3 - Originally published on Google+ on 2015-09-06 18:36:26 UTC

Take that Von Habsburgs: Part 03: 2033-2043: This is all weirdly historical

Duchess of Slovakia actually accepted vassalization with some handling fee, so presumably I didn't need that first war. Oh well. Also Teutonic Order, who recently built a castle in Slovakia agreed to be my vassals, earlier they wouldn't as a distant realm.

Viacheslava Putin had non-dynastic heir, and since he was non-dynastic anyway, she agreed to matrilineal betrothal with my daughter. Sweet. Take take, von Habsburgs!

Abu-Bakr al-Baghdadi got captured, so his jihad on Israel failed miserably.

I somehow convinced them pope to let me divorce my lowborn second wife, and marry princess of Bohemia instead.

King of Hungary was incapable due to some silly mishap, so I put a more competent ruler on Hungarian throne.

Just as soon as that finished, some traitors tried to force elective succession in Austria. Over my dead body. Time to get 8000 gold from bank of Jewgold, just in case that turns out uglier than I expect it to, even though that costs me 10% nationar tax modifier and -2 diplomacy until they're back, and gives arbitrary trait. Oh well. Apparently king of Israel could not care less. One of the things they should have considered.

The difficulty of the war is mostly my divided demesne, fortunately rebels are divided as well - and my sister in law queen Zofie of Bohemia is on my side.

The rebellion weirdly made Teutonic Order (who sided with the rebels) independent. That seems like a serious bug. And speaking of bugs, I discovered that Danube is not navigable for me. Fuck. I thought that got fixed in the patch, but apparently depending on your non-London capital, random subset of major rivers are unnavigable.

My wife Anna died, so I married her niece Kinga to maintain our alliance with Bohemia. She wasn't quite as skilled, so I had to let go of one of my counties, and oh look, claimant to duchy of Macedonia is asking for my help.

My supposed demon sister Emma, sweet 14/18/17/36/18, became of age and married emperor of Spain, in a regular marriage. This is the second time I got this very rare event chain, and second time it's someone who can't get my primary title. Oh well.

Sadly my non-dynastic niece who was next in line to throne of Italy got murdered on orders of her uncle who was next in line.

Oh wait, queen of Bohemia Zofie died, leaving some kid on the throne. Oh come on, I need to save poor Bohemians from such a weak ruler. Zofie's nephew Udalrich would be much better king. Oh and he just so happens to be my son. I had to break a betrothal to make that happen - arranging a matrilineal one with king of Ukraine's brother instead.

There was a 3-way civil war ongoing in Croatia, with even Belgium with its surprisingly big 18k stack wanting a piece of action, so I had to intervene, as it was traditional part of crown of Hungary. Sadly my claimant died of depression, so I had to try another one.

All of this is going along weirdly historical lines, if we ignored crusade for Constantinople for a moment.

I somehow got involved in far too many wars on side of emperor of Russia, king of Ukraine. I doubt any of my family members will get their thrones. Prince Simeon who ought to be emperor of Russia and make babies of my dynasty with my daughter is just double duke, presumably due to some faction nonsense, his sister being on the throne. Well, there's always a chance.

I'm seriously tempted to get crowned king of Bavaria and get that from Germany - France, Spain, Poland, Ukraine, Russia, and Georgia are all my allies and at least some of them won't be busy.

Pretty much all of North Africe west of Egypt got conquered by various European powers - Greece, Italy, Spain, and Portugal. Even Israel blobbed a little and Shiite Iraq got Medina (but not Mecca yet). Among all this it's surprising that ISIS didn't lose any of their territory yet.

It's all been going really well so far.

Oh and France somehow managed to win their holy war on duchy of London.

This looks shockingly historical. Add British Egypt and you'd be thinking it's real 1914 map.

Post 4 - Originally published on Google+ on 2015-09-08 14:18:44 UTC

Take that Von Habsburgs: Part 04: 2043-2049: Going East

I fixed it so that all major rivers are navigable regardless of fort level - this is really great for me, as my demesne is divided between Vienna and Constantinople, and it's seriously silly that you're blocking rivers in your own territory. And I also installed mod that fixed duke frames to be distinguishable from count frames.

So there was fun dynastic story here:

• empress of Russia married king of Georgia, with son being heir to both
• as son was non-dynastic to her anyway, she had no problem marrying him matrilineally to my daughter
• somehow he did not become emperor of Russia, just a double duke, but he's still heir to kingdom of Georgia, so if that works, and a few lucky coincidences happen, my dynasty will rule Georgia

Now, this matters, as I have choice of a few actions:

• crown myself king of Bavaria (which I finally can, now that Croatian parts of Bavaria get me over 50%), then press claimant on duchy of Bavaria against Germany to wreck them, using the French to do as much fighting as possible. I need to wreck Germany and Italy at some point to restore lands I want, France is probably fine.
• turn Balkan minors into tributaries. Last time I tried it it was rather hard, as they were willing to fight till 100%, and in Modern Times sieges take longer so it's hard to get that 100%.
• holy war Turkey to get closer to Georgia, which is a potential future dynastic realm. Or for that matter holy war everybody near Austrian North Cyprus

Maybe I could do two of those at once, not really all. Well, Bulgaria suddenly started having willing claimants and Danube was suddenly navigable, so the thing to leave for later is holy wars I guess. Oh wait, while I was pondering things Bavaria became no longer pressable, and Bulgaria is on my side in some silly Ukrainian war. Oh well, planning is complicated...

So instead I cleaned up a bunch of Balkan counties, and went for Cilicia, while Turkey was already fighting decadence revolt, Shiite holy war, and Yazidi revolt.

My son lost Bohemia to some rebellion (and embarassingly I had to pay 110 for his freedom), but king of Bohemia is oldest son of Polish king and heir to kingdom of Poland somehow, so I'll let that pass for now.

I accidentally inherited Teutonic Order and all its baronies when its grand master died, and I couldn't give it away, so I used console to give it to some random dude. Then I gave them a bunch of spare baronies in Cilicia - the whole duchy was otherwise home to a bunch of claimants to various titles, ruled by my son who lost Bohemia before.

After some silly civil war in Ukraine and a series of accidents that left a baby girl on the throne, I decided to intervene to make my son in law the rightful king.

Oh and thanks to a series of freak accidents, king of Georgia (heir to empire of Russia, but that could change if current emperor survives to age of 16 and has some own babies) is matrilineally married to my daugher, while heir to empire of Italy is married matrilineally to my sister.

There's also a lot of fun religious arrangements, as emperor of Russia is Catholic, his heir and uncle king of Georgia is Orthodox, then his son is Catholic again.

France tried to holy war United Kingdom again, this time it was a total failure.

Oh maybe it's time to end all this silliness of expanding one duchy or kingdom at a time and put dynastic claimants on thrones of empires of Germany and France. Spain and Poland ought to help me with it.

In best case scenario, Austria, Germany, France, Italy, and Russia will all be of my dynasty in two generations, Poland, Greece, and Bulgaria will fall into my realm by inheritance to my various vassals (with some armed negotiations), and I'll figure out some way to clean up Serbia later.

Other than Portugal and Belgium I think I have marital connections of some kind to every significant Catholic country in Europe, and quite a few heretic ones as well.

Austria stronk

Netherlands and Norway went Catholic when I wasn't looking? Russia as well, but at least I noticed that. Sunnis continue getting wrecked by everyone.

WTF is going on in India?

Post 5 - Originally published on Google+ on 2015-09-11 22:31:39 UTC

Take that Von Habsburgs: Part 05: 2049-2054: Family First

I seriously regret that I did't give everybody in my initial family hunie trait, it would have been much easier to figure out who's related to our dynasty.

Also as the script reuses dynasty IDs instead of just making new dynasty with same name, there's tons of people of historical dynasties. Like rulers of Ukraine are Rurikids (and get insane levels of dynastic prestige), and my former spymater (30 intrigue and didn't hate me) was same dynasty as me, even though not directly related. His on rules over lands we liberated from Swiss heretics now.

Oh and I figured out why I inherited Teutonic Order - my script that changes all titles to primo mistakenly also changed holy orders as they're technically feudal.

I had so many claimants it was hard to choose - my brother had claim to Germany, and his wife had claim to France, so it was one way. Alternatively I could push claim of any of my 3 nieces to France instead. Let's go for brother&wife approach. All that leads to the question - why the hell am I not playing as him anyway?

It turns out none of my allies were interested in helping me. So much for networks of dynastic alliances.

Oh and I learned that in this mod the optimal way is to completely ignore all peasant revolts. Time to siege is based on fort level and difference in technology. As tech difference is about zero but fort level increases and increases, sieges are rather slow in general. On the other hard peasants have technology 0, so they suffer from both huge fort level and huge technology based penalty, giving them ETA for a single castle like 15+ years. I could literally keep buying fort level upgrades while they siege it.

My vassal king of Bohemia inherited Poland due to some dynastic accidents. Then a few accidens later both titles went to my wife. She's still a bit annoyed by my alleged involvement in her cousins' accidents.

Pope declared crusade for England - there's only this tiny problem that 3 biggest Catholic countries are busy right now.

France had to be won first - otherwise my brother's wife would leave for his court, and that would be it. Of course she immediately needed help with rebels, and I so absolutely despise how you can only offer to join one war.

And then I was finally able to press my brother's claim. I lost 3 counties this way, but who cares really.

So right now, biggest countries:

• Austria - me
• Germany - my brother
• France - my brother's wife
• Spain - my demon-sister's husband (not matrilineal, won't by dynastic)
• Italy - my sister's husband (matrilineal, dynastic heir)
• Greece - not in line, but tons of dynasty members have claims
• UK - getting wrecked by a crusade
• Georgia - my daughter's husband (matrilineal, dynastic heir). Orthodox, but heir is Catholic.
• Russia - heir is king of Georgia, but that's only because emperor is 14 and has no own children yet, probably won't go into dynasty. Also already Catholic.
• Jerusalem - Yazidi liberation revolt of all things got it, Israel is reduced to one duchy in Syria

Oh wait, that's wrong. Empress of fucking France already folded to faction demand.

For fuck's sake, what's the point of pressing any faction demands if every fucking claimant just folds, even while they have massive army and ridiculously powerful allies and rebels are just like a duke or two?

This is supposed to be dynastic game, but the only claims that are of any use whatsoever are your own.

I have 3 nieces with claim to France, but what is the fucking point, if they'll stay on the throne for a week, then fold to second revolt (as I can only join against the first)?

I really need to investigate these two things:

• How to make newly installed claimant at least try to fight, not fold to every fucking faction. If it was at least something like lower crown authority, or even independence or elective succession, it makes some sense to fold to that - I can't think of any good reason to ever fold to claimant faction without a fight. In worst case you can just surrender.
• How to allow joining your ally's all wars, not just one. That will require some fancy scripting, but the game really needs this.
• And for that matter is there any way I can side with my vassal against rebels? I know Game of Thrones mod has some mechanics for it. At least they usually lose to faction rebellion, they don't just fold, but still.

Because right now major mechanic is just broken.


Pictures from Chicken Week

As I said before, this is now a food blog. Well, at least sometimes, I still seem to be posting about video games or programming every now and then.

So after a disaster which was vegan week, I decided that I still like making food pics, but I'd prefer something much easier and more casual. So how about a chicken week? It was actually so delicious I kept going for nearly two weeks worth of pics. If you're really curious, the entire photo album of everything I ate is at flickr, with comments for each pic.

Let's start with selection of culinary highlights.


The most obvious thing to try was chicken salad. Just throw some cooked chicken with a bunch of vegetables and apples, and it's a fast to make and pretty decent food.

Chicken with fruit

I really like using fruit in my cooking. My greatest discovery was just how delicious chicken with watermelon is. I had that many time since then:
Of course I had chicken with oranges (it unfortunately came out a bit blurry):
And something I do a bit less often, grapes:

Chicken with vegetables

There's only so many types of fruit, sometimes more traditional version of chicken with vegetables would do:
Or this one:
Vegetables are generally steamed, and chicken pan-fried. I used to steam chicken together with vegetables under assumption that it would be easier, but amount of mess meat makes while steamed made it totally not worth it.

Eggs are just baby chickens

We don't need to wait for the chicken to grow up before eating it.
Here's Cloud wondering what the hell am I doing, eating silly human food instead of obviously more delicious cat food:

Chocolate eggs are kinda eggs and that's kinda chicken, right?

Obviously just because it was "chicken week" didn't meat I planned to go without at least some chocolate. Chocolate eggs sort of vaguely fit the theme. Also it's the first food pic on this blog that's totally illegal in certain unnamed countries:
 I also tried to make meringues. That was a miserable failure, so I got some from the shop instead: 

The end

To conclude this series:

  • chicken is delicious
  • watermelon is perfect with chicken
  • the distinction between fruit and vegetables is just another way the system lies to you

Wednesday, September 23, 2015

Let's Play Happy Factorio with Bob's Mods

I really like Factorio, except for aliens and sad graphics.

I wrote a mod which recolors Factorio to be more cheerful (most recent version downloadable from factorio forums), I wrote a tool to recolorize other mods (it's on github but not really easy to use, ask me if you need it), and a mod to fix night lights and pollution map (I should probably release those as well).

So now the only thing left to do is install a bunch of mods and play. Here's the full playlist, and here you can watch the first video:

New videos, about 25 minutes each, are going to be posted once every day, on same time each day.

Mods used:

  • Better Visuals 0.0.1 (unreleased yet)
  • bobassembly 0.12.3
  • bobelectronics 0.12.3
  • boblogistics 0.12.4
  • bobmining 0.12.1
  • bobmodules 0.12.4
  • bobores 0.12.4
  • bobplates 0.12.5
  • bobpower 0.12.3
  • Happy Factorio 0.12.8
  • Larger Inventory 1.0.0
  • Loot-able Rocks 1.0.0
  • peacemod 0.1.0 (I changed json file to make it compatible with 0.12, but it's basically same version as 0.11)
  • Terraforming 0.12.1

All mods are available from Factorio Forums.

Enjoy the base :-D

Let's Play Civilization 5 as Poland - in Polish

I tend to be pretty close to 100% English speaking online, but I wanted to record something in Polish - and what could be better than Civilization 5, the only game where Poland is the strongest country of all.

Of course I'm still not terribly happy about sudden death of my Germany campaign to save game corruption. I think the most likely explanation is that mods somehow got upgraded mid-campaign, which is something I might have clicked accidentally. I'll make extra sure not to do so this time.

Anyway, here's the playlist, and here's episode 1:

New videos, about 25 minutes each, are going to be posted once every day, on same time each day.

Friday, September 11, 2015

Modern Times mod for Crusader Kings 2 - enjoy feudal politics of 1900-2015

IMG_7142 by MankiProject from flickr (CC-BY)

Early versions of the mod have been available for a bit over a week on Steam Workshop, but I'd like to make a proper announcement and notes.

The mod shifts Crusader Kings 2 to 1900-2015 timespan, with same map, reasonably accurate borders (as much as possible with vanilla provinces), some historical rulers, and automatically generated vassals, families, and rulers which I didn't write down yet.

Otherwise, it has same map and mechanics. It is not and has no intention of ever being a total conversion mod. It might someday expand timespan back a few decades or maybe even centuries, and it will probably contain a few tweaked mechanics eventually, but I'm not making anything like AGOT.

You can get it from Steam Workshop or as direct download.


The intention is that all independent rulers will be accurate in some future version - for now all 10/10 emperor-tier countries but only 13/75 lower tier countries are done. You can - and should - use ruler designer to come up with your ruler if non-historical one is used.

Who counts as a "ruler" is somewhat ambiguous, I took monarchs if possible, and then usually presidents over prime ministers, unless prime minister is much more prominent (as in let's say Germany). Interim presidents and no-ruler periods are all disregarded, with next ruler being backdated to whenever previous ruler's reign ended.

Everybody else - regional vassals, and children of various landed characters - has been generated randomly.

This start is in some ways already better than vanilla starts - especially in 769 and 867 but also in later start dates outside core of Europe nobody had any daughters or sisters, so there was no way to do any dynastic politics until second generation. In this mod as duke of Bavaria you can marry daughter of king of Netherlands, or whoever got rolled randomly there.

20% of rulers (except Muslims and popes) and 50% of children are female.

Even historical characters get randomly generated children (in addition to any historical children they might have).

I tried to model parent-child relations between rulers, but anything more complicated than that I left out for now, so they'll just be kinsmen. Characters with same name (historical or generated) in same country are treated as part of same dynasty, characters from same dynasty in different countries (like kings of Sweden and Norway) are currently treated as independent houses, and any intermarriage between royal houses of different countries is not yet modelled. It will probably change at some point.

Traits of all characters are generated randomly by the game whenever you start. So if Jacques Chirac turns out to be a greedy impaler attractive dwarf in your game, that's not mod's doing.

The only character with special treatment is ISIS caliph Abu Bakr al-Baghdadi who gets cruel zealous and 10k event troops. Without that ISIS falls too easily, and we wouldn't want that, right?

I might add special treatment to a few more rulers, but it can too easily get into silly arguments if someone was a genius or an idiot based on political preferences, so I'll keep most randomly generated.

Countries and their names

The mod tries to use the most geographically appropriate landed title, and then rename it if it needs be, using same trick vanilla uses to make "kingdom of Italy" continuation of "kingdom of Lombardy" (k_italy both).

So for example Romania is a kingdom-level title, corresponding to "k_dacia" (named Wallachia) in vanilla.

De jure map has not been touched yet, but it will need to be eventually. There are a few things I'm not terribly happy about, like how HRE and Byzantine Empire still exist de jure, and how post-1918 Austria (e_carpathia) is wholy outside its de jure territory.

Decision to make something empire, kingdom, duchy, or county depends primary on its maximum territorial extent in mod's timeframe. That's why Belgium (d_frisia) is just a duchy, while Austria (e_carpathia) is an empire.

All empires are: United Kingdom, Spain, Ottoman Empire/Turkey, Russia/Soviet Union, Italy, France, Germany, Austria, India, Iran. (names of Russia and Turkey change depending on bookmark).

The mod includes no dynastic names minimod, so Arab/Turkish/etc. countries use territorial names too.

One thing I couldn't fix was making ISIS keep "The Sunni Caliphate" as its primary title. It quickly creates territorial duchies of Syria and Mosul and uses one of them as its primary, even though game files explicitly tell it not to do so. So you'll see two Syrias (k_syria and d_syria/d_sunni) next to each other quite often. I think I should at least rename "d_syria" to duchy of "East Syria" or something to reduce silliness a bit.

Arabia (k_arabia) is called "Arabia" not "Saudi Arabia", as nothing guarantees that their dynasty will stay in charge.

As map covers only tiny part of China, instead of any kind of empire of China mod only includes kingdom level Xinjiang - which is early bookmarks includes Mongolia. I'm not terribly happy about it, but there's little I can do. Chances are high Paradox will add China in some future expansion, making this problem go away.

Border changes generally correspond to peace deals or some long term truces, so there's no crazy border changes every month during WW2 etc.

Some small countries like Kosovo, Lichtenstein etc. just don't fit the map, so they won't exist in the mod at all.

Holy Orders

All holy orders which exist at end of CK2 vanilla timeframe still exist in the mod. In addition to that Templars exist (check any conspiracy site for reasoning), Zealots exist as Israeli vassal in any bookmark where Israel exists (mostly to prevent them getting overran by Egypt day one), and Assassins get un-destroyed and exist as vassals of Iran in any bookmark after Iranian Revolution.

Internal Organization

Every county or duchy level independent ruler holds everything personally.

King/emperor level rulers hold everything in their capital duchy personally, and have one multi-count vassal per de jure duchy.

As gavelkind would be ridiculous, everybody starts at agnatic-cognatic primogeniture, except Muslims (agnatic open), and various special titles like papacy and holy orders.

All countries start with zero crown authority, papal investiture, as well as level 2 city and feudal taxes (AI will generally go to no feudal tax ASAP which is silliness inherited from vanilla, I might include bugfix for that in future versions of the mod).

Emperor tier titles start at zero centralization, everybody below that at medium centralization. This means that some titles start over vassal limit, and some - especially United Kingdom (while it still holds India) and India - start drastically over vassal limit.

This will hopefully be fixed in future versions, with vassal multicounts being replaced by vassal dukes, multidukes, or kings for countries where it's sensible.

Mongolia, Kazakhstan, and Uzbekistan are marked as nomads - so they'll start as nomads if you play with Horse Lords DLC, or tribes otherwise. Other countries (like Moldova) have nomad flag removed.

Provinces which are tribal and end of CK2 remain tribal in mod, even though it's a bit silly.

All provinces with bishopric capital get their capital moved to castle, except Rome. City capitals remain as such.


Population culture/religion is mostly what it was at end of CK2, with some number of rough tweaks for worst silliness.

Various Protestants are modelled as Catholic heresies. Half-Catholic countries like Germany are generally treated as Catholic for now.

The problem with accurate modelling of all that is that religious and cultural minorities are for most part spread out geographically, but CK2 expects them to be regionally concentrated, so nothing like correct modelling is possible.

Technology is based on sensible gradient - British Isles > Western Europe > Eastern Europe > Middle East > India/Africa/Steppes (each group one tech below previous). France and Germany regions are in Western Europe tech in 1900, but in British Isles group in 2015.

Game generates buildings in holdings based on technology levels.

Extra game mechanics

The mod includes Suez Canal minimod.

There's no European Union / NATO / WW2 etc. as we can't add extra tier of titles, and it would take very complex scripting to do anything useful this way. Maybe one day I'll set this up.

If you're playing as Norse (via ruler designer) character, you won't have access to most major rivers, as they stop being navigable when provinces they neighbour reach fort level 10, which most of them start at with mods' tech levels. I might change that in the future.

Bookmarks suggested by the mod (1900, 1914, 1920, 1938, 1945, 1975, 1991, 1999, 2015) are in no way special.

Future versions of the mod might include a lot more mechanically.

Mod might be compatible with a lot of non-map-changing minimods.

Code and Bug reports

Feel free to contact me in any way whatsoever about bug reports or questions (email, blog comments, Steam Workshop, reddit etc.).

Bug reports that some country's rulers are missing are not necessary, as I know that already :-)

If added historical rulers have wrong dates (interim rulers intentionally not included, so backdating here expected), names etc. or borders are wrong (in a way that's not simply artifact of vanilla provinces falling between two countries), that's kind of mistake I'm most interested in hearing about.

Code generating the mod is available on github. Most interesting files are probably characters and borders.

There is no guarantee that mod updates won't screw your existing campaign in some way, so you're probably better off using direct download version instead of Steam Workshop version (which will automatically update).


My primary sources were Wikipedia and GoaCron. I checked with a few other sources like 2015 mod by King of the Romans too.

Wednesday, September 09, 2015

Fun and Balance mod for EU4 1.13.1

Arctic Fox by Mark Dumont from flickr (CC-NC)

Fun and Balance is available updated for 1.13.1:
Other than compatibility fixes, the only change from 1.12 is that vanilla now includes "adopt theocracy" decision, which Fun and Balance had for a while, so I removed mod's decision as redundant.

It's been surprisingly common that people playing Fun and Balance mod get early access to features which vanilla players only see many versions later - the biggest one was probably pushing vassals' CBs, but all kinds of changes I make end up being unnecessary a few versions later.

As with other government type change decisions, Fun and Balance removes number of provinces restrictions, but you still need to do fulfil other requirements (religious and diplomatic ideas fully filled).

I'm not a huge fan of what happened to EU4 in 1.12 with forts and zones of control system which is an embarrassing pile of bugs and bad design, and 1.13's heavy handed diplomacy nerfs only made things worse. Sadly neither problem can be fixed by mods, so I have to hope they fix them in vanilla.

As I explained with some math in 1.12's announcement, I'm not terribly worried about increased point costs of expansion, and in any case if you dislike this change, it's relatively easy to change numbers in common/defines.lua.

I don't have strong opinion on AE changes. They were rebalanced multiple times since 1.12, and will presumably get rebalanced some more. If you find it too high or too low, it's a relatively straightforward common/defines.lua change.

People differ in how tolerant they are of Common Sense problems. If you don't mind them much, grab a mod and play. If you do, there's nothing wrong with playing older version of EU4.

Or for that matter there are other games. I recently made Modern Times mod for Crusader Kings 2, which lets you play as various characters in 1900-2015 timeframe, so if you want to crush Islamic State as François Hollande, now's your chance. Fine, I know perfectly well half the people just want to play Putin or Hitler. Leaders of minor countries are not yet in the mod, but it's only a matter of time, and in the meantime you can use ruler designer to play as your favourite leader.

Enjoy the games!

Tuesday, September 08, 2015

Tree of PRNGs design pattern

Kitten kaleidoscope by hehaden from flickr (CC-NC)
Here's a problem I had while coding Modern Times mod for Crusader Kings 2 - I needed to generate a ton of data.

Crusader Kings 2 is a game about characters, and I put a few historical villains like Hitler, Putin, and al-Baghdadi - somehow the bad guys is are who people request the most - but that's not even close to enough. There's nearly a 100 independent countries on the map, over timespan of 1900-2015, and in addition to rulers I still need to setup regional vassals, some kind of families so you can engage in dynastic politics and so on. About 20k for now and it will likely end up with a lot more.

What could be simpler? Every language has some kind of rand(min, max) function, and that should be enough, right?

Well, that would have a horrible side effect of the mod being different every time I rebuild it, and that's seriously unacceptable. Even worse, I'd need to write real unit tests instead just going for my favourite diff output reference_output as refactoring safety net, and who's got time for that? Especially considering how annoying it is to write tests for non-deterministic processes.

So obviously I'd jut seed the PRNG with something and it solves the problem, right? Oh by the way, here's how you can create deterministically seeded PRNG object is Ruby in a non-stupid way, as stdlib doesn't have any such way (unlike in Java and early versions of Ruby, Object#hash is not consistent between program runs for security reasons):

require "digest"
class Random
  def self.keyed(key)

Anyway, global PRNG is just not good enough. It does the bare minimum that rebuilding the mod returns same output and I can use diff against reference as smoke test for pure refactoring, but any change I make anywhere will completely change all the data that comes afterwards.

PRNG Counter Mode

Why is that a problem? When refactoring the green condition is simple - output shouldn't change at all, dumb diff can tell me if it worked.

When changing or extending functionality it's more complicated - output related to the program changes should change (in correct way), while everything else should remain the same, as a statistical distribution.

For example every ruler has some chance to be male or female. I turned this off for popes as it was a bit silly, and I'm OK with popes' names and such details changing (for one - they should no longer be called Joan), but since now every random number generated after first pope has different history, it affected every character on the map. How can I be sure that's just seed shift and not another bug I accidentally introduced?

If we had quantum testing tools - or infinite testing time - "output should remain the same as a statistical distribution" would be usable condition. A we don't, we need to seed parts of PRNG to get repeatable pseudorandom data.

So how about instead of global PRNG we seed it with key containing character ID for data related to every character?

Every character already needs an unique ID anyway. The most straightforward way I used initially would be to just allocate them sequentially starting from some large number that won't collide with vanilla characters (like 100,000,000 or so), and then PRNG seeded with Random.keyed("character #{id}") would be used to generate all data related to that character.

This worked reasonably for a while - as long as number and order of characters became constant, changes in character didn't affect other character's pseudorandom data.

Of course that didn't last long - number of characters had no desire to remain the same, and especially when characters would get a (random) number of random relatives that would make diffs completely unpredictable.

My first quickfix was to bucket IDs by some timestamp like character's birthday or crowning like some kind of mongodb ObjectIds, but this data was not even close to random - like when a country becomes independent (or mod's timespan starts) all its regions get a new ruler on same day, and that just bubbles every year as all generated reigns, deaths, and childbirth ages were at yearly intervals for simplicity.

I could fuzz the dates away from full years to reduce conflict, but why the hell am I even using pseudosequential IDs if their only condition is uniqueness and stability between runs?


This actually has a very nice solution - counterintuitively, to make data more stable just pick a pseudorandom ID for everyone, instead of pseudosequential one.


Well, for every top level ruler we can come up with some reasonable unique string - like "ruler-#{title}-#{crowning_date}". We don't generally put multiple rulers on same date, so number of conflicts should be low - some due to silly special case, most due to birthday paradox:

def allocate_id(key)
  space_size = 10_000_000
  base_shift = Digest::MD5.hexdigest(key).to_i(16)
  id = @namespace + (base_shift % space_size)
  while @characters.has_key?(id)
    base_shift += 1
    id = @namespace + (base_shift % space_size)
  @characters[id] = :placeholder
  rng = Random.keyed("#{key}-#{id}")
  [id, rng]

And so everybody gets ID and PRNG seeded with that ID.

Well, what about people who don't have unique top level descriptors? We just use #{parent_id}-#{relation} as unique key, where parent_id is ID of any previously generated character (root or not), and relation is a (hopefully) unique relation between that parent and child.

In this case "parent" and "child" are literally parent and child (as vassals are just keyed with whichever land they rule over like normal rulers), and due to lack of twins (this will totally need to change at some point to properly deal with Polish history) I just use ""#{parent_id}-#{child}-#{birthdate}" as the key.

And it all works. Really well.

The lat remaining detail is why I seed PRNGs with Random.keyed("#{key}-#{id}") instead of Random.keyed("#{id}").  This is not necessary for isolation, but it works around a different artifact - if due to birthday paradox new character A steals old character B's ID, keying PRNG by just ID would mean that A might steals B's whole identity including name, surname, and names of all their children. Of course B would get completely random and independent new set of data - but that could be a serious debugging mess.

This sort of implies that I should use whole original key (or at least whole hash, not just allocated ID which throws away most bits) to create sub-PRNGs, but as this protects from a rather unusual scenario I didn't bother doing so yet.


Code for Modern Times mod and my other CK2/EU4 mods is on github.

Modern Times mod is available on Steam Workshop, just are many other mods by me.

Thursday, September 03, 2015

Suez Canal mod for Crusader Kings 2

I've been playing with it for a while (see here and here), but Suez Canal was embedded in my personal supermod blob.

Now that I refactored the supermod a bit, I can release parts of it as standalone mods, so here it is on Steam Workshop.

If you don't like Steam Workshop for any reason, just use Steam Workshop Downloader.

Technical notes

Suez Canal is implemented as portage, which seems like it would be accessible to only religions which can navigate major rivers (Norse and Reformed Norse), but it turns out that's only true for portages between great rivers. Portages themselves don't have such restriction, anybody can navigate them just fine.

The mod won't work with mods that modify the map (like CK2+), but it's easy to make similar version for other mods. Here's the whole script creating this mod:

  • Find province IDs where you want to put the canal (between 939 and 1382 passing through 789) - the third one doesn't seem to matter
  • Copy map/adjacencies.csv into your mod and add line like 939;1382;portage;789;-1;-1;-1;-1;Suez Canal at the end (last ID and portage name don't seem to matter, just name it whatever)
  • Copy map/default.map into your mod, find ocean_region tag, and merge both sea_zones into one.

Suez Canal is totally historically plausible

In spite of common skepticism, canals connecting Mediterranean and NIle existed in antiquity, only closed in 767, and Venice considered rebuilding it in 1400s, so it's not outside realm of possibility that one might exist in CK2 timeframe. At least it's much more likely than a bridge connecting Ireland with Wales.

Now technically these were all Red Sea - Nile canals, not Red Sea - Mediterranean canals, but Nile is weirdly not marked as navigable river in game.

Gameplay reasons

Anyway, historical reasons are of secondary importance. In vanilla game there's whole chunk of map - India - which doesn't interact with anyone ever.

There are many reasons for this situation - super-stable Muslim blob (Abbasids or Seljuks depending on start date) stands between India and rest of the world (including between India and steppes/Khotan), Indians don't have good CBs to expand into Muslim world, the Muslim blob usually prefers easier targets elsewhere, and Indians can defend themselves from attacks by random Muslim dukes thanks to their ridiculous 769 era holy orders, four centuries before anyone else.

But mostly it's just geography. Even if you got alliance between someone Indian and someone on the rest of the map, getting troops is over is impossible for AI. Player can do that with some extremely contrived tactics (check all guides for Norse India for details), but even if you go to India, you'll just reverse the problem and you'll be playing in India and not interacting with rest of the world in any way. Maybe if you start in Persia you'll enjoy both maps.
This level of isolation is just bad gameplay. Now Suez Canal is not a magic solution completely fixing the India problem, but it's an easy way to at least reduce the problem somewhat.

Or even if you ignore India, it will make any gameplay in Middle East much more fun. Or you could just raid Mecca as Norse. Or expand into Silk Road as a merchant republic. So many new options which are now much more realistic thanks to the canal.


Anyway, enjoy. I'll probably release more minimods in the future, as I've done a lot of fun changes to the game (check my various AARs for details), and they just need disentangled into something publishable.

For that matter, check my other mods for CK2 and EU4 on Steam Workshop. There's already quite a few.

Feel free to include this minimod in any other mod you make, just put the credits somewhere.