Got another design question. Probably some rubber-ducking here, but maybe someone has some ideas.
Wondering about connections between rooms this time – “doors” to Inform7, “connectors” to TADS. Initially I thought these didn’t need to be formalized in a standard library, and could be done in an ad-hoc way:
office is north of lobby. office door is jammed. player tries to move north, player is in lobby? office door is jammed? say "The door to the office is jammed."
But these connections seem to be pretty common, and can do some interesting things:
- Prevent travel.
- Narrate something during travel.
- Be acted on: entered, examined, locked.
So, maybe it’s better to have some canonical connectors.
My initial attempt at these allows defining a connection name and the rooms it connects –
"office door" connects lobby to office – and when the player wants to “enter office door,” that gets redirected to “move north,” based on the fact that “office is north of lobby.”
Thinking about it more, this seems backwards, since “move north” should check for a connector in order to deny travel or narrate something, but the connector already knows where it leads, so the fact that “office is north of lobby” seems irrelevant when entering the door. Instead, it seems like “move north” should defer to a connector if it’s there, while “enter office door” should move the entrant to the destination, regardless of what direction it’s associated with. This also has the benefit of connectors working between non-adjacent locations, like teleporters or transports.
But then I wonder, is it too restrictive to indiscriminately check for a connector when traveling? Maybe there’s a connector that’s not associated with the normal path of travel, something non-obvious like a duct. Say the office door connector is blocked, but there’s also a duct connector, and both lead into the office. We never want to take the duct when traveling, only the door, unless the player explicitly enters the duct.
That suggests there should be two ways of defining connectors. One is implicitly entered during directional travel (when applicable), and the other is only entered explicitly.
"office door" connects lobby to office. duct explicitly connects lobby to office.
Maybe something like this? Seems like the implicit one is more common, so it should be less verbose, but the “explicitly” wording feels a little misplaced. Any suggestions here?
What’s the precedent for this in existing engines? I guess Inform7’s doors are more like rooms where you automatically pop out the other side, but would the duct really be an enterable container with some special behavior when you enter it? Or is there a cleaner way? What about TADS?