Automated storytelling and interactive plot in games

Started by
121 comments, last by Trapper Zoid 18 years, 7 months ago
Quote:Original post by Trapper Zoid
sunandshadow, since you come from a literary background, can you describe the basics of how you would design a story generation system?


Sure. I'll try to sketch out the text-only generated interactive story game I was saying we should aim at. I also want to point out that I don't think it would be too hard to switch to a graphical interface after the game worked in text mode.



Okay, you turn on the game. Here are the steps the program has to go through to make the game happen:

0. (Optional) Gather input from the player which can be used to customize the story generator's output to the player's taste.

1. Spawn a fishtank (enclosed 3D area) which will be the stage for the game or the first level of the game. Spawn the PC (or multiple PCs for a multi-player game I suppose). Good default placements might be the middle of tank floor, one end of the tank, one corner of the tank, etc.

2. Run the Story Generation Engine. This involves consulting the player's preferences if known, and accordingly choosing a setting/genre for the game, choosing one or more Goals which will signal the end of the first level/chapter, choosing Obstacles and methods for overcoming these Obstacles, etc.

3. Spawn the Goal(s), rooms/walls, NPCs, tools, etc. called for by the engine, making sure the Obstacles are in between the PC and the Goal(s), and any tools necessary to overcome the Obstacles are in between the Obstacles and the PC. Random objects such as trees and monsters may also be spawned now.

4. Communicate to the player the initial equilibrium of the setting and how it is disrupted by the initial incident. This can be done in several ways:
- A. The PC witnesses the initial incident as it happens.
- B. The PC recalls the II as introspection.
- C. An NPC directly tells the PC about the II.
- D. The PC eavesdrops on NPCs discussing the II.
- E. An omniscient Narrator describes the II.

5. Control of the game is released to the player, who explores the PC's immediate surroundings. This may include encountering and fighting enemies, talking to NPCs, solving puzzles, acquiring and using objects (including money), playing mini-games, and managing equippage. In the course of all this the PC encounters Calls To Action and Hints. The first call to action (aka telling the player a Goal to pursue) may optionally be delivered along with the initial incident. Other than that, these bits of info may be delivered by means of NPC dialogue, finding written info objects, finding physical clue objects (with accompanying introspective interpretation), and introspective error messages when the player attempts an action that doesn't work. This is the Rising Action phase of the plot.

6. The last Obstacle standing between the PC and the Goal is the Climax, and may be made more dramatic by being a particularly complicated or dangerous Obstacle, emphasizing the nearness of the Goal by one of the methods listed in step 4, having the villain NPC (if there is one) taunt the PC, and/or dramatic music.

7. When the PC obtains the Goal (note that in certain games this may include the PC's death at the end of the game) it is essential to praise/reward them in some way, and to either communicate that the initial equilibrium has been restored/repaired if the game is over; or if the game is not over, present them with a portal to the next level/chapter and repeat this process from step 2 including communicating a new goal.

I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.

Advertisement
Quote:Original post by achilles_
I did consider that for a while, but it seemed far too complicated to start writing agents to deal with the player. Instead, I simply write responsive behaviours as a framework, and generally that's enough to catch aberrant behaviour.

The large-scale project that I'm working on (and one day hope to make some real progress with ;-) will involve severe punishments for players who break certain in-game laws, of which stealing is one example. I could create agents to monitor the player's behaviour and adapt the game to deal with the player, but I figured a more natural approach would be to use the NPCs. When they need an item and discover that it's missing they try to relocate their items. As NPCs can ask each other about seeing a particular item (great for spreading gossip), they have a pretty good chance of finding more interesting items. Should a player be discovered stealing by an NPC, other NPCs will be told and eventually the player will be dealt with within the context of the game.


I agree that the AI for the characters has to be left manageable, but I didn't really mean it in a law watching kind of sense. Maybe I should use a better example (and apologies in advance, I'm not really thinking clearly today, so there's a good chance this will sound like rubbish too...)

My feeling is that a character based approach like the one you are implementing, and the one I originally envisioned, would be improved with a bit of plot structure, even if that's forcing a series of "interesting events" to occur to the player that the NPCs might not otherwise choose. The purpose of these hidden "agents" were to manipulate things behind the scenes in order for interesting things to happen to the player. To use another more complex example, suppose the player was being a good citizen but needed an interesting event; the hidden "agent" could arrange things so that the player was framed for stealing something. This might involve manipulating an NPC to do the framing that it would not otherwise choose to do, but would help keep the player interested.

Quote:
Hurrah for consequences in gaming!


I agree with this too! That's the whole justification for me working on dynamic storylines.

Quote:
The nice thing about this kind of simulation is that it allows me to bring in some other concepts that I really would like to introduce to games, such as senesence and multi-generational stories. :-D


Had to check the definition of this one; senescence is my new vocabulary word for today! How are you planning on incorporating something like that into this, by running the simulation for multiple generations? It's starting to sound a bit like the project I'm planning for myself right now, although mine doesn't have a murderer element.

One thing I'd like to do with plot-based games is episodic gaming; breaking the plot into small gaming chunks that flow into each other like the episodes in a TV series. But that's way in the future for now...

Quote:
It's not ready for anyone other than me to play with yet, but when I've polished it I would like to release it. I might need to change the plot slightly, as there's a rule with watching the stage play of the Mousetrap where you're not really allowed to tell anyone whodunnit. :)


If you do finally release it, please tell me too! It sounds great!
Quote:Original post by sunandshadow
Okay, you turn on the game. Here are the steps the program has to go through to make the game happen:

0. (Optional) Gather input from the player which can be used to customize the story generator's output to the player's taste.


I like this step, that's something I've always wanted to be included in games, and I think dynamic storied games is a perfect genre to include this. It would be great if you could vary the story content to fit different audience levels, for example (by varying the amount of violent or mature story scenarios or fragments), or specifying what the story would be about.

The other steps you've included sound a bit like a more instantiated version of the Propp-style story grammar. Those story systems work pretty much in the manner you've described:

1. Start of with an initial condition (PC, NPCs, any predefined objects; I like calling these the "cast and props").

2. Then create the conflict incident. This usually involves the PC lacking something, either passively (such as a spouse or money) or actively (a villain NPC kidnapping an NPC important to the PC). This also (at least partially) defines the Climax; confronting the villain or gaining the object.

3. The middle of the story is fleshed out by creating a series of tasks for the PC to do, such as helping people to get gifts of useful tools or information (the "donor" motif) or gaining people's help (the "helper" motif. This where a logical framework such as my "door and key" model becomes useful if this part is to be interactive

4. Once enough tasks have been done, the Climax occurs, and either the story ends, or a new cycle begins (if the NPC gets kidnapped again, or a new NPC claims credit for the PC work (the "false hero" motif).

While I do think that a pure Propp based approach is a bit rigid (frankly, I suspect that the reason that Russian folktales are so easily catalogued is because they stem from only a few original early tales), I think this has the beginnig of a really great quest model for interactive storytelling. There's been a few attempts of this already; Vanquish provided a link to the OPIATE system by Chris Fairclough which is up in the links above that attempts a Propp based approach.

But what I do also think needs to be done in these systems, and which you have included in your description, is to more deeply integrate the player with a sense of drama in the model, such as the key step of prasing/rewarding the player at the end of the cycle. This hasn't really been done in the systems I've seen (understandably due to the time constraints of implementing these models) but would make the whole thing much more dramatically powerful.
I would call my version Freytagian rather than Propppian, but I suppose my own mental model of plot grammar is informed by Propp as much as anything else.

I'm going to read Chris Fairclough's thesis, looks fascinating, but it's 200 pages long, so not tonight. ;)



Mainly I am posting now because I wanted to remedy a major omission in my previous post: I didn't talk at all about how the NPC AI supports the plot interactivity. There are three seperate difficulties of NPC AI design:

1) Dialogue generation (which is also an issue for narration and introspection) is probably most practically addressed by an Eliza approach.

2) Information control (knowledge differences between NPCs, ignorance, rumors, learning from conversation, and NPC item posession could also be included here) is probably best handled by Venn subsets in a SOAR knowledge database.

3) Emotional/personality modelling requires a map of all possible personality states and numerical gauges which determine the NPC's emotional state and how that emotional state is affected by various inputs.


If those difficulties could be overcome, and adding the standard problem-solving type of AI, I believe a very realistic social gaming experience could be created by assigning various NPCs different personality types, starting emotional stated, esthetic preferences, and their own Goals at cross-purposes with the PC's Goal.

I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.

You guys have a great discussion going on here! I'm visiting from GarageGames where we've been having a similar discussion (Reviving the "Role-Playing Experience" Thread).

I'm currently implementing Derivitive Data Structuring into my design for Infinity (MMORPG), with DDS as the sole component for almost everything in the game, including context sensitive conversation between PCs, NPCs, and enemies.

DDS is based on data which is derived from parent data based on context, mood, and situation. Everything from skills to combat to conversation take the parenting structure and use it to produce clean, coherent results. It's also quite effective for realistic decision-making AI.

I've been working on this for the past eight years, so it's nice to see that others are coming to similar conclusions about where the RPG experience should take us in the future.

- Ronixus
How about a plot-outline generating system?

Ie. it takes the 'heroic quest' template and spews out a randomised version of it.

Your master ---- has had the ----- stolen and it has been taken / split into seven pieces / can only be reunited if you pass tests X,Y and Z.

It then sticks in some different levels between each static plot point.
While that is a good start...you've merely come up with randomization.
What we're working towards is a dynamic structure of storytelling that creates itself and recreates itself based on interaction and reaction, as well as npc needs and context.
Alfred Norris, VoodooFusion StudiosTeam Lead - CONFLICT: Omega A Post-Apocalyptic MMO ProjectJoin our team! Positions still available.CONFLICT:Omega
Quote:Original post by Vanquish
towards is a dynamic structure of storytelling that creates itself and recreates itself based on interaction and reaction, as well as npc needs and context.


Well, I haven't been following the work that you've all been doing, but my 'advice' would be to start simply. Make a game where the structure of the plot is fairly rigid, but can be done in different ways. Ie. A basic heroic quest

Ie. Using my example, in one 'story' you would need to collect the five fragments of a sacred artifact to save the world,
the next you would have to reawaken six spiritual leaders etc.

But how does this become dynamic? Well, that's the thing -it doesn't- if people accept that some parts of the story / game are unchangeable then they won't worry so much about being able to escape the story bounds.

Maybe the dynamic content would be what comes before and after each major set-piece / plot point. Ie. The NPC interaction. But you would still be rescuing the fragments of the Triforce etc.
Umm, Ketcheval... what the heck would be the point of that? Aside from the fact that it would be horribly boring to play, non-dynamic story generators already exist. The whole point of this discussion is formulating an approach to creating a _dynamic_ story generator because we don't have a good one yet.

I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.

Exactly. We're needing something waaaaay more than just random.

In our case we have large NPC groups with needs/goals and individual NPCs with needs/goals. On a crude crude level, these needs will create quests for players to accomplish. Then of course that automatically creates a sub-level of how one NPC can help a player fulfill another NPCs need. Depending on what modifiers you introduce, the outcome of the quest attempt can be anywhere from success, partial success (including success in time for x,y z), to failure...which in turn creates a shifting set of needs...with resulting quests.

Ive re-read that and Im thinking to anyone but me it sounds like gobbldegook.
Here's what I mean.

Your character finds a computer in an abandoned facility and uses his hacking skill to determine when Faction X will be dropping a shipment of XYZ at the doc.
Earlier you had been asked to find this shipment by NPC Y. If you can get this to him in 24 hours then he will give your guild the blueprints for EFJ weapon.

Lets say you raid the shipment with your group and take it over successfully. This means that Faction X will offer quests to a) hunt you down b)go find another shipment of cargo XYZ and c) be unable to equip their troops with the ammunition for EFJ weapons. NPC Y will now be able to sell XYZ at his merchant tent and his standing in the NPC world will increase/change. Perhaps he decides not to sell to mutants because some other NPC asked a mutant player to steal the EFJ back from him.

Thats not even a very detailed version...but its not really random at all. Its dynamic and it has a dynamic effect on the capabilities and quest offerings of multiple NPCs and the player world.

Such a thing is do able...and the first to do it well will be hailed as a groundbreaking game.
Alfred Norris, VoodooFusion StudiosTeam Lead - CONFLICT: Omega A Post-Apocalyptic MMO ProjectJoin our team! Positions still available.CONFLICT:Omega

This topic is closed to new replies.

Advertisement