Repository navigation
Lanternfall 2.0.0: Lantern Engine
▶ Play the latest version free on itch.io · Read the write-up · 💛 Donate
To play this exact version, download lanternfall-2.0.0.html below and open it in any modern browser. It runs offline from that one file.
Separating the engine from Lanternfall's content (see the roadmap). It arrived in parts: EN-1 (content as data, #17), EN-4 (mods, #19), EN-3 (the town editor, #20) and EN-6 (languages, #21). The game plays exactly the same.
Added
- Languages (EN-6). Every line a player reads goes through
tl(), with the English as the key: the code stays readable, an untranslated line falls back to English, andtl`${name} reached level ${n}!`becomes{0} reached level {1}!, so a translation can put the values in any order. A language is one file,content/lang/<code>.json; Settings → Language switches (the game restarts).tools/strings.jswritescontent/lang/template.json, about 2,200 lines for translators, and its check stops a translation that drops a value. Mods can add a language, or reword the English withlang/en.json. No translation ships yet;content/lang/README.mdsays how to make one. - A pseudo language for testing (
?lang=pseudo): every translated line comes out accented and a third longer, so English left on screen, and text too long for its box, stand out. Thei18nplay-test plays in it and fails on any untranslated line it draws; it also builds a French test mod and checks its lines, reordered values and English fallback. tools/wrap_strings.py, which wrapped about 2,180 strings across 18 files. The English game is unchanged: all 70 tables of game data compare byte for byte, and the guide is identical.- The town editor (EN-3). Open
index.html?edit: the town is drawn with the game's own art, its people stand where the game puts them, and a side panel holds the tools. Move, add and delete buildings (and set their kind, colours, sign, shop or inn price); paint paths, water, piers and twelve kinds of decoration; add or remove exits; show who's in town at night or after the ending; undo and redo; Walk around in the edited town and press Esc to come back. Edits are kept in the browser. Save as a mod file downloads atowns.jsonfor a mod; Copy for content/towns.json gives the entry to paste into the game. - Town layouts are content:
content/towns.json, with a schema, moved out ofsrc/maps.js(every town builds tile for tile as before). Mods can change towns; the content check covers a building's shop and the town's music. - A walk check for every town, shared by the editor and the build (
townProblems()insrc/editor.js, run bytools/load_check.js): from the way in, every door and every townsperson must be reachable, by day and night, early and late in the story, with the game's own walking rules and NPC placement; buildings mustn't overlap or touch the edge; decorations mustn't hide under buildings. All ten towns pass; a broken layout, in the game or in a mod, fails the build with what's wrong and where. editorplay-test scenario (14 checks), in CI; the content self-test grows to 25 cases.- Mods (EN-4). A mod is a folder in
mods/with amod.json, the content it adds or changes, and optionally code (a new monster drawing).python3 build.py --mod mods/examplebuilds the game with it intobuild/lanternfall-modded.html;index.htmlis never touched. New items and monsters are added, existing ones patched field by field ("goblin": {"steal": "hipotion"}), and shop and encounter lists replaced or edited withadd/remove. The merged content goes through the same checker, and a problem names the mod it came from. Seemods/README.md. - An example mod, The Ember Fox: a new monster with its own drawing roaming the Ashen Isle, a new accessory sold in Lastlight, and a one-field change to Goblins.
- The title screen of a modded game says which mods are in it, and saves record them. Loading a save in a game without its mods leaves the mods' items out (gear returns to the hero's starting gear) and tells the player, instead of breaking a menu later.
modsplay-test scenario (11 checks), in CI; the content self-test now also plants 6 mod mistakes and checks a good mod merges.- Content as data files. Items, monsters, shops and random-battle tables moved out of
src/data.jsintocontent/items.json,monsters.json,shops.jsonandencounters.json, one entry per line.build.pywrites them back intoindex.html, so the game is still one file. The tables the game sees are byte-for-byte the same as before, and the generated game guide is unchanged. - A schema for each file in
content/schema/, describing every field. Editors that understand JSON Schema (VS Code and most others) underline mistakes and show what a field means as you type. - A content checker (
tools/content.js, no packages needed).build.pyruns it first and builds nothing if it finds a problem. It checks each file against its schema, then every reference: drops and shop stock are real items, encounter groups are real monsters, moves exist, every monster family has a drawing, every night table has a day table. It also checks what the code names: a town's shop, a dungeon's encounter table, the monsters instartBattle([...]), items inaddItem/hasItem, recipes, treasure maps, meals, the arena and the black market.--selftestplants 15 typical mistakes and fails unless each is caught; CI runs both. content/README.md: the format, comments (keys starting with//), and how checking works.
Changed
docs/MODDING.md: adding a monster, item, shop, dungeon, boss phase or fish now editscontent/, with JSON examples. The accessory table now lists all seven statuses an accessory can block.