How to Achieve Truly Dynamic Events

So I've been mulling over this for a while and I just can't seem to come up with a solution, so I've decided to ask you guys for your thoughts on what I've drudged up so far and if it makes sense. I put this in General Discussion because I'm sure the concepts could be applied to SG, especially with the stated goal of having a really dynamic story.

My problem is that random event systems aren't really all that random. Generally there's a list of events that could happen and a bunch of anchor points that the events can occur at. An RNG loops over and over until it lands on one of the events and bam, "randomness" occurs. The problem is this isn't really random, and it doesn't feel random. In the end, there's usually not that many events and the player sees something that has already happened and suddenly the immersion is broken and all the mystique dissolves in the face of the limitations of the system.

So how do we avoid this? I feel that the solution is in AI. The reason events have the be guided at all is that the AI isn't smart enough to interact in a way that an event will arise. Let's take a gander at good ole Skyrim:

Skyrim's random event system is pretty much exactly as described above. Radiant grabs an event from the list and throws it down just out of the player's line of sight, and then the player happens upon it. The NPCs are scripted to do something on some trigger, and then... nothing. There's probably a hundred or so of these events that can occur. Maybe a bandit trap is set with a broken down carriage where the bandits attack the player when they go to investigate. So what's the problem with this system?

Well the problem is that a developer can only make so much content. Once the player exhausts the full list of events, nothing new can happen. The player realizes this and loses their sense of adventure. The first time that bandit attack comes you're taken by surprise. The second time might catch you off guard, but after that it's all just repetition. Games like Skyrim have a huge initial burst of excitement as people find new things and experience fresh experiences, but it quickly dies once people have run through the list.

The solution then is to find a way to make it so these events happen on their own without any parameters other than an RNG seed and happenstance. And the only way to really do that is a complex AI. I believe it is necessary for two artificially intelligent entities to interact in a way that is not simply a boolean "kill or don't kill" decision. This does not mean that they need to be perfectly human, or even close to it. However, it does mean that there needs to be more than two reactions to every action by the other entity.

Consider the following scenarios. Let's say that two NPCs happen upon eachother. They have an interaction that is 3 events long.

Situation 1: The NPCs follow a boolean decision tree. There are a possible 2^3 (8) full interaction sequences. That means that there are eight total series of events that could transpire.

Situation 2: The NPCs follow a ternary decision tree. There are now a possible 3^3 (27) full interaction sequences. This means that there are 27 total series of events that could transpire.

Adding a single extra decision per interaction more than triples the possible series of events. So now in our 3 event interaction, instead of landing on "kill", let's say one of the NPC's AI RNG lands on "Greet Happily". From this action, the other NPC's AI then looks at its internal table for appropriate reactions to "Greet Happily" and applies some sort of weighting based on perhaps an internal happiness meter that records the overall progress of the conversation. So now this other AI's RNG lands on "Approach Cautiously", but it could have also landed on "Kill" or "Greet Happily". In response to this, the first AI looks up appropriate reactions. Let's say that this is a "Sneaky" type AI. The appropriate sneaky reactions to "Approach Cautiously" might be something like "Attack", "Approach Happily and Then Attack", or simply "Idle Chat". So it lands on "Approach Happily and Then Attack", and suddenly this Sneaky NPC has cut the other's throat and a dynamic event has happened.

The nice part about this is that you have a completely dynamic event that has an implied story behind it, but was simply a result of RNGs. It wasn't hard coded and the outcome wasn't predetermined. Perhaps the first NPC instead rolled "Kill" right off the bat and attacked the second NPC. From this the other NPC could roll "Defend", "Flee", or "Yield", to which the first will respond with something similar.

From an abstract standpoint, this is a very simple thing to implement (But then again, what isn't? :p). Simply add a tree data structure for each AI personality type you want and populate it with decisions as you wish. The truly important part is choosing decisions that will create memorable and worthwhile events.

Now all this doesn't mean that there shouldn't be something like Skyrim's Radiant system for random events. However, I believe the actual event should be handled by the AI, while a system like Radiant should only be used to plop down some actors and maybe some influencing props and then let them do their thing.

I think this could be a great system to implement in Sui Generis in place of a random event generator, which would stale rather quickly. I would encourage BME to focus on AI, as it is so much more worthwhile than a random event generator. Also I love all of you. That is all.
 

Pilluminati

Insider
I'm pretty sure their aim is to not have "events", just consequences stemming from an advanced AI system. Of course it will be extremely difficult to do, and I'm wondering how they will simulate the whole world (or will they?).
If they succeed the game will be out of this world.

Quote from the last update:

"One of the core concepts is that NPCs never do things just because we designers said they should. Everything they say and do is the result of a decision. They have goals, ambitions, emotions and various traits that guide everything they do. To create behaviours and plotlines we first have to create motivations. NPCs will always have choices and they will make one because the conditions are right. A great many parameters are involved in making any of these decisions and altering any of them can change the course of events. This doesn't just apply to specific plotlines, we want every apparently insignificant NPC action and behaviour to be driven by decisions and always to react to changing conditions.
Can we really do all this? As we've said before, we have to try. It is difficult, we ourselves have to occasionally remind ourselves why it might be possible. We are committed to it and actively working towards it. To us this is the only way worth doing it. It’s the same attitude we have with everything. We're doing combat using physics because that's kind of how it works. It might be far from perfect but it's a lot better and infinitely less boring than comparing a couple of numbers."
 
The way I see it, the AI is the most important thing, as you say. But, I don't think selection of predetermined responses is the right way to go. As said in the update, things should be based on decisions. To get decisions, we apply logic using knowledge to achieve our goals. Our goals are determined by desires and desires by opinions. So, if you take your example of two NPCs meeting, assuming they have happiness stats and assuming these are both high, they like life - this is their opinion. This causes them to want to continue life - the desire. The desire becomes a goal, stay alive. And then we come to the decision, how do we stay alive.

One NPC will see the other, and instantly gain knowledge, they can see a stranger, and the stranger has a sheathed weapon. This instantly rules out fight, because their goal is to live and they will die as they are unarmed. So then using knowledge, the NPC thinks (based on intelligence stat) this guy could be a bandit. So the decision is to flee. Obviously, a less intelligent NPC gains less knowledge overall.

Another more normal circumstance. A farmer likes his family. His desire is to spend time with them. His goal is to preserve their life. He knows they will starve soon. His decision is to buy food to feed them. He has no money - he knows he is bad at stealing so he takes the longer route of selling his crops for money.

The trick with this system is ultimately two things, the acquisition of knowledge, and the appropriate modifications of opinions. Those two things essentially decide everything. If they can be programmed to happen automatically, character traits and stats will do the rest. Another difficulty is the jump between opinion and goal. It may end up that all possible examples have to be hard-coded. But, this should be easy as the goals are mainly simplistic eventualities.
 
The way I see it, the AI is the most important thing, as you say. But, I don't think selection of predetermined responses is the right way to go. As said in the update, things should be based on decisions. To get decisions, we apply logic using knowledge to achieve our goals. Our goals are determined by desires and desires by opinions. So, if you take your example of two NPCs meeting, assuming they have happiness stats and assuming these are both high, they like life - this is their opinion. This causes them to want to continue life - the desire. The desire becomes a goal, stay alive. And then we come to the decision, how do we stay alive.

One NPC will see the other, and instantly gain knowledge, they can see a stranger, and the stranger has a sheathed weapon. This instantly rules out fight, because their goal is to live and they will die as they are unarmed. So then using knowledge, the NPC thinks (based on intelligence stat) this guy could be a bandit. So the decision is to flee. Obviously, a less intelligent NPC gains less knowledge overall.

Another more normal circumstance. A farmer likes his family. His desire is to spend time with them. His goal is to preserve their life. He knows they will starve soon. His decision is to buy food to feed them. He has no money - he knows he is bad at stealing so he takes the longer route of selling his crops for money.

The trick with this system is ultimately two things, the acquisition of knowledge, and the appropriate modifications of opinions. Those two things essentially decide everything. If they can be programmed to happen automatically, character traits and stats will do the rest. Another difficulty is the jump between opinion and goal. It may end up that all possible examples have to be hard-coded. But, this should be easy as the goals are mainly simplistic eventualities.

The problem with the system you described is that the implementation is insanely complex. I don't know your background or if you've had experience in coding or computer design, but a system in which the AI truly learns is something that requires a massive amount of resources in both design and runtime. Computers operate on pure logic, meaning that these abstract concepts that you mention like desire, knowledge, fleeing, and thinking need to be put in terms the computer understands - numbers, or at a higher level, raw data. To have believable and dynamic interactions happening on a frequent basis, you would need to convert a large portion of the human psyche into code, which is no small task. It's easy to say that happiness could be valued as a quantity, but that value means nothing without actions that occur because of it.

You are correct though, decision trees are widely regarded as not being a true AI. And I very much agree with you that if it were possible to implement such a system, I would want to see it implemented without question. However, I don't think anyone has ever come close to designing a system like what you describe, not just in games, but in any field. And if it has come close, it's something whose AI is really just a crowdsourced amalgamation of inputs and responses from users like Cleverbot.

What I'm trying to do here is propose a feasible, if less robust, version of this that uses weighted decision trees as a base from which the team can work off of. BME has developed some really neat technology, and I would love to see them make a true AI, but for a small team with limited resources and time, it doesn't seem remotely feasible. This doesn't mean I don't want them to try and innovate in their AI development. I'd love to see some really sleek decision making in NPCs. But I'm just here to provide a reasonable option :)
 
The problem with the system you described is that the implementation is insanely complex. I don't know your background or if you've had experience in coding or computer design, but a system in which the AI truly learns is something that requires a massive amount of resources in both design and runtime. Computers operate on pure logic, meaning that these abstract concepts that you mention like desire, knowledge, fleeing, and thinking need to be put in terms the computer understands - numbers, or at a higher level, raw data. To have believable and dynamic interactions happening on a frequent basis, you would need to convert a large portion of the human psyche into code, which is no small task. It's easy to say that happiness could be valued as a quantity, but that value means nothing without actions that occur because of it.

You are correct though, decision trees are widely regarded as not being a true AI. And I very much agree with you that if it were possible to implement such a system, I would want to see it implemented without question. However, I don't think anyone has ever come close to designing a system like what you describe, not just in games, but in any field. And if it has come close, it's something whose AI is really just a crowdsourced amalgamation of inputs and responses from users like Cleverbot.

What I'm trying to do here is propose a feasible, if less robust, version of this that uses weighted decision trees as a base from which the team can work off of. BME has developed some really neat technology, and I would love to see them make a true AI, but for a small team with limited resources and time, it doesn't seem remotely feasible. This doesn't mean I don't want them to try and innovate in their AI development. I'd love to see some really sleek decision making in NPCs. But I'm just here to provide a reasonable option :)
I get the feeling that the implementation for many features of the game that already are in place are insanely complex. :) What the devs seem to be striving for is pretty close to what fluffydino2000 envisioned. While a perfect simulation of character motivations has never been achieved and if it ever was it would be very computationally expensive, a more basic system could be created (especially for events that don't take place on screen) that would be relatively inexpensive but still far beyond current RPG standards.
 

Torhque

Insider
OP, what you just explained is literally the system behind the AI interaction between survivors on this other Alpha-funded game called Project Zomboid. I'd link you directly to the article where they explain it, but I'm typing this on my phone. Go Google it man, that game is shaping up to be the most amazing Zombie Survival RPG to date. Also, I think the system they will have is actually better than what you explained haha.
 
Top

Home|Games|Media|Store|Account|Forums|Contact




© Copyright 2019 Bare Mettle Entertainment Ltd. All rights reserved.