All files are build on a texture bitmap base of 128x128 texel.
after loading a .bin file with a hex editor you see the code going from 0000 to 3fff for the first square and 4000 to 7fff for the next square and so on until end of file. when you extract such a square and append it to a Targa-Template 128x128 you can view this square with your picture editor software (GIMP, Paintshop, Corel ... MS PhotoEditor 97)
here is a in deep description for Visual Basic peoples
' Read tga Template Sub ReadTGAHead(fina As String) Dim tga(786) As Byte Open fina For Binary Access Read As #1 ' the targa header part 1 For i = 0 To 11 Get #1, , tga(i) Next i ' base level 3 level 2 level 1 level 0 ' now the picture size 128x128 512x512 1024x1024 2048x2048 4096x4096 Get #1, , tga(12) ' &h80 &h00 &h00 &h00 &h00 Get #1, , tga(13) ' &h00 &h02 &h04 &h08 &h10 Get #1, , tga(14) ' &h80 &h00 &h00 &h00 &h00 Get #1, , tga(15) ' &h00 &h02 &h04 &h08 &h10 ' the rest of the targa header Get #1, , tga(16) Get #1, , tga(17) ' now same colorpalette as FU3 resource 908 For i = 18 To 18 + 256 * 3 Step 3 Get #1, , tga(i) ' red Get #1, , tga(i + 1) ' green Get #1, , tga(i + 2) ' blue Next i Close #1 ' insert here the binary code of the square &h0000 - &h3fff End Sub
the total file size should be: 17170 Bytes
the 4 Bytes of the size fields are &h80 &h00 &h80 &h00 for the 128x128 bitmap.
of cause you can read the targa template at once
' Read tga Template Sub ReadTGAHead(fina As String) Open fina For Binary Access Read As #1 For i = 0 To 785 Get #1, , tga(i) Next i Close #1 End Sub
This will work for all .bin map files but not for the compressed .cpd files. They have to be decompressed first. Sergey provides the utility you need for that in his toolkit. and there are also the utilities for the square shuffling to a total level 3, 2, 1, 0 map.
The shuffled squares has the ending .raw after conversion and for viewing you need to merge it to a targa template of the right size.
Information: André Meystre
back to FU3 Terrain Workshop next to The Superpalette