Record a video of the game being played
On this page
When you want someone to look at the timing of an effect, or to show what a bug looks like, a video of the game being played gets the point across quickly. lim shot --video records from a chosen place while advancing at the same speed as the game, and turns the recording into an mp4 video. With --line, the top left of the screen shows the script line being run at that moment, so you can tell right away which line an effect comes from.
This uses lim on the command line (for how to install it, see Start with the command line). Recording needs ffmpeg. Without it, lim stops before recording and says how to install it (brew install ffmpeg on a Mac, apt install ffmpeg on Linux, winget install ffmpeg on Windows).
Record
In the project folder, run it with the place to start from. Write the place as file or file#label.
lim shot start#night --video
It records 20 pages from the starting place, advancing 1.8 seconds after the text has finished showing on each page, and creates video.mp4 in the current folder. When it finishes, it shows where the video is, how many pages it recorded, and how many seconds it took.
- Effects and text play at the same speed as in the game.
- With
--line, the top left shows where the line being run is (a file and line such asstart.lim:52) and how that line is written. This is only shown in the recording, never on a player’s screen. - Music, sound effects, voices and the sound of movies are recorded too (nothing plays through your speakers while recording;
--no-audioleaves the sound out). On a page with a voice, it advances after the voice ends. - The video is a 30fps mp4 (H.264, or MPEG-4 if your ffmpeg can’t use H.264).
Set how it records
| Option | What it sets |
|---|---|
--video clip.mp4 | The video file to create (video.mp4 if left out) |
--skip 10 | Which page to start recording from, counting from the starting place (1 by default; the page shown as [10] by lim trace) |
--pages 40 | The number of pages to record (20 by default; all for the whole game) |
--read 2500 | How long to wait after the text has finished showing before advancing (in milliseconds; 1800 by default) |
--auto | Advance like a player using auto: after the text and the voice finish, wait according to the length of the text (--read is then only used for how long choices are shown) |
--choose 1,North road | What to pick at choices |
--avoid-ending | Don’t pick choices that can only lead to an ending of the kind bad, or one named DEAD END or GAME OVER (to name the kinds, --avoid-ending bad,lost) |
--avoid-choice Sleep,Run | Don’t pick choices containing that text |
--lang en | The language to play in (one of the languages in liminalia.json) |
--no-audio | Leave the sound out |
--line | Show the script line being run in the top left |
lim shot chapter1 --skip 10 --pages 40 --read 2500 --video clip.mp4
Choices, and when it stops
When a choice appears, it’s shown for the --read time, then picked. In --choose, list what to pick separated by ,, and they’re used in the order the choices come up. Numbers count from 0 at the top (be careful: choose in script tests counts from 1). If you write text, the choice containing that text is picked. Once the list is used up, or nothing matches, it picks the next one each time it comes back to the same choice (the first one the first time, the second one the second time), so a choice you come back to doesn’t keep it from going on.
Investigation spots (@investigate), choosing a destination on a map (@map-choice), text input and confirmation boxes also go on the same way with the screen kept on. Movies (@movie) play to the end, even ones that can be skipped. A screen from the project’s plugins goes on the same way if the plugin describes how recordings go on (see “How recordings go on” in Writing plugins).
Recording stops when one of these happens:
- It has read the number of pages in
--pages - The play ends, or returns to the title screen (it shows the ending screen for a moment before stopping)
- It reaches the place in
--until - Nothing advances for 60 seconds (while a movie plays, or a voice or effect is going, doesn’t count; change it with
--stuck 120)
Record from the start to the end
To record a long game all the way through, split it into one mp4 per file or per chapter with --split. Give --video a folder.
lim shot start --video recording --split file --avoid-ending
You get mp4 files with a number and a name, such as recording/001_start.mp4 and recording/002_chapter1.mp4. With --split chapter, it’s one per chapter in chapters in liminalia.json. With --split, it records to the end unless you write --pages. With --until chapter3, it stops when it gets to that file.
- Before starting, it shows how long and how large the recording is likely to be, and the free space. If there isn’t enough space, it doesn’t start. If space runs low while recording, it writes what it has and stops. At 1280×720 it takes about 0.5 to 1GB an hour.
- Even when it stops halfway (Ctrl+C, a screen that doesn’t advance, low on space), the mp4 files recorded so far stay. Run the same command with
--resumeto record the unfinished part again from its start and go on. The scene change at the start of the part is recorded as in an uninterrupted recording (how far it got is inrecording/liminalia-video.json). - To record one finished part again, add the part’s number (the 3 digits at the start of the mp4’s name) like
--redo 2instead of--resume. It records from the start of that part and stops when it enters the next one. The other parts stay as they are. - When it stops at
--untilor--pages, you can also go on with--resume. It goes on from the page after where it stopped and doesn’t record finished parts again. Move--untilfurther or remove it, and raise--pagesor remove it. This is handy for recording a long game a day at a time.
To play the exported game to the end automatically and keep a screenshot each time the look changes, see Play an exported game to the end automatically.