2018 icon indicating copy to clipboard operation
2018 copied to clipboard

Choose Your Adventure: Safari edition!

Open WhiteFangs opened this issue 6 years ago • 14 comments

Hi there!

I just came back from holiday in Uganda where I did a bunch of safaris so I came up with this idea for this year's NaNoGenMo project of mine: a generated choose your adventure book about a safari!

My ideas at the moment:

  • The book has to be in HTML with links from one page to another (could be a single page app or different pages)
  • The main character is the reader, he/she is doing a safari in an eastern-african country in a 4x4 with a guide
  • Every page is a description of some landscape (ex: savana, river, lake, forest, swamp) with some details about the area (ex: road, bridge, bushes, buildings, trees, swamps, shore, etc.) and a focus on one animal species (mainly either bird, mammal or reptile) in this area with the guide giving some trivia knowledge about it (from a database I guess) and maybe also a picture for the flavour
  • Animals should appear depending on the area of course but also by rarity
  • Every page ends with a paragraph describing 2 things coming next (ex: road splitting, hearing a sound, seeing a shape afar) and gives these 2 choices to the reader who has to click to go to the chosen page
  • Ideally I would like the reader to have a inventory of the animals seen and maybe also a defined goal to see some specific animals (ex: the big fives, some rare bird, etc.)

I have not decided yet if the book should be fully generated at once or if every new page would be generated following the decision made by the reader at the previous page... I guess I'll go with the easiest solution but I don't know which it is yet.

I also have no idea which tech stack to use, I heard of Twine and Inform to create interactive fictions but I don't know to which extent my project would fit with them... Worst case scenario I write everything myself with the languages I usually use (probably JS and PHP).

I'm a bit late for the start of the project, it's already mid-november, but I'll try to do my best and I would love to hear your thoughts and advice about it!

WhiteFangs avatar Nov 15 '18 17:11 WhiteFangs

I believe there was a project just like that last year, were you the author?

LuRsT avatar Nov 15 '18 19:11 LuRsT

Not at all! What was this project?

WhiteFangs avatar Nov 16 '18 21:11 WhiteFangs

I advanced a bit on the idea.

I'll use Twine as the tool to display the interactive story in HTML. I plan to crawl the Animals Wikia as a database for the animals of the story. I'll use the name, the first paragraph of each article, the link to the page and the link to the image to produce the trivia knowledge bits I talked about.

The plan then is to get the database and write a PHP script that uses the database to produce a Twine archive file (it's basically HTML/XML) that one can download and then import to the Twinery web UI to play it. (I haven't figured out a simpler way to deal with the playability yet)

I don't know yet how I will get the official 50000 words text output for the challenge but I can figure that out later.

WhiteFangs avatar Nov 16 '18 21:11 WhiteFangs

Last year: "Oldschool Dungeon Crawler GameBook generator"

https://github.com/NaNoGenMo/2017/issues/109

hugovk avatar Nov 16 '18 22:11 hugovk

Yes @hugovk that's the one I meant, it's my fav. For inspiration, there's another one I didn't know about: https://github.com/NaNoGenMo/2017/issues/24

LuRsT avatar Nov 18 '18 10:11 LuRsT

The Dungeon Crawler Gamebook is really impressive, I fear I won't get to that level of goodness with my project but I'm happy to know about it! I already had a look at the other one which unfortunately is incomplete and looks a bit shallow to me... Thank you both for the links!

I think I'll switch from the idea of Animals Wikia to classic Wikipedia which looks richer in information and simpler to crawl. I'll use the pages Birds of East Africa, Mammals of Uganda and Reptiles of Uganda.

The idea is to simulate an east african safari but I allow myself some incoherence in the output with endemic species from places impossible to visit at the same time (for example seeing a bird from Madagascar just after seeing a cheetah).

WhiteFangs avatar Nov 18 '18 10:11 WhiteFangs

I'm about to start coding.

I have prepared a list of terms to detect in the wikipedia articles to automatically fill the "habitat" field of every animal I'll have in my database. I also have an idea of how rareness of animals will work: every bird and reptile will have the same likelihood to appear, only mammals will be customized by me (so you won't get lions and leopards every 2 pages!).

The only thing I'm struggling to organize is the trivia knowledge from the guide as a selection of sentences from the wikipedia articles... I don't know if I should only get the first paragraph every time or add a few random sentences from other sections... I mainly fear the style will be too academic for a guide that talks (although I can also describe him as very encyclopedic in the introduction). If anyone has an idea of how to handle this nicely, I would be happy to hear your advice!

WhiteFangs avatar Nov 19 '18 10:11 WhiteFangs

I created the repo, crawled the Wikipedia data and cleaned it: https://github.com/WhiteFangs/choose-your-safari-adventure I'm now working on the generation of the story's pages graph.

WhiteFangs avatar Nov 24 '18 11:11 WhiteFangs

I successfully wrote a basic Twine story generator with good links between pages and any number of pages.

My next steps are:

  • Implement rarity of species
  • Write lots of possible page introductions and conclusions depending on the areas
  • Write lots of possible animal introductions and conclusions depending on type (bird, reptile or mammal)
  • Write lots of possible sentences variations for the guide talking
  • Design and implement the sentence selection for all the knowledge about the species (4 types of content: introduction, description, habitat and behaviour)
  • Write introduction and conclusion to the story

So basically, write lots of things.

Oh, and also find a way (if possible) to automatically transform my generated Twine archive file into an actual HTML interactive story without going through the Twine interface and the file upload.

WhiteFangs avatar Nov 24 '18 15:11 WhiteFangs

It's DONE.

The result is here.

I have implemented:

  • Background images
  • Around 50 levels of depths (so to reach the end you'll have to make around 50 choices and see as many animals)
  • Many sentence variations
  • Interactive unfolding of the pages
  • Tracking of seen animals
  • Live generation of the HTML interactive story (not a Twine archive file that you have to upload to the Twine interface to play it)

It looks much better than what I thought it would be and I'm quite proud of it. I counted around 52000 words per story (with all the pages, not just the ones you choose to visit) but the calculation is quite naïve, it may be more or less depending on the generation. I could do a lot more just by increasing the number of depth (which is just a variable) so I consider it completed for the NaNoGenMo!

WhiteFangs avatar Nov 29 '18 13:11 WhiteFangs

Wow, this is great!

hugovk avatar Nov 30 '18 07:11 hugovk

Impressive and very readable! Good job!

LuRsT avatar Nov 30 '18 07:11 LuRsT

Yes, this is beautiful. Incredible photo curation here.

jimkang avatar Nov 30 '18 20:11 jimkang

This looks terrific!

lizadaly avatar Dec 01 '18 15:12 lizadaly