Planet Roguelike-Dev

January 22, 2017

ULTIMA RATIO REGUM

More Lexicon Variation, Conversation Development, New Variables

Lots of major developments (and some minor ones) in URR this fortnight! Firstly, all the content I added last week meant that a whole new set of words and phrases had to be added to the lexicon; the best part of a thousand in total, if I’m counting correctly. I’ve now implemented all of these, and the game can correctly vary the words from all these new sentences by drawing on these new additions to the central lexicon. Secondly, I’ve now almost finished what I’m calling the “standard” or “basic” conversation system, which is ensuring NPCs can reply to every question they are asked; this should be done by this time next week. Thirdly, a wide range of further variables for individuals and the cultures they hail from have been implemented, and are now having an effect on what kinds of things NPCs will say. Another very, very text-heavy post this week – although next week’s will contain a lot of screenshots, this week continues to be lots of under-the-hood programming and content addition that cannot, yet, be reflected in screenshots, but is getting pretty damned close. Read on!

More Variations for New Words

Firstly, as above, there was a huge set of new words and phrases that needed to be varied for each culture, as with all the others. These entered the game because I was writing the new “option” answers (see last week’s entry), and needed to be written up. This was one of those tasks that isn’t especially intellectually challenging or needs a lot of programming experience, but mostly just involves adding a massive chunk of “content” which the game will then deploy in the appropriate situations. With this finished, I’m very happy with those look, and the sentences read really well and really nicely. Here’s a screenshot from the new set – I’m sure you can see how/where a lot of these fit in…

I also went through the existing words, and decided to statistically bias some of them back towards slightly shorter variations, and therefor slightly shorter sentences, as a response to the feedback I regularly get about some of the sentences being too wordy. You’ll see the same in the earlier example, where we have some sets using the same short word twice to boost the chance of that word being selected (this is of course not an especially elegant way to do it, but let’s be honest: my programming is not known for its elegance). This should ensure that sentences will tend to be just a little shorter and a little less wordy, and I’m going to continue this trend of chopping out irrelevant words whilst maintaining sentence variety – though this is a tricky balance to strike.

Nearing Completion on Standard Conversations

The development of the game towards what I’ve been calling the ability to have a “basic conversation” – i.e. the traditional question-and-answer session that one gets in most games, where the player asks something, the NPC responds, and this pattern continues until all conversation options have been exhausted – is now extremely close. NPCs respond correctly for all the “basic” questions (about 1/2 of all questions), and for the “options” questions (about 1/4 of questions), and are in the process of being programmed to respond appropriately to the “list” questions (also about 1/4 of all questions). This is the final step to them being able to ask any NPC any question, and get a response. For now these responses are all truthful, and they always answer, but this will still be a huge milestone once finished. As such, by this time next week, I’ll be able to show off the basic conversation system working universally, for all possible inputs and outputs, even if a few placeholders like “[holybook]” will still be in place, rather than the appropriate text itself. From my current trials with it, it looks amazing, and the experience of being able to select any question from this gigantic list and get an appropriate and sensible response is really something. It has been a long time coming, but I’m very confident that 0.8 will be worth the wait.

New Individual and National Variables

This week I also found myself needing to implement a large number of additional variables for both individuals, and in some cases for nations and religions and cultures, which NPCs would need to draw upon when they give their responses to particular questions and sets of questions.

Mercenaries

A range of new variables were implemented this week for mercenaries, along with quite a complex formula to decide on how much mercenaries cost to hire. There are four elements here – how much training a mercenary has had (counted in years, generally as a soldier, or in an arena, or they simply became a mercenary immediately and learned on the go), how much experience they’d had (how many years they’ve served as a mercenary, and also some specific stories/information about what they’ve done during their tenure), and then a list of benefits and conditions each mercenary brings. For each mercenary, the game develops a possible list of each according to their  background. For instance, a particularly zealous mercenary might refuse to fight their own religion (a condition) but be especially keen to fight other religions (benefit). This system is naturally comparable to a lot of modern roguelike games where you have PCG characters with selections of “traits” (or an equivalent term) that mix positives and negatives, and task the player with interesting strategic decisions. The game then figures out how much “true money” a mercenary costs to hire (a secret number converted into in-game currencies whenever it’ll appear on screen), which goes by a formula I’ve developed. Broadly speaking, better-trained and more-experienced mercenaries will naturally cost more, and the more benefits they bring the more they cost, but the more conditions they bring, the less they cost. There’s a bit more to it than that, but some initial testing has shown that this attends some very satisfying results.

National Voting Rights

Here’s an interesting one – the question of national voting rights. At the moment when each nation generates, a die is rolled to decide whether women, men, or both are allowed to hold the throne (or whatever the equivalent of the “throne” is). It then considers who is allowed to join the military – if only one sex is allowed to hold the throne, then that sex will always be able to serve in the military, and sometimes the other one will be too; if either is allowed to hold the throne, then both will be allowed to serve (generally). I’ve now extended this to voting right; if either can hold the throne, then both can vote, but if only one can hold the throne, then normally only that sex is allowed to vote, but sometimes the other sex is allowed to vote at a “reduced vote”, e.g. one quarter of the other. There is no real-world bias here so it’s totally randomised between F/M/either, and all variants are equally likely, although certain ideologies make “Only one not the other” decisions more likely than others (Imperialist nations are more likely to restrict, democratic nations are less likely to restrict, and so forth, although this is not absolute or guaranteed).

Nomadic and Tribal Relations

There are now variables to determine how much particular NPCs like tribal and nomadic nations. This draws upon the general feelings of individuals about other nations, which in turn of course draws on a range of ideological and historical factors, but also then modulates this further according to particular ideologies (if these are a close match with lots of tribal/nomadic states), and the individual classes of the NPCs. These will therefore be generally close to a more general feeling about foreign lands, but also quite different in particular contexts, and will affect what NPCs say about their nations, what they’re willing to tell you, what they themselves have “bothered” to find out (if they care), and so forth.

Delegates and Parties

This week I also implemented the first half of the system that will determine what kinds of political parties exist in democratic nations, which parties hold power, and how these parties will have shifted over time. To assess the political leanings of each nation, the game first goes through all of their ideological preferences and develops a set of overall political leanings for the nation, going by some axes that the majority of real-world political parties go by: are they primarily globalist or nationalist, are they liberal or conservative, are they religious or atheistic, are they collectivist or individualist, and so on and so forth. For instance, the “Isolationist” ideology will naturally add a lot to nationalist, and some to conservative, and a little bit to conservative; the “Aesthetics” ideology will promote individualism, but also nationalism, but also a little bit of globalism, and might also support religious iconography… and so on and so forth. Then, if there is a strong specific religious belief in that nation, it checks what political leanings that religion has (is it very peaceful towards others? Does it enjoy holy wars? Etc) and adds that into the mix where appropriate. The game then ranks these overall national political leanings, and then selects a number of parties, before going through each party and having the central tenet of that party be one of the leanings, starting with the biggest leaning and working down. So a nation that is first and foremost “liberal” will have its biggest party adopt a broadly liberal position, with smatterings of other political tendencies lower down the list for that nation. Once that is done, the game then looks at whereabouts delegates come from in that nation – do they come from districts of the capital, from towns, from monasteries, from farms – and distributes delegates appropriately to each party, depending on its political leanings (and generates a procedural name for the party, although this isn’t finished yet, but I’ll show some off soon). This party affiliation will allow delegates to comment on the current political situation according to their own allegiance – which was the only reason I implemented all of this now! But it’s nice to have it in place, and it makes the democratic nations just a little more fleshed-out, even if it’ll be the small 0.9 release where we really see this more visibly.

There are also about another thirty new variables added in this week alongside the ones listed here, but I decided to mention these four as they struck me as being some of the more intriguing examples from the selection. As noted last week, these variables are entirely hidden (or rather, the numbers in each variable are hidden) and are always going to be represented instead by who people are, how they act, how they dress, what they say, where you find them, who they worship, who they serve, and so on and so forth…

Next Week

The completion of the standard conversation system, all questions/answers for all possible questions, and a lot of screenshots to show it off! It has been a while since we’ve had any proper in-game screenshots, so it’s definitely time to actually give you all a look at how (incredibly neat) everything is looking now. See you then!

by Ultima Ratio Regum at January 22, 2017 05:27 PM

January 18, 2017

PickledDev

Telling a story; Creating a Compelling Narrative.

Telling a story; Creating a Compelling Narrative.

In this blog I will talk about my own recent brush with story telling and go on to talk about how tools from creative wring can help you to better author the narrative in your games, whether they have a traditional linear narrative or a procedurally generated interactive narrative.

Narrative and structure in traditional fiction 

 

last week I started writing a story set in the world I'm developing for my game Vinland: 1936.

I hope the story will help me to flesh out my game world and develop my own expanded universe which will be a good place to set my games in the future.

After about a week of work, on and off I've progressed the story to outline stage. For each character thread I have half a dozen chapters which plot a course through the events of the story. Each thread is told from the perspective of a different character.


Actually I started writing as soon as I had my outline, but I've since gone back and deleted what I wrote. The problem was that the scenes just weren't compelling. They read like summaries of a boring office meeting or lecture.

Why? There simply wasn't any conflict, the characters didn't have clear goals, and when they did they achieved them too easily.

I spent some time talking to my old school friend, a Teacher of literature in the UK. He teaches creative writing and has written his own book, which I read last year called "Ape Flesh".

I told him I had actually looked at some online "How to..." posts about writing and they suggested using certain tools. Not computer apps, but formalist tools. Things like the "action-reaction cycle" and "Goal-Conflict-Outcome". I wanted to know if these were things that writers actually use.

Yes, it turns out they do.

Here's a pair of scenes from my Friend's scene map which he was generous enough to show me:



What is a scene map? Well it's what a novel is before it's written. It's an outline of each chapter, scene by scene.

You can see that scene number 69 is an "action" scene. This doesn't mean that it contains action, but that it is the POV character doing something (or trying to do something) while scene 70 is a "reaction" scene, i.e. the POV character reacting to what's happened.

The Action scene can be broken down in to three components:

It has a Goal; to get to the van. 
You need a goal or else your story becomes directionless. The characters float around not really knowing what they are doing (pretty common in bad novels).

It also has a Conflict; It's difficult because of darkness and mud. 
If the goal was too easy then it's not an interesting scene. Conflicts help to make the story interesting.

Finally it has an Outcome or a "disaster". They get separated.

Not every scene has to end in a disaster, but if it doesn't, and the character achieves their goal, there should be some bad side effect that negates their victory. If there's no disaster then the scene stalls and the book becomes difficult to read.

The reaction scene also has three components:

First is the Reaction; Eva is scared.
It's important to know how your characters are feeling, how they deal with stress and failure. This helps the reader to empathize with them. The reaction stage is a place you can do this without breaking up the flow of the story.

Next is the Dilemma; Is she lost?
Think of this part as the character's thought process. How do they go from failure to success, how do they move past their current obstacle. They have to identify the obstacle first and then come up with some possible choices.

Lastly is the Decision; Lewis finds her and they continue to the van.
The character has to choose a new goal. This will take you back to the start of the next Action scene.
The example here shows how the decision doesn't always have to come from the character. An outside source can force an unexpected result to the dilemma, for good or bad.

Here's one of my scenes written in the same way:


Now it is starting to sound like a real story!

Action/Reaction cycle in games

 

Anyway, this made me think about how this can be useful not just for novels but also for making games. This month's Blender Game Making Challenge is soon to start and the theme is "Tell a story".

So how do games tell a story?

Sometimes a game has a linear narrative, just like a novel. Other times it has a non-linear or interactive narrative. The tools I talked about above can be useful in any case.

If you google "Action-Reaction cycle in games" You will find a lot of articles on the subject with graphics like this:


Actually this structure is very naturally applied to games. It's how games work. Consider the following scene map:


To be complete we should consider the situation from the AI's (or GMs) perspective. it also has an action and reaction cycle which runs parallel to the player's. That's what's shown in the Action/Reaction/Processing/Decision cycle graphic above.

This is non-linear, interactive storytelling, a story that writes itself through the player's actions. So in fact we can't describe it as a linear map at all, we should use a tree:


This type of action-reaction cycle can be authored, you can design the game this way, or it can be procedurally generated. Because of the way the branching of decisions could easily become unmanageable (1>2>4>8>16>32>64>128 etc...) procedural generation is an option.

If you're going to author the story directly (by designing the levels and story by hand), you need to find a way to limit the branches of the story. This can easily make the game seem restrictive if it is done wrong, you might make it so there is only one dungeon accessible at any time for example. It would be better to make sure there is something in the dungeon that you need before you can realistically visit another one. Character levels and level appropriate monsters make a great organic method of channeling the player. In games without character levels you could use a MacGuffin.

Even if you're using Procedural generation, limiting narrative choices can be an important part of your job. Procedurally generated games can easily become boring if there is no clear narrative thread, if there's no goal or direction, or if the generated content is too random (see no-man's sky).
Again, character levels can help. Equipment and loot can be used as ongoing goals to drive the player onward. Creating prefabs or epic items can help to stop the game from being too random. This is why the procedural generation model works so well in roguelikes which have so many of these elements.

Conclusions

 

If you're making a game, whether a linear narrative like a point and click adventure, or a non-linear narrative like a roguelike it pays to think about the action-reaction cycle:
  • Think about character goals: Does the player have a clear idea of what they are supposed to be doing fro the start?
  • Think about conflict: Is the game too easy or too hard? This can make it boring.
  • Think about disaster: Does the player have something to lose, or can they just reload a recent save game? If you haven't explored the idea of permadeath, now's a good time to look it up. 
  • Think about Reaction: How does the game make the player think and feel? Do they react to it? Maybe you need to think about atmosphere. 
  • Think about dilemmas: Does the player have an meaningful decisions to make? Does what gear they use or what tactics they use make any difference to the game?
  • Think about decision: If they have decisions to make, are they too easy? Are there too few meaningful decisions?
I think that taking this approach could help you to better author your games so that they are compelling and interesting. A game which you can't put down.


by Pickledtezcat (noreply@blogger.com) at January 18, 2017 07:59 AM

January 17, 2017

Roguelike Radio

Episode 132: End of 2016

This is episode 132 of Roguelike Radio, where Darren and Mark talk about the End of 2016!

Read more »

by Darren Grey (noreply@blogger.com) at January 17, 2017 04:43 PM