Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A tale of battles #37

Open
slicedlime opened this issue Oct 28, 2014 · 6 comments
Open

A tale of battles #37

slicedlime opened this issue Oct 28, 2014 · 6 comments

Comments

@slicedlime
Copy link

I don't have a detailed plan - I do want to generate something with a story. Currently thinking I'll go for a Fantasy style, mostly because there's a lot of easy tropes and stereotypical stories to build on.

@slicedlime slicedlime changed the title I'm joining A tale of battles Nov 30, 2014
@slicedlime
Copy link
Author

I do seem to have a Fantasy novel generator!

I'm going to write a more detailed blog post explaining the thoughts behind the whole thing, but here's how it ended up:

  • Start with a story end.
  • Add and extend pieces towards the beginning of the story, keeping track of state.
  • Location and character descriptions are driven by a data definition format based on JSON.
  • Action is also driven by an extended version of the above.
  • Repeat process until word count exceeds desired length

The framework sort of (;-)) works. The problem with it is to get enough variety - I have generators for skirmishes, travel and end battles, as well as the protagonist recruiting others for his/her party. In addition I also have a "quest" generator that will add a small conversation or thought foreshadowing something that happens later.

I am very happy with the way the location and character descriptions turned out. The action came out entirely jumbled though, probably because there's no real state... it's just the characters involved randomly doing things and those random actions possibly having consequences. It initially looked like a lack of variety was hurting action terribly, but adding variety to it turned it into a clusterfuck of epic proportions - and then November ended :)

The generator is also slow when generating long novels. 5000 words takes a few seconds, 50k words takes 30 minutes or so. I'm guessing this could be sped up by not constantly generating the whole thing, but I haven't had time to really look at that.

I'm currently generating a 50k novel, will return when it's done.

@slicedlime
Copy link
Author

There we go. The source (python code & json data definitions) can be found in this archive. A sample novel can be found here. This is the output from running ./generate.py 1 50000.

@slicedlime
Copy link
Author

Example of a passage I'm pretty happy with:

"Lynalod, Ilnoil and Yeil travelled from Pendito to Salotar plains. There was short grass on the plains that swayed in the wind. Old moss covered a few huge boulders that laid on the plains. A small river that flowed through Salotar blocked the way."

... and then there's lots of stuff with ratmen and orcs, since those are the only two monster types available.

@ikarth
Copy link

ikarth commented Dec 1, 2014

I like this. There's some good ideas in the approach, and you've discovered some of the pitfalls.

And I think this is one of the few generators to produce a novel-length plot, such as it is.

@MichaelPaulukonis
Copy link

Talespin, from the 1970s, started with endings then worked its way backward to the beginnings. They were pretty short stories, though. Involving animals, too.

http://wikis.sub.uni-hamburg.de/lhn/index.php/Story_Generator_Algorithms - scroll down to the 11th paragraph (they're marked).

Great job!


I originally read your comment as "lots of stuff with ramen and orcs" and visualized japanese campfire scenes.....

@MichaelPaulukonis
Copy link

Don't think I won't be stealing some of your ideas. No matter how many ratmen you send at me.

I can always brandish a special, magical Temporal-External-Positron-Dynamic Core or summat. Maybe it'll make the plains collapse. Who knows.

locations.json, 'monsters.json' and 'characters.json' are more in line with how I had envision certain objects, but never got around to implementing. So I will be staring at them more.

One thing I learned -- the longer and more varied your template text, the less repetitive-seeming is your output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants