taw's blog

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

Sunday, April 13, 2014

Zombie Survival Guide review

I feel a headache coming on! by ucumari photography (Valerie) from flickr (CC-NC-ND)
I was really happy to get my hand on a book that claimed to be a compendium of knowledge necessary to survive close encounter with the living dead - The Zombie Survival Guide: Complete Protection from the Living Dead by Max Brooks. Unfortunately while the guide has many good points, it also commits far too many mistakes to be a reliable source, so I feel obligated to write this review and refutation, which will hopefully prevent countless unnecessary deaths by naive civilians trying to follow flawed advice.

Zombie Science

The book nearly implies without stating it outright that zombies violate Law of Conservation of Energy. Let's get serious here - zombies don't feel tired, they don't feel pain, they don't waste energy on all the functions necessary for long term survival of the body, so they can keep going far longer than a human, and it might seem to a naive observer that they can go forever, unless they rot away away.

This is of course a total nonsense, a captured zombie could be used to build a perpetual motion machine by just keeping in environment where body rot is unlikely. All zombies will run out of energy eventually. Assuming an average human is 80kg, 60% water, 20% body fat, 20% lean mass, and uses 2500kcal/day, that person will be left with literally not 1 gram of tissue in their body in 83 days. Even if we assume zombies can be far more efficient by shutting down nonessential body functions, a lot of this mass is still necessary for structural purposes. There's pretty much no way a zombie can remain active for more than a few months - not years like the author frequently claims.

A zombie could plausibly remain in a semi-dormant state for much longer, but visions of multi-year zombie sieges author sometimes draws need to be treated as fairy tales. If you can survive 3-6 months, you're basically saved.

The author makes other claims about zombies - that they're slow, clumsy, can't climb, can't throw things, can't use tools, can't coordinate, are not afraid or aware of fire and so on. These should be treated with caution. They might be true of a typical zombie, but how confident are you in risking your life on a bet that zombies you're facing are of the most vanilla variety? Different people had different abilities in life, and while zombification definitely generated massive brain damage, what was left might just be an exception. So prepare accordingly, but always have a backup plan just in case.


It's hard to describe advice about weapons given by the book as anything less than ridiculous. It's centered around use of silencers and long distance headshots. Both aspects are completely ridiculous.

Contrary to Hollywood portrayals, "silenced" weapons are still quite loud - and if zombies are attracted to slightest sound like the author portrays them to be (advising not even talking loudly just in case zombies might overhear that), any use of silencers is completely futile. And for untrained civilians able to reliably shoot a (even slowly) moving target in the head from long distance while shitting their pants? Such attempts are just the best way to waste all your ammunition.

Fortunately there are far more realistic solutions to the zombie menace - like shotguns. Sure, they are loud, but your chance of hitting zombie's head from a short to medium distance when your life is in danger is far better than with anything else unless you had years of training.

And contrary to author's claims, I would not completely ignore all targets except the head. Severed zombie head might be dangerous for a while, but your priority is survival, and it won't chase you. Mobility kill is good enough to save your life. Any hit that severs spinal column, shatters limb bones, breaks major muscles, and so on can ensure the zombie thus hit will not be following you. That's why grenades, molotovs, and all kinds of explosives are your friend. Of course the author is right - don't be stupid and approach the immobilized zombies, but your priority should be survival, not being a hero.

What to do if you have no firearms? If you had adequate training and quality equipment available, a polearm or a sword might be very viable - but let's be serious here, that's even less likely than sharpshooter training. If you have nothing better available, improvised spears are relatively easy to make, and can be adequate protection of last resort - they were used successfully for thousands of years against much bigger, stronger, and faster wild animal, than a stray zombie. Anything shorter like improvised knives and swords, baseball bats, hatchets, crowbars, and so on leads to far too great risk of infection even if you manage to eliminate the attacker, so only use in real desperate situations.
Abby contemplates the meaning of string by DirtBikeDBA (Mike) from flickr (CC-NC-ND)


The best thing you could possibly get, if your budget is unlimited is a shark suit. It costs about $5000 and protects from shark bites. Zombies have basically human anatomy, and any armor that protects you from sharks will also definitely protect you from zombies with a huge margin of safety.

If you don't have that kind of money to spare, or zombies caught you unprepared, you should still try to armor up. Any kind of motorcycle helmet and heavy leather clothing (of the kind bikers wear) will offer at least some degree of protection from zombie attack. It's not going to make you invulnerable of course, but every little helps.

Short Term Survival - Get on the Roof

I feel the book covers that well - just get on the fucking roof, and get rid of the ladder. Zombies can't use ladders, can't climb, and even struggle with staircases, so heigh is your saviour.

I'd put much more trust in doors than the author. Plenty of doors are flimsy and will fall in minutes to even a single zombie, but depending on where you live, heavy fire doors routinely installed in all new buildings can stop zombies just as well as fires. Not forever perhaps, but your priority is not to die now. Time is on your side, and even if hundreds or thousands or zombies might be in the neighbourhood, they can't all try to break the doors at once due to physical constraints and zombies' lack of coordination.

Hopefully you'll only need to survive for a few days, and then help will come. But what if help doesn't arrive?

Medium Term Survival - Zombie Demographics

The author inexplicably ignores demographics of zombies, but that's the key to your medium term survival. There are currently about 47 humans per square kilometer. Even in the worst kind of outbreak, where very few people survived, most will likely die without turning into zombies, and every day, significant percentage of zombies will die to delay, loss of energy, accidents, human resistance and so on. Within weeks their numbers will fall real low - even in apocalypse scenario after 3 months it's difficult to imagine more than 1 zombie per square kilometer worldwide, falling to maybe 0.1 per square kilometer after 3 more months.

So what do you need to do? Get the hell out of the city. A single zombie or a handful is not very dangerous, and in the countryside that's the most you're likely to encounter. It's only in densely populated urban areas where you're likely to find literal hordes.

In apocalypse scenario, you won't really have to worry about food and supplies - zombie numbers are falling rapidly, and any store will have huge amounts of nonperishable food for the few survivors. Store trips are extremely dangerous places in the first days of the outbreak, especially for stores located in more populated areas, but a couple weeks or months in, in broad daylight, with prior reconnaissance and cleanup of the surroundings, it's manageable level of risk.

Long Term Survival - Rebuilding Humanity

It's exceedingly unlikely that any kind of outbreak would get all of humanity - most likely it will be geographically isolated and even if a large region falls to the zombies, the military will soon intervene (hopefully not with weapons of mass destruction or carpet bombing), and thing will go back to normal before a year passes.

Still, if we're considering apocalypse scenarios, we might as well consider the worst case of all.

And here the author goes completely off base - recommending setting up the new society for your group in tho most inhospitable environment possible - like deep Siberia, or a desert, or even a jungle. That's just insane. Zombie numbers will be falling rapidly, so your first problem is shifting from eating non-perishable pre-apocalypse food to growing new food - and for that you'll need either coastline for fishing, pastures for livestock, or decent arable land (wildlife hunting can supplement your food, but it's unlikely to work as its primary source) - it won't give the yields modern agriculture, but then the number of survivors will be much less than seven billion.

Bandits are a risk of course, but people can and will defend their homes, and bandits won't last very long in such an environment, just like they didn't in ancient times. Historically, small scale bandits mostly robbed travellers, not farms - you need a small army to setup a successful long term farm robbing operation, and if you have an army you might just as well call yourself President for life, wipe out all other bandits, and start collecting taxes. Of course history doesn't reliably tell what might happen to the society after a catastrophic zombie outbreak, but it very reliably predicts what's going to happen if a bunch of fat urbanites try to set up new life in environment where even natives living there for generations can barely make ends meet.

It's still far safer to deal with some potential bandits than with near certain starvation.

History of Zombie Outbreaks

The book also narrates important historical zombie outbreaks. Since it's based on inference from highly unreliable information, definitely don't take them at face value (especially the alleged multi-year siege), but it's still interesting to read, and can better prepare you for the day zombies come for you.


4/5 stars - It's really important that someone finally wrote such guide, and it contains a lot of useful information, but using it as your sole source is going to get you killed.

Saturday, April 05, 2014

Review of Ruby Under a Microscope: An Illustrated Guide to Ruby Internals

Cat Pimp by nicora from flickr (CC-NC-ND)

I've been digging my way out of an overwhelming pile of book at pace of about 3 a month - a pace at which I have no chance whatsoever to ever catch up with all the absolutely must read stuff. One book I recently found in my pile was a review copy of Ruby Under a Microscope: An Illustrated Guide to Ruby Internals I got a few months ago, which turned out to be by far the best Ruby book I've ever read.

I'm a little jealous of how easy kids have it these days. I learned Ruby internals back in the 1.6 days - that was the time when most programmers have never even heard of this "Ruby" thing (I'm not kidding you here). To learn anything about Ruby internals you had to dig through macro-heavy and very idiosyncratic C codebase (C/C++ codebases tend to be highly idiosyncratic in general, much more than Java or Ruby or Python codebases), and what little documentation there was was mostly in Japanese. And here someone bothered to write a quality book that explains it all, and well just like that. I've learned a lot about 2.0/2.1, JRuby, and Rubinius from it, even if I was already very familiar with 1.8 series (and had some nonzero level of familiarity with others).

I can see two target audiences for this book. First, advanced Ruby programmers who want to learn Ruby internals - to work on one of the Ruby implementations, or write complex C extensions, or to heavily optimize performance of their Ruby apps.

And second, people who want to write their own programming languages. Ruby implementation is uniquely well-suited for study if you're such a person. It's relatively simple, but implements a highly modern language with all the goodies. Studying something like JVM is basically a waste of time - it's a monstrosity implementing a monstrosity, and half of the features you'll absolutely need in your language you'll have to brutally hack into an unsupportive environment, instead of just cleanly implementing them from first principles. And trying to build your language on top of JVM/LLVM or whatnot, while highly pragmatic, robs you of all the learning experience of writing your own first VM - something I believe any serious CS student should go through at least once.

The book itself assumes you're reasonably familiar with Ruby, but nothing out of ordinary, and as far as C goes it assumes you understand pointers, struct declarations, and basic syntax, and that's about it. That makes it surprisingly approachable considering its subject matter, but I found it really useful even already being familiar with all that (or how it was a few years ago at least). It doesn't bore you with compiler theory, but focuses on actual solutions to actual problems, and invites you to think about how things could possibly be solved. Contrary to what you'd expect, it's meant much more for a cover-to-cover reading than as a reference manual - it's over 300 pages, but it's very heavily illustrated, so it doesn't take that much time.

One big weakness of the book was its chapter about Garbage Collection, which spent far too much time on GC theory and far too little about explaining the interesting bits (like write barriers implementations). I don't think it kept up with standards set up by the rest of the book. And of course many subjects could use some elaboration, but you only get that many pages, and its priorities are relatively sensible.

I'm not sure how complete the book is for someone with no prior exposure to Ruby from the inside - it seems to cover all the basics except maybe C extensions (which would require a lot more C knowledge than the book assumes), but even if something you need to know isn't covered, the hardest part is getting started without being overwhelmed by all the interconnected pieces, and the book will definitely give you that.

If you're in one of two audiences I mentioned, it's practically a must read. I don't think it's terribly useful for people who just hack some Ruby on Rails at work, and aren't terribly interested in going deeper. Sample chapter is available on author's website if you're interested.

tl;dr 5/5 stars

Monday, March 17, 2014

Cultural Insensitivity of Europa Universalis IV

Culture groups map from EU4 wiki. Notice 4 monster groups in Asia/Africa, and mess in Europe.

We need a serious talk because EU4 culture and culture group system is just awful. Just slightly blobby France can have 6 completely distinct culture groups (French, Iberian, Italian, German, Celtic, and Basque), but you can own all of Africa, half of Asia, and a pretty big chunk of Europe and fit all that in just 4 (African, Turko-Semitic, Altaic, and East Asian)?

Seriously EU4, pick one resolution and stick with it. There's no sensible interpretation under which it makes sense to put all of Africa or all of East Asia or everything from Crimea all the way to Kamchatka into a single group, but then make a ridiculous number of tiny groups for just about each European country.

There are two huge problems: 4 ridiculously large mega-culture-groups, and extreme proliferation of cultures in Europe.

Here's just one sensible proposal of globally meaningful, but you can pick up any scale and stick to it:

  • India, Persia, and South-East Asia have very sensible granularity, and I'm extremely happy with it. This proposal is meant to give all heavily populated parts of the Old World similar granularity.
  • Current Han/Cantonese should be one group without anything else - and divided into 5-10 different cultures, whichever way it makes most sense. I get it that China was far more culturally unified that India or Europe back then, but it was not this level of unified (just about any medium sized European country of that time has 2 cultures minimum), and that definitely did not extend all the way to Korea, and Japan.
  • Speaking of which, Korea and Japan together would make a nice culture group, possibly with some minor nearby cultures like Manchu if it makes sense.
  • African culture group really needs to be split, at a very minimum East and West Africa should be separate culture groups, since they're separated by massive wastelands, but there are probably great historical and gameplay reasons to add more.
  • I understand why Arabic can be one huge culture group, but Turkish should not be part of it. Ottomans don't need any more gameplay help, and if they got on conquering spree, they'll probably accept most of that anyway.
  • All of Altaic, Turkish, and Manchu need to be reassembled into some number of groups. It could follow basic geography of Middle East/Caucasus (Turkish, Tartar, Azerbaijani), North-East Asia (Manchu, Mongol, Siberian), and Central Asia (everything else), or something along these lines. Right now there are no major gameplay reasons to go one way or another since hordes are massively underpowered, and Ottomans will do well no matter what. Put Uralic in one of those groups as well.
  • In a modest proposal all of France would be one culture. As is all of Italy. And all of Iberia. And all three together form one Latin culture group. Maybe, if there's a really good reason some of these three could be divided into 2-3, but not into silly minor cultures like Galician, Umbrian, and Gascon with just a couple of regions and status equal with Japanese somehow. That would be approximately right for 1444, and who knows how your history will continue from then on.
  • Scandinavian looks really good. Byzantine looks reasonable. Germanic looks a bit overly divided into individual cultures, but it looks good as a group.
  • 3 Slavic groups is a huge mess. There's no cultural basis for grouping Poles with Hungarians but separately from Ruthenians. Just group it into one big culture group, and kill any silly cultures like Schlesian (in 1444, seriously?), Serbian-vs-Croatian (the difference is primarily religion not culture), etc.
  • British for English and Scots, but put Irish, and Welsh in the same group.
  • Just throw Finnish/Estonian/etc. in Baltic group. It makes sense to have a special group here, not two special groups.
  • That leaves Basque, and Briton unaccounted for. I'm tempted to just throw Briton into Latin group for long standing cultural ties reasons the same way Hungarians ended up fake Slavic. Basques can end up there as well, or as a separate weirdo group if there's a strong need to go this way.
  • The New World is about fine as is.
  • Much fewer culture union states. None is a valid number here, and with larger cultures most current culture union states won't have any legitimate reasons to have any.
Or you could pick another resolution, and stick with it. Like Europe-style microcultures? Turn Japan into 10 regional cultures in its own distinct culture groups. Like Arabic-style macrocultures? Turn all of Germanic into one big culture group. Any of that would make sense. What doesn't make any sense is having such drastically different resolutions in different parts of the world.

This isn't just about cultural insensitivity - many aspects of gameplay like culture penalties, AE spread etc. are balanced for certain culture and culture group size, and are currently completely unbalanced depending on which part of the world you play in. Having roughly similar culture resolution - with exceptions for good historical (Chinese group will likely be big even when it loses Japan and Korea) or gameplay (Hungarians in Slavic group) reasons, not completely at random like now - will make for a much more balanced game, and it will allow more aspects of the game to depend on culture system, which currently is underutilized since it's too much of a mess to rely on it for anything.

Monday, February 24, 2014

Fun and Balance minimod for EU4 1.5.0

Warm Fuzzy Furry Thoughts ...... by recubejim from flickr (CC-SA)
Here's updated version of my minimod for EU4 1.3.2, now with a few more balancing features.

For the impatient, here's download link. Now all the explanations.

Less Bullshit

I have very little tolerance for bullshit and AI cheating so:
  • no Burgundy inheritance event
  • no naval attrition due to time spent at sea (what you'd normally get at diplo tech 22) -  AI has 0% naval attrition anywhere, which is the cheatiest of all its cheats and gets on my nerves. You'll still get 1% out of supply range and 6% at open sea - there's not that much abuse potential here (even though AI abuses its lack of attrition all the time), and it will save you a lot of time in micromanaging blockades on the other end of Mediterranean sea.


Huge number of rebalancing changes here. They make non-gamey expansion slightly easier, so some people will like that, others won't. Super-gamey expansion is not affected much.
  • No coalitions due to outraged attitude, leaving just coalitions by special events and missions. It's hard to imagine but AE in 1.5 is even worse than in 1.3.2 (reconquest of your cores now gives AE, WTF?), so it's totally hopeless and our only choice is to disable this completely. Hopefully 1.6 will balance it to the point where we can reenable them.
  • Overextension events scaled down a bit at 101%-200% OE, but you'll get more of them over 400% OE. This doesn't make OE much less painful on average, just smooths this extreme 101% discontinuity, and not even that much.
  • Vassals will buy provinces from you just like in 1.3.2. OE limit is set to 50% after-buying just like for other AI. It was 25% before-buying in 1.3.2 which amounts to approximately the same.
  • Coring time does not depend on your size.

Correction for extreme nerfs

Some game features got inexplicably nerfed to the ground:
  • Republics get a choice of 3 random rulers with minimum of 1/1/4 etc. not fixed at 1/1/4. Keeping the same ruler doesn't give any bonuses, but doesn't lose republican tradition. Basically like in EU3. This makes republican rulers slightly better, and significantly more consistent than kings (can't have 0 or 6 in any skill). Republics suffer from so many downsides due to lack of royal marriages, lack of PUs, it's completely ridiculous that they should suffer from 3 points on average worse rulers than monarchs on top of that.
  • Steppe Horde bonuses increased to +100% manpower, +100% land force limit, -50% land maintenance. A bunch of tests show that they're still far weaker than in EU3, and their civilized neighbours don't have much to worry about - they'll mostly fight each other and rebels (who normally destroyed all hordes by reducing their manpower to 0). It sounds like much, but I tested far higher numbers in observer mode, and even then hordes weren't much of a threat. I miss EU3 here.
  • Cleansing of heresy gives you 25% cost for forced conversion, so you can convert any country - but you don't get any discount whatsoever on demanding provinces. Use that for cleansing heresies, not as an excuse to expand. Hopefully with this reformation in Europe will get a lot more interesting. There were many exploits with this in EU3, so there could still be some here, but that's no reason to kill the feature completely.
  • Imperial Ban now costs only 10% AE as it should so emperor has sensible way to kick Venice and Burgundy from imperial lands (even when these lands have no other cores). It still doesn't give cores like it did in EU3, just claims. That nerf was just ridiculous, the CB affects less than 10 provinces in the whole game and is extremely narrow, and emperor should be able to do take imperial lands back.

Rebalancing minor features

And here's a bunch of changes meant to make the game more interesting without affecting the balance too much.
  • Can't reduce War Exhaustion while at war, period. It's supposed to be War Exhaustion, not damage to diplo point pool. I'm tempted to disable this completely, but for now you can reduce it if you're at peace. This has far reaching implications since a lot of events trigger based on WE like in EU3, but EU3 had real WE, and vanilla EU4 just doesn't have any ever.
  • Protectorates disabled due to all the bugs they have, and because they're such a bad idea anyway.
  • Culture conversion was ridiculously overpriced at 25/basetax. Even at much lowered 10/basetax it's probably still overpriced.
  • Accepted cultures follow single 10% threshold instead of 20% to accept 10% to unaccept thresholds, so it's much easier to predict which cultures will be accepted regardless of order of expansion.
  • Non-accepted cultures now get +5 RR instead of puny +2 RR. Now that should be significant pain in the butt for bigger empires, since they'll have ton of non-accepted cultures. Does not affect same culture group.
  • Rebel support gives up to +6 RR instead of + 3 RR. Remember, AI gets cheaty revolt risk reductions, so it's still probably not as good as you think, except against you.
  • +2 diplomatic upkeep, so you can have some real diplomacy without having free magic upkeep from your special nation (France, Austria etc.), or without rushing to diplo ideas as first group.
  • Buildings level 1-4 don't get destroyed on ownership change.
  • Can store 50% more monarch points to reduce micromanaging around ahead of time penalty.
  • Cores and claims expire 2x slower. Now that core expiration bugs are hopefully fixed, this isn't necessary, but all events that give only claims are useless enough as is, this will make them slightly less useless.

Ideas for the future

There's a bunch of things I considered but didn't add this time:
  • more OE rebalancing so OE is slowly worse as it grows, not everything is perfect at 100% OE, then instant rebels everywhere at 101%, and these events just need to be toned down a bit
  • early game manpower is really painfully low, but it's not obvious how to rebalance it without making it excessive mid/late game
  • maybe restoring geographically limited coalitions for truly excessive aggression (not just sensible levels of expansion), with some sensible ways to deal with them; unfortunately other than outright disabling them modders aren't given much control over them
  • do colonial nations work well? they could be disabled if they don't, and protectorates sure don't
  • crusades and excommunications are nearly useless now, they could use some improvement
  • reformation is very weak if player doesn't support it, could be made stronger and less predictable
  • pirates are just pointless annoyance, unfortunately I don't see any way to turn them off
  • diplomat travel time could be faster, many negotiations require multiple round trips to get everything you want done, and that requires huge amount of waiting
  • moving capital to another continent really should be possible if anyone really wants to do so
  • monarch points are really unbalanced, some tweaks could make it better
Anyway, enjoy the mod: Download.

EDIT: Original version did not correctly disable protectorates, updated version uploaded and links above point to fixed version now.

Sunday, February 23, 2014

5 months with Beeminder

I'm forever blowing bubbles... by hehaden from flickr (CC-NC)
It's been 5 months, plus or minus a few days, since I started serious some beeminding.

Early on I tried to set goal levels somewhere near where I want my long term averages to be, minus some reasonably wide margin for things which might go wrong (it's not pessimism, it's an outside view), but that's actually how I failed one of my goals once and these days I readjust short term goals often and aggressively.

I have status of my beeminder tasks on my GTD dashboard, and it display both time-to-fail and long term weekly averages. That's what actual averages are:
  • Try new fun things - 2.55/week. The "new" being the key here in case you're wondering why I bothered to put it as a task. About half of these turned out to be awful, but the point is for trying something out. I could probably use broader definition of what counts as a new fun thing.
  • Exercise - 2.15h/week. (due to counting method that actually means something closer to 2.5h/week) That's about sensible long term average for a busy person. If I have time for more I'll do more, but there's only so much time in a day.
  • Online Education - 2.38 lessons/week. That's a very interesting one. I redefined "lesson" in a different way for just about every single education resource, whatever was closest to 1-2h/lesson time. Interestingly even at this aggressive pace it doesn't seem like I'll be finishing any courses anytime soon. There's some diminishing returns here, and it feels more fun and more useful to try something else out rather than spend time "finishing" what I already started.
  • Play Magic - 7.19 games/week (that is about 3 full matches/week, I'm counting this way because EDH, casual etc. don't use matches, and people ragequitting after game one are a thing). Making sure I allocate some time each week for Magic led to discovery of a lot of interesting decks I'd otherwise miss. And yet I haven't played much of any Constructed formats other than Standard and a bit of Modern lately.
  • Commits to Open Source repositories - 8.36 commits/week. That's about 100% github these days. That's mostly me being more aggressive about putting stuff I write on github if possible instead of just stashing it in my personal ~/everything repo. And it turns out a lot of stuff I write for myself still can't reasonably go public.
  • Blog - 1.68 posts/week. I counted a few blog-sized things I posted on Google+ which I didn't want here because they were even more off topic than usual stuff I tend to post here, but even disregarding them that's very active blogging.
  • Books - 0.8 books/week. And I'm nowhere closer to getting through the ridiculous stashes of books I sort of meant to read. At least they're mostly electronic form these days, so they take less space. If Amazon releases that rumored high resolution e-paper Kindle this year, that might increase by a lot.
I'm reasonably satisfied with how all these things are going, and I'm in very low risk of failing since average time-to-fail for these goals is somewhere in 20-30 days range typically, so if anything horrible happened that would significantly reduce my ability to do them I'd have enough time to adjust the targets accordingly.

As for things I want to see done which are harder to beemind - I haven't found a decent solution. I tried a pomodoro beeminder target but that was a miserable failure. My experience with pomodoros has generally been pretty underwhelming. Single-tasking is just not very compatible with me. I tried a lot of non-beeminder-linked things, with varying degree of short-term success, but nothing really looks like a good long term solution. If you have any ideas for things worth giving a try, definitely tell me.

Friday, February 21, 2014

Monetary consequences of Scottish independence

Sand cat licking his paw by Tambako the Jaguar from flickr (CC-ND)

Scottish independence referendum is coming soon, and so far it looks that the No option will win, rendering everything I mentioned here moot. But on an off chance residents of Scotland change their mind and vote for independence, the next big question is what currency they're going to use.

The 3 choices are:
  • some kind of Scottish Dogecoin, or whatever else they'll name their currency, with floating exchange rates
  • British Pound, or some Scottish Pound at fixed exchange rates with British Pound
  • Euro, or some Scottish Euro at fixed exchange rates with Euro
And my point is that Scotland will be totally screwed no matter which one of this options it chooses.

British Pound

This is the most obvious choice, since that's the currency Scotland currently uses.

Usually, it's a really horrible bad idea to use currency of another country and give up control over own monetary policy, as eurozone periphery learned in 2008, Argentina in 1998 and the entire world during Great Depression, to just note the most prominent cases.

Currently whenever economy of Scotland goes through a better or worse times than the rest of UK, fiscal transfers do a huge amount of work to level things out. After independence, it will no longer be possible - just compare fate of Greece or Spain with fate of Florida or California - even when their housing markets failed fiscal union among American states provided enough cushion to prevent the kind of Great Recession level of screwup eurozone periphery had to suffer through.

This will be somewhat alleviated by much higher trade levels between Scotland and its monetary partner rest-of-UK, and by Bank of England's far greater competence and democratic accountability than ECB.

On the other hand Scottish economy will be very small, and its exports will be dominated by North Sea oil and gas - so value of exports from year to year will change drastically depending on highly volatile commodity prices, and on production level from just one big source.

Overall, not the greatest idea.

Scottish Dogecoin

The second obvious idea is to pick up its own currency. By the orthodox economics this is the right thing to do - except for the tiny issue of debt denominated in British Pounds.

Scotland, on separation from UK, will inevitably inherit some portion of British debt. British public debt levels are pretty close to 100% of its annual GDP, some of the highest in the world - so assuming Scotland inherits debt about proportional to size of its, it will also be around 100% of its annual GDP.

This will be a huge problem for Scotland regardless of its monetary policy, but let's be serious here - there's no way in hell any country can survive with that amount of debt denominated in now foreign currency. Any chance if exchange rate between British Pound and Scottish Dogecoin can easily skyrocket Scottish debt levels to even higher levels, and unlike large and monetarily independent British economy which can get away with low interest rate, small Scotland with foreign debt would represent a huge default risk, and it would be priced accordingly.

This is even worse than keeping the British Pound.


As if Scottish Dogecoin wasn't bad enough idea, you can do even worse than that. Upon secession Scotland will not have any kind of automatic EU membership, and one of accession criteria is adopting the euro - the only exempt countries are UK and Denmark. So far EU has been extremely lax with this rule, so a lot of EU countries have a schedule of switching to euro in about 2000-never, but they might very well decide that it's a good idea to push harder here.

Scotland would then be in a completely ridiculous state - monetary policy controlled by the most incompetent central bank in the world with zero democratic accountability, and crippling debt denominated in even different foreign currency. If any of that looks likely, run the hell out of Scotland before it's too late, since Greeks will have it easy by comparison.

Any ways out?

Core of the problem here is that for Scotland to be independent it must negotiate terms with both UK and EU, from very weak position in both cases - UK can simply refuse to grant it independence if it wishes to, or enforce just about any terms it chooses, referendum be damned; and EU blocking accession or some kind of Norway-style association would instantly cripple Scottish economy.

Neither UK nor EU have any reason to feel particularly generous towards independent Scotland, and in EU's case any such deal would require unanimity and some of its members (especially Spain) would absolutely hate to establish an easy precedence, since that would pretty much lose them Catalonia next year.

There are some options like going for Scottish Dogecoin, then basically defaulting on all debt by forced conversion of it into Dogecoins, but good luck with all the international litigation in such case - vulture funds are pretty well established part of modern economy, and they are pretty good at screwing weak countries over.

Or if UK felt amazingly generous it could take over Scottish portion of debt - most likely in exchange for a very large portion of North Sea oil and gas revenues. And then if EU felt amazingly generous it could just let Scotland it on Dogecoin without any complications (and then Catalonia next year).

If neither of these looks very appealing, staying on British Pound and hoping for the best might still be the least bad way.

By the way I doubt very much economic arguments are going to convince either supporters or opponents of Scottish independence - if nothing could convince Greece, Spain, Ireland and the rest of periphery to quit euro, and Latvian politicians forced it upon its people even while seeing in plain sight how crippling it would be, there's little chance Scots in their current safety will care about potential risk of future recessions.

Sunday, February 16, 2014

Simple theoretical basis for Hyperbolic Discounting

Cally by hehaden from flickr (CC-NC)
Exponential Discounting is the only time-consistent discounting method and it's mathematically very neat, so all economics and psychology likes to pretend that's how humans operate, but in reality everybody universally uses something much closer to Hyperbolic Discounting.

I've talked about evolutionary side of this problem before. These two discounting systems are not even close, so we need some kind explanation why all humans and all animals so consistently use Hyperbolic Discounting. Today I want to present a very simple and intuitive model in which Hyperbolic Discounting is optimal choice.

Exponential Discounting is wrong

But first, I want to disabuse you from the notion that Exponential Discounting is correct, a notion you might believe from excessive exposure to economics.

First imagine how much less do you care about yourself in 10 years compared to yourself right now. Is it 10%? 50%? 90%? Doesn't matter, just pick a number. Let's say this number is 50%, but analogous reasoning applies to each choice.

Now does any of this sound even remotely true:
  • You care about yourself at age 90 only 6% as much as yourself at age 50.
  • You're indifferent between one person dying today, or a trillion people dying in 200 years from now.
  • You believe that wishes of any person who lived a few hundred years ago count for more than wishes of all existing and future humans put together (to remain consistent, going into the past reverses discounting process, so if you care about the future less, you must care about the past equally more)
These are straightforward consequences of exponential discounting. Does any of that sound even remotely sane? I don't think so.

Now compare that with prediction of hyperbolic discounting model, same discount rate (50% in 10 years):
  • You care about yourself at age 90 only 42% as much as yourself at age of 50 (if you're 30 today). The older you get, the bigger the gap becomes since at young age both of them are extreme remote, but older you get, the closer 50 seems, but 90 still feels very remote.
  • 1 person dying today is as bad as 21 people dying 200 years from now.
  • Hyperbolic Discounting as normally defined doesn't provide any numbers about the past, but the most reasonable way to expand it is to make it symmetrical, so you care about past people less than today's people, and the more distant they are the less you care - you might sort of care what your grandparents wanted even if they passed away, but who the hell cares about some Medieval peasants tens of generations ago?
If you put it that way, Exponential Discounting is pretty much Flat Earth level of crazy.

Theoretical basis for Hyperbolic Discounting

There's still one problem left - Exponential Discounting has neat theoretical basis of self-consistency, but it's much harder to explain Hyperbolic Discounting even if it's so intuitively correct, and agrees with all experiments.

So here are two entirely reasonable assumptions, which together generate hyperbolic discounting:
  • Assumption 1: You care about future or past you and past or present reality in proportion to how similar they are to you and your current reality.
This might sounds like an unusual way to put it, but it is intuitively about right. The future you will be a somewhat different person, with different preferences, and somewhat alien to you. You're likely to care about similar selves far more than about very different selves - and the greater distance in time, the more different a person you'll be.

The same applies to discounting reality - you might like having certain things or maintaining certain relationships, but the more different reality becomes, the more likely it is they'll become less valuable, or won't persist.

To show that what you care about it is difference, not time, consider these - your attachment to your phone or your collection of Magic: the Gathering cards or your funny cat picture collection won't change from today to tomorrow. But what if a zombie apocalypse started overnight? Or if you had to move to another country without ability to return, or if won a lottery, or had a major accident, or became a Scientologist, or whatnot? Suddenly all of this will be so much less relevant because reality will be so different from reality today, even if very little time has passed.

Now I admit, this assumption is unusual, but it doesn't generate Hyperbolic Discounting on its own. If each aspect of your personality and of reality had about the same chance to change every day, you'd still get Exponential Discounting.
  • Assumption 2: Different aspects of your personality and of reality chance at different pace.
OK, this is totally obvious, but changing same pace to different pace assumption moves us from Exponential Discounting to Hyperbolic Discounting. Now technically you need some very particular and difficult to defend ratios to get exactly Hyperbolic Discounting, but you get Hyperbolic Discounting-like by just about any sensible choice of paces.

Let's say an aspect of your personality can have a half-life of 1, 2, 4, 8, etc. years with chance of 1/2, 1/4, 1/8, 1/16 that particular aspect has such half-life. This makes you value your 1.7 year removed self at 50%, but you get to 25% valuation at 4.1 years, and 10% valuation only at 10.5 years. That's not exactly Hyperbolic Discounting (it would predict 25% valuation at 6.8 fears and 10% valuation at 15.3 years), but we just made up pretty much the distribution we could come up with, and its behaviour is already far closer to Hyperbolic than to Exponential Discounting.

For continuous distribution of such half-lives you can assign numbers that give precisely Hyperbolic Discounting. I'm not going to bore you with the math - I'll leave that as an exercise to the reader. (future me will post the math if there's an overwhelming demand)

In any case, nobody really believes humans have exactly Hyperbolic Discounting. In fact both pace of chance of your personality and your empirically measured discount rates will depend on your age and circumstances in fairly predictable matter - just as model presented here would suggest, there is no "one true discount rate". To get exact shapes of people's discount curves you'd need detailed surveys and actuarial tables. Hyperbolic Discounting is basically the mathematically simplest formula that is gives decent approximation of how everybody actually discounts the future, and lacking highly precise and individualized measurements we can just as well use its simple formula.

So now you know of at least one model why people aren't all wrong.

Wednesday, February 12, 2014

Far Cry 3 vs Tomb Raider - comparative game review

Birds Eye View LOL by Andreas-photography from flickr (CC-NC)

I'm doing a comparative review, since in many ways these games are far more similar to each other than you see outside the same series. They've both been trying to resurrect their troubled franchise with a lost on an island survival/exploration/stealth story, and they've been fairly popular for it.

Also one of these games does just about everything better than the other, so it's going to be a fun review.

Mild some spoilers ahead.


Let's start with the story. Tomb Raider is classic reluctant hero(ine) story - it's quite well executed, but it's hard to get any more cliche than that. Far Cry 3 is descend into madness story under thin veil of reluctant hero - something like what Spec Ops: The Line did so superbly. The execution is probably far too subtle, and it's easy to miss half of what the game is trying to tell you during your first playthrough, especially since you have much freedom to do things in your way and order, so traditional story telling gets diluted, but not to the point where environment becomes the story itself like in Skyrim or Fallout: New Vegas. This is a close one, but I feel Far Cry 3 is doing a bit better.

As for protagonist, Jason is highly generic on purpose as demanded by the descend into madness genre - he must be an empty canvas, and any particularly distinct characteristics would overshadow the descend. Lara can be developed much more, since there are no storyline constraints, so on this point Tomb Raider has small edge.

For antagonist, Vass is a strong contended for top 10 bad guys of all times, and let's just say none of the Tomb Raider antagonists has any shot at that list. The biggest problem with Far Cry 3 is that it has too many antagonists who are not Vass, and they are just so much less exciting by contrast.

Likewise, the team of minor supporting characters in Far Cry 3 is far ahead of blandness what Tomb Raider has to offer. The contrast couldn't be more extreme - in Far Cry 3 everybody except protagonist is extremely interesting, and in Tomb Raider nobody except protagonist is.

And before we leave the storyline, let's talk about sex. Lara in her earlier incarnations was famously oversexualized - it feels weird why in retrospect, her body had fewer polygons than a half-decent rendering of a teapot - but they very successfully toned it down and it's no longer what the character is about. Interestingly while they pretty much had to completely desexualize Lara (not counting a couple borderline creepy cutscenes) to restore her position as a serious character, sex is used quite skilfully and with much better taste than you'd expect from a video game as an element of Far Cry 3's storyline, and then again in Far Cry 3: Blood Dragon.


Major part of both games is exploring the island you're trying to escape from.

The island - in Far Cry 3 you can actually explore wide open spaces on your own - the only thing stopping you is danger it represents, not artificial walls. In Tomb Raider you're largely constrained to following the storyline with just minor detours. Both are valid ways to design a game, but Far Cry 3 surely wins this.

Tombs and ruins - in Far Cry 3 you can explore the whole island looking for ruins - some are fairly easy, others are obscure and extremely rewarding when found. The problem is that you can just buy maps showing you locations of them all cheaply, and that kills a lot of fun. In Tomb Raider the titular tombs are just small detours from path of the main storyline, and it's really not much of an achievement that you found them.  On the other hand, Tomb Raider executed platforming and puzzle aspect of tomb raiding far better than Far Cry 3, where the only really hard part is getting there, and once you're there they tend to be pretty straightforward.

Wildlife - at least during the first playthrough Far Cry 3's island is teeming with extremely dangerous wildlife in addition to more conventional human enemies. Then you learn some simple techniques for avoiding them all and the game loses a lot. Tomb Raider's island contains mostly highly scripted wildlife and doesn't feel alive at all.

Enemies - enemies in Far Cry 3 are highly dynamic and coordinated threat and you have countless ways to deal with them - paranoid avoidance being a good start early game. Even if you're really good at the game, you'll be frequently running away from unfavourable encounters, to strike back some other time. In Tomb Raider there's really not much sense of a threat, and the enemies are pretty dumb.

Graphics - the Far Cry series started from a tech demo, and is still unmatched in terms of amazing graphics - it's one of the reasons why the tropical island is so tempting to explore, and during some of the storyline missions the game far outdoes even that. Tomb Raider's graphics are merely decent - I feel they put far more effort into making Lara look (tastefully) good than into making the environment look good.


Of everything I've mentioned so far, Far Cry 3 sounds like an amazing game, and Tomb Raider as still a very good one. Unfortunately when it comes to mechanics both games leave a lot to be desired - and for Tomb Raider a lot more than for Far Cry 3.

Quick time events - Far Cry 3 thankfully largely avoids them. For Tomb Raider they are everywhere - some storyline sequences require you to perform a combination of six or more quicktime events, including repeatedly bashing various buttons, and other such awfulness which is bad enough on a console controller, and completely unacceptable with a mouse and keyboard. This isn't just an inconvenience - endless quick time events after quick time events sap all the fun from this game. I strongly dislike QTE in any game, but I've never seen a game which relied on them so heavily as Tomb Raider, on any platform.

Stealth - Far Cry 3 wins here easily, since outside storyline missions you have full freedom to go any way you want, and even most (not all) storyline missions leave you with unusually diverse options. Tomb Raider gives you some option to avoid combat or ambush your enemies, but so far I haven't found a single quick time event I could sneak away from, so basically the only thing you want to get away from you can't.

Combat - Far Cry 3 has really bad balance (many mods at least partially fix that, Far Cry 3: Blood Dragon was also balanced a lot of better thanks to lessons learned) - for example silenced sniper rifles are totally overpowered and can safety dispatch pretty much everyone if you have some patience and good sniping spot, while bows with full ballistics are really awkward compared with all the silenced guns you're getting, but it's pretty decent, and there's a lot of variety if you want to experiment rather than going for sheer efficiency. Tomb Raider is less impressive, but it's executed decently, except of course half of all combat situations which turn into scripted quick time events instead.

Inventory - this is the most painful part of Far Cry 3. They didn't even bother to group multiple copies of the same items, so selling skins of 10 dingos (2x each thanks to a skill) requires 60 mouse clicks instead of 2. Tomb Raider just converts everything into points, so you never have to bother with buying and selling, which is frankly a much better idea.

Skill Tree - neither game provides terribly many customization choices. Vanilla Far Cry 3 locks out most skills until you progress storyline, which is probably fine on your first playthrough, but most mods get rid of these limitations for a reason. Nothing exciting here in either game.

And everything else

Mods - I'm a PC gamer, a game without mods is incomplete to me. Far Cry 3 has some limited modding scene - it's mostly balance and such minor tweaks, but that makes second and further playthroughs a lot more interesting. Tomb Raider modding scene looks completely nonexistent.

Franchise - both franchises needed a serious reboot. Far Cry 2 was a total disaster, and Tomb Raider series was in even worse spot. Far Cry series already got another amazing game in Far Cry 3: Blood Dragon, so far Tomb Raider series didn't get any major new content, but it definitely managed to turn Lara into a serious character. Hopefully the sequel Tomb Raider: No More Quick Time Events is coming soon.

And that's why Far Cry 3 is  9/10 totally amazing, and Tomb Raider: Quick Time Events is just a 6/10 almost good but no. (I could definitely imagine this game to go to 8/10 if some modder removed every single QTE from it, but without active modding scene I don't have much hope)

Saturday, February 08, 2014

Fun and Balance minimod for EU4 1.3.2

I just finished a nearly full campaign, and while it was enjoyable the game had so many bugs, balance issues, and random fun stoppers I feel obligated to just fix them and release a minimod for everyone to enjoy.

It's an extension of my previous minimod which just disabled coalitions as particularly annoying and buggy.

First - yes, it's for 1.3.2. 1.4 patch is basically an open beta for 1.5, so I wouldn't really recommend playing it unless you're really impatient for new features. I'm sure they'll fix a lot of them for the next patch. It's the same story with every major patch for any of Paradox games, so don't act surprised.

Here's download link.

What the mod does

Since EU4 changes from patch to patch so much I decided to do a small number of high impact changes rather than tweaking a lot of small numbers.

Less railroading:
  • No Burgundy inheritance event. Seriously, this was awful idea, and it will always be an awful idea. Other railroading events are bad, but this goes far beyond just bad. In case you haven't heard it yet - the event kills the king, kills the heir, then popup shows up with "oops, king died without an heir, what a shame, I guess France and Austria get half of Burgundy each for free now"
Workarounds for major bugs:
  • No coalitions. Between AE scaling, outright AE bugs, and lack of separate peace they're simply not fun in any way. I wish there was a less drastic way to fix them, but there isn't.
  • No core expiration. There are so many bugs related to this, it's best to just disable it completely. It also improves gameplay late game.
CB fixes:
  • I get it why they nerfed forced conversion since they were so abusable in EU3, but they nerfed it to the point where it's worthless. Peace cost of conversion now 25% of annex cost if you have cleansing of heresy CB, so you can finally have some proper religious wars in Europe. And you no longer get lower AE for taking provinces with this CB - it's really meant for forcing conversions, not as excuse to grab territory. (I tried modding it so that conversion is always 50% of annex cost, but it seems that game converts PEACE_COST_CONVERSION to integer so 0.5 is rounded to 0). It's probably still totally abusable, but I prefer abusable mechanic to not having religious wars at all. By the way unlike in EU3 force converted countries can happily flip back to their old religion next week even without rebels forcing them to.
  • Imperial ban CB down to only 10% AE on imperial provinces. It was completely ridiculous that you'd get full AE and then only a claim on a province, which would be unsellable since it's in HRE so you'd need to core it the hard way (since most of provinces which you can ban don't have any releasable cores like Venice, or lose them very fast like Burgundy). It's still way worse than in EU3 since you don't get a core, and not having a core hurts more.
  • +1 diplomatic relationship for everyone. The limit was low that no matter what gameplay you wanted it forced you to go for diplomatic ideas very early. I'm not sure if +1 is enough, but it's a start. Making vassals and/or royal marriages upkeep-free might be interesting (except that's not moddable as far as I know).
  • Culture conversion cost lowered from 25/bt to 10/bt. Culture conversion either needs to be drastically cheaper, or to have penalties for non-accepted cultures much higher, since in vanilla it's completely worthless regardless of circumstances. I think it might still be too expensive even after the cut.
  • Buildings no longer destroyed on conquest (except unique and level 5-6 buildings). It was either that or making them cost no monarch points. Maybe we should just do both, especially if we can come up with some dump for MIL points?
  • No war exhaustion reduction while at war (cost x100). It was really silly that instead of causing war exhaustion you were only causing the country to lose some monarch points, so WE never actually mattered during the war (it only caused long term tech lag). If you want to reduce war exhaustion, peace out first.
  • No extra time to core per province owned. If you can pay the price, you can core whatever you want.
  • Foreign support for rebels can increase RR from +3 to +6. It was far too weak. I'm not even going to talk about bugs where patriots want to secede back to the country they're rebelling from and such nonsense, which made already weak option even weaker.
  • Max power stored increased to 1500. Very often I waited for January 1st to have no or lower ahead of time penalty, but then I missed it since I was busy with other things and a lot of points got wasted over 999 limit. I doubt it will affect game balance much.

What the mod does not

There's a long list of things the mod might be doing, but isn't right now, including:
  • Manpower - It's annoyingly limited early game and extremely plentiful late game. I'm not sure how to balance that out by modding.
  • Pirates - they're just minor annoyances for no game value, but I guess I can live with that.
  • Naval attrition - it applies only to players not AI, it requires really painful amount of micromanagement for blockades, and for some crazy reason your supply range doesn't even count ports of your vassals or where you have ship basing rights. There are probably some balanced ways to deal with it, and it's not game breaking the way coring and AE bugs are, so I'll let it be for now.
  • Colonies and Economy - DLC for that is in open beta (also known as 1.4 patch), so you can just wait for it.
  • Other railroading events and bonuses - it would be nice to replace other events like Iberian wedding, Poland-Lithuania union with something more generic, which can trigger for most countries in certain circumstances rather than just for one specific country early game. And some bonuses countries get, especially Muscovy, are pretty ridiculous and would use some nerfing. Anyway, that would take a lot of fine balancing, and with EU4 being a moving target it is, there's not really time for it, so I only killed the most awful of them all.
Most of these changes - and a few more - will probably be just as necessary for 1.5.


All software pages moved to taw.github.io

It took me approximately forever to actually do that (probably my fault for not using beeminder for it), but it's finally done. All links on this blog which pointed to dead server at taw.chaosforge.org now point to updated taw.github.io and/or to Dropbox for larger binaries.

I decided to put MTG Sealed stuff (images copyrighted by Wizards etc.) in that github repository as well, hopefully that won't annoy any Hasbro lawyers too much. I'd be relatively easy to change from local copy of images to hotlinking them and be totally safe, but I'll deal with it if someone complains.

If you find any remaining fixable dead links either here or on taw.github.io, feel free to bother me.