"CHARACTERISTICS" Attribute in XML files? (Full Version)

All Forums >> [New Releases from Matrix Games] >> The Operational Art of War IV >> Mods and Scenarios



Message


76mm -> "CHARACTERISTICS" Attribute in XML files? (4/20/2019 3:06:32 PM)

Guys, I'm almost finished with adding the ability to add equipment in TOAWxml but am a bit stumped about one thing: the XML entries for units include an attribute called "CHARACTERISTICS", and I can't quite figure out what it is for, or how it works.

Here are some of the entries from units from a couple of scenarios (WWII & NATO eras):
GERMAN
2001
4001
4008
4009
8001
8008
8009
10008
10009
20008
20009
40009

SOVIET
2000
4008
8000
8008
20008
40000
40008


WP
A0000000
A0008008
A0010000
A0010008
A0020008
A0040008

NATO
A0000000
A0002000
A0002008
A0004000
A0004008
A0008000

At first I thought that these entries might have been bitflags to reflect the characteristics of the equipment comprising the unit, but after further examination, I'm not sure that that is the case: units with almost identical equipment lists and identical "Special Abilities" in the Unit Report can have very different "CHARACTERISTICS".

To deepen the mystery, some units don't seem to have "CHARACTERISTICS" at all, and if I delete the CHARACTERISTIC values in Notepad++ and then reload the file into the in-game editor, the game does not crash, but inserts a value of "1".

I doubt anyone other than Bob or Ralph will be able to shed much light on this, but I wanted to check with the other posters here before resorting to asking one of them.

Meanwhile, I'll post a screenshot of progress on TOAWxml in that thread...




Lobster -> RE: "CHARACTERISTICS" Attribute in XML files? (4/20/2019 3:58:33 PM)

The mysteries of the Normish mystics. [;)]

Looks like hex doesn't it? What with the A in the first position in the WP and NATO lists.




76mm -> RE: "CHARACTERISTICS" Attribute in XML files? (4/20/2019 4:00:04 PM)

quote:

ORIGINAL: Lobster
Looks like hex doesn't it? What with the A in the first position in the WP and NATO lists.

That is one of the mysteries, but I suspect that the A000 is some kind of prefix to deal with old scenarios. Or sumfink...




cathar1244 -> RE: "CHARACTERISTICS" Attribute in XML files? (4/21/2019 3:16:15 PM)

Since it is at unit level, it probably has something to do with unit "special abilities" -- maybe related in part to the unit icon and associated equipment. Definitely, testing required to try to unravel it -- although -- that may only clear up certain aspects.

If you delete the chars and the game resets them to "1", are the unit special abilities any different?

More mystery meat. [X(]

Cheers




76mm -> RE: "CHARACTERISTICS" Attribute in XML files? (4/21/2019 4:59:45 PM)

quote:

ORIGINAL: cathar1244
...it probably has something to do with unit "special abilities" -- maybe related in part to the unit icon and associated equipment.

That was my initial assumption as well, but units with identical "special abilities" have different "CHARACTERISTICS".

quote:

ORIGINAL: cathar1244
If you delete the chars and the game resets them to "1", are the unit special abilities any different?

Good question, I'll take a look at that. I will also try to delete the attribute altogether, see what happens.

quote:

ORIGINAL: cathar1244
Definitely, testing required to try to unravel it -- although -- that may only clear up certain aspects.

Indeed. If these are indeed bitflags, my limited understanding of the matter is that one of the reasons they are used (at least for certain applications) is that it is difficult to reverse-engineer them if you lack the "key".




cathar1244 -> RE: "CHARACTERISTICS" Attribute in XML files? (4/21/2019 5:56:41 PM)

quote:

If these are indeed bitflags, my limited understanding of the matter is that one of the reasons they are used (at least for certain applications) is that it is difficult to reverse-engineer them if you lack the "key".


That kind of approach was also useful in the old days when memory usage had to be watched; it is a compact way of noting a list of properties for a given object. Not sure if this was an issue when the original version of TOAW came out in 1998 or so.

Don Lancaster used to write about disassembling undocumented 6502 code ... what, 30 YEARS AGO now? Yow! Anyway, one of his techniques was called "fill it with water and see where it leaks", which was converting unknown bunches of data into zeros and seeing what it did to a program's data and/or graphics. So, yeah, zeroizing some of these characteristic fields might indicate useful directions to investigate.

Cheers




76mm -> RE: "CHARACTERISTICS" Attribute in XML files? (4/21/2019 6:24:07 PM)

quote:

ORIGINAL: cathar1244
That kind of approach was also useful in the old days when memory usage had to be watched; it is a compact way of noting a list of properties for a given object. Not sure if this was an issue when the original version of TOAW came out in 1998 or so.

Yeah, when I first started looking at the TOAW "Flags" I figured that they were a 1990s programming relic, but when I started researching the topic, it appears that bitflags remain a popular programming method in 2019.




76mm -> RE: "CHARACTERISTICS" Attribute in XML files? (4/22/2019 1:35:39 AM)

So I've been poking around with this a bit more...changing the Characteristics to 0 (or 1) does not change a unit's special abilities, nor does eliminating the attribute altogether (it auto-regenerates with a value of 1).

But when I saved the revised scenario, opened it as a game, played a turn, saved it, renamed it from a sav file to a sce file, re-opened it in the scenario editor, and exported it back to xml (whew!), it seems that some, but not all of the edited/deleted auto-regenerated to their original values. Weird...

I need to look at this further, but I'm guessing that the game (and only the game, not the editor) auto-generates these values on as as-needed basis, perhaps when a unit is within range of an enemy unit or something similar. I think that the values are based on the ability flags but something else as well, not sure what...

Will poke around for another day or two, and report my findings back here.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
1.21875