NaNoGenMo / 2017

National Novel Generation Month, 2017 edition.
https://nanogenmo.github.io
186 stars 7 forks source link

The Infinite Fight Scene #127

Open filiph opened 6 years ago

filiph commented 6 years ago

This is a hack of my own IFCOMP entry (a procedural gamebook). The NaNoGenMo version removes all interactivity, switches from second person to third person, and keeps the initial fight going ad infinitum.

Output

Code

Here's the code: https://github.com/filiph/edgehead/tree/nanogenmo2017

You run the code by cloning the repo, installing Dart, running pub get and then dart bin/play.dart --automated. It's actually very slow, partly because the actors in the book are planning each move, and partly because this is not what this thing is optimized for.

See comment below for more info and best starting points.

Excerpts

Here's the first page of output2.pdf:

screen shot 2017-11-30 at 14 39 54

Page 147:

screen shot 2017-11-30 at 14 50 54

Here's an early excerpt:

Briana takes the scimitar and the sword. From the blackness of the caverns, another goblin comes into view. He lifts his fist.

Briana casts her spear at the goblin. The spear drills through the goblin's shoulder. The goblin grunts in pain and springs at Briana.

Briana dodges the goblin. He hits the rock floor. Aren strikes down at the goblin. The goblin tries to roll out of the way, but can't. The sword slashes his side. He stops moving.

Briana takes the spear. From the shadow of the caverns, another orc comes into view. He lifts his spear.

Briana kicks the orc's right shin. He grunts, and falls to the cavern floor. He tries to scramble out of reach. Aren strikes down with his sword at the orc. The orc tries to roll out of the way but can't. The sword cuts his side. He stops moving.

Here's the algorithm in action, as it writes in realtime:

nanogenmo2017

hugovk commented 6 years ago

"It's just a flesh wound!"

filiph commented 6 years ago

Some more context of the fight/simulation system: https://medium.com/@filiph/skyrim-rendered-in-text-1899548ab2c4. In the article, I'm also explaining the concept of "fractal stories" employed in both the book and this NaNoGenMo entry.

I just realized you'll have trouble running the code because I based this hack on the master branch of Insignificant Little Vermin, which depends on a currently closed-source package. If you want to play around with the system, use the dev branch.

Since I'm reusing code for a game, there's a lot of it. If you want to read the interesting parts, here are a few tips:

filiph commented 6 years ago

Ok, I couldn't resist and made some minor bug fixing today, plus added a script for PDF generation. There are now 2 outputs.

Thanks @hugovk for organizing this. It was a lot of fun!

maetl commented 6 years ago

This is great! I remember thinking when reading your article about fractal stories a few weeks ago that a lot of these ideas could be applied to generating books/NaNoGenMo texts as well—nice to see some amusing experiments based on that core work.

superMDguy commented 6 years ago

Yeah, this is incredible! I loved reading about and playing your "Insignificant Little Vermin" text adventure.

hendrikboom3 commented 6 years ago

Briana is a real survivor, isn't she?