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

Monday, April 05, 2010

How to kill all your children

Félinitude-I by Etolane from flickr (CC-NC-ND)

I'm sure you all had this problem a few times - you tell your children to do something, and they just won't obey. At first you wait, but your patience grows thin until you come to face the inevitable - you have no choice but to kill all you children. But first you need to find them.

Unfortunately there's no portable API for traversing process tree to find all your descendant processes. ps, pstree and similar programs use operating system-specific hacks, like reading procfs (Linux) or reading tea leaves patterns (OSX). Even command line options for ps seem to follow three different mutually incompatible systems. And careful tracking of return values of fork won't do you any good, as forked processes might have kept spawning.

So we'll need more than one line of Ruby. Maybe even as many as five!

First, let's get raw data out of the operating system. If it was Linux-only exercise, procps would work fine, but some experimentation shows that both Linux and OSX versions of ps support -eo pid,ppid options for getting process parentage graph.


$ ps -eo pid,ppid
  PID  PPID
    1     0
   10     1
   11     1
   12     1
   14     1
    ... 
 3367  3366
 3382  3367
 3441  1240
 3442  3441
 3460  3442


Before doing anything else, let's just turn it into a hash.


Hash[*`ps -eo pid,ppid`.scan(/\d+/).map{|x|x.to_i}]

Now we know what's parent of every process and the only problem is reverting this graph - something that's strangely missing from the usual Hash/Array toolkit that Ruby and Perl are based upon.

A brief pause time. You might be wondering what happens when process's parent dies. Normally it is the reparented to its grandparent, or init process, whichever is more sensible based on process groups and other things we don't need to concern ourselves with. So process graph is always proper, unless something weird happened during execution of ps (atomicity in my Unix? it's less likely than you think).

Now it's time to do a lazy half-unification. Create a list for every process containing just its id, and then go through all processes and add reference to its list to its parents' list. When we're done every process's list will contain at some depth ids of all its descendants. Now it's just flatten and remove yourself from the list to avoid a suicide.


def Process.descendant_processes(base=Process.pid)
  descendants = Hash.new{|ht,k| ht[k]=[k]}
  Hash[*`ps -eo pid,ppid`.scan(/\d+/).map{|x|x.to_i}].each{|pid,ppid|
    descendants[ppid] << descendants[pid]
  }
  descendants[base].flatten - [base]
end

Once you've found all your children and further descendants, it's just a matter of a quick kill -9 to finish them all off.

Death Sentence - Help Roni - California by fofurasfelinas from flickr (CC-NC-ND)


As a bonus, here's the version of the same function in Perl.

sub flatten {
  map{ (ref($_) eq "ARRAY") ? map{flatten($_)}@$_ : $_ } @_;
}
sub descendant_processes {
  my ($base) = (@_, $$);
  my %parentage = (`ps -eo pid,ppid` =~ /\d+/g);
  my %reverse = map { ($_, [$_]) } %parentage;
  while (($pid,$ppid) = each %parentage){
    push @{$reverse{$ppid}}, $reverse{$pid};
  }
  shift @{$reverse{$base}};
  flatten($reverse{$base});
}


Notice the advantage Ruby has over Perl - and how workaround while annoying are not that difficult:
  • There are no default arguments, but we can easily hack them with an equivalent of [*arguments, default] for one-argument functions.
  • I wanted to say in Perl we don't need to_i - but then it doesn't really change anything in Ruby either, operating on pids like 1234 instead of "1234" just feels saner.
  • We can use Ruby autovivification which takes blocks, but Perl autovivification is useless as we want hash values to default to [key] not []
  • There's no flatten so we need to implement it (and it's such an extremely common function - the reason it's not in Perl is because Perl started without any support for nested arrays whatsoever)
  • There's no way to subtract lists from each other like Ruby's [1,2,3] - [2]. Fortunately we know own pid is always first, so we can just shift the list.
As always, C++ version left as an exercise for the readers.

Monday, March 29, 2010

Personal experience points and OSX menulets

World of Warcraft Obsession by Stacina from flickr (CC-NC-SA)

Doesn't it seem odd how people are willing to spend so much time and effort on doing everything that's best for their in-game characters, and yet they never do anything for their real lives?

And it's not just highly complex MMORPGs like World of Warcraft and Eve Online - look how many people spend how much effort on FarmVille - which is about logging it at scheduled times and clicking harvest/plow/plant seeds on a large number of virtual squares! Many of them are the same people who avoid putting any effort into their real life characters as much as possible.

There's been some interesting discussion about this real world - gaming world divide, started by this TED talk by Jane McGonigal - like vast majority of TED talks it's totally wrong, and totally worth watching for entertainment value and some intellectual stimulation:







By the way - to people who are new to this blog - links here are like on Wikipedia - they usually lead somewhere interesting.

Anyway. Assuming you want to achieve some real life outcomes but your laziness and disorganization stops you - like most people - why couldn't you simply approach life just as if it was a game? Well for one thing games give you a lot of immediate feedback that you're doing well, but real life doesn't.

So why not fix the problem and create such immediate feedback? This "feedback" is usually little more than just some numbers, progress bars, and make some badges or other icons. Let's do it!

Experience points log

Well, first thing you need is log actions which give your real life character experience points.

A log can be a simple semi-structured text file like this.
= RULES =
# Every time
+10 write a blog post
+2 read a book
+1 go to gym
+1 play with cat

# Just once
+100 setup a backup system
+500 organize free elections in Belarus

= 2010-03-27 Sat =
+10 blog post
+1 played with the cat

= 2010-03-28 Sun =
+1 played with the cat
+2 read a book
Example is completely made-up but you can think of some points for yourself. And of course you can go back and change these rules and numbers any time you want.

kitten by biwanoki from flickr (CC-NC-SA)

Recording actions

Unfortunately there are no iPhone apps for that yet, so we'll have to record our actions manually - but let's make it as easy as possible. The log is located at /home/taw/all/xp/xp.txt and I have the bound one of the keys on the most awesome keyboard in the world to open this log in case I want to edit it.

And because I almost always have terminal open, I wrote a script which appends current date header if it changed, and if you passed it any arguments it appends them to the log, otherwise it opens it. Actually now that I think about it, it wouldn't be a bad idea to get the keyboard shortcut to do this date change too... The script also edits itself if I pass it --edit

#!/usr/bin/env ruby1.9
exec "mate", __FILE__ if ARGV[0] == '--edit'

require "time"
require "date"

fn = "/home/taw/all/xp/xp.txt"
last_day = Date.parse(File.read(fn).scan(/^= (\d{4}-\d{2}-\d{2} \S{3}) =$/)[-1][0]) rescue nil

out = []
unless last_day == Date.today
  out << Date.today.strftime("\n= %Y-%m-%d %a =\n")
end
out << ARGV.join(" ") unless ARGV.empty?
unless out.empty?
  open(fn, "a"){|fh| fh.puts out.join}
end

system "mate", fn if ARGV.empty?

It's all highly portable so far as long as you adjust paths etc. - nothing OSX-specific about it.

Drawing progress bar


It's fairly simple to think of a regexp to parse experience points out of the log - the only nontrivial bit is skipping rules section. But we'd much rather have pretty icon than numbers.

Well, first let's parse XP and convert it to levels, in a typical quadratic system (code assumes Symbol#to_proc; upgrade your Ruby to 1.8.7 or paste it from core_ext if it dies).
module XP
  class << self
    def read_xp
      log = File.read("/home/taw/all/xp/xp.txt").sub(/\A.*?= \d{4}-\d{2}-\d{2} \S{3} =\n/m, "")
      log.scan(/^\+\d+/).map(&:to_i).inject(&:+)
    end
    def threshold(level)
      10 * (level ** 2)
    end
    def stats(xp=(ARGV[0] || read_xp).to_i)
      level = 0
      level += 1 while xp >= threshold(level)
      [xp, level, xp-threshold(level-1), threshold(level)-threshold(level-1)]
    end
  end
end

XP.stats returns an array of [experience ponits, level, XP since acquiring current level, XP needed from current level to next] so code drawing pictures doesn't have to think about it.

Now the drawing part. We want 32x16 icon - height is constrained by OSX menu bar height, this ratio just looks good. On the bottom we have progress bar, on the top 1-4 colored circles showing your level - levels 1-4 are green, 5-8 are cyan etc. Here are some examples:


And the code:
require "rubygems"
require 'RMagick'

canvas = Magick::Image.new(32, 16){
  self.background_color = 'transparent'
}
Magick::Draw.new.instance_eval {
  stroke('black')
  fill('none')
  rectangle(2, 9,  30, 14)

  xp, level, xp_got, xp_needed = XP.stats

  stroke('none')
  fill('#0F0')
  rectangle(3, 10, 3 + (29-3)*xp_got/xp_needed, 13)

  level_colors = %w[#0FF #FF0 #F0F #00F]
  while level > 4 and !level_colors.empty?
    fill(level_colors.shift)
    level -= 4
  end
  level.times{|i|
    x = 4+8*i
    circle(x, 4, x, 1)
  }
  draw(canvas)
}
canvas.write(ARGV[0] ? "xp-#{ARGV[0]}.png" : "/home/taw/all/xp/xp.png")

In both parts of the code weird ARGV[0] code is just there for making sample images instead of reading the actual log. Not exactly a masterpiece of modularity, but that's real world Unix scripting for you ;-)

Wich wun will teh kitty beet yous wif??? by Throcket Luther from flickr (CC-NC-ND)

Putting it in OSX menu bar

All this work is fairly useless we put the icons generated somewhere no display - like on OSX menu bar. So far everything has been reasonable system-independent - this part is highly OS-specific - unfortunately all cross-platform GUI toolkits take lowest common denominator approach, and look like shit on all systems equally. But it's really simple code. It's really easy to make the menu icon interactive but then I don't have any particular need for it to be interactive yet.

It must use OSX-shipped ruby interpretter (/usr/bin/ruby), not one from MacPorts unless you want to deal with some serious library hell.

#!/usr/bin/ruby

require "osx/cocoa"
include OSX

class Timer
  def init
    tick
  end
  def tick
    system "./draw_xp.rb"
    $statusitem.setImage(NSImage.alloc().initWithContentsOfFile("/home/taw/all/xp/xp.png"))
  end
end

app = NSApplication.sharedApplication 
$statusitem = NSStatusBar.systemStatusBar().statusItemWithLength(NSVariableStatusItemLength)
NSTimer.scheduledTimerWithTimeInterval_target_selector_userInfo_repeats(1.0, Timer.new, 'tick:', nil, true)
app.run 

Alternatives

One thing I found while writing this blog is Chore Wars, which seems to be like a website for getting XP for performing real life actions - there might even be a Firefox port for constant visibility, but making it public is kinda creepy. You don't want Belarusian secret police finding out about your "+50 sent information about Lukashenko's secret Swiss bank account to WikiLeaks".

Saturday, March 27, 2010

Small tips for making Unix programming nicer

Koma is a Mac Addict by Pixteca MX【ツ】 from flickr (CC-BY)

Every Unix programmer - and I tell it authoritatively based on my statistically significant sample of 1 - creates millions of tiny scripts that he never bothers publishing. Because they're small, so overhead of cleaning up, documenting, and publishing such script would be immense. And not obviously googleable/bingable/baiduable or whatever people call it these days - it might surprise you but most things in the world are not described by a few well-defined key phrases.


I decided to get a few of such scripts, and throw a bunch of tips on top of them - hopefully you'll find a useful trick or two here.

How to avoid Unix destroying your files

First, we need to fix some of the famous Unix brain damage - cp, mv, and bash overwriting your files.
Now a case could be made for rm removing files without asking for confirmation - that's what rm stands for.
But how in the world is this:
mv most_awesome_song_ever.mp3 ~/Music/
supposed to quietly overwrite existing ~/Music/most_awesome_song_ever.mp3?
In 99% of cases this is behaviour you do not want - and if you actually do,
you know to type this instead:
mv -f most_awesome_song_ever.mp3 ~/Music/

So open your ~/.bashrc and put these commands there (at least ones for mv and cp):
alias rm='rm -i'
alias mv='mv -i'
alias cp='cp -i'

There's one more way Unix can destroy your files - command >file redirection will overwrite file without asking, so it's pretty easy for accidents this way. You really don't want
cat >~/notes/girlfriend
to lose information about all your exes, do you? (example purely speculative) Get yourself into habit of always saying command >>file - appending to file. 99% of time the file in question won't exist - so the result will be the same - and in cases where file exists, you remove it first. If you make a mistake, you just ^C and you're back when you started. I haven't used overwriting redirection is years - it's completely purged from my Unix dictionary. Do the same thing.

By the way some Unix distributions do these by default. And some shells have options for asking for confirmation if > would override files. Do these anyway, just to be sure.

Make shell history useful

By default shell history stores entire 500 entries - a sensible decision back when you had 4MB of RAM, most of which taken by Emacs. It's just ridiculous these days so as first line of .bashrc put export HISTSIZE=1000000. It must be first, because if bash ever decides to exit without HISTSIZE set to a sane value, it might decide to trim your history file and lose all your history. Of course if you want to tempt the fate...

Get rid of .pyc file everywhere

Python's habit of creating .pyc files all over the place gets on my nerves - and it's dubious that they really improve performance that much. If they want to fix performance, how about dealing with GIL first instead of resorting to such hacks? Anyway export PYTHONDONTWRITEBYTECODE=1 totally fixes the problem without any side effects.

Saner output from Unix commands

Compared to fatal loss of data, these are just minor annoyances, but they're really easy to fix, so let's do it.
For stupid reasons du and df commands give sizes in units of 512 bytes or something like that.
Probably some ancient BSD file system allocated files in multiplies of that. That they care more about file system
implementation details than about human usability tells you something about the Unix mindset (if these were at least kBs
that would make sense but no...) - and in any case these assumptions are no longer true on modern operating systems,
which don't rely so mindlessly on blocks. So add these two lines to get human-readable output:
alias df='df -h'
alias du='du -h'

By the way alias command only applies to what you type in the terminal, not what scripts do. So if you run mv or df from scripts, it will not have this default -i/-h. Be cautious.

FELEK - My Home


Final touches for .bashrc

If some commands require root access, and you're tired of typing sudo this and sudo that, just add a few of:
alias port='sudo port'
alias gem='sudo gem'
alias apt-get='sudo apt-get'
alias reboot='sudo reboot'
to your .bashrc. They only save you a little typing, and don't chance anything about security (you still need your admin password etc.), but why type more if you can type less.

Colorful shell

Depending on your distribution you might already have colors in your shell or not.
export CLICOLOR=1 in .bashrc will convince many commands that you want nicely colored output.
To tell that to git, you need to add to your .gitconfig:
[color]
 diff = auto
 status = auto
 branch = auto

And now your Unix comes with more rainbows.

GNU grep must die

Never use GNU grep. Use pcregrep for everything - or rak/ack if you want coloring, automatic .git directory skipping etc. Unfortunately pcregrep is ridiculously slow to type so do yourself a favour and add
alias gr='pcregrep'
to make your life even easier.

wget HTTPS nonsense

I don't know if it's just MacPorts' version of wget, or is it universal, but it seems to miss all HTTPS root CAs (take that VeriSign!). Another alias solves the problem. By "solves" I mean it opens a massive security vulnerability, but we already know that CAs will create fake certs for NSA, Mossad, RIAA, and Hackney Borough Council if asked, so the vulnerability is much less than it seems at first.
alias wget='wget --no-check-certificate'

Use ruby or perl for nontrivial actions

In early 1980s, before Perl got invented to solve exactly this problem I talk about,
people would write insanely complicated shell scripts to automate their Unix actions.

Unfortunately you cannot really serve two aims at once - being highly accepting for casual real time input,
and being highly robust for programmable interfaces - so shell sucks at both. Fortunately the problem
is solved since December 18, 1987 when Perl got invented just for this reason.

And yet - many people act as if 12/18 never happened. Wake up sheeple!

curious sheeple by ztephen from flickr (CC-NC-SA)


Shell is ridiculously stupid. It has arcane and fragile escaping rules.
It cannot even reliably expand a file list:
$ ls ~/porn/*.jpg
-bash: /bin/ls: Argument list too long

How useless is that? And don't even get me started with xargs, find, awk and the rest horrible mess.

How do you find top largest MP3 files - in any subdirectory?
ruby -e 'Dir["**/*.mp3"].sort_by{|fn| -File.size(fn)}[0,10].each{|fn| system "ls", "-l", fn}'
And yes, I'm calling ls 10 times here, as otherwise it would see fit to rearrange them alphabetically just for lulz.
This Ruby code is really easy and really obvious.

What would be shell solution? Something like this:
find . -name '*.mp3' -print0 | xargs -0  ls -l | sort -k25 -rn | head -n 10
You need find and xargs to avoid "argument list too long" error, then you need -print0 and -0 because file names can contain single quotes or - longcat forbid - spaces! Then you need to manually count at which position of ls -l's output is file name (conveniently ls -l uses something close enough to fixed column width to make sort work - otherwise you'd have to do some heavy awking around it), then you finally head. Personally I prefer waterboarding to having my brain suffer any of this.

Learn GUI integration basics

The chasm between nice programmable world of Unix terminals and hostile world of closed GUI programs can be to some extend lessened.

If you use KDE, dcop command gives you decent level of control over GUI programs and you can explore the interface from command line.

On OSX there's a convenient open command for opening URLs and files with the most sensible program. And osascript command, which is about as powerful as KDE's dcop except far more painful to use by trying to be "friendly" too hard, resulting in unsurprising failure. Google will help.

Editing your scripts made easy

You probably have five billion scripts in your path (you have ~/bin or ~/local/bin or ~/gitrepo/bin or such in your $PATH right?) - and you're tweaking them all the time.
Typing mate `which some_script.rb` takes forever and is not easily tabbable (Ubuntu has really good
bash autocompletion package which might alleviate this problem a lot - but most distros don't).

Wouldn't it be easier to just say some_script.rb --edit? It would also be far easier to type - somTAB --edit. It's really easy. Just put this below the shebang line of all your scripts:

# Ruby
exec 'mate', __FILE__ if ARGV[0] == '--edit'

# Perl
exec "mate", __FILE__ if $ARGV[0] eq '--edit';

# Python
import os, sys
if sys.argv[1:2] == ['--edit']: os.execlp("mate", "mate", __file__)

If someone passed --edit as first argument it will start the editor instead of running the script - otherwise it will not affect it in any way.

Python code is fairly painful because Python decided to keep low level C interface to exec* instead of providing sane Perl-style interface. And you know something is wrong if Perl is described as "sane" compared with you.

Feel free to figure out how to get this effect with C++.

PRRRRRRR!!! by milky.way from flickr (CC-NC-ND)

Find kittens for your blog

I only want CC kittens, so nobody sues my blog. Except for defamation, that I don't mind. Here's the script

#!/usr/bin/env ruby
uri = "http://www.flickr.com/search/?q=#{ARGV.join '+'}&l=cc&ss=2&ct=0&mt=all&adv=1&s=int"
# On OSX
system "open", uri
# On Linux
#system "firefox", "-new-tab", uri

By the way could someone get Linux distros to copy open command? It's really simple and really useful.

That's it for today. Enjoy your Unix.

Saturday, March 20, 2010

How to be a high-status blogger (like Robin Hanson)

P1010334-Tit'Fanee 03.02.08...Bizous à vous...!!! by julicath/Cath (pas vraiment présente) from flickr (CC-NC-ND)

Welcome my to highly inflammatory and highly meta post, which I wrote to show-off my high status as a blogger, obviously. I could have made this post more structured and logical, but it would suggest I actually care about my readers, and caring is low status, right? Or is it? (making this sound deeper will definitely make the subject more high status).

So what's Robin Hanson's theory of status? The basics are simple - people have different hierarchical "status" in society, which is based on organization of paleolithic tribes of hunter-gatherers, and before that of primate bands. These monkeys/cavemen/or such would always try to figure out what's whose status in the tribe so they could engage in tribal politics effectively, but people are not cats so they don't come with captions (making silly jokes is high status, I think), so they had to rely on subtle cues - minor differences in behavior between high-status and low-status monkeys. If you acted like a high-status monkey, everyone would assume you're a high-status monkey and treat you accordingly.



Funnily enough, there are even some experiment showing such effects in monkeys. (I could find you a Wikipedia link, but I already told you what caring would signal) The difference is that with monkeys it's pretty easy to figure out what high-status or low-status behavior would be - and quite easy for researchers to fake it - so it's nice testable theory.

But that's not what Hansonian status is about. Meta time! People incorrectly assume that bloggers write because they believe what they're writing to be true! By showing a few examples of popular and yet false blogs <GLaDOS>insert link to a study showing this here</GLaDOS>, we can convincingly demonstrate that bloggers don't write things that are true, but to signal their high status. It doesn't really follow? Well, it doesn't matter - it works well enough for showing off you're smart and high-status, and that's the only thing which counts in life!

That's basically the methodology. And it's not just Robin Hanson, I've seen far too many people on Less Wrong doing the same - without any doubt they're just trying to associate with high status originator this way.

And what are these high and low status signals? Now it gets even more interesting:
  • Anything for which you can make a just-so story that it might have been a high/low status signal in some imaginary primate/Neolithic community, can be treated as high/low status signal without any further evidence
  • Anything which some of people you think are high/low status today seem to be doing, can be treated as high/low status signal, or not, depending on how you feel about it, and regardless of there existing even a correlation.
  • Anything that seems high status might be treated as low status, because obviously only low status person would try so hard
  • Anything that seems low status might be treated as high status, because obviously only high status person could signal that they don't care what others think like that
That is - virtually any behavior can be described as high or low status, depending on how you're feeling on a particular day. Mocking others' theories like that is obviously high status, as some high status people like... let's say Jon Stewart do so. And I don't have to care if other high status people like let's say The Pope don't - or if it might be as common or more among the low status people - such concerns are no part of the Hansonian methodology.

This all has zero predictive power, and no falsifiability whatsoever.



And it doesn't have to be that way. Status theory has a revival after being long forgotten, but it started in late 19th century with Thorstein Veblen's The Theory of the Leisure Class. Now I wouldn't advice reading that book - it's the most painful kind of 19th century literature - unfortunately I know of no better more modern versions. (see what I did here? I'm showing off that I've very knowledgeable and can do impressive things like reading difficult books - so high status!)

Veblen's theory - while based on about as much nonsense just-so stories explaining how status came about - was much simpler than Hanson's, and had far more predictive power. Signals according to it are:
  • Spending money on shit you don't need that everyone can see (conspicuous consumption) - high status
  • Wasting time on useless activities in a way that everyone can see (conspicuous leisure) - high status
  • Doing real hard work - low status, and the more real and harder it is, the lower the status (Veblen didn't believe any of business / management really counts as useful work, and I can definitely see his point)
That's about it.

This can actually predict something, right? Look what kind of signals different ways to spend a day would show:
  • Flipping burgers at MacDonalds - really low status, you pollute yourself with menial work
  • Playing Excel accountancy games at the office - still low status, at least you avoid menial work pollution
  • Playing video games - you waste time but mostly privately, so it counts for little; doesn't show you have money to waste - so still pretty low status
  • Going for holidays in some popular destination - shows you have some time to waste, and some money to waste - higher status
  • Going for really expensive holidays like on the Lower Earth Orbit - definitely high status, but could use some more conspicuous leisure
  • Holidays excavating Mayan ruins - not only shows you have loads of money, it also shows you had ridiculous amounts of time to waste to learn something as useless as Mayan archeology - very high status
That's Veblenian logic. Of course there's no research proving any of that, but who cares. At least it predicts something. Hansonian theory could make a just-so story that burger flipping is high status as it shows you control access to food, which must have been very high status in Paleolithic tribal society - just imagine that - someone who could provide the entire tribe with BigMacs would be the instant alpha male of the tribe (not that such wolf terminology has any applicability to human societies, but anyways)! Or alternatively burger flipping might have Hansonian high status by showing that you so totally don't give a shit what others think about you, you're going to flip some burgers, oh yeah! Unfortunately predictive power and falsifiability don't correspond with high status in either of theories (but feel free to make some just-so stories showing that they do).

Now if you think about it - writing such post shows off that I have plenty of time to publicly waste. Which is appropriately meta.

Wednesday, March 17, 2010

Please privatise Royal Mail already


I woke up today, and on my way out checked the physical mailbox - and I wasn't even that surprised any more that it contained a "Sorry, you were out" note from the Royal Mail. It's probably the fifth or so time when the Royal Mail cannot find me when I'm at home. Now think which of these is more plausible:
  • Aliens keep abducting me for anal probe experimentation every time Royal Mail is supposed to deliver a package for me.
  • Those lazy unionized asshats don't even bother ringing and just add the note to the pile of letters.
And no - it's really impossible to miss the doorbell, it's ridiculously loud and annoying, so that's not it. Now let's think for a moment - what would a reasonable package delivery policy be for cases where the recipient is missing - not to mention cases when your staff is too lazy to even bother checking that?
  1. Try delivering the second time
  2. Have the package available for pickup from the nearest Post Office
  3. Have the package available for pickup from some Delivery Office in the middle of nowhere, opened at highly inconvenient hours
You can probably guess when I'm going. And nobody else - none of the private package delivery companies, or fast food delivery guys, or Tesco grocery delivery service, not to mention normal guest - ever had such problems - it is only the Royal Mail and they keep failing over and over again!

So what should be done about it? Privatize their lazy asses, that's what! Maybe it would help, maybe it wouldn't - but right now these fuckers not only cannot deliver mail, they suffer from a severe case of Royal Mail Entitlement Syndrome - and privatizations are a really good cure for that.

Hopefully that will be one good thing that will come out of Tories taking over the country. Labour became so much like Tories already anyway that the only difference between them is Labour's testicular deficiency when it comes to dealing with unions.

Friday, March 12, 2010

The real reason behind Greek economic problems

Relaxing Greek Cat by flik from flickr (CC-NC-SA)

According to CIA, right now Greece has GDP of $405.7bln, and debt of $552.8bln (136%) - not even counting debt hidden thanks to Goldman Sachs shenanigans. It got into massive debt by spending too much and taxing too little. But everyone seems to forget what it spent so much money on. Here's the real reason:
Greece spends far higher percentage of GDP on military than any EU country; higher than US, Russia, and any even remotely sane country in the world.


Greece spends completely insane 4.3% of its GDP on military - that not even counting forced unpaid labour system - if every soldier was actually paid the number would be even higher - and it definitely severely damages economy by taking people at their most productive age away from useful activities like studying or working.

And what's their track record?
  • They obviously lost during the Second World War, but so did everyone else, and then they proceeded to...
  • Have a Civil War 1944-1949! The first major success of Greek military was murdering fellow Greeks, with British and American assistance.
  • The Civil War being won, the army still felt like shooting some people but didn't have balls enough to face another real army, so not soon later, in 1967, they overthrew the government to kill even more Greeks (they especially loved killing students). With CIA involvement of course, like most Cold War right wing military coups.
  • What did the military junta do after they ran out of people to kill in Greece? By sponsoring a military coup attempt in Cyprus with annexation of it into Greece as the ultimate goal. That failed spectacularly, as Turkey would have none of it, and moved its army to annex Northern Cyprus. The fiasco caused collapse of Greek military regime.
  • So what did Greeks do after that? Dissolve or at least drastically reduce the army whose only occupation was shooting at their compatriots and unsuccessfully trying to occupy other countries? Of course not - they kept spending insane amount of money and forced unpaid labour on it!
Let's look at list of countries by military expenditure, some notable cases.
  • Greece - 4.3% - way too fucking high, never won a war, killed fuckloads of Greeks
  • USA - 4.06% - while being involved in countless genuine wars
  • Russian - 3.9% - you're clearly spending far too much if even Russia is saner than you
  • South Korea - 2.7% - and they're next to a nuclear-armed madmen just waiting for the best time to hit them
  • France - 2.6% - second highest in EU, manage to have built third largest nuclear arsenal for that
  • UK - 2.4% - and that includes nuclear arsenal and they even manage to win a war every now and then without American support
  • Taiwan - 2.2% - they clearly don't care about Chinese
  • EU average - only 1.69%
  • People's Republic of China - 1.7% - they're clearly all hippie peaceniks!
  • Japan - 0.8% - being in reach of North Koreans nukes? We just love our animes and do not care about such things!
There is absolutely no reason why the miserable failure that Greek military is should cost anywhere near as much as it does. And don't even try to mention of Turkey - Greece is part of NATO and has all the NATO guarantees; Turkey was never remotely interested in invading Greece; and their Greek-military-initiated confrontation over Cyprus already resulted in massive failure of Greek military.

Imagine that instead of insane 4.3% of GDP Greece spent only 1.7% of GDP in it, like a typical EU country. Over the last 20 years (before that there was Cold War, which was seriously overrated but let's excuse that), it would save them 52% of GDP - moving them from the list of bankrupt countries to the list of fairly average countries struggling with the recession. But there's more! All that 52% of GDP incurred compound interest. Average long term interest rates are about 6%/year nominal, so 1bln drachmas spent in 1990 grew all the way up to 3.2bln drachmas now (or however many euros that is). Even worse - countries which are deeper in debt have to pay much higher interest rates.

Now exact calculations would require far too much data gathering, so I won't bother at the moment, but one thing is clear even from this:

The only reason Greece is in such crisis now is because they have ridiculously oversized army. The main requirement of any bailout package should be massive reduction in size and cost of their armed forces.

Friday, March 05, 2010

Evolution of the Total War series

Greetings from ZooAtlanta! by ucumari from flickr (CC-NC-ND)

Yay, another post about Empire Total War, plus some Rome and Medieval 2! In case you're wondering - I don't intend to even look at Napoleon Total War for let's say another year or two - that's because the first rule of Total War is:
Initial releases of all Total War games are bug-infested piles of shit. Patches fix most of that.
That is, the versions which reviewers fap over so hard are worst.

So you might wonder - why do I even bother playing then? Well, the thing is video game industry like all content producing industries is a oligopoly - there's a really small number of video games made, so the choice is between highly flawed ones and finding another hobby. Like one which might involve going outside more... Let's better not think about it too much. And as I said - patches fix most of the most atrocious problems.

I have no idea what were the main problems of 1.0 ETW. By the time ETW came out I was smart enough to not play it for a year or so; I've only heard all users universally complaining how bad it was. Which is highly believable considering how atrocious M2TW 1.0 was, and about half of these bugs were fixed in vanilla patches (and not even all in mods):
  • cavalry couldn't charge (pathfinding issues?)
  • pikemen preferred their crappy swords to pikes
  • soldiers with two-handed weapons would just stand around confused (attacks in M2TW were based on animation system, and they lacked sufficient animations; RTW just ignored animations so had no such problem)
  • having shields made units much worse at defending than not having shields (animation again?)
  • ballista/cannon towers didn't shoot what they were supposed to
  • during sieges you couldn't move your armies into many large empty places
  • treating civilians well gave you negative reputation
And these are just outright bugs, not minor issues like crappy AI, lack of balance, or far too much micromanagement...

Improvements


Anyway, let's focus on what was improved from (patched) M2TW to (patched) ETW. Easily the biggest improvement is huge reduction in micromanagement.
  • There are no diplomats/princesses at all. You can talk with anyone you want. RTW diplomats were at least useful for bribery, M2TW made it pretty much impossible.
  • Map is all discovered. Fog of war only affects enemy units.
  • Units move a lot faster. Especially on roads and by ships, difference between road and wilderness speed is much greater than in M2TW.
  • There are decent free garrisons for all cities, so you don't need to keep so many goddamn armies everywhere.
  • There is no agent recruitment, all agents spawn automatically.
  • There are no annoying random rebels spawning 3 units of Peasants somewhere where it wastes you 3 turns to move, win without a single soldier lost, and waste 3 turns to move back.  Rebellions are very rare, based on population happiness, and fairly high profile when they happen.
  • Of the agents left, merchants were replaced by trade ships which move very fast, and provide big money, working in stacks - far less micromanagement again.
  • Priests were replaced by missionaries, who are much fewer in numbers and more effective (at least in Americas).
  • Spies/Assassins were replaced by Rakes, which are of quite dubious use. M2TW spies were overpowered because they could open settlement gates; while assassins were outright useless. Rakes are just plain useless. You lose diplomatic point, and it costs your enemy almost nothing to repair sabotaged buildings or autorespawn assassinated agents. At least they move fast.
  • The last agent type - Gentlemen - is a pretty stupid idea. They mostly sit around in schools, passively adding research points. They can duel - which is completely useless due to autorespawning; and steal research - which I guess is marginally useful, but not sufficiently to warrant another agent type.
  • Per-settlement single tax replaced by per-theatre two tax rates plus per-settlement tax exemptions. Mathematically you have fewer choices now when you have at least 5 settlements per theatre, so it's about even... in practice it seems to be somewhat less work.
As a result you can realistically finish the campaign without having to waste far too much effort on campaign micro, and deciding it would be more fun to start over from zero like you did in RTW and M2TW. Now campaign mode is in no way perfect, but the improvement is so huge... they finally got their act together and fixed one of the biggest problems plaguing the series.

There are other improvements. If you include both faction differences and research level differences, there's pretty decent unit variety.

As bad as ever


Plenty of problems from earlier TW games still affect ETW. Campaign AI is still crap. I'm not sure if it improved at all - it keeps doing ridiculous things like attacking me first with half its units, then again same turn with the second half - because merging before attack is clearly too hard. It has absolutely no idea how to do a naval invasion - which sort of makes is unable to organize any attack larger than pirate raids now that oceans became so important.

Battle AI is even worse. The simplest, dumbest formation you can use is just form a lot of Line Infantry units in a long shallow line, facing enemy. And this seems to be able to enough to destroy almost any AI army twice its size with hardly any loses. Instead of flanking, or at least atacking en masse, AI insists on running to center of my line with 1-2 units at time, and not even spread out, so they get 200 of my guys shooting at their 10. To entirely crush AI I can fold my flanks into a horse-shoe - what wouldn't be possible if AI bothered to attack my flanks instead of storming the center.

A bunch of Line Infantry with one howitzer is enough to take any fort - you need to approach diagonally, as there's a zone where fort cannons cannot fire; and then a bit of howitzer fire is enough to make AI units leave the fort and attack you - and again 1-2 units at a time. Carcass shot is needed if your howitzer is to cause any kills, but vast majority of their soldiers are going to die running into your line infantry alone.

Battle pathfinding is as bad as ever. All places which seem empty and available are now at least empty and available - but it's very common for whole unit of Line Infantry to stand idle and wait for one guy trapped on some obstacle instead of fucking him and firing at the enemy.

Units also seem to ignore orders a lot. Not even complex orders - I've seen artillery keep firing after I explicitly told it to stop more than once. When they decide to fire, they often fire at something else than I ordered, or even right at my units for no obvious reason. Fire-at-will button is basically a license to ignore your targets (the same was true with M2TW).

And while units usually behave reasonably well on an open field, once they get into a fort fight they get so unresponsive than anything more complicated than a bayonet charge is probably not going to work. Fortunately AI is usually kind enough to loss 80% of its units while charging at my infantry line before I even get to the fort, so bayonet charge might as well finish the job.

Regressions


Unfortunately there are some ways ETW is significantly worse than RTW/M2TW. Naval battles for one. They were just a huge mistake, they're not fun, they don't add anything to game, fortunately you can still do the RTW/M2TW thing and click autoresolve.

Another problem is tile-less campaign map. Figuring out if unit can reach some place, or merging units gets a lot more finicky. Every time I want to do any non-trivial campaign maneuvering, I save the game - the chance is good something really stupid will happen. This is the only part of campaign mode which I would really rather see reversed.

Empire crashes to desktop a lot more often than RTW/M2TW. Even the patched version. I just had a campaign as United Provinces which ended with me having 39 regions, and the game reliably crashing every time I click end of turn, just after last enemy faction moves.  I loaded the savegame and bought the final province from Ottomans for an easy victory, but that really shouldn't be happening.

Another big problem is total lack of documentation. There's no in-game documentation, no paper (ha, Steam) or PDF tutorial, just absolutely nothing for plenty of game functionality. Do you know what are pros and cons of various government types? I've seen many mutually conflicting answers to that online.

And the worst problem of all - moddability really suffered. RTW kept everything in plain text files, so modding was quite easy even if they never really gave it much thought. M2TW moved files to packs, ETW makes it even harder... And unfortunately it's not just their laziness - they figured out that if they make modding harder, they can sell DLCs with extra units / campaigns etc. - things modders would release in buckets, much more fun and much higher quality - if only they had access to proper modding tools. And they still sort of can, but with more and more effort with each game, and I'm afraid Creative Assembly will eventually kill the modding community.

There are fewer battle maps now for some reason - it doesn't strike me as terribly much effort to make them, so why wouldn't they? Custom battles seem more limited - you cannot select technology levels etc. for different sides... in previous games you could have pretty much any battle in custom mode that was possible in campaign mode.


There's one more thing about campaign mode which is really puzzling, by which I mean retarded. When you get required number of provinces, let's say 40, by 1730 - you still have to wait until 1799 to officially "win" the campaign. So 2/3 of the game time spent doing absolutely nothing at all? I don't see how anybody could think it could be a good idea.

And as I said in previous post, user interface for battles got significantly less readable for some mysterious reason.

What next?


Now tasks for my readers: have any of my complaints been addressed by either Napoleon Total War or mods? Some seem fundamental, but others seem fairly trivial so they might have been fixed already, right?

Saturday, February 27, 2010

Wikipedia bias in video game articles

Cat and Wii by plynoi from flickr (CC-NC)

In spite of all claims to neutrality, Wikipedia can be ridiculously biased at times - it just outsources its biases to some external authority.

Wikiality


Here's Wikipedia article about Empire Total War - but you can look at any video game review. Here's an excerpt:
Empire: Total War received acclaim from reviewers upon release; several critics commended it as one of the foremost strategy titles of recent times. Praise was bestowed upon the extensive strategy breadth, accurate historical challenges and visual effects. The real-time land battles, with a far greater focus on gunpowder weaponry than earlier Total War titles, were thought to be successfully implemented.

Here's another:
 
And entire Reception section is one big praise-fest, just look at it yourself.

Reality


In reality Empire is a bug-infested game with crappy AI, "historical accuracy" is sacrificed to gameplay or general coolness without giving it a second thought, and neither users nor even authors received in particularly well. Some but not all problems were fixed with patches - but reviews were based on buggiest pre-releases or very early versions, so they must have noticed the bugs - just failed to mentioned them.

Here's Metacritic users:



Here's Amazon:



Here's one of the developrs Mike Simpson (about pre-1.5 patch version):
I had 6 copies of Empire: Total War sat on my shelf intended for close gamer friends that I didn’t send out because I was too embarrassed about the flaws.

How did it go so wrong?


Users and even the developers were highly disappointed by the game, and outright hated first versions. About the only group of people who absolutely loved it were game reviewers.


But game reviewers are not independent! They're publishers' outsourced PR department! Any review outlet which is overly critical of publisher's dearest games will lose access to pre-release games - and more importantly advertisement money. If your job depends on not being able to see flaws in games...

What annoys me is not so much reviewers - everyone knows they're corrupt spineless wankers - it's how Wikipedia instead of making neutral reviews based on users' opinions outsources its bias to reviewers. Here's a diagram of bias flow:
Publishers → Reviewers → Wikipedia

There's as little place for these unofficial PR departments in Wikipedia as there is for publishers' official PR departments. Unlike users who don't have any conflict of interest, there's nothing remotely independent or unbiased about professional game reviewers. This is to some extent true for all kinds of reviewers, but in game reviews situation is far more pathological than with movies or books or almost any other kind of reviews I can think of.

Wikipedia failed its mission hard. Outsourced bias is still bias. How come it can write about abortion without much less bias than about video games?

Saturday, February 20, 2010

A more honest review of Empire: Total War

Combat Laila by mize2oo5 from flickr (CC-NC-ND)

As we all know professional game reviewers spend most of their time fellating big publishers - and if one isn't good enough they lose all access to pre-releases and have to find a real job. So imagine my shock when the "universally acclaimed" game like Empire: Total War didn't live up to the fella... I mean critical acclaim.


By the way, this spinelessness only affects game reviewers - movie reviewers seem to be fairly honest, even if they're highly opinionated pricks. I guess it's mostly because it's so difficult to control access to movies - you can write your review 2 hours after theatrical premiere (or scene premiere, which often happens a couple of weeks earlier) even if the distributors hate you and want you to die.

But it is somewhat disappointing - as previous two games in the series were actually good, especially after a mod or two.



What's good about Empire: Total War


I will let my hate out in due time. Let's concentrate on the good bits.

Micromanagement which plagued Medieval 2 Total War and turned it into Eve Online once your empire reached 20 or so settlements (at least in vanilla, there's a mod for that) is trimmed to more reasonable levels.

Diplomacy works from diplomacy screen, there's no need for diplomats and princesses... It was particularly bad part of M2TW - in Rome diplomats were very powerful as they could bribe units and settlements - there was never any point in engaging in actual "diplomacy" due to bugs like this one, still unfixed at time of writing. Medieval made bribing nearly impossible, and added extra type of diplomat - Princess - with even more useless options.

Then there were priests of all kinds, heretics, witches (I never had a witch do anything other than fool around), inquisitors (supposedly trying to burn your agents on stakes, but they always had very low levels and I don't remember them succeeding even once) - what it really was was infuriating micromanagement.

And then there were spies - useful agent type for a change; assassins - ridiculously useless as the only enemy agents worth killing were the ones particularly difficult to kill; and merchants - somewhat profitable if you loved micromanagement or play Moors and use the fort merchant stack cheat.

Empire gets rid of all that nonsense, leaving just Gentleman, Rake (Spy), and Missionary. And you can actually see where cities are on the map, and who owns what. This part of the game has been improved - but when you think about it "oh look, we removed a lot of annoying shit we put in previous games" is not exactly such a great achievement.


You get nice explanations why units on the battlefield feel better or worse - I vaguely recall them being there in Rome and not any more in Medieval... And why different powers feel what they feel about you - not that it matters that terribly much, they'll eventually all attack you anyway.

I'm ambiguous about the new system of buildings, social classes, town wealth, trade goods and all that. I'm not terribly enthusiastic about it, as I got used to Rome/Medieval system, but then it doesn't strike me as particularly bad - just different.

What's bad about Empire: Total War


Enough with the praise. Let's get to the parts that suck hard. Do you remember M2TW and its gunpowder units? Artillery was somewhat useful for sieges - I remember my Citadel with Cannot Towers and relatively weak garrison destroying 3 full Mongol stacks invading all together; and even simplest bombard or catapult could make a lot of holes in most city walls unless defenders had their own artillery (or balls to charge knights into your artillery, which AI has never quite developed).

And in a field battle it would shoot itself out of ammo without hitting stationary enemy once. You know how to detect a n00b in M2TW multiplayer? Start a no-rules game (normally artillery is banned). If they buy any artillery - they're a total n00b and they will suffer.

And that was perfect. Medieval artillery was a siege toy. The first effective use of artillery in the field was by Jan Žižka's Hussite armies in 1419 - and these were wagon forts - imagine a group of medieval battle tanks - not cannons standing in the field and waiting to be run over knights.

Amongst their weaponry were such diverse elements as: fear, surprise, ruthless efficiency, an almost fanatical devotion to the cause of Utraquism... I mean pikes and crossbows. Widespread use of field artillery had to wait until 17th century.


It gets worse. Remember how firearm-wielding infantry in Medieval 2 Total War was good at maybe scaring off elephants and Indians (not that you ever got to elephants or Indians, by that time the campaign was almost over), and Pavise Crossbowmen could absolutely massacre any firearm units? That even if they got to shot anything, if anyone as much as looked funnily at them, musketeers and arquebusiers of M2TW would get all confused spent the rest of the battle changing and rechanging formation.

So how awesome would be the idea of taking two most broken unit types from Medieval 2 Total War - artillery, and firearm infantry - and basing an entire game around them? About that awesome.

They are still broken. Artillery is completely useless for hitting anything smaller than fort walls, while missile infantry confusingly runs around trying to form nice lines instead of actually shooting anyone.

To balance it out they decided to nerf cavalry. Now cavalry in Rome and M2TW was ridiculously overpowered. And you know what? That's historically accurate (except it should historically be way more expensive than infantry, but wasn't).

It's a myth that coming of gunpowder brought end of knightly heavy cavalry. That's what began it - only once infantry gots crossbows and firearms knight started wearing full plate armor! And the greatest cavalry charge in history - and the reason women without burqas are on the street - was Polish hussar charge of 1683 breaking Turkish siege of Vienna.

Early 1600s hussars - almost time of the Empire Total War - routinely massacred professional armies ten time their size. Here's an example. Here's another. How about this?

Yes, not every cavalry unit was that great, and a century of progress in firearms does its thing. But Empire Total War cavalry got so ridiculously nerfed that the only reason it's useful at all is all other units being so bad! Pretty much their only functions would be killing off routing units and destroying artillery - as if all that crappy artillery was worth the bother.

User Interface


I'm not over. I hate what they did to the user interface. All units look the same. Now I know this is more historically accurate - but I cannot see anything on a battlefield. They don't even bother properly highlighting unit flag or card as they did in previous games. Radar is horrible - displaying vague blobs instead of locations of units... you cannot cycle through units with Tab - you have to select them manually one by one, try to figure out which one got selected as highlighting is horrible - and give orders which it will then ignore running around looking confused.

I almost feel as if all my input was limited to setting up initial deployment before battle starts, and then chasing routing enemy units with my cavalry. Bad user interface and bad unit AI synergistically work together to create a really horrible user experience.

There are naval battles - which is a massive ridiculous waste of effort as in no Total War game ever navies had any significant use. Oh sorry, in M2TW other countries with which I had friendly relations or even an alliance, and with which I had no common border would sometimes get a mission to blockade my ports, which they would do starting the most pointless war imaginable.


And just like with land battles, once it gets past 2 or 3 ships per side it turns into a massive clusterfuck of confusing interface and AI ignoring your commands. Someone even made a Hitler Downfall video about it - it's that bad.


What shocks me is how easy would it be to fix the UI - give units distinct looks, make highlighting better etc... If you have any mod recommendations, please tell me.


But then, why should I act surprised if half the people buy game based on bribed reviews and initial shininess, and the other half would pirate it anyway, so why should they bother finishing it before release?

tl;dr version: Would be good if they bothered finishing it instead of rushing the release - even more so than previous Total War games; also professional game reviewers suck publishers' cocks.

Friday, February 12, 2010

Game theory, video game piracy, and market failure

AAAAR2D2 by Kaptain Kobold from flickr (CC-NC-SA)

Most games are shit - this is a true fact with which there will be no arguing. And while we cannot really expect every game to be Portal level of quality, it is quite puzzling why average quality is so dismal. It's surely no lack of money - in spite of game piracy being so easy, people pay tens of billions of dollars for video games.



That's a very interesting slideshow  describing gaming industry. A first good hint of what's wrong with gaming can be seen from this costs breakdown:



So publishers, retailers, marketing, console vendors, and other parasites take almost all money, and just 16% of what customer pays goes into development cost. Why is it so?

Name recognition


The core of the problem is games being what economists call "experience goods". No, it doesn't mean games are "experienced" - what is means is that customers have no reliable way of telling if the game is any good before playing it (and paying for it). So what can customers do instead? Rely on any signals which correlate at all with quality - like being sequels to known good games, or being based on something well known from outside gaming. Let's leave games for a moment, do you know what the 50 highest grossing movies ever were (inflation etc. aside for now, it doesn't change that much)? Original content in bold (by with I mean content without major name recognition, I know Forest Gump was based on a book; Avatar on Pocahontas; and Titanic - well, on a Titanic - but in such cases name recognition didn't play a major role).
  1. Avatar
  2. Titanic
  3. The Lord of the Rings: The Return of the King
  4. Pirates of the Caribbean: Dead Man's Chest
  5. The Dark Knight
  6. Harry Potter and the Philosopher's Stone
  7. Pirates of the Caribbean: At World's End
  8. Harry Potter and the Order of the Phoenix
  9. Harry Potter and the Half-Blood Prince
  10. The Lord of the Rings: The Two Towers
  11. Star Wars Episode I: The Phantom Menace
  12. Shrek 2
  13. Jurassic Park
  14. Harry Potter and the Goblet of Fire
  15. Spider-Man 3
  16. Ice Age: Dawn of the Dinosaurs
  17. Harry Potter and the Chamber of Secrets
  18. The Lord of the Rings: The Fellowship of the Ring
  19. Finding Nemo
  20. Star Wars Episode III: Revenge of the Sith
  21. Transformers: Revenge of the Fallen
  22. Spider-Man
  23. Independence Day
  24. Shrek the Third
  25. Harry Potter and the Prisoner of Azkaban
  26. E.T. the Extra-Terrestrial
  27. Indiana Jones and the Kingdom of the Crystal Skull
  28. The Lion King
  29. Spider-Man 2
  30. Star Wars Episode IV: A New Hope
  31. 2012
  32. The Da Vinci Code
  33. The Chronicles of Narnia: The Lion, the Witch and the Wardrobe
  34. The Matrix Reloaded
  35. Up
  36. Transformers
  37. The Twilight Saga: New Moon
  38. Forrest Gump
  39. The Sixth Sense
  40. Ice Age: The Meltdown
  41. Pirates of the Caribbean: The Curse of the Black Pearl
  42. Star Wars Episode II: Attack of the Clones
  43. Kung Fu Panda
  44. The Incredibles
  45. Hancock
  46. Ratatouille
  47. The Lost World: Jurassic Park
  48. The Passion of the Christ
  49. Mamma Mia!
  50. Madagascar: Escape 2 Africa


So 34 out of top 50 (68%), or 16 out of top 20 (80%) are not original content. And most of the best movies ever are not on the list. And if you think about it, what Pixar (Finding Nemo, Up, Ratatouille, The Incredibles), Dreamworks (Kung Fu Panda and all the Shreks), and Disney (The Lion King) are doing is not as much original content standing on its own as a series of good but fairly formulaic animations - Pixar could as well call Ratatouille "Pixar 8: Ratatouille" and people would come for name recognition (have you ever seen a Pixar movie in which the protagonist was not an adolescent male?), and Dreamworks, well...




Yes, most movies on the list are pretty good, but that's not even strictly necessary - look at #11 for evolution's sake! And most often sequels which are demonstrably worse than originals earn more money anyway, and it's not just due to inflation. Just looking at the list - Matrix, Star Wars, Madagascar, Shrek, Pirates of the Caribbean all went downhill in quality and skywards in revenue.

I don't know how to easily measure relative contributions of genuine quality (well, I could perhaps rank-correlate imdb scores with some Bayesian filtering for rating uncertainty, maybe some other time...) and name recognition - but the latter factor is just huge.

You thought movies are bad?

That's how bad situation with movies is, and movies are the easiest case. Yes, you only know if a movie is good or not after you see it - but movies are all the same format (not counting 3D), similar length, usually in a small number of easily classifiable genres - so it's not that hard. Within a single genre you can "almost objectively" say that The Dark Knight was better than Spider-Man 2, or something like that.


Yes, there will be individual differences, but it's a simple problem of low dimensionality - completely non-personalized imdb score is a pretty good predictor of how much you'll like a movie. Add or subtract a few points depending on what genre you like, and other trivial criteria, and it gets eerily accurate. And if that's not enough Netflix Prize shows that if you rank just a handful of movies, it will be enough to predict if you like any movie ever made very very accurately.

How about books?


So movies are solved, at least in theory. How about books? It seems that the bestsellers are the Bible, and list of quotations by Chairman Mao. Followed by more religious, books, more Communist propaganda, a dictionary of Chinese... All right, that list makes no sense whatsoever, let's forget about it. And we all know people buy books mostly based on series and author name recognition, J. K. Rowling and Stephanie Meyer can both tell you that.


But even though books with books, Amazon can be quite decent in its recommendations. Unfortunately its algorithm seems to work only with books. Here what it does with movies (recommendations for New Hope):


And with games (recommendations for Medieval 2 Total War):
How useless is that?

Back to video games

Game theory time. What are the choices game developer and publishers face?
  • Make genuinely good games - expensive, risky, if not flashy enough customers often won't even know these games exist
  • Make games that make good first impression - often due to name recognition, and are really shitty once you get to play them for more than 15 minutes - cheap, easy, makes shitloads of money
Which one would gamers prefer to happen? Which one will actually happen? That's my point. Until we find a way to reliably tell which games are good before paying for them - most games will be flashy shit.

As I'm blogging about games sucking let me give you an example of particularly egregious abuse. First "Far Cry 2". It is just like Far Cry except it's developed by another company, has different genre, entirely unrelated world, not a single character or plot element in common, and basically there's nothing - absolutely nothing - linking Far Cry and Far Cry 2.








You know what it is? That's criminal fraud. Publishers of Far Cry 2 should be prosecuted for fraud. Calling their game something it is not to deceive customers is exactly that. It's also widely accepted marketing practice, as if that made it any less criminal. The point of trademarks should be protecting customers from deception, not making trademark owners shitloads of money as it is now - and it was once like that - a century ago Coca-Cola was once sued by American government because it changed its formula to no longer contain extracts of coca leaves or kola nuts. That was before corporate interests took over all our governments. Now trademarks no longer serve customers - they serve corporations exclusively.

So how can a gamer find out if a game is any good or not? First, the problem is extremely difficult compared to one with movies. Games offer very wide variety of different experiences and it's really difficult to compare different games. Someone might like mercenary-shooting missions in the original Far Cry, but hate Trigen missions with passion. By someone I mean virtually every single games - but if different parts of the same can evoke such reactions, how can you give such game a single score?

Or even worse, people might absolutely love the game, except for a huge number of severe bugs which make it virtually unplayable. Like every single Total War game ever released. You know, it's been 3 years and they still haven't fixed those few semicolons in Medieval 2 Total War which completely break diplomacy system.

You rarely have such varied reactions to a single movie (shitty ending appended to the Shindler's List for no reason notwithstanding). Maybe with so-bad-it's good genre, but it's an entirely different matter.



Example of a movie 10.6% consider so-bad-it's-good, most people think it's plain bad

So how can you find out if a game is good or not? Clearly you cannot rely on Amazon, and game reviewers are some of the most incompetent and corrupt group of journalist ever. I wonder why Fox News didn't start a game review channel - they would all feel just at home there. Not that it's much different from other journalist who need pre-release access to products provided by publishers to stay in business. Publishers have them by the balls.

Once upon a time there was a tradition of game demos and "shareware" - you could give a game a try, and if you liked it you could purchase full version. This tradition almost died, partially because most genres don't really work well in demo format, and partially because it's so easy to get full version to try.

So as a gamer you have the following three options to get 1 good game:
  1. Pay for games that make good first impression, most of which will be shit. You pay for 1 good game and 9 shitty games.
  2. Bittorrent games without paying, test which ones you like, then buy games you like. You pay for 1 good game and delete 9 shitty games after quick testing.
  3. Bittorrent games without paying, never pay.
Now in the perfect world everyone would follow #2 option - publishers would earn money for good games, and would earn nothing on shitty games like Far Cry 2. There's just one problem here - once you've found your game, you really have no interest in paying for it. Whatever little stigma or risk is attached to piracy, it is the same in both option #2 and option #3. And publishers try hard (and fail hard) to make #3 difficult, and to extent they're successful make #2 equally difficult in process.



As the result almost everyone does #1 or #3. #1 creates incentive for production of shitty games. #3 creates no incentive whatsoever - and so games stay shitty, gamers stay unhappy, and everyone blames piracy.

Getting rid of piracy would not solve the problem at all - just look at Playstation 3. Everyone would have to do #1 - pay loads of money for shitty games, resulting in high prices, and shitty games. Nobody would be happy.

The only way #2 could happen in the short term would be some sort of honor system - but it's hard to create a honor system if most publishers are assholes who treat gamers like shit (starting from unskippable ads every time you start a game and obnoxious DRMs), developers get only 16% of what customers pay, and people who do #2 are treated just as those who don't pay for anything. Not to mention option #2 being technically illegal. Honor systems can be extremely powerful, but they just won't happen in an environment like that.

What else could happen? Well, someone might figure out ways of figuring out if game is any good other than bittorrenting it. Remember - once incentive for creating shitty games disappears piracy won't be necessary. That doesn't sound terribly likely due to difficulty of the problem. And even if such system existed, it would have to be used by most gamer, and it would have to be difficult to abuse by publishers. Remember - we already have systems which can tell you if you'll like a movie or not with very high accuracy - and yet most people don't use them, going for name recognition instead - resulting in endless stream of shitty sequels.

Or we could use something like flattr. You'd pay some sum every month for playing any video games you want - and after end of the month your money would be distributed to developers of games you played most (or marked as ones you liked most). This would be almost as good as option #2 above, and probably the most realistic way to solve it for good. Of course publishers won't go for it easily, as they'd lose control over market, all the powers going to developers and gamers.

Until that happens, long live Pirate Bay!