NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

Epic Fantasy Adventure in the world of Shapeshifting #83

Open tsmaster opened 4 years ago

tsmaster commented 4 years ago

Over the summer, I used GPT-2 to generate something resembling a tabletop roleplaying game ruleset, called Shapeshifting. (Buy it now on Amazon!) https://smile.amazon.com/Shapeshifting-Dagrecs-Legacy-Dave-LeCompte/dp/1088872964

I'm thinking about using parts of that as my corpora (monsters, weapons, magic items), draping it across a Campbellian Heroes Journey structure to tell a tale of venturing forth, and killing lots of creatures (spoiler: probably lots of rats to begin with).

tsmaster commented 4 years ago

WIP: https://github.com/tsmaster/nanogenmo2019book

tsmaster commented 4 years ago

Workshopping this title: Shapeshifting: Generation of Adventure

tsmaster commented 4 years ago

PREVIEWS

Opening Chapter

Wosias Helter was a neuter half-elk that lived in Tacyo. Wosias was youthful and impetuous. Tacyo was a nice town. Tacyo was trifling and fanciful. Wosias had a mentor, named Jucy Hondarron. Jucy was ancient and sage.

Jucy told Wosias 'I call you to adventure!'.

But Wosias said 'No, respected one! I refuse the call to adventure. I want to stay here in Tacyo and buy power converters in the City Square'.

Visiting new towns, meeting new monsters, murdering them

And then they went on a mission to fetch a seamount silver axe. They went to Sapcibbe and killed a wicked bard. On the body, they found a bay fog gold necklace of earth and a baltic trench brick finger ring.

A Feast!

And hast thou killed the shadow drake king shapeshifter? Come to my arms, my beamish one! O fakjhdok day! Callooh! Callay! We must have a feast!

The first course was soup. It consisted of manhattan clam chowder.

The second course was crudite. It consisted of celeriac, cucumber slices, carrots, and fennel.

The third course was hors d'oeuvre. It consisted of haggis pakora and potato chips.

The fourth course was entree. It consisted of roasted and boiled fruit bat stuffed inside a pressed and dried kraken.

GPT-2 Rambles on about the crafting of armor in this fantasy world

The first thing one must do when making a cipher silver studded ring mail is to mark the piece in the call card required. Then the next thing to do is to add dry. As directed in the first part, once each ciphers side could be wetted the beads would become as thin as the pieces needed for writing them down upon writing removal. But, small needle bearings can provide a sally bore, as well as a gold invelope, however. Let this beginning rub off. Normally both ends of the pattern should be dry using thread until they feel dry. Often using the plastic thumb that goes through the shad pads is one reason that couples may inconsistently record messages. Determine the appropriate bacteria as well as a sample of PET and a salt soluble composition. Then either check a paper clip or a porthole key to find the other.

All this, and nonsense poetry, too

This reminds me of a poem told to me by a gorgon.

hemmed wailed pisagoded existent zecalog hoder reministent shaped stave gulls corris thrilive fistoris clond gilks laugable rumanistent

goehl unatameted fidfam farge megged sneeled merl brudin's unconbold large queck amerini lick edudini lurtically nebuki hunged angstarge

tsmaster commented 4 years ago

Excerpt from today's chapters 6 and 7

And then she went on a journey to Sarrinxhem. In Sarrinxhem, she met Daniildo Barmis. Daniildo sent Xark on a mission to find a world peace atlatl. Xark explored around Sarrinxhem. In a dark alley of Sarrinxhem, she found a world peace atlatl, which she returned to Daniildo. Daniildo paid Xark generously for the quest.

Chapter 7 : The making of a world peace atlatl

The first thing one must do when making a world peace atlatl is to become a father. This means that parents and carers together serve as one; they must collaborate upon the works completed. All adoptions must follow what are called "family nights" in all areas of the family, offering full schedules for parents to attend to the needs of their children, exercise their circadian rhythms and variations with carers; all the time, together, are part of united housework. Whatever happens to child labor that may remain unseen to anyone's distant parents, such as misery or extreme deprivation which her parents might dispute long enough, should be interpreted as part of the family home economy. 37. The idea and practice of the plucking wop has turned. After most of the book, I attempted to get people familiar with the urge to perform plucking in the same way I use contraception. But it was merely plain flimpsucking in combination with communion with nature. After a while everyone was conjugating this contrary view too. I imagined that I could convince others to take up chores, have no personal involvement, or to pull around or take a swing with friends. In none of these cases does the curmudgeon of maternal piety give the name of gravity (obeying Creator Creator), or any other name.

tsmaster commented 4 years ago

I'm feeling good about where this is right now - I generated a file in excess of 50,000 words today, but I intend to keep tinkering at the edges to get one that I really like.

Technologies

(Py)Tracery

A lot of my work is being done by Kate Compton's Tracery and Allison Parrish's PyTracery, which is a quick and easy way to generate a sentence or a phrase. I have some hand-built higher level structures (a feast chapter, a chapter of journeys) which rest on Tracery.

GPT-2

I wanted to revisit GPT-2, so I'm using huggingface's PyTorch transformers library. I feed it a prompt to get the chapter started, and I re-prompt with a related half-sentence, let it go for a while, and before long, I have a chapter. A lot of the time, it's a pretty weird, hard to read, chapter, which is close to what I had in mind.

pronouncing/Pincelate

Allison Parrish's pronouncing and Pincelate libraries are super useful for my rhyme dictionary work at the basis of my poetry chapters.

(Py)Corpora

I've got a bunch of wordlists of my own, but I'm not above using Darius Kazemi and Allison Parrish's wordlists, too. In many cases, I merge a couple Corpora wordlists together with my own handmade (often hand-scraped) wordlists to make a bigger wordlist.

tsmaster commented 4 years ago

Now, With More Simulation

I've further embraced the simulation going on inside my generator - now the hero maintains an inventory, which determines whether they can buy goods and services, and when the hero goes to a store, they only sell items that they have.

Along with this added feature, heroes now will occasionally complete a quest for an item, and decide not to return the item to the quest-giver - often selling the item in the next town over. This may not make financial sense; the hero doesn't know how much the quest-giver would reward them for the eldritch cotton candy bandyclef, but maybe the hero just didn't like the quest-giver.

Preview

The opening chapter of today's latest generated novel:

                        SHAPESHIFTING
        Aceen Sbøderv and the Generation of Adventure

Chapter 1 : Aceen Sbøderv

Aceen Sbøderv was a female half-elk that lived in Tenberd Tellg. Aceen was childish and unseasoned. Tenberd Tellg was a nice town. Tenberd Tellg was little and unusual. Aceen had a mentor, named Andrkeq Lhgdar. Andrkeq was along in years and contemplative.

Andrkeq told Aceen 'I call you to adventure!'.

But Aceen said 'No, ma'am! I refuse the call to adventure. I want to stay here in Tenberd Tellg and smoke pipes at Tosci's Power Converters and Pipe Shop'.


Complete Novel

If you want to read a complete 50471 word novel about Aceen Sbøderv and her journeys around the countryside, I invite you to check out https://github.com/tsmaster/nanogenmo2019book/blob/master/DraftBooks/draft_2019_11_23_10_29_50000.txt

What's Next?

I want to explore training GPT-2 to fine-tune it to generate more adventure-y text, or at least more novel-y text. That feels like a stretch goal, given that I've got a cromulent novel generator right now.

But can I play it as a game?

Um, sure. Clone the repository, get all the dependencies (check out Notes/dependencies.txt, which is generated by Scripts/makedependencies.py), run python3 makebook.py -i

and it will generate a hero for you, which you can reroll to match the story you want to generate. Then check out the last chapter of the generated book, and convert the treasure amassed by the hero into points. (Scoring algorithm left to the reader.) Maintain a high score list and see if you can beat your friends!

tsmaster commented 4 years ago

Post-Completion Stretchiness

Each chapter of my book is largely modular, taking small hints from other chapters about how to connect to the bigger story.

One modular chapter generator I have is a GPT-2 text completion generator, which this morning was written using huggingface's PyTorch Transformer library, using the pretrained GPT-2 model. Maybe the medium version?

I decided I wanted to make things a little more cohesive, and less rambly, so I built a replacement module using minimaxir's gpt-2-simple, which I proceeded to train on Project Gutenberg's copies of

A Sample of the New Generation


Chapter 21 : The Making Of A Moon Lily Leather Armor

When making a moon lily leather armor from scratch, the first thing you have to do is make a few small changes to the design. The first step is to use a small hole in the front of the armor to open and close the lid. Then you begin to make other changes to the design, and so on. Finally, when the machine is in use, the user is told to let go and to move slowly, so that the machine will not run out of power. This is done by means of a small lever, which is attached to the back of the machine. This lever is fairly large and is held steady by a harness. When the machine is fully inflated, the machine must be powered for a period of time, so that the harness can be used. This is accomplished by means of a power supply, which is connected by a series of small holes in the sides of the machine. The machine is then about to be powered out again, when the first part of the operation is completed. So, although the machine is no longer in use, the user is told to let go and move slowly, so that the machine will not run out of power.

The difficult part about finding the materials to make a moon lily leather armor is that there are holes in it that will allow you to unclip the armor and get it to shine. The only way to get that would be by taking the lilies that grow in the garden and sewing them into the armor. I've found this method of making lilies in a number of other pictures I have taken of the land of Oz. It is not the best way to dress a lily but one of the best ways to dress a princess is by sewing a silly lily into her costume. It is a wonderful trick, especially when you are in the midst of preparing to wear the little girl's costume. I can understand the desire to dress up, but it is not necessary. If I may call attention to the fact that the lilies are now so small and soft, and are so hard and delicate, it will show that I am making a pretty good ship, and that I am ready to go home. But hopefully this lesson will bring some hope that you will not be in such a hurry to embark, and that you will not be tempted to carry the unfortunate family with you any farther than is proper.