Skip to content

Updated smart template info#41

Open
UHDanke wants to merge 1 commit intoRifct:mainfrom
UHDanke:patch-1
Open

Updated smart template info#41
UHDanke wants to merge 1 commit intoRifct:mainfrom
UHDanke:patch-1

Conversation

@UHDanke
Copy link

@UHDanke UHDanke commented Feb 27, 2026

Based off the following research:

Center template is also serialized and has group parent set when serialized.

If the template contains a group parent besides the center template, the center of the object group will be calculated as the average of all objects' sprite origin positions. Since the game assumes the center is always X 0 Y -90 when pasting the objects regardless of the center template's position, this results in a bug where all objects inside the template are offset from their actual position.

kCEK 10
1 - template id: int
2 - name: str
3 - variations: dict[template_match_string,list[dict_kCEK_11]]
4 - allow rotation: int
5 - allow flip x: int
6 - allow flip y: int
7 - ignore corners: int

4-7 are set upon first selection to value 1 while the template is in use, once saved they cannot be removed and the template does not remember the last selected options when loaded in-game.

kCEK 11
1 - serialized objects: str
2 - weight: int

Template match string

9-character string that encodes the template's 3x3 block layout. The character's index encodes position while its value encodes template type.

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 of the slope points towards while 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.

Index
0 - Center
1 - Top
2 - Bottom
3 - Left
4 - Right
5 - Top-Left
6 - Top-Right
7 - Bottom-Left
8 - Bottom-Right

Values
0 - None
1 - Square
2 - 1x Slope Bottom-Right
3 - 1x Slope Bottom-Left
4 - 1x Slope Top-Left
5 - 1x Slope Top-Right
6 - 2x Slope Center Bottom-Right
7 - 2x Slope Side Bottom-Right
8 - 2x Slope Center Bottom-Left
9 - 2x Slope Side Bottom-Left
A - 2x Slope Center Top-Right
B - 2x Slope Side Top-Right
C - 2x Slope Center Top-Left
D - 2x Slope Side Top-Left
E - 2x Slope Center Right-Top
F - 2x Slope Side Right-Top
G - 2x Slope Center Right-Bottom
H - 2x Slope Side Right-Bottom
I - 2x Slope Center Left-Bottom
J - 2x Slope Side Left-Bottom
K - 2x Slope Center Left-Top
L - 2x Slope Side Left-Top

Based off the following research:

Center template is also serialized and has group parent set when serialized.

If the template contains a group parent besides the center template, the center of the object group will be calculated as the average of all objects' sprite origin positions.
Since the game assumes the center is always X 0 Y -90 when pasting the objects regardless of the center template's position, this results in a bug where all objects inside the template are offset from their actual position.

kCEK 10
1 - template id: int
2 - name: str
3 - variations: dict[template_match_string,list[dict_kCEK_11]]
4 - allow rotation: int
5 - allow flip x: int
6 - allow flip y: int
7 - ignore corners: int

4-7 are set upon first selection to value 1 while the template is in use, once saved they cannot be removed and the template does not remember the last selected options when loaded in-game.

kCEK 11
1 - serialized objects: str
2 - weight: int

Template match string

9-character string that encodes the template's 3x3 block layout.
The character's index encodes position while its value encodes template type.

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 of the slope points towards while 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.

Index
0 - Center
1 - Top
2 - Bottom
3 - Left
4 - Right
5 - Top-Left
6 - Top-Right
7 - Bottom-Left
8 - Bottom-Right

Values
0 -  None                        
1 -  Square                      
2 -  1x Slope Bottom-Right       
3 -  1x Slope Bottom-Left        
4 -  1x Slope Top-Left           
5 -  1x Slope Top-Right          
6 -  2x Slope Center Bottom-Right
7 -  2x Slope Side Bottom-Right  
8 -  2x Slope Center Bottom-Left 
9 -  2x Slope Side Bottom-Left   
A -  2x Slope Center Top-Right   
B -  2x Slope Side Top-Right     
C -  2x Slope Center Top-Left    
D -  2x Slope Side Top-Left      
E -  2x Slope Center Right-Top   
F -  2x Slope Side Right-Top     
G -  2x Slope Center Right-Bottom
H -  2x Slope Side Right-Bottom  
I -  2x Slope Center Left-Bottom 
J -  2x Slope Side Left-Bottom   
K -  2x Slope Center Left-Top    
L -  2x Slope Side Left-Top
@UHDanke
Copy link
Author

UHDanke commented Feb 27, 2026

Commit has an error, 4 and 5 are swapped around, should be like this:
2 - 1x Slope Bottom-Right
3 - 1x Slope Bottom-Left
4 - 1x Slope Top-Right
5 - 1x Slope Top-Left

@UHDanke UHDanke marked this pull request as draft February 28, 2026 11:05
@UHDanke UHDanke marked this pull request as ready for review February 28, 2026 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant