Skip to content

180 mod tool 2 the s7 plan

Alex Diakovsky edited this page Dec 1, 2026 · 7 revisions

180. Mod tool 2: the S7 plan, a toolset to make a whole game by hand

Question: the audit (document 179) found the engine ready to run a game with no Return Fire content, and the mod tool able to write only 4 of the 40 or so tables a game is made of. The netplay test game must be made by the user, art included: nothing in it is generated. What does the toolset need, in what order, so that the user can draw, build and ship that game with it, and how does each piece get built and checked (issue #133, tracking issue #143)?

The mod tool series: stage S7 builds the mod tool into a toolset that makes a whole game by hand. It began as the last stage of the deterministic simulation plan (whose stages S0 to S6 are documents 156 to 178), because netplay is tested on a game made with the tool, but the work is the mod tool's. S7 began with the audit, document 179. This document is the plan for the rest of S7, written so that a new session can execute it stage by stage.

Glossary

Term Meaning
the toolset The engine's mod tool (editor/editor_main.tscn, EDITOR_PLAN.md) plus the game's own runtime and its export. "Made with the toolset" means no JSON written by hand and no file made by a script.
the user's art Every picture and sound in the test game. The user makes it: drawn in the tool's pixel editor, or drawn in another program and imported. Nothing is generated, by a script or by a model.
test fixture Throwaway data that a check makes in code (flat-colour squares, a 16 x 16 map), like the engine's tests/fixtures/synthetic_pack.gd. Allowed in tests only: never shipped, never offered as the game's content.
try-out The list at the end of each stage of things the user does in the tool to accept the stage. A stage is done when its checks pass and the user has done its try-out.
provenance Where a file came from, recorded in the pack: "source": "drawn" (made in the tool), "imported" (from a file the user chose). The no-original-asset check (#141) and the Validate tab read it.

The answer, up front

  1. The mod tool is a product that ships with the engine. It is what modders and game makers get, and they will not have Godot installed (EDITOR_PLAN.md section 2). S7 is the mod tool's first real test: if the user can make a whole game with it, it is ready to ship. So every gap S7 finds is fixed in the mod tool, not worked around in the Godot editor or by hand.
  2. The user is the artist, the tool is the studio. Each stage builds tools; the user then makes content with them. Sessions never add art, sounds or maps to the game, and never "fill in" a gap with generated content: a gap in the tool is an issue to fix in the tool.
  3. Use Godot itself wherever it can do the job, inside the tool. The mod tool is a Godot program, so every class the Godot runtime has is free to use: images, undo, colour pickers, tile maps, 3D viewports, sound loading, fonts, file dialogs. What Godot keeps for its own editor (its tile painter, its 3D gizmos, its inspector, its animation editor) is not in an exported program, so the tool needs thin versions of those, built on the runtime classes. The table Where Godot does the job says which is which, area by area. The Godot editor itself is only for people working on the engine.
  4. Art comes first. Before maps and vehicles can be built from nothing, the user must be able to make the pictures they are built from. So the order puts an art stage (S7.2) right after the engine clean-up: blank sprites, frame sequences, an in-app pixel editor (EDITOR_PLAN's E6, #12, no longer optional), team-paint masks, tile previews, and where-used.
  5. Two ways to draw, both first-class. The in-app pixel editor for drawing and touching up pixel art, and "Open in image editor" (which already exists, with live reload) for Aseprite, Pixelorama, GIMP or Krita, which already do onion skin, layers and animation well. The tool does not try to out-build them; it makes their output easy to bring in (one picture, a strip, a sheet). Both ways end in the same place: frames of the user's pack with their provenance.
  6. A vehicle is built from 2D faces. A vehicle's look is a set of flat faces in 3D, each a sprite stretched over four corners. The vehicle assembler (S7.5) is the tool for that: add faces, boxes and wedges, drag their corners, paint them with the user's sprites, mirror and repeat them, and bind groups of faces to the vehicle's turret, rotor or wheels.
  7. Eight stages. S7.1 the engine names no game; S7.2 art; S7.3 maps; S7.4 vehicle numbers and weapons; S7.5 the vehicle assembler; S7.6 sounds, world objects and rules; S7.7 front end and HUD; S7.8 the game, its build and its checks. Each stage is a few sessions of work, ends with a wiki doc in this series, and ends with the user's try-out.
  8. Every stage keeps the project's workflow. Engine first, tests on code-made fixtures, both suites green, a doc that quotes the code, the issue closed with the doc linked.

S7's stages: S7.1, then S7.2 art, which the map, vehicle and front-end stages build on; S7.8 the game comes last

Mermaid source
flowchart TB
  A["S7.1 the engine names no game<br/>#134"] --> B["S7.2 art<br/>#144 #12 #9 #8"]
  B --> C["S7.3 maps<br/>#135 #3"]
  B --> D["S7.4 vehicle numbers and weapons<br/>#4 #136"]
  D --> V["S7.5 the vehicle assembler<br/>2D faces to a vehicle<br/>#5 #6"]
  B --> F["S7.7 front end and HUD<br/>#139"]
  C --> E["S7.6 sounds, world objects, rules<br/>#137 #138"]
  V --> E
  E --> G["S7.8 the game: repo, export,<br/>no-original check, CI recording<br/>#140 #141 #142"]
  F --> G
Loading

Where Godot does the job

The mod tool ships as a Godot program, so it can use any class of the Godot runtime. Godot's editor features are not in a shipped program, so where the tool needs one, it builds a thin version on runtime classes. For each area, what to take from Godot, and what is left to build:

Area Use Godot's runtime Still to build in the tool Do not
Undo, redo UndoRedo (already ModWorkspace.undo) nothing new
Drawing pixels Image (set_pixel, fill_rect, blit_rect_mask, flip_x, rotate_90, save_png) and ImageTexture.update for live redraw the canvas tools on sprite_canvas.gd (pencil, line, rectangle, select), a flood fill (a few lines; Image has none) build layers, onion skin of many frames, or a timeline: Aseprite and Pixelorama do those, the tool imports their output
Colours and palette ColorPicker (its swatch presets are the palette panel), ColorPickerButton saving the swatches in the project
Frame sequences SpriteFrames and AnimatedSprite2D to play a sequence the frame strip (add, reorder, renumber), sheet import (Image.get_region in a grid)
Tiles and maps TileSet and TileMapLayer as the map's edit canvas (set_cell, its own drawing and scrolling), Camera2D for pan and zoom the brush, rectangle and fill tools, placement of spawns, pads and flags, and the save to art.bin (the game keeps its own format) rely on Godot's tile painter or terrain autotiling: they are editor-only
The vehicle assembler SubViewport, Camera3D, Node3D transforms, the engine's own vehicle_render_3d.gd to draw the result, Transform3D for mirror and array picking a face (ray against its quad), corner and move handles (Godot's 3D gizmos are editor-only)
Numbers SpinBox, OptionButton, Tree, CheckBox typed fields (16.16 as decimals, ticks, angles) use Godot's inspector: editor-only
Sounds AudioStreamWAV.load_from_file, AudioStreamOggVorbis.load_from_file, AudioStreamPlayer for preview, with no import step the cue list and assignment
Fonts FontFile (load_dynamic_font for TTF/OTF, load_bitmap_font for BMFont files from tools such as BMFont or Hiero) an image-font cutter only if the user wants to draw fonts as sprite sheets
Front end Theme and the engine's own screens for a live preview the editors for the menu, skin and progression tables
Files FileDialog (or DisplayServer.file_dialog_show for the system's own dialog), OS.shell_open for "Open in image editor"
Shipping the game Godot's exporter and an EditorExportPlugin (the engine's plugin.gd) the export plugin (S7.8)

The Godot editor is fine for people working on the engine itself (scenes of the tool, the export). A rule for the stages: if a step would make a game maker open the Godot editor, the step is not done.

Rules for the session that executes a stage

Read these before starting any stage.

  • Read first: this document, document 179, docs/EDITOR_PLAN.md (openfire) for the stage's section, the engine's README.md and docs/ARCHITECTURE.md, and the stage's issues. The memory notes on the two-repo workflow apply: the engine is its own repo (alexdia25/openfire-engine), mounted in openfire as addons/openfire_engine.
  • Work in a worktree, never in the shared main checkout (it has other sessions' uncommitted edits). Make one from openfire (git worktree add ../openfire-s7N -b s7-N origin/main, then git submodule update --init), and switch the submodule to main before editing engine files. Remove the worktree and branch when the stage is pushed.
  • No art, sound or map in commits except test fixtures made in code. A check that needs a picture makes a flat-colour image in code, as tests/fixtures/synthetic_pack.gd does. A screenshot of the tool for a doc is fine; it is documentation, not content.
  • Never take anything from packs/original_pc into a standalone project, not even as a placeholder. Tools for a standalone project must not offer original art in their pickers (the stack has none, since there is no base pack; keep it that way).
  • The engine names no game: no Return Fire sprite id, vehicle name, level id or file format in engine code, tests or tool text. A tool's defaults are neutral (mygame.tank.hull, not vehicle.tank.*).
  • Tests: every tool feature gets an engine check that drives the workspace API (ModWorkspace) and the panel (as mod_tool_ui_check.gd does), on fixtures. Run the engine suite (GODOT=<godot> bash tools/run_tests.sh in the engine), then the openfire suite, never at the same time, and grep the logs for SCRIPT ERROR. Run Godot with --audio-driver Dummy.
  • Godot's runtime, never the Godot editor. Build each tool on the Godot runtime classes the table Where Godot does the job names before writing one of our own. If a step would make a game maker open the Godot editor, it is not done.
  • Saving is layered and undoable. Every edit is one ModWorkspace action (undo, redo, revert to base), and PackWriter writes only the project's own layer, sorted. A new table the tool writes needs: the workspace action, the writer, the reader in Pack (it may exist), a Validate rule, and a round-trip check (save, reload, identical).
  • Push order: engine first (git push origin HEAD:main from the submodule), then the openfire submodule bump. A pack-format change means the user must re-import Return Fire's pack, and the stage's doc says so.
  • Each stage ends with a doc in this series (next free number, re-check for collisions before pushing): question, glossary, answer up front, steps quoting the code, a diagram rendered with tools/wiki_diagrams (in the code folder, next to the repos), the checks, the try-out, where the code is. Link it from Home, from this document's stage table, and from the issues it closes. Comment on #143 and tick the stage.
  • Then stop and hand the user the try-out. The next stage starts after the user has done it, or said to go on.

The stages

Stage What the user can do when it is done Issues Doc
S7.1 Play a level of their own game with no Return Fire word on screen #134 181
S7.2 Draw any picture the game needs, in the tool or outside it #144, #12, #9, #8 182
S7.3 Define tiles and paint a two-player map from nothing, and play it #135, #3 183
S7.4 Set a vehicle's numbers and give it a weapon that fires the user's own shots and explosions #4, #136 184
S7.5 Build a vehicle's body from 2D faces painted with their own art, and drive it #5, #6 185
S7.6 Give the game sounds, soldiers, turrets, a flag, computer players and controls #137, #138 186
S7.7 Give the game its own title, menus, skin and HUD #139 187
S7.8 Hand out a build that is proven free of original files and deterministic #140, #141, #142 188 (design)

S7.1: the engine names no game (#134)

Build:

  • game/placeholder_hud.gd: the objective lines and the controls line from pack data. Vehicle names come from the definitions (name); "the vehicle that carries the flag" comes from the flag-carrier flag, not "the Jeep"; button labels come from input/controls.json; the objective wording from a ui/ table (for example ui/strings.json) with neutral engine defaults ("Destroy the enemy targets, then take the flag"). Return Fire's pack gets its current wording through that table, written by the importer (importer/pack_builder.gd, mirrored in tools/build_pack.py), so Return Fire looks the same as today.
  • The table projectiles/jeep_missile.json and Pack.jeep_missile_data get a generic name (what the table is: the art of a homing missile), with the importer writing the new name. A pack-format change: the user re-imports.
  • Grep the engine for other game names in strings the player or the tool user sees (Tank, Jeep, MSV, Heli, Return Fire, sprite id prefixes such as vehicle.), and fix each or list it in the doc as code-only.

Checks: an engine check that loads the synthetic test pack, builds the HUD for a level and asserts no string names a vehicle the pack does not have. The openfire suite stays green (Return Fire's text unchanged, through its table).

Try-out: run the engine's test pack as a game (the audit's throwaway project, document 179 step 1) and see neutral text; run Return Fire and see the old text.

S7.2: art (#144, #12, #9, #8)

The tool's Assets tab today imports finished PNGs, sets pivots, opens a frame in an outside image editor with live reload, and handles team pairs, masks and colours. S7.2 makes it a place to draw. EDITOR_PLAN.md 3.1 already designed it so that a pixel editor is more tools on the existing canvas (editor/sprite_canvas.gd), with Pack.replace_frame swapping a frame live and undo carrying pixel payloads.

Build, in this order (each a commit and a check):

  1. Start art (#144): New blank sprite (size presets the engine uses: 32 x 32 tile, 16 x 16 soldier, 8 x 8; any size), Duplicate, provenance ("source": "drawn" / "imported" in sprites/sprites.json, kept by PackWriter, shown in the inspector).
  2. The pixel editor, built on Godot's Image and ImageTexture (#12), tools on sprite_canvas.gd: pencil, eraser, line, rectangle, fill, colour picker, rectangular select with move / copy / paste / flip / rotate by 90, a 1-pixel and a bigger brush; zoom and grid exist. A palette panel on Godot's ColorPicker (its presets are the swatches): the user's own swatches saved in the project (a new sprites/palette.json layer of the project), plus "add from image". Each stroke is one undo step with its changed rectangle's pixels. Every edit goes through Pack.replace_frame, so every view of the frame updates as the user draws. Keyboard shortcuts for every tool.
  3. Frame sequences (#144): numbered ids (<name>.00, .01, ...) shown as one sequence with a frame strip; add, insert, delete, reorder (renumbering); playback at a chosen rate; onion skin of the previous frame on the canvas; playback with Godot's SpriteFrames and AnimatedSprite2D. More than that (layers, a timeline) is the outside editors' job. Explosions, wheels, rotors and soldiers' walk cycles are sequences.
  4. Team paint (#9): make a team-paint mask from a colour range of the drawing, and paint it with the pixel tools (a mask is an ordinary sprite of kind mask). The colour strip already previews every team colour.
  5. Tiles: a 3 x 3 tiling preview while drawing a terrain frame, and a preview of a tile next to its neighbours chosen from the project's tiles.
  6. Where-used (#8): the inspector lists what draws the sprite (vehicles' faces, tiles, effects, HUD).
  7. Outside editors stay first-class: "Open in image editor" works for a blank sprite too, and "Import a sheet" cuts a grid of frames from one PNG into a sequence (Image.get_region), for artists who draw strips in Aseprite or Pixelorama.

Checks: an engine check per tool that applies it to a fixture frame through the workspace API and asserts the pixels, the undo, the saved PNG and the provenance; a UI check that every tool button exists and acts on the canvas; a round trip of a sequence (insert a frame, save, reload, same ids and pixels).

Try-out: in a new standalone project, draw a 32 x 32 tile and check it tiles; draw a 4-frame explosion and play it; draw a vehicle body, make its team mask, and see it in every team colour; draw one frame in an outside editor and see it reload.

S7.3: maps (#135, #3)

Done: document 183.

Build: first the tile types (#135): a Tiles panel that writes terrain/tileset.json (each art id: its sprite, terrain class, road, hole, water class, hit points and what it becomes when destroyed), terrain/water.json, terrain/coastal_shapes.json and coastal_damage.json, terrain/decorations.json (types), terrain/gates.json and terrain/home_pad.json. Then map editing as EDITOR_PLAN.md section 5 designs it, drawn on Godot's TileSet and TileMapLayer (which scroll, zoom and redraw a grid of tiles for free; the tool's own brush, rectangle and fill write both the layer and art.bin) (#3), starting from the existing read-only map viewer (editor/map_view_panel.gd): New map (size, name, players); paint tiles into art.bin with brush, rectangle and fill; place decorations, gates, spawn points, home pads, target pools and the flag; the rules panel (sides, colours, roster); Play this map (it exists). Start at the original's 128 x 128 and allow smaller sizes; anything that breaks at other sizes (EDITOR_PLAN.md section 8 lists the 128 x 128 assumptions) is fixed in the engine, with a check.

Checks: a check that builds a map through the workspace API on fixture tiles, saves it, loads it with LevelData, and runs a match on it with the determinism harness's two computer players for a few hundred ticks (they must leave the pads and meet).

Try-out: with the tiles from S7.2, define the tile types, paint a two-player map with water, a road and buildings, place both sides' pads and flags, and walk it in the map's 3D preview. (Playing it needs a vehicle: the S7.4 try-out plays it.)

S7.4: vehicle numbers and weapons (#4, #136)

Done: document 184.

Build: EDITOR_PLAN.md sections 4.1, 4.2 and 4.4. Numbers and behaviour first (#4): the module inspector with typed fields (16.16 shown as decimals, per-tick values with per-second equivalents, headings in steps and degrees), slot pickers, New from blank (a vehicle with one box for a body, so it can be driven before S7.5). Then weapons (#136): projectile types, a vehicle's weapon slots, explosions (with the sequences from S7.2) and their damage boxes, mines. Then the sandbox test drive of 4.4 and the roster (with the selector's bays; the selector takes more than four vehicles since #56).

Checks: build a vehicle through the workspace API from a blank, with one weapon, on fixture art; save; load it in a match; drive and fire it for a few hundred ticks; assert it moved, the shot flew and hit. The determinism harness replays that match identically.

Try-out: make a new vehicle from blank, set its speed and turn rate, give it a weapon whose shot and explosion are the user's own sequences, test-drive it, add it to the roster, and play the S7.3 map with it in split screen.

S7.5: the vehicle assembler, a vehicle from 2D faces (#5, #6)

Done: document 185.

A vehicle's look is nothing but flat faces in 3D: each face is one sprite stretched over four corners. This is the render descriptor's vocabulary, the one game/vehicle_render_3d.gd already draws, so the assembler needs no engine change. One face of a pack's vehicle.json render.parts:

{"corners": [[-12.0, -12.0, 5.0], [12.0, -12.0, 5.0], [12.0, 12.0, 5.0], [-12.0, 12.0, 5.0]],
 "sprite_ids": ["<side 1 sprite>", "<side 2 sprite>", "<hit-flash sprite>"], "flags": 8}

render.groups rotates a named set of faces by a channel the vehicle's modules publish (a turret by turret_deg). The assembler of EDITOR_PLAN.md 4.3 and 4.5 (#5) is the tool that builds these, in a 3D view made of Godot's SubViewport, Camera3D and the engine's own renderer, so what the user builds is exactly what the game draws:

  1. The view: orbit, pan, zoom; the game's own camera angle one key away; a ground grid in the game's units with snapping (quarter units); the vehicle shown in any team colour.
  2. Add a face (a flat panel), a box (six faces) or a wedge, at the last selection. Once placed, every face is an ordinary face: select it (a ray against its quad), move, rotate and scale it with on-screen handles (the tool's own: Godot's 3D gizmos are editor-only), or drag one corner, or type the corners in.
  3. Paint a face with a sprite from the user's pack: pick the team pair from the Assets browser, or draw a new one on the spot (opens S7.2's canvas on a blank sprite sized to the face). A face with no sprite yet shows a checker. Double-click a face to edit its frame on the canvas (#6), and see the vehicle update as the user draws.
  4. Mirror a face or a group across the centreline, repeat one along an axis at a spacing (wheels, ribs), duplicate, delete, and reorder (order is draw order).
  5. Groups and channels: put faces in a group that rotates by a channel (the turret, the rotor), or bind one face's sprite to a channel (a wheel strip: a sequence from S7.2 indexed by the wheel channel). A scrubber moves each channel so the result shows at once.
  6. The rest of the body: the collision polygon from above with draggable points, mounts and muzzles as markers (the S7.4 weapon fires from them), the wreck's look.
  7. New from one of the user's vehicles: copy one of the project's own vehicles under a new id and reshape it. (There is no template from the original game in a standalone project, and must not be.)

Checks: build a box, a mirrored wheel pair and a turret group through the workspace API on fixture sprites; save; assert the render table (corners, sprite ids, groups) and that a reload draws the same faces; rotate the turret channel and assert the group's faces moved and the rest did not; undo every step back to the blank. A UI check drives the selection, the handles and the mirror through the panel.

Try-out: build a vehicle body from faces painted with the user's own sprites, give it a turret that turns and wheels that roll, see it in every team colour and from the game's camera, drive it in the sandbox, and fight with it on the S7.3 map.

S7.6: sounds, world objects and rules (#137, #138)

Build: a Sounds tab (#137): the list of cues the engine plays (from the engine's own code, so a missing cue shows as silent), import WAV or OGG for a cue (Godot's AudioStreamWAV.load_from_file and AudioStreamOggVorbis.load_from_file, no import step), play it, set category and priority; the music and jingle tables with their tracks. The user records or composes the sounds elsewhere; the tool imports and assigns them. Then the world-object and rules tables (#138): soldiers, gun turrets, Drones, the edge guard, debris, the flag marker, the death skull, the computer players' profiles and handicaps, and the controls. Read-only first (with the traced defaults and provenance, as the Vehicles tab shows modules), then editable.

Checks: each table round-trips through the workspace; a match on fixture data with soldiers and a turret runs and replays identically.

Try-out: give every cue a sound of the user's own (or leave one silent on purpose and see Validate list it), add music, place soldiers and turrets on the map, and play against the computer.

S7.7: front end and HUD (#139)

Build: editors for ui/menus.json (screens and buttons), ui/skin.json (colours, fonts, frames; fonts imported as font files through Godot's FontFile, TTF or OTF or a BMFont made in a font tool, or drawn as a sprite sheet in S7.2), ui/progression.json (campaign groups and unlocks), the HUD tables (hud/panels.json, hud/selector.json, hud/radar.json) and the title and banner pictures, each with a live preview using the engine's own screen code.

Checks: each table round-trips; the engine's front end, run on a fixture skin made through the workspace API, shows its title and buttons with the skin's colours.

Try-out: give the game its own title screen, menu look and HUD; walk from the title to a level and back.

S7.8: the game, its build and its checks (#140, #141, #142)

Update (document 188, 2026-12-01): the choices below are made. The game is a small netplay test game, openfire-nettest (public): 2 to 4 players, two vehicles, two maps, flag / score / time rules, a side-pick screen. It ships web first (desktop later). It needs engine work first: up to four sides, the score and time rules, the side-pick screen. Netplay will be rollback from the start, with lockstep as a setting.

Build: the game's own repo, as the engine's docs/STARTING_A_GAME.md describes (the engine as a submodule, the user's pack inside, the export plugin that adds the pack's files, the engine's tests/ and tools/ left out) (#140). Which game it is (Invasive Species or a small game made for netplay testing), its name, and whether the repo is public is the user's choice when this stage starts. CI in that repo: export for Windows, Linux and the web; the no-original-asset check (#141: every exported file's hash, and every image's decoded pixels, against a hash list of Return Fire's pack written by openfire's importer, only the hashes committed, plus every frame's provenance); and the determinism workflow of document 178 on a match of the game's own map (#142).

Checks: the CI run itself: three exports reach the title screen from an empty folder, the asset check passes (and fails on a planted original file in a check of its own), and the recording agrees on every platform.

Try-out: download the build from CI on another machine, play it, and hand it to a tester.

When S7.8 is done, #143 closes, and netplay (Phase 5) starts on the test game.

What stays the user's

  • All content: every picture, sound, tile, map, vehicle, menu and the game's name.
  • The choices the plan leaves open: which game (S7.8), the repo's visibility, the art style and palette, the map size, how many vehicles.
  • The try-outs: a stage is accepted by doing them, not by the checks alone. When a try-out finds something the tool cannot do or does badly, that is a new issue on the stage, fixed before the stage closes.

Where the plan's pieces are

  • openfire docs/EDITOR_PLAN.md: the editor's design (sections 3 to 5, build order in 7; S7 brings E6 forward, see its note). Section 2: why the tool is its own program and not a Godot editor plugin.
  • Engine game/vehicle_render_3d.gd: the faces the assembler builds.
  • Engine editor/: the mod tool. editor/sprite_canvas.gd is the canvas the pixel tools join; editor/workspace.gd the undoable actions; editor/pack_writer.gd the saving.
  • Engine game/pack.gd: every pack table the tool must write (document 179 step 2 lists them by area).
  • Engine docs/STARTING_A_GAME.md: the game's repo and export.
  • Tracking: #143.

S7.1 is done: document 181. S7.2 is done: document 182. S7.3 is done: document 183. S7.4 is done: document 184. S7.5 is done: document 185. S7.6 is done: document 186. S7.7 is done: document 187. S7.8's design is agreed: document 188. Next: S7.8's engine pieces, then the game.

Clone this wiki locally