Autotiling
In the Map Editor, there is a function called 'autotiling' that makes map building much easier and simpler by automatically placing in the correct transitions (i.e. 'grass' to 'water'). This is defined by having one tile as the "mastertile" and the transitions as "insteadofTiles". The "insteadofTiles" are given definitions or "scenarios" where they are true. When the position of the tile is 'true' for that definition, the "insteadofTiles" tile that is attached to that definition replaces the mastertile that was formerly in that position.
The Definitions
The definitions are based on the affinity of the surrounding tiles. So here the red tile is the tile in question: the one we are defining. The green tiles are the surrounding tiles that we will check to see if they have affinity to each other. The tiles that are alike (green), we define as '1'; the ones that are unalike (red), we define as '0'; the ones that can be either way (blue), meaning it does not matter if they have affinity or not, we define as 'x'. We define the surrounding tiles in this order: So that these mastertiles would be defined as such:
00000000
00111000
0011100x
A real definition looks like this:
"00000000-100"
The part before the dash (00000000) is the definition. The part after the dash (100) is the "insteadofTiles" (transition) which will replace the mastertile if the definition is true.
A sample file with the definitions
Code: Select all
{
"masterTiles":[
{
"id":100,
"comment":"grass",
"insteadofTiles":{
"grass":{
"byteTileRel":[
"00000000-100"
]
}
}
},
{
"id":113,
"comment":"water-grass and river-grass definitions",
"insteadofTiles":{
"grass":{
"byteTileRel":[
"11111010-133",
"11101011-134",
"10111110-135",
"10101111-132",
"10101011-128",
"10101110-131",
"10101010-122",
"11101010-129",
"10111010-130",
"11101111-109",
"10111111-110",
"11111011-111",
"11111110-112",
"11111111-113",
"10111011-117",
"11101110-116",
"1x0x1011-140",
"1x0x1110-141",
"101x0x11-3",
"11101x0x-147",
"10111x0x-145",
"111x0x10-146",
"0x11101x-142",
"0x10111x-143",
"10101x0x-125",
"0x10101x-124",
"101x0x10-123",
"1x0x1010-126",
"11111x0x-104",
"0x11111x-101",
"111x0x11-102",
"1x0x1111-103",
"0x101x0x-121",
"101x0x0x-120",
"0x0x101x-119",
"1x0x0x10-118",
"0x111x0x-105",
"111x0x0x-106",
"0x0x111x-107",
"1x0x0x11-108",
"0x1x0x0x-137",
"0x0x1x0x-139",
"1x0x0x0x-138",
"0x0x0x1x-136",
"0x1x0x1x-114",
"0x0x0x0x-127",
"1x0x1x0x-115"
]
}
}
},
{
"id":1000,
"comment":"mountain definitions",
"insteadofTiles":{
"grass":{
"byteTileRel":[
"1x1x1x1x-1007",
"0xxx1xxx-1001",
"1xxx1xxx-1002",
"1xxx0xxx-1003",
"xx1xxx0x-1004",
"xx1xxx1x-1005",
"xx0xxx1x-1006",
"0x0x0x0x-1000"
]
}
}
}
],
"tileIsBasically":[
"grass-100",
"water-101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147",
"mountain-1000,1001,1002,1003,1004,1005,1006,1007"
]
}
Here is a brief explanation of the rest of the definitions.
"id":113, the mastertile
"comment":"water-grass and river-grass definitions", a comment that lets us designers know what we are looking at
"insteadofTiles":{
"grass":{ what we are transitioning from
"byteTileRel":[
"tileIsBasically":[ list of the transitions and what they replace
"grass-100", tile '100' is the only tile that grass
Appendix 2: Block Placement
Example:
Code: Select all
{
"master":6056,
"comment": "coolguys: big stairs",
"blockItemDefs":[
"0,1,6057",
"-1,0,4092",
"-1,1,4093",
"-2,0,4076",
"-2,1,4077"
]
}