Author Topic: Ultima Ratio Regum (0.8 released after five years!)  (Read 238490 times)

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #210 on: July 18, 2016, 11:04:51 PM »
Since last week we had a post about my third bullet hell world record high score instead of an URRpdate, this week’s should be the longest in quite some time! Lots has happened in terms of naming NPCs, fixing remaining bugs, changing the player’s dialect in a conversation, and also sentence generation is now actually happening! Most exciting. Read on…

Names in Conversations

As well as being generated, names now appear correctly in conversations. In future versions you will naturally not automatically know the names of strangers you bump into – unlike certain RPGs we could mention where the player magically divines the names of every single you talk to – and learning someone’s name will therefore sometimes be a gameplay mechanic. You might, for instance, know that a particular merchant called [Name] knows something, but the civilization that merchant comes from are not particular friendly to you, and you don’t know what they sell, so you’ll have to try to figure out which of seven merchants in a market district the particular merchant you’re after is, and potentially use other clues (sex, clothing, behaviour, whatever). Equally, of course, the game will remember perfectly the names of everyone you meet, and I’m actually thinking of a system that might alert you when you encounter someone whose name you already know – perhaps a message in the text log saying “You see [Name] [doing task X]” for someone you already know, because there is no visual way to mark out someone you recognise from someone you don’t (i.e. two merchants will both be ‘m’ whether you know them or not). Here are a couple of screenshots showing some conversation windows with people from various name-types:







Changing Dialect

You can now actually change your dialect by selecting a different dialect. This is a small thing, but it required me to start building up the code for handling what happens when you press [Enter] on an option in an in-conversation window, and it therefore has to detect the sentence or the item or the dialect you select, and then notice what kind of thing it is the player has selected, and then take the appropriate action. This works correctly now, though, so you can switch to another dialect and all the % chances of uttering each possible sentence immediately update appropriately. You can see in this gif how the chances of successful/unsuccessful words changes as we change dialect from one to the other.



Sentence Generation (Part I)

After thinking long and hard about sentence generation, and managing to free up a spare day to do nothing else except working on this, I’ve been able to make a substantial start. So, basically, the game splits sentences down into three categories, I’m naming “clauses“, “archetypes“, and “kennings” (which applies to a range of things that are not technically kennings, but the term gives us a good impression of what we’re talking about here).

Clauses: these are segments of a sentence, which vary massively from culture, religion, geographical background, and all the other factors that basically everything else in URR tends to be varied along.  A sentence will contain several clauses in most cases, and clauses are basically sections of a sentence that the game will generate independently (via archetypes) and then stitch back together (see below for more information on this).

Archetypes: these are hand-written default versions for each possible question. For each of the questions that the player can possibly ask (or the NPC can ask back), I’ve gone through and written a dozen or so variations of that serve as the foundations of possible replies (although once a reply is finished it will be almost indistinguishable from the archetype that created it). These are then distributed to each culture semi-randomly, with some relationships between some archetypes which others are “free-floating”, and each culture then starts the game with a few basic and foundational ways to talk about the things people might need to talk about in-game.

Kennings: in the case of URR, this refers to a particular way of referring to a particular thing. So this might mean referring to historical events, or a title to put in front of the name of a deity, or a particular way to talk about oceans or mountains, and so forth. These are basically segments of clauses that have to be expressed a particular way, so a clause might say [Title of god] and then the game will look up the appropriate “kenning” for that element and place it into the clause; alternatively, if it says [Desert] then maybe that nation says “Deserts”, or “Great Sands”, or “Great Dunes”, or “the Red Expanse”, or whatever, and the game will quickly check what the appropriate (generated) term is for something in a sentence.

So, in trying to create a sentence, the game does the following process:

Stage 1: select clauses. This first stage means that the game looks at how many clauses should be in a sentence, and what they should be. A nation with a dialect with low “sentence complexity” will have very few clauses in the average sentence, for example, whilst a nation with high sentence complexity will have many clauses. I’ve developed a fairly complex but easily-added-to system for adding clauses into sentences based on the nature of the sentence. This means that extra historical, personal, geographical, religious, etc, detail can be added to a sentence depending on how many clauses it has, and those clauses will be handled intelligently and sensibly.

Stage 2: select an archetype for each clause. The game then checks how that particular culture would express a particular clause and retrieves that archetype (which will then, in stage 3, be massively varied) and readies it. Archetypes are generated/selected in such a way that they should be broadly consistent across a culture, so you shouldn’t get a culture that talks about mountains in one way and talks about oceans in another, but rather talks about all those things in a broadly comparable way. Archetypes also affect sentence structure and in some cases word order, and these elements are also taken into account.

Stage 3: implement kennings/references. This third stage is perhaps the most important part of sentence generation, since at this point the game looks up how to express everything in every clause in that sentence. As we see above, archetypes say things like [Religion-title] and these are all triggers, telling the game to look up the appropriate phrase for the appropriate thing in the appropriate culture. As such, the sentences themselves within archetypes tend to have a large volume of square brackets in them, and aren’t really human-readable – although you can get a good idea of their meaning – until there’s a nice lot of kennings and references in place.

Stage 4: stitch it all together. The game then goes through all the sentence components – now transformed from archetypes with square brackets to archetypes with appropriate references and the like – and stitches them together with appropriate punctuation. This is partially done through the system that places clauses together, and also a bunch of signifiers that handle things like vowels/consonants, plurals, etc.

It was very tricky to find a system that struck the right balance between a) generating a huge volume of potential sentences, b) making the number of hand-made sections relatively low so that I actually get the release out before the 2020s, and c) ensuring a huge amount of modular variation within the sentence structures. With this system – selecting clauses, selecting archetypes, varying almost all of the components of those archetypes, and then stitching the sentence together into a meaningful whole – I’m confident that I’ve found a balance between all of these requirements. I think I’ve struck a balance between large volumes of hand-made sections, large volumes of procedurally-generated sections, and sections of speech that sit somewhere in the middle where handmade elements can be altered or twisted in some way depending on the particular nature of the speaker. I’m really excited to see what this will produce! These are just initial trials, but in the coming week I’ll be trying to build up all the possible conversation options and archetypes and clauses and whatnot, and then we’ll see how that looks. Here are two variations OF THE SAME CONVERSATION, and just look at all that variation!





(Note: you’ll also see a tiny bit of procedurally-generated calendars there! Some use years, some use a bunch of other systems; this might not make it into 0.8, but I just happened to be testing it out whilst I took these screenshots)

(You’ll also note the lack of ‘?’ in the second – just a typo!)

Having looked at the power of this system, even with the incredibly simple conversation above, I am *so* excited about how this is going to work. I now just need to write all the other words to slot into every other part of the system, and this is a huge task, but by next week’s blog entry I hope to have it all done and to be able to show off some more detailed conversations, as well as some of the other conversation options I’ve been developing this week – these extra things aren’t totally ready just yet, but they’ll be essential to making conversations feel very human, and adding extra depth.

Next Week

Conversations, sentences!

Aleksanderus

  • Rogueliker
  • ***
  • Posts: 179
  • Karma: +0/-0
  • Champion of the unknown
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #211 on: July 19, 2016, 07:23:32 AM »
Damn son, which bullet hell game did you play?

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #213 on: July 19, 2016, 05:38:26 PM »
Wow, this looks absolutely awesome. Is this moddable?

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #214 on: July 20, 2016, 10:08:19 AM »
Wow, this looks absolutely awesome. Is this moddable?

Common question, but I'm afraid not. It won't be moddable and I have no intentions of making it open source (except, possibly, in my will!). I'm always looking for feedback and suggestions though, and I very often take comments on board, so feel free to throw any ideas my way :)

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #215 on: July 20, 2016, 11:46:07 AM »
I should have specified better: Is there going to be a way to add kennings? This seems like the kind of stuff that isn't spoilery and well-kept in text-files either way (or I'm missing some very important stuff here), so I wonder whether you are keeping kenning definitions in plain text files, which could be edited by players.

UltimaRatioRegum

  • Rogueliker
  • ***
  • Posts: 318
  • Karma: +0/-0
  • Username says it all, really.
    • View Profile
    • Ultima Ratio Regum
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #216 on: July 21, 2016, 09:57:39 PM »
Ohhhh.

Er...

Still probably not. I'm not really big on modding, from the perspective of my own game(s), anyway. I have a particular vision I want to realize, and that's really the goal. I'm totally open to all kinds of suggestions though!

Aleksanderus

  • Rogueliker
  • ***
  • Posts: 179
  • Karma: +0/-0
  • Champion of the unknown
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #217 on: July 22, 2016, 09:38:25 AM »
Ohhhh.

Er...

Still probably not. I'm not really big on modding, from the perspective of my own game(s), anyway. I have a particular vision I want to realize, and that's really the goal. I'm totally open to all kinds of suggestions though!
Well, if you could make it open-source and encourage modding then modders could modify this game so much then it could even best the original!

And also modding can add SO much possibilites... It would be even possible to implement scifi, magic and much more!

I would love to see Cthulhu mythos mod to this game! (it may even work out because this game has detailed textures and if this game was open-source then modders could modify them! and also from what it looks like damage system is complex so it surely would be a good mod!)

This is the most important suggestion so far deciding on the path which this game will choose!  ;D

Krice

  • (Banned)
  • Rogueliker
  • ***
  • Posts: 2316
  • Karma: +0/-2
    • View Profile
    • Email
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #218 on: July 22, 2016, 05:18:51 PM »
Well, if you could make it open-source and encourage modding then modders could modify this game so much then it could even best the original!

This doesn't work like ever. Angband was easy to modify, but none of the mods were ever better than the original. It's how this stuff works. If something is easy (like modding), it attracts wrong kind of people.

Aleksanderus

  • Rogueliker
  • ***
  • Posts: 179
  • Karma: +0/-0
  • Champion of the unknown
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #219 on: July 22, 2016, 08:30:30 PM »
Well, if you could make it open-source and encourage modding then modders could modify this game so much then it could even best the original!

This doesn't work like ever. Angband was easy to modify, but none of the mods were ever better than the original. It's how this stuff works. If something is easy (like modding), it attracts wrong kind of people.
I think it depends on the game. I didn't play Angband a lot with or without mods so I don't know about it but open-source can make bugfixing even faster because people can make unofficial bugfix and developer can "steal" it and use it in the next release officialy. (of course credits to the creator of bugfix should be given)

Antsan

  • Rogueliker
  • ***
  • Posts: 52
  • Karma: +0/-0
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #220 on: July 22, 2016, 09:43:43 PM »
I think making URR OS is actually not up for debate. I assume the comment about openness to suggestions was in regards to game mechanics.
I mean, why are you guys even talking about this, it was already said that URR isn't going to be Open Source. It seems this has been discussed elsewhere quite extensively already.

Aleksanderus

  • Rogueliker
  • ***
  • Posts: 179
  • Karma: +0/-0
  • Champion of the unknown
    • View Profile
Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
« Reply #221 on: July 23, 2016, 07:23:57 AM »
    I think making URR OS is actually not up for debate. I assume the comment about openness to suggestions was in regards to game mechanics.
    I mean, why are you guys even talking about this, it was already said that URR isn't going to be Open Source. It seems this has been discussed elsewhere quite extensively already.
    And who cares it's not up!?

    And also it's not some fucking other forum! Your posts are becoming much more edgier than they should be, Ant-san...
    « Last Edit: July 23, 2016, 07:25:35 AM by Aleksanderus »

    UltimaRatioRegum

    • Rogueliker
    • ***
    • Posts: 318
    • Karma: +0/-0
    • Username says it all, really.
      • View Profile
      • Ultima Ratio Regum
      • Email
    Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
    « Reply #222 on: July 23, 2016, 10:33:48 AM »
    Allow me to step in again here: yeah, making URR open source has been discussed numerous times, and I'm afraid it's always a no. There are various reasons, and maybe if there was only one reason I'd reconsider, but there's four or five reasons I normally cite which make it a definite no. Basically: 1) it would require HUGE code rewriting, 2) even the bits that wouldn't need rewriting are incredibly open-source-unfriendly, 3) I have a particular vision and don't want to allow multiple versions, 4) I'm just not motivated to do it. Like I say, though, I've taken on-board a huge number of player suggestions, and I'm sure I'll keep doing so, but the combination of those reasons is more than strong enough to discourage me!

    ---

    In other news, 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. https://www.rockpapershotgun.com/2016/07/22/future-of-procedural-generation-1/

    UltimaRatioRegum

    • Rogueliker
    • ***
    • Posts: 318
    • Karma: +0/-0
    • Username says it all, really.
      • View Profile
      • Ultima Ratio Regum
      • Email
    Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
    « Reply #223 on: July 24, 2016, 09:55:00 PM »
    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:





    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!
    « Last Edit: July 24, 2016, 09:57:39 PM by UltimaRatioRegum »

    UltimaRatioRegum

    • Rogueliker
    • ***
    • Posts: 318
    • Karma: +0/-0
    • Username says it all, really.
      • View Profile
      • Ultima Ratio Regum
      • Email
    Re: Ultima Ratio Regum (v 0.7 released, 18th April!)
    « Reply #224 on: July 27, 2016, 06:46:43 PM »
    And here's a little piece I wrote for Vice Gaming about PCG in RimWorld!

    http://www.vice.com/read/you-can-spin-your-own-sci-fi-tale-in-rimworld