Inside Behaviour, Housing Districts, Prayer Mats

This week I’ve worked on some new graphics, on a lot of the AI for interior behaviour, made some alterations to a district generation system I wasn’t happy with, fixed various bugs and minor issues, and moved closer to the point where I can confidently say all crowd NPCs are working correctly. First, though, I must give my appreciation to one James Patton for this extremely kind and very thoughtful write-up – he has (or “you have”, if he’s reading this) hit the nail on the head with my objectives, my design philosophies, and basically everything else, and that’s always very gratifying to read. Also, if you fancy some other roguelikey reading, I’m building up quite a number of roguelike pieces – I wrote for KillScreen about the demonic enemies in NetHack, for Paste Magazine about the 35th Anniversary of Rogue, and for Imaginary Realities about the role of text, characters and letters in roguelikes (and URR). Also, on a non-roguelike note, I wrote two pieces in the latest issue of Five out of Ten, both on Command and Conquer, specifically about the portrayal of civilians and ecological disaster – if you fancy giving them a read, head over here. The magazine itself is beautiful, and gets criminally little attention for the amount of effort which clearly goes into it (and I don’t just say this because I’m in this issue) so do give it a look. Hope you enjoy giving them a read… and now, onto the update, which is rather more substantial than last week’s paltry offering:

Prayer Mats

I took a moment this week to do some graphics, and decided to finally implement something I’ve been meaning to for ages: prayer mats. Some religions now use prayer mats in their religious buildings instead of chairs, and the design of these mats is dependent on both the religion, and the civilization the religious building is found within (so religions across many nations will have similar, and aesthetically comparable, but slightly different, prayer mats across nations). The colour scheme is based on the altar, as shown in the three examples here, and the shapes (squares, octagons, etc) are down to the nation, whilst the specific layout of shapes and symbols, and obviously the religious symbols, are down to the religion. Here are some rather nice examples:


And some prayer mats in a religious building and a cathedral (note that the colour of the maps vary based on the actual mat colours, though now ‘=’ can’t be used for anything else!):



Further Interior Behaviour

This week I’ve done a lot more NPC interior behaviour. There is still a little bit which needs doing, particularly with special cases – NPCs going into banks should talk to the clerks, for instance, just as NPCs in hospitals should go and sit by the bed-side of someone they know, etc, but a lot of these actions are now working very nicely. In a cathedral, for instance, I just sat by and watched as NPCs came in and prayed at the altars, sat on the chairs/prayer mats, looked at the relics, admired the cathedral’s decoration, talked to one another, sat down to study the holy texts, etc. Here is an awesome gif of this which is neat enough to watch to the end, I think, of various people in this cathedral (the one above) doing these types of activities:

CathWorshipNext up was the gallery. As with all buildings, I’m leaving the “permanent” NPCs until last – so worshippers will wander around a cathedral, for example, but there are no priests there yet, as they will be tethered to that building and a particular routine – but here we now have people coming in, admiring the paintings, and showing themselves out again. Painting generation will happen when I swoop in and redo the history generation from the fairly simple system there is now, to something which truly encompasses every piece of information in the world, and begins to lay the foundations for sneaking in clues to the game’s central cultural cipher. Anyway, the gallery:


By the end of next week I hope to have more interior algorithms finished, and by the week after, they should all be done (this week is GDC Europe and Gamescom, and I’m attending 100% of the former and ~25% of the latter, so that’ll be taking up a bunch of time). At this point I’ve implemented some general code for all buildings, and now it’s a matter of going into every building and checking the code actually works there.

Middle-Class Rivers

I suddenly noticed that under the new generation algorithm for middle-class districts, when a river goes through them, they don’t look very impressive at all, and we end up with something like this (with the issues ringed in red where multiple “bridges” seem to overlap:


This wouldn’t do, and it just looks rather dull, so I rewrote this algorithm into producing something rather more interesting, so here’s the same district using this new algorithm which encourages the river to flow around/past major roads, avoid smaller ones, and to then design the rest of the roads differently and place buildings/parks a little differently in order to accommodate the river. Here are two examples with a “corner” river and a “long” river, from the same city (note that the shapes of the corners and the roads sometimes change – I set it to randomize that aesthetic choice each time I generated an area so I could make sure the new system always worked):

oubleriv neriv

Other Small Changes

A number of other minor changes have also been implemented this week:

– Colonies can now only be established with nations with the “Imperialist” ideology, rather than all nations which are not “Isolationist” (which it was until now).

–  An extremely unlikely edge case involving rivers and lower-class district generation has been fixed, ensuring you never end up with a part of a district that cannot be accessed without entering the district from another angle, due to the river’s location. See below:


– Each NPC’s face is now tinted fractionally to add further diversity within nations – everyone’s faces are tinted a tiny bit (between 0.03 and 0.06%) towards yellow, orange, red, white or black at random. That might sound tiny, but the difference is noticeable.

– Roads are now grey merged with just the tiniest bit of brown, and all skin-tones are now very easy to read on it. However, others do struggle on the “soil” terrain type, so I’ll fiddle with that too (probably make it a little more green, perhaps). Equally, chairs are made out of wood – with colours that range from light brown to dark brown – and therefore chairs, in some cities, do tend to blend a little with the populous. Again, considering solutions, but I might tint everyone’s skin tone a fraction to the red.

– Fixed a thrilling bug where chairs sometimes decided to spawn in the empty void of nothingness outside the map… and then NPCs wanted to sit on them.

Next Week

As above, I’m flying out tomorrow and returning in a week, and I’ll be doing lots of GDC stuff. So… expect either a shorter update, or a non-URR update, depending on how things go. See you then!

Be Sociable, Share!

35 thoughts on “Inside Behaviour, Housing Districts, Prayer Mats

  1. Excellent post and progress! I just have one concern—don’t the rivers in middle class districts look a bit unnatural now, what with their sharp angles and such? I guess if interpreted more as canals in the sense that some terraforming has taken place, it would make a bit more sense, but even then it seems unlikely for them to have so many corners.

    • Thanks! See partly my reply to James, but I do indeed see them as more like canals, or at least rivers which have been forced down a particular route. I am glad to say some variations have fewer corners, too!

  2. Hi, I’m so glad you liked my writeup, thanks for mentioning me! 🙂 I also read your Nethack and Demons piece – it really got me thinking about how demons in literature and myth are usually portrayed as these untrustworthy entities who make shady bargains with the protagonist, but in games they’re usually just a big, horned thing to kill (thinking of Diablo specifically).

    I’m very excited about the addition of NPCs and their behaviour! That was the one thing that felt most lacking in the build I played: the game was a big empty world with all this detail and no inhabitants. Very excited to see all the different permutations of citizens and how you can interact with them.

    I also love the middle class rivers – making them angular suggests these districts are wealthy enough to dig canals to their liking, in comparison to the poorer districts which just get normal rivers. Like Vincent says, though, I think canals are generally longer and straighter?

    • You’re welcome! I appreciate the effort you put into the piece – it’s great when someone so clearly “gets” the project (and that’s exactly my thinking about demons and the possibility of a rather more nuanced/sophisticated portrayal, which – despite the flak NetHack gets for other reasons – I think it really achieves). I completely agree re: NPCs and the empty world. It has been one of the final sticking points with the detractors of the project on the “WHEN’S GAMEPLAY?!?!” brigade, and hopefully this will begin to silence their dithering (or at least reduce it in volume). It’s the start of August now – within no more than a fortnight I want to have all ambient NPC life finished; then a week on special NPC life (so things like festivals, rituals, having people actually attend the arena when there’s a fight on, etc), and then NPCs tethered to one building/schedule (e.g. priests) and then I’ll be moving onto handling important NPCs, which will be tough. Glad you like the MC rivers – that’s exactly my thinking, they aren’t quite as “perfect” as the upper-class rivers, but it’s still clearly built. That’s true re: canals… but I’m not changing the damned thing now! (Though in fairness, there are some less bendy variations than those screenshots)

  3. I can understand the need to rewrite the algorithm of middle-class districts, but the rivers seems quite unnatural without any corners, it’s a bit strange. But maybe the people wanted to make a canal out of it, so yeah it makes sense if you see it that way .So that’s why lower-class district kept river’s “natural form” ? Are they too lazy to build something like that hu?^^

    Anyway, good updates as always.

    And chairs spawning in the nothingness seems quite cool to see. Void chair from another dimension followed by hordes of NPC that ABSOLUTELY wants to sit on it.

    • Maybe some kind of small barrier at the sides of it would be nice, like marking the channel.

      Anyways, this time’s article was excellent! Hyped for more.

    • Yep, canal! And the lower-class districts are too poor to improve the river in any way, so they just have to leave it on its original path. Ah, the pains of social stratification. Heh, yes, I suppose you could see the void-chairs as being rather neat… until an NPC decides to path to it and the game crashes :\

  4. Great work on the prayer mats; along with the altars & relics, religious buildings will have lots of interesting things to explore in-game (& now I want an eldritch-style prayer mat*). I’m looking forward to unique artwork generation in galleries; imagine exploring to locate a specific painting in a specific gallery in a specific city as part of an investigation into hidden symbols, or comparing two ‘identical’ pieces of artwork that have subtle differences to see what’s changed! Very exciting.

    As for Command & Conquer…last week I played through (or more accurately ‘suffered through’) the single-player portion of C&C 4: Tiberium Twilight. After completing the Nod campaign I uninstalled that monstrosity from my hard drive as fast as I could click ‘Delete Local Content’ on Steam. What a sad concluding entry in an otherwise great series. And I hadn’t heard of the ‘highest scores’ marketing campaign for C&C 1 that you brought up in Five out of Ten. Yes, it’s a clever way of making one think about what ‘high score’ means in a game with soldiers and civilians, but as an advertisement during a time when violence in games was a source of so much hysteria (think Mortal Kombat)…what was Westwood thinking?!

    *Random idea: could procedurally-generated artwork/designs/objects in URR be exported, so if a particularly good design captures the interest of a player, they could have it available as a reference for shirt designs, 3-d print modelling, etc?

    • Thanks, glad you like ’em! Yeah, I’m trying to really put a lot of detail into religious buildings – they’re one place where two of the major “macro” aspects of the game world intersect (cultures and religions) and I certainly want to get the most out of that. I can’t wait for the artwork generation! And of course, they’ll have hidden symbols, secrets, tiny pieces of clues and riddles, and the like… I think we should reasonably look for paintings in 0.10. I’m working on 0.8 now, which is NPCs and conversations; 0.9 will be a shorter release to handle things like trade and travel; then 0.10 will probably be the first major integration of the game’s central cipher/riddle/mystery, so at that point I’ll be thinking about paintings (and statues too). At some point I’ll also do the plant generation, since it really bugs me that there aren’t any graphics for those…

      Anyway! C&C4 is, indeed, an utter monstrosity. It shouldn’t be allowed. Everyone who worked on it without quitting in disgust should be tried for crimes against humanity. Re: the ad campaign, I know! It’s insanely bold (but, honestly, I have to say I actually think it’s quite clever, even if it does generally elicit a sharp intake of breath once one figures out what the advert is “saying”). Random idea: I love it. I’d actually like to develop some kind of URR stuff to buy in 2016, and I think some idea of that sort where you can “send in” a particular design you liked for printing is an awesome one. Come 2016 I’ll look into options and report back!

      • Heh, I actually never played Sole Survivor – I wasn’t really a multiplayer gamer in the slightest until the days of things like RA2, Halo 2, etc. Dial-up match making was bloody confusing to a 5/6/7 year-old!

  5. “don’t the rivers in middle class districts look a bit unnatural now, what with their sharp angles and such” –> I thought the same thing. Perhaps some very advanced civilization could change the natural flow of a river, but most likely, the city will be build AROUND the river like it is, and not the river be flowed after the city is made…(not sure if i’m clear on this point).

    • Oh yeah, generally true; I guess this is an example where a) I’m thinking of it as more akin to a canal, but also b) I’m willing to sometimes do away with “absolute realism” if I think it’ll make the world more interesting!

  6. Hello Mark! Hum, I’m not going to make a comment about this entry; I want to ask you, weapons are still planned, or URR it’s going to be some kind of exploration game? I’m confused…
    Thanks n.n

    • Hello! Well, by the end of the next 12 months this will be very clear, but the best answer I’ve given is this one, which I will now copy/paste in. Basically, the game is going to be about information. You are seeking to locate a very small number of items scattered around the world; to do so, the more the player understands the world, the easier this task will be. This means conversing with NPCs, examining books, coming to learn about the cultures/religions of that world, the history of various nations, exploring and gaining access to buildings, and plotting your path around the world map to “track down” these items. It’s almost a… research game, one could call it? The world is insanely detailed (and only becoming more so with every release), and it’s the close examination of the world and figuring out the paths these artefacts have taken, and who may possess them now, which will be key to success! But for this to work, the world must be in place first, hence the worldbuilding focus up to this point…

      So weapons? I’m honestly not sure. I think it could be even more intriguing/original/different without weapons, but at the same time, I fear no-weapons will put people off, and might seem a little historically peculiar. So, honestly: I’m not sure. This release is entirely about NPCs, the next release is travel and currencies and trade and that kind of thing, so I have a few months yet to reach a final decision.

      • Well Mark, what can I say? It’s always cool to kill people, but an treasure hunt it’s awesome too. If you keep the conversations really rich, I guess it’s okay.

        In fact, weapons or not, I’m hyped as hell to see this game in it’s final form 🙂

        • Conversations are going to be rich AS HELL (I believe that is the technical term). Still figuring out how the conversation system will work, though, but it’s going to have a huge amount put into it, and I still have a good month before I need to work on it to figure out how precisely to develop it…

          • I am excited to see how it turns out. I was playing Pillars of Eternity the other day (because I am an old salt who is trying to wring the last bits of glory out of the golden RPG years) and thinking how un-interesting the dialog was in that, even though it was voluminous and thoroughly couched in the game’s lore, such as it is. I think the conversation system might be the central design challenge of this game, if that is not too presumptuous. Giving data without making characters databases, in a procedurally generated world, means you have to position a fulcrum very carefully. Conversely, procedural generation can take some of the edge off that too, I think. DF sidesteps alot of hard design choices by sublimating them in the use of very “wide” algorithms that generate interesting content in a quirky, stochastic kind of way.

            Warfare and combat are very rich cultural and social activities, but you can explore those without a combat system… through chronicles, or various abstractions of war between nations etc. etc.

          • > I think the conversation system might be the central design challenge of this game, if that is not too presumptuous.

            I completely agree (or at least, one of the two/three central challenges, with the other obvious one being the distribution of the “clues” through-out the world). As I think I might have mentioned o the blog before, I’ve scribbled down ideas for a good half a dozen systems, but I’m not completely happy with any of them so far. At the moment I’m leaning towards something with several “axes” – so you can say something in various tones, and use idioms/terms/greetings from any culture, etc. As you say, DF uses wide “Can you tell me something interesting?” style questions, which I think I’d prefer to avoid… but it’ll be tricky.

  7. “The chairs of limbo” – that’s quite the amusing bug. “Everyone wants a seat there, but only high priests can actually obtain such honor.”

    I second the oddity of square 90-degree rivers, they look more like blue roads at the moment, but I like the new bridges. But not a critical issue.

    Great work, keep it up! Thanks for the links to the articles, too.

  8. I just wanted to let you know Google kept trying to tell me that this site is dangerous and has malware. You might want to talk to Google about that because it will probably scare people away.

  9. Pingback: Crowds, Slums, Pathfinding, Campfires, Demographics, Priests, etc | Ultima Ratio Regum: The Roguelike

Leave a Reply

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