Is this agent-based "political adventure" game possible?

Started by
13 comments, last by s.Mason 11 years, 8 months ago
Hi all,

I've been developing aspects of a fictional setting bit by bit for a while, and more recently I've got it into my head to use it for a game. I enjoy both pen-and-paper and video games which are heavy on character interaction and especially political intrigue, and I'm also interested in negotiation and manipulation from a mathematical perspective; so I'd like to create something where the gameplay focuses on those things.

I'm envisioning the player character travelling around a largish game world and interacting with maybe a few dozen major NPCs, as well as some more minor characters. But instead of presenting the player with the traditional rather limited dialogue tree, each NPC would be a fairly complicated intelligent agent: capable of forming beliefs and goals, and trying to second-guess the player as well as the other NPCs with which it interacts. This would form the core of gameplay: I have a plot of sorts in mind, but the aim would be for the course of some major events to respond flexibly to the behaviour of the player, or more accurately to the behaviour of the various agents in response to the player and each other. A sort of "emergent plot", if you like; but with enough constraints to ensure that only certain "types" of actions are available to the player and to the agents.

So far I've put a limited amount of thought into how this could be implemented interface-wise: traditional dialogue options seem like they could get clunky and repetitive ("Welcome to Corneria!"), so I've been playing with the idea of using a kind of "sentence" builder with very basic syntax and Sims-style symbols in place of words - but I'm not committed to that. As I hinted at above, I've got more experience in the mathematical side than in programming and optimization, but some back-of-the-envelope calculations suggest that the logic engine of the agents shouldn't use up too much processor time.

My main goals are, in rough order of priority:

1. Engaging gameplay based on interacting with the characters in the world. The characters should feel creative and hard to predict, not two-dimensional and immersion-breaking. Combat and physical challenge will not be a central aspect of gameplay, indeed might not even feature at all, so the strength of the interaction with NPCs is essential.

2. Not boring: the player should be able to choose what content they want to experience, when. A corollary is that the game will have a non-linear, sandbox feel to it; and, for example, moving between towns should not mean having to spend ten minutes of real time walking between them.

3. An immersive setting which motivates the player to explore said content. I am also aiming for realism where possible: for example, if I need to constrain how far the player character can travel, it should be because he would run out of food if he went too far from a settlement or because his escorts will not allow him to be placed in harm's way, rather than a glass wall cutting across the landscape. Settlement sizes and distributions, etc. will also be appropriate to the setting (a roughly early Bronze Age level of technology and sociopolitical development).

I'm aiming to do as much as possible of this by myself - certainly all of the design and programming work - so I'd be keen to hear your thoughts before I sink too much time into it. Is this feasible from a programming perspective? Could it make an enjoyable game? What crucial aspects have I not thought of, and in what sort of ways might I develop some of the ideas I've had? I hope I'm not being hopelessly vague, but I'll be happy to go into some more detail on those things I have spent time thinking about.

Thanks in advance,

Robin
Advertisement
So, in other words, you're creating a game about talking to people? This is fun, but only if it influences something else. What would the player be able to do, and why should he care? I suppose that, first off, almost all characters should have differing goals, dreams, and beliefs. However, you should also make it so that the player can influence how other people turn out. For example, perhaps you can convince a person that trying for political office isn't a bad idea, and then you can convince another person to sponsor that guy. However, if you can get a person into a high-position job, that doesn't mean they're qualified, and they might be kicked back onto the streets. You have to measure the potential of a person.

I'm envisioning the player character travelling around a largish game world and interacting with maybe a few dozen major NPCs, as well as some more minor characters. But instead of presenting the player with the traditional rather limited dialogue tree, each NPC would be a fairly complicated intelligent agent: capable of forming beliefs and goals, and trying to second-guess the player as well as the other NPCs with which it interacts. This would form the core of gameplay: I have a plot of sorts in mind, but the aim would be for the course of some major events to respond flexibly to the behaviour of the player, or more accurately to the behaviour of the various agents in response to the player and each other. A sort of "emergent plot", if you like; but with enough constraints to ensure that only certain "types" of actions are available to the player and to the agents.

So far I've put a limited amount of thought into how this could be implemented interface-wise: traditional dialogue options seem like they could get clunky and repetitive ("Welcome to Corneria!"), so I've been playing with the idea of using a kind of "sentence" builder with very basic syntax and Sims-style symbols in place of words - but I'm not committed to that. As I hinted at above, I've got more experience in the mathematical side than in programming and optimization, but some back-of-the-envelope calculations suggest that the logic engine of the agents shouldn't use up too much processor time.

You used very broad words, I cannot think of any way to implement what you got in mind, other than with a traditional "decision graph".
I also think that one of the core functionalities of your game would be an interesting UI for the player.

I have yet to think of a game that doesn't use some sort of decision graph, all your features like the NPC reading your player would traditionally be achieved by:
1. awesome dialoges
2. awesome complex decision graph

I cannot think of something else and this probably isn't what you want. Since this is another major component of your game, how do you imagine you would implement such an awesome NPC?
Project: Project
Setting fire to these damn cows one entry at a time!

What would the player be able to do, and why should he care?


I mentioned this only as an aside in my original post, but the setting is Bronze Age -like, so most of the important characters will be kings, priests, generals and the like. The player character will be a minor member of one of the royal households, sent on various diplomatic missions; so he'll be expected to negotiate alliances, treaties, trade agreements and the like on the behalf of his king, but as the game progresses he'll gain some reputation of his own and will be able to act as a go-between for many of the major political players in the area. At first the motivation will be to gain the trust of the king and rise to prominence within the court - but over time, as the player discovers more about the politics of the region, they will hopefully form their own attachments and find their own part to play in events.


Since this is another major component of your game, how do you imagine you would implement such an awesome NPC?


What I'm picturing goes something like this: the gameworld has a "state", which is divided into lots of things, like who controls what territory, who's allied with whom, who's paying what taxes or who's readying their troops for war, along with environmental aspects like the weather and state of the harvest. Some aspects of the state might lie on a sliding scale, such as the happiness of various factions of the populace. Each agent assigns a level of desirability for each possible state, and also a level of belief that a given state is actually true (since there are many things the agent cannot directly know for certain). Finally, the other agents' goals and beliefs themselves form part of the state - so, for example, A might somewhat believe that B strongly wants C to declare war on D. Infinite regress is not necessary - a few nested levels of belief with a goal or "plain" state at the end is generally sufficient.

Now, it is in each agent's interests to manipulate events towards a state which is desirable for that agent. The main way agents can manipulate events is by talking to each other, and to the player. If A tells me that he thinks B stands to lose by C and D being at war, that might throw my suspicion away from the possibility that A and B are actually conspiring to overthrow C. A clever agent will work out what course of action is - based on that agent's beliefs - most likely to move events in a desirable direction. Agents can have personality traits, such as being risk-averse or quick-tempered or suspicious; these properties can be programmed in as parameters which are used by the decision engine when weighing up their options or beliefs.

I fear I may have confused things further. Please ask about things I can clarify, and I'll do my best. In the meantime, thanks for your replies so far!
This sounds like an amazing concept. It can also act as a history lesson by being a throwback to the past. Players can also learn on how the culture, diplomacy and so on works in the past. The implementation of a political adventure game is however, based on how you can think in the perspective of those political figure. Why would they want to war with another Kingdom? Why would they want to ally with you? Also, other than a political adventure game, players could also act as military strategists and devise strategies to defeat the enemy. Some random factors such as famines, natural disasters and sudden change in weather conditions can also be used. How are players supposed to adapt and overcome these problems without disrupting the original plans? Do they have to alter the plan and opt for another?

Definitely, it is a creative concept and an endless game as compared to most rpgs. There will be many options on how you can play the game whether you want to a player who prefers peace or a warmonger who will wage war at every single nation :).

What I'm picturing goes something like this: the gameworld has a "state", which is divided into lots of things, like who controls what territory, who's allied with whom, who's paying what taxes or who's readying their troops for war, along with environmental aspects like the weather and state of the harvest. Some aspects of the state might lie on a sliding scale, such as the happiness of various factions of the populace. Each agent assigns a level of desirability for each possible state, and also a level of belief that a given state is actually true (since there are many things the agent cannot directly know for certain). Finally, the other agents' goals and beliefs themselves form part of the state - so, for example, A might somewhat believe that B strongly wants C to declare war on D. Infinite regress is not necessary - a few nested levels of belief with a goal or "plain" state at the end is generally sufficient.

Now, it is in each agent's interests to manipulate events towards a state which is desirable for that agent...


Ok, so let's call it "Current World" state. I would also implement a "desired World" state for each agent and a "World change" vector. The agents actual goal is to set the "World change" vector as similar as possible to their "desired World" state. Two minor things you have to define specifically is how the parameter "desirable" and "belief" affect the actions of the agents.
Then I would also define "actors", meanign they are able to change a part of the "World change" vector.
This is the basics, and the concept seems solid to me.

Now let's get to the meat of the game, the relationships. You want intrigues, deceptions, trust, distrust etc. You also seem to want that to be dynamic, meaning every actor decides for himself what he does. Try to model the relationships from a global perspective, it isn't easy.
And now the main thing which I haven't seen concretely defined. How do they interact? By talking isn't enough.
Let's make a simple example. Actor 1 wants to see if he thinks he can trust actor 2... how do you want to do that?

Interaction with the player.
Lets assume you managed to implement everything and it models interaction better than you expected, you now need dynamic dialoges for the actors. And the dialoges need to reflect the actors intensions. How do you create a speech from an actor to the player, that indicates he wants to team up with you, but actually tries to deceive you. The best you can do is writing pre defined text. But this will eventually repeat itself and doesn't seem very natural.

That's why games like Deus Ex, who play with the far simpler principle of trust/distrust, you have pre scripted choices, answers and dialogue trees. It greatly limits the choices of the player, but in that way the responses are as natural as possible and the player has to decide to trust/distrust according to tone, choice of wording, body language etc.


IMO you have the choice between setting up complicated AI algorithms with basic dialogues, or setting up basic algorithms with complicated dialogues.
Project: Project
Setting fire to these damn cows one entry at a time!

Hi all,

I've been developing aspects of a fictional setting bit by bit for a while, and more recently I've got it into my head to use it for a game. I enjoy both pen-and-paper and video games which are heavy on character interaction and especially political intrigue, and I'm also interested in negotiation and manipulation from a mathematical perspective; so I'd like to create something where the gameplay focuses on those things.

I'm envisioning the player character travelling around a largish game world and interacting with maybe a few dozen major NPCs, as well as some more minor characters. But instead of presenting the player with the traditional rather limited dialogue tree, each NPC would be a fairly complicated intelligent agent: capable of forming beliefs and goals, and trying to second-guess the player as well as the other NPCs with which it interacts. This would form the core of gameplay: I have a plot of sorts in mind, but the aim would be for the course of some major events to respond flexibly to the behaviour of the player, or more accurately to the behaviour of the various agents in response to the player and each other. A sort of "emergent plot", if you like; but with enough constraints to ensure that only certain "types" of actions are available to the player and to the agents.

So far I've put a limited amount of thought into how this could be implemented interface-wise: traditional dialogue options seem like they could get clunky and repetitive ("Welcome to Corneria!"), so I've been playing with the idea of using a kind of "sentence" builder with very basic syntax and Sims-style symbols in place of words - but I'm not committed to that. As I hinted at above, I've got more experience in the mathematical side than in programming and optimization, but some back-of-the-envelope calculations suggest that the logic engine of the agents shouldn't use up too much processor time.

My main goals are, in rough order of priority:

1. Engaging gameplay based on interacting with the characters in the world. The characters should feel creative and hard to predict, not two-dimensional and immersion-breaking. Combat and physical challenge will not be a central aspect of gameplay, indeed might not even feature at all, so the strength of the interaction with NPCs is essential.

2. Not boring: the player should be able to choose what content they want to experience, when. A corollary is that the game will have a non-linear, sandbox feel to it; and, for example, moving between towns should not mean having to spend ten minutes of real time walking between them.

3. An immersive setting which motivates the player to explore said content. I am also aiming for realism where possible: for example, if I need to constrain how far the player character can travel, it should be because he would run out of food if he went too far from a settlement or because his escorts will not allow him to be placed in harm's way, rather than a glass wall cutting across the landscape. Settlement sizes and distributions, etc. will also be appropriate to the setting (a roughly early Bronze Age level of technology and sociopolitical development).

I'm aiming to do as much as possible of this by myself - certainly all of the design and programming work - so I'd be keen to hear your thoughts before I sink too much time into it. Is this feasible from a programming perspective? Could it make an enjoyable game? What crucial aspects have I not thought of, and in what sort of ways might I develop some of the ideas I've had? I hope I'm not being hopelessly vague, but I'll be happy to go into some more detail on those things I have spent time thinking about.

Thanks in advance,

Robin

Reading this topic encouraged me to sign up to this forum (so kudos to that :P)

My initial thoughts in relation to this topic are as follows (I will get round to reading all the other comments in a second):

1. "Engaging gameplay", "Not boring" and "An immersive setting" are not design goals. They are at best, advertising waffle. I really think you've got an amazing ideal for a game - a game that is all about diplomacy and political intrigue is a game I'd really like to play (especially as it's in the bronze age!)... but like you say your thoughts are very vague at this moment, so before you get into any sort of programming or design I would suggest having a concrete design outline - narrow down exactly what types of things the player should be able to do, how the world is set up, etc by eliminating everything that doesn't add anything to your vision for the gameplay.
And most importantly (an obvious point) before you get bogged down in the nitty-gritty of character biographies - make sure you have a proof of concept so you know that you plan to make is technically possible an could be fun. I'll be happy to give you feedback on any prototypes you make :)

2. Returning to the point about 'narrowing down' - if the game is about political intrigue and diplomacy, is it really necessary to have the player walk around for 10 minutes trying to get to another town? And is realism in all sorts of places really going to contribute to the core play? Your idea for conversation should be developed and be the centre piece - IMO large detailed maps which take along time to traverse may seem realistic in theory, but in practice it just means 10 minutes of waiting for the player who during that time won't be able to do anything that the game is designed to simulate (i.e. interactions, diplomacy etc).

3. Minor aside point - the game is set in the Bronze age, - awesome - is the player trading at all in this game? Because it strikes me that a game about social/political relationships set in the bronze age, is void without a system for trading because your position in society during that age would be influenced in no small way by your material position - e.g. finely crafted bronze jewellery, or rare items from a distant city would add to your prestige. Or an even more interesting trade point revolves around the core aspect of bronze age trading itself, e.g. tin and copper - if a city has copper but doesn't have access to tin, they cannot forge bronze and therefore the ruler will aim to get hold of a tin source for a higher price. But as I said, thats just an aside.

Two minor things you have to define specifically is how the parameter "desirable" and "belief" affect the actions of the agents.


This amounts to game theory. Each agent works out, based on its beliefs, how the other agents might react to its own actions. (Infinite regress is avoided because the game state only stores a few levels of belief for each agent.) Then it weights the desirability of each possible outcome by the strength of its belief that it will actually occur, in order to find the "expected desirability" of the outcome following from a particular action. Finally it chooses the action with the greatest expected desirability - or maybe, if it's (say) more risk-averse, the action which is least likely to have a strongly negative outcome, etc.


Now let's get to the meat of the game, the relationships. You want intrigues, deceptions, trust, distrust etc. You also seem to want that to be dynamic, meaning every actor decides for himself what he does. Try to model the relationships from a global perspective, it isn't easy.


I plan to avoid using one global set of variables to model the relationships. Instead, how strongly A trusts B is implicit in what A believes about B. For examples, if A has reason to believe that B wants X to happen, but B has told A that he doesn't want X to happen, that will make A suspect that B is trying to hide something - represented as something like "A somewhat believes that B strongly wants the following to occur: (X happens, and A believes that B didn't want X to happen)". A may then conclude that B is likely to lie to him about other things as well.


And now the main thing which I haven't seen concretely defined. How do they interact? By talking isn't enough.
Let's make a simple example. Actor 1 wants to see if he thinks he can trust actor 2... how do you want to do that?


You're right that talking isn't enough, although it will still be the main way in which agents interact. In particular, it's quite possible to set up scenarios in which A decides how much to trust B based solely on talking. For a simple example, A might confide some information and then wait to see if it gets out. Or he might ask other agents about B. Or he might ask B questions to try to determine his allegiances indirectly.

As far as other actions go, they're the sort of things which determine aspects of the state other than beliefs. So for example, if C decides to declare war on D then at some point he will want to physically send some troops out to attack him. But in practice that action will be mediated via more talking: C will give orders to his generals, who might decide to rebel. Or when the general has passed the orders on to the soldiers, one of them might sabotage the attack by letting D's commanders know the attack plans. Talking - the communication of information, along with issues of trust - will always be important, as in real life.


And the dialoges need to reflect the actors intensions. How do you create a speech from an actor to the player, that indicates he wants to team up with you, but actually tries to deceive you.


This is one of the issues I'm most worried about at the moment. In particular, I think you're completely right when you say


IMO you have the choice between setting up complicated AI algorithms with basic dialogues, or setting up basic algorithms with complicated dialogues.


At the moment I'm leaning towards a basic "dialogue" system, with intentions discernible (if at all) through context rather than wording. As a way of justifying this to myself, I remember that to become politically powerful, back then even more than today, you would have had to be very good at lying. So a suspicious diplomat might be more likely to learn about a king's true motives by asking around, or using common sense, than by relying on him having a bad poker face.


1. "Engaging gameplay", "Not boring" and "An immersive setting" are not design goals. They are at best, advertising waffle.


Yeah, fair enough. I suppose I came up with them as things to keep in mind - especially "not boring", as in the walking example that I'll come to in a minute.


before you get into any sort of programming or design I would suggest having a concrete design outline - narrow down exactly what types of things the player should be able to do, how the world is set up, etc by eliminating everything that doesn't add anything to your vision for the gameplay.


I'm very inexperienced when it comes to design, so please forgive me if some of my questions sound stupid - but how do I decide what qualifies for the outline, as something to decide on before "getting into (proper) design"?


make sure you have a proof of concept so you know that you plan to make is technically possible an could be fun. I'll be happy to give you feedback on any prototypes you make


Absolutely, and thanks.


is it really necessary to have the player walk around for 10 minutes trying to get to another town?


Definitely not. I meant that I planned to avoid things like that, say by having some sort of fast-travel feature. Of course, the player might be interrupted on his journey, maybe because he's ambushed by bandits or meets someone he knows en-route - in which case he might not arrive at his destination straight away when choosing the fast-travel option.

When I talked about realism, I was referring more to things like: How many people live in the cities? What are the ratios of the various professions? How many villages are there for each city, and how much do they pay in taxes? How are governors distributed among the settlements? Who trades what with whom, and how much? Some of these details may only live in the background of the game, in the form of area layouts, NPC appearances and so forth; but by aiming to make them realistic I hope to enhance the player's willingness to "buy into" the setting (as well as satisfying my own pedantic tendencies).


3. Minor aside point - the game is set in the Bronze age, - awesome - is the player trading at all in this game?


Trade will absolutely play a part in the game - for example, the player will end up negotiating trade agreements, that sort of thing. I don't know yet how much trading the player himself will be doing: he gets his social status from being related to a king, who presumably got to his position through trade or conquest - or is descended from someone who did. These days the royal family will get its wealth from collecting taxes, tributes and trade with neighbouring kingdoms, all of which (at least on paper, so to speak) pertain to the property of the king himself. The player will have access to some of that wealth as an allowance, as well as his wardrobe etc. - and might occasionally need to barter for particular items, but I don't see him taking on the role of a full-time merchant.
Sorry if I have sounded a bit aggressive in my last post, this wasn't my intention.


You have a good idea, now you have to get more specific with your mechanics. I urge you to sit down with a pencil and make a crude draw of your class diagrams.


When I asked you to specify the desirability and belief mechanism, you answered with this.

This amounts to game theory. Each agent works out, based on its beliefs, how the other agents might react to its own actions. (Infinite regress is avoided because the game state only stores a few levels of belief for each agent.) Then it weights the desirability of each possible outcome by the strength of its belief that it will actually occur, in order to find the "expected desirability" of the outcome following from a particular action. Finally it chooses the action with the greatest expected desirability - or maybe, if it's (say) more risk-averse, the action which is least likely to have a strongly negative outcome, etc.


In your previous posts about you wrote about belief differently

Each agent assigns a level of desirability for each possible state, and also a level of belief that a given state is actually true (since there are many things the agent cannot directly know for certain). Finally, the other agents' goals and beliefs themselves form part of the state - so, for

This tells me your game mechanics are in the idea stage. The Ideas are good, but they are potentially hardcore difficult to implement, so we need to start with concepts how to "model" the mechanics.

Both your texts are great for discussing an idea, or explaining the game to an amateur. But we don't need to discuss the idea anymore, your idea is great, the implementation is the hard thing with this.
I cannot see any programming concepts in your text. Don't give example how it should work, write it concretely. What influence does a high belief/low desirability have. what a medium/medium. How do they change. Write down specifications, then you start to see what might work/not work.


The greatest undefined mechanic in this is the interaction.
Going back to the example: Agent A goes to agent B and wants to know if he can trust agent B. This is the simplest example I can think of. Here all the belief/desire already comes to play. For now you can also remove the option that B is trying to double cross A. Write down what the instances A and B should have, what values the instances ask from each other and a basic formula that spits out the trust level.
From there expand your concept, how would B double cross A? Then expand: how would A notice B might double cross him? Then expand: how sure is B that A trusts him?
Then you have a solid concept about the basic interactions of agents.

From there you can go on how A and B decide further procedures.


E: on the Dialog thing: You don't seem to be the guy that is happy with easiest solution. I presume this is a time eater, you can put in as much time in it as you want, it is never finished and can always be better. Keep that in mind when you really want to implement this.
Project: Project
Setting fire to these damn cows one entry at a time!
I like the idea of deeper goal-oriented gameplay. I think the emergent behaviour could be very interesting.

However, from a feasibility perspective you need to consider the speed and potentially combinatorial explosion. Think of it like doing an accurate gravity simulation. The level 0 assumption is that down is down. The level 1 assumption is that towards the planet centre is down. Then we get increasing difficulty levels such as "add the effects of every large mass", "add the effects of every mass" and "integrate over every particle in the simulated universe". If you simulate a full personality for every individual, and their relationships to every other person, that's like the latter version. It's not impossible, but it's fairly improbable for more than a few dozen NPCs at a time. You could for example fully simulate the most important/nearby NPCs. The rest could be broken up by faction, e.g. which faction is the individual's personality closest to, simulate them using that faction's motivations. Also do you intend to only simulate the important people? if you want to simulate everybody... I'm afraid the unwashed masses would need to be simulated in a more "down is down" manner.

As far as getting a more solid design... put an arbitrary limit on your thinking for now. Think of an old-fashioned game. Traditionally the number of actions is pretty low compared to some of the modern monstrosities. Pick something like that, maybe 7 actions total. What are the 7 actions that define your game? Cut it down brutally. For example, forget up/down/left/right, focus on the nuts and bolts. Perhaps "travel to location", "give tribute", "demand tribute", "negotiate", "agree", "disagree", "trade". Not great examples, but that's your job. wink.png It's not essential to be as minimal as possible, but until you do that you won't really know what the core of your game is. Everything else should complement that. And avoid duplicates, e.g. actions whose purposes overlap too much.

This topic is closed to new replies.

Advertisement