Skip to content

Smart Templates (kCEK 10 & 11)

Smart Templates are user-made templates used for the Auto Build feature. They are stored in GLM_20.

kCEK 10

KeyValueType
1Smart Template IDinteger
2Namestring
3Template Variationsdict
4Allow Rotationinteger
5Allow Flip Xinteger
6Allow Flip Yinteger
7Ignore Cornersinteger

Keys 4 to 7 are set to value 1 when the template is first selected in-game. Once saved, these keys cannot be removed. The keys are functionally useless as the template does not remember the last selected options when loaded.

Key 3 stores a dictionary that maps a 9-character long string key (representing the template's 3x3 layout) to a list of kCEK 11 dictionaries.

The character's index represents its position inside the layout:

CharPosition
1Center
2Top
3Bottom
4Left
5Right
6Top Left
7Top Right
8Bottom Left
9Bottom Right

The character's value represents the type of template that will be matched at that position:

ValueTemplate
0None
1Square
21x Slope Bottom-Right
31x Slope Bottom-Left
41x Slope Top-Right
51x Slope Top-Left
62x Slope Center Bottom-Right
72x Slope Side Bottom-Right
82x Slope Center Bottom-Left
92x Slope Side Bottom-Left
A2x Slope Center Top-Right
B2x Slope Side Top-Right
C2x Slope Center Top-Left
D2x Slope Side Top-Left
E2x Slope Center Right-Top
F2x Slope Side Right-Top
G2x Slope Center Right-Bottom
H2x Slope Side Right-Bottom
I2x Slope Center Left-Bottom
J2x Slope Side Left-Bottom
K2x Slope Center Left-Top
L2x Slope Side Left-Top

The directions represent what side the legs of the slope point towards. 1x Slopes have equal legs, so they are interchangeable, while for 2x slopes the first direction is the one the longer leg sits on and the second direction is for the shorter leg.

2x slopes cover 2 blocks, so they are represented by 2 different templates, where center is the smaller half of the slope, while side is the larger half.

kCEK 11

KeyValueType
1Object Stringstring
2Weightint

Key 1 is the object string of the template variation. The object string is unencoded and stored raw. The center point is at X: 0, Y: -90.

The center smart template object is also encoded alongside the rest of the template variation's objects and is given property 34 (group parent) when serialized.

Key 2 is the variation's weight used to calculate the template's random chance to be picked.