*) to certain degree, of course. There is no reason to e.g represent richness as string value (e.g "very good") when a numeric value (e.g 5) works just fine.
For example it might look roughly like this. Here are lots of missing fields + comments wouldn't exist in the actual string. I'm not even sure if this would be a valid Lua object
Code: Select all
"map-exchange-string" = {
-- version of the exchange string format
version = "0.01"
-- generated resource layer data
ores =
{
{"copper", 1, 2, 3},
{"stone", 2, 3, 4},
{"iron", 2, 2, 2},
},
segmentation = 2,
water = 3,
peaceful = true,
seed = "1234",
-- 0 == infinite
size = { 0, 0 },
}
___
Now the longer, mostly useless, stuff .
I ran one exchange string through python decoder and this was the result:
Code: Select all
>>> import base64
>>> coded = '''AAAKAAAAGAADAw8AAAAEAAAAY29hbAEDAgoAAABjb3BwZXItb3JlAQMCCQAAAGNydWRlLW9pbAEDAgoAAABlbmVteS1iYXNlAwMCCQAAAGdlbXN0b25lcwMDAggAAABnb2xkLW9yZQMDAggAAABpcm9uLW9yZQEDAggAAABsZWFkLW9yZQMDAgUAAABtYWdtYQMDAgQAAABzYW5kAwMCCgAAAHNpbHZlci1vcmUDAwIFAAAAc3RvbmUBAwIHAAAAdGluLW9yZQMDAgwAAAB0dW5nc3Rlbi1vcmUDAwIIAAAAemluYy1vcmUDAwIkdHwlI1wAAG3CAAAAAAAAAAAAAAMAi4OyoA=='''
>>> base64.b64decode(coded)
'\x00\x00\n\x00\x00\x00\x18\x00\x03\x03\x0f\x00\x00\x00\x04\x00\x00\x00coal\x01\x03\x02\n\x00\x00\x00copper-ore\x01\x03\x02\t\x00\x00\x00crude-oil\x01\x03\x02\n\x00\x00\x00enemy-base\x03\x03\x02\t\x00\x00\x00gemstones\x03\x03\x02\x08\x00\x00\x00gold-ore\x03\x03\x02\x08\x00\x00\x00iron-ore\x01\x03\x02\x08\x00\x00\x00lead-ore\x03\x03\x02\x05\x00\x00\x00magma\x03\x03\x02\x04\x00\x00\x00sand\x03\x03\x02\n\x00\x00\x00silver-ore\x03\x03\x02\x05\x00\x00\x00stone\x01\x03\x02\x07\x00\x00\x00tin-ore\x03\x03\x02\x0c\x00\x00\x00tungsten-ore\x03\x03\x02\x08\x00\x00\x00zinc-ore\x03\x03\x02$t|%#\\\x00\x00m\xc2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x8b\x83\xb2\xa0'
>>>
The format doesn't seem to be too complex. I managed to decode that for each ore layer frequency, size and richness is encoded in a single byte. There are extra 4 bytes of information per-ore (possibly one of them being newline).
For example (not from the long example I gave):
copper-ore \x03\x02\x01\t\x00\x00\x00
That means copper ore will be with frequency 3 (normal), size 2 (small) and richness of 1 (poor)
I have no idea what the rest of the data means and probably won't try to figure it out.
___
Analyzing the string I found that surprisingly frequency/size/richness were mapped 1:1 to GUI values. I would have expected that internally they are some specific values on a much greater scale. E.g richness could vary between 0-100% with the GUI options being 20% steps within that scale. It would be somewhat nice if such fine-tuning of those parameters was possible through the exchange string (or even built into the GUI itself with sliders).