Hi Steve,
I've come across some unusual values in the data field that shows whether a unit is organised or disorganised and was wondering whether they are okay or not? From what I can tell, most units are either 1023 (Organised), 5119 (Disorganised) or 17407 (looks like not built yet).
However, this is the record for one of my Japanese transports. I've put the record in bold. The 195 is unusual.
,49,48,1938
255,2863,,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.P World in Flames uses two main types of naval transport counter: Transport (TRS) and Amphibious (AMPH). The use of these counters depends to an extent on what optional rules are being used. However, as a general rule, TRS represent the types of ship that were used to transport men and material from one friendly port to another, while AMPH represent the specialised shipping that could land men and material on a hostile shore. .P TRS not only include troop ships but also other vessels that kept the troops fighting overseas supplied. These vessels include tankers, munitions ships and other cargo carrying vessels. These write-ups outline a few of the vessels employed by the Japanese during World War II. .P UNDER CONSTRUCTION
6296,6320,0,4447,195,1527,908,41627,0,0,0,0,224,0,32768,3245
-1,UndoData
34944,336,0,768,0,0,0
The save is from N/D 42, 7.
Looking through the game history, the TRANS had usual values in J/A 42, 4.
,49,48,1938
63,2863,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.P World in Flames uses two main types of naval transport counter: Transport (TRS) and Amphibious (AMPH). The use of these counters depends to an extent on what optional rules are being used. However, as a general rule, TRS represent the types of ship that were used to transport men and material from one friendly port to another, while AMPH represent the specialised shipping that could land men and material on a hostile shore. .P TRS not only include troop ships but also other vessels that kept the troops fighting overseas supplied. These vessels include tankers, munitions ships and other cargo carrying vessels. These write-ups outline a few of the vessels employed by the Japanese during World War II. .P UNDER CONSTRUCTION
6296,6320,0,4447,1023,58863,58,35990,0,0,0,0,224,0,32768,3245
-1,UndoData
34944,336,0,768,0,0,0
The shift occurred in J/A 42, 6. The Transport has loaded the 70mm ART and 40mm AA.
,49,48,1938
63,2863,,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.P World in Flames uses two main types of naval transport counter: Transport (TRS) and Amphibious (AMPH). The use of these counters depends to an extent on what optional rules are being used. However, as a general rule, TRS represent the types of ship that were used to transport men and material from one friendly port to another, while AMPH represent the specialised shipping that could land men and material on a hostile shore. .P TRS not only include troop ships but also other vessels that kept the troops fighting overseas supplied. These vessels include tankers, munitions ships and other cargo carrying vessels. These write-ups outline a few of the vessels employed by the Japanese during World War II. .P UNDER CONSTRUCTION
6296,6320,0,20831,195,34328,652,41626,0,0,0,0,232,8,49152,3245
-1,UndoData
34944,336,32768,768,0,0,0
In J/A 42 10, the two units were unloaded. A different value again appears in the record.
,49,48,1938
255,2863,,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.P World in Flames uses two main types of naval transport counter: Transport (TRS) and Amphibious (AMPH). The use of these counters depends to an extent on what optional rules are being used. However, as a general rule, TRS represent the types of ship that were used to transport men and material from one friendly port to another, while AMPH represent the specialised shipping that could land men and material on a hostile shore. .P TRS not only include troop ships but also other vessels that kept the troops fighting overseas supplied. These vessels include tankers, munitions ships and other cargo carrying vessels. These write-ups outline a few of the vessels employed by the Japanese during World War II. .P UNDER CONSTRUCTION
6296,6320,0,4447,12483,1564,652,41626,0,0,0,0,224,0,32768,3245
-1,UndoData
34944,336,32768,768,0,0,0
The next impulse (S/O 42, 1) sees it in the Bismark Sea with an HQ (Yamashita) loaded.
,49,48,1938
255,2863,,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.P World in Flames uses two main types of naval transport counter: Transport (TRS) and Amphibious (AMPH). The use of these counters depends to an extent on what optional rules are being used. However, as a general rule, TRS represent the types of ship that were used to transport men and material from one friendly port to another, while AMPH represent the specialised shipping that could land men and material on a hostile shore. .P TRS not only include troop ships but also other vessels that kept the troops fighting overseas supplied. These vessels include tankers, munitions ships and other cargo carrying vessels. These write-ups outline a few of the vessels employed by the Japanese during World War II. .P UNDER CONSTRUCTION
6296,6320,0,12639,195,1527,580,59056,0,0,0,0,232,9,49152,3245
-1,UndoData
34944,336,0,768,0,0,0
S/O 42 5 has it back in Osaka disorganised.
,49,48,1938
49,2863,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.P World in Flames uses two main types of naval transport counter: Transport (TRS) and Amphibious (AMPH). The use of these counters depends to an extent on what optional rules are being used. However, as a general rule, TRS represent the types of ship that were used to transport men and material from one friendly port to another, while AMPH represent the specialised shipping that could land men and material on a hostile shore. .P TRS not only include troop ships but also other vessels that kept the troops fighting overseas supplied. These vessels include tankers, munitions ships and other cargo carrying vessels. These write-ups outline a few of the vessels employed by the Japanese during World War II. .P UNDER CONSTRUCTION
6296,6320,0,4447,4291,1527,68,39588,0,0,0,0,240,8,49152,3245
-1,UndoData
34944,336,32768,768,0,0,0
The start of N/D 42, 1 sees it in port at Osaka.
,49,48,1938
49,2863,,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
.P World in Flames uses two main types of naval transport counter: Transport (TRS) and Amphibious (AMPH). The use of these counters depends to an extent on what optional rules are being used. However, as a general rule, TRS represent the types of ship that were used to transport men and material from one friendly port to another, while AMPH represent the specialised shipping that could land men and material on a hostile shore. .P TRS not only include troop ships but also other vessels that kept the troops fighting overseas supplied. These vessels include tankers, munitions ships and other cargo carrying vessels. These write-ups outline a few of the vessels employed by the Japanese during World War II. .P UNDER CONSTRUCTION
6296,6320,0,4447,195,1527,68,39588,0,0,0,0,224,0,32768,3245
-1,UndoData
34944,336,32768,768,0,0,0
It then sails to China Sea 3-box that impulse, giving the same values I posted for N/D 42, 7.
All my other 'in game' TRANS and AMPH have the regular 1023/5119 values. It appears the different values started with the loading of the 2 ART units. Is this operating as planned? If so, once the ART units were unloaded, I would have expected the org/disorg field values to revert back to normal but this hasn't happened.
If things should have reverted and haven't, what impact will this have?
I ask because I'm looking to do some manual modifications to the file. The TRANS unit should be showing as having loaded INF HQ Yamashita. It appears I forgot to do my usual triple check to make sure the unit had actually loaded and moved with the TRANS. As always seems to happen when you forget, it didn't get picked up, resulting in an empty TRANS at sea. The simplest solution will be to manually move the HQ to the destination it will go to at the appropriate time and then manually disorganise the TRANS but I want to understand the unusual values before doing so.
Thanks
Unusual Data Values
Moderator: Shannon V. OKeets
- paulderynck
- Posts: 8516
- Joined: Sat Mar 24, 2007 5:27 pm
- Location: Canada
RE: Unusual Data Values
How are you at binary arithmetic? For each of these, each bit may be used to indicate one of the status flags, FREX 0001 versus 0000 means the right most bit is set/not set = flag on/not on (or vice versa depending on the program code).
195 = 000001100011
1023 = 000111111111
4291 = 100001100011
So 4291 and 195 are almost the same state except the far left bit shown is set for 4291.
195 = 000001100011
1023 = 000111111111
4291 = 100001100011
So 4291 and 195 are almost the same state except the far left bit shown is set for 4291.
Paul
RE: Unusual Data Values
ORIGINAL: paulderynck
How are you at binary arithmetic?
Urm, 0 [:)].
Seriously though, that sort of makes sense. If I understand you correctly only part of the binary code refers to the organisation status, the rest conveys other information. 1023 looks somewhat different to the other two.
I’m still puzzled about the onset of these values being linked to picking up the ART units but not then reverting to normal once unloaded.
RE: Unusual Data Values
So 4291 and 195 are almost the same state except the far left bit shown is set for 4291.
Continuing my education, the difference between the two is 4096, which adds/subtracts the 1 to the 12 bit digit and makes a unit organised/disorganised.
That's good to know. To organise/disorganise a unit simply add/subtract 4096 and none of the other flags are affected. Courtenay's post in Ronnie's guide just clicked into place.
192 - 00000000000011000011
4291 - 00000001000011000011
12483- 00000011000011000011
1023 - 00000000001111111111
So, looking at the other values, 12483 has mostly the same flags. The TRANS is disorganised (correct) and the 13 bit is flagged. Possibly relating to the unloading?
So as far as I can tell from looking at 192 and 1023, loading the two artillery units turned off the 5, 4, 3 and 2 bit flags and they've never reset.
- paulderynck
- Posts: 8516
- Joined: Sat Mar 24, 2007 5:27 pm
- Location: Canada
RE: Unusual Data Values
If someone has figured out which status each bit represents, then it's simply a matter of adding all the powers of 2 up.
FREX for 1023 left to right, it's 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4+ 2 + 1 = all those bits were set. 1024 is a vastly different state.
FREX for 1023 left to right, it's 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4+ 2 + 1 = all those bits were set. 1024 is a vastly different state.
Paul
-
Shannon V. OKeets
- Posts: 22165
- Joined: Wed May 18, 2005 11:51 pm
- Location: Honolulu, Hawaii
- Contact:
RE: Unusual Data Values
For unit types in general, here are the codings for the first 7 data fields. There are extra data fields depending on unit 'category': land, naval, air, and special.
I reserve the right to modify these at my discretion (although I rarely do that).
===
// ****************************************************************************
// Data0
(*
Bits Mask Data
0-6 $0000007F Type (128 possible unit types).
7-14 $00007F80 Country (254 countries).
15-20 $001F8000 Year (-1890).
21 $00200000 Not built at start (air & naval units only).
22 $00400000 Small (land units only).
23-30 $7F800000 Source country (254 countries).
31 $80000000 No adjacent ZOC (land units only).
*)
// ****************************************************************************
UnitTypeMask = $0000007F;
UnitTypeShift = 0;
CountryMask = $00007F80;
CountryShift = 7;
YearMask = $001F8000;
YearShift = 15;
NotBuiltMask = $00200000;
NotBuiltShift = 21;
SmallMask = $00400000;
SmallShift = 22;
SourceCountryMask = $7F800000;
SourceCountryShift = 23;
NoAdjacentZOCMask = $80000000;
NoAdjacentZOCShift = 31;
// ****************************************************************************
// Data1
(*
Bits Mask Data
0-12 $00001FFF Unit ID # (13 bits = 8192).
13-16 $0001E000 TransType (4 bits). 15 possible values.
17-25 $03FE0000 Unused (9 bits).
26-31 $FC000000 Fort hexsides (land units only) (6 bits).
*)
// ****************************************************************************
UnitIDReadMask = $00001FFF; // Unit's ID # read from CSV file (13 bits).
UnitIDReadShift = 0;
TransTypeMask = $0001E000; // TransType (4 bits). Used to be $03FFE000.
TransTypeShift = 13;
FortHexsidesMask = $FC000000; // (6 bits).
FortHexsidesShift = 26;
// ****************************************************************************
// Data2
(*
Bits Mask Data // Unit IDs of transported units.
0-12 $00001FFF Trans1 (13 bits).
13-25 $03FFE000 Trans2 (13 bits).
26 $04000000 Picked.
27 $08000000 Sentry.
28 $10000000 Disorganized.
29 $20000000 Disorganized at reorganization start.
30 $40000000 Out of supply.
31 $80000000 Isolated.
*)
// ****************************************************************************
Trans1Mask = $00001FFF;
Trans1Shift = 0;
Trans2Mask = $03FFE000;
Trans2Shift = 13;
PickedMask = $04000000;
PickedShift = 26;
SentryMask = $08000000;
SentryShift = 27;
DisorganizedMask = $10000000;
DisorganizedShift = 28;
DisorganizedAtReorgStartMask = $20000000;
DisorganizedAtReorgStartShift = 29;
OutOfSupplyMask = $40000000;
OutOfSupplyShift = 30;
IsolatedMask = $80000000;
IsolatedShift = 31;
// ****************************************************************************
// Data3
(*
Bits Mask Data
0-8 $000001FF Column (9 bits = 512).
9-16 $0001FE00 Row (8 bits = 256).
17-23 $00FE0000 Sea area (7 bits = 128).
24-26 $07000000 Section (3 bits = 8).
27-31 $F8000000 On/Off map location (5 bits = 32).
*)
// ****************************************************************************
ColumnMask = $000001FF;
ColumnShift = 0;
RowMask = $0001FE00;
RowShift = 9;
SeaAreaMaskUnits = $00FE0000;
SeaAreaShiftUnits = 17;
SectionMask = $07000000;
SectionShift = 24;
UnitPlaceMask = $F8000000;
UnitPlaceShift = 27;
// ****************************************************************************
// Data4
(*
Bits Mask Data
0-6 $0000007F Parent carrier sea area (air units only).
7-9 $00000380 Parent carrier section (air units only).
10 $00000400 Unused.
11 $00000800 Permananent factory (factory units only).
12 $00001000 Invading (land units only).
13 $00002000 Sea invading (land units only).
14 $00004000 Paradropping (land units only).
15 $00008000 Offensive HQ.
16 $00010000 Primary supply source (land units only).
17 $00020000 Emergency supply.
18 $00040000 Emergency supply HQ (land units only).
19 $00080000 Combat engineer (land units only).
20 $00100000 Flying extended (air units only).
21 $00200000 Night mission (air units only).
22 $00400000 Supply checked.
23 $00800000 Selectable.
24 $01000000 Selectable cleared.
25 $02000000 ActiveUnit.
26 $04000000 Overrunning (land units only).
27-30 $78000000 Offensive points used (land units only).
31 $80000000 HQ moved off rail (land units only).
*)
// ****************************************************************************
ParentCarrierSeaAreaMask = $0000007F;
ParentCarrierSeaAreaShift = 0;
ParentCarrierSectionMask = $00000380;
ParentCarrierSectionShift = 7;
PermanentMask = $00000800;
PermanentShift = 11;
InvadingMask = $00001000;
InvadingShift = 12;
SeaInvadingMask = $00002000;
SeaInvadingShift = 13;
ParadroppingMask = $00004000;
ParadroppingShift = 14;
OffensiveHQMask = $00008000;
OffensiveHQShift = 15;
PrimarySupplySourceMask = $00010000;
PrimarySupplySourceShift = 16;
EmergencySupplyMask = $00020000;
EmergencySupplyShift = 17;
EmergencySupplyHQMask = $00040000;
EmergencySupplyHQShift = 18;
CombatEngineerMask = $00080000;
CombatEngineerShift = 19;
FlyingExtendedMask = $00100000;
FlyingExtendedShift = 20;
NightMissionMask = $00200000;
NightMissionShift = 21;
SupplyCheckedMask = $00400000;
SupplyCheckedShift = 22;
SelectableMask = $00800000;
SelectableShift = 23;
SelectableClearedMask = $01000000;
SelectableClearedShift = 24;
ActiveUnitMask = $02000000;
ActiveUnitShift = 25;
OverrunningMask = $04000000;
OverrunningShift = 26;
OffensivePtsMask = $78000000;
OffensivePtsShift = 27;
HQMovedOffRailMask = $80000000;
HQMovedOffRailShift = 31;
// ****************************************************************************
// Data5
(*
Bits Mask Data
0-6 $0000007F Invasion sea area (land units only) (7 bits = 128).
7 $00000080 Synth oil lost (synth oil units only).
8-15 $0000FF00 Points: oil resources/build points only (8 bits = 256).
16-20 $000F0000 Year the unit arrives as a reinforcement.
21-22 $00600000 Role (air units only).
23 $00800000 AA fired (land units only).
24 $01000000 Aborted this combat.
25 $02000000 Aborting.
26 $04000000 Bombarding (land units only).
27 $08000000 Landing.
28 $10000000 Doubled (land units only).
29 $20000000 Forced abort.
30 $40000000 Force extended range (air units only).
31 $80000000 Unit initiating an Interception (air/naval units only).
*)
// ****************************************************************************
InvasionSeaAreaMask = $0000007F;
InvasionSeaAreaShift = 0;
SynthOilLostMask = $00000080;
SynthOilLostShift = 7;
PointsMask = $0000FF00;
PointsShift = 8;
YearArrivesMask = $001F0000;
YearArrivesShift = 16;
RoleMask = $00600000;
RoleShift = 21;
AAFiredMask = $00800000;
AAFiredShift = 23;
AbortedThisCombatMask = $01000000;
AbortedThisCombatShift = 24;
AbortingMask = $02000000;
AbortingShift = 25;
BombardingMask = $04000000;
BombardingShift = 26;
LandingMask = $08000000;
LandingShift = 27;
DoubledMask = $10000000;
DoubledShift = 28;
ForcedAbortMask = $20000000;
ForcedAbortShift = 29;
ForceExtendedMask = $40000000;
ForceExtendedShift = 30;
InterceptionMask = $80000000;
InterceptionShift = 31;
// ****************************************************************************
// Data6
(*
Bits Mask Data
0 $00000001 Returning to base (air/naval units only).
1 $00000002 Staying at sea (air/naval units only).
2-8 $000001FC Range used (air/naval units only) (7 bits = 128).
9-16 $0001FE00 Working8Bits (8 bits).
17 $00020000 US naval combat.
18-20 $001C0000 Movement points used (3 bits = 8).
21-24 $01E00000 Setup status: 0 = not being setup (4 bits = 16).
25-30 $EE000000 Setup group index (6 bits = 64).
31 $80000000 Built this turn.
*)
// ****************************************************************************
ReturningToBaseMask = $00000001;
ReturningToBaseShift = 0;
StayingAtSeaMask = $00000002;
StayingAtSeaShift = 1;
RangeUsedMask = $000001FC;
RangeUsedShift = 2;
Working8BitsMask = $0001FE00; // (8 bits = 256).
Working8BitsShift = 9; // Working8Bits.
ReorgTagMask = $3F; // Used in combination with Working8Bits.
USNavalCombatMask = $00020000;
USNavalCombatShift = 17;
MPUsedMask = $001C0000;
MPUsedShift = 18;
SetupStatusMask = $01E00000; // Step in setup process (4 bits = 16).
SetupStatusShift = 21;
SetupGroupIndexMask = $7E000000; // Setup Location Group Index (6 bits = 64).
SetupGroupIndexShift = 25;
BuiltThisTurnMask = $80000000;
BuiltThisTurnShift = 31;
// ****************************************************************************
// Data7
(*
Bits Mask Data
0 $00000001 Whether unit's bitmap image was loaded (air and naval only).
1-5 $0000003E Bitmap page (31 possible - 22 used).
6-12 $00001FC0 Bitmap cell within page (127 possible - 100 used).
13-21 $003FE000 From column (512 possible - 360 used).
22-29 $3FC00000 From row (256 possible - 195 used).
30 $40000000 Moved in impulse.
31 $80000000 Moved in turn.
*)
BitmapLoadedMask = $00000001; // Whether the unit's bitmap has been loaded.
BitmapLoadedShift = 0;
BitmapPageMask = $0000003E;
BitmapPageShift = 1;
BitmapCellMask = $00001FC0;
BitmapCellShift = 6;
FromColumnMask = $003FE000; // Hex unit started from. Used for returning
FromColumnShift = 13; // air units back to the hex from which they
FromRowMask = $3FC00000; // started, and artillery units back to the hex
FromRowShift = 22; // from which they bombarded.
MovedInImpulseMask = $40000000;
MovedInImpulseShift = 30;
MovedInTurnMask = $80000000;
MovedInTurnShift = 31;
I reserve the right to modify these at my discretion (although I rarely do that).
===
// ****************************************************************************
// Data0
(*
Bits Mask Data
0-6 $0000007F Type (128 possible unit types).
7-14 $00007F80 Country (254 countries).
15-20 $001F8000 Year (-1890).
21 $00200000 Not built at start (air & naval units only).
22 $00400000 Small (land units only).
23-30 $7F800000 Source country (254 countries).
31 $80000000 No adjacent ZOC (land units only).
*)
// ****************************************************************************
UnitTypeMask = $0000007F;
UnitTypeShift = 0;
CountryMask = $00007F80;
CountryShift = 7;
YearMask = $001F8000;
YearShift = 15;
NotBuiltMask = $00200000;
NotBuiltShift = 21;
SmallMask = $00400000;
SmallShift = 22;
SourceCountryMask = $7F800000;
SourceCountryShift = 23;
NoAdjacentZOCMask = $80000000;
NoAdjacentZOCShift = 31;
// ****************************************************************************
// Data1
(*
Bits Mask Data
0-12 $00001FFF Unit ID # (13 bits = 8192).
13-16 $0001E000 TransType (4 bits). 15 possible values.
17-25 $03FE0000 Unused (9 bits).
26-31 $FC000000 Fort hexsides (land units only) (6 bits).
*)
// ****************************************************************************
UnitIDReadMask = $00001FFF; // Unit's ID # read from CSV file (13 bits).
UnitIDReadShift = 0;
TransTypeMask = $0001E000; // TransType (4 bits). Used to be $03FFE000.
TransTypeShift = 13;
FortHexsidesMask = $FC000000; // (6 bits).
FortHexsidesShift = 26;
// ****************************************************************************
// Data2
(*
Bits Mask Data // Unit IDs of transported units.
0-12 $00001FFF Trans1 (13 bits).
13-25 $03FFE000 Trans2 (13 bits).
26 $04000000 Picked.
27 $08000000 Sentry.
28 $10000000 Disorganized.
29 $20000000 Disorganized at reorganization start.
30 $40000000 Out of supply.
31 $80000000 Isolated.
*)
// ****************************************************************************
Trans1Mask = $00001FFF;
Trans1Shift = 0;
Trans2Mask = $03FFE000;
Trans2Shift = 13;
PickedMask = $04000000;
PickedShift = 26;
SentryMask = $08000000;
SentryShift = 27;
DisorganizedMask = $10000000;
DisorganizedShift = 28;
DisorganizedAtReorgStartMask = $20000000;
DisorganizedAtReorgStartShift = 29;
OutOfSupplyMask = $40000000;
OutOfSupplyShift = 30;
IsolatedMask = $80000000;
IsolatedShift = 31;
// ****************************************************************************
// Data3
(*
Bits Mask Data
0-8 $000001FF Column (9 bits = 512).
9-16 $0001FE00 Row (8 bits = 256).
17-23 $00FE0000 Sea area (7 bits = 128).
24-26 $07000000 Section (3 bits = 8).
27-31 $F8000000 On/Off map location (5 bits = 32).
*)
// ****************************************************************************
ColumnMask = $000001FF;
ColumnShift = 0;
RowMask = $0001FE00;
RowShift = 9;
SeaAreaMaskUnits = $00FE0000;
SeaAreaShiftUnits = 17;
SectionMask = $07000000;
SectionShift = 24;
UnitPlaceMask = $F8000000;
UnitPlaceShift = 27;
// ****************************************************************************
// Data4
(*
Bits Mask Data
0-6 $0000007F Parent carrier sea area (air units only).
7-9 $00000380 Parent carrier section (air units only).
10 $00000400 Unused.
11 $00000800 Permananent factory (factory units only).
12 $00001000 Invading (land units only).
13 $00002000 Sea invading (land units only).
14 $00004000 Paradropping (land units only).
15 $00008000 Offensive HQ.
16 $00010000 Primary supply source (land units only).
17 $00020000 Emergency supply.
18 $00040000 Emergency supply HQ (land units only).
19 $00080000 Combat engineer (land units only).
20 $00100000 Flying extended (air units only).
21 $00200000 Night mission (air units only).
22 $00400000 Supply checked.
23 $00800000 Selectable.
24 $01000000 Selectable cleared.
25 $02000000 ActiveUnit.
26 $04000000 Overrunning (land units only).
27-30 $78000000 Offensive points used (land units only).
31 $80000000 HQ moved off rail (land units only).
*)
// ****************************************************************************
ParentCarrierSeaAreaMask = $0000007F;
ParentCarrierSeaAreaShift = 0;
ParentCarrierSectionMask = $00000380;
ParentCarrierSectionShift = 7;
PermanentMask = $00000800;
PermanentShift = 11;
InvadingMask = $00001000;
InvadingShift = 12;
SeaInvadingMask = $00002000;
SeaInvadingShift = 13;
ParadroppingMask = $00004000;
ParadroppingShift = 14;
OffensiveHQMask = $00008000;
OffensiveHQShift = 15;
PrimarySupplySourceMask = $00010000;
PrimarySupplySourceShift = 16;
EmergencySupplyMask = $00020000;
EmergencySupplyShift = 17;
EmergencySupplyHQMask = $00040000;
EmergencySupplyHQShift = 18;
CombatEngineerMask = $00080000;
CombatEngineerShift = 19;
FlyingExtendedMask = $00100000;
FlyingExtendedShift = 20;
NightMissionMask = $00200000;
NightMissionShift = 21;
SupplyCheckedMask = $00400000;
SupplyCheckedShift = 22;
SelectableMask = $00800000;
SelectableShift = 23;
SelectableClearedMask = $01000000;
SelectableClearedShift = 24;
ActiveUnitMask = $02000000;
ActiveUnitShift = 25;
OverrunningMask = $04000000;
OverrunningShift = 26;
OffensivePtsMask = $78000000;
OffensivePtsShift = 27;
HQMovedOffRailMask = $80000000;
HQMovedOffRailShift = 31;
// ****************************************************************************
// Data5
(*
Bits Mask Data
0-6 $0000007F Invasion sea area (land units only) (7 bits = 128).
7 $00000080 Synth oil lost (synth oil units only).
8-15 $0000FF00 Points: oil resources/build points only (8 bits = 256).
16-20 $000F0000 Year the unit arrives as a reinforcement.
21-22 $00600000 Role (air units only).
23 $00800000 AA fired (land units only).
24 $01000000 Aborted this combat.
25 $02000000 Aborting.
26 $04000000 Bombarding (land units only).
27 $08000000 Landing.
28 $10000000 Doubled (land units only).
29 $20000000 Forced abort.
30 $40000000 Force extended range (air units only).
31 $80000000 Unit initiating an Interception (air/naval units only).
*)
// ****************************************************************************
InvasionSeaAreaMask = $0000007F;
InvasionSeaAreaShift = 0;
SynthOilLostMask = $00000080;
SynthOilLostShift = 7;
PointsMask = $0000FF00;
PointsShift = 8;
YearArrivesMask = $001F0000;
YearArrivesShift = 16;
RoleMask = $00600000;
RoleShift = 21;
AAFiredMask = $00800000;
AAFiredShift = 23;
AbortedThisCombatMask = $01000000;
AbortedThisCombatShift = 24;
AbortingMask = $02000000;
AbortingShift = 25;
BombardingMask = $04000000;
BombardingShift = 26;
LandingMask = $08000000;
LandingShift = 27;
DoubledMask = $10000000;
DoubledShift = 28;
ForcedAbortMask = $20000000;
ForcedAbortShift = 29;
ForceExtendedMask = $40000000;
ForceExtendedShift = 30;
InterceptionMask = $80000000;
InterceptionShift = 31;
// ****************************************************************************
// Data6
(*
Bits Mask Data
0 $00000001 Returning to base (air/naval units only).
1 $00000002 Staying at sea (air/naval units only).
2-8 $000001FC Range used (air/naval units only) (7 bits = 128).
9-16 $0001FE00 Working8Bits (8 bits).
17 $00020000 US naval combat.
18-20 $001C0000 Movement points used (3 bits = 8).
21-24 $01E00000 Setup status: 0 = not being setup (4 bits = 16).
25-30 $EE000000 Setup group index (6 bits = 64).
31 $80000000 Built this turn.
*)
// ****************************************************************************
ReturningToBaseMask = $00000001;
ReturningToBaseShift = 0;
StayingAtSeaMask = $00000002;
StayingAtSeaShift = 1;
RangeUsedMask = $000001FC;
RangeUsedShift = 2;
Working8BitsMask = $0001FE00; // (8 bits = 256).
Working8BitsShift = 9; // Working8Bits.
ReorgTagMask = $3F; // Used in combination with Working8Bits.
USNavalCombatMask = $00020000;
USNavalCombatShift = 17;
MPUsedMask = $001C0000;
MPUsedShift = 18;
SetupStatusMask = $01E00000; // Step in setup process (4 bits = 16).
SetupStatusShift = 21;
SetupGroupIndexMask = $7E000000; // Setup Location Group Index (6 bits = 64).
SetupGroupIndexShift = 25;
BuiltThisTurnMask = $80000000;
BuiltThisTurnShift = 31;
// ****************************************************************************
// Data7
(*
Bits Mask Data
0 $00000001 Whether unit's bitmap image was loaded (air and naval only).
1-5 $0000003E Bitmap page (31 possible - 22 used).
6-12 $00001FC0 Bitmap cell within page (127 possible - 100 used).
13-21 $003FE000 From column (512 possible - 360 used).
22-29 $3FC00000 From row (256 possible - 195 used).
30 $40000000 Moved in impulse.
31 $80000000 Moved in turn.
*)
BitmapLoadedMask = $00000001; // Whether the unit's bitmap has been loaded.
BitmapLoadedShift = 0;
BitmapPageMask = $0000003E;
BitmapPageShift = 1;
BitmapCellMask = $00001FC0;
BitmapCellShift = 6;
FromColumnMask = $003FE000; // Hex unit started from. Used for returning
FromColumnShift = 13; // air units back to the hex from which they
FromRowMask = $3FC00000; // started, and artillery units back to the hex
FromRowShift = 22; // from which they bombarded.
MovedInImpulseMask = $40000000;
MovedInImpulseShift = 30;
MovedInTurnMask = $80000000;
MovedInTurnShift = 31;
Steve
Perfection is an elusive goal.
Perfection is an elusive goal.
RE: Unusual Data Values
Thanks Steve, unfortunately this goes way beyond my comprehension.
It's a bit like the Hubbard quote along the lines of any sufficiently advanced technology is indistinguishable from magic. In my limited grasp of all this, I might just as well be trying a Latin inscribed spell incarnation at Hogwarts!
Wingardium leviosa ....
Going back to my original puzzlement, does it matter or not that the Transport values were apparently changed when the 2 ART units were loaded and have never reset?
It's a bit like the Hubbard quote along the lines of any sufficiently advanced technology is indistinguishable from magic. In my limited grasp of all this, I might just as well be trying a Latin inscribed spell incarnation at Hogwarts!
Wingardium leviosa ....
Going back to my original puzzlement, does it matter or not that the Transport values were apparently changed when the 2 ART units were loaded and have never reset?
-
Shannon V. OKeets
- Posts: 22165
- Joined: Wed May 18, 2005 11:51 pm
- Location: Honolulu, Hawaii
- Contact:
RE: Unusual Data Values
The very first programming assignment I had (in 1968) was to code a routine to solve simultaneous equations. I struggled with doing that for a couple of weeks and showed my results to my boss. He glanced at it and told me to read some code a friend of his had written to solve the same problem. It was about 1/10 the length of my code, very efficient, and worked! (mine didn't).ORIGINAL: AllenK
Thanks Steve, unfortunately this goes way beyond my comprehension.
It's a bit like the Hubbard quote along the lines of any sufficiently advanced technology is indistinguishable from magic. In my limited grasp of all this, I might just as well be trying a Latin inscribed spell incarnation at Hogwarts!
Wingardium leviosa ....
Going back to my original puzzlement, does it matter or not that the Transport values were apparently changed when the 2 ART units were loaded and have never reset?
One big difference was that the better programmer hadn't bothered to reset values for variables that were no longer needed. His program set and used variables, and then forgot about/ignored them.
That is most likely what you are seeing here. A transport stores how many units it is carrying and also the IDs of the units it is carrying. If the count is zero, then the values in the ID fields are irrelevant.
Steve
Perfection is an elusive goal.
Perfection is an elusive goal.

