ref: 9469147002e906ef07da1baf75005a589eebc837 gemif/README.md -rw-r--r-- 2.9 KiB
94691470Norm MacLennan shell doesn't expand ~ in path seemingly 1 year, 1 month ago


GemIF is a simple Interactive Fiction engine which runs as a Gemini server.


There's no simple installation process at the moment.

For now, you'll need to clone this repo and build or run cmd/gemif with something like make build-all, go build gemif/cmd/gemif, or whatever.

Then run the compiled binary with the cloned repo as your working directory.

You'll also need to generate or copy in your TLS cert to my.crt and my.key.

The templates and static assets are compiled into the binary and cannot be changed at runtime, but the file.yml holding your story and cert/private key are read directly from your current working directory.

#Managing Your Story

Stories must live in the ./stories directory in your working directory. At least for right now, maybe it'll be configurable later.

Each *.yml file in that directory represents a separate story to be loaded up by the engine. The top-level index page will allow the user to choose which of these stories they'd like to play, so you have have as many as you want (within other technical constraints).

The file must contain two top-level properties: metadata and rooms.

metadata provides information about the story:

  • id: is a unique id (within your instance) for the story
  • name: is a human-friendly title of the story
  • description: is a brief description of the story
  • author: a name or other identifier of the author(s)

The rooms object holds a list of your rooms/scenes.

Each room has:

  • room_id: a unique id for the room, I recommend a GUID
  • room_name: a human-readable name
  • room_description: a description of the room (what is printed to the screen when the user is there)
  • exits: an array of exit objects

Each exit contains:

  • exit_description: a description of the exit (the text of the exit link)
  • destiantion_id: the id of the room this exit takes you to
  • exit_id: a unique id for the exit, I recommend a GUID

The sample in the repo contains a walking tour of my home. But here's a simpler sample:

- room_id: the_beginning
  room_name: The Beginning
  room_description: >
    This is the beginning of the story!
  - exit_description: This is boring, flip to the end
    destination_id: the_end
    exit_id: exit_a
- room_id: the_end
  room_name: The End
  room_description: >
    And they lived happily ever after.


Hopefully between these two examples, you can get an idea of how you can build simple linear or branching stories.

I plan to do a little bit of extension soon to add, like, conditions that determine which descriptions are printed and which exits are available. But honestly probably not much beyond that to avoid getting too complex.


MIT © Norm MacLennan