Page 2 of 2

Posted: Tue Mar 26, 2013 4:21 am
by TurkeyXIII
Spunkmeyer wrote:QUOTE (Spunkmeyer @ Mar 26 2013, 11:47 AM) I do have some some pre & defs memorized or otherwise referenced... as it's not immediately apparent to me how the numbers change from looking at the underlying bits (doesn't look like a simple LSB & MSB swap) I was saying if you could provide the conversion formula, then I could quickly revise my lists to refer to the new, accurate numbers.
Yeah, I'd want the conversion formula too.

Posted: Tue Mar 26, 2013 3:08 pm
by KGJV
I'll do this in 2 steps:

1st i'll change Coredump to be consistent with ICE.

2nd i'll fix ICE to be consistent with IGCLib and the game and revert Coredump. this could take a while as I want to review and change a lof of internal code in ICE.

as for the conversion function:

pre/def numbers (called TechTreeBitMask in the game code) are coded using 400 boolean values stored as a bitarray.
These boolean values are referenced with their indexes in the array starting from 0 to 399.

both in game and ICE, the bitarray is reprensented using a 50 bytes array (since 50x8 = 400).

The value of the Nth bool in the bitarray is stored in the N%8 bit of the (N/8)th byte.

where ICE and game code differs is on the endianness of the bytes.

for ICE the 1st bit in the byte is the left most.
for the game code it's the right most.

we get :

Code: Select all

ICE    0 1 2 3 4 5 6 7 |  8  9 10 11 12 13 14 15 | ... | 392 393 394 395 396 397 398 399 
GAME   7 6 5 4 3 2 1 0 | 15 14 13 12 11 10  9  8 | ... | 399 398 397 396 395 394 393 392
when ICE displays 13 , Coredump displays 10 for the same bit.

the conversion formula is :

Code: Select all

(N/8)*8 + 7-N%8
the same formula works both ways.

Posted: Tue Mar 26, 2013 3:18 pm
by KGJV
ok coredump is updated on the site as well as its source.

changes:

- display TechTreeBitMask like ICE does
- added DataExpendableTypeIGC objects (mines,chaffs,missiles,probes) and DataLauncherTypeIGC objects.


some others flag values that use bitmasks may differ from ICE too. i'll treat these on demand only.

Posted: Tue Mar 26, 2013 5:30 pm
by Spunkmeyer
:thumbsup:

Posted: Tue Apr 02, 2013 5:19 am
by Imago
finally acks a bitmask problem in ice