K
Double post Sry I know, but i found this sooo...
A quick observations about query_info:
<rec type="bottom_left">
<v2 x="-1280.0" y="-640.0"/>
<v2 x="-640.0" y="-320.0"/>
<cell x='-1280.0' y='-640.0' id='131072'>
<cell_quad id1='327681' coord1='35547' id2='131072' coord2='38450'/>
<cell_quad id1='327681' coord1='38450' id2='131072' coord2='569'/>
<cell_quad id1='327681' coord1='569' id2='131072' coord2='11240'/>
<cell_quad id1='327681' coord1='11240' id2='131072' coord2='2597'/>
<cell_quad id1='327681' coord1='2597' id2='131072' coord2='8505'/>
<cell_quad id1='327681' coord1='8505' id2='131072' coord2='1750'/>
<cell_quad id1='327681' coord1='1750' id2='131072' coord2='53282'/>
</cell>
</rec>
131072 = 0x00020000.
327681 = 0x00050001.
There's no way in hell these are IDs. They are some kind of quad tree bitmaps more likely.
Every id/id1/id2 in query_info has very few bits set when expressed as hex.
coord1/2 are all between 0 and 60570 in query_info1 and 104 to 49941 in query_info2.
At firs they look like plausibly 16-bit coordinates, but it's suspicious that they're never between 60571 and 64k, and for the second query info there's no way in hell they're never between 50k and 64k.
So id/id1/id2 are NOT ids, they're some kind of masks (possibly id1+id2 together form 64-bit mask 8x8 like in quad_trees, esf have 64-bit data type but for some reason prefer to use two 32-bit values), and coord1/coord2 are probably IDs, and almost certainly not coordinates.
That's all.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
I changed id/id1/id2 to mask/mask1/mask2 in hex.
Grouping in data is actually (coord1, coord2, mask1, mask2) not this mixed grouping.
There's probably no association of coord1 with mask1, and coord2 with mask2.
More likely than not it's two numbers (coord1, coord2) that are indexes of something, plus one 64-bit 8x8 mask.
coord1/coord2 are probably not coords, but I have no idea what else they could possibly be, so I'll leave them like that for now.
<rec type="bottom_left">
<v2 x="-1280.0" y="-640.0"/>
<v2 x="-640.0" y="-320.0"/>
<cell x='-1280.0' y='-640.0' mask='00020000'>
<cell_quad mask1='00050001' coord1='35547' mask2='00020000' coord2='38450'/>
<cell_quad mask1='00050001' coord1='38450' mask2='00020000' coord2='569'/>
<cell_quad mask1='00050001' coord1='569' mask2='00020000' coord2='11240'/>
<cell_quad mask1='00050001' coord1='11240' mask2='00020000' coord2='2597'/>
<cell_quad mask1='00050001' coord1='2597' mask2='00020000' coord2='8505'/>
<cell_quad mask1='00050001' coord1='8505' mask2='00020000' coord2='1750'/>
<cell_quad mask1='00050001' coord1='1750' mask2='00020000' coord2='53282'/>
</cell>
</rec>
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Obvious answer is obvious, they're indexes to vertices table.
<rec type="bottom_left">
<v2 x="-1280.0" y="-640.0"/>
<v2 x="-640.0" y="-320.0"/>
<cell x='-1280.0' y='-640.0' mask='00020000'>
<cell_quad v1='35547 (-1050.91638,-640.0)' v2='38450 (-1058.36401,-619.99988)' mask1='00050001' mask2='00020000'/>
<cell_quad v1='38450 (-1058.36401,-619.99988)' v2='569 (-1080.00037,-564.87494)' mask1='00050001' mask2='00020000'/>
<cell_quad v1='569 (-1080.00037,-564.87494)' v2='11240 (-1100.00049,-519.99969)' mask1='00050001' mask2='00020000'/>
<cell_quad v1='11240 (-1100.00049,-519.99969)' v2='2597 (-1122.86633,-479.99957)' mask1='00050001' mask2='00020000'/>
<cell_quad v1='2597 (-1122.86633,-479.99957)' v2='8505 (-1168.59839,-399.99979)' mask1='00050001' mask2='00020000'/>
<cell_quad v1='8505 (-1168.59839,-399.99979)' v2='1750 (-1197.0719,-359.99969)' mask1='00050001' mask2='00020000'/>
<cell_quad v1='1750 (-1197.0719,-359.99969)' v2='53282 (-1259.99988,-293.73993)' mask1='00050001' mask2='00020000'/>
</cell>
</rec>
Finelli or someone - could you take a look at it if it makes any sense?
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Here's an example of a fairly deep cell:
<rec type="top_right">
<v2 x="-680.0" y="140.0"/>
<v2 x="-640.0" y="160.0"/>
<cell x='-680.0' y='140.0' mask='00a60000'>
<cell_quad v1='49348 (-640.00043,150.70923)' v2='46583 (-637.70776,151.5701)' mask1='00a40000' mask2='00a60000'/>
<cell_quad v1='52858 (-641.76343,150.00026)' v2='49348 (-640.00043,150.70923)' mask1='00a40000' mask2='00a60000'/>
<cell_quad v1='56236 (-643.02142,148.77602)' v2='52858 (-641.76343,150.00026)' mask1='00a40000' mask2='00a60000'/>
<cell_quad v1='12032 (-644.00818,144.99997)' v2='56236 (-643.02142,148.77602)' mask1='00a40000' mask2='00a60000'/>
<cell_quad v1='22967 (-644.14758,142.48305)' v2='12032 (-644.00818,144.99997)' mask1='00a40000' mask2='00a60000'/>
<cell_quad v1='38140 (-645.00061,140.00006)' v2='22967 (-644.14758,142.48305)' mask1='00a40000' mask2='00a60000'/>
<cell_quad v1='52174 (-645.78314,137.07166)' v2='38140 (-645.00061,140.00006)' mask1='00a40000' mask2='00a60000'/>
</cell>
</rec>
v1/v2 are both NOT exactly within the cell bounding box, vertices sometimes go slightly outside cell.
At least one end seems to be always within the bounding box.
This suggests they are not point features, they're something else.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Many cells with mask2=ffffffff with mask1 with few bits set strongly disproves my theory that it's one 64-bit mask. It's two 32-bit values that still look like some kind of masks to me.
No good idea what they are. They seem to mostly be 00XX00YY, with 1st and 3rd most significant bytes zeroed, and usually least-significant byte is also zero, or <=15 at least (usually, there are exceptions).
Most of the action seems to be in 2nd most significant byte.
It's either 00XX00YY or all FFFFFFFF as far as I can tell. I see no other strict regularities,
in particular none of mask/mask1/mask2 is always superset or subset or another.
<rec type="top_left">
<v2 x="-560.0" y="295.0"/>
<v2 x="-550.0" y="300.0"/>
<cell x='-560.0' y='295.0' mask='00000000'>
<cell_quad v1='25337 (-548.93658,296.84702)' v2='27658 (-550.00049,297.04044)' mask1='00040002' mask2='ffffffff'/>
<cell_quad v1='27658 (-550.00049,297.04044)' v2='24968 (-550.52008,297.13492)' mask1='00040002' mask2='ffffffff'/>
<cell_quad v1='24968 (-550.52008,297.13492)' v2='24524 (-551.00952,297.62436)' mask1='00040002' mask2='ffffffff'/>
<cell_quad v1='45529 (-554.32037,297.39407)' v2='44030 (-555.00061,297.50745)' mask1='00010002' mask2='ffffffff'/>
<cell_quad v1='44538 (-553.84467,297.22028)' v2='45529 (-554.32037,297.39407)' mask1='00010002' mask2='ffffffff'/>
<cell_quad v1='47742 (-552.82324,296.84705)' v2='44538 (-553.84467,297.22028)' mask1='00010002' mask2='ffffffff'/>
<cell_quad v1='45472 (-552.16107,295.98328)' v2='47742 (-552.82324,296.84705)' mask1='00010002' mask2='ffffffff'/>
<cell_quad v1='43316 (-551.57861,295.29852)' v2='45472 (-552.16107,295.98328)' mask1='00010002' mask2='ffffffff'/>
<cell_quad v1='33365 (-550.86548,293.88153)' v2='43316 (-551.57861,295.29852)' mask1='00010002' mask2='ffffffff'/>
<cell_quad v1='24524 (-551.00952,297.62436)' v2='23430 (-551.1535,298.40173)' mask1='00040002' mask2='ffffffff'/>
<cell_quad v1='23430 (-551.1535,298.40173)' v2='22527 (-550.77917,299.17908)' mask1='00040002' mask2='ffffffff'/>
<cell_quad v1='22527 (-550.77917,299.17908)' v2='20646 (-550.40491,299.99988)' mask1='00040002' mask2='ffffffff'/>
<cell_quad v1='20646 (-550.40491,299.99988)' v2='17329 (-550.40112,301.04468)' mask1='00040002' mask2='ffffffff'/>
<cell_quad v1='38377 (-555.00061,294.99979)' v2='44030 (-555.00061,297.50745)' mask1='00040001' mask2='ffffffff'/>
<cell_quad v1='44030 (-555.00061,297.50745)' v2='49516 (-555.00061,299.99988)' mask1='00010002' mask2='ffffffff'/>
<cell_quad v1='49516 (-555.00061,299.99988)' v2='13631 (-555.00061,302.87854)' mask1='00010002' mask2='ffffffff'/>
</cell>
</rec>
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
S2TW uses exactly the same regions.esf format as ETW (so pressumably NTW does as well).
It might be worthwhile to use S2TW files for testing since it's simpler than ETW's.
It seems that vertex pairs that go outside of quad's bounding box are repeated twice. Those that don't are not.
For example 25060 occurs in:
Quad for:
<v2 x="-700.0" y="280.0"/>Quad for:
<v2 x="-680.0" y="290.0"/>
<cell_quad v1='25060 (-679.65881,288.46317)' v2='27427 (-680.00043,288.63312)' mask1='00b40000' mask2='00240008'/> (crossing box, see below)
<v2 x="-680.0" y="285.0"/>
<v2 x="-670.0" y="290.0"/>
<cell_quad v1='24858 (-679.45221,288.25653)' v2='25060 (-679.65881,288.46317)' mask1='00b40000' mask2='00240008'/> (not crossing box, no inverse anywhere)
<cell_quad v1='25060 (-679.65881,288.46317)' v2='27427 (-680.00043,288.63312)' mask1='00b40000' mask2='00240008'/> (crossing box, see above)
Sometimes copies are exact, something they're reversed (5186-5162, S2TW):
<cell_quad v1='5186 (-30.0012073516846,-141.60289)' v2='5162 (-29.92026,-141.44437)' mask1='00010003' mask2='0001000c'/>
<cell_quad v1='5185 (-31.1498851776123,-143.55949)' v2='5186 (-30.0012073516846,-141.60289)' mask1='00010003' mask2='0001000c'/>
<cell_quad v1='5162 (-29.92026,-141.44437)' v2='5186 (-30.0012073516846,-141.60289)' mask1='0001000c' mask2='00010003'/>
Reversed ones have masks switched backwards. This sort of implies "masks" might be some kind of vertex flags.
If we figured out what masks are, we could make a script which converts a list of vertex pairs into fully formed query info quad tree. This would make massive progress towards working map compiler.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Obviously it makes sense. When I have explained this part I have tried to tell you that are indexes from vertices. This was my idea from the beginning.
No, no don't be hurry. I was wrong about ids, but these are vertices. You can be sure. First of all I don't know what you mean with mask. I don't know what is a mask and so I have thought the most easy thing basing on my knowledge. Now I'll try to explain why vertices sometimes go slightly outside cell. Quad tree data structures are for geographical points inside a map. But in regions.esf files quad tree is used to locate geometric figures bounded by vertices. This is a bit different from the normal usage of quad tree system. In fact now what is important are not points for itself, but segments that join two points. You can see that. Points are always in couple. Query info are based, as obvious, on recursive system of quads of 7 levels. It happens that a segment can be split between two quads. But this segment is anyway defined by two vertices. Accordingly the same couple of vertices will be repeated in two neighboring quads. Bounds of the quad allow to discard the portion of segment that is not within. Finally if you draw segment by segment all cells in query info, you will obtain global map as if you have drawn all outlines. This is true also for groundtype query info (query_info-0002.xml).
"Mask" as in set of bits where 1s and 0s mean on or off, and that's the only thing the number means.
That was my first guess (8x8 bit array showing which parts of quad tree had something in it - that's how quad_trees/*.xml in startpos.esf work).
Now I'm not sure, but it's definitely not IDs either.
My current best guess is that "mask1" is associated with v1 somehow, and "mask2" with v2 (like you said), based mostly on S2TW
where cell_quads duplicated across boxes can have both v1 switched with v2, and mask1 switched with mask2.
Copying line segment that intersects with multiple bounding boxes is exactly how quad trees are normally used.
I'm not sure why it's sometimes inverted, it probably doesn't matter.
More tests. Assuming each "mask" is actually two numbers (so 4 numbers per line segment).
ETW query_info_1.xml: 0x0000 to 0x00cc (204)
ETW query_info_2.xml: 0x0000 to 0x0004 (4) and 0xffff
S2TW query_info_1.xml: 0x0000 to 0x001b (27)
S2TW query_info_2.xml: 0x0000 to 0x002a (42)
S2TW query_info_3.xml: 0x0000 to 0x0001 (1) and 0xffff
So these look like IDs or indexes of some kind after all - except we have two IDs per vertex.
They are not vertex IDs or cell IDs - there are far too many cells and vertices.
There are too many slots and areas, and not enough regions as far as I can tell.
There are some u2s in area/*.xml (unknown1 id, island id, unknown2 id) but there's no obvious match either.
This is probably a solvable problem. Any more ideas?
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
I changed the format to something better corresponding to what we know:
<cell x='-400.0' y='-280.0' mask='00070000'>
<line_segment v1='40550 (-381.50714,-244.07616)' a1='7' b1='0' v2='52074 (-380.00046,-239.99986)' a2='147' b2='1'/>
<line_segment v1='40550 (-381.50714,-244.07616)' a1='147' b1='1' v2='5664 (-385.83099,-247.06197)' a2='7' b2='0'/>
<line_segment v1='5664 (-385.83099,-247.06197)' a1='147' b1='1' v2='5219 (-389.89581,-248.60497)' a2='7' b2='0'/>
<line_segment v1='5219 (-389.89581,-248.60497)' a1='147' b1='1' v2='12695 (-393.35596,-247.75829)' a2='7' b2='0'/>
<line_segment v1='12695 (-393.35596,-247.75829)' a1='147' b1='1' v2='6167 (-397.46161,-247.62468)' a2='7' b2='0'/>
<line_segment v1='6167 (-397.46161,-247.62468)' a1='147' b1='1' v2='7702 (-400.00049,-248.33412)' a2='7' b2='0'/>
</cell>
No hexes, simply splitting "mask1/mask2" (which turned out not to be masks) into 2 16-bit integers each.
a1/b1 probably correspond to v1, and a2/b2 probably correspond to v2.
If someone can tell me the meaning of a1/b1/a2/b2 that would be lovely.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
From one cell:
<cell x='-20.0' y='305.0' mask='00320000'>
<line_segment v1='30604 (-8.69700622558594,308.13715)' a1='70' b1='0' v2='43212 (-10.0004806518555,308.33551)' a2='50' b2='0'/>
<!-- 70=france -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='43212 (-10.0004806518555,308.33551)' a1='70' b1='0' v2='6247 (-10.5878305435181,308.40759)' a2='50' b2='0'/>
<!-- 70=france -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='6247 (-10.5878305435181,308.40759)' a1='70' b1='0' v2='26067 (-11.3741149902344,308.83362)' a2='50' b2='0'/>
<!-- 70=france -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='2750 (-10.5530204772949,305.73615)' a1='50' b1='0' v2='52907 (-10.8203811645508,306.02579)' a2='50' b2='5'/>
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 5=pacific_ocean -->
<line_segment v1='45251 (-10.7758331298828,305.00012)' a1='50' b1='0' v2='2750 (-10.5530204772949,305.73615)' a2='50' b2='5'/>
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 5=pacific_ocean -->
<line_segment v1='42078 (-10.9986238479614,304.04285)' a1='50' b1='0' v2='45251 (-10.7758331298828,305.00012)' a2='50' b2='5'/>
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 5=pacific_ocean -->
<line_segment v1='26067 (-11.3741149902344,308.83362)' a1='70' b1='0' v2='24128 (-11.2936477661133,309.23111)' a2='69' b2='0'/>
<!-- 70=france -->
<!-- 0=atlantic_ocean_se -->
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='2002 (-10.6508712768555,309.44318)' a1='70' b1='0' v2='10205 (-10.5707931518555,310.00006)' a2='69' b2='0'/>
<!-- 70=france -->
<!-- 0=atlantic_ocean_se -->
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='2002 (-10.6508712768555,309.44318)' a1='69' b1='0' v2='24128 (-11.2936477661133,309.23111)' a2='70' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 70=france -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='26067 (-11.3741149902344,308.83362)' a1='69' b1='0' v2='38232 (-12.1239166259766,308.56848)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='38232 (-12.1239166259766,308.56848)' a1='69' b1='0' v2='43560 (-12.9538040161133,308.54187)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='28515 (-13.3284149169922,308.17081)' a1='50' b1='0' v2='43560 (-12.9538040161133,308.54187)' a2='69' b2='0'/>
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='28515 (-13.3284149169922,308.17081)' a1='69' b1='0' v2='18402 (-14.4526290893555,308.09113)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='18402 (-14.4526290893555,308.09113)' a1='69' b1='0' v2='45011 (-15.0000905990601,307.85971)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='45011 (-15.0000905990601,307.85971)' a1='69' b1='0' v2='36653 (-16.0328979492188,307.95895)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='36653 (-16.0328979492188,307.95895)' a1='69' b1='0' v2='48978 (-16.9694213867188,307.87906)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='48978 (-16.9694213867188,307.87906)' a1='69' b1='0' v2='48400 (-17.8760414123535,308.41251)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='48400 (-17.8760414123535,308.41251)' a1='69' b1='0' v2='57967 (-18.8397178649902,308.46555)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='57967 (-18.8397178649902,308.46555)' a1='69' b1='0' v2='15412 (-19.5419425964355,308.51089)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='15412 (-19.5419425964355,308.51089)' a1='69' b1='0' v2='16911 (-20.0582447052002,308.53656)' a2='50' b2='0'/>
<!-- 69=bay_of_biscay -->
<!-- 0=atlantic_ocean_se -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='25784 (-12.2463150024414,304.5553)' a1='50' b1='5' v2='20053 (-11.8229789733887,305.00006)' a2='50' b2='0'/>
<!-- 50=spain -->
<!-- 5=pacific_ocean -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='20053 (-11.8229789733887,305.00006)' a1='50' b1='5' v2='32246 (-11.2882623672485,305.647)' a2='50' b2='0'/>
<!-- 50=spain -->
<!-- 5=pacific_ocean -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
<line_segment v1='32246 (-11.2882623672485,305.647)' a1='50' b1='5' v2='52907 (-10.8203811645508,306.02579)' a2='50' b2='0'/>
<!-- 50=spain -->
<!-- 5=pacific_ocean -->
<!-- 50=spain -->
<!-- 0=atlantic_ocean_se -->
</cell>
</rec>
From another:
<line_segment v1='58057 (-2.09213209152222,316.53064)' a1='70' b1='0' v2='30262 (-2.16471338272095,316.5903)' a2='36' b2='43'/>
<!-- 70=france -->
<!-- 0=atlantic_ocean_se -->
<!-- 36=all -->
<!-- 43=baluchistan -->
So a1 and a2 could plausibly be region numbers (and I'll comment them as such).
b1/b2 really don't look like that. And they're mostly 0 everywhere.
There are also two u16s in cell - first I'll assume is region code as well, second - who known.
Here's how it looks now:
<cell x='-20.0' y='305.0' a0='50 (spain)' b0='0'>
<line_segment v1='30604 (-8.69700622558594,308.13715)' a1='70 (france)' b1='0' v2='43212 (-10.0004806518555,308.33551)' a2='50 (spain)' b2='0'/>
<line_segment v1='43212 (-10.0004806518555,308.33551)' a1='70 (france)' b1='0' v2='6247 (-10.5878305435181,308.40759)' a2='50 (spain)' b2='0'/>
<line_segment v1='6247 (-10.5878305435181,308.40759)' a1='70 (france)' b1='0' v2='26067 (-11.3741149902344,308.83362)' a2='50 (spain)' b2='0'/>
<line_segment v1='2750 (-10.5530204772949,305.73615)' a1='50 (spain)' b1='0' v2='52907 (-10.8203811645508,306.02579)' a2='50 (spain)' b2='5'/>
<line_segment v1='45251 (-10.7758331298828,305.00012)' a1='50 (spain)' b1='0' v2='2750 (-10.5530204772949,305.73615)' a2='50 (spain)' b2='5'/>
<line_segment v1='42078 (-10.9986238479614,304.04285)' a1='50 (spain)' b1='0' v2='45251 (-10.7758331298828,305.00012)' a2='50 (spain)' b2='5'/>
<line_segment v1='26067 (-11.3741149902344,308.83362)' a1='70 (france)' b1='0' v2='24128 (-11.2936477661133,309.23111)' a2='69 (bay_of_biscay)' b2='0'/>
<line_segment v1='2002 (-10.6508712768555,309.44318)' a1='70 (france)' b1='0' v2='10205 (-10.5707931518555,310.00006)' a2='69 (bay_of_biscay)' b2='0'/>
<line_segment v1='2002 (-10.6508712768555,309.44318)' a1='69 (bay_of_biscay)' b1='0' v2='24128 (-11.2936477661133,309.23111)' a2='70 (france)' b2='0'/>
<line_segment v1='26067 (-11.3741149902344,308.83362)' a1='69 (bay_of_biscay)' b1='0' v2='38232 (-12.1239166259766,308.56848)' a2='50 (spain)' b2='0'/>
<line_segment v1='38232 (-12.1239166259766,308.56848)' a1='69 (bay_of_biscay)' b1='0' v2='43560 (-12.9538040161133,308.54187)' a2='50 (spain)' b2='0'/>
<line_segment v1='28515 (-13.3284149169922,308.17081)' a1='50 (spain)' b1='0' v2='43560 (-12.9538040161133,308.54187)' a2='69 (bay_of_biscay)' b2='0'/>
<line_segment v1='28515 (-13.3284149169922,308.17081)' a1='69 (bay_of_biscay)' b1='0' v2='18402 (-14.4526290893555,308.09113)' a2='50 (spain)' b2='0'/>
<line_segment v1='18402 (-14.4526290893555,308.09113)' a1='69 (bay_of_biscay)' b1='0' v2='45011 (-15.0000905990601,307.85971)' a2='50 (spain)' b2='0'/>
<line_segment v1='45011 (-15.0000905990601,307.85971)' a1='69 (bay_of_biscay)' b1='0' v2='36653 (-16.0328979492188,307.95895)' a2='50 (spain)' b2='0'/>
<line_segment v1='36653 (-16.0328979492188,307.95895)' a1='69 (bay_of_biscay)' b1='0' v2='48978 (-16.9694213867188,307.87906)' a2='50 (spain)' b2='0'/>
<line_segment v1='48978 (-16.9694213867188,307.87906)' a1='69 (bay_of_biscay)' b1='0' v2='48400 (-17.8760414123535,308.41251)' a2='50 (spain)' b2='0'/>
<line_segment v1='48400 (-17.8760414123535,308.41251)' a1='69 (bay_of_biscay)' b1='0' v2='57967 (-18.8397178649902,308.46555)' a2='50 (spain)' b2='0'/>
<line_segment v1='57967 (-18.8397178649902,308.46555)' a1='69 (bay_of_biscay)' b1='0' v2='15412 (-19.5419425964355,308.51089)' a2='50 (spain)' b2='0'/>
<line_segment v1='15412 (-19.5419425964355,308.51089)' a1='69 (bay_of_biscay)' b1='0' v2='16911 (-20.0582447052002,308.53656)' a2='50 (spain)' b2='0'/>
<line_segment v1='25784 (-12.2463150024414,304.5553)' a1='50 (spain)' b1='5' v2='20053 (-11.8229789733887,305.00006)' a2='50 (spain)' b2='0'/>
<line_segment v1='20053 (-11.8229789733887,305.00006)' a1='50 (spain)' b1='5' v2='32246 (-11.2882623672485,305.647)' a2='50 (spain)' b2='0'/>
<line_segment v1='32246 (-11.2882623672485,305.647)' a1='50 (spain)' b1='5' v2='52907 (-10.8203811645508,306.02579)' a2='50 (spain)' b2='0'/>
</cell>
ETW query_info-1 b = 0 to 153
ETW query_info-2 b = 0 to 3 and 65535
S2TW query_info-1 b = 0 to 20
S2TW query_info-2 b = 0 to 42 and 65535
S2TW query_info-3 b = 0 and 65535 only
Does it look like anything?
EDIT: It totally is the number of area within region. Region "all" has 154 areas, and everything else checks.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
<cell x='90.0' y='370.0' region='97 (saxony)' area='0'>
<line_segment v1='39967 (90.46936,369.99997)' region1='107 (west_pommerania)' area1='0' v2='44378 (89.9996643066406,370.55167)' region2='97 (saxony)' area2='0'/>
</cell>
There are trivial details like figuring out which of multiple regions/areas cell claims as its own, but the entire thing is fully decoded for all practical purposes now.
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
This makes things much harder to understand.How can be inserted in a database 2 points in such a way that they are always belonging to two different regions?
Last edited by PietroMicca; March 19, 2012 at 08:02 AM.
Congratulations on figuring this out Taw. I'm not sure why but 65535 is often present in the first area entry in the regions.esf\theatres_and_region_keys\region_data\regions\areas. I believe it tells ETW which land mass this region belongs to, while the other area entries tell ETW about specific things in this area. The most common land masses are Eurasia (13) and the Americas (20). The other land masses are usually island, such as the UK (11) or Trinidad and Tobago (108); or areas that cannot easily be accessed, such as French and Dutch Guyana (14).
The primary purpose of this is to stop the AI trying to march their armies across the sea, such as going from Italy to Corsica. If Italy (13) and Corsia (82) are classified as different land masses then the AI knows it can't march between them and needs to sail from one land mass to another one.
Region 'all' refers to the rivers in ETW.
Last edited by uanime5; March 18, 2012 at 08:45 AM.
Morning Sun (adds Korea and China to the Shogun 2 map)
http://www.twcenter.net/forums/forum...28-Morning-Sun
Expanded Japan mod (97 new regions and 101 new factions)
http://www.twcenter.net/forums/showt...ew-factions%29
How to split a region in TWS2
http://www.twcenter.net/forums/showt...split-a-region
Eras Total Conquest 2.3 (12 campaigns from 970-1547)
65535 is for passable areas
if I remember correctly 256 is for impassable (but only in ETW)
They're from different areas, not necessarily different regions. (grepping shows no cases of same region1=region2 and area1=area2 anywhere).
<line_segment v1='3084 (-1.03942561149597,301.97079)' region1='50 (spain)' area1='5' v2='37345 (-2.33167123794556,302.08218)' region2='50 (spain)' area2='0'/>
Are these line segments borders or connecting lines or what? Have we ever bothered drawing them?
Medieval 2 mod builder with first ever Random Scenario Generator.
All my code is available in etwng repository.
Morning Sun (adds Korea and China to the Shogun 2 map)
http://www.twcenter.net/forums/forum...28-Morning-Sun
Expanded Japan mod (97 new regions and 101 new factions)
http://www.twcenter.net/forums/showt...ew-factions%29
How to split a region in TWS2
http://www.twcenter.net/forums/showt...split-a-region
Eras Total Conquest 2.3 (12 campaigns from 970-1547)
Yes, they are what I have said. I have drawn query info for egypt campaign in Napoleon. I only mean that create this kind of file will be much harder for us. There's some complicated technique we don't know and hardly we will know it.
Anyway, there's another similar mask in regions.esf and it's about <ary type="connectivity"> in areas.