Witpload & CSV Files

Please post here for questions and discussion about scenario design, art and sound modding and the game editor for WITP Admiral's Edition.

Moderators: wdolson, MOD_War-in-the-Pacific-Admirals-Edition

User avatar
witpqs
Posts: 26376
Joined: Mon Oct 04, 2004 7:48 pm
Location: Argleton

Witpload & CSV Files

Post by witpqs »

I've been messing around with the data dumped by the witpload.exe utility that comes with AE in the SCEN folder. I followed advice on the forums to create CSV files for scenario 1. I've done much nosing around in the data, and used it to create that map of the Allies command structure. I'm trying to see if I can get enough of a handle on the data to do the same thing for all units, not just HQs (and for both sides).

The thing is, it looks like witpload is not dumping all the data - or maybe just some data is hard coded instead of being in the scenario files?

For example, one file that witpload creates is called "WITPtabs.csv", and it contains tables to help decode the meaning of certain fields in the other files. In the location file there is a field "Type" that tells you whether a unit is an HQ, etc. Some entries in the WITPtabs file tell you that Type=4 means HQ, Type=3 means AA unit, and so on.

There is also an "HQtype" field in the locations file. However, there is no corresponding tables in the WITPtabs.csv file. It's taking guesswork to figure those out.

As you know some HQs are restricted commands. Well, it appears that there is no field in the locations file that indicates whether an HQ is restricted or not.

Those are just two examples, there are others. So that poses a couple of questions. Is witpload.exe available in an updated form that will dump all the data? Are there some tables available that give the meaning of the possible various in the various fields?
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Witpload & CSV Files

Post by michaelm75au »

WITPLOADAE dumps all data that is usable.
If there are any specific fields not dumped, and you want to know what it is, just drop a note here.

HQtype is a combined field, consisting of the HQ type and its command radius.

------------
The last digit of the HQ type => command radius
Take the HQ type and divide by 10 => actual type as defined below
0 = Corp HQ ( range of editor value: 01-09)
2 = Naval HQ (21-29)
3 = Amphibious HQ (31-39)
5 = Air HQ (51-59)
7 = Army HQ (71-79)
10 = Command HQ (101-109)

Details can be found in Editor Manual under Location tab.
Michael
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Witpload & CSV Files

Post by michaelm75au »

There is an 'attribute' field in the CSV.
The value here corresponds to the sum of the tick boxes from the editor and is what is know as a bit-map field.
Non-technically, you can determine what the attributes are by following this:
1. if the value is >= 32, then the unit is usable by the AI scripts. Subtract 32 from the value.
2. if the value is >= 16, then subtract 16 from the value.
3. if the value is >= 8, then the unit is used as a Convoy-type unit. Subtract 8 from the value.
4. if the value is >= 4, then the unit is permanently restricted. Subtract 4 from the value.
5. if the value is >= 2, then the unit is temporarily restricted. Subtract 2 from the value.
6. if the value is 1, then the unit is statically attached to HQ.

Example, attribute value is 37 (as for unit #2 Home Defense HQ)
1. Bigger than 32, so unit is used by AI in scripts. Take 32 from the value = 5
2. Bigger than 4, so unit is permanently restricted. Take 4 from the value = 1
3. Equals 1, so unit is statically attached to HQ

If you look in the editor, you can see ticks in the boxes for 'Static attached' and 'Restricted Permanent' for the Home Defense HQ.
Meaning of these can be found in Editor manual also.
-----------------------------
Static Attached: units may not move by air or sea unless the HQ is changed. Even when HQ’s are changed subordinate units need to be individually acquired via PP’s..
Restricted Temp: units may not move by air or sea unless the HQ is changed. When the HQ’s are changed subordinate units change to the classification of the parent.
Restricted Permanent: HQ’s (and on some occasions units) are restricted and may never have their HQ changed – they remain and always shall be permanently restricted.
Convoy Unit: unit that when arrives will place it’s devices in the pool for that side and then withdraw from game.
Michael
User avatar
witpqs
Posts: 26376
Joined: Mon Oct 04, 2004 7:48 pm
Location: Argleton

RE: Witpload & CSV Files

Post by witpqs »

Thanks, Michael - you just saved me a lot of time! [:)] [&o]

I had figured out the HQ Type but not the command radius, and was part way through decoding the 'attrib' field (identified the bit for restricted HQ) by analyzing it in a spreadsheet and comparing in-game status:



Image
Attachments
DecodeAttrib.jpg
DecodeAttrib.jpg (297.39 KiB) Viewed 990 times
User avatar
Don Bowen
Posts: 5192
Joined: Thu Jul 13, 2000 8:00 am
Location: Georgetown, Texas, USA

RE: Witpload & CSV Files

Post by Don Bowen »


HQ Type and command radius are in the HQ Type. First 1-2 digits are type, last is radius.



Image
Attachments
23B23843AD..EBACCE24.jpg
23B23843AD..EBACCE24.jpg (91.73 KiB) Viewed 985 times
User avatar
PaxMondo
Posts: 11125
Joined: Fri Jun 06, 2008 3:23 pm

RE: Witpload & CSV Files

Post by PaxMondo »

For aircraft weapons, specifically cannons like the hispano, how are effect and penetration calculated?  Are there normalization factors involved?
 
Thanks.
Pax
User avatar
topeverest
Posts: 3381
Joined: Wed Oct 17, 2007 1:47 am
Location: Houston, TX - USA

RE: Witpload & CSV Files

Post by topeverest »

I'm trying to export a mod I am working designated Scenario 27. Specifically, I am looking to get the ships into access or excel, but I am just a bit rusty in the ole DOS. I also am not sure if I have all the command paramaters right.

I opened the command prompt and changed the directory to the scenario folder and executed by typing the file name "WITPloadAE". I received the response:

"Witp export / import utility -version 8.0. Loading Scenario #1,
WITPdev001.csv:no such file or directory"

What am doing wrong?

Any help is appreciated.
Andy M
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Witpload & CSV Files

Post by michaelm75au »

If you are trying to create the CSVs you need to supply the option /e
as in
witploadae /s1 /e

Without that it thinks you are building a new scenario file set from CSVs.
Michael
Moss Orleni
Posts: 201
Joined: Mon Nov 03, 2008 8:36 am

RE: Witpload & CSV Files

Post by Moss Orleni »

ORIGINAL: michaelm

There is an 'attribute' field in the CSV.
The value here corresponds to the sum of the tick boxes from the editor and is what is know as a bit-map field.
Non-technically, you can determine what the attributes are by following this:
1. if the value is >= 32, then the unit is usable by the AI scripts. Subtract 32 from the value.
2. if the value is >= 16, then subtract 16 from the value.
3. if the value is >= 8, then the unit is used as a Convoy-type unit. Subtract 8 from the value.
4. if the value is >= 4, then the unit is permanently restricted. Subtract 4 from the value.
5. if the value is >= 2, then the unit is temporarily restricted. Subtract 2 from the value.
6. if the value is 1, then the unit is statically attached to HQ.

Example, attribute value is 37 (as for unit #2 Home Defense HQ)
1. Bigger than 32, so unit is used by AI in scripts. Take 32 from the value = 5
2. Bigger than 4, so unit is permanently restricted. Take 4 from the value = 1
3. Equals 1, so unit is statically attached to HQ

If you look in the editor, you can see ticks in the boxes for 'Static attached' and 'Restricted Permanent' for the Home Defense HQ.
Meaning of these can be found in Editor manual also.
-----------------------------
Static Attached: units may not move by air or sea unless the HQ is changed. Even when HQ’s are changed subordinate units need to be individually acquired via PP’s..
Restricted Temp: units may not move by air or sea unless the HQ is changed. When the HQ’s are changed subordinate units change to the classification of the parent.
Restricted Permanent: HQ’s (and on some occasions units) are restricted and may never have their HQ changed – they remain and always shall be permanently restricted.
Convoy Unit: unit that when arrives will place it’s devices in the pool for that side and then withdraw from game.

Finally found this missing piece of information, great!

One question though: based on their definitions, it would appear that Static Attached, Restricted Temp and Restricted Permanent are mutually exclusive.
However, many LCUs seem to have more than one box checked. Does this mean that there is a ranking between the three, ie one status takes precedence over another if both are checked? Or does each add different characteristics to a unit that are not included in the other two?

Thanks & cheers,

Moss
Moss Orleni
Posts: 201
Joined: Mon Nov 03, 2008 8:36 am

RE: Witpload & CSV Files

Post by Moss Orleni »

Bump, hoping to get answer to my previous post and also because I'm still struggling with the definition of a static unit, ie a unit that is not able to move.

In Scenario1, unit 4626 (Peleliu Naval, a CD unit) is listed as static in the LCU information screen. Yet, all non-disabled and disabled devices seem to have a load cost different from 9999 and seem to have their attribute bitfield correspond to a non-static item.

What makes this unit static then? More generally, what other database values can be used to define a unit as static?

Thanks & regards,

Moss
User avatar
PaxMondo
Posts: 11125
Joined: Fri Jun 06, 2008 3:23 pm

RE: Witpload & CSV Files

Post by PaxMondo »

ORIGINAL: Moss Orleni
ORIGINAL: michaelm
4. if the value is >= 4, then the unit is permanently restricted. Subtract 4 from the value.
5. if the value is >= 2, then the unit is temporarily restricted. Subtract 2 from the value.
6. if the value is 1, then the unit is statically attached to HQ.
One question though: based on their definitions, it would appear that Static Attached, Restricted Temp and Restricted Permanent are mutually exclusive.
However, many LCUs seem to have more than one box checked. Does this mean that there is a ranking between the three, ie one status takes precedence over another if both are checked? Or does each add different characteristics to a unit that are not included in the other two?
Moss
Static + Temp restrict = 3
Static + Perm restrict = 5

It is a simple bit mask if you are old time programmer. Commonly used as it is very fast executable. Helps if you can do math in binary, octal, and hex. [;)]
Pax
Moss Orleni
Posts: 201
Joined: Mon Nov 03, 2008 8:36 am

RE: Witpload & CSV Files

Post by Moss Orleni »

Not sure I understand your post.

The Peleliu CD unit has an attribute value of 32, which in bitfield language and as per MichaelM corresponds to: AI Scriptable = true, alle other attributes = false. So the unit is not static (neither restricted for that matter)...
So the question remains: how come it is shown as static in the game, even when you know that none of its devices are static either?

Cheers,

Moss
User avatar
witpqs
Posts: 26376
Joined: Mon Oct 04, 2004 7:48 pm
Location: Argleton

RE: Witpload & CSV Files

Post by witpqs »

It's not just the devices anymore (it was in WITP). Now you can define a unit as static in the editor. I think that's what he's saying.
User avatar
JWE
Posts: 5039
Joined: Tue Jul 19, 2005 5:02 pm

RE: Witpload & CSV Files

Post by JWE »

[:@]ORIGINAL: Moss Orleni
One question though: based on their definitions, it would appear that Static Attached, Restricted Temp and Restricted Permanent are mutually exclusive.
They are not.
, many LCUs seem to have more than one box checked. Does this mean that there is a ranking between the three, ie one status takes precedence over another if both are checked? Or does each add different characteristics to a unit that are not included in the other two?
There is no ranking. Review the editor further to see what each switch does. Can't answer general questions because can't discuss algorithm. If you have specific questions, may be able to help, but must be specific.
Moss Orleni
Posts: 201
Joined: Mon Nov 03, 2008 8:36 am

RE: Witpload & CSV Files

Post by Moss Orleni »

ORIGINAL: witpqs

It's not just the devices anymore (it was in WITP). Now you can define a unit as static in the editor. I think that's what he's saying.

As I don't see any other way in the editor to designate a Location/LCU as static, I suppose you refer to the checkboxes Perm Restr, Temp Restr and Static Att? I'm not sure, but to me this doesn't seem to be related to a unit being static or not (static in the sense of being physically unable to move, even when changing HQ).

Taking the example of the Peleliu CD unit (Location ID 4626), none of the three boxes are checked, yet the unit is static. Furthermore, when applying the attributes bitmask to its devices, it doesn't seem to contain any static devices (disabled nor non-disabled); also, the unit is attached to an unrestricted HQ.
So, what makes this unit static?

Cheers,

Moss
User avatar
witpqs
Posts: 26376
Joined: Mon Oct 04, 2004 7:48 pm
Location: Argleton

RE: Witpload & CSV Files

Post by witpqs »

Dunno.
ckammp
Posts: 756
Joined: Sat May 30, 2009 4:10 pm
Location: Rear Area training facility

RE: Witpload & CSV Files

Post by ckammp »

ORIGINAL: Moss Orleni

ORIGINAL: witpqs

It's not just the devices anymore (it was in WITP). Now you can define a unit as static in the editor. I think that's what he's saying.

As I don't see any other way in the editor to designate a Location/LCU as static, I suppose you refer to the checkboxes Perm Restr, Temp Restr and Static Att? I'm not sure, but to me this doesn't seem to be related to a unit being static or not (static in the sense of being physically unable to move, even when changing HQ).

Taking the example of the Peleliu CD unit (Location ID 4626), none of the three boxes are checked, yet the unit is static. Furthermore, when applying the attributes bitmask to its devices, it doesn't seem to contain any static devices (disabled nor non-disabled); also, the unit is attached to an unrestricted HQ.
So, what makes this unit static?

Cheers,

Moss


From the manual, page 180:

"Coast Defense units that have the word "Fort" or HarDef" in their name or certain large guns are static and cannot move."

In the case of Peleliu Naval Fort (4626), it is the suffix (115-Fortress) that makes the unit static.
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Witpload & CSV Files

Post by michaelm75au »

Static units are those with at least one 'static' device or has type suffix of 115.

Most static units have at least one device that has the static check box ticked.
Michael
Moss Orleni
Posts: 201
Joined: Mon Nov 03, 2008 8:36 am

RE: Witpload & CSV Files

Post by Moss Orleni »

ORIGINAL: JWE
ORIGINAL: Moss Orleni
One question though: based on their definitions, it would appear that Static Attached, Restricted Temp and Restricted Permanent are mutually exclusive.
They are not.
, many LCUs seem to have more than one box checked. Does this mean that there is a ranking between the three, ie one status takes precedence over another if both are checked? Or does each add different characteristics to a unit that are not included in the other two?
There is no ranking. Review the editor further to see what each switch does. Can't answer general questions because can't discuss algorithm. If you have specific questions, may be able to help, but must be specific.


I appreciate you take time to look into it, and I understand you can't discuss the general algorithm.

I'll try to make it more concrete:

Based on the CSV tables, I'm trying to put together a list of units that are unable to move (ie that are physically unable to move, even if the HQ is unrestricted).
As per Michaelm's earlier post (the definitions that are also stated in the editor manual):
ORIGINAL: michaelm
Static Attached: units may not move by air or sea unless the HQ is changed. Even when HQ’s are changed subordinate units need to be individually acquired via PP’s..
Restricted Temp: units may not move by air or sea unless the HQ is changed. When the HQ’s are changed subordinate units change to the classification of the parent.
Restricted Permanent: HQ’s (and on some occasions units) are restricted and may never have their HQ changed – they remain and always shall be permanently restricted.

So, you can have 8 different combinations (let's denote them as SA 0/1, RT 0/1, RP 0/1; for instance SA0-RT0-RP1 is a unit that is not static attached, is not temporarily restricted but is permanently restricted).
I'm trying to understand the meaning of these combinations. Example: if you define a unit as SA0-RT1-RP1, what is the additional effect of RT1 if it's already RP1? Or what is the difference of defining a non-HQ unit as SA1 or RT1, or even both?
So in short, although the three criteria are not mutually exclusive, it is difficult to see what the different combinations represent.

Also, is it correct to assume that the Static Attached attribute is not related to the physical ability to move, but to the movement restrictions resulting from attachment to a HQ?

This leads me to the question in my last post: what combination of criteria in the data structure (Locations, Devices, ...) makes a unit static in the sense of not being able to physically move? Location ID 4626 Peleliu CD is a good example: the unit is SA0-RT0-RP0 (though I'm not sure if that is relevant to its ability to physically move, see above), it is attached to an unrestricted HQ (also irrelevant to its physical ability to move I think), and its devices list contains no static devices. So why can't it move?

Cheers,

Moss


User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Witpload & CSV Files

Post by michaelm75au »

The HQ assignment does not make the unit static as in 'can not move'. That is a suffix 115 (Fortress location) or a static defined device.

The static attached, etc, refers to command structure not movement.
Michael
Post Reply

Return to “Scenario Design and Modding”