AI tools: 2D games
Tilemaps, sprites, 2D art, 2D worlds and checks. 24 tools. You see every step your AI takes and can undo any of them.
art2d_import_review
Key a source sheet into a new review folder. Default border-only; enclosed:"key" also removes enclosed key regions of at least minimum_enclosed_area working pixels (default 24), honoring protection rectangles; incompatible with key:"none". Preserve frame groups/pivots and audit removed enclosed-region count/area. Optional edge_rgb:"foreground" repairs strong key-hued RGB within edge_rgb_radius working pixels (1–16, default 4), using reliable same-object foreground; preserves alpha/protection and audits repaired/unresolved pixels. A radius alone does not enable it; incompatible with key:"none". Optional unmix:"boundary" limits inferred alpha/color unmixing to unmix_radius working pixels from removed background (1–16, default4), retaining opaque interior RGBA before the separate RGB pass; radius alone is disabled and key:"none" is incompatible. Never silently approves art. HTTP calls return a job_id immediately; read progress and the final result with tool_job instead of repeating the tool.
| Argument | Type | What it does |
|---|---|---|
columns | integer | |
edge_rgb | foreground | Opt-in boundary RGB repair only; alpha and protected pixels unchanged; incompatible with key:"none". |
edge_rgb_radius | integer | Boundary-band radius in working pixels. A radius alone does not enable repair. |
enclosed | key | Opt in to removing enclosed key-color regions; omit for border-only keying. Incompatible with key:"none". |
key | string | |
minimum_enclosed_area | integer | Minimum enclosed-region area in working-image pixels. |
output required | string | |
protect | list of list of integer | |
regions | list of list of integer | |
rows | integer | |
source required | string | |
tolerance | number | |
unmix | boundary | Opt in to boundary-only alpha unmixing for opaque art. Default legacy behavior retained; incompatible with key:"none". |
unmix_radius | integer | 4-connected foreground distance from removed background, in working pixels. A radius alone does not enable the mode. |
art2d_split_map
Split a flat map into aligned ground/wall/roof PNGs using explicit top-left pixel polygons. Up to 8 layers, 2048x2048. Original art is preserved. Optional underlay supplies hidden ground; otherwise holes are transparent and reported for review. Does not infer semantic regions or invent hidden art. HTTP calls return a job_id immediately; read progress and the final result with tool_job instead of repeating the tool.
| Argument | Type | What it does |
|---|---|---|
layers required | array | [{name:'roof',polygons:[[[x,y],[x,y],[x,y],...]]}] |
output required | string | |
source required | string | |
underlay | string |
art2d_timeline
Create, inspect, retime or set frame events; undo/redo use the persisted AI/human authoring history. Writes editable authoring JSON plus exportable timeline on request. Scrubbing/onion preview emits no events.
| Argument | Type | What it does |
|---|---|---|
action required | create / inspect / retime / event / undo / redo / export | |
event_id | string | |
event_name | string | |
frame | integer | |
frames | integer | |
name | string | |
offset | integer | |
output | string | |
page | string | |
source | string | |
ticks | integer |
art2d_trace_alpha
Trace alpha into editable polygons, retaining holes and concavities. Writes source hash/resolution/scale/kind; does not infer a physical footprint or alter runtime collision.
| Argument | Type | What it does |
|---|---|---|
kind | silhouette / footprint / walkable | |
output required | string | |
pixels_per_unit | number | |
source required | string | |
threshold | number |
catalog_bake_outfit
Compose same-grid sprite layers with exact palette swaps and optional RGB-mask outfit tints. Recipe uses CatalogDollRecipe JSON; original layers stay intact.
| Argument | Type | What it does |
|---|---|---|
columns required | integer | |
frames required | integer | |
name required | string | |
recipe required | string |
catalog_bake_set
Bake real animations into matching transparent 2D sheets with a shared camera, scale and palette. Optional motion_library is an Assets-relative glTF/GLB supplying clips for retargeting to the model. Saves an immutable folder with source hashes. HTTP calls return a job_id immediately; read progress and the final result with tool_job instead of repeating the tool.
| Argument | Type | What it does |
|---|---|---|
actions | list of string | |
directions | 1 / 4 / 8 | |
frames | integer | |
height | integer | |
model required | string | |
motion_library | string | |
name required | string | |
style | pixel16 / painted | |
view | side / threeQuarter | |
width | integer | |
yaw | number |
catalog_bake_sprite
Render a real skinned glTF animation to an orthographic 2D sprite sheet. Optional motion_library supplies real clips from a separate Assets-relative glTF/GLB. Uses CPU skinning, alpha, outlines and pixel palettes. No overwrites. HTTP calls return a job_id immediately; read progress and the final result with tool_job instead of repeating the tool.
| Argument | Type | What it does |
|---|---|---|
clip required | string | |
frames | integer | |
height | integer | |
model required | string | |
motion_library | string | |
name required | string | |
style | pixel16 / painted | |
view | side / threeQuarter | |
width | integer |
catalog_slice_sprite
Slice a source sheet into editable numbered PNG frames without overwriting originals. Grid and pivot validation share the baker APIs.
| Argument | Type | What it does |
|---|---|---|
columns required | integer | |
frames required | integer | |
name required | string | |
source required | string |
collision_overlay_2d
Show or hide the 2D collision overlay in the editor and in Play: solid tiles and slopes (green), one-way (cyan), solid bodies and outlines (yellow), movers (white), sensors (magenta), camera rooms (blue), roof areas (orange), y-sort feet (red). Not saved.
| Argument | Type | What it does |
|---|---|---|
on | boolean |
feel_2d_report
2D animation and action feel (anim_2d, action_2d, rig_2d): checks every object's frame times, events, hit/hurt boxes, states, transitions and rig lines (problems are listed by object). With seconds>0, plays the scene on an isolated copy (the live scene is untouched) with held keys by time, using the same inputs array as play_test, and reports accepted hits (who, whom, damage, time), duplicates rejected, frame events and state changes per object, effect pool use and script errors. Optional bot drives a side-on player through normal controls and reports accepted damage per minute. Zero hits need inspection of the inputs, animation and hit boxes. HTTP calls return a job_id immediately; read progress and the final result with tool_job instead of repeating the tool.
| Argument | Type | What it does |
|---|---|---|
bot | object | Optional side-on combat input probe: {attack_key:'J',range:100,cadence:0.5}. Cannot combine with inputs. Reports actual accepted damage per minute; no path planning. |
effects | boolean | false: effects off (the on/off comparison); hits and motion must not change. |
inputs | list of object | Same controls as play_test: {from,to,move,keys,fire,look,sprint,crouch}. |
limit | integer | |
seconds | number |
fx_2d
2D effects (fighting-game VFX): list recipes, preview one as rendered frames, or save one into the project. A recipe combines particles (sparks, embers, smoke, debris with physics, colour ramps, bloom), painted flipbooks from Assets/2D/fx, a sword swing arc, a shockwave (refraction ring), a ground decal, hit-stop, screen flash, speed lines, light, shake, chromatic pulse. Scripts play one with game.fx(name, [x, y], dir, strength) or self.fx(name); action_2d burst and anim_2d 'fx:NAME' events use the same names.
| Argument | Type | What it does |
|---|---|---|
action | list / preview / save | |
direction | number | preview: 1 right (default) or -1 left. |
name | string | preview: a recipe name to show. |
recipe | object | preview/save: a full recipe object (see docs/guide/2d-vfx.md); validated before use. |
strength | number | preview: hit strength (1 as authored). |
game_state_2d
The game-wide state (game.state: coins, items, quest flags carried across scenes and saved in slots). action get (all values, or one key), set (key + JSON value, for testing), new_game, slots (the save slots and their status). Works on the running game; without one, slots reads the project's Saves folder.
| Argument | Type | What it does |
|---|---|---|
action | get / set / new_game / slots | |
key | string | |
value | string | set: the value as JSON (5, "text", true, {"stage":2}). |
light_2d_scene
2D scenes: real lights in one step. preset sets the mood on the scene's lighting_2d (night, cave, dusk, dawn, day, neutral) and lights everything (lit_by_default). auto_lights puts a light_2d at every light-giving sprite (named or tagged torch, lantern, lamp, candle, fire, brazier, window, crystal, or with an <image>.emissive.png), at its glowing part in its colour, flickering for flames, casting shadows, with an emissive material so the flame glows and blooms. occluders gives solid-looking sprites (pillar, crate, wall, rock, tree, statue, barrel; solid body_2d) a sprite-shaped occluder_2d so lights cast hard shadows. explain: true lists the scene's lights, budget and settings, changing nothing. Everything added is ordinary components: tune them with edit_entity (light_2d.intensity, radius, flicker, color; material_2d.normal "auto" for relief; lighting_2d.time_of_day for a day cycle). Then look with screenshot.
| Argument | Type | What it does |
|---|---|---|
auto_lights | boolean | Add lights at light-giving objects (default true). |
explain | boolean | Only describe the scene's 2D lighting. |
occluders | boolean | Add occluders to solid-looking objects (default true). |
preset | cave / dawn / day / dusk / neutral / night / readable_night | The mood (sets lighting_2d). night: moonlit and contrasty; readable_night: brighter base light with broad, soft light pools. |
motion_2d_rig
Bring a Paper Forge character to life: turns an object drawn with a Paper Forge rig's sprite sheet (Assets/2D/paperforge/<name>/) into a live cut-out rig_2d plus motion_2d (breathing, walk/run blend, jump squash, turn-arounds, wind-up/strike/follow-through with smears, flinch, death, blinking, eye look-at, talking mouth shapes and emotions from the recipe's alternative face parts, springy hair and capes). Keeps its position, layer, mirroring and every other component; anim_2d states and boxes keep working (a move's clip has four frames: wind-up, strike, follow-through, recovery). body: biped, blob, flyer or npc. preset fills in the numbers for a kind of character. Undoable.
| Argument | Type | What it does |
|---|---|---|
body | biped / blob / flyer / npc | |
entity required | string | Object name or #id. |
preset | hero / knight / brute / skeleton / slime / bat / boss / villager |
motion_2d_tune
Tune a motion_2d character in plain words, no code: changes like "heavier attack", "snappier attack", "bigger swing", "more squash", "less bounce", "heavier", "lighter", "more lean", "angry", "happy", "scared", "telegraph attacks", "blink more", "falls apart when it dies". Each is a reviewed multiplier on the motion_2d numbers (shown in the reply); several can be given. Undoable.
| Argument | Type | What it does |
|---|---|---|
changes required | list of string | Plain words, e.g. ["heavier attack", "more squash"]. |
entity required | string | Object name or #id. |
paper_forge
Paper Forge: make 2D game art FROM CODE (no images needed, no rectangles): a pf.* JavaScript recipe of 2D shapes raised into a shallow 3D relief, painted with generated palettes and procedural textures (brush strokes, wood, planks, cracked stone, water, moss drips), lit and inked to look hand-drawn. Bakes sprite pages at 1x/2x: painted beauty, relightable albedo, normal map, emission, relief height; rigs (cut-out parts on bones, posed into idle/run/... frames, plus a parts atlas and bone list) and auto-tiling tilesets (ttr.tileset JSON). mesh: true also writes a 3D relief model (Assets/Forge/<name>_relief.glb) for 2.5D cameras. action api lists the whole recipe API; list shows existing recipes. Recipes are saved to Assets/PaperForge/<name>.pf.js, art to Assets/2D/paperforge/<name>/. Returns the sprite component line (or tileset path) to paste into the scene, the clips, and a preview. mode strict is the truly image-free route: geometry and flat palette colours only (no pictures written or read), lit, banded and inked by the renderer (camera_look style stylized), with triangle and colour budgets.
| Argument | Type | What it does |
|---|---|---|
action | bake / api / list / save | bake (default), api (the recipe reference), list (recipes in Assets/PaperForge), save (a shared file other recipes include(), such as a palette: saved, not baked). |
max_colors | integer | strict: flat colours (draws per instance), default 10. |
max_triangles | integer | strict: triangle budget (default 20000); the grid coarsens to fit. |
mesh | boolean | baked mode: also write the 2.5D relief model Assets/Forge/<name>_relief.glb (textured from the baked pages). |
mode | baked / strict | baked (default): sprite pages for the 2D renderer. strict: truly image-free, a relief mesh with flat palette colours and 0 images (Forge/<name>.strict.glb); tilesets need rows and become one level mesh. |
name | string | Asset name (letters, digits, _): Assets/PaperForge/<name>.pf.js. |
recipe | string | The pf.* recipe source; saved as Assets/PaperForge/<name>.pf.js. Leave out to rebake the saved recipe. |
rows | list of string | strict tilesets: the level rows (top first), as in tilemap rows. |
shoot_2d_report
Plays the 2D scene on an isolated copy (the live scene is untouched) for seconds, with the player aiming at the nearest enemy and firing (or the given inputs, as play_test), and reports guns: shots fired, hits landed, kills, explosions, pickups, reloads, peak bullets, accuracy, damage by weapon, accepted hits, script errors. Zero hits means the guns, teams, hurt boxes or line of sight need a look. HTTP calls return a job_id immediately; read progress and the final result with tool_job instead of repeating the tool.
| Argument | Type | What it does |
|---|---|---|
inputs | list of object | Optional play_test controls {from,to,move,keys,fire}; without them a bot walks toward enemies, aims and fires. |
seconds | number |
tilemap_paint
Undoable 2D brush, flood fill or rectangle. Stores terrain identity; existing world terrain rules resolve neighbors. Points are top-first [column,row].
| Argument | Type | What it does |
|---|---|---|
entity required | string | |
mode required | brush / fill / rect | |
points required | list of list of integer | |
terrain | string | |
tile required | string |
tilemap_paint_region
Paint a bounded rectangle in an existing 2D tilemap using a declared tileset character ('.' erases). Autotile edges and blob corners update from neighbours; one undoable scene edit.
| Argument | Type | What it does |
|---|---|---|
column required | integer | |
entity required | string | |
height required | integer | |
row required | integer | |
tile required | string | |
width required | integer |
water_2d
Create or edit a 2D water body in one undoable step. Give name to create, entity to edit. fields is water_2d field text (size, shape, color, depth_color, opacity, distortion, foam, columns, tension, damping, spread, idle, density, drag, flow, waterfall, layer, enabled). Position is its centre. Waterfalls use waterfall true and flow (0,-300,0). Body mass, density, swim_speed and breath live on body_2d. Read docs/guide/2d-water.md, then inspect with screenshot and play.
| Argument | Type | What it does |
|---|---|---|
entity | string | |
fields | string | Water field text without outer braces. |
name | string | |
position | list of number |
weapon_2d
2D guns in one undoable step. entity: give or change the guns of an existing object (the hero, an enemy, a turret); name + position: put a gun pickup in the world. weapon: pistol, smg, shotgun, rifle, rocket, laser, orb, turret, thug_pistol or a project weapon (weapon_2d_define). carried: everything it holds. tune: this object's weapon changes, e.g. ["knockback=1100"] for a shotgun that knocks enemies back, ["shotgun.pellets=12", "fire_rate=10"]. ammo: ["shotgun=24"]. fields: any other weapon_2d field text (aim_assist, shoulder, arm, gun_scale, crosshair, control, pickup_ammo). The object also needs action_2d (team, health) for hits; enemies aim and fire from their script (self.aimAt, self.shoot, self.pattern). See docs/guide/2d-shooting.md.
| Argument | Type | What it does |
|---|---|---|
ammo | list of string | |
carried | list of string | |
entity | string | |
fields | string | Other weapon_2d field text without braces. |
name | string | |
pickup | boolean | |
position | list of number | |
tune | list of string | |
weapon | string |
weapon_2d_define
Makes or replaces a project weapon (Assets/Weapons/<name>.weapon.json): base (a built-in to start from) plus settings, e.g. {name: "boomstick", base: "shotgun", settings: {pellets: 12, knockback: 1200, color: [1, 0.4, 0.2]}}. Objects use it by name in weapon_2d. weapon_2d_presets lists the settings.
| Argument | Type | What it does |
|---|---|---|
base | string | |
name required | string | |
settings | object |
weapon_2d_presets
Lists the built-in 2D weapons (pistol, smg, shotgun, rifle, rocket, laser, orb, turret, thug_pistol) with their main numbers, the project's weapon files, and every weapon setting a tune line or weapon file can change.
No arguments.
world_2d_check
Check a 2D world: y-sorted sprites in draw order with their feet, plain sprites standing among sorted ones (a likely missing y_sort), roof groups (members, areas, reveal), camera rooms (overlaps, rooms smaller than the view), unreadable body outlines, and while playing the game state store. Reads the running game when playing, else the scene.
| Argument | Type | What it does |
|---|---|---|
aspect | number | Screen width / height for the room check (default 16/9). |