Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Map files in XML format

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> The Operational Art of War IV >> Mods and Scenarios >> Map files in XML format Page: [1]
Login
Message << Older Topic   Newer Topic >>
Map files in XML format - 1/4/2019 10:37:46 AM   
cathar1244

 

Posts: 552
Joined: 9/5/2009
Status: offline
Interesting format for the map files. Are there any guides as to the meaning of the fields and their values?

Cheers
Post #: 1
RE: Map files in XML format - 1/6/2019 3:46:19 PM   
cathar1244

 

Posts: 552
Joined: 9/5/2009
Status: offline
I've figured out much of the XML Map file format. There are some fields that are still mysterious.

I can put my results here; however, before I do so, I would like to know how Bob Cross and/or Ralph feel about that. It is interesting in a technical sense, but I don't want to break any rules or irritate the people who have put so much time and effort into the game's development.

Bob or Ralph, your comments on this would be appreciated. Thanks!

Cheers

(in reply to cathar1244)
Post #: 2
RE: Map files in XML format - 1/6/2019 3:57:09 PM   
76mm


Posts: 3752
Joined: 5/2/2004
From: Washington, DC
Status: online
I'd also be interested in knowing more about the xml map data.

While I can't speak for Bob and Ralph, obviously, neither seem to have a problem with my XML editor, or indeed various other similar tools in the past.

(in reply to cathar1244)
Post #: 3
RE: Map files in XML format - 1/6/2019 4:28:21 PM   
Curtis Lemay


Posts: 11456
Joined: 9/17/2004
From: Houston, TX
Status: offline

quote:

ORIGINAL: cathar1244

I've figured out much of the XML Map file format. There are some fields that are still mysterious.

I can put my results here; however, before I do so, I would like to know how Bob Cross and/or Ralph feel about that. It is interesting in a technical sense, but I don't want to break any rules or irritate the people who have put so much time and effort into the game's development.

Bob or Ralph, your comments on this would be appreciated. Thanks!

Cheers

Not a problem.

_____________________________

My TOAW web site:

Bob Cross's TOAW Site

(in reply to cathar1244)
Post #: 4
RE: Map files in XML format - 1/6/2019 6:16:32 PM   
cathar1244

 

Posts: 552
Joined: 9/5/2009
Status: offline
Thanks Bob!

I'll work on a useful report of what I understand, and the items I don't yet grasp.

Cheers

(in reply to Curtis Lemay)
Post #: 5
RE: Map files in XML format - 1/7/2019 11:20:58 AM   
cathar1244

 

Posts: 552
Joined: 9/5/2009
Status: offline
TOAW IV version 4.0.0.11 map files in XML format - description

1. Blended terrain (terrain that "spills" over the hex border). The appearance of the terrain tile is controlled with an integer. The value of the integer is determined by which sides of the hexagon blend into the next hexagon. Consider the top side of the hexagon as "north", and the values are N = 1, NE = 2, SE = 4, S = 8, SW = 16, and NW = 32. These values are added as necessary. So, if one wanted the terrain in question to blend over the NW and SW sides of the hex, the integer value would be 48.

2. File format. The file header looks like the following. Note that "maxx" and "maxy" cannot be less than 19 (smallest TOAW map is 20 x 20 hexes).

<?xml version="1.0"?>
<GAME>
<MAP version="100" offsetx="0" offsety="0" minx="0" miny="0" maxx="19" maxy="19">

The final record of the file has this appearance:

</MAP>
</GAME>

Depending on the editor one is using, these tokens may all appear on a single line. In between the file header and the final record are the records for the terrain data. Each hexagon has a record that starts with the hex coordinates (<CELL loc) followed "b=". The hexagon terrain record is terminated with ">". Within the record, fields are separated with the "/" character. There are 48 fields (this document numbers them 1 to 48) that describe the terrain. I have not been able to determine what fields 41, 43, and 45 do, although I suspect these fields may be used when a scenario is being played.

3. Record format for each hexagon. Following is a hexagon record as an example. Note that the hex location is 0,0. 48 fields follow, each set to a value of zero.

<CELL loc="0,0" b="/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0"/>

Following is the key to the fields. Fields 01 through 35 correspond to the 35 terrain tiles in the map editor, starting with clear terrain (01), arid (02), sand (03), and ending with broken rail line (35). The integer value in each field controls the appearance of the terrain type as described above in paragraph 1. For example, if one wants a hill terrain tile that blends only over the north hex edge, the integer value in field 06 would be 1. Note the value 63 means the terrain should blend into all adjoining hex tiles. The use of fields 36 through 48 is:

Field 36 Shallow water edging
Field 37 Deep water edging
Field 38 Entrenchment level
Field 39 1=anchorage, 2=airfield, 4=peak, 8=contaminated, 16=non playable, 32=muddy, 64=snowy, 128=destroyed bridges (additive for multiple effects)
Field 40 0,1=ownership by first and second force, 8=very cold (additive)
Field 41 UNKNOWN use
Field 42 8=exclusion zone 1, 16=exclusion zone 2
Field 43 UNKNOWN use
Field 44 Red Border hexsides (1=N, 2=NE, etc.)
Field 45 UNKNOWN use
Field 46 Distance from adjacent hexes
Field 47 UNKNOWN use, but some integer values cause display of the vertical bar used to indicate a unit's movement path
Field 48 UNKNOWN use, but some integer values cause the hex to be tagged with "round 1"

Note that shallow and deep water hexes are often coded with value 63, indicating the entire hex is filled. Values other than 63 change the shape of the water tile. Edging (fields 36 and 37) are applied to surrounding hexes and the hexside values are subtracted from 63 to place the edging on the desired hexsides; thus value "59" places edging on the SE hexside.

4. Odd bits.

Field 01 corresponds to clear terrain, but the clear terrain tile always fills the hex; it does not seem alterable in terms of shape unless one places something like edging for a body of water along a hexside. This characteristic may simply be so because clear terrain is the default terrain in the map editor.

Disallowed terrain types (like airfields on shallow water) can be created by manually editing the XML file. I have not tried to use such terrain in a TOAW scenario. The game might allow it, might ignore it, or might crash. My advice would be to experiment with small scenarios and see what happens.

TOAW-nonfunctional terrain can be created. For example, water edging can be used to create what looks like "hexside rivers" on a map -- but TOAW will see only the other terrain and ignore the edging. This aspect, though, is interesting. With edits to the XML file, a map that looks like it has hexside rivers can be made and exported as a *.bmp file. This graphic file could then be used with other platforms (like, get ready ... Microsoft Excel ) to serve as the base image on which to push around graphic objects representing army corps, orcs, and so on. At that point, it is a different game system using a TOAW-generated map. One suspects the only limit here is imagination, especially when one considers the potential of using this with alternate terrain tile sets produced by enthusiasts.

If anyone knows or figures out the "UNKNOWN" fields noted above, please advise.

Cheers

< Message edited by cathar1244 -- 1/7/2019 12:39:27 PM >

(in reply to cathar1244)
Post #: 6
RE: Map files in XML format - 1/7/2019 11:24:40 AM   
cathar1244

 

Posts: 552
Joined: 9/5/2009
Status: offline

quote:

ORIGINAL: 76mm

I'd also be interested in knowing more about the xml map data.

While I can't speak for Bob and Ralph, obviously, neither seem to have a problem with my XML editor, or indeed various other similar tools in the past.


Hey 76mm,

Not sure if the map XML format is the same in the latest TOAW IV version, but one neat utility would be something that could strip the mud and snow tiles off the map by automatically altering the values in the 39th field of the hex location records.

Cheers

(in reply to 76mm)
Post #: 7
RE: Map files in XML format - 1/7/2019 3:00:51 PM   
76mm


Posts: 3752
Joined: 5/2/2004
From: Washington, DC
Status: online
quote:

ORIGINAL: cathar1244
Not sure if the map XML format is the same in the latest TOAW IV version, but one neat utility would be something that could strip the mud and snow tiles off the map by automatically altering the values in the 39th field of the hex location records.

Not a bad idea; should be possible although it will be awhile before I get to this.

Thanks a lot for this info, I hope to spend more time looking at it in coming days.

(in reply to cathar1244)
Post #: 8
RE: Map files in XML format - 1/7/2019 3:07:55 PM   
76mm


Posts: 3752
Joined: 5/2/2004
From: Washington, DC
Status: online
quote:

ORIGINAL: cathar1244
Field 40 0,1=ownership by first and second force, 8=very cold (additive)

Just wanted to check, I don't get this one, seems to cover very different issues, and I don't get the format...so is 08 ownership of very cold hex by first force?

Also, just for clarity, not sure if it matters, but did you work directly with map xml files or with the map portions of the scenario files? At first glance the xml looks the same, but haven't examined in detail.

< Message edited by 76mm -- 1/7/2019 3:08:18 PM >

(in reply to cathar1244)
Post #: 9
RE: Map files in XML format - 1/7/2019 3:43:19 PM   
Curtis Lemay


Posts: 11456
Joined: 9/17/2004
From: Houston, TX
Status: offline
Byte 1: May have originally been Clear Terrain, but somewhere along the line they figured out they didn't need anything for Clear Terrain. This byte was then re-purposed to "Interdiction Chances".

Byte 40: 1 = Side 2 Owned; 2 = Overcast; 4 = Hazy; 8 = Frozen; 16 = Cool; 32 = Warm; 64 = Hot; 128 = Precipitating.

Byte 41: 1 = Spotted by 1; 2 = Spotted by 2; 4 = Observed by 1; 8 = Observed by 2; 16 = Side 1 Supplied (Standard Rules);
32 = Side 2 Supplied (Standard Rules); 64 = Refugees for 1; 128 = Refugees for 2.

Byte 42: 1 = Changed Ownership; 2 = Attacked by 1; 4 = Attacked by 2; 8 = Zone 1; 16 = Zone 2; 32 = Recently Occupied;
64 = Changed Ownership Turn; 128 = ?; (I'm not clear about the use of those last three).

Byte 43: 1 = Side 1 Source; 2 = Side 2 Source; 4 = Side 1 High; 8 = Side 2 High; 16 = Side 1 Normal; 32 = Side 2 Normal;
64 = Side 1 Minimum; 128 = Side 2 Minimum. (Obviously, this is Old Supply. When I decoded this stuff, New Supply didn't exist yet, nor did Variable Supply Points. So, I don't have how that was done.)

Byte 45: Objective Value.

Byte 47: I think this was a spare at the time. There was no byte 48 when I was decoding it.

_____________________________

My TOAW web site:

Bob Cross's TOAW Site

(in reply to 76mm)
Post #: 10
RE: Map files in XML format - 1/7/2019 4:14:55 PM   
cathar1244

 

Posts: 552
Joined: 9/5/2009
Status: offline

quote:

ORIGINAL: 76mm

quote:

ORIGINAL: cathar1244
Field 40 0,1=ownership by first and second force, 8=very cold (additive)

Just wanted to check, I don't get this one, seems to cover very different issues, and I don't get the format...so is 08 ownership of very cold hex by first force?

Also, just for clarity, not sure if it matters, but did you work directly with map xml files or with the map portions of the scenario files? At first glance the xml looks the same, but haven't examined in detail.


Hello 76mm,

Taking into account Bob's notes in his comment ... yes, "08" alone indicates ownership of the very cold hex by the first force. The integers pointed out by Bob for Field 40 are additive like those of Field 39.

Cheers

(in reply to 76mm)
Post #: 11
RE: Map files in XML format - 1/7/2019 4:15:02 PM   
76mm


Posts: 3752
Joined: 5/2/2004
From: Washington, DC
Status: online
Thanks for the info Bob, but a couple of questions:
1) I still don't understand Byte 40; how does it work it a hex is owned by Side 2 and Overcast, etc.?
2) Where is "Side 1 Owned" indicated?

(in reply to Curtis Lemay)
Post #: 12
RE: Map files in XML format - 1/7/2019 4:23:29 PM   
cathar1244

 

Posts: 552
Joined: 9/5/2009
Status: offline
Bob,

Thanks so much for the clarifications. As to the final two fields (47th and 48th), I don't think I've seen any values but zero so far. They may remain unused, although the 4.0.0.11 version of TOAW reacts to having integers greater than zero present in those fields. The "Round 1" tag in the hex description is a bit puzzling; not sure if it relates to combat rounds or something else.

Cheers

(in reply to Curtis Lemay)
Post #: 13
RE: Map files in XML format - 1/7/2019 5:51:40 PM   
Lobster


Posts: 3147
Joined: 8/8/2013
From: Third rock from the Sun.
Status: online
quote:

ORIGINAL: 76mm

Thanks for the info Bob, but a couple of questions:
1) I still don't understand Byte 40; how does it work it a hex is owned by Side 2 and Overcast, etc.?
2) Where is "Side 1 Owned" indicated?


Just guessing but since there are only two sides one side would be default so only the other side would have to be specified. In this case I'd say the 0 is side one.

< Message edited by Lobster -- 1/7/2019 5:53:46 PM >


_____________________________

http://www.operationbarbarossa.net/

"Getting back to reality...I'll only go as a tourist!"

(in reply to 76mm)
Post #: 14
RE: Map files in XML format - 1/7/2019 6:00:15 PM   
Curtis Lemay


Posts: 11456
Joined: 9/17/2004
From: Houston, TX
Status: offline

quote:

ORIGINAL: Lobster

quote:

ORIGINAL: 76mm

Thanks for the info Bob, but a couple of questions:
1) I still don't understand Byte 40; how does it work it a hex is owned by Side 2 and Overcast, etc.?
2) Where is "Side 1 Owned" indicated?


Just guessing but since there are only two sides one side would be default so only the other side would have to be specified. In this case I'd say the 0 is side one.

Correct. If the bit is ON, the hex is owned by Side Two. If it is OFF, the hex is owned by Side One.

_____________________________

My TOAW web site:

Bob Cross's TOAW Site

(in reply to Lobster)
Post #: 15
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> The Operational Art of War IV >> Mods and Scenarios >> Map files in XML format Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.117