dariusk / NaNoGenMo-2015

National Novel Generation Month, 2015 edition.
341 stars 21 forks source link

Choice of Someone Else's Novel #164

Open cvaneseltine opened 8 years ago

cvaneseltine commented 8 years ago

My NaNoGenMo project will accept a .txt source file and use it to build an interactive novel in ChoiceScript. It extracts a vocabulary from the source, determines parts of speech by comparing against a dictionary, and then uses grammar-based Markov chains to write prose sequences.

It also attempts to recognize and extract characters (along with their pronouns of choice) from the original source, which will be repurposed as "relationship" characters in the game. It also randomly generates various stats based on adjectives used in the work.

I'm building this in C#, but I may pull in Unity at the end in order to make a web-based version.

cvaneseltine commented 8 years ago

Hooray, I'm done!

This C# system accepts a chunk of source text, digests it, and spits out the files to build a working ChoiceScript interactive novel. The text is poetic at best, but it does at least bear some resemblance to the original. Characters do extract (sort of) and turn into statted relationships, but pronouns aren't recognized or used.

There's a working game at http://www.sibylmoon.com/nanogenmo15/mygame/index.html, under the name "Saving?". Source text: Caelyn Sandel's "Mara and the Bottleman" (cw: violence, bodily horror).

The chapters are extremely shallow due to a bug that hasn't been adequately squashed. This system hypothetically can build a 50k novel, but it would take about 50 shallow chapters to do so. That seemed unnecessary, so I didn't.

To build a ChoiceScript game with this system:

1) Find some good source text. Save it in the same folder as NaNoGenMo.exe as "sample.txt". 1) Download the latest ChoiceScript build from https://github.com/dfabulich/choicescript. 2) Unzip the CS build to \choicescript-master in the same folder as NaNoGenMo.exe. 3) Run NaNoGenMo.exe. 4) Go to choicescript-master\web and then open index.html. Hooray! Your very own ChoiceScript game!

cvaneseltine commented 8 years ago

Source: https://github.com/cvaneseltine/NaNoGenMo2015