Vertex Offsets

Vertex offsets are a powerful feature that let you adjust the positions of the verteces of a tile. Each tile has a total of 8 corners which can be adjusted, allowing things such as hills, slopes, and even diagonal walls.

The eight corners are as follows:

corner 1: bottom northwest
corner 2: bottom northeast
corner 3: bottom southwest
corner 4: bottom southeast
corner 5: top northwest
corner 6: top northeast
corner 7: top southwest
corner 8: top southeast

The vtx function takes parameters for each of these 8 corners, for each of the x, y, and z axes.


x1,y1,z1|x2,y2,z2|x3,y3,z3|x4,y4,z4|x5,y5,z5|x6,y6,z6|x7,y7,z7|x8,y8,z8

Diagonal Walls

Diagonal walls are achieved by taking one of the corners of the tile and moving it to the center.

Example:


    vtx(x4:-.5,-.5),side(+0,+1,connect:se),-1#top(A2,0,0)

The vtx command takes corner 4 (the sourtheast corner) and moves it to the center of the tile. This creates the basic shape for the diagonal wall.

In the side command, we're both choosing a new texture for the side (+0,+1 is one tile down on the tileset), but we're also setting the connection mode. connect:se means the southeast corner should have the texture be "connected", this prevents the autotile from using a corner texture here.

-1# indicates a new Configuration Layer (a new feature in Rewrite). This creates a new layer that we can configure. -1 means it will be below the default layer. This layer will just be a basic floor texture with top(A2,0,0). Otherwise, our vertex offset will leave a hole in the floor. Alternatively, if we have the floor on a different tile layer already then we don't need this part.

Slopes

Internally, the Slope command uses vertex offsets. The two following configurations should have roughly the same result. Although, the slope command has some additional features for the direction of the slope.


slope(1)

vtx(z7:1|z8:1)

z7 and z8 are the top southwest and top southeast corners, each of which we're moving up (z) by 1.

Theme: