Friday, December 31, 2010

Most popular posts of 2010

I did this in 2007, 2008 and 2009 so it is time once again to trawl through this blog's statistics and see what posts appeared to attract the most attention (in terms of hits) in 2010. They are:
  1. The iPad and Children
  2. Pick of the litter
  3. Don't touch that cheese
  4. Sleeping games in the car
  5. Lose The Game [Update: it didn't happen]
  6. What to do about all this hair? [Update: it has now been straightened; everyone very happy]
  7. NPR's Planet Money Podcast
  8. Back to School iPad/iPhone Apps
  9. Valentine's Day, seriously
  10. Where economics and psychology meet
In addition, these posts from past years still had enough hits to out do those above (just counting their hits in 2010 alone):

Wednesday, December 22, 2010

Shop for a cause

I know it is a late little late (although post holiday sales are coming) but I recently became aware that many charities have arrangements with Amazon.com that if you buy following going through a link on their page, Amazon gives the charity 6% of their revenue from resulting purchases to that charity. Why wouldn't you want to take advantage of this? [Update: it turns out it is 6% of your first purchase only after clicking.]

So let me give you a good example. When we were looking for a place to rent in Boston, we came across a family whose 12 year old (Steve Glidden) had perished in a bus accident on a school trip to Canada almost 10 years ago. You can read more here. The stories there remind me of everything that is hard and beautiful about parenting at the same time. More to the point, if you click here it will take you to Amazon and resulting purchases will count towards contributions to the charity set up as a consequence of all this.

Finally, the boy's sister -- now an adult -- has written a book that she dedicates to her brother. The book, How to Understand Israel in 60 Days or Less, is a graphic novel and was named by Entertainment Weekly as one of the top 10 non-fiction books for 2010. It is worth a look.

Friday, December 17, 2010

The technology of punishment

As a parent, I am often looking of new and innovative ways to punish my children for 'bad' behaviour or other forms of noncompliance with my wishes. Restricting television has been a favourite but often an issue since we restricted that just for the apparent fun of it -- it didn't build up enough punishment capital.

This new report from the University of Southern California notes that the trend is away from 'no TV' and towards 'no Internet' as the punishment of the times.
Researchers at the Center report parents are now limiting their children’s Internet access and television use in nearly identical ways. Three in five American households restrict television use as a punishment, a figure that’s hardly budged over the past decade. Restricting children’s Internet use as a form of punishment has steadily increased over the years and is now a practice in 57 percent of the nation’s homes with children under 18.
Easier said than done. The problem is that the Internet can get used for homework and also for communication. On both of those scores, the punishment may well hurt me more than it would hurt them. Not that it excludes it from being a punishment but my kids will see right through my potential lack of credibility in threatening and keeping to it.

Friday, December 10, 2010

Player - Avatar Symbiosis

In a recently released paper, Jeroen D. Stout (creator of Dinner Date) proposes an interesting theory on the relashionship between player and avatar. It is related to the things that have been discussed previous post about immersion, so I felt it was relevant to bring it up. The full paper can be gotten from here. I will summarize the ideas a bit below, but I still suggest all to read the actual paper for more info!

Most modern theorists of the mind agree that it is not single thing, but a collection of processes working in unison. What this means is that there is no exact place where everything comes together, but instead the interaction between many sub-systems give rise to what we call consciousness. The most clear evidence of this is in split brain patients, where the two brain-halves pretty much form two different personalities when unable to communicate.

This image of a self is a not fixed thing though and it is possible to change. When using a tool for a while it often begins to feel like an extension of ourself, thus changing ones body image. We go from being "just me" to be being "me with hammer". When the hammer is put down, we return to the old previous body image of just being "me". I have described an even clearer example of this in a previous post, where a subject perceives a sense of touch as located at a rubber hand. Research have shown that this sort of connection can get quite strong. If one threatens to drop a heavy weight or similar on the artificial body part (eg the rubber hand), then the body reacts just like it would to any actual body part.

What this means for games is that it is theoretically possible for the player form a very strong bond with the avatar, and in a sense become the avatar. I discuss something similar in this blog post. What Jeroen now purposes is that one can go one step further and make the avatar autonomously behave in a way that the players will interpret has their own will. This is what he calls symbiosis. Instead of just extending the body-image, it is the extension of the mind. Quite literally, a high level of symbiosis means that part of your mind will reside in the avatar.

A simple example would be that if player pushes a button, making the avatar jump, players feel as if they did the jumping themselves. I believe that this sort of symbiosis already happens in some games, especially noticeable when the avatar does not directly jump but has some kind of animation first. When the player-avatar symbiosis is strong this sort of animation does not feel like some kind of cut scene, but as a willed action. Symbiosis does not have to be just about simple actions like jumping though, but can be more complex actions, eg. assembling something, and actions that are not even initiated by the player, eg. picking up an object as the player pass by it. If symbiosis is strong then the player should feel that "I did that" and not "the avatar did that" in the previous examples. The big question is now how far we can go with this, and Jeroen suggests some directions on how to research this further.

Having more knowledge on symbiosis would be very useful to make the player feel immersed in games. It can also help solving the problem of inaccurate input. Instead of doing it the Trespasser way and add fine-control for every needed body joint, focus can lie on increasing the symbiosis and thus allowing simply (or even no!) input be seen by players as their own actions. This would make players feel as part of a virtual world without resorting to full-body exo-skeletons or similar for input. Another interesting aspect of exploring this further is that it can perhaps tell us something about our own mind. Using games to dig deeper into subjects like free will and consciousness is something I feel is incredibly exciting.

Sunday, December 5, 2010

The true meaning of Hanukkah

Christmas is a big deal. So big its gravitational pull has raised the significance of other religious holidays in its wake. There is no clearer example than Hanukkah. It is a Jewish substitute for Christmas but not in substance but in the trappings. And here I am talking about presents for children. 

Indeed, that is our clue that this is a holiday of pandering; unlike Christmas where everyone you know gives and receives a gift, for Hanukkah, it is just for children; the obvious theory being that Jewish people are worried that they will lose the kids early on unless Hanukkah is given the considerable star power of Christmas. For a parent, there is also the obvious incentive power of the threat value of withdrawing the event should behaviour be bad. That said, there is no Santa keeping tabs on good and bad behavior but innovative Jews can use Yom Kippur to good effect there. 

My parents didn't try to resolve this. When I look back this is surprising but, when my brother and I were very young, they gave us both Hanukkah and Christmas presents. I really have no idea why. But I do remember it and I also remember being quite miffed the year the dates for the two holidays coincided. 

For our children we vowed to avoid it all. No significant Hanukkah presents and certainly no Christmas. They would essentially get nothing. 

Our kids have accepted this and understand the rationale. But that doesn't stop them exploiting their predicament in public. When we visit stores or something else and someone asks them what they are hoping to get this year they put on a resigned face explaining they are Jewish and so will get nothing. That prompts a look in our direction and I guess this is precisely what my parents wanted to avoid. Anyhow from my kids it is all an act. They do fine at other times of the year. 

But we do the candles but not religiously. Many nights we forget. I've explained to the kids that for our family we celebrate only on prime number nights. That turns out to be about right. 

These issues must be challenging for families where one parent grew up with Christmas and the other with Hanukkah. Family pressures will be enough to cause them to double up. Not only that but there are hard issues in maintaining traditions: more so for the non-Jewish parent. 

As an example of this a friend, who is such non-Jewish parent, recounted her first experience trying to maintain Hanukkah while her husband was out of town. She researched what was involved on the Internet and carefully set up the candles for lighting. But Hanukkiahs can be tricky. The candles can be hard to put in especially since one of them is lit and used to light the others. Accidents can happen quite easily if you haven't engaged in some supervised practice. 

So you want to ensure things can be contained. What you don't want to do is to put something that can easily catch fire near the festivities. Certainly putting down a paper towel to catch wax might be regarded as a no go. Of course, this is precisely where she went and herself and her 3 and 2 year old sons were treated to more than the twinkling of a few lights as the entire table was engulfed in flames. A rookies' mistake to be sure. 

It was easily extinguished but it had an impact on the children. Her 3 year old ran off to another room, seemingly in terror, but instead on a mission. He came back appropriately dressed as a fireman; ready to assist in some frantic firefighting. Of course, that experience became a family memory from that night on and for years afterwards as her son insisted on being dressed a fireman prior to the lighting of the candles. He was just being prepared. A laudable trait. That meant, however, that there was no covering up the incident from other adults in the future. There is simply no other way to explain why your child has to engage in visible fire prevention measures on the holidays. 

When you think about there is an important sense in which this family has captured the true meaning of Hanukkah; namely, that you should have appropriate respect when burning stuff. The whole holiday comes from the miracle that oil burned for 8 nights rather than an expected one (although let's face it that this so called miracle is so lame that no one really believes it or could care less whether it is true or not). In this household, everyone respects the power of flammable materials. It is as fundamental a message as an child is going to receive from a holiday.

[Update: for those doubting that Hanukkah is trumped up, see there economic evidence.]

Thursday, December 2, 2010

Tech feature: Light Masking

So just wanted to give a quick info on a brand new feature: light box masks.

When placing lights in some rooms, it is common that light bleeds through walls, and show up in other rooms close by. The obvious way to fix this is to add shadows, but shadows can be pretty expensive (especially for point lights), so it is not often a viable solution. In Amnesia we solved this through careful placement, yet bleeding can be seen in some places.

To fix this I added a new feature that is able to limit the lights range with a box. This way the light can cast light as normal but is cut off before reaching an adjacent area. This pretty much does the job of shadows, but is much cheaper.

It turned out to be pretty simple to implement as well. In the renderer, different geometrical shapes are used to render lights (spheres for point lights and pyramids for spots) which make sure the light only affects needed pixels. To implement the masking, these shapes where simply exchanged for a box and then with some small shader changes it all worked.

Without masking:

With mask:

Wednesday, December 1, 2010

Bye, bye Pre-Pass lighting

I have an announcement to make.

I am dumping pre-pass lighting.

A couple of weeks ago I started to remaking the renderer from a deferred shader to a pre-pass lighting one. Directly after implementing it, I wrote this post. At first, pre-pass lighting sounded great: faster light rendering and more variation in materials. Having seen that companies such as Crytek and Insomniac Games used it, I thought it would be the next logical step to take.

However, even as implemented it, the problems began. The first one was that specular lighting has to be made through hacks or something that makes it closer to deferred lighting. The next was that implementation become more messy. I suddenly needed to redraw all objects in two separate passes and this made the material and shader code harder to maintain. Normal deferred shading has this nice design where all material info is rendered in one pass to one buffer. But in pre-pass lighting, this spread out and makes more annoying to add new stuff and to update existing.

Still, I stuck to it, because I was sure that the speed and material variety would make up for it. One of the features I was looking forward to was making more interesting decals, with normals and such. Since only the light data is written to an accumulation buffer I thought this would allow me to easily put more effects to the decals. However, I quickly realized that I had been quite foolish and not considered that pretty much every interesting part of a materials is added when lighting it. The surface normals, specular, etc are all baked into the light data. So I ended up doing tricks that I could actually work with normal deferred shading.

So what ended up with was lighting of worse quality, compared deferred shading, and with no more room for special effects. Still, this rendering is much faster right? Well, I did some checks which I collected in this post. It turns out that pre-pass is actually slower unless in very specific situations. None of the improvements I was hoping for turned out to be true.

Still, I stuck to it. I am not sure why, but I guess I did not want to face the truth after having put so much time and effort into it. Going back to the old renderer was something I did not want to consider.

Then last week, as I was starting making undergrowth for the terrain, it suddenly happened. I realized that I had to render the vegetation twice, creating more overdraw and making it a lot more cumbersome to implement. At this point I decided that I should seriously consider going back to the old deferred renderer. What I was most worried about about was that it would exclude us from consoles, but I found out that games like Burnout Paradise used a deferred shader too, and assuring me that consoles would still be possible to do.

This post by Adrian Stone, with an in-depth discussion on the subject, sealed the deal for me and I got to work with going back to deferred shading. I had actually come across Adrian's post before when implemented pre-pass lighting, but never read it carefully. I guess it would not had made me stop then since I wanted to check it out myself, but it is interesting to see how one can convince oneself that something is correct, to the point of avoid contradictory sources. This is a very important lesson to learn and one should always be prepared to reconsider and "kill your darlings".

Right now I have fully implemented the deferred shader again and even updated it a bit too. For one thing, I fixed so the decals support all the feature I had in the pre-pass lighting shader. Since we are aiming for a little higher specs (shader model 3 or 4) for our next game, I took that into account and was able to add some other fun stuff. Examples are colored specular and saving the emission in the g-buffer (allowing to cheaply to a variety of effects).

I am really happy to back to the old renderer and now that I am adding new features things are going a lot smoother. The pre-pass renderer was not all in vain though. I cleaned up the rendering code a lot and it also made me rethink how some features could be added. Last but not least, it also reminded me that I should never get too attached to an idea.