Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In inform7, you can do this:

> A race is a kind of person. Dwarf, elf, and half-elf are kinds of race.

> A town has numbers called friendliness, services, comfort, and population. Leadership relates a person to a town. The verb to lead implies the leadership relation. "F [friendliness] / S [services] / C [comfort] / P [population]".

> Rivalry relates various towns to each other. The verb to be rivals with implies the rivalry relation. The verb to be rivals of implies the rivalry relation.

Then you can make a town like this:

> Bremen is a town in Ten-Towns. "Founded by dwarf prospectors, the sleepy town of Bremen sits on the west bank of Maer Dualdon, at the mouth of the Shaengarne River.". It has friendliness 3. It has services 1. It has comfort 2. It has population 150.

> Dorbulgruf Shalescar is a dwarf. Bremen is led by Dorbulgruf Shalescar.

And now inform7 can be used to query or act on all this metadata:

> Every turn when the player is in a town: repeat with town running through towns: say "Rivals of [town]: [list of towns that are rivals with town][line break]";

This is the kind of thing you have to work hard to represent in ink because you only have functions, variables, and lists (a hashmap<variable, boolean>). As you add more metadata to inform7, it can make EXTREMELY sophisticated queries or conditions like "list of weapons that were in hidden rooms which are gilded". So for very little work, you can have inform7 reason about whether a player can 'wear' a specific item by checking what they're wearing, how the item affixes to things, and what attachment points you've defined (which can be as broad or granular as you want). And as a bonus, it's also very little code to comment on the player wearing a strange thing (like pants on their head) or wearing colours a specific character thinks clash with eachother.

This kind of query is one of ink's notable weaknesses (and requires quite a lot of lists or very clever lookup functions to achieve). But, ink can leverage its frontend (often a general purpose programming language like C# or javascript) to provide that functionality.



Apologies that I forgot this line for the example above:

> Bremen is rivals with Lonelywood, Targos, and Termalaine.

When you write it, you effectively get 3 pieces of metadata for 'free' without any extra code:

> Lonelywood is rivals with Bremen. Targos is rivals with Bremen. Termalaine is rivals with Bremen.


If you’re going to use something outside of Ink to provide most of the logic, is Ink the superior solution?


Ink isn't a programming language, it's a markup for scripts that branch a lot or have text substitution rules. The FFI means that if a project hits ink's limits, you can go beyond them. Despite being a markup, ink is very close to turing complete. XML is another type of markup that relies much more heavily on external languages. So I think ink is quite powerful. (at least enough for most interactive fiction!)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: