← Back to Index

TerminalLog Engine

User Guide for the editor and the GAME_DATA JSON file


1. What is TerminalLog Engine?

TerminalLog is a micro-engine for creating small games in a retro terminal style + graphic viewport. The player interacts by typing commands (e.g. look, scan, listen) and moving between textual “rooms”, while the viewport shows an image or animated tileset (to simulate cameras, scanners, etc.).

As a developer, you don’t need to write JavaScript: you just edit a JSON object called GAME_DATA. The editor helps you to:


2. How to open the editor

Make sure you have these files in the same folder:

To get started:

  1. Open editor.html in a modern browser (Chrome, Firefox, Edge).
  2. You will see a split screen:
  3. When opened, the editor loads a sample horror demo.

3. Interface overview

Left side

Right side


4. How to use the terminal preview

In the Terminal Preview panel (on the left) you can test your game as a player would. The basic available commands are:

Besides these, you can type local actions defined in the JSON (e.g. listen, restore power, use terminal, etc.) when you are in the appropriate room.


5. The GAME_DATA JSON: global structure

The JSON in the GAME_DATA JSON box defines the entire game. The basic structure is:

{
  "title": "My Horror Game",
  "startRoom": "airlock",
  "viewport": { ... },
  "flags": { ... },
  "rooms": { ... },
  "events": [ ... ]
}

Each time you modify the JSON, press Apply JSON & Restart to see the changes in the preview.


6. The "viewport" section

The viewport section controls the image or tileset shown in the upper-left part of the editor (and of the exported game).

"viewport": {
  "image": "assets/viewport_idle.png",
  "frameWidth": 160,
  "frameHeight": 90,
  "fps": 6,
  "mode": "tileset"
}

Note: in the editor you can also use a locally loaded image for testing, but in the exported game you must make sure that the path (e.g. "assets/viewport_idle.png") matches a real file in the assets/ folder.


7. The "flags" section

flags are global variables representing the state of the game world.

"flags": {
  "power_online": false,
  "creature_alert": 0
}

8. The "rooms" section (rooms)

Each room in the game is defined inside rooms. Example:

"rooms": {
  "airlock": {
    "name": "Outer Airlock",
    "desc": "Frost covers the inner hatch.",
    "scan": "Atmosphere: THIN. Movement: NONE.",
    "exits": {
      "north": "main_corridor"
    },
    "actions": {
      "listen": "You hear a faint knocking sound."
    },
    "onEnter": [
      { "type": "log", "text": "You dock with the outpost." }
    ]
  }
}

Main fields:

8.1 The "+ Add Room" button

When you click + Add Room, the editor:

  1. Reads the current JSON.
  2. Asks you for an ID for the new room (e.g. hallway).
  3. Automatically adds a base room with fields:
  4. Updates the JSON in the editor box.
  5. Restarts the preview with restartGameFromEditor().

You can then manually customize the content of the new room directly in the JSON.


9. Room local actions

Inside a room’s actions, you can define commands that the player can type when they are in that room. Example:

"actions": {
  "listen": {
    "text": "You hold your breath.",
    "conditions": ["flags.power_online === false"],
    "actions": [
      { "type": "log", "text": "Something moves in the dark above you." },
      { "type": "flag", "add": { "creature_alert": 1 } }
    ],
    "onFail": [
      { "type": "warn", "text": "You hear only the hum of active systems." }
    ]
  }
}

Field meanings:


10. The "events" section (global events)

Global events react to:

10.1 Example of an onCommand event

{
  "trigger": "onCommand",
  "command": "scan",
  "conditions": ["flags.power_online === false"],
  "actions": [
    { "type": "warn", "text": "Scan is degraded. Power is offline." }
  ]
}

Here, each time the player types scan, if the conditions are true, this list of extra actions is executed.

10.2 Example of a timer event

{
  "trigger": "timer",
  "delay": 20,
  "repeat": true,
  "conditions": ["flags.creature_alert >= 1"],
  "actions": [
    { "type": "log", "text": "You hear something drag itself a little closer." },
    { "type": "flag", "add": { "creature_alert": 1 } }
  ]
}

Every 20 seconds, if the condition is true, the engine executes these actions. If repeat is true, the timer keeps repeating.

10.3 The "+ Add Event" button

When you click + Add Event, the editor:

  1. Asks whether the event is onCommand or timer.
  2. If it is onCommand, it asks which command (e.g. scan).
  3. If it is timer, it asks for the delay in seconds.
  4. Adds a new base event in the events section.
  5. Restarts the preview.

11. Supported action types

Inside actions, onEnter and events, you can use objects like:


12. Conditions (conditions[])

Conditions are strings containing small JavaScript expressions. The engine evaluates them with predefined variables:

Examples:

"conditions": [
  "flags.power_online === true",
  "flags.creature_alert >= 2",
  "roomId === 'lab'"
]

If ANY of these expressions is false, the whole condition set fails. In that case, if you define onFail, it will be executed.


13. Validate the JSON

If you are unsure about the JSON, click Validate JSON. Possible errors:

If the JSON is valid, you can click Apply JSON & Restart to reload the game.


14. Exporting the game

When you are satisfied:

  1. Make sure the JSON is valid.
  2. Click Export runtime ZIP.
  3. You will download a zip file, for example Derelict_Outpost_A_13.zip.
  4. Inside the zip, you will find:
    index.html
    style.css
    engine.js
    game_data.js
    assets/
    
  5. Copy your images into the assets/ folder (with the same names used in viewport.image and in setViewport/jumpscare actions).
  6. You can now:

15. Tips for inexperienced / hobby devs


16. Conclusion

TerminalLog Engine is designed to be simple but expressive: you can create small horror games, mysteries, and technical logs using only text + a graphic viewport.

Take your time to explore the JSON, duplicate rooms, change texts, and add events. Even if you are a hobby or inexperienced dev, with a bit of trial and error you will be able to build complete, publishable experiences.

If something doesn’t work, double-check the JSON, quotes, commas, and room IDs.