Chapters, Twitch, Graphics

Hi everyone! I’m afraid this is the only blog post we’ll have this week. Basically, a particular and extremely exciting games-related opportunity has just arisen very unexpectedly that requires me to absolutely focus on putting together what is effectively an application by the middle of this coming week. I’ve been working almost entirely on this for the last few days, as well as finishing several book chapters I need to write for an upcoming textbook on procedural generation edited by Tarn Adams and Tanya Short, organizing a funded “hackathon” event at the University of York next month, preparing for a conference presentation on modding and glitch-hunting in Belgium next weekend, having a meeting at Twitch with some absolutely fascinating future research potential…

Meetery…and creating a quick mockup of ANSI art for an intriguing external game project whose lead designer is keen to hire me to do the artwork (and I’m keen to work on!)…

Nuclear Mockup…and generally catching up with my emails and whatnot post-Canada. Sorry everyone! We’ll be back in seven days with lots of conversation screenshots, as the menus of conversation options and the technical implementation of tracking dialects and sentences and whatnot are *almost* ready to show. See you then!

NPCs, Playtesting, Speech and Dialects

A huge update this week, so let’s skip the introduction and get on with it!

AI Refinements

I’ve had a wealth of fantastic feedback from my playtesters this week – thank you to you all! As such, I’ve implemented a whole range of fixes, some of which were for issues that I thought had been resolved ages ago, but some code edit in the mean time had apparently ruined, leading to these problems.

Firstly, we had a wealth of problems with servants/slaves in upper-class housing districts entering non-crucial mansions, and then when players enter them, a whole suite of Very Strange things happened, normally resulting in a crash. Quite a few people reported it. This bug was a leftover from a previous model of NPC handling, and required me to prevent random crowd servants/slaves from going into buildings, so now they just move around the district or sometimes leave the district instead; in turn, I’ve disabled servants/slaves in second-tier upper-class houses, and I’ll put them back once I come to 0.9 and I’m putting in all the other NPCs and NPC variations 0.8 will lack. This should all now be fine!

Slaveys

Secondly, I’ve had a bunch of reports of crashes when saving/loading the game, and these are very hard to diagnose, unfortunately, but I think I’ve fixed it. One was a rather strange issue with the pathfinding maps in buildings; these were just saved and loaded, but for some reason this has stopped working when you save and close the program; save and reload works fine. In truth, I don’t really understand what could be causing this in the slightest, but it takes just a few milliseconds to recalculate when you load the game instead of trying to load it from scratch, so I’ve dumped in some code to that effect, which will be sufficient for now. Debug logs still look crazy, though.

Log

Thirdly, a major problem arose with non-“important” NPCs sometimes straying into the code for important NPCs, and being asked by the game to report their “current_step” variable (which relates to how far through they are moving from one district to another on a regular/routine schedule), and the game thereby crashing because they don’t have that variable at all. A lot of people reported this, and it turned out to be pleasingly trivial to diagnose and fix, since it basically required the addition of “if npc.important:” to a particular piece of AI code, and that sorted it out. Result!

We also had an issue with guards failing to appear to relieve other guards in upper-class districts, which has now been fixed:

Swapshop

And ambassadors were not always in their embassies at night, which needed a quick fix:

Emb

There were also reported issues of jailers sometimes getting into an infinite loop (fixed), an issue with castles that contained both slaves and jailers/torturers in the basement and they would sometimes try to path to beds in the other segment of the basement and cause the game to go into a loop (fixed), farmers sometimes didn’t always appear on their farms at the right times (fixed), and entering a farmhouse after a farmer who you saw enter, entered, and that farmer wasn’t an important farmer, would cause a crash (fixed), due to them inexplicably attempting to use a line of code designed for guards and knights moving between floors in castles, and the game freaking out with concern about the impossibility of pathing to duplicate mutually-exclusive staircases which didn’t exist. Weird. Also, we had a problem with guards sometimes teleporting themselves into the inside doors of a castle, which was screwing up their ability to exchange places with their counterparts at the right time (fixed, below) and a whole host of little minor problems which I didn’t write down whilst solving, but were generally not crash bugs, but just strange actions.

Inside

There is still one issue, which is that if you enter a “farm” map grid at night, the farmers spawn outside and then immediately rush inside to sleep; this really should be fixed, but it’s low priority, so in 0.9 I’ll make sure they appear in their buildings. It’s basically because most farmers being unique, but unimportant, AND being in their own buildings, is a unique combination, which requires some special code to it though. If I don’t mention on the blog that I’ve fixed this in the next couple of months, somebody remind me!

If you’re on the playtesting team, you should have a link to a new version in your inbox in the next few days. For everyone else, suffice to say that major bug-fixing improvements are taking place at the moment, and the team are doing damned well. More news as and when…

Talking Screen

Insanely exciting developments this week! We have a first draft of the conversation screen! It is heavily *in progress*, but check this beautiful thing out:

firstdraft

Now, I’ve been working on how this should look for quite some time and there’s a lot of stuff here to explain and describe, so let’s take it in order. Firstly, when you want to talk to someone you press ‘s’ for speak – ‘t’ is currently used for throw, and the options are therefore “throw” and “speak”, or “chuck” and “talk” – I think we can all agree that chuck is far too informal, so the first option is obviously better. This gives you a crosshair like the look function and the grab function and so forth, which can be moved in a 7×7 square centred on the player. Anyone in that area, and without your line of sight and on an explored tile (so you can’t exploit it by trying to speak through walls and finding where other NPCs are!) can be spoken with by pressing Enter, which brings you to the above screen. (In the below gif I quite rudely start talking to an NPC whilst they’re sleeping, but these are early days – naturally waking someone else will soon have some effect on their mood in the conversation).

Speak

Once you’re there, we have a bunch of options, which fall into three categories. Firstly, we have the “standard options”.

Biens

These are the options that the player will be given for every single person they ever talk to. These will be related to the player’s “memory” (which will soon replace the existing “encyclopedia”, which is to say that you can ask anyone a question about any sub-topic within these topics, so for every important painting you’ve seen, you’ll be able to raise it as a potential topic of conversation (if you’re thinking “this will make for extremely tedious optimal gameplay – don’t worry, I have a solution, which is later in this entry). These options will likely form the majority of one’s conversations, and allow for a great breadth in potential conversation topics. Naturally, some people will be more or less willing to discuss each topic, for reasons of their own preferences or their culture/religion.

Then, we have the “special options”.

Biens

These are options specific to the class of NPC you’re talking to. A priest will give you options like “Worship”, “Holy Book” and “Relics” that we see here; a servant or slave will show “Tasks”; a noble or lord might show “Family”; an archivist will show “Archives” and “Tombs”; and so on and so forth. There are never more than four special options, but quite a few classes of NPC now have four special options listed. These will often be the crucial topics to speak about with an NPC, but naturally the standard options will also often yield important or interesting data of various sorts. I think these add a nice sense of variety when encountering new types of NPC, and also direct players to some almost “recommended” topics of conversation, which might be especially important when people are learning the game and find themselves a little overwhelmed by the sheer volume of Stuff you can talk about.

And thirdly we have the “dialect” option.

Biens

Now, you may be thinking – what is to stop the player simply asking every single question to every important NPC in the hope of extracting some information? We all know that gamers can often be satisfied with performing some very unexciting things in games if they are gameplay-optimal, and naturally I therefore don’t want it to be gameplay-optimal to “grind” in this way and just ask everything you can in the hope of landing upon something which matters. Once you’ve explored the world a fair bit, you are going to have hundreds, and potentially (in the late game) thousands of things which you could ask a given NPC. The solution to this problem is rather simple, and I think rather elegant. Basically, all NPCs will have a “conversation interest” meter, hidden to the player, but reflected in the tone with which they speak. If you ask relevant questions, the conversation continues. If you don’t, they will quickly become disinterested, and past a certain point, just end the conversation with you. This will therefore strongly encourage the player towards focusing only on conversation topics you know are important, or towards those you think might be important, getting the player to make intelligent and informed judgements instead of just taking a shot on every conversation option. This is very different to most games with conversation options, in which players are generally strongly encouraged to exhaust every conversation tree, and I think it’ll be interesting to see how this plays out.

Also, I then thought of a way even this could be exploited – end the conversation, start a new conversation, try some more options, etc – but that’s also readily fixed. Characters who end the conversation due to your stupid or irrelevant questions will be unwilling to start a new conversation for a period of time, and since time will be the fundamental “food clock” resource in URR, you won’t (in almost all cases) be able to just wait around until they reset (a few days? A week?), and if you do, then it will have to be a strategic choice because you strongly feel you need to speak to a character who has previously shunned you.

Anyway, back to the screen. When you select an option you’ll get a list of every possible topic, and whether you know the dialect well enough to speak that question in that dialect (I’m still working on how exactly that will be “acquired”). These are empty for now, but will be one of the next things I’ll work on. We also see two images at the top of the screen, for the player and the person you’re talking to, whilst the conversation will scroll up (and be scroll-able) in the middle of the screen, with your comments left-aligned and the comments of the other character right-aligned. These are all the things I’ll be putting together in the next few weeks!

Lastly, on dialects, I would also like to add (on a more personal note) how enjoyable it is to be working on the speech generation/conversation system stuff! There’s a real pleasure to be found in starting to work on an entirely new and very cool system, and the past few days have been a great little period of starting to piece the disparate components required together. I’m really happy with how this initially looks and excited to keep working on this in the coming weeks. Stay tuned!

Nomadic Clothing, Tribal Clothing, Class Variation

For the last fortnight I’ve been working extremely hard on AI pathfinding and scheduling. It has been massively challenging – after two days searching for the conclusion to a single bug, only to discover that it was a single word misspelled in the 5000+ lines of AI behaviour code, something broke within me, and I need to take a break from the damned thing! So, for the last couple of days I’ve gone back to clothes and churned out all the remaining clothing for 0.8, and I feel intellectually rested enough to return to facing AI in the coming week. But back to clothing: nomads now have generated clothing, and tribal nations do as well, and these therefore now accompany the feudal clothing and the religious clothing styles that we have seen before. This entry will therefore talk about the nomadic clothing generation, the tribal clothing generation, and also small additions to feudal clothing to handle both lower-class and rulership-class variations in those clothing styles. With this done, almost all the graphics required for 0.8 are done, and it’s still just the pathfinding/scheduling stuff for important NPCs that needs finishing (as I say, I’m working hard on this in all my spare time at the moment, but it’s a huge task and by far the most intellectually challenging thing I’ve ever coded, without doubt). Anyway:

Nomadic Clothing

For nomadic clothing I wanted something fairly practical and rough-and-ready, but still visually interesting and distinctive, and something “modular”. The feudal clothing is less modular, in many ways, as there are clear archetypes that clothing will appear as a subset of, whereas for nomadic clothing I wanted to design it from the get-go to have more combinations – which is viable (unlike feudal) because it is a little less ornate, more pragmatic, and because you’ll simply see less of it in the average game, so you don’t have to “force in” quite as much variation in a single world generation. Each clothing generation selects three colour schemes, consisting of a plain colour (generally white, grey, some kind of pale brown), a pair of rich colours based on the flag of that nation (e.g. pink and purple, red and orange, blue and cyan, etc) and then a lighter version of the combination of those two colours (so a violet and red flag might wind up with a pale magenta as the third colour). Nomadic clothing is similar to the “robe” archetypes for feudal clothing, i.e. it takes up both the upper- and lower-body clothing slots when worn (unlike tribal clothing, as below) and consists of five layers – clothing shape, pattern shape, pattern pattern (you’ll get what I mean when you look at them), strap locations, and strap pattern, all combined with the various colour sets as described above. Here are some examples with illustrative flags that might be associated with the same nations, so you can see the colour-scheme similarity:

Hoifinal

I’m really happy with how these came out! As you can see there, rather than two ranks – “normal” and “ruler” – that we have in the tribal clothes you’ll see below, there are three ranks here, each rank gaining an extra stripe. I actually really like this system as another visual way to denote rank within a single civilization. So, for example, normal people in a nomadic civilization get one stripe, people like merchants or caravan leaders or the ruler’s family and the like get two, whilst the ruler will be the only person to get three stripes. You’ll also notice the background fabric of these is simpler than the tribal clothing below; as above, I felt nomads should be a little more utilitarian than tribal people, and I thought the large blocks of colour on some of the nomadic designs actually worked really well, so I decided that I didn’t need to add in any more detail in that regard. Also, nomadic boots  – quite a bit simpler than feudal ones, but distinctive and a little more colourful (as the clolthing styles of many real-world nomadic peoples often are), so I’m pleased with how these look (also, feudal ones tend to be more vertical whilst these flare out at the top more, which for some reason makes complete sense to me for nomadic footwear). The little buckle shape reflects the shape preference of the nomadic nation.

Nomboots

Tribal Clothing

Tribal clothing proved extremely challenging. From the get-go I’ve tried to emphasize relativism in URR, a lack of technological determinism, and so forth, but it is tricky to create “tribal” clothing styles that are intriguing and interesting, without them appearing “primitive”, but still acknowledging that a tiny (or at least, small) tribal nation will not have the technologies of their colossal feudal neighbour, for example. I also, of course, needed them to look very different from feudal and religious clothing, whilst still having enough variety that the clothing of one “tribe” will look nothing like another. After a lot of thought and several full days of trial and error, I’m very happy with the system I came up with. When I was doing the research for these styles I tried to find as many styles of dress used by ancient people that didn’t necessary look “primitive”, and that looked nice and varied. I looked for things like ancient Mesoamerican dress, ancient Egyptian clothing styles, and so forth, whilst accessories (necklaces, bracelets, etc) will appear in later releases. In the end I wound up with ten total possible “styles”, and three rankings of the technological sophistication of the tribal nation. For those with the greatest tailors you get something like the “high” one below – a thick background colour and lines running down it; for those with middling clothing technology (if there is such a thing) get a pale background with a coloured pattern and running lines, whilst “low” technology clothing has no lines and pale/dark pattern. You’ll also note the pattern becomes less dense each time – there are no tiles between the pattern in the left-most, a one-tile gap in the middle, and a two-til gap on the right. I also, of course, had to think about leadership signifiers. Just like religions use silver and gold thread to denote high rank (abbots, inquisitors, archivists, etc) and the highest possible rank (popes etc), and feudal nations will use gold thread for their rulers (see below), there are various signifiers of a leadership position in these clothes. They either have a number of patterned “discs” hanging on their front; a pattern down the middle of their clothing; or a bar that rests in the centre of their torso (the patterns on all of these also, of course, vary).

HG Clothes

And here we have various lower-body permutations, which will be similar in colour and graphics to the above set (the colour is always dependent on the flag of the tribal nation in question, as with nomadic clothes). These were far, far trickier to create than the upper-body tribal garments (although that was also the case for feudal clothing) but I’m happy with what I’ve come up with, most of which are (broadly speaking) kinds of skirts/gowns. As above, the most technologically advanced tribal nations have their colours inverted for someone that looks much richer, whilst each rank creates background double-line patterns that get denser as you go up in technical ability. As with the upper body clothing, there are equivalent variations for lower-body, so when you view a Chieftain, for example, both their upper- and lower-body clothes will be very distinctive with the appropriate leadership signifier. Naturally in all of these pictures any shape could be of any technical level – to reiterate,the high/mid/low distinction only applies to the detail and complexity of the background pattern on the piece of clothing.

Tribal lowers

I also in the process of creating these figured out how I actually want tribal nations to function in the game, at long last! More on this much later when I get around to it, but suffice to say the existing tribal nations are very un-varied, and adhere to very comparable “technological levels”, and it would be far more interesting to create nations that might resemble the Mayans, or Babylonians, or Hittites, or Aztecs, or ancient Egyptians, and so forth. I’d like to expand “tribal” nations to mean more than just what we would now call tribal nations, but rather to encompass civilizations that are smaller and more self-contained and inward-looking, but vary vastly more than those currently spawning in the current version. Either way, this is a future project, but I’ve already had some very interesting ideas for how this could work. Oh, yes, and as for shoes, tribes either go barefoot or have some fairly simple sandal-type shoes, which I haven’t got around to making yet, but I’ll throw those together on a spare day sometime before release.

Class and Clothing

I’ve returned to the highest and lowest class statuses for standard feudal clothing. I didn’t want to create a special clothing set just for rulers because the player will so rarely ever encounter them (although rulers do get unique crowns and unique thrones!), but I wanted something to mark out “ruler clothing” from “upper class clothing”, so I’ve gone with a similar model to the “pope clothing” of adding a special colour of highlights to upper class clothes. Therefore, “ruler clothing” now looks like this, with some nice gold/orange/white trim which varies depending on the other colours of the clothing (however, if the ruler is of a theocracy and therefore also a pope/godking/archcleric/whatever, they default to the religious clothing). Examples:

Nomcloth

Meanwhile, lower-class clothing wasn’t looking particularly impressive and needed a significant overhaul, since there is only so much brown one can look at. I tried to build up a decent library of “standard” colours that wouldn’t require any kind of serious wealth – whites, greys, browns, etc – and then I’ve tried to actually make them interesting (though I admit, this was tricky). Here are some instances of lower-class clothing types with the upper/middle equivalents for the same nation next to them:

Clothingranks

There is still one final thing to do for the lowest-class clothing, which is to make certain archetypes even less ornate (though you can see that the buttons are smaller, the belts less patterned, etc), because the 1st and 2nd on that list, for example, are still a bit too snazzy. Although, with that said, I don’t want to make the most common kind of clothing too uninteresting to look at, so there’s a balance to be found between realism and variety. I’ve also made the variety of colours possible for lower-class clothing significantly greater than it originally was, and hopefully you can see that in the left-most column. I’ll update this image later in the week once I reduce the complexity of some of the designs!

Final Clothing Thoughts

I’m extremely pleased with how different all four forms of clothing are. I feel confident saying that although the styles within each vary very significantly, it’ll always be fairly apparent when looking at an unknown person’s clothing whether they are wearing feudal, nomadic, tribal or religious clothing (and the armour sets I intend to develop later this year will obviously be highly distinct again). Here’s a rather nice image of some compiled generated clothing which illustrates this point better than I can, and shows very nicely the massive range of clothing you can now find on all the people you meet in the world(s) of URR:

Hoi2

Next Up?

I’m very happy with how these are all looking, and with these finished all clothing except armour is done (though armour won’t appear until 0.9) so we’re done with clothing for now (at a later date I will also add gloves, necklaces, rings, crowns, etc – I am really looking forward to crown generation – but not for 0.8, and probably not 0.9). I’m now turning back to pathfinding and scheduling for the third week of work, and we’ll have a large update on this in a week’s time… hopefully with it completed, but we’ll see how it goes. The task remains massive, complex and challenging, and although I’m making progress, it’s a long way from done. If I don’t think enough scheduling and pathfinding is done by next week, I’ll probably post an interim update on some of the other small additions and changes I’ve been implementing into 0.8. Either way: see you then!

ProcJam 2015 Report

This week I’ve been profoundly busy with work-stuff and other-stuff, and I’m basically working through a large backlog of minor bugs and issues and optimizations I’ve accrued through the coding of the last few months, so this week I’m going to write a report on this year’s ProcJam opening talks (which I was fortunate enough to be able to attend yesterday at Imperial College London) and save the next URRpdate for a slightly longer post next week.

Due to a tremendous train-related farce I missed the first part of Kate Compton‘s talk, which was the first of the day, but I was able to catch most of it. She talked extensively about a simple array-based model of procedural generation and showed a range of examples of what this could mean – flowers, faces, bizarre aliens, snowflakes, dance moves (which I thought was particularly amusing and interesting, and which if I recall correctly the below photo is from) and much else, and in hindsight seemed to slightly preface Tom Betts’ later talk about the value (which will obviously be something familiar to readers of this blog) of doing PCG for its own sake, and generating interesting/beautiful/intriguing things for their own value, rather than necessarily with a specific gameplay goal or longer-term objective in mind (although URR does, of course, intend to make every image gameplay-relevant in the longer term). A really interesting opening talk, the highlight of which was rapidly generating similar-but-slightly-iterated trees/plants, which looked really tremendous and should be on the ProcJam video talks on Youtube once they go live.

Proc1

Next up, Sean Oxspring and Kieran Hicks – who previously exhibited their work at the IRDC I organized earlier this year – gave a great talk about their various games using APIs and similar data. This includes #Dungeon (pronounced “Hashtag Dungeon”) which generates dungeon levels based on Twitter data (and they outlined various attempts to develop and iterate on this system), and then a game which used the UK National Election polling/sentiment-analysis data to get virtual politicians fighting, a game involving defending Wikipedia from malicious edits which attack the player in real-time, a bee-related game based on the changing seasons and the actual outside weather, and an intriguing, amusing and slightly disturbing game in the works involving a certain adult website API. It was fascinating to hear their experiments with games that drag explicitly on immediate data, and the issues with this – the Wiki game is only exciting when people are trying to mess up Wikipedia at certain times of day, the bee game is very monotonous throughout a given real-world season, etc – and it’ll be really interesting to see how their next games pan out.

Next, Dan Stubbs, the creator of unusual and potentially-very-impressive one-man game The Hit, gave an overview of the game to date and many of his higher-level artistic and design objectives, including (whether jokingly or seriously) the possibility of using cellular automata for beard generation, which rather puts my own paltry efforts to shame. After that Allison Parrish gave a really interesting talk about understanding and generating sentences via various dependencies and semantic/grammatical logics, and the weird things that systems using these types of data can produce, which is naturally very close to some of the work I’ll be doing on URR in the extremely near future as a conversation system begins to materialize. This was followed by Tommy Thompson‘s piece on the PCG infinite runner game he and his team are developing, Sure Footing, and a range of the player-side concerns they’re thinking about – difficulty, pacing, how people use different characters, variation and learning, and much more. And it has a very pleasing neon aesthetic, which should never be discounted. I also greatly enjoyed Tommy’s parody of academic ivory-tower behaviour, which is perhaps a little too close to the truth to be all that comfortable…

Proc2

The next talk was from Tom Betts, coder on Sir You are Being Hunted and various other highly intriguing games, and although we’ve chatted a few times in the past and he also gave a talk at IRDC, this really hammered home how similarly I think the two of us perceive issues around game design, procedural generation, games and/as/with art, game philosophy, player experience, and various other issues caught up somewhere in those fields. His talk argued for the value of procedural generation for its own sake, and as an artistic medium that doesn’t necessary have to be in the service of specific gameplay goals, but can be a goal in its own right in the creation of original/beautiful/compelling spaces for exploration, “sight-seeing”, and the like. He seemed just as interested as I am in trying things in PCG precisely because they haven’t been done before, and that that is an adequate and suitable rationale for committing time and effort in its own right. He also quickly went through a huge list of interesting games/quasi-games/experiences/things which embody this kind of rationale, and I’ll probably stick this list up on the blog at some point.

Proc3

The last talk was from @Thricedotted, who spoke about the creation of Twitterbots and offered both a lot of interesting high-level overviews and justifications, but also concrete examples of their own work at creating various bots and the outcomes they produce. A lot of people seem to be very keen on creating Twitterbots as part of ProcJam, and for those of you on Twitter that’s probably something worth keeping an eye on as the week progresses. It was interesting to note the importance of constraints and requirements, and the interplay between the two in ensuring outcomes that are at least vaguely intelligible, and the range between simpler and more complex Twitterbots that use the various kinds of available data out there.

After this we wandered off to a nearby pub, where conversations ranged over roguelikes, those old game helplines where you pay £1/minute for assistance with Mario 64, genre theory and genre definitions, the troubling preponderate of people with doctorates in the ProcJam talks attendee demographics, various upcoming triple-A games, the immense amount of time games like Fallout 4 demand out of one’s existence, the exciting growth of eSports as a cultural moment, what we were all planning on doing for ProcJam (if anything – to those wondering, I’ll just be working on URR as usual), game exploits and balance and fairness, our respective future employment intentions and hopes in the world of games, and various other topics which have probably disappeared from my memory overnight. It was also good to catch up with many other friends from the world of games/PCG, and after a certain point I had to make a move in order to get back to King’s Cross before the last train back. All things considered it was another great event, I highly recommend keeping an eye on the procjam hashtag, and that everyone should try to make it to next year’s talks, wherever they end up. Even though I wasn’t giving a talk this year I bumped into quite a few previously-unmet URR fans, which always warms my heart, so do come along and say hi some time!

Next week we’ll be back to our regularly-scheduled URRpdates, at which point I hope to have worked through most/all of the bugs and minor issues and so on that have built up to a near-critical mass at this point, and need to be resolved to give URR a level of stability before we continue to push forward with NPC coding. See you then!

Crowds, Slums, Pathfinding, Campfires, Demographics, Priests, etc

It has been a busy fortnight, with house-moving (in progress) and secret projects (almost ready to start) and programming (proceeding nicely) and various other endeavours (far from complete), but I’ve finished all ambient crowd behaviour, and a couple of other things besides. Here’s a pretty massive round-up of what has been happening in the last three weeks since the last full URRpdate:

Priest Clothing

I decided to work last week on a second of the four high-level clothing archetypes (feudal, nomadic, hunter-gatherer, religious) – the religious clothing. For this I did a standard expansive image search, collated a range of religious dresses, and then attempted to break them down into commonalities, differences, and readily exchangeable parts. The colouring of each piece of religious clothing, much like the prayer mats we saw a few weeks ago, are connected to the altars they worship at. The highest-ranking priests in the religion will have slightly snazzier robes, whilst if the religion has any kind of poverty-is-holy ideology or similar, they might have duller robes. Here is a set of six possible robes all using a potential “demonic” colour scheme (just since that’s the one I was testing the systems with, but how nice do they look?!), and then some with their attendant altars alongside (one “Eldritch” archetype, one “Pantheon”, and two “Standard”), and lastly an example of the higher tier of religious clothing reserved for religious leaders (hence the lovely gold filigree):

Priest Clothes

Altvest

Popeclothes

Priests use the same shoes as the nation they’re in, and usually the lower-class variation (though in some religions priests will be barefoot). With these done, that means approximately half the clothing generation for 0.8 is done – feudal clothing is 99% finished (I just need to put in a few final touches to the lower-class variations) and religious clothing is now finished. I’ll probably work on nomadic clothing next, as I have a few ideas of what archetypes I want to generate those around, then I’ll do hunter-gatherer clothing probably last before this version’s release. Armour and things like that will come later (0.9?) so for the time being, all soldiers and other military personnel just have lower-class clothing, or upper/middle-class if they are officers (which in the future they’ll probably keep, but just wear beneath their armour).

Slums and Encampments

The last few areas which needed handling for NPCs have been dealt with. NPC crowds now spawn, move and despawn intelligently in slums outside major cities, and also in hunter-gatherer encampments. Pictures of slum, and encampment, and example crowds:

Slumgi

HGcrowd

Remaining Interior Behaviour

All buildings which can have crowds in them (e.g. a tavern can have randoms wander in. but a royal mint cannot) now have those crowds behaving intelligently at all times, and – as far as I can tell – this is entirely glitch/bug/crash free regardless of what building, what civilization, what demographics the NPCs in question are, etc. Here are some examples of an arena and a longhouse, since I thought these were both rather pleasing, especially in the longhouse as people gather around the table:

Arena

Lonhouse

Pathfinding Problems

Some buildings and some parts of the external map were starting to produce a problem – if you had two NPCs (or an NPC and the player) trying to get through the same one-tile tunnel between walls, at the same time, then they couldn’t slip past each other. I implemented a temporary solution (whereby crowd NPCs will look for another objective if they find someone blocking the one-tile route down to their current objective) but this wasn’t good enough for the future, especially once we begin handling important NPCs whose paths cannot just be changed on a whim. So, now, if you have two NPCs who meet, and NPC 1 is trying to move onto the tile NPC 2 is on, and NPC 2 wants to move onto the tile NPC 1 is on, *and neither of them can find another way around* by stepping on a diagonal, and they would both allow the other to step past them (so they aren’t enemies), then the game will look at which one of them has the longest wait until their next turn, and then schedule a special “simultaneous” turn for them both to switch places at the same instant for that more distant turn (so that neither NPC can move “faster” than it should be able to). I’ve now implemented this to work indoors and work outdoors, so here’s an outdoor (filmed in “slow motion” to make it clear) example of this:

Switch

However, this became trickier when I wanted to combine it with the player. Clearly the player should be able to do this as well, but it required writing quite a hefty new chunk of code, for handling if the player tries to move through an NPC, or an NPC tries to move through the player, because obviously I don’t want to remove agency from the player, or allow NPCs to shove the player around the place (as that would get quickly annoying), but nor should the player somehow be able to exploit this ability to move NPCs around the map (I’m not sure how this could be an issue in the future, but it seems better to just produce a robust system now rather than worrying about it later). Either way, we clearly needed a way for NPCs to walk past the player if the player is being an ass and standing in the way:

Stuck

So, there are two scenarios: what if the player wants to move onto another NPC, and what is another NPC wants to move onto the player. It would be deeply annoying to allow the player’s character to be “pushed around” by other NPCs, so that was something I knew I had to avoid, but at the same time I had to ensure that you cannot exploit the system by somehow pushing around NPCs yourself. If an NPC wants to move onto the player, therefore, they initiate a special two-turn move, where the NPC takes two turns instead of one and “squeezes” past the player, taking both moves on the second turn – so from the player’s perspective, the NPC moves next to them on Turn 0, remains there for Turn 1, and then moves to the other side of them on Turn 2. If the player moves in the interim, then normal pathfinding resumes and the two-turn move is cancelled. (Of course, the two turn move only works if the tile beyond the player is free, the player and the NPC’s relations are friendly enough that the player would let the NPC get past, etc). Here’s an example, where I start off looking at the approaching slave, then turn to the other side, and sure enough the slaves pass “through me” using this special two-turn move:

flip

This also results in a message being printed, along the lines of “The [NPC type] squeezes past you”. The other version is; what if the player wants to get past an NPC who is blocking a one-tile area? An NPC blocking a one-tile area and standing *still* should be an impossible scenario – I am certain there are no areas which are valid for crowd NPCs adopting the “meandering” walking type which are also only one-tile wide – so if one encounters an NPC in an enclosed space, it’ll be if you and the NPC are moving towards each other and need to cross over. If the NPC “initiates” the move, we get the scenario shown above. If the player initiates the move, then the game looks at both the player and the NPC, does the usual check of whether they are allowed to move through or not (this might have to wait until 0.9, as it’s going to be a complex calculation – for now it just returns “yes”) and then, if so, it has the player move along with the obstructing person during the later of their two turns (so if the player is next scheduled to move on turn 18174, and the NPC on turn 18175, then both will move on 18175, so that neither character is able to have a “free turn”). You then switch places with them, as shown in this example, where I step into an NPC who I am friendly enough with to switch places, then I turn around (taking one turn) and we therefore see the NPC two turns behind me, and they then leave. Had I just stood still, then they would have initiated the two-turn move, going “through” me without forcing my movement.

Mymove

The three systems shown here also work when indoors as well as outdoors. These are all very rare scenarios, and I suspect will (for the most part) only happen if the player is standing deliberately still to try to annoy the NPCs, but it still needed handling. With all of this done, I am now… 99% that all NPCs of all categories, whether inside or outside, and whether dealing with the layout of the terrain, the motion of other NPCs, or the motion of the player themselves, should be able to path correctly past any obstacles (I think there is still one final minor non-crash bug here involving NPCs who have stopped to admire something, and if they have stopped in a “line”, then other NPCs may struggle to get past, but I’m working on fixing that one). As a last note on this, it’s also worth noting that in almost all cases I’ve worked hard to ensure every corridor/path both inside and outside is, in most cases, at least two tiles wide. However, in certain areas – slave quarters, some cathedral generations, slums, and a bunch of other places – one tile corridors can generate, so it was clearly important to handle these sorts of scenarios.

Also, now I need to at some point have you be able to switch your “walking style” from “walking” to “shoving” (or “pushing”, maybe?) so that in the rare possibility of a blockade (which I *think* should be impossible, as I’ve modeled spawning a bunch of NPCs on every tile in an enclosure and they’ve always managed to find their way out so far) you can always push your way through NPCs and force them all to move into the position you previously occupied, though that might not make them all that friendly to you. Nevertheless – and although I’m not even sure such a scenario can ever happen – it seems like an important addition which I’ll probably add this release, and it should be simple (note if there’s an NPC there, and if so, just switch places with it).

Campfires

Hunter-gatherer encampments now have campfires, beds, and tables. Only the fires so far have an image, but the beds and tables will be made of either wood or stone, and will get images before the end of this release:

Campy

We still need more variation and detail in these areas – a lot more, honestly – but hunter-gatherer areas now look slightly less bleak and empty than they did a little while ago (in the above picture you can see some stone chair/tables and a second fire). More soon, hopefully, though anything beyond tables, chairs and beds might have to wait until 0.9 or a little beyond. I’m focusing on feudal nations this release (although all NPCs will be present), and it’ll probably be the next release when I do more on nomadic and hunter-gatherer NPCs and societies.

Guards

We now have guards! Guards appear outside Parliaments, Mints, Embassies, Officers’ Quarters, Armouries, Mansions and Citadels in the middle of Fortresses, and also inside Banks and Arenas (the former to guard the vaults, the latter to keep the crowd at bay and make sure nobody interferes with the combat). The game also now notes every part of the map which needs a special “permission” in order to access it, and guards are tethered to certain permissions, meaning that if the player steps onto a tile which has the (‘Embassy’,24) permission and the player isn’t from the nation with the id# 24, then the guards will act – right now the game just registers this since the conversation system isn’t in yet, but that’s the plan. So, here are some guards doing their guarding thing (they currently wear standard clothing since armour generation doesn’t exist yet):

Majors

And then here’s a slice of the visual map, and the “forbidden” map, which shows the parts of the terrain close to the armoury door which will trigger the ire of the guards, so we can see that anything within the courtyard, and some of the tiles just outside the the gate, will trigger their ire (the guards don’t show up on this view, but as we saw above, the guards are basically standing just outside the gate):

Armo

So, now we just wait until later this release when I get working on a conversation system and the guards can accost you! More on this later once I figure out how precisely it works, but all the guards spawn, and detect intruders, and that’s all that matters for now.

Distance Demographics

The crowd’s demographics now vary according to the expansiveness of the nation in question. By this I mean – if the nation is small, then all people spawn with the genetic demographics (skin tone, hair colour, eye colour, etc) of the capital, or nearby. If the nation is large, the game will sometimes look for a random tile in that nation’s territory to choose the demographics from (which is to say, if you’re in the capital city it’ll normally be a “capital person”, and sometimes someone from further out; if you’re in a town, it’ll normally be a “town person”, but sometimes someone from further out) and use those to spawn the person instead; and if the nation has colonies it’ll do the same. This means if you run into two people in a nation with the same cultural demographics (clothing, hairstyles, etc) but very different skintone/hair colour etc, then you can reasonably deduce that nation is either very large, or has some colonies somewhere. Here are two examples of this kind of crowd, and the latter you’ll note has a priest leading some followers (the priest of course now spawns with the right robes). Rather annoyingly I wasn’t able to quickly find a nation which had colonies/homelands with skin tones at the two extreme ends of the spectrum, but you still get the idea from these of a lot more variation in the larger and more expansive empires:

Mixcrowd

Mixcrowd2

Another thing this has got me wondering: in future versions (0.9 or 0.10 onwards) all the map except your home nation will be in shroud when you start. Should colonies be “lit” or not? I think the best solution is that colonies don’t start as explored, and if you take a ship to one of your own nation’s colonies, perhaps all the colony land is then revealed when you arrive? In contrast, normally, you’ll just explore the tiles around you as you move, and if you take a ship, it will perhaps show you the ocean path you move along? That seems like a good compromise without having a situation where you start with a few chunks of the map explored which are disconnected from your nation’s homeland.

Lesser Houses

I’ve now implemented the first stage in generating families/houses which are less important than the small number at the top of each civilization (one of which, of course, belongs to the player) but are still noteworthy. In nations with the “Vassalage” ideology, one of these families will have a special “Manor” building spawn in each town in that nation, and a family rules each of these manors and therefore each town. In Vassalage nations the other smaller buildings in upper class districts will also belong to these families (so they have a manor, and a home in the capital), whilst in non-vassalage districts these buildings will also belong to second-tier families, but not “special” ones (as in, rich merchants or whatever, not those with direct feudal/political power). However, for the vassalage nations, these all needed coats of arms! So, I’ve returned to the sigil generation system and added in the ability for “lesser” houses to have coats of arms. These are much simpler than the major houses, and have a geometric pattern determined by the aesthetic preference of their nation (octagon, square, circle, cross, diamond) which feeds into an algorithmic sequence that combines various elements (I’ll also add a system ensuring there can’t be more than 5 vassalage nations, and they can’t share a shape, to ensure variety across the game world). Now, bearing in mind of course there are meant to be for lesser/more general houses… what do you think?

Subthings

Compare, of course, with some examples of important families:

Majors

So what do you think of the minor ones? Good, bad, too little detail, too similar, just right…? Of course, they still need mottoes, and I’m thinking of having it tether them to the towns they’re from in some way (or perhaps these lesser houses don’t have mottoes?).

What next?

Next up I’ll be working on adding more “fixed” NPCs like guards – so this means tellers in banks, priests in religious buildings, servants in mansions, officers in officers’ quarters, delegates in parliaments, and so on. This week is probably also going to see a little bit of reworking of some aspects of world generation, since I need to add in a system for vassalage nations to generate and track these other houses, and for parliamentary nations to figure out how many delegates they should have (I have a cool system planned for this), and I might add in the new “Monastic” religious ideology I’ve been thinking about for a while too. Either way, I’d say we’re about 75% through NPC mechanics at this point, and in a fortnight or so I think everything with NPCs should be finished, and then we can move onto the other massive part of this release – conversations. See you next week!