SCRMaps
/
Sign in

The diamond lattice Isometrical actually works in

Isometrical does not paint in tiles. It paints on a lattice of 4x2-tile diamonds, and it redraws past the area you painted.

11 min read

The previous lesson got as far as "it lays terrain in diamonds and blends the edges". Knowing exactly what that diamond is explains both "why will it not make this shape" and "why did painting next to it change what I already had".

isomWidth  = 타일 너비 / 2 + 1          isomX = 타일 x / 2
isomHeight = 타일 높이 + 1             isomY = 타일 y

마름모는 (isomX + isomY)가 짝수인 자리에만 존재합니다
마름모 하나가 덮는 타일:  x = 2*isomX-2 .. 2*isomX+1,  y = isomY-1 .. isomY
One diamond is 4 by 2 tiles. And the lattice is a checkerboard, so a diamond exists at only half the positions.

Painting a rectangle paints only the diamonds whose whole footprint fits inside it. If none fits, nothing happens at all - so a small rectangle works or does not work depending on where it is, not only on how big it is.

Does it hold a whole diamond at every offset?
4 x 2At 16 of 64 offsets.
5 x 2At 32 of 64.
4 x 3At 32 of 64.
5 x 3All 64. Always.

5x3 is not a rule of thumb, it is the smallest rectangle that works wherever it lands. Size every area from there up and the parity never has to be thought about. For scale: 16x16 holds 53 diamonds, 32x24 holds 173, 64x64 holds 977.

And the edge blending reaches OUTSIDE what you painted - two diamonds, 8 by 4 tiles. Paint next to an area and you re-cut its border. Paint the edge that should win last, or leave 8 tiles between areas that must not touch.

The tile id comes out of the same structure: divide by 16 for the tile group, the remainder is the variant. A group holds the common variants first, then a single 0, then the rare ones - and painting picks a rare one with a 1 in 20 chance.

That choice is not random but seeded from the operation's own parameters, so the same brush at the same place in the same size always produces the same tiles - and re-running a step changes nothing.

Finally, not every terrain can meet every other. Each tileset carries a table of which types connect to which, and two that are not adjacent get an intermediate laid between them automatically. You cannot design a border straight from water to high dirt - think of it as water, then dirt, then high dirt.

Terrain modes
Sign in to track your progress