| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428 |
- // Defines terrain view patterns.
- // The following properties are mandatory:
- // data: the 3x3 pattern
- // mapping: maps the pattern to a range of terrain view images/frames of the .DEF, e.g. 10-15
- // for patterns which represent two transitions a comma can be used to distinct between dirt and sand
- // e.g. 10-15, 25-35 whereas the first value is always dirt and the second sand
- // The following properties are optional:
- // 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
- // id: the identifier for the pattern if it's referenced by other patterns
- // minPoints: the minimum points to reach to validate the pattern successfully
- // The following table shows the rules for the 3x3 pattern of all terrain types:
- // I) normal(e.g. grass, lava, ...):
- // N: Native type
- // D: Dirt border
- // S: Sand border
- // T: Sand OR dirt border(all Ts in the pattern are replaced by dirt OR sand)
- // ?: T or N
- // II) dirt:
- // N: Native type
- // D: Dirt border
- // S: Sand border
- // ?: Any border
- // III) sand:
- // N: Native type
- // S: Sand border
- // IV) water:
- // N: Native type
- // S: Sand border
- // ?: Any border
- // V) rock:
- // N: Native type
- // S: Sand border
- // ?: Any border
- // Some additional info:
- // 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.
- // Chaining of patterns is supported. To reference a another pattern you simply add the <Ref Id> to the relevant field of the pattern.
- // Rules can be given points: <[Rule OR Ref Id]-Points> With the property minPoints simple conditions can be built.
- {
- "normal" :
- [
- // Standard transitions
- {
- "data" :
- [
- "?", "?", "T",
- "?", "N", "N",
- "T", "N", "N"
- ],
- "mapping" : "0-3, 20-23"
- },
- {
- "data" :
- [
- "?", "N", "N",
- "T", "N", "N",
- "?", "N", "N"
- ],
- "mapping" : "4-7, 24-27"
- },
- {
- "data" :
- [
- "?", "T", "?",
- "N", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "8-11, 28-31"
- },
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "N",
- "N", "N", "T"
- ],
- "mapping" : "12-15, 32-35"
- },
- {
- "data" :
- [
- "T", "T", "a-1,?",
- "T", "N", "N",
- "a-1,?", "N", "N"
- ],
- "mapping" : "16-17, 36-37",
- "id" : "a",
- "minPoints" : 1
- },
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "a-1,N",
- "N", "a-1,N", "T"
- ],
- "mapping" : "18-19, 38-39",
- "minPoints" : 1
- },
- // Mixed transitions
- {
- "data" :
- [
- "T", "N", "N",
- "N", "N", "N",
- "N", "N", "T"
- ],
- "mapping" : "40, 42"
- },
- {
- "data" :
- [
- "D", "N", "N",
- "N", "N", "N",
- "N", "N", "S"
- ],
- "mapping" : "41"
- },
- {
- "data" :
- [
- "N", "N", "D,N",
- "N", "N", "D",
- "S", "D", "D,N"
- ],
- "mapping" : "43"
- },
- {
- "data" :
- [
- "N", "N", "S",
- "N", "N", "D",
- "D,N", "D", "D,N"
- ],
- "mapping" : "44"
- },
- {
- "data" :
- [
- "N", "N", "D,N",
- "N", "N", "D",
- "N", "N", "S"
- ],
- "mapping" : "45"
- },
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "N",
- "D,N", "D", "S"
- ],
- "mapping" : "46"
- },
- {
- "data" :
- [
- "N", "N", "D,S,N",
- "N", "N", "S",
- "D", "D", "D,S,N"
- ],
- "mapping" : "47"
- },
- {
- "data" :
- [
- "N", "N", "D",
- "N", "N", "D",
- "D,S,N", "S", "D,S,N"
- ],
- "mapping" : "48"
- },
- // No transition
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "49-72"
- }
- ],
- "dirt" :
- [
- // Standard transitions
- {
- "data" :
- [
- "?", "S", "S",
- "S", "N", "N",
- "S", "N", "N"
- ],
- "mapping" : "0-3"
- },
- {
- "data" :
- [
- "?", "D", "D",
- "S", "N", "N",
- "?", "D", "D"
- ],
- "mapping" : "4-7"
- },
- {
- "data" :
- [
- "?", "S", "?",
- "D", "N", "D",
- "D", "N", "D"
- ],
- "mapping" : "8-11"
- },
- {
- "data" :
- [
- "D", "D", "D",
- "D", "N", "N",
- "D", "N", "S"
- ],
- "mapping" : "12-15"
- },
- {
- "data" :
- [
- "S", "S", "D",
- "S", "N", "b-1,D",
- "D", "b-1,D", "D"
- ],
- "mapping" : "16-17",
- "id" : "a",
- "minPoints" : 1
- },
- {
- "data" :
- [
- "D", "D", "D",
- "D", "N", "a-1,D",
- "D", "a-1,D", "S"
- ],
- "mapping" : "18-19",
- "id" : "b",
- "minPoints" : 1
- },
- // Mixed transition
- {
- "data" :
- [
- "S", "D", "D",
- "D", "N", "D",
- "D", "D", "S"
- ],
- "mapping" : "20"
- },
- // No transition
- {
- "data" :
- [
- "D", "D", "D",
- "D", "N", "D",
- "D", "D", "D"
- ],
- "mapping" : "21-44"
- }
- ],
- "sand" :
- [
- {
- "data" :
- [
- "?", "?", "?",
- "?", "N", "?",
- "?", "?", "?"
- ],
- "mapping" : "0-23"
- }
- ],
- "water" :
- [
- // Standard transitions
- {
- "data" :
- [
- "S", "S", "S",
- "S", "N", "N",
- "S", "N", "N"
- ],
- "mapping" : "0-3"
- },
- {
- "data" :
- [
- "?", "N", "N",
- "S", "N", "N",
- "?", "N", "N"
- ],
- "mapping" : "4-7"
- },
- {
- "data" :
- [
- "?", "S", "?",
- "N", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "8-11"
- },
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "N",
- "N", "N", "S"
- ],
- "mapping" : "12-15"
- },
- {
- "data" :
- [
- "S", "S", "N",
- "S", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "16-17",
- "id" : "a"
- },
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "a-1,N",
- "N", "a-1,N", "S"
- ],
- "mapping" : "18-19",
- "minPoints" : 1
- },
- // No transition
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "20-32"
- }
- ],
- "rock" :
- [
- // No transition
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "0-7"
- },
- // Standard transitions
- {
- "data" :
- [
- "?", "S", "?",
- "S", "N", "N",
- "?", "N", "N"
- ],
- "mapping" : "8-15",
- "flipMode" : "diffImages"
- },
- {
- "data" :
- [
- "?", "N", "N",
- "S", "N", "N",
- "?", "N", "N"
- ],
- "mapping" : "16-19",
- "flipMode" : "diffImages"
- },
- {
- "data" :
- [
- "?", "S", "?",
- "N", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "20-23",
- "flipMode" : "diffImages"
- },
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "N",
- "N", "N", "S"
- ],
- "mapping" : "24-31",
- "flipMode" : "diffImages"
- },
- {
- "data" :
- [
- "S", "S", "N",
- "S", "N", "N",
- "N", "N", "N"
- ],
- "mapping" : "32-39",
- "flipMode" : "diffImages",
- "id" : "a"
- },
- {
- "data" :
- [
- "N", "N", "N",
- "N", "N", "a-1,N",
- "N", "a-1,N", "S"
- ],
- "mapping" : "40-47",
- "flipMode" : "diffImages",
- "minPoints" : 1
- }
- ]
- }
|