Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

"CHARACTERISTICS" Attribute in XML files?

 
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 >> "CHARACTERISTICS" Attribute in XML files? Page: [1]
Login
Message << Older Topic   Newer Topic >>
"CHARACTERISTICS" Attribute in XML files? - 4/20/2019 3:06:32 PM   
76mm


Posts: 4688
Joined: 5/2/2004
From: Washington, DC
Status: offline
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...
Post #: 1
RE: "CHARACTERISTICS" Attribute in XML files? - 4/20/2019 3:58:33 PM   
Lobster


Posts: 5104
Joined: 8/8/2013
From: Third rock from the Sun.
Status: offline
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.

_____________________________

http://www.operationbarbarossa.net/

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein

Q: What do you call a boomerang that doesn’t come back?
A: A stick.

(in reply to 76mm)
Post #: 2
RE: "CHARACTERISTICS" Attribute in XML files? - 4/20/2019 4:00:04 PM   
76mm


Posts: 4688
Joined: 5/2/2004
From: Washington, DC
Status: offline
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...

< Message edited by 76mm -- 4/20/2019 4:13:39 PM >

(in reply to Lobster)
Post #: 3
RE: "CHARACTERISTICS" Attribute in XML files? - 4/21/2019 3:16:15 PM   
cathar1244

 

Posts: 1003
Joined: 9/5/2009
Status: offline
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.

Cheers

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


Posts: 4688
Joined: 5/2/2004
From: Washington, DC
Status: offline
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".


< Message edited by 76mm -- 4/21/2019 5:00:33 PM >

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

 

Posts: 1003
Joined: 9/5/2009
Status: offline
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

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


Posts: 4688
Joined: 5/2/2004
From: Washington, DC
Status: offline
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.

(in reply to cathar1244)
Post #: 7
RE: "CHARACTERISTICS" Attribute in XML files? - 4/22/2019 1:35:39 AM   
76mm


Posts: 4688
Joined: 5/2/2004
From: Washington, DC
Status: offline
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.

(in reply to 76mm)
Post #: 8
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> The Operational Art of War IV >> Mods and Scenarios >> "CHARACTERISTICS" Attribute in XML files? 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

1.984