views:

510

answers:

8

I'm working on a simple story generator and am looking for story building algorithms and patterns to use in my design. Anyone has some good recommendations?

+1  A: 

This may not be what you are looking for, but have you thought of one of those story telling mechanisms that allow you to choose what happens next in a story? Its sort of a pattern and makes it more fun for the user :)

ParseTheData
+4  A: 

Knuth, The Art of Computer Programming, Volume 2, Seminumerical Algorithms. Section 3.6, Summary. Exercise 5, "Creative Writing by Computer". Pages 158-160.

S.Lott
A: 

Read litterature that clearly defines what elements can be found in a story. Break the problem down from there.

You could then for example make an "Intro-generator", "Middle-part-generator" and "Ending-generator". In each of these generators you could use other sub-generators.

Example:

  • Action sequence generator
  • Environment description generator
  • Drama generator

Make it script based so that you can customize your patterns without recompiling.

Load text from data-files, etc etc.

The list goes on and on =)

Alternatively, you could look at some AI- paradigms for really high-tech stuff.

Nailer
+1  A: 

Look at Petri nets.

If you employ a goal-driven approach, in which each potential segment of a story has facts that need to be fulfilled for it to make sense, and goals that the segment produces, you can write an algorithm to recombine these in meaningful ways.

David
+1  A: 

What is the moral of the story? ;-) And seriously, what do you base the story on? Natural Language Generation is a fascinating subject. Ehud Reiter has written a book about it. For simple applications, you can use a Hidden Markov Model or a Stochastic CFG.

Yuval F
+6  A: 

Roger Schank and his students (Wendy Lehnert, Robert Wilensky) did a lot of work on natural language story understanding and generation at Yale in the late 1970s and early 1980s in an AI context.

A good, recent list of works is at http://xenia.media.mit.edu/~mueller/storyund/storyres.html

Anthropologists and comparative literature people have attempted to derive "story grammars" for folk takes around the world. I can't provide any citations to this body of work, but it appears the MIT list names some books.

Note that the Yale folks had major problems with the idea of story grammars. An excellent summary of the argument is Wilensky "Story Grammars or Story Points" Behavior and Brain Sciences 1983 vol 6 no 4. I can't find this online for free, but if you are at a decent university your reference librarian ought to be able to find it for you.

I also found http://www.rehabmed.ualberta.ca/spa/enni/story_grammar.htm which looks interesting.

Finally you might want to do a search for "Interactive Fiction". Back in the day, the Society for Interactive Fiction had people working in this area. I have no idea if any of them are still around.

Jim Davis
+1  A: 

You'd probably want to take a look at for example Propps narrathemes or other narrative structures, write different sections and randomly combine them like this fairy tale generator

Jasper Bekkers
+1  A: 

For an idea of one approach which has been developed over a number of years, have a look at Chris Crawford's work at Storytron and read his book Chris Crawford on Interactive Storytelling online at Safari.

Andy Dent
thanks! that is indeed a very interesting system. Something along the lines of what I'm trying out
Robert Gould