Has anyone made a moddable inform 7 game?

by moddable i mean extra content that is not included in the compiled gblorb include with the release. i have read that inform can read external files though by the looks of it the gblorb need to know what the name of the file is before it is compiled so it seems that it can not be add or changed after the fact with user created content?

1 Like

Basically, it’s conceivable that you could make a game that has the ability to include an extension, but have your original release contain a dummy extension which is later replaced by the “expanded version” extension, I suppose? But it’s about as much trouble to just release a second version of the original game. I don’t know of any games that did this, though.

The closest actual example I could think of is Ryan Veeder’s Authentic Fly Fishing where the usual save functionality is replaced with a manual file creation process that is version-agnostic, and then you can update the game file after-the-fact with new content and the existing saves would continue to work. I don’t know that he has done this, but my understanding is that he could update it, were he so inclined.

Custom javascript bundled with a Vorple game could download content from elsewhere that the game could interact with.


I did actually add content to Ryan Veeder’s Authentic Fly Fishing one time. I added the hat, like, a day or two after the game was released. Adding more stuff would be very easy from the technical side, but I discovered that it was very difficult from a creative standpoint to add material to a game that my brain believed was complete.

What @silverhikari describes makes me imagine a game where, let’s say, you fight a bunch of monsters, and some third party wants to add more monsters to fight, so they publish a .glkdata file with all those monsters’ stats. (Or instead of monsters, it’s custom cooking recipes or cat breeds or map layouts.)

I don’t think this has been done, but it stands to reason that it could be. In my imagination I’m doing this without any javascript or the Dynamic Objects extension.

Take for example a very simple monster-fighting game where monsters simply have an Attack stat and a Defense stat. Normally you’d write stuff like

The creeper is a monster. The attack of the creeper is 4. The defense of the creeper is 2.

For these purposes though you might want to write out everybody’s stats in a table, and then assign stats from that table at runtime, like this:

A monster is a kind of thing.

A monster has a number called monsterID.

A monster has a number called attack.

A monster has a number called defense.

The wraith is a monster. The monsterID of the wraith is 1.

The elephant is a monster. The monsterID of the elephant is 2.

The dummy3 is a monster. The monsterID of the dummy3 is 3.

The dummy4 is a monster. The monsterID of the dummy4 is 4.

Table of Monsters
IDnum  name        atk   def
1      "Wraith"    4     5
2      "Elephant"  7     4
3      ""          0     0
4      ""          0     0

When play begins:
   repeat with thisMonster running through monsters:
      let thisID be the monsterID of thisMonster;
      choose the row with a IDnum entry of thisID in Table of Monsters;
      now the printed name of thisMonster is name entry;
      now the attack of thisMonster is atk entry;
      now the defense of thisMonster is def entry.

The reason you might use a table is because Inform 7 external files can be formatted as tables. The reason you would refer to the monsters in the tables by their monsterID value is because external files cannot abide internal names like “elephant” or “dummy3”.

So a modder adding a new monster would format their .glkdata file in the same way:

Table of More Monsters
IDnum  name        atk   def
4      "Medusa"    9     7

The author of the original game has to include some mod-accepting code, along the lines of

When play begins: [make sure this runs before the other when play begins rule above]
   if the File of More Monsters exists:
      uh, I can't write this out off the top of my head

Essentially, read the table in that extension file, and if there’s a line in there with the IDnum of one of the base game’s dummy monsters, copy the line from the extension on top of the corresponding line in the Table of Monsters.

The author has made the “dummy3” and “dummy4” objects available for the modder to give new stats to in this external file—the external file can’t create new objects! It can only modify existing objects. So the number of monsters a modder adds is limited to the number of dummy objects the original author provides. (I don’t know how the Dynamic Objects extension works, so I don’t know if it would make things any easier here.)

It’s true that the .glkdata file has to have a specific name to be recognized by the game, and it needs to be formatted a certain way for the game to use it, but the original author can make that information public to the modders: “Name the file moremonsters.glkdata, copy and paste this header into it, and then construct each line of the table like so…”

This namespacing stuff makes it very difficult to use two mods at the same time. You would basically need to concatenate the contents of each mod’s table into a single file, and if both mods were using the dummy3 object, then one of them would need to be edited to use the dummy4 object instead. Very inconvenient. Plus you can’t tell from the filenames which mod you’re using! The system really wasn’t designed for this!

But it’s possible, as long as you can figure out a way to format the data. The critical thing is, all the code for accepting the new data has to be in the base game. If you want to let modders add rooms, you have to make the game check for an external file with room data, and you have to make the game read that data and turn it into a room. And you probably need a “dummy” room to write that data onto. And a modder can only customize their room within the parameters set by your code.

This is all very convoluted and impractical. I bet if you did it another way it would be less convoluted or more practical. But it could be done! And it could be really fun.


It might be even easier now with my JSON extension. For when a table isn’t quite flexible enough.

1 Like

With a bit of Inform 6, it’s possible to ask the player to choose any file on his computer ending with .glkdata. Combined to the JSON extension mentioned above, you could achieve a lot of things.

I think the main difficulty is that you can’t really add anything in a story after it’s compiled. So if you want a modder to add a monster, you have to create a bunch of blank monsters with a set of configurable properties. And it’s worse if you want a way to add whole maps and sidequests.

I almost got into a whole thing about how if your monsters are complicated enough you might need a bunch of different external files to handle all your data types. Handling it as JSON would probably be a lot more convenient at all stages of the process.