Dev Update #19: NPC Portraits Part 1

portraits.png

Problem

A. Dynamic World Generation

Given that the whole gameworld and all it's characters are generated procedurally at the moment of player birth, I can't have a specific portrait for every possible NPC.

B. Creating 1,000+ Portraits is Cost Prohibitive

Most (if not all?) CRPG's use hand painted portraits to represent your characters and the NPCs of the world.  That's easy if you have a scripted story knowing the number of characters up front, and the budget to have an artist paint them.  

Pillars of Eternity allows a lot of modification to your character model, but then you get one of 74 choices for yer head.

It's hard for me to say how many characters a player in Archmage Rises will interact with.  It's well over a hundred.  Close to a thousand by game end.  Even if I was able to get a portrait made for $50, and even if I thought it was a good idea to blow $50k on portraits alone, I wouldn't be able to find 10 artists interested in painting 100 portraits in a similar art style for that little money.  That is the gruntiest of grunt work.

C. Portrait Generators Look Crappy

 The artist, Rogier, was quick to point out that most (if not all?) portrait generators he and I have seen look crappy.  Most of them are made for flash-type games with simple cut & paste paper dolls.  If you only need 20-50 portraits, you get better quality results for low investment by having them hand painted.  I'm sure he was saying this to increase his work as a contractor. :-)

Ah... No!  Probably ok for a manga comic book generator, but this is a serious RPG folks!

 

What We Did

The solution I came up with was to use what i call "Generic Portraits".  Every barmaid is the same, every mage shop owner is the same.  The portrait is representative for a type of person not an actual person.  Old school games like Mechwarrior 1 and Bards Tale did this.  

This seemed like a good comprimise so off Rogier went and painted up a few portraits per type: some kids (male, female), some adults by wealth level, some special ones (your parents always look the same regardless).

And the results are some nice portraits.  I put them in the game, and kept building the game.

Epic Fail

Oh hindsight, why dost thou mock me!

When we tried out a version of the gameplay trailer on a focus group, some people were confused: if you killed the innkeeper in one town, why does he pop up again in the next town. (Answer - that's a different guy, but same picture).  It actually ruined the whole dramatic thrust of the trailer/demo.  So for the trailer I just forced the second innkeeper to use a different portrait.  Fine solution for the trailer, doesn't solve the game issue.

In hindsight, if the game is about you making relationships with any or every NPC and those relationships are supposed to matter, if you are supposed to feel real emotion when you see your good friend Kate the Butcher, but if every female peasant is only different by name not face, it ruins the whole experience.  Ugh!

Necessity is the Mother of Invention

Time to revisit our assumptions.  Either we figure out a way to dynamically generate GOOD portraits or we toss the portraits altogether.

Dynamic portraits have sucked in the past, but why?  What new approaches can we bring to the table to address or mitigate those problems?  Is there a way to innovate to solve this differently.

Following the advice of Lean Startup to "fail fast" (the point of a start up is Validated Learning not success), we decided to make a rough & dirty prototype at a GOOD portrait generator.

What we Learned

First, I've learned more about the human head than I ever wanted to.  I discovered scientific genetic analysis on what makes up the distinctiveness of the face.  For instance, the placement of the eyes (how much forehead you have) how big they are, how close together or apart they are, all make us look quite different.  (More of this validated learning in future posts.)

Second, I studied thousands of portraits.  From RPG hand drawn ones, like those in Pillars of Eternity or Wasteland 2, to Baulders Gate, to stock photos of portraits where they take the picture of about 32 people all roughly the same way so you can see their face most distinctly.

Then I found an avatar generator art pack on opengameart.org.  Armed with some ingredients (heads, eyes, hair, etc.) to play with, I set about making a simple portrait generator.  I didn't want to waste any art time until i understood the programming aspect better.

These portraits are exactly as cheesy and bad as I feared.  But just doing it taught me a few things and gave me hope:

  1. Working with a small sample size (all heads use the same nose, and ear; there are only a few different hair styles, then they vary by color) did result in a significant number of different looking portraits.
  2. Utilizing different backgrounds really tricks the eye into thinking the person is different when they are either very similar or exactly the same.  Our recognition of faces must be contextually based.
  3. I could imagine many many ways to improve the algorithm so it wasn't making stupid choices
    1. For instance, I can lock down certain feature "sets" so an aged old woman won't end up with little girl pig tails

Armed with this knowledge I contacted Rogier, showed him what I had.  And now we are trying version 2.

To be continued... in PART 2!  (Aren't you glad you don't have to wait!)

(BTW, I don't know if this experiment will succeed or fail, but I think the journey will be interesting none the less!)