hexagram30 / mush

Apache License 2.0
1 stars 1 forks source link

Figure out long-term data plan #16

Closed oubiwann closed 4 years ago

oubiwann commented 4 years ago

Right now, new content is added as part of a schema migration ... but as soon as content starts getting created in-game, what do we do? Genera DB dumps regularly? Convert those to migration files?

oubiwann commented 4 years ago

The IF community relies upon tools that help authors generate stories using Markdown-like syntax. This is something we might be able to do, too. For instance, for creating content out-of-game:

  1. In the appropriate directory, create an '.md` file
    • the body of the file would be the area/room description
    • have a metadata section where you could override any defaults for the columns of this entry in the DB
    • have a required metadata field Exits: where Markdown links would point to other md files for connected rooms/areas
    • have metadata fields for:
      • Contents:: Markdown links for any items in the room/area ... can be either unique items or generic items with an instance
      • NPCs: Markdown links for any NPCs in the room/area -- links go files that define the NPC
  2. Upon game start-up:
    • read and parse .md files
    • create SQL for areas, connections between areas (exits), items, NPCs, etc.
    • load the SQL into the database
  3. For in-game edits (the dig command):
    • write out to appropriate Markdown file(s)
    • generate appropriate SQL
    • execute generated SQL

This will also mean that:

As such, we'll also need a Markdown file for the game itself, complete with metadata fields, etc ...

Separately, the MUSH server will need to maintain game state. So, even if the story data is reloaded into the DB (ids need to remain the same!!!), default placement / existence of items / NPCs / etc. may change when the state is loaded. No player placement will be in the story data, only in state

Gonna need a good Markdown reader / writer for Erlang!

oubiwann commented 4 years ago

This seems like a really good long-term plan, so I'll convert that comment to several tickets ...