first real procedural portrait

Here is the first portrait actually created from independent elements (body / clothes / face / mouth / nose / eyes / eyebrows / hairs), and totally drawn from scratch. It took me two hours to reach this point. Making additional sets of eyes/hair/… should be much faster. I hope so, because there are loads of elements to draw, especially since I decided that portraits should also reflect the character’s mood… That means that each set of mouth/eyes/eyebrows must be drawn for each mood supported by the engine.

5 comments so far

Add Your Comment
  1. AWESOME !!!


  2. Hey that looks pretty good!! So, you managed to have something like a character for each eye, another for the mouth, etc? Or something else is going on?

  3. No I have a 32 bits png with only the mouth, one with the nose, one with the eyes…

    In the engine, I load all pngs and I build the final TCODImage by applying selected layers in order (back hair, body, clothes, face, mouth, nose, eyes, front hair).

    Once I have the final TCODImage, I decompose it into font characters and I update some empty font characters so that I can blit them on screen. The font I use in TCOD has 32×16 characters (512 characters). The last 256 are empty and are used for portraits.

    I added several functions in libtcod to be able to do this :
    invert on TCODImage to be able to invert the final image (in the font, white is opaque, black is transparent).
    getAlpha on TCODImage to get the alpha value (only works when the TCODImage is created from a 32 bits png).
    updateChar in TCODConsole to dynamically update a character in the font. All these functions are available in the latest beta (not documented though, because they’re early work in progress).

  4. Hey you could even have stuff like scars, a magic mark in the forehead… you can throw pretty much anything you want there. I’m impressed.

  5. yeah, bangles, necklaces, tatoos, scars, … possibilities are almost limitless 🙂