Dynamic Story Generator
by Jack Stone · in General Discussion · 05/18/2008 (6:28 pm) · 11 replies
I am currently working on a game project that strives to immerse the player as much as possible, as part of an attempt to create as much "Emotion" in the game experience as possible (see my other post).
One of the things I will need in order to make that happen is to have a dynamic storyline, that cannot be "predicted"
even if the player has played the game before. I have written code to implement a basic tree structure, to allow branching missions.
I was thinking of using event "Templates", which would be stored in a library of sorts, and the system would mix and
match several of them. For example, there would be 50 possible mission events, arranged into categories, such as
end of game, beginning of game, etc etc, and the system would pick several of them, and string them together in a random
order, so that the player would never know which event was going to happen next. Events could include things like characters being killed, changing sides, being kidnapped, etc etc.
I would also need to include things like conversations for the games NPC's (they would change depending on past actions by the player)
and possibly art assets, or character/enemy types. (The system could choose enemies, characters, or certain mission layouts depending on a variety of factors)
I was wondering if anyone has implemented anything like this before? Or if anyone has any ideas or advice in general?
One of the things I will need in order to make that happen is to have a dynamic storyline, that cannot be "predicted"
even if the player has played the game before. I have written code to implement a basic tree structure, to allow branching missions.
I was thinking of using event "Templates", which would be stored in a library of sorts, and the system would mix and
match several of them. For example, there would be 50 possible mission events, arranged into categories, such as
end of game, beginning of game, etc etc, and the system would pick several of them, and string them together in a random
order, so that the player would never know which event was going to happen next. Events could include things like characters being killed, changing sides, being kidnapped, etc etc.
I would also need to include things like conversations for the games NPC's (they would change depending on past actions by the player)
and possibly art assets, or character/enemy types. (The system could choose enemies, characters, or certain mission layouts depending on a variety of factors)
I was wondering if anyone has implemented anything like this before? Or if anyone has any ideas or advice in general?
#2
I've just starting reading a book called "The Hero with a Thousand faces" by Joseph campbell (http://en.wikipedia.org/wiki/The_Hero_with_a_Thousand_Faces). If anything is capable of providing a "formula" with which to automatically create a storyline, I think this is it.
This book basically analyses stories, in terms of the "Hero's Journey" and describes the stages that the hero must go through from beginning to end. This could provide the basic parameters for a mission generator, just choosing elements that fit the formula.
05/20/2008 (2:45 pm)
I agree with the point about complex AI. I've spent a long time researching various AI techniques, in preperation for this kind of project. One of the most difficult things about it, as you suggested, would be generating mission in sequence, so that event B occurs after event A, rather than just randomly selecting a number of events.I've just starting reading a book called "The Hero with a Thousand faces" by Joseph campbell (http://en.wikipedia.org/wiki/The_Hero_with_a_Thousand_Faces). If anything is capable of providing a "formula" with which to automatically create a storyline, I think this is it.
This book basically analyses stories, in terms of the "Hero's Journey" and describes the stages that the hero must go through from beginning to end. This could provide the basic parameters for a mission generator, just choosing elements that fit the formula.
#3
05/20/2008 (2:58 pm)
The book is definitely an interesting study in the functionalist approach to mythology as seen through a Western lens. The functionalist approach is handy when you are working with systematic representations. Quite a fun read. Levi Strauss and Bronislaw Malinowski are both interesting reads as well.
#4
05/21/2008 (6:52 am)
The Hero's journey isn't the only type of story structure that you can use for this. Remember that in any repetitive game, the player will get used to the structure very quickly, so you may want to look into other plot structures to combine with it.
#5
I've never heard of Strauss of Malinowski David, I'll look them up, thanks.
05/21/2008 (4:17 pm)
In most games though, the "structure" is fairly transparent anyway, so I don't know if the player would really notice even it was repeated in a predictable manner. I've never heard of Strauss of Malinowski David, I'll look them up, thanks.
#6
You could write 3 stories complete. When the player starts one of the 3 stories and completes one of them fully, then would miss out on the alternate 2 stories.
If at specific parts of the story, the player didn't complete the quest in good time then parts of the story would be missed.
If you add prejudice and faction points ( unseen to the players ) you can guide the player through the quests and the ending would be random since it all depends on the players personal actions and skills.
05/21/2008 (4:47 pm)
@JackYou could write 3 stories complete. When the player starts one of the 3 stories and completes one of them fully, then would miss out on the alternate 2 stories.
If at specific parts of the story, the player didn't complete the quest in good time then parts of the story would be missed.
If you add prejudice and faction points ( unseen to the players ) you can guide the player through the quests and the ending would be random since it all depends on the players personal actions and skills.
#7
Look up Story Structure Architect by Victoria Lynn Schmidt. It has some interesting ideas, even if you yourself may find only one or two interesting. With a single player game, you would have a little more leeway in throwing things at the player, as the CPU running it will be dedicated to that one player.
05/21/2008 (4:59 pm)
@Jack: Yes, in most games the story structure is fairly transparent, but that's part of the problem. After all, if the player didn't notice, there wouldn't be any complaints, and noone would be investigating this path as much as is happening.Look up Story Structure Architect by Victoria Lynn Schmidt. It has some interesting ideas, even if you yourself may find only one or two interesting. With a single player game, you would have a little more leeway in throwing things at the player, as the CPU running it will be dedicated to that one player.
#8
I was reading in David Freemans book (Creating Emotion in games) about an idea where you would write several story "Elements" which could be played in any order, would were also self-contained sections, with appropriate game play, character interactions, etc. This way the player can choose (either directly, or indirectly) which element to play and in what order.
@Ted, I looked up that book on Amazon, it looks like a good read, thanks for the advice. I was originally thinking of making a single-player only game, but the current state of the art with Artificial intelligence just isn't enough for an immersive and dynamic game. You could do one or the other, but not both, so I decided to merge multiplayer and single player, and create a type of hybrid MMO. I'm still not 100% sure of the details, but I think it could work.
05/23/2008 (2:20 pm)
@Scott: I am assuming from your description that you mean there are specific areas in the story where it can branch off, and merge with another one of the stories? That's not a bad idea, that would have a fairly strong random element to it. I was reading in David Freemans book (Creating Emotion in games) about an idea where you would write several story "Elements" which could be played in any order, would were also self-contained sections, with appropriate game play, character interactions, etc. This way the player can choose (either directly, or indirectly) which element to play and in what order.
@Ted, I looked up that book on Amazon, it looks like a good read, thanks for the advice. I was originally thinking of making a single-player only game, but the current state of the art with Artificial intelligence just isn't enough for an immersive and dynamic game. You could do one or the other, but not both, so I decided to merge multiplayer and single player, and create a type of hybrid MMO. I'm still not 100% sure of the details, but I think it could work.
#9
You post caught my attention because I am using this method for my game. I see no reason not to share the concept since others can and likely will implement better then I will.
I have written a Base history of a world. In this world their are countries, each with a ruler, each with a religion, each with their own countries agenda.
Players can choose what city to start in. They can leave that country and work for another country but at the expense of faction points with their homeland. This would be a turning point.
Each country having an agenda for what the world should be like .. will have their own history, current events, and purpose for seeking players to work for them. Players that choose to help then gain faction points for each task. The better the player performs, the better the reward and also unbalances that players faction with other countries. So in essence is another turning point.
You can easily change the tides on a player with invisible faction points..example would be to reward more points for a small task for the player.. but important to the country.
This is just one element in my game but I think it suits your need.
The design allows for Writers to come and go as they please.. that is.. your hired story tellers. Since the world would already have a base.. each story teller can add their own twist.. and if that story teller decides not to stay, you can hire another.. who then can read the history and story up to that developemnt point and then add their own flavor.
Doing it this way is because I believe that "Everyone is replaceable" and only the truly committed and best working will remain till the day of publish.
05/23/2008 (3:13 pm)
@JackYou post caught my attention because I am using this method for my game. I see no reason not to share the concept since others can and likely will implement better then I will.
I have written a Base history of a world. In this world their are countries, each with a ruler, each with a religion, each with their own countries agenda.
Players can choose what city to start in. They can leave that country and work for another country but at the expense of faction points with their homeland. This would be a turning point.
Each country having an agenda for what the world should be like .. will have their own history, current events, and purpose for seeking players to work for them. Players that choose to help then gain faction points for each task. The better the player performs, the better the reward and also unbalances that players faction with other countries. So in essence is another turning point.
You can easily change the tides on a player with invisible faction points..example would be to reward more points for a small task for the player.. but important to the country.
This is just one element in my game but I think it suits your need.
The design allows for Writers to come and go as they please.. that is.. your hired story tellers. Since the world would already have a base.. each story teller can add their own twist.. and if that story teller decides not to stay, you can hire another.. who then can read the history and story up to that developemnt point and then add their own flavor.
Doing it this way is because I believe that "Everyone is replaceable" and only the truly committed and best working will remain till the day of publish.
#10
The idea of having turning points is very similiar to what I was thinking, and of course, having hidden turning points would also add to gameplay, since the player wouldn't be sure what choices would actually affect the game.
I hadn't thought of writers leaving the project halfway through, since I'm pretty much doing this myself, but this kind of idea would handle that contingency well. I would imagine on any indie project keeping team members motivated would be difficult.
05/25/2008 (2:36 pm)
That's an interesting idea Scott. I'm assuming your gamehas some kind of strategy, or resource management elements? The idea of having turning points is very similiar to what I was thinking, and of course, having hidden turning points would also add to gameplay, since the player wouldn't be sure what choices would actually affect the game.
I hadn't thought of writers leaving the project halfway through, since I'm pretty much doing this myself, but this kind of idea would handle that contingency well. I would imagine on any indie project keeping team members motivated would be difficult.
#11
Long story short.. Network Management nearly fried me after 9 months of daily hard and fast problem solving for 200 people and quit the job after I received my last paycheck in 1992.
I am designing my game as a hobby, between work and family.
When I discovered Torque 4 months ago, I decided to use it as my engine. And the learning continues between Family and work.
I started with a desire to make a game that I enjoy playing and I wanted it to be dynamic in nature and still easy to manage.
I wrote out a plan of attack which started with a World History. Added continents, Society evolution, Humanity, Religion, and Trade skills. Then broke each part down further into smaller parts.
When the entire concept was completed I discussed it with my wife and tweaked it for the fun-factor.
She also has talent for writing stories.. very amazing stuff, even if they are short stories and reading them is inspirational.
My time now is spent learning Torque and testing concepts and the working concepts are heavily commented, Zip filed and stored onto CD.
I have written some programs for my Father long ago but never a Game and I don't consider myself to be a Dev until my hobby game is completed. Thats a long way off from now... I am learning everything from Engine, to Script, to Graphics and Animation, all at the same time.
Enough about me and my Game. This thread is about YOUR game.. and the concept above.. using faction points is the easiest method to make a game dynamic. It's already in probably hundreds of games so it's not really "my" concept either.. It's not even the concept of famous commercial games.. It's a real way of life actually implemented into games.
Best way to explain it would be to offer a real life example.
I moved into a small town, where I became neighbors with a lady who had friends in networking positions.
I was neighborly to her, and in turn she spoke to her friends.. which turned into a job offer.
When I quit that job, I turned to people I know in another industry, who in turn spoke to their friends, and landed a new job.
When I got tired of that work, I listed my abilities on paper and Job hunted according to my abilities and wound up as a Welder in a very large company. In 2 months time I moved up to making Proto-types for the engineers who frequently discuss design issues with me and thus the faction continues.
Ok.. so much for Short story..
here is the same concept done in a real game:
Born as a Dark Elf you start out with 80% faction at your birth place.
Doing Tasks for the locals adds to your home base faction.
Being an evil race, then killing races other then Dark Elf adds to home faction while lowering Faction for those other races.
The Higher in Society that the Dark Elfs enemy is, the more Negative faction points you obtain for that slaying.
If the Dark Elf wanted to ever get near a Human city.. they'd have to do work for those on the Fence.. the ones that sell and trade illegal goods to both Good and Evil Races.. which in turn adds Positive faction back to the player.. sort of restitution for the slaying sprees. Naturally, gaining faction with an enemy race will be slower.. but possible.. eventually doors will open for new quest lines, or Tasks.
Hope I didn't over explain this. I have a tendency to be redundant. ( Maybe a good thing ).
05/25/2008 (5:07 pm)
@JackLong story short.. Network Management nearly fried me after 9 months of daily hard and fast problem solving for 200 people and quit the job after I received my last paycheck in 1992.
I am designing my game as a hobby, between work and family.
When I discovered Torque 4 months ago, I decided to use it as my engine. And the learning continues between Family and work.
I started with a desire to make a game that I enjoy playing and I wanted it to be dynamic in nature and still easy to manage.
I wrote out a plan of attack which started with a World History. Added continents, Society evolution, Humanity, Religion, and Trade skills. Then broke each part down further into smaller parts.
When the entire concept was completed I discussed it with my wife and tweaked it for the fun-factor.
She also has talent for writing stories.. very amazing stuff, even if they are short stories and reading them is inspirational.
My time now is spent learning Torque and testing concepts and the working concepts are heavily commented, Zip filed and stored onto CD.
I have written some programs for my Father long ago but never a Game and I don't consider myself to be a Dev until my hobby game is completed. Thats a long way off from now... I am learning everything from Engine, to Script, to Graphics and Animation, all at the same time.
Enough about me and my Game. This thread is about YOUR game.. and the concept above.. using faction points is the easiest method to make a game dynamic. It's already in probably hundreds of games so it's not really "my" concept either.. It's not even the concept of famous commercial games.. It's a real way of life actually implemented into games.
Best way to explain it would be to offer a real life example.
I moved into a small town, where I became neighbors with a lady who had friends in networking positions.
I was neighborly to her, and in turn she spoke to her friends.. which turned into a job offer.
When I quit that job, I turned to people I know in another industry, who in turn spoke to their friends, and landed a new job.
When I got tired of that work, I listed my abilities on paper and Job hunted according to my abilities and wound up as a Welder in a very large company. In 2 months time I moved up to making Proto-types for the engineers who frequently discuss design issues with me and thus the faction continues.
Ok.. so much for Short story..
here is the same concept done in a real game:
Born as a Dark Elf you start out with 80% faction at your birth place.
Doing Tasks for the locals adds to your home base faction.
Being an evil race, then killing races other then Dark Elf adds to home faction while lowering Faction for those other races.
The Higher in Society that the Dark Elfs enemy is, the more Negative faction points you obtain for that slaying.
If the Dark Elf wanted to ever get near a Human city.. they'd have to do work for those on the Fence.. the ones that sell and trade illegal goods to both Good and Evil Races.. which in turn adds Positive faction back to the player.. sort of restitution for the slaying sprees. Naturally, gaining faction with an enemy race will be slower.. but possible.. eventually doors will open for new quest lines, or Tasks.
Hope I didn't over explain this. I have a tendency to be redundant. ( Maybe a good thing ).
Torque 3D Owner Ted Southard
Mission-wise, the branching and templates thing sounds good- just put something in so that some events don't follow others if the chain of events don't make sense. If a character's mother is killed by the bad guys, the next scene won't be that character switching sides to join them unless there was good reason, for example.
You'll need better-than-average AI in order to pull this off, because you're putting your NPC's in the position of being actors acting out pieces of story. And while the AI would probably get generated with those events, it still needs to be able to perform within those constraints.