Let me open this post with a quote from How to Read a Book, by Mortimer Adler:
I quote Adler here because expository works, rather than imaginative ones, typically claim the subject of the practice of eating. Expository works, like The Omnivore’s Dilemma, tend to describe practices that eaters have done or could accomplish themselves, at least in theory. This atmosphere does not invite new ideas about eating – specifically complex ideas involving computer-assisted meal planning – because those ideas tend to be unfamiliar, untested, and alien to our experience of eating or perhaps anyone’s experience of eating. Thus, I forsake expository writing to instead write an interactive fiction piece that communicates a computer-assisted meal planning experience for an audience that would otherwise be unmotivated to pursue such an idea. Hence the subject of this post, IF that is secretly a guide for meal planning software. It is a story with some puzzles that are tasks related to meal planning.
Designing such a “tutorial” presents some nonstandard requirements for authoring, so I’m posting here for advice. Namely, the story needs access to programs that can do indexed searches on user input and a food thesaurus, as well as other programs that can query nutritional databases, like gnutrition (when gnutrition gets a command line interface someday). The story code could access these programs by launching a shell, or by (dynamically) linking with the libraries of these programs.
I’ve searched through some of the documentation on Inform and TADS, but it’s not clear to me if they can use the shell to call other programs. I understand that disallowing shell access could be a security feature for virtual machines that play the stories. I could write the story in a general programming language like C, Lisp, or Python, but in that case I would like to use an IF library or module for those languages so I don’t have to reinvent the wheel. I know that Pyf might work here, but I’m having a hard time finding other IF libraries and modules for C and Lisp/Guile.
You could modify an interpreter to do whatevery you want it to do and bundle the game with it. Since it would be for one game only and not for general use, it could be as simple as scanning for custom tags in the output. If you’re already familiar with C it shouldn’t be very complicated.
Glulx stories have a limited ability to read and write files; I wouldn’t know where to begin, but you could feasibly create an external application that does functions outside of the story and writes the output to a file, then have the story read it; the external app could also monitor a file for changes and do things based on those changes as well. Sounds like a nightmare to get working properly though.
Modifying an interpreter would definitely promote code reuse.
Communication through an intermediate file would keep things modular too.
These are good ideas. I may not personally write the best story, so it would be good planning for me to first write a dumb-simple storyline to establish proof-of-concept, then allow other authors to tinker with more detailed plots. Keeping the system accessible to many IF authors would be advantageous in that case, and these solutions seem to jive with that goal.
UnwashedMass: How deep were the choices? I imagine that CYOA can make comedic substitutions, like
or they can explore transformations of ingredients, like the milk --> yogurt --> cream cheese sequence.
Edit: I do have to be careful to not emphasize any one pattern of eating, because the reader needs to own the experience by filling it with their own. Hopefully I can add to that experience in a neutral manner.
A few years ago there was a mini comp entitled SandwichComp. I started coding up a one-room game with a table of sandwiches including various components (choice of bread, dressing, meat, etc.), but didn’t finish in time to enter. In fact I think the comp deadline came and went with no entries at all.
There’s a nice example in the I7 manual of using tables and quantities to mix a cocktail, which wouldn’t be hard to adapt for lattes and mixed espresso drinks.
There’s also a different example of a short cooking sim, except that all the steps are in a specific sequence and you can’t improvise. I imagine this “meal planning software” would require flexibility.