Monday 10 September 2012

Amnesia - Two Years Later

Introduction
It has now passed a little more than two years since we launched Amnesia and one year since the last report, so time for another! One would think that there is perhaps not much to be said this long after release, especially for a single player game with no built-in social features. But the fact is that Amnesia is still going very strong and 2012 will probably be the best financial year here at Frictional Games, which we would never had expected two years ago.

Sales
As always, let's start with the sales and some numbers. The first thing will be to figure out how many units we have sold in total, which is actually really hard to pin down. The biggest reasons for the uncertainty is that Amnesia was part of the Humble Indie Bundle (HIB) earlier this year and Potato Bundle last year. Both of these account for quite a lot of sales. Without counting the units bought there our total lands at 710 000 units. Adding all HIB and Potato Sack sales gets us to 1 360 000 units in total, which can be called the optimistic figure. This means that, optimistically speaking, Amnesia has sold almost 1.4 million units! This reasoning is not strictly speaking invalid, but I think that one should not really count anyone that bought the bundle and already owned Amnesia as a proper unit. A slightly pessimistic guess (not far from reality I think) is that 2/3 of every bundle and pack buyer already owned Amnesia. This gives us about 920 000 units in total, pessimistically speaking. So saying that we have sold a million units seems fair. Wait... a million units! Oh shit!!

Despite that huge number of sales, what I think is more interesting is how good the monthly sales still are. Not counting any discounts, the monthly full price sales lie at over 10 000 units. This means that less then every 5th minute someone in the world is buying a copy of Amnesia. This is totally insane to me. The figures themselves are far beyond any guesses we would have made two years ago. It is also insane, because this number is actually higher than it was around three months after initial launch. That a game can still be going this good two years after is truly remarkable.  This success is due to many factors, some of which are the uniqueness of the game (horror games without combat do not really exist on PC), the large modding community (more on this later) and the steady flood of YouTube clips (which is in turn is fueled by the modding community output).

Also worth noting that our Penumbra games are still going on at the same rate that they always have. They are still selling about the same numbers (a little more actually) as they did three years ago. This totals to about 900 units per month. Taking all sales together is more than enough to support the company, financing A Machine For Pigs (more on that later) and having some left over. This means that we are in a very good position and aim to use it to take more risk and try out new things (more on this later).

I think we have never disclosed how much we Amnesia cost to make, so might as well do that here. The (exactly) three years of development cost a total of 360 000 US Dollars. It has since earned more than ten times that. Take that investors we talked to in 2009!

Piracy
It has been over a year since we even thought about piracy. With sales as good as above we cannot really see this as an issue worth more than two lines in this post, so screw it.

Modding
I mentioned it a bit in last years summary, but feel it was not given enough focus. When we created the possibility of custom stories, it was something we thought of very late and I think Luis implemented it in less than a day. We put a few days on adding documentation our wiki as well, but all in all, it was a tiny effort compared to the rest of the game. Despite that, this aspect as been immensely important for the game and while it is hard to give any exact features in terms of sales, the influence on our community is easily seen. Before modding started, we had one or two daily post on our message boards. But as the modding community has grown, it is now up in over 40! (Remember this on the boards of a 2 year old a single player game.) There is even a long meme thread regarding the custom story community. What is interesting is that there are even internal expressions used, like "poofer", that we at Frictional did not know about and that was specific to Amnesia modding.

The output of modding community has been quite big as well. Amnesia is as of writing the 2nd most popular game at ModDB and sports 176 finished mods. Not only do this amount of user content lengthen the life of the game, it has also increased the amount of YouTube movies made with an Amnesia theme. There are lots of popular Let's Play channels that have devoted quite a bit of time with just playing various user-made custom stories. As mentioned earlier this have probably played a large role in keeping our monthly sales up.

It is quite clear that allowing users to create content is a feature worth putting time into. I also think that we managed to have a pretty good balance between having simple tools and still allowing a lot of possibilities. It is far from perfect though and for our new engine (which AMFP is not using) will have lots of improvements. It will still be possible to use the simple scripting as before, but now you can pretty much remake whatever you like and do not have to use a complicated total conversion to do so.

Future
The next big thing for us will be the release of Amnesia: A Machine For Pigs, which is a follow-up developed by thechineseroom and produced by us. This release will be very interesting in many ways. First of all it is a big experiment for us to do this sort of collaboration, so from the start we had no idea how it would turn out. Judging from the latest build we have nothing to worry about though, and so far it looks great. Another interesting aspect is how well it will sell compared to the initial Amnesia launch. Not only is the market a lot bigger now than two years ago, Amnesia is more known. The result will be very important to how we plan our future. Release for AMFP is expected early 2013.

At Frictional Games our main concern is our new super secret project. We do not want to say much about this project yet,but we can disclose that it will be horror and that it will be first person. One of the things I was most disappointed with in Amnesia was that it never really managed to deliver any deeper themes, but was more like a shallow fright-fest. For the new project we want to change that and really try and bring a certain theme to the front. Our hope is that this will create a very special experience, creating horror in a much more disturbing way. For the curious, some information on the path we are taking can be found in this paper. The game's current status is that we have pretty much all tech working, and have started to playtest the first parts. Still, a lot is up in the air and the current design is bound to change. While we do not want the project to go on forever, we want to use our good financial situation the best we can and make sure we do not just rush something out (which we did with Amnesia actually). Release will probably be some time in 2014.

Frictional Games have also grown over the last year and we now employ 11 people, which feels very close to the maximum. At least the way we run the company right now. We also do not want to lose the small underdog spirit that has fueled us in the past. When you have such financially different situation compared to when you started I think it is easy to get caught up in expansion, wild ideas and basically do not get much done. So, we do our best to keep our feet firmly on the ground, to be strict on deadlines and to always remember our humble pasts. At the same time we will not take any easy solutions and play it safe. After the successes we have had, I think it is our responsibility to use our money and independence the best way possible.


Friday 7 September 2012

Tech Feature: HDR Lighting


Introduction

Hello my name is Peter and I’m the new graphics and engine programmer. New is not really the correct word since I have been working at Frictional for a year now. During this time I have updated the engine and added a lot of new graphic features. This will be the first of my blog posts descripting the changes that have been made.


HDR


One of the biggest changes to the the new engine is the introduction of HDR (High Dynamic Range) Lighting. This is a technique to increase the detail of the lighting system. The benefit of using HDR is that bright things can be really bright, dark things can be really dark, and details can be seen in both.

In nature there is no limit to how bright something can be. The difference between a 60 W light bulb and sunshine hitting the earth is around 10 000 luminance (cd/m^2). This means that we need a way to store high intensity values while keeping the quality and precision of the dark areas. Thankfully there already exists a method for storing such values - by using floating point numbers.

We use a 16-bit fp RGBA buffer to store our lighting. This gives us enough of a dynamic range without taking up too much memory.


Tone mapping

A normal computer monitor can display 8-bit colors between the value of [0..1]. Because of this the monitor can not display a 16-bit HDR image directly. To be displayed the image will have to be converted to 8-bit while keeping as much of the details as possible.

Tone mapping is the process of converting an image of dynamic range to one with a clamped range between [0..1].

The simplest method for doing this is to use the Reinhard tone mapping algorithm.

vec3 color = x / (x + 1.0)

No matter how high x gets the final value will always stay between [0..1]. The problem with Reinhard is that it desaturates your dark colors and removes contrast. In the brighter parts of the image Reinhard produces great result with its soft highlights.

What you want to have is an algorithm that preserves the saturation of the color in the dark areas and that keeps as much of the contrast as possible.

I ended up choosing an algorithm created by John Hable for Uncharted 2.

vec3 Uncharted2Tonemap(vec3 x)
{
float A = 0.15;
float B = 0.50;
float C = 0.10;
float D = 0.20;
float E = 0.02;
float F = 0.30;

return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;
}
Left: Long curve, Right: S-curve near dark values



This algorithm is based on a filmic tone mapping algorithm created by Kodak. It keeps the nice highlights from Reinhard while using a slightly S-shaped curve too keep the dark colors saturated.



Exposure

If you have been sitting in a dark room for some time and walk out into the sun, your eyes will not be ready for the bright light and you will have to squint. After a while your eyes will have adjusted to the light and it will not bother you anymore.

Exposure is a way to control the intensity of light that gets passed through the lens. In the eye this is controlled by the size of the pupil and in a camera it is done by selecting for how long the sensor should be active.

There are a few different ways to control exposure in a game. It can be controlled automatically by storing the average luminance over a few frames and calculating a exposure from that value.
We choose to go with a much simpler method that lets the artists control the exposure by dividing the level into areas that have different exposures. So in a dark area the exposure can be increased and in an outdoor area the exposure can be decreased.

vec3 color = Uncharted2Tonemap(scene_color * exposure)


White Point

A white point is used to increase the contrast of the image. This is the value that is selected to be the brightest any pixel can be. Pixels brighter than the white point will be clamped to 1.0.

vec3 color = Uncharted2Tonemap(scene_color * exposure) / Uncharted2Tonemap(white_point)

HDR Bloom

When a pixel is brighter than the white point it can be used to generate an additional post effect called HDR Bloom. Pixels that get too bright should start bleeding over to other nearby pixels, producing a halo around them. It is a subtle effect that adds realism to the image.

To solve this I use a few render passes. First a bright pass is applied to the image which removes all pixels that are below the white point and scales down all the pixels that are above it. The result is then blurred to create the halos. The blurred image is then added to the original image. The HDR Bloom effect must be performed before the tone mapping.


Final Thoughts

I would say that HDRL and filmic tone mapping is the most important part of any rendering pipeline. It greatly increases the quality of lighting and will make your game look much more realistic.

But HDR and tone mapping is all for nothing if your calculations are not done in linear color space. My next tech feature will focus on gamma correction and the linear color space.

References