Defaults Finished, Negative Replies, Simulated Boredom

All the remaining default conversation options, and all the remaining expansions, are now complete. I’ve also altered the expansion code such that certain expansions aren’t tied to certain words or sentences within a language and guaranteed to appear whenever that sentence or word is said, but instead they appear with a % chance for every instance of a particularly word or phrase someone in that dialect says, depending on their sentence complexity (as we discussed before, sentence complexity is now tied to individuals, not to entire cultures). Here’s a couple of examples, courtesy of our good playtesting friend, Orangejaw Moonblizzard, and some NPCs who may or may not have had their origins changed using admin commands for the sake of testing (as you’ll notice these replies could not be for the same nation!)…



Negative Replies

The big thing this week and weekend has been working on negative replies – so, for instance, if you ask “Are we near the desert?”, the default response is “We are near [desert] in [direction]”, or whatever, but obviously a valid option is “We are not near the desert” – and this obviously applies to loads of questions. What if the speaker’s nation has no army, or dislikes art, or have never travelled, or doesn’t know any other civilizations, or lives on a tiny island and knows nothing of the wider world, or doesn’t worship a religion, and so on? We therefore now have a body of negative replies for people to basically say “no”, “that’s irrelevant”, “I don’t know”, or “I don’t care”, in hundreds of thousands of interesting ways!

These negative replies effectively now split up into two categories, which we could usefully call “general” and “specific” negative replies. “General” negative replies include replies like “I don’t know”, “I don’t remember”, “I’d rather not answer”, “I’m not authorized to give you that information”, etc, which can apply to a huge range of NPCs in a huge range of situations. Since the player will run into these fairly often, I’ve made sure that there’s a lot of variation in these general negative responses – although in many cases, of course, there’s only so many ways that you can actually utter some of these things, but here are a few examples.


“Specific” negative replies refer to asking a question where the answer is still answering the question, rather than a general answer, but still a negative. For instance, if you ask someone what they think a particular policy in their nation should be, they might reply “I have no interest in politics”, or if you ask someone whether they know any distant cities you might want to visit, they might say “I know of no distant cities” – and so on and so forth. Each of these is often more specific and more varied than the above, so I’m trying to bias people towards using these wherever possible, although they are naturally dependent upon particular cultural/political/religious situations.


Crowd Disinterest

You’ll all recall the “conversation interest” idea that URR conversations will have implemented – that unless you ask relevant questions, NPCs will quickly lose interest in talking to you. This is to stop the player just going through every single question one after the other, and to encourage you towards asking sensible, logical and appropriate questions. However, I realized the other day that I can’t just limit this to a specific NPC getting bored; if you have a bunch of general questions you’re asking every soldier, for instance, then you could just go from one soldier over to the next soldier in the barracks and start questioning them, ignoring the questions you already asked Soldier 1, but assuming (quite fairly) that they will probably respond the same way, seeing as both Soldier 1 and Soldier 2 are just default soldiers.

Therefore, I need to implement some kind of “crowd disinterest” solution, and I think I’m going to do this on two levels. On the “local level”, NPCs within a building will see who you’re talking to and what you’re asking them about, and also within a map grid (within your line of sight, or nearby), and will take note of the questions. So if you question Soldier 1 about pointless stuff, and they tell you to go away, then you start asking Soldier 2 pointless stuff, the time it’ll take Soldier 2 to lose interest will be shorter than normal; Soldier 3’s will then be even shorter; and so forth. Then, at the global level, I think we need a system whereby information about the player slowly spreads through cultures/cities/religions/etc in the entire world so that people get some idea of whether they should respond to the player or not. Neither of these systems will be in 0.8, but they definitely need to be there.

Next Week

Remember those two new conversation features I mentioned a while back – replies and counter-questions – and also all those questions that have more complex replies, such as lists? Some combination of those will be coming next week – probably the complex replies, I would think. See you then!

Default Conversation Options, Expansions, Scrolling, Personalities

To make up for last week’s rather short entry, here’s a bit one. I’m pleased to report that a very pleasing volume of new stuff has been done this week, and things continue to look very exciting indeed. Read on!

Default Conversation Options

At this point almost all the “default” conversation options are done! This means everything that you can ask every character, and also the class-specific questions (like “What are you guarding?”, “What nation do you represent?”, “How long have you ruled this nation?”, etc). This was a totally huge volume of work I’ve been putting together over the last fortnight and it’s great to see it all nearly done,. and it’ll certainly be all done by this time next week. Here are some examples of conversations with people from specific classes, in this case with a priest, guard, and diplomat:


Words1 Words2Words3Default “Expansions”

“Expansions” are what I’m calling bits of a sentence that certain NPCs will add to certain words in a sentence. For example, as we’ve seen rather than just saying “What is the greatest battle your nation has fought?”, someone from a particularly militaristic nation might be “What is the greatest battle, that glorious arena in which all are equal, that your nation has ever fought?”. Similarly, rather than asking “Are there any mountains nearby?”, someone from a particularly exploration-focused nation might ask something like “Any there any mountains, those peaks that inspire us to great deeds, nearby?”. Almost all of the expansions for the default conversation options are now in place, and wow, there are a truly huge number. There are close to a thousand expansions I’ve written for various ideologies with various words, and much like everything else, the inclination of a person towards using expansions is contingent upon their sentence complexity value – a higher sentence complexity means more expansions. As a result of making conversations more human as we discussed a fortnight ago, these are now far rarer, but here are some examples from the generation system, which gathers all possible expansions for a certain word for every nation into one place, then if a random number is rolled that is lower than the nation’s sentence complexity, it selects an expansion for that nation for that term and stores it. Again, by this time next week these will be totally finished.


NPC Personalities

NPCs are now generated with four personality modifiers that will structure how they behave. These will now be explicitly visible, although they will be noticeable from the kinds of replies you get, and also in some cases I suspect I’ll get other NPCs to tell you about the personalities of other relevant NPCs.

  • Sentence Complexity – this has been shifted from nations to people, and reflects how much people give in answers they’re willing to give. By this, I mean let’s say you ask someone about whether they know about any nearby towns, and they know about five towns. Will they tell you all five, or just one, or somewhere in the middle, and will they comment on what they think about those towns? This modifier will determine that, but it’s different from whether they’ll reply at all – replying is a binary, and then the detail of the reply will be structured by these metrics.
  • Education  this affects how much someone knows, i.e. how often they’ll wind up saying “I don’t know!” to a question. Naturally this will vary according to class, and expected educational levels, and so forth, and therefore certain questions will be more likely to give you an answer from certain NPC classes, because others simply won’t know the answer!
  • Patience this is a modifier for how much an NPC is willing to speak with you. This will combine with modifiers for each civilization, and also for each NPC class and the player’s current status (so a guard will be disinclined to talk to a random person automatically, whereas a merchant will naturally be more inclined to talk to a random person in the hope of making a sale).
  • Privacy this modifier affects how willing the person is to talk about their own personal details, and probably how willing they are to tell you information about their culture, religion, etc. This won’t vary too much, but some NPCs of the same class will certainly be more or less concerned about telling strangers their thoughts.

These four metrics are being generated for each NPC, but I can’t say yet whether they’ll make it into the conversation system in 0.8 – I’m really trying to get an absolute core conversation system done, with the kind of scope and variation I want, and then release that. It’ll probably be in 0.9, but I thought it was worth drawing attention to these elements now, as more ways to vary the conversation experience.

Conversation Scrolling

Added a scroll-bar to the main conversation window. I pondered for a while how best to do this. Firstly, I was going to have the scroll bar only appear to the left-hand side of the right face when the conversation gets long enough, but that would mean that the conversation window would then slightly resize itself (which didn’t look nice) and it could slow things down a little to have to measure the size of the conversation before printing it, and then altering the size of the printed conversation. I then tried having a scroll bar only appear on the right-hand side double-grey border when you needed to be able to scroll, but this was very inelegant and seemed disconnected from the actual conversation you were scrolling through. As such, my third try was to do what I’m now going to stick with, which was to add a dark version of the scroll bar always present on the right-hand side, and then have that scroll bar expand and light-up once the conversation is too long. See below:


(Though you’ll note just for testing purposes I asked the same question a lot, and they didn’t get bored – boredom still needs implementing!)

Next Week

Next week I’ll be finishing off the final parts of the elements above, and I’ll be working on the non-default responses. This means answers which are negative, e.g. you ask “What size is your army” and the reply is “We have no army”, and also special answers, like “What do you think about [nation]” which doesn’t easily fit into a sentence structure where you just switch out words, as they’d express positive/neutral/negative feelings very differently, so these need more complex answers. See you all then!

IRDC US Roundup

A shorter update this week (but with a big conversation update next week), as I’ve spent the entire week at conferences! I was at DiGRA/FDG 2016, where I gave a talk in the PCG workshop about URR’s dialect generation…

… and then gave the deep play and dark play talk I previously gave at CGSA, and concluded with a live bullet hell demonstration, commentated on by the ever-marvellous Mike Cook, which went down really rather well. Lots of people said they felt it was the highlight of the conference and it got a pretty amazing amount of traction on Twitter. It was actually remarkably relaxing to play live compared to the same event at CGSA a few months before – it’s amazing how quickly just a single trial-run of a particular event can transform it from something quite nerve-wracking into something very comfortable.

After that, however, I flew to NYU for the 2016 US IRDC! Last year, as some readers might remember, I really wanted to visit Atlanta for the first US IRDC, but despite the incredibly generous offer of some financial support from a fellow roguelike developer, it didn’t work out in the end. This year, however, I made it across the pond and attended my first ever US IRDC! I gave my procedural dialects talk, fielded a pretty huge volume of questions, and then spent the rest of the day talking to the (rather good) turn-out of attendees. I’m keeping it brief this week as there’s so much otherwise stuff I to do today, but here are some pics:

Introduction from Kawa: 


The awesome games collection of the NYU Game Centre:


The highly amusing Dragon Hoard Income Tax simulator:

IMG_20160806_173714Issues with the amazing time-travel 7DRL by @humbit:


Another talk…


…and rather nice Japanese restaurant!


For me, the two highlights were Jason Grinblat’s awesome talk on using Markov Chains to generate books in Caves of Qud, and Jeremiah Reid’s fantastic piece about his time-travel roguelikes and how to handle paradoxes and deal with some highly amusing bugs. It was a fantastic event with a strong turnout and loads of great talks. To anyone in the US who considered coming but didn’t make it – you were missed! I don’t know if I’ll be able to make it next year, but I’ll certainly give it a shot again, though it will depend on funding, jobs, all that other stuff. It’s always hugely enjoyable to meet the big names in the community, and as a developer to meet people who want to meet me, and I can’t recommend it enough. Hope to see some more of you there next year! Next week: more sentence and dialect generation!

Conversation Changes

After last week’s post, I was very pleased with the kind of variation in styles of speaking I was getting, but something just didn’t feel quite right. It took a bit of time and quite a bit of feedback to figure out what it was, and that then triggered a second realisation about something else that needed changing, and in turn, a third. And a fourth and a fifth!

First, length and clauses. Many of these are simply too long, and there are too many additional clauses. I think the extra clauses will become just a little bit annoying after a certain point, especially if you’re talking to lots of people from one civilization close together. As such, I’ve made some sentences shorter, and reduced the likelihood of clauses being added to sentences. This also meant a change to sentence complexity: I’ve decided to actually make quite a substantial change here and change sentence complexity from a value/modifier embodied in a civilization to a value embodied individually in each person you encounter. I realized that since you’ll spend a decent length of time in each nation at once, you’re probably going to be spending a while talking to a range of people from the same background, and so I want to boost variation between people more than I want to boost variation between civilizations. As a result, each person now has a sentence complexity modifier specific to them. This has five variations, which I’m currently just storing as 1-5; that’s an x/15 chance that each sentence they say might have a clause. This means even the most wordy person will add in extra detail clauses in 1/3 sentences, but for most it will be far rarer. I’ve tried this out a little and I’m much happier with the kinds of sentences it produces (along with the other changes). Equally, it means that that kind of extra info will come to the player more gradually, which I think is also beneficial.

Secondly, punctuation. The end of sentences now varies according to the mood of the person speaking them; a hostile NPC will end with “.” or “…” to everything they say, a neutral NPC will end with “.”, whilst an NPC very positively disposed towards you will end sentences with a mix of “.” and “!”. Again, a very simple thing, but it’s already making a big different to the ebb and flow of conversation.

Thirdly, and related to the above – formality. Many of the sentences were just too formal and rigid and didn’t have the kind of flow that you would expect sentences to have. To adjust this, I’ve made some changes to quite a few of the sentences, added in the possibility for things like “Hmm…” to appear at the start of sentences, or things like “Let me think”, or “That’s hard to remember”, or “I don’t know much, but I’ll tell you what I recall”, things like that – I’ve also added in more use of “I’m” instead of “I am”, “I’ve” instead of “I have”, etc, and so on. The combination of these various alterations seems to be working quite nicely, and gives a far more conversational feel to the whole thing.

Fourthly, visuals. I felt that using the skin tone for the sentences on both sides of the conversation is making the actual conversation window look a bit too thick and same-y; instead, the player’s comments will always be the same colour as their @ symbol, i.e. white, whilst those from other characters will change according to skin tone. This breaks up the visuals and seems to make conversations a little easier to parse, which is obviously very important!

Fifthly, stories – see below in the example for precisely what I mean by that.

As such, this is how conversations should look from this point onwards:


There’s still a lot more to be done, of course – like adding “Hmm…” and all the other stuff described above, but I think this is a great step forward.

More next week!

A Million Ways to Speak in the World

Firstly, rather excitingly, I’ve been commissioned to write a four-part series on qualitative procedural generation for Rock Paper Shotgun! Societies, practices, cultures, beliefs, and so forth, and how to integrate them into gameplay. I think one part will be going up each fortnight for the next three fortnights, but here’s the first one.


Generation Next, Part 1: How Games Can Benefit From Procedurally Generated Lore

Sentence Generation

This week I’ve been adding in a truly titanic amount of speech variation into the game. I’m only now beginning to realize the size and scope of this task, given the level of variety and interest and complexity I want to include, but at this point it’s close to around ~1/3rd of the default conversation options done. There’s a vast number of archetypes, a truly gigantic number of clauses and descriptive modifiers (a comment a character might make about the word “world” if they’re from a particularly isolationist nation, for instance, which might be something like “frightening in its size and distances”). I’ve already written several thousand of lines of speech, variations in those, templates, words, clauses, kennings, all kinds of stuff, and written the (actually remarkably simple) code that pieces them all together. I’ve reached the end of all the “default” questions which you can ask anyone (and their answers), and I’m now moving onto the class-specific questions (and their answers), and then after that onto the special answers that change their sentence structure, not just their sentence content, depending on the NPC. By this I mean, you can always answer the question “What is your religion’s most sacred relic?” with an answer of the sort “Our most sacred relic is [x]”. However, a question like “What is your opinion about the ongoing war?” cannot be answered with a single sentence with words switched out, so needs a more complex set of answers tethered to the opinions of that NPC.

There basically hasn’t been much new coding going on since last time, so below you’ll find two conversations I had with different people, and how different they turned out (so the same kind of thing I showed off last week). You’ll notice that certain words get “expanded” upon, such as that “in which we all serve and are served” bit of the first picture below; these are bits of flavour text heavily dependent of course upon religions, cultures, backgrounds, etc, and these are one of the major things that will give you a hint about the background of the person, when they elect to give you a bit of their perspective on an issue you’re discussing. By the end of this process there will be an *incredible* number of these little expansions; as above, I’ve only done about 1/3rd of the default conversation options so far (not to mention negative replies, replies that can’t have a default form, and other stuff) and already there are several hundred of these. Naturally some political beliefs are easier to find expansions for – consider how much of a conversation someone from a pacifist nation would comment on, compared to how much of a conversation someone from a planned economy nation would have a comment relevant to planned economy to make – but I’m trying to come up with expansions for even the less-obvious ideologies too.

Anyway, here’s two examples of one conversation again, and you can see these are already more complex than last week:
New Conversation 1_1

New Conversation 1_2

I love how distinctive these are, and how you can even in just a few snippets of conversation start to guess at some of the beliefs and backgrounds of the people and their nations. In that last one you can see that we need a scroll bar for the conversation window, which is coming shortly.

For next time, I’ll be continuing to put in the massive databases that underlie the sentence generation system. I’m also starting to put in the first parts of two next things, both designed to enhance the smoothness and realism of the conversation system, instead of reducing it to what can look like a question-and-answer session. Although I’m super-proud of the above screenshots, they ARE quite question-and-answery, and this needs to be changed, and that’s what these two new elements will help us towards (the “how interested am I in this conversation” meter will be coming later). These two new elements are:

  • Counter Questions: this is what I’m calling it when the character you’re talking to asks you something back! They’ll reply (or not) to your question, and then ask you a question back; sometimes the same question, sometimes a related question, and sometimes a more general “Why are you asking that”, “Why do you want to know?”, etc. You’ll then get a reply option (see below) that you can use, or not, depending on your preference.
  • Replies: you as the player can respond to a specific thing that another character said and question them further on a topic that emerges in the process of conversation. For instance, if they mention a person, you can immediately say “Can you tell me more about [person]”, if you want to. Alternatively, as above, you can offer replies to what someone asks you, and will have the option to tell the truth, lie, semi-lie, etc.

These do require a bit of work, and I want to get all the “default” stuff done first, so I won’t mention these for another week or two, but I wanted to note that I’m aware the structure and flow of conversations needs a little work, and I’ll be working on that soon.

See you all next week!

UPDATE: various bits of feedback have highlighted some other issues with how conversations are currently looking, basically focused around their excessive formality. Like I say, I’m working on it, but I’ve also identified a few other useful changes I can make before next week…