The Big Reveal

Procedural ANSI face generation is here!

PCface1

Ok, so a little about the system. I basically wanted a system which adhered to four (five) major objectives. Firstly, it should be massively varied, and even if you spend a decent length of time just looking at the ordinary people in the street, it should take some time and under you see any two people who are identical. Secondly, it should be demographic – which is to say, each nation can have a set of preferred hairstyles, likely skintones, other signifiers (like turbans, tattoos, jewelry, etc), and these should be distinct in each nation. Thirdly, and following on from the second point above, there should be enough of these that (much like everything else in URR) you should be able to gain visual information: when you meet someone you’ve never met before, you should be able to make a reasonable guess about their nation of birth. Fourthly, any combination should be possible, as a means of undermining the idea that only “primitive” peoples will be found with certain cultural signifiers – in one game perhaps the people in the most technologically and militarily powerful empire all have extensive facial tattoos, for examples. Fifthly (I suppose), the objective was to make them look visually and aesthetically interesting, and striking, and distinct: as with everything else in URR, if I wasn’t able to make face generation look enough to meet my standards, I’d have just cut it.

I’m not honestly sure how many variations there are (since some variants cancel out other variants in the generation process, making the simple solution of just multiplying everything together inaccurate). Roughly speaking there are nine skin tones, thirty hairstyles for women, thirty for men, a dozen different forehead/chin/nose shapes each, a dozen hair colours (which are genetically placed around the world and are toned appropriately to reduce contrast with skin tone), four eye colours (likewise, genetically varied around the world), several dozens beards (for the gents), and then a massive range of other visual identifers. There are six below: paint/dye markings, turbans, brands (sometimes consensual/cultural, sometimes as identifiers of slavery), facial tattooing, collars (always denotes slaves), scarification, and a bunch I haven’t shown here. There are also some rare additions like scars, eye patches (like the lady at the top of this entry), and some other neat and extremely rare properties as well. These will always tie to that NPC’s history, so someone with an eyepatch will have a distinct event in their past where it was lost – you can sometimes, therefore, get a bit of “personal” data from someone’s face, as well as cultural/national/etc.

PCface1

When you ‘l’ook at an NPC, you’ll get a new range of screens to cycle through in this coming release. If you’re currently in combat, it’ll automatically go to the screen showing their health; if you’re not (which will obviously be the case in this release) it will show you their face, and a little bit of data. There will then a list where you can scroll through everything they are wearing and bring up the appropriate attendant images for all of those (clothing, shoes, any holstered weapons, jewelry, etc). I’m going to remove anything you could not “physically” determine, until you know for sure: which is to say, an NPC’s lookup will never state their affiliations, unless you have explicitly talked to them and found out (though they might have lied…) or someone else has told you. Here’s a spectrum of the skin tones in the game, with a bunch of hairstyles and beard styles (where appropriate). Alpha Centauri players might also note the worrying but entirely unplanned similarity of one of these nine women to a certain Sister Miriam Godwinson…

Fine folk

And that glorious image pretty much concludes this entry. I’m currently working on a bunch of optimizations for the game – primarily in terms of how data is saved, and the efficiency of the rendering and line-of-sight algorithm, since this needs some serious improvement so that you can see further than a couple dozens tiles in front of you. Once that’s done (which hopefully won’t take too long) I’ll probably get working on clothing generation, and then doing some major work on families, family trees, and how NPCs should be stored for remaining still and/or moving around the map, as an important precursor to getting them actually spawning. See you all next week!

Be Sociable, Share!

42 thoughts on “The Big Reveal

  1. Awesome work, Mark! Looks beautiful 🙂 I think the idea that NPC’s are primarily used as a source of information is brilliant. Very curious of your plans for how conversations and interactions will work 🙂 I get the feeling that it will be one of the core mechanics of the game?

    The information hunting aspect of the game objective is really interesting. Reminds me of a game idea I had one time where I would generate tons of simulated fictional database information which a police detective/investigator typically would have access to; like birth papers, insurance data, medical reports, phonecall lists etc. The purpose was to create a detective puzzle, kind of like a labyrinth – but with information in where I would hide clues. The player were to search through all the documents, which could’ve been printed (with an authentic look :D) and looked through by a kitchen table, for example. The thought was to save every information string in the databases as true or false. And build chains and patterns of false information that then would lead the player either to dead ends or to find the culprit of a murder, which was the objective.

    • Thanks! Yeah, that’s definitely the primary purpose of all NPCs, even just the standard random citizens who’ll be wandering around the place (though obviously the amount you can gather from the average “person in the street” will be minimal); combat is going to be pretty damned rare. Info-gathering is probably *the* core mechanic, really.

      That sounds extremely cool, and in a way, is similar to what I’m working on in URR, really: creating a labyrinthine detective puzzle (or rather, many hundreds/thousands of other interwoven and twisted through-out the game world). I’d look into what Michael Cook (@mtrc on Twitter) is doing with his games “Murder” and “Mystery” where the latter is semi-similar to that (and also, I think the game “Inquisition” that came out of ProcJam had a similar core concept?). I like all these ideas for games with non-combat core mechanics, I think it’s such an interesting and promising route to take. I love the idea of making some of the game “physical”, too!

      • When you say combat will be rare, how rare were you thinking? Like, for example, will be rare that I need to fight, but if I want then me and a group of mercenaries can go on a rampage?

        • Well, for a given playthrough (I don’t know, 20+hrs?), I would think you should only fight maybe a dozen times, at most. You’ll need to fight a few times, but a rampage will be put down very quickly and painfully; if you’ve ever played Resident Evil 4 and experienced fighting the Chainsaw enemy, I want combat to be roughly like that: something rare, and deadly, which makes you immediately rethink your environment and your strategy when it occurs.

  2. Excellent work! Great variation from skin tone, hair, and other attributes. Probably the only somewhat disturbing and distracting element are the eyes, which are all too similar and stand out so much compared to the rest of the face (in most but not all of the sample cases).

    Eyes are often considered one of the most telling parts of a person’s appearance, and are naturally what we look to first for meaning, but these lack that “window to the soul” feeling that would bring them to the next level. Perhaps they could be smoothed in various ways, sort of like some of the eyebrows have a lot of life to them.

    Then again, maybe it’s just seeing so many of them together–the effect seems to be less pronounced when looking at them individually at full size. Regardless, amazing to see this added to the game! URR would feel odd with so much visible in ANSI form but no portraits. Now you have to do (and *are* doing) just about everything in the world like this =p

    • Thanks! It’s interesting, a bunch of people have commented on the eyes, so I’m definitely going to give them another look. It is tricky to make eyes different using only ANSI; although they are only a small part of the overall face, they probably took the most time of any feature; a significant amount of effort went into trying a whole bunch of variations before I settled on how they look now. As you say though, I think part of it is seeing a bunch of them together, whereas in game that’ll obviously never happen! Ha, yeah, it would be strange to have PCG graphics for everything else but not faces… so I’m just glad I managed to get them working well enough to meet with my satisfaction!

  3. You keep getting me amazed.
    I’m following the project for quite a while and it just gets more and more interesting!

  4. This is exciting! I have to say though, while beards are clear identifiers of masculinity. A good deal of the female faces are rather androgynous. Girls 2,3,4,8, and 9 could all easily be confused as males. I think it’s the general face that all the random features are drawn on top of. The males, even without beards, look quite male, big necks, strong jaws etc. While the females do look more feminine in contrast, on their on, they could just be lanky or non muscular men. Perhaps some more -extra- feminine variations could be thrown in to fix this? A few extra large pairs of lips. Maybe makeup for the more well to do women? An even more slender neck variation?

    • Thanks! Re: androgyny, very interesting; I personally don’t agree, but obviously I’ve spent a week on this system, so my opinion is probably much less useful than somebody seeing them for the first time. Women do have a one-tile thinner neck, narrower eyebrows, narrower nose, different lips, etc; I could definitely try making necks even narrower, and possibly trying somehow to make the entire face a tad slimmer. The bit of the torso you can see should also be slightly different for women, but I’ll try shrinking that a bit too and seeing how it looks!

      • I’d much rather you keep it as-is or have this as extra variation. Many women throughout history and across cultures have had strong necks, strong jaws etc. Muscular women tend to have less differentiation about the hips as compared to men. It’s interesting and refreshing, I appreciate it.

        • Then maybe I will! I’m explicitly trying to make a very sex/gender/race/culture/etc neutral world, but obviously some degree of ability-to-identify the difference is important (and not necessarily trivial within ANSI limitations). There’s no way I’m going to stray into caricatures; honestly, I don’t know how much it’ll be changed, but I’ll certainly experiment around a bit. I appreciate the interesting and refreshing comment a lot – thanks, and rest assured, any further change will be extremely minimal (if there is one – I haven’t had time yet to try out some other possibilities, and it might just prove too difficult). As you say, I might just make it variation, rather than a total change. I’m very insistent about the kind of world I’m trying to make, and I specifically want it to be one a sex-neutral one where women have just as many political/military/cultural/whatever roles as men, and any images should reflect that.

  5. I must say I am impressed.
    My only reseve would be about, as mentioned before, the rectangular eyes and the lack of variety in the general shape of the faces. While the latter is probably a lot of work, the former might be easier to correct.
    In any case this is truly awesome work!

  6. I find (oddly enough) eyebrows to be one of the most effective character-evokers in portraits. With just a little variation you can affect a huge range of emotions, tendencies and possibilities.

    • Interesting; currently men have one eyebrow set, and women have… five, I think? I’m not currently planning to add to this, and the portraits are for “reference”, not for emoting (as it were), so I think that’ll do, for the most part.

  7. Yes, the eyes are too similar, maybe is this batch of variation? They seems all related just because the eyes.

    But, of course, this is amazing. Good Work!

  8. ~The Book of Ultima Ratio Regum… Developments 3:16~

    “…and so it was that the Wizard of Procedural Generation, mighty maker and Coder-Lord of Ultima Ratio Regum, decided that He would blesseth His devout worshippers with the gift of ANSI Procedural Face Generation on the Second of May as a testament to his otherworldly munificence. Many were the praises unto Him that day as the plebeians thanked Him for sharing His gift, and many were the songs chanted that night in reverence of His skill…

    …praise be unto the Wizard of ProcGen, for He is the true prophet and one destined to ascend the Throne of the Roguelikes- Hail, Coder-Lord of Ultima Ratio Regum!”

    GLORIOUS

  9. Very very cool stuff indeed.
    But what about the player character Sir??
    Will our characters get the randomized faces too?
    If yes can we also customize our haircuts etc?

    I also wander a bit more and I found the scale of the indoor buildings are pretty up to my taste.
    No mega endless underground basements are a great plus in my book.
    Daggerfall is without a doubt one of my all time favorites, but God knows how I hate those super big labyrinthine dungeons which happen to be every single dungeon in the game.
    IMHO Realms of Arkania Star Trail has the best dungeons in games. They are very varied with clear reasonable purpose to exist than just the places for adventurers to explore and find loots, plus there are no senselessly huge dungeons and no endless horde of monsters inside. There’s even a dungeon without any monsters inside but instead filled with traps and other nasty surprises.

    Also it would be cool if we can access the world map and the encylopedia during country selection screen to see more detailed explanations about the religions, each nation history etc.

    Thank you so much.

    • Thanks! Yes, the player will look just like these, and you’ll have comparatively little control over your appearance; I think it’ll be interesting to spawn the player as a “logical”-looking person based on their nation of choice. Probably no customizing!

      Excellent re: indoor buildings. The size of these things is an interesting quandary, and maybe at some point I’ll do a blog point about the overall size of dungeon design. I think both NetHack and DCSS are illustrative in this regard (those are the two RLs I have played the most of, so I’m not really equipped to talk about dungeon size/design in Angband, ADOM, etc). The DCSS devs are forever changing the size of the dungeon and the size of different branches (generally making them smaller) whilst a lot of players seem to think the Gehennom part of NetHack is either too long, or too monotonous for its current length (I actually don’t agree with either). I’ve tried to make all the buildings a logical size based on two major factors: firstly, how important the building is (so obviously cathedrals are massive, lower-class housing is tiny) and how much interesting stuff there actually is inside. I think it has worked out well, but naturally there are lots of items, NPCs, etc, which haven’t yet been implemented. I don’t want to make anything bigger than it should be, especially when the world is so huge anyway and exploration is so important!

      Hmm, interesting: actually, I’m thinking about doing away with the country selection screen! That might seem like craziness, I know, but there’s a bunch of gameplay reasons I might do that which I’ll talk about in a later entry, if/when I decide to do that…

  10. Man this is brilliant stuff, it kind of reminds me of the sprite generator library that can generate ships based on a base tilemap, except more complex. You say that some variations cancel out others, is there like a list the generator refers to that defines which parts don’t work with others (e.g. if a certain hair colour doesn’t work with a certain skin colour) or is this cancelling out done when applying certain features, making it more specific restrictions?

    • Thanks! And I think I know the library you mean, it’s very neat as well. There is indeed a list of that sort (lots of URR’s generators have similar lists, actually) which notes what cannot be overlaid on what, and therefore when choosing what the people of each nation look like, if it comes up with a “forbidden” variant, it’ll just re-roll them, and keep going until it finds something acceptable. Hair colour is an interesting one: all hair colour is allowed with all skin tone, but it is actually blended slightly with the skin tone to reduce contrast. In the third image, the 1st and 5th women have the same “base” hair colour, and the 1st and 9th men have the same hair colour, but you can see the actual colour is different; darker skin tone makes hair slightly darker, and lighter makes it slightly lighter. I had to add that since I found keeping the base colour for the darkest hair tones looked absurd on the lightest skin, as did the lightest hair against the darkest skin.

  11. I’ve been looking forward to this and you don’t disappoint. The amount of detail and variation you work into this game is amazing. I do have a few concerns though:

    Will female/male hairstyles be at all interchangeable? Aside from beards, looking at Earth’s cultural history alone seems to suggest that fashion styles between genders can be pretty fluid. Different cultural trends in that aspect would be interesting to have. Would also be cool to see cultures with systems like the Hijra communities and Two-Spirits, on that note.

    I’m also loving the wide gradient of skin colors an NPC can have, but for some reason they all look very grey to me. It’s definitely not bad. But I grew up among many people of Asian and Latin ethnicity and I assume that many (especially brown) skin tones are a bit more saturated than that, but perhaps it’s more the effect of sunlight (yellow tinge) or maybe I’m spoiled by phtography. Perhaps a saturation gradient could be implemented as a second “axis” of skin tone generation.

    RE: What people are saying about the eyes, I generally agree, although as-is it’s not bad, I tend to notice small same details like that over the course of gameplay, personally. In my assumption, most people tend to have very different-looking “neutral expressions”, so more variety in that regard would be very cool. Even if you aren’t planning on making them emote, it’s something, I guess. The variations for thin/thick wide/short faint/contrasting eyebrows are neat, though.

    Lovely stuff, altogether. I’ve been watching this project from afar for a long time and what you’re doing with URR is inspiring and great all around. I’m really looking forward to being able to meet with and talk to these people. Having your game generate its own cultures complete with art, people, and personality is something I really admire about your work.

    • Whew, thanks for this message – it’s awesome that you like where things are going. As for specific comments/questions:

      1) They are not interchangeable, *but* it is not just male = short hair, female = long hair. Both sexes have a lot of long and short hair styles, but the full dictionary of each is distinct for each sex. I think for now I’m going to keep it that way – as I say, there’s no real difference in who gets what kind of hairstyles, but I think it might fractionally add with player recognition in the longer term. It would just be the push of a button to change that, though.

      2) Very interesting idea: I like it. A couple of people have suggested some of the skin tones should be more yellow, and some more red/brown, so I’m definitely going to incorporate that, combined with what you said. Will update it on the blog as and when…

      3) I’ll look into it, but as I’ve said in other comments, it’ll be tricky! I can’t make eyes too big since otherwise they look bizarre (even if that means I can use more tiles to display them), and making them smaller adds variation, but makes it extremely hard to add detail…

      4) Thanks! I appreciate it *immensely*. From my perspective it was great last release to take all the macro things and start to write those into the micro world of what the player walks around, and doing that even more so this release is hugely exciting!

  12. Very impressive! Has anything like procedurally-generated faces been done in a game before? At this rate, I half expect to load up this blog one day and read, “New feature: URR will now generate new, highly-detailed roguelike games that are fully playable in-game!”

    As for the eyes, I think it’s mostly an uncanny valley effect of seeing so many faces lined up beside each other; within the game, it would be much less noticeable. It will be interesting to see this new feature as it develops further.

    • Thanks! I… don’t think so; I mean, I suppose there’s a blurred line with games which do have face options and generate faces for random enemies (Oblivion, Skyrim, etc) but I’ve certainly never heard of anything like this in ASCII/ANSI; the closest was this really cool pixel face generation, though I cannot remember the name of it right now…

      And ha! That is, indeed, basically the goal (though I think you want to talk to Michael Cook at Goldsmiths about that one). Eyes: I think you’re right, it’ll be far less apparent in-game, but I am going to experiment with making them perhaps a tad more grey rather than the very bright white they are now…

  13. Very, very cool.

    The main problem with the eyes is that they are pure white. Use blending like you did with the hair to bring them closer to the surrounding skin tone — in real life this happens because of reflected light off of the skin. You could also skew some slightly towards yellow or pink or gray.

    Also, for eye shape variance, try procedurally adding a “pixel” of skin in one or more corner, e.g. top inner corner of both eyes, or top inner and bottom outer, top inner and outer, etc. The rectangle is too inorganic.

    • Thanks! Yeah, I think I’m going to do exactly that re: the eye blending. They definitely are a tad too bright against the darker skin tones. As for eye shape… under the current ANSI limitations, something like that is going to be very tricky! There aren’t really any characters in the font map that could do that effectively. At least I don’t think so. I’ll have a look…

  14. Pingback: Ultima Ratio Regum’s Procedural People Are Handsome | Rock, Paper, Shotgun

  15. They are awesome, really! I am looking forward to this so much. Just a little suggestion!

    Another factor you should consider are lips, noses and chins, or jaws.. Seeing how they are created i don’t think this would be much of a problem! Depending on the heat the size of lips is different, and generally the same zone always has a distinctive type of chin or jaw. Though i don’t know what makes noses different in size, i guess it’s the same.

    Adding that would add much more personality and uniqueness to them. Right now, they look too much like the same person.

    I think that, appart from the artwork, it should not be hard to make some variations for this things, though i should not talk about what i don’t know.

    And hey, the game is coming toghether awesomely! Can’t wait to see how this update will be.

    • Excellent!

      Yeah, I’m going to add more lips and noses (there are actually several chins; there is only so much variation I can add in some areas whilst still making sure that all the ANSI “components” still slot together). I’ll be updating the blog once I’ve got some more variation there, though it might be a couple of weeks…

  16. Pingback: Procedural Clothing Generation (Part 2 of ?) | Ultima Ratio Regum: The Roguelike

  17. Great work! 🙂

    Is there any possibility to vary the general geometry of faces? Right now, they look like the same oval with a couple of bolted on distinctions. Thin faces, fat faces, assymetrical ones, certain deformities – that kind of thing. Maybe you can use one of those strange mugshot sites to get rough guidelines for distinct facial features.

    I guess the sheer scope of your world will quickly outgrow ASCII-Art.

    • Thanks! Yeah, I’m going to try to vary them a little bit more before release, but it is tricky when you have so many layers, *and* – crucially – the layers have to fit together when you only have ASCII/ANSI characters to use (I intend to stick with this style forever!). I intend to add more noses, mouths and necks for sure, as those are some of the most similar parts; and yeah, definitely more striking differences too, although those might have to wait until 0.9.

  18. Pingback: 2015 in Review | Ultima Ratio Regum: The Roguelike

Leave a Reply

Your email address will not be published. Required fields are marked *