Post navigation

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):

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:

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:

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:

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:

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:

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.

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:

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):

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):

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:

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?

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

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!

This is very impressive! I like how all of this is slowly coming together, the end result will be brilliant!

The lesser housings coats of arms do draw similarity to the major ones in some sense. I don’t know if this is of major importance or not though.

I can’t help but always think of and old PC game Arcatera – The Dark Brotherhood in which the plot is to uncover a conspiracy taking place within the games central city (Senora). The game itself was awkward to play but I spent hours on it none the less simply to wander around the place and gawp at the npcs. The overall progress of NPC’s is looking fantastic!

Thanks! I was hoping they’d be similar, but distinctive, so you should always know when you look at one whether it’s a minor or major house, since I like that kind of visual clue a lot (and URR is/will be full of them). I have never played that, but that sounds interesting! And uncovering a central conspiracy, interesting NPCs… sounds familiar : )

First of all I’m wondering, how it looks when a priest in a red robe prays on a red prayer mat in front of a red altar. Obviously that’s the extreme case, but I’m just thinking about, whether the colourpattern is going to be overkilled at some point.
I just imagine walking through a church/temple and everything being painted in more or less the same way. Maybe a smaller church or religious believe group wouldn’t be able to afford everything in their patterned style and they’d just have one really precious altar/sanctuary and the rest would be just standard prayermats or wooden benches.
It seems to me that this is a question of immersion vs. gameplay, since having to less clues obviously could lead to player frustration and having too much could be just – I guess – too much?

For the coat of arms/emblems of the lesser feudal houses, maybe it’s an idea to make the paintings on it a little bit smaller? Right now – in my opinion – besides the one in the bottom right, they kind of look like a drawing from or for a child.
I assume your decision to make them look less “distinct” is based on the idea that players can easily recognize the importants of a house.
I’m not really sure whether in history great houses had “greater”/more-impressive coat of arms than those of the lesser important ones, I think the house did great things and so the coat of arms got more renounced.
That’s why I guess the lesser one in the bottom right appealed a little bit more to me, because it reminds me of the templars.
On the other hand having a dragon on the coat of arms, should kind of mean that you kick ass. (At least maybe your family kicked ass at some point in history?)
Anyway seems again like immersion vs. gameplay again!

Keep up the weekly Updates, it’s really something I look forward to every time.

Hey! Interesting point about colour pattern, though since you’ll never be ‘l’ooking at them at the same time, and I think it’s important to give religions consistency, that’s ok. Also, some parts of religions – like incense holders, or statues, or vases, and so forth – aren’t actually tethered to the exact same colour set, so there’s some variety in there too. Interesting point about poorer places not being able to afford them all; it’s a great point, but adding in variations of everything for home altars, say, instead of those in churches… quickly gains an extra amount of work. I think I’d rather have fewer of them (so a house only has a prayer mat, say, and another else) rather than give them everything, but lesser versions of everything.

As you say, I don’t think there was historically any difference in detail/quality, but again, a gameplay/recognition thing. Interesting points though all around – I’ll have another look at the lesser house sigils and think about that.

Just a little add/question.
Isn’t there some potential in the stories of the smaller houses? Some people (I can see myself being included here) could be similarly intrigued by houses that were once great and lost their powers in the present, or just were small all along but where decisive in one important battle of the nation.

I think my stands defending/pushing the smaller houses because I enjoy reading historical fiction so much and in most of them the really interesting stories sprout from smaller houses or unimportant people gaining power and influence over time.

In the grand scheme this might be a small point though considering it’s only about a part of one of something like 10 different nation types, so don’t get lost in that, because of my taste of literature.

I think/hope so – I’m still figuring out now precisely how all the different major families in a given civ are going to work, what kind of impact they’re going to have, what kinds of interactions will be possible with them, etc. So we’ll know more about the answer to that question soon-ish! I do see your point through about the new house trying to gain power rather than the continuation of the existing power structure… we’ll see!

perhaps not all the maps should be shrouded maps! – cultural development and relations between cultures coupled with literacy & study-time or time-spent conversing with people from foreign places could/ought-to progressively inform the player about distant places.

maybe just the ‘lay-of the land’ as in districts and the main roads, perhaps the details of common areas gleaned from materials in embassies.

i bring this up because it would be ‘unbelievable’ on many levels (for me i guess) that i could infer so much about different cultures, even visit their embassies, that i would travel to distant cities without having any clue about where the things i might have heard about (implicitly) or am explicitly looking for are.

this may or may not be a case for a drawing skill, a map-inventory/memory, a gps-ie route-planner (perhaps not, as i’m still completely unclear how i, not as the player, but as the avatar, will know what i know) .. but at least, going to paris, i would roughly know the location of the eifel-tower while still on the boat!

again, i dont know how or even if the avatar will know what he knows – or if the game will demands the player have all that knowledge in memory (using his note-taking skill.)

‘d appreciate your thoughts on how you’re planning to keep ‘the learning’ and/or ‘my speculations’ about the world within the game.

You’ve raised a lot of tricky questions – player knowledge vs player character knowledge, in a game which is going to be all about knowledge. I see two solutions – first, learning something makes it appear on your world map, so once you learn about a certain landmark, that landmark is “pre-explored”. Secondly, learning something does not make it appear on your world map, and things only appear if you visit them, so when you view a “map” item (not the world map you can browse) you have to compare it to the map you’ve explored. Or, to put it another way, when you acquire a map item, the game doesn’t automatically tell you where it fits in. You might be told the map refers to the north, or the south, or a particular nation, but those aren’t automatically overlaid.

So right now: I’m not sure what the best idea is, but I think I like #2. Or maybe there’s a difference between buying a map – which is its own item – or having an NPC actually draw something on your map, which will always be accurate? That might be a way to ensure you know about things you “should know” but still maintain an interesting game of figuring out what each map means.

The crowd scenes, especially the one with the priest and his entourage, start to make the world seem really alive. Great job!

I’ll second Frido regarding the Lesser House CoAs – the central designs should leave a bit more space to the edge of the shield. If there was at least one “pixel” between a central shape’s outer edge and the edge of the shield at all times, they’d look better, I think. The complexity is okay, in my opinion.

Concerning the priest clothing and the effects of a poverty ideal: I’m can’t think of any real world religion in which the top ranks dress more plainly than the lower ones. Even if they’re hostile to ornamentation, I believe there’s usually superficially a “sidegrade” where all ranks dress the same, if there even are ranks (say, Calvinists?) or the plainly clothed ones are outside the hierarchy (say, skyclad Sadhus) and are more holy men/charismatic exemplars then priests. I’m not an expert on the subject though, and anyway it’s no big deal, just what went through my head.

Awesome! Glad to hear it – and got it re: space at the edge of the shield. I’ll definitely go back to them this week and make a few changes.

Priests: no, indeed, that would never be the case; the lower ranks would just be even more poorly dressed than the upper ranks! Right now, standard priests use the “low” rank, then inquisitors and archivists have the “middle” rank (which I actually didn’t show here, but which have silver instead of gold lining) and then high-ranking clerics have the gold lining. I’m not yet sure how heretics and sects are going to work though, and as you say, maybe some kind of “sideways” robe is what we’re after? I’ll have to ponder it…

Should you enter an alternate universe and find yourself with time to spare, I think it would be cool if you could animate the campfire graphics. Based on how the static fire picture looks already, I think that could be quite pretty. Would be an interesting thing to attempt and gain experience in as well, if you haven’t done such a thing before. Just a random thought I had.

I’ve got a question concerning houses mottoes. Are they going to influence the house actions? For example, if a house has a motto like “Gold is the answer to all questions” – are they gonna hoard gold and be more like merchants than, let’s say, warriors?

As for the sigils, what if you just make them…smaller? Because i don’t think i could tell the difference between them as it is now.

Er, yes, that is the plan! Mottoes should have at least some relationship to how they act. Smaller? That’s tricky with the limitations of ANSI, but when I look again at the lesser house sigils (see the above replies) I’ll ponder that too.

Wow, you’ve made a lot of progress since the last update. The robes and the new heraldry look good — I like how the less important the family is in the hierarchy, the more abstract their heraldry. They might not even need mottos, which might seem too self-important for the ruling families to tolerate…especially if said ruling family has the motto ‘WRATH WITH FEROCITY’. And yes those Demonic-style robes certainly are snazzy…I’m sure that’s a big selling point for the Demon church when they’re proselytizing.

Looking forward to seeing how conversations function. I’m sure it will be a big challenge to implement, but I enjoy seeing the development of URR evolve on this blog.

Thanks! I’m also considering going motto-free as another way to identify them from the greater houses; that might work fine, actually. Oh yeah, you wouldn’t believe how popular the demonic church can be!

Conversations: yeah, it’s going to be the second major challenge (I’d call the first one world generation per se). It’s going to be huge, but I feel I’m moving towards a good idea of how it’s going to work (though there’s still maybe a month of NPC work until we reach that point? This release is going to take a while but it’ll be huge!)

When you implement the dialogue system, I think it might be helpful to look at the dialogue systems of some other games to see the breadth of possibilities available to you as a game designer.

My personal suggested system to research is the one for Morrowind (Skyrim and Oblivion probably have a similar but much more advanced one, but I’m familiar with Morrowind’s). Since the Elderscrolls games all have game editors packaged with them, you’d easily be able to research how they work.

In Morrowind, the dialogue system has a table of prioritized topics available to any NPC which passes the topic’s filters (for race, guild membership, PC’s skill level in alchemy, whatever set of random little variables you want), it has access to the games scripting system allowing dialogue to easily cause effects on the world around you or change global/local variables or progress quests through a quest tree.

Since your usage would be highly influenced by PCG concepts, I think a robust dialogue system like this could be a powerful world building tool for you.

A lot of people have suggested looking at the Morrowind’s system and it’s definitely on my list of things to do. That’s very interesting about the dialogue and the scripting system, which I think would be extremely useful in my context and allowing the outcomes of conversations to feed back to a system which then makes appropriate changes based on the data it receives from the conversation data. I totally agree though, as many others (and myself) have noted, this is going to be huge and integral, so I need to ensure it’s big, robust, easily added-to/changed, and improved. To Morrowind with me!

Morrowind is a lot of fun. Maybe you could try the OpenMW engine! Any way, I think looking at other games for conversation ideas is a brilliant idea. So many games do it poorly and there are so many different ways to do it. Please have a look at Emily Short’s text game, Galatea. It is all conversation with one NPC and it is fantastically well done.

Regarding maps, interesting questions and discussion. One of the things that bugs me in games, but seems necessary in most such engines, is that everything is seen from the same distance. A mountain, an ocean, city walls, castles, and roofs of buildings – all are discovered with the same adjacency as people, and doors, and piles of loot. In real life, I know that mountain is out there because I can see it, but have no idea if there’s a city or forest in the distance between me and it. I can see much further in the ocean. If I look at a map (even a bad map) I have an idea of the shape of continents and rivers. In some games one has no idea if it’s a river or an ocean you’ve bumped into, which is rare (but not impossible) in real life – only a few rivers can’t be seen across their widest width. (Excluding lakes and swamps!) But I haven’t come up with a good way around the gameplay/engine problem to have any recommendations, especially in a roguelike, so is just an observation.

For the heraldry, I also think you could get away with just background fields and few/no devices on them for low families. Isn’t the historical point a recognizable battle flag/shield paint as the background (like a flag) plus devices and symbols to recognize accomplishments (dragon slaying) or status (royal heir) approved by the crown? It’s easy to correlate more recognition with more power, especially in a game.

Heh, thanks! I try. Maps: a bunch of very interesting points. For the time being on the world map as you explore new territory (when I enable the territory-exploring stuff, i.e. not having the entire map pre-discovered) it does actually let you see distance objects and things depending on the z levels of each world map tile. I think once the world map does start off unexplored (not 0.8, the next release, but probably 0.9?) I will actually consider how exactly this should work, the ability to see different objects, etc. Heraldry: interesting! I’ll give that a whirl and see how it looks.