• Register
Post news Report RSS Inside Behaviour, Housing Districts, Prayer Mats

Procedural prayer mat generation, more interior NPC behaviour, redone housing district algorithms.

Posted by on

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, if you fancy some other roguelikey reading after you've read this entry, 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). 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:


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



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!

Post comment Comments
Choders
Choders - - 28 comments

This is incredible progress you've made, and always consistent with the updates. Can't wait for the game, keep it up man

Reply Good karma Bad karma+4 votes
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Thanks! I greatly appreciate it :).

Reply Good karma+1 vote
yhoyhoj
yhoyhoj - - 67 comments

These zoomed-out views of districts are always impressive. Good progress overall !
And personally , I found the last week update not that "paltry". The technical side is also interesting.

And as usual, a question :
Will you add special events which would attract more NPCs to certain places ? For example a sunday mass in the cathedrals and churches or a special feast organized by a noble family ?

Reply Good karma Bad karma+2 votes
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Thank you! I'm glad re: last week, even if I don't generally think that the technical side is all that interesting for myself. An answer: yes, that is 100% planned. After I finish general ambient NPC life (a fortnight, maybe?) I'll then be moving onto what I'm calling special ambient life, which is precisely that kind of thing: going to the right religious buildings on the right days, etc. It's coming soon!

Reply Good karma+2 votes
SafariJohn`
SafariJohn` - - 197 comments

I like how the river in the middle class district goes at right angles like it's been rerouted, but the complete loss of the nice, natural curves is bad. A mix of both would be best, I think.

In regards to that lower class district, I kind of like the idea of the rare district that is completely divided into two sub-districts, but I understand why you want to avoid it.

Reply Good karma Bad karma+1 vote
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Hmm, thanks for the comment; I'll see if I can handle that somewhere. Heh, I did consider the same about the lower-class districts, but I just felt it ran the risk of being deeply infuriating to the player who can see the thing they want to reach but has to leave the district, find another path, unload, reload, and go back in!

Reply Good karma+1 vote
Guest
Guest - - 688,627 comments

The district in the image would work if there were two entrances on the south side, but that would open a whole other can of worms.

Reply Good karma Bad karma0 votes
SafariJohn`
SafariJohn` - - 197 comments

Whoops, wasn't logged in.

Reply Good karma Bad karma+1 vote
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

Yeah - there's always a reasonably complex-ish system in place for choosing gate locations across districts, and handling rivers... so I don't want to mess with that!

Reply Good karma+1 vote
B.R.V
B.R.V - - 96 comments

Wont it be less buggy to place bridges first, then main roads connecting the gates through bridges and then buildings\blocks\minor_roads? I think that would solve the multibridging problem.
Or is it the exact way the system runs at rhe moment?

Reply Good karma Bad karma+1 vote
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

It would, but that would have actually required an equally large re-write of the code, just due to the nature of the order in which this particular kind of city district generates its roads/buildings/etc :\

Reply Good karma+1 vote
Vladiskov
Vladiskov - - 384 comments

PErsonally you should let the lower class bug happens, think this: that part of the district is the lower lower part, and are even severed off from the main district XD

Reply Good karma Bad karma+1 vote
UltimaRatioRegum Author
UltimaRatioRegum - - 307 comments

That's what the slums are for! Which reminds me, I need to check NPCs walk intelligently around slums...

Reply Good karma+1 vote
Vladiskov
Vladiskov - - 384 comments

i hope to see something akind the bug, but with onle one bridge in the river, that would keep a segregated slum off the main one specially in highly racist societies :D (like in a religous country with several religion from another places of the world)

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: