writing interactive fiction
Playfic games are parsed and run locally — no AI, no internet required. Use the source format below to build rooms, objects, characters, and custom rules.
rooms
Define rooms with a name, the keyword "is a room", and a description in quotes. Connect them with directional phrases.
The Hallway is a room. "A long corridor lit by gas lamps." The Kitchen is north of the Hallway. The Garden is south of the Hallway. The Cellar is below the Hallway.
Supported directions: north, south, east, west, northeast, northwest, southeast, southwest, up, down, above, below, in, out.
objects
Place objects in rooms. Give them descriptions. Mark them openable, locked, or scenery (can't be taken).
The rusty key is in the Hallway. The description of the rusty key is "An old iron key, flecked with rust." The wooden chest is in the Kitchen. "A heavy chest with iron hinges." The wooden chest is openable. The wooden chest is locked. The fireplace is in the Hallway. The fireplace is scenery.
characters
Place characters (NPCs) in rooms the same way. Players can talk to them.
The innkeeper is in the Hallway. "A stout woman with a suspicious expression." Instead of talking to the innkeeper: say "'We're full,' she says, not looking up."
rules
Use Instead of rules to override default behaviour. Add conditions with when.
Instead of taking the rusty key: say "The key crumbles as you pick it up." Instead of going north: say "A heavy gate blocks the way." Instead of going north when the player has the rusty key: say "You unlock the gate and head north." Instead of going north when the player does not have the lantern: say "It's pitch dark. You need a light."
Supported actions: examining, taking, dropping, going, opening, closing, unlocking, talking to, putting, reading, using, pushing, pulling, eating, drinking, wearing, listening.
player commands
| command | what it does |
|---|---|
look / l | describe the current room |
examine [thing] / x [thing] | inspect an object or NPC |
take [thing] / get [thing] | pick something up |
drop [thing] | put something down |
inventory / i | list what you're carrying |
north / n, south, east, west… | move in that direction |
go north | same as north |
open [thing] / close [thing] | open or close something |
unlock [thing] with [key] | use a key on a locked object |
put [thing] in [thing] | place one item inside another |
talk to [character] | speak to someone |
read [thing] | read an object (same as examine) |
help | show this command list in-game |