terrainViewPatterns.json 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. // Defines terrain view patterns.
  2. // The following properties are mandatory:
  3. // data: the 3x3 pattern
  4. // mapping: maps the pattern to a range of terrain view images/frames of the .DEF, e.g. 10-15
  5. // for patterns which represent two transitions a comma can be used to distinct between dirt and sand
  6. // e.g. 10-15, 25-35 whereas the first value is always dirt and the second sand
  7. // The following properties are optional:
  8. // flipMode: should the same be flipped or different images be used(see rock) or is flip not supported at all; allowed values: sameImage | diffImages; default is: sameImage
  9. // id: the identifier for the pattern if it's referenced by other patterns
  10. // minPoints: the minimum points to reach to validate the pattern successfully
  11. // The following table shows the rules for the 3x3 pattern of all terrain types:
  12. // I) normal(e.g. grass, lava, ...):
  13. // N: Native type
  14. // D: Dirt border
  15. // S: Sand border
  16. // T: Sand OR dirt border(all Ts in the pattern are replaced by dirt OR sand)
  17. // ?: T or N
  18. // II) dirt:
  19. // N: Native type
  20. // D: Dirt border
  21. // S: Sand border
  22. // ?: Any border
  23. // III) sand:
  24. // N: Native type
  25. // S: Sand border
  26. // IV) water:
  27. // N: Native type
  28. // S: Sand border
  29. // ?: Any border
  30. // V) rock:
  31. // N: Native type
  32. // S: Sand border
  33. // ?: Any border
  34. // Some additional info:
  35. // Rules can be combined with comma. e.g. T, N which would be the same meaning of ?. It's most useful in combination with pattern chaining.
  36. // Chaining of patterns is supported. To reference a another pattern you simply add the <Ref Id> to the relevant field of the pattern.
  37. // Rules can be given points: <[Rule OR Ref Id]-Points> With the property minPoints simple conditions can be built.
  38. {
  39. "normal" :
  40. [
  41. // Standard transitions
  42. {
  43. "data" :
  44. [
  45. "?", "?", "T",
  46. "?", "N", "N",
  47. "T", "N", "N"
  48. ],
  49. "mapping" : "0-3, 20-23"
  50. },
  51. {
  52. "data" :
  53. [
  54. "?", "N", "N",
  55. "T", "N", "N",
  56. "?", "N", "N"
  57. ],
  58. "mapping" : "4-7, 24-27"
  59. },
  60. {
  61. "data" :
  62. [
  63. "?", "T", "?",
  64. "N", "N", "N",
  65. "N", "N", "N"
  66. ],
  67. "mapping" : "8-11, 28-31"
  68. },
  69. {
  70. "data" :
  71. [
  72. "N", "N", "N",
  73. "N", "N", "N",
  74. "N", "N", "T"
  75. ],
  76. "mapping" : "12-15, 32-35"
  77. },
  78. {
  79. "data" :
  80. [
  81. "T", "T", "a-1,?",
  82. "T", "N", "N",
  83. "a-1,?", "N", "N"
  84. ],
  85. "mapping" : "16-17, 36-37",
  86. "id" : "a",
  87. "minPoints" : 1
  88. },
  89. {
  90. "data" :
  91. [
  92. "N", "N", "N",
  93. "N", "N", "a-1,N",
  94. "N", "a-1,N", "T"
  95. ],
  96. "mapping" : "18-19, 38-39",
  97. "minPoints" : 1
  98. },
  99. // Mixed transitions
  100. {
  101. "data" :
  102. [
  103. "T", "N", "N",
  104. "N", "N", "N",
  105. "N", "N", "T"
  106. ],
  107. "mapping" : "40, 42"
  108. },
  109. {
  110. "data" :
  111. [
  112. "D", "N", "N",
  113. "N", "N", "N",
  114. "N", "N", "S"
  115. ],
  116. "mapping" : "41"
  117. },
  118. {
  119. "data" :
  120. [
  121. "N", "N", "D,N",
  122. "N", "N", "D",
  123. "S", "D", "D,N"
  124. ],
  125. "mapping" : "43"
  126. },
  127. {
  128. "data" :
  129. [
  130. "N", "N", "S",
  131. "N", "N", "D",
  132. "D,N", "D", "D,N"
  133. ],
  134. "mapping" : "44"
  135. },
  136. {
  137. "data" :
  138. [
  139. "N", "N", "D,N",
  140. "N", "N", "D",
  141. "N", "N", "S"
  142. ],
  143. "mapping" : "45"
  144. },
  145. {
  146. "data" :
  147. [
  148. "N", "N", "N",
  149. "N", "N", "N",
  150. "D,N", "D", "S"
  151. ],
  152. "mapping" : "46"
  153. },
  154. {
  155. "data" :
  156. [
  157. "N", "N", "D,S,N",
  158. "N", "N", "S",
  159. "D", "D", "D,S,N"
  160. ],
  161. "mapping" : "47"
  162. },
  163. {
  164. "data" :
  165. [
  166. "N", "N", "D",
  167. "N", "N", "D",
  168. "D,S,N", "S", "D,S,N"
  169. ],
  170. "mapping" : "48"
  171. },
  172. // No transition
  173. {
  174. "data" :
  175. [
  176. "N", "N", "N",
  177. "N", "N", "N",
  178. "N", "N", "N"
  179. ],
  180. "mapping" : "49-72"
  181. }
  182. ],
  183. "dirt" :
  184. [
  185. // Standard transitions
  186. {
  187. "data" :
  188. [
  189. "?", "S", "S",
  190. "S", "N", "N",
  191. "S", "N", "N"
  192. ],
  193. "mapping" : "0-3"
  194. },
  195. {
  196. "data" :
  197. [
  198. "?", "D", "D",
  199. "S", "N", "N",
  200. "?", "D", "D"
  201. ],
  202. "mapping" : "4-7"
  203. },
  204. {
  205. "data" :
  206. [
  207. "?", "S", "?",
  208. "D", "N", "D",
  209. "D", "N", "D"
  210. ],
  211. "mapping" : "8-11"
  212. },
  213. {
  214. "data" :
  215. [
  216. "D", "D", "D",
  217. "D", "N", "N",
  218. "D", "N", "S"
  219. ],
  220. "mapping" : "12-15"
  221. },
  222. {
  223. "data" :
  224. [
  225. "S", "S", "D",
  226. "S", "N", "b-1,D",
  227. "D", "b-1,D", "D"
  228. ],
  229. "mapping" : "16-17",
  230. "id" : "a",
  231. "minPoints" : 1
  232. },
  233. {
  234. "data" :
  235. [
  236. "D", "D", "D",
  237. "D", "N", "a-1,D",
  238. "D", "a-1,D", "S"
  239. ],
  240. "mapping" : "18-19",
  241. "id" : "b",
  242. "minPoints" : 1
  243. },
  244. // Mixed transition
  245. {
  246. "data" :
  247. [
  248. "S", "D", "D",
  249. "D", "N", "D",
  250. "D", "D", "S"
  251. ],
  252. "mapping" : "20"
  253. },
  254. // No transition
  255. {
  256. "data" :
  257. [
  258. "D", "D", "D",
  259. "D", "N", "D",
  260. "D", "D", "D"
  261. ],
  262. "mapping" : "21-44"
  263. }
  264. ],
  265. "sand" :
  266. [
  267. {
  268. "data" :
  269. [
  270. "?", "?", "?",
  271. "?", "N", "?",
  272. "?", "?", "?"
  273. ],
  274. "mapping" : "0-23"
  275. }
  276. ],
  277. "water" :
  278. [
  279. // Standard transitions
  280. {
  281. "data" :
  282. [
  283. "S", "S", "S",
  284. "S", "N", "N",
  285. "S", "N", "N"
  286. ],
  287. "mapping" : "0-3"
  288. },
  289. {
  290. "data" :
  291. [
  292. "?", "N", "N",
  293. "S", "N", "N",
  294. "?", "N", "N"
  295. ],
  296. "mapping" : "4-7"
  297. },
  298. {
  299. "data" :
  300. [
  301. "?", "S", "?",
  302. "N", "N", "N",
  303. "N", "N", "N"
  304. ],
  305. "mapping" : "8-11"
  306. },
  307. {
  308. "data" :
  309. [
  310. "N", "N", "N",
  311. "N", "N", "N",
  312. "N", "N", "S"
  313. ],
  314. "mapping" : "12-15"
  315. },
  316. {
  317. "data" :
  318. [
  319. "S", "S", "N",
  320. "S", "N", "N",
  321. "N", "N", "N"
  322. ],
  323. "mapping" : "16-17",
  324. "id" : "a"
  325. },
  326. {
  327. "data" :
  328. [
  329. "N", "N", "N",
  330. "N", "N", "a-1,N",
  331. "N", "a-1,N", "S"
  332. ],
  333. "mapping" : "18-19",
  334. "minPoints" : 1
  335. },
  336. // No transition
  337. {
  338. "data" :
  339. [
  340. "N", "N", "N",
  341. "N", "N", "N",
  342. "N", "N", "N"
  343. ],
  344. "mapping" : "20-32"
  345. }
  346. ],
  347. "rock" :
  348. [
  349. // No transition
  350. {
  351. "data" :
  352. [
  353. "N", "N", "N",
  354. "N", "N", "N",
  355. "N", "N", "N"
  356. ],
  357. "mapping" : "0-7"
  358. },
  359. // Standard transitions
  360. {
  361. "data" :
  362. [
  363. "?", "S", "?",
  364. "S", "N", "N",
  365. "?", "N", "N"
  366. ],
  367. "mapping" : "8-15",
  368. "flipMode" : "diffImages"
  369. },
  370. {
  371. "data" :
  372. [
  373. "?", "N", "N",
  374. "S", "N", "N",
  375. "?", "N", "N"
  376. ],
  377. "mapping" : "16-19",
  378. "flipMode" : "diffImages"
  379. },
  380. {
  381. "data" :
  382. [
  383. "?", "S", "?",
  384. "N", "N", "N",
  385. "N", "N", "N"
  386. ],
  387. "mapping" : "20-23",
  388. "flipMode" : "diffImages"
  389. },
  390. {
  391. "data" :
  392. [
  393. "N", "N", "N",
  394. "N", "N", "N",
  395. "N", "N", "S"
  396. ],
  397. "mapping" : "24-31",
  398. "flipMode" : "diffImages"
  399. },
  400. {
  401. "data" :
  402. [
  403. "S", "S", "N",
  404. "S", "N", "N",
  405. "N", "N", "N"
  406. ],
  407. "mapping" : "32-39",
  408. "flipMode" : "diffImages",
  409. "id" : "a"
  410. },
  411. {
  412. "data" :
  413. [
  414. "N", "N", "N",
  415. "N", "N", "a-1,N",
  416. "N", "a-1,N", "S"
  417. ],
  418. "mapping" : "40-47",
  419. "flipMode" : "diffImages",
  420. "minPoints" : 1
  421. }
  422. ]
  423. }