Post news RSS Conversations, Relations, and Alcohol

Major URRpdate on conversations, international relations, animals, speech, relics, responses, oh, and PCG alcohol.

Posted by on

A big update this week, summarising everything from the last three weeks of coding work. Succinctly, the game now has NPCs who can reply to even more “list questions” than they were previously able to, adds in what I am calling “meanderings” into speech from time to time in order to make everything feel and read more realistically, boasts a rather more developed international relations system which NPCs can draw on when making comments to the player, and procedurally generated alcohol is now present in the game. This last one is, obviously, the most crucial of the bunch. Oh, yes, and I’ve also expanded and finished the system for generating the names of relics, although their procedurally-generated images are of course not yet present. So without further ado, read on:

More List Questions

I have now finished off almost all the “list questions” – which is to say, questions where the answer often takes the form of a list, such as “What towns are nearby?”, or “What animals are sacred to your people?”, and so forth. Here are some examples of the recent additions:

Animals and Plants

You can now ask people about the animals and plants that are local to their homeland, and whether any animals or plants are considered especially important in that homeland, as part of your conversation. They’ll now give you a list of the local flora or fauna as appropriate, which is always grammatically correct, and also lists these things in a fairly logical order. The number is never too high, either, so you never find yourself reading through a gigantic list of things. Although not currently implemented, in the very near future these animals and plants will be spawning, and should be found referenced throughout a culture, and are designed to be another clue the player can potentially use to find out about the world.

International Relations and Geography

The game can now generate appropriate and logical sets of relationships between nations, based on their ideologies, religions, proximity, and so forth. You can now ask people about their relationships with other nations, what they think about other cultures in general, what kinds of cultures are nearby, what tribes and nomads can be found nearby, and so on. The same system is then used for overall geography, so you can now ask a range of questions about things that are near to where the player and an NPC are having their conversation. For example, you can ask whether there are mountains (or mountain passes) in the proximity, and so forth. These questions then redirect to a function which chooses an appropriate area for the NPC to have knowledge of (more educated NPCs will have a wider area, and NPCs more well-disposed towards you will think about giving you a longer response). This system needs expanding to all kinds of conversations, which I will talk about more in the future, but for the time being, people can tell you quite a bit about the surrounding areas:


Also, here are the law responses from last time:

You’ll notice the first of those is rather long. This is an example with a nation with a lot of laws on violence, and talking to someone who is well-disposed to you, and is therefore willing to actually talk to you. I think I need to find some way to chop this down; for such a long potential answer, maybe even people who like you the most will tell you the top laws or bottom laws, or maybe they’ll say “Do you want to know punishments for the worst crimes or the most common crimes?”, or… something. I’m not quite sure yet. Either way, it’s pretty clear that a reply this long isn’t really workable, and is very hard to read, and will probably lose the reader’s interest part-way through.


Secondly, I added in a set of what I’ve now taken to calling “meanderings”. As part of making conversations as realistic as possible, I felt it was important to add in code for people thinking for a moment before they reply, or being semi-reluctant to quickly reply, and just generally having the umms, ahhs, and oks, that characteristic real speech. At the same time, of course, having too much of this would quickly get annoying. To balance this out, there are two elements. Firstly, people will only start to use these phrases if they begin to get annoyed about the conversation, and they’re starting to lose interest in you. When their full interest is on you they won’t falter in the conversation, but this might change as time goes by. Secondly, they will not use it too often; an NPC that has just used one will definitely not use it on the next sentence, and beyond that, it is randomised, but becomes more and more likely the less and less interested in the conversation the NPC becomes. If you look at the conversations above, you’ll see a few of those present here and there.

International Relations

As noted above, the game now generates appropriate relationships between each nation in the game, whether feudal, tribal, or nomadic. In essence, the game looks over the ideologies of each nation, and looks at where they match, and where they clash. In some cases a pair of ideologies could be seen as a match or a clash; for instance, two monarchies might get on well because they have the same system of leadership, maybe the families are related, and so forth; or they might hate each other and have a rivalry between their ruling families. In these cases the game chooses at random whether these are “good” commonalities or “rivalry” commonalities. Equally, some shared ideologies will always cause conflict – two theocracies or two especially religiously zealous nations which do not share religions are never going to get on, and likewise two imperialist nations – whilst others will always generate friendship, such as a shared commitment to religious tolerance, or a shared appreciation of gladiatorial combat. Then, in turn, various religious beliefs, geographical distributions, and so forth, further affect matters. These are then categorised into nations that are close allies, friendly, neutral, disliked, or firm enemies; these five categorisations then affect speech, whilst the more specific like/dislike values will play into other elements later on. This is basically akin to the kinds of systems one sees in the recent Civilization games, but somewhat more complex and with many more factors at play determining what cultures think of one another.

Along the civ.relations dictionary, there is also a civ.trade_relations dictionary. This is similar, obviously, but actually somewhat distinct. Whereas relations simply tells you what one nation thinks of the other, in the case of trade_relations, we’re talking specifically about how much trade passes between two nations. Of course, trade is not going to be passing between nations that loathe each other, but two nations that share a massive border and are somewhat friendly are likely to trade more than two nations that are the best of friends, but half the world apart (bearing in mind, of course, that we are talking about the renaissance rather than the modern day here). Trade_relations therefore tells you the volume of trade going on between each nation and each other nation, and in some stores the player will therefore be able to sometimes find the items of other nations for sale. The reverse will actually happen in black markets – if X and Y hate each other, the goods of X might secretly appear in the black markets of Y, and vice versa. In this way I’m aiming to make the potentially someone “abstract” idea of international and trade relations much more concrete; it shapes who appears in each nation, what items appear where and under what conditions, and will also – of course – affect where the player can safely go.


For a fun little diversion for an hour this week, I also implemented the system for procedural alcohol – I’m sure we’ll all agree, a truly vital component of any procedural world. Each nation now selects an archetype of drinks that they tend to enjoy drinking, which can be beer, spirits, or wine; these are designed so that a full world will not have a completely equal distribution, but some generations should have a high volume of beer, spirits, or wine drinkers; much as in the real world, we don’t see these equally distributed. It then generates an appropriate set of alcoholic drinks for each nation, with words drawing on the terrain and climate types enjoyed by that nation, a wide set of default words for each alcohol type, and names – a class of alcohol might be named after the particular monastery where it is brewed, a particular town where it is particularly favoured, and so forth.

The player can also now ask innkeeps about the kind of alcohol they sell, and they’ll give you an appropriate list! Taverns stock a high percentage of all the alcohols drunk by one nation, but will never stock the full collection; equally, I’ll shortly implement a system so that taverns particularly near the border with another country will (assuming that is a nation with a particular set of alcohols, so not a tribal nation) sometimes carry one of the alcohols from “across the border”. Later on I will also add actual “breweries” in the locations where the various alcohols in a nation are brewed; these will have minimal gameplay value, so I certainly won’t spend more than a few hours on that, but for the sake of completeness I think they need to go in to make the world look just that little bit more complete, more varied, and so forth.


In the last fortnight I also finished the generation system for relics, and here are some example debug logs, where “RT” means “Relic Type”. Some of these do have rather lengthy names, because the names of the people associated with the relic can be quite long. It’s a little unwieldy, but honestly, I think it’s fine. I’m extremely happy with how these work and how these look, and I don’t think I’ll make any more changes here before the 0.8 release, beyond making sure everyone in the game can speak about relics of their religion correctly.

Blog Update Speed

So, once again, this has been a fortnightly update. As such, I’m just going to stop commenting on this for now or trying to predict when the next update will be, and I’ll just say to everyone: I’ll update as soon, and as rapidly, as I can. I am developing URR actively again, as you can see from the above, but I am also changing jobs, taking up two visiting positions in two other continents, and finishing my first academic monograph… so we’ll see how it goes. See you all next wee-… er… next time!

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.