PixelKiln tiles and parallax: done when the engine opens them featured image

PixelKiln tiles and parallax: done when the engine opens them

December 04, 2026 · 13 min read

Nineteen releases of tile, terrain and parallax work, judged by one test: does the engine open the file and paint with it, with nothing fixed by hand?

The first LDtk project PixelKiln wrote opened in LDtk 1.5.3 and drew its shorelines correctly. LDtk re-evaluated the auto-rules and got the same 108 tiles the file stored. It still changed three things on load. It capitalized the layer and tileset names and set the level’s world position to -1, so a project nobody had touched opened marked as unsaved. 0.112.0 writes those values the way LDtk does. A small fix, and the standard for everything else in this post.

For new readers, PixelKiln is a manifest-driven pixel-art pipeline. You describe a game’s art in a JSON manifest, it plans the cost, generates through PixelLab and other providers, records every output in a lockfile, and packs and exports the results for engines.

This post covers nineteen releases on two themes. The twelve tags from 0.112.0 to 0.120.0, on November 18 and 19, are tiles and terrain. Seven releases between 0.138.0 and 0.145.0, November 23 to 26, are parallax backgrounds. The argument running through both is that a tileset is not done when the sheet looks right. It is done when Tiled, Godot or LDtk opens it and paints with it without a hand fix, and most of this work went into checking exactly that.

This is part 6 of seven posts on what shipped in PixelKiln between 0.60.1 and 0.150.0. Part 5, Paperdoll characters in PixelKiln: one body, swappable gear, covered the paperdoll builder, and part 7 closes the series with effects, 3D models and the review queue.

LDtk gets a project it can paint with

Tiled and Godot already had exports. 0.112.0 adds --format ldtk, and it writes a whole .ldtk project rather than a tileset: the atlas as a tileset, an IntGrid layer, an AutoLayer with one auto-rule per mask, and a Preview level painted so that it uses every rule.

pixelkiln export --style ground --only terrain --format ldtk

LDtk has no terrain concept. You paint values on an IntGrid layer and an AutoLayer picks tiles by matching rules against the values around each cell. A corner set puts its terrain on the vertices between cells, so the export uses a dual grid. The <asset>_corners layer holds one value per vertex and sits half a tile up and left, and each rule reads a tile’s own cell plus the cells to its right, below and below-right as its four corners. Edge sets read a cell and its four neighbours.

LDtk has no headless mode, so CI can’t open the file. The tests compare the keys with the sample projects LDtk 1.5 ships and run the written rules through a port of LDtk’s own matcher. Then I opened a 16-tile lake and grass set in LDtk 1.5.3, the Preview level drew continuous shorelines, and painting a grass cell redrew the right tiles around it.

LDtk 1.5.3 with a PixelKiln export open: two layers, Ground_lake and Ground_lake_corners, in the layer list, and a 12 by 9 Preview level of grass islands in a lake with every shore drawn by the auto-rules
A lake and grass set exported with --format ldtk and opened in LDtk 1.5.3. The Preview level is part of the export. The capture was added to the site in 0.116.0, after the 0.112.0 naming fix, yet its title bar reads [UNSAVED], so something changed the project after it opened, most likely painting during the capture. The picture doesn’t show what.

Connected sets become one tileset

A PixelLab terrain set has two terrains. A coast needs more. One set draws ocean against sand, the next draws that same sand against grass, and before 0.115.0 each exported as its own two-terrain tileset. --merge-connected writes the whole group, as the manifest’s connect fields define it, as one tileset with every terrain.

Every format takes it. Tiled gets one Wang set, Godot one terrain set, and LDtk one IntGrid value per terrain with a larger 16 by 12 Preview. The LDtk check this time used two connected sets from real art, 32 tiles, three terrains and 31 rules, and LDtk’s own evaluation reproduced all 192 stored tiles. It also showed the limit. Painting dirt straight against lake left those cells empty, because no tile has a lake corner and a dirt corner. Paint a band of the shared terrain between them.

The sets also got a page, /tiles, whose terrain brush paints the real tiles from lookups generated out of the repo’s lockfiles.

A sandy pixel-art island with a grass meadow in the middle, surrounded by ocean, drawn from two connected PixelLab terrain sets
The island from part 2, painted in October from the two connected sets, ocean to sand and sand to grass. It was drawn from the sets themselves, not from a --merge-connected export.

Isometric tiles have to say where the diamond is

0.118.0 started with real PixelLab runs: a corner-ruled ground set, an edge-ruled road set, a building kit and single blocks, 32 generations billed. Each tileset planned at 25 and billed 10. The road set also turned up a hard rule, a 422 at 32px: “Roads need tile_size 48-96 for isometric.”

The finding that mattered for export is that the diamond is not the image. A 32×24 ground tile is a 32×16 diamond with 8 rows of block side hanging below it. An engine’s grid is the diamond, so it has to know where the diamond sits in each image. The export now finds it from the alpha and writes it as footprint. Godot gets the diamond as tile_size, a texture_origin of Vector2i(0, -4) that seats each image on its cell, and tile_layout = 5, the diamond layout. Tiled gets an isometric grid and a tileoffset of y: 8, because it lines images up by their bottom edge.

Edge masks on an isometric tile now export to Godot too. North, east, south and west are the diamond’s top-right, bottom-right, bottom-left and top-left sides, measured on the 17 road tiles of a real set. The proof is a painted map. Godot 4.7.2 drew a 2×2 block that filled exactly the lattice the cell centres predict, and roads painted with its terrain tool ran unbroken with correct corners and T-junctions. The next morning a scripted run of Tiled 1.12.2 painted a 12×10 map with each of five sets, isometric ground and road included, read every cell back, and found 0 missing and 0 wrong. That check is about which tile lands in each cell. The docs’ own geometry section still says the y: 8 offset follows Tiled’s documented rule and has not been loaded in Tiled, so treat where Tiled draws the image as unconfirmed.

An isometric diamond of grass tiles with a dirt road laid across it, including corners, a T-junction and a crossing, painted in Godot from an exported TileSet
The 48px isometric road set, painted in Godot with its terrain tool from the exported TileSet: ground filled with the plain tile, then the road laid on top.

A building kit is pieces, and no engine takes it yet

The building kit from the same run is 58 separate pieces, each 52×58: walls, corners, pillars, doorways, stairs, floors and solid blocks. It billed 10. Its rules are a composed family with no per-tile masks, so no engine exporter maps it. The generic file is the output, and a scene is built by placing pieces by cell and height.

website/art/pixellab-isometric/compose-hall.py places the kit into a three-tier hall with two flights of stairs and a side room up a ramp. 0.120.0 adds two touch-ups, and the page’s caption admits both. The kit draws the ramp’s slope far paler than anything else, so it is repainted in the stairs’ stone, and each doorway, a hole the background showed through, is filled with a dim passage. It is the one place in this post where hand fixes remain.

An isometric stone hall in three tiers joined by two flights of stairs, with pillars, a doorway in the back wall and a small side room one level up reached by a ramp
The stone-hall kit stacked by script into three tiers and a side room. The ramp’s colour and the doorway fills are touch-ups, not the kit’s own art.

Honesty check: every engine had the wrong tiles

Painting real sets is what caught this, and it had been wrong in every format. A real PixelLab terrain set names a tile tile-06-wang-0. The exporter read that trailing number as the tile’s place in the list of corners, so a rule landed on the wrong image in Tiled, Godot and LDtk alike. 0.118.0 finds tiles by role. A set exported by an older version needs exporting again. 0.120.0 adds a warning: line naming the set and tiles when a tile’s role isn’t in the lock’s terrainTiles, the one case where the export still has to guess.

Godot had a second fault. It picks a tile to paint by its centre terrain, and a tile has one centre, so a tile with grass on two corners and sand on two could answer only one brush. Borders came out as a sawtooth. Each such tile is now written once per terrain it touches, as alternatives of one image. npm run test:godot now paints five sets in a headless Godot, the real ocean, sand and grass coast among them, and compares every corner or side with the strokes. All five fail without the alternatives.

Only corner sets were opened in the LDtk editor, so edge sets still rest on the matcher tests alone.

Parallax started as a research note

0.138.0 adds no code to the CLI. It adds the parallax research note and an agent skill reference. 9 of 10 benchmark backgrounds showed a seam 1.3 to 5.6 times the normal step between neighbouring columns, so none loops as generated. Qwen-Image-Layered took 35 to 42 minutes a picture on a 12 GB RTX 3060 and split sky from scene, not near from far. Steps 13 to 16 spent 17 PixelLab generations and $0.24 of Retro Diffusion.

The note’s conclusion is that generators are good at one isolated shape and bad at agreeing across several pictures, so ask them for shapes and do the agreeing yourself. The route it recommends comes from a downstream game project: generate separate silhouettes and lay them in runs.

pixelkiln parallax previews the stack and exports it to four engines

0.140.0 turns the note into a command. A manifest’s new parallax section names a background’s layers, far to near, each a generated asset, a finished file or sky bands PixelKiln draws, with its own speed. pixelkiln parallax preview writes a page that scrolls the set and a strip of frames, and warns about rough joins and backdrops that end too soon. pixelkiln parallax export writes a Tiled map, a Godot scene and an LDtk level. It runs offline and spends nothing. This is the run behind the picture below:

$ pixelkiln parallax preview volcanic-dusk --frames 5
  volcanic-dusk: parallax/volcanic-dusk/volcanic-dusk.preview.html (scrolls in a browser) + .png (5 frames, start to end)
    sky: 384x216 at 0,0, speed 0/1
    far: 241x166 at 0,50, speed 0.125/1, seam 0.0
    cones_far: 504x102 at 0,60, speed 0.25/1
    cones_near: 624x102 at 0,78, speed 0.5/1
    ground: 384x216 at 0,206, speed 1/1
    near: 382x100 at 0,146, speed 1/1, seam 0.0

Godot gets one Parallax2D per layer. LDtk has no image layer, so each layer is baked into one picture of what the camera can see, cut into 16 px tiles, with parallaxFactorX set to 1 minus the speed. The exports were checked pixel for pixel against the preview. Godot 4.7.2 with 2D pixel snapping on, Tiled 1.12.2’s renderer, Phaser 3.80 in a browser and LDtk’s drawing code ported from its source all matched at every tested camera position.

They matched once a same-day fix landed. The first LDtk version threw at speeds such as 0.33 and dropped a column of tiles on slow layers; the fix puts the remainder of a tile into transparent padding. Tiled 1.11 and later apply a non-zero parallax origin with the opposite sign to its manual, so the export leaves the origin at (0, 0) and folds the start into each layer’s offset. And the LDtk editor itself has not opened a parallax export yet. The check is its drawing code.

Five frames of a volcanic dusk parallax background side by side, from the start of the level to the end: banded purple sky, a far range, two tiers of volcanic cones and mesas, and dark lava-cracked hills in front
The preview strip from the run above: the volcanic dusk set at five camera positions, start to end. Six layers, two of them runs of silhouettes.

Runs, feet, tints and loops move from a script into the manifest

The research script finished pieces by hand. The next four releases make each step a layer field, and each one matches the script pixel for pixel.

  • Silhouette runs (0.141.0). A run layer lays generated landforms left to right by seed: each starts 72% of the way across the last plus a random gap, flips at random and never repeats the sprite just used. Each run is baked into one picture, so every export takes it unchanged.
  • Dithered foot and tints (0.142.0). Background removal leaves every pixel fully on or off, so a silhouette can’t fade by alpha. foot trims it and dithers the bottom fraction out. tint mixes toward a colour and snaps to the set’s palette, so two runs of the same sprites become two tiers.
  • Palette files (0.143.0). A style’s paletteFile reads a Lospec, GIMP or Paint.NET palette, and editing the file makes the style’s assets stale.
  • Looping whole pictures (0.144.0). loop takes cut, crossfade or mirror. On seven generated layers from the research, cut left every join at 0.4 of the picture’s own column step or smoother, while crossfade left five rougher than before.
One generated volcanic cone four times on a teal background: as generated, with its bottom dithered out, then tinted toward a pale mauve for the far tier and toward a dark slate for the near tier
One generated cone as it came back, with a dithered foot, and as the far-tier and near-tier copies. Made by the research script, which the foot and tint fields match pixel for pixel.

A second time of day costs no generations

The research tried generating the alpine set again on a night palette. The layers agreed with each other, but every peak moved, and 7 of 9 pictures drew a moon or stars, two of them despite “no moon, no stars” in the prompt. 0.145.0 takes the other route. A set’s times swaps its palette by luminance rank, so every shape stays where it was, and cool leaves warm lights such as lamplight out of the new palette.

Godot gets one scene with a shader and a colour lookup, so one material switches the whole set with time, and blend with blend_to fades between times. Tiled and LDtk have no shaders, so they get a map per time. The swap matches the research script’s recolour on 36 pieces, and Godot 4.7, Tiled’s renderer and LDtk’s drawing code drew the night set at seven camera positions with no pixel different from the preview.

Five frames of an alpine parallax background at night: deep blue sky bands, a pale far range, snow-capped peaks and a dark pine forest in front
The alpine dusk set at night, from alpine-dusk.preview.night.png. Same layers, palette swapped, no new generations.

Little of this is new art. The isometric run billed 32 generations and the parallax sets reuse 51 from the research. The work was in the files around the art: the dual grid LDtk needs, the diamond Godot needs, the origin Tiled draws backwards, a tile name read as a number. Each of those showed up only when an engine drew the file, which is why every claim above names the engine version that drew it.

If you load one of these exports into an engine the post doesn’t name, Defold or Unity’s Tilemap or something of your own, I’d like to know which file you started from and what you had to fix by hand.

The rest of the series

  1. Skeletons, loops and a character studio in PixelKiln
  2. PixelKiln takes on PixelLab’s long tail: revisions, VFX and sidescroller tiles
  3. Measured prices and assets PixelKiln didn’t make
  4. The rest of PixelLab in PixelKiln: music, lip-sync and nine-slice panels
  5. Paperdoll characters in PixelKiln: one body, swappable gear
  6. PixelKiln tiles and parallax: done when the engine opens them
  7. PixelKiln after the picture: effects, 3D models and a review queue (December 9)
Griffen Fargo headshot

Griffen Fargo

Published

Share
Keep Reading

Discussion

Have thoughts? Drop them in.

Comments are powered by Disqus. Sign in once, comment anywhere.

Loading comments…