mikew

Back to TFX1

49 posts in this topic

TFX1 contains five maps:
tfx1_maps.png

..and like many others I'm sure, my dream has always been to fly the TAW F-22 around these worlds.

The size of the TFX1 worlds are 200x200 tiles, but we can pad that out with sea for now to get the TAW 400x400 map size:

lib400.png

Now, it is just a case of performing the following data processing::
1. Convert TFX1's libya.lev,libya.le2,libya.dat to TFX3's redsea.env and redsea.lst
2. Append the TFX1 ssinfo.fn to that of TFX3
3. Identify the supershapes used in the .lst file, and modify their shape indices to match the new positions in ssinfo.fn
4. Merge the used shapes and supershapes with the TFX3 set
5. Forget the textures and palettes for now, we'll use those from TFX3

That's it. Let's fire up TFXplorer and start flying!

tfx1_town.png

Hmmn, maybe should have dealt with those palettes and textures after all. :)

Anyway, let's try to land on Malta. I hope this somewhat surprisingly textured runway is solid:
malta_airbase.png

..and it is! Perfect landing with appropriate sound effects.
malta_landed.png

Anyway, many thanks to Krycztij for TFXplorer and apologies for abusing it in such a way.

Share this post


Link to post
Share on other sites

For next steps, I suggest:

  1. identify tiles with missing pieces (no ground etc.)
  2. identify the according .3 shapes
  3. analyze their instruction sequence via 3View
  4. enhance the renderer to handle the missing pieces
  5. enjoy full-quality TFX 1 terrains :) 

Mike, this is incredible work. Just incredible!

Share this post


Link to post
Share on other sites

 

I think I have already identified 1 and 2. The 'no ground' seems to be due to the shape file of a terrain tile not being in the regular 32 triangle format that we see for TFX2 and TFX3. It's more a collection of discrete triangles and quads as in this example 'barren1m.3': which is common in the Libya map.barren1m.png

Some background colour needs to be specified somewhere, and I don't think it's in the 3 file. Here's the decoding, to TFX2 rules, using my old parser where the comments were state of the art in 2010.

 

header ;fc100fa01f40000000007fff0000000003e800000000000200030003000000000000000e02f603f003f003f000000000ffff
0000; 003f000402e0    ;  If 003f (Time??) test(4), Jump to line 107
0001; 00620000018b000001be    ; Vertex :0  X=395  Y=0  Z=446
0002; 0068ff41fd6a    ; Vertex :1  X=204  Y=0  Z=-216
0003; 006800e20132    ; Vertex :2  X=430  Y=0  Z=90
0004; 0068ff060028    ; Vertex :3  X=180  Y=0  Z=130
0005; 00680320005a    ; Vertex :4  X=980  Y=0  Z=220
0006; 0068fd62feb6    ; Vertex :5  X=310  Y=0  Z=-110
0007; 0068fb96ff38    ; Vertex :6  X=-820  Y=0  Z=-310
0008; 006804baff88    ; Vertex :7  X=390  Y=0  Z=-430
0009; 0068fafdff8a    ; Vertex :8  X=-893  Y=0  Z=-548
0010; 006806d40495    ; Vertex :9  X=855  Y=0  Z=625
0011; 0068ffcd00a6    ; Vertex :10  X=804  Y=0  Z=791
0012; 0066fa92    ; Vertex :11  X=804  Y=0  Z=-599
0013; 0068ffa202cf    ; Vertex :12  X=710  Y=0  Z=120
0014; 00680004fbd8    ; Vertex :13  X=714  Y=0  Z=-944
0015; 0064fc44    ; Vertex :14  X=-242  Y=0  Z=-944
0016; 00680488072d    ; Vertex :15  X=918  Y=0  Z=893
0017; 0068000df920    ; Vertex :16  X=931  Y=0  Z=-867
0018; 0068fa4506ad    ; Vertex :17  X=-536  Y=0  Z=842
0019; 0068ff70f9b4    ; Vertex :18  X=-680  Y=0  Z=-770
0020; 0068003c044c    ; Vertex :19  X=-620  Y=0  Z=330
0021; 0068ffc800c1    ; Vertex :20  X=-676  Y=0  Z=523
0022; 0068ff1aff67    ; Vertex :21  X=-906  Y=0  Z=370
0023; 006801f0fdbc    ; Vertex :22  X=-410  Y=0  Z=-210
0024; 006804e400ac    ; Vertex :23  X=842  Y=0  Z=-38
0025; 006800a602f0    ; Vertex :24  X=1008  Y=0  Z=714
0026; 0068fe5efb38    ; Vertex :25  X=590  Y=0  Z=-510
0027; 0068fc5efee8    ; Vertex :26  X=-340  Y=0  Z=-790
0028; 00680064008c    ; Vertex :27  X=-240  Y=0  Z=-650
0029; 0068036effa6    ; Vertex :28  X=638  Y=0  Z=-740
0030; 0068fbac04b0    ; Vertex :29  X=-470  Y=0  Z=460
0031; 0061001e0000    ;
0032; 00020022000000020005    ; Flat Shaded Triangle, Palette:34  Vertices: 0,2,5
0033; 0071000000050003    ; Flat Shaded Triangle, Palette:34  Vertices: 0,5,3
0034; 0071000500070003    ; Flat Shaded Triangle, Palette:34  Vertices: 5,7,3
0035; 0071000300070001    ; Flat Shaded Triangle, Palette:34  Vertices: 3,7,1
0036; 0071000800060016    ; Flat Shaded Triangle, Palette:34  Vertices: 8,6,22
0037; 00720009000a000f0018    ; Flat Shaded Quad, Palette:34  Vertices: 9,10,15,24
0038; 0072001c000b0010000d    ; Flat Shaded Quad, Palette:34  Vertices: 28,11,16,13
0039; 00720011001d00130014    ; Flat Shaded Quad, Palette:34  Vertices: 17,29,19,20
0040; 0071001300150014    ; Flat Shaded Triangle, Palette:34  Vertices: 19,21,20
0041; 007100040017000c    ; Flat Shaded Triangle, Palette:34  Vertices: 4,23,12
0042; 007100170019000c    ; Flat Shaded Triangle, Palette:34  Vertices: 23,25,12
0043; 0071001a001b000e    ; Flat Shaded Triangle, Palette:34  Vertices: 26,27,14
0044; 0071001a0012001b    ; Flat Shaded Triangle, Palette:34  Vertices: 26,18,27
0045; 002607d00004    ;  Comparison with (2000), Jump to line 47
0046; 0000    ;
0047; 0062001e00c800000000    ; Vertex :30  X=200  Y=0  Z=0
0048; 0075001e    ;
0049; 002d001e0054    ; Vertex Test 30 , jump to line 63
0050; 0062001efda800000190    ; Vertex :30  X=-600  Y=0  Z=400
0051; 0075001e    ;
0052; 002d001e00e6    ; Vertex Test 30 , jump to line 90
0053; 0062001e019000000258    ; Vertex :30  X=400  Y=0  Z=600
0054; 0075001e    ;
0055; 002d001e00d2    ; Vertex Test 30 , jump to line 90
0056; 0062001efda80000fe70    ; Vertex :30  X=-600  Y=0  Z=-400
0057; 0075001e    ;
0058; 002d001e00be    ; Vertex Test 30 , jump to line 90
0059; 0062001e01900000fda8    ; Vertex :30  X=400  Y=0  Z=-600
0060; 0075001e    ;
0061; 002d001e00aa    ; Vertex Test 30 , jump to line 90
0062; 0000    ;
0063; 00620000ffd300000081    ; Vertex :0  X=-45  Y=0  Z=129
0064; 0068004effab    ; Vertex :1  X=33  Y=0  Z=44
0065; 0068ffd5ff21    ; Vertex :2  X=-10  Y=0  Z=-179
0066; 0068ffb300fa    ; Vertex :3  X=-87  Y=0  Z=71
0067; 0068fffbfee6    ; Vertex :4  X=-92  Y=0  Z=-211
0068; 00680025ffd6    ; Vertex :5  X=-55  Y=0  Z=-253
0069; 0068ffcbfffa    ; Vertex :6  X=-108  Y=0  Z=-259
0070; 0068fff00230    ; Vertex :7  X=-124  Y=0  Z=301
0071; 0068002cffa9    ; Vertex :8  X=-80  Y=0  Z=214
0072; 0068ffeeffc8    ; Vertex :9  X=-98  Y=0  Z=158
0073; 0068ffabffc5    ; Vertex :10  X=-183  Y=0  Z=99
0074; 0068002dffd3    ; Vertex :11  X=-138  Y=0  Z=54
0075; 0068ffdbffbd    ; Vertex :12  X=-175  Y=0  Z=-13
0076; 0068ffc10036    ; Vertex :13  X=-238  Y=0  Z=41
0077; 0068ffceff8b    ; Vertex :14  X=-288  Y=0  Z=-76
0078; 0068001dffc3    ; Vertex :15  X=-259  Y=0  Z=-137
0079; 0068ffedffa1    ; Vertex :16  X=-278  Y=0  Z=-232
0080; 0068ffee0052    ; Vertex :17  X=-296  Y=0  Z=-150
0081; 006800640169    ; Vertex :18  X=-196  Y=0  Z=211
0082; 00680010fff3    ; Vertex :19  X=-180  Y=0  Z=198
0083; 0068fffbffeb    ; Vertex :20  X=-185  Y=0  Z=177
0084; 0068ffe80005    ; Vertex :21  X=-209  Y=0  Z=182
0085; 00680122fe7a    ; Vertex :22  X=81  Y=0  Z=-208
0086; 00680010ffe5    ; Vertex :23  X=97  Y=0  Z=-235
0087; 0068fff2fff6    ; Vertex :24  X=83  Y=0  Z=-245
0088; 0068fff30017    ; Vertex :25  X=70  Y=0  Z=-222
0089; 0068ff11017a    ; Vertex :26  X=-169  Y=0  Z=156
0090; 0061001b0000    ;
0091; 000300240000000100020003    ; Flat Shaded Quad, Palette:36  Vertices: 0,1,2,3
0092; 0001002400000002    ; Line, Palette:36  Vertices: 0,2
0093; 0002002c000400050006    ; Flat Shaded Triangle, Palette:44  Vertices: 4,5,6
0094; 0001002c00040006    ; Line, Palette:44  Vertices: 4,6
0095; 00020025000700080009    ; Flat Shaded Triangle, Palette:37  Vertices: 7,8,9
0096; 0001002500070009    ; Line, Palette:37  Vertices: 7,9
0097; 00030029000a000b000c000d    ; Flat Shaded Quad, Palette:41  Vertices: 10,11,12,13
0098; 00010029000a000c    ; Line, Palette:41  Vertices: 10,12
0099; 00030024000e000f00100011    ; Flat Shaded Quad, Palette:36  Vertices: 14,15,16,17
0100; 00010024000e0010    ; Line, Palette:36  Vertices: 14,16
0101; 000300230012001300140015    ; Flat Shaded Quad, Palette:35  Vertices: 18,19,20,21
0102; 0001002300120014    ; Line, Palette:35  Vertices: 18,20
0103; 000300200016001700180019    ; Flat Shaded Quad, Palette:32  Vertices: 22,23,24,25
0104; 0001002000160018    ; Line, Palette:32  Vertices: 22,24
0105; 00020025001a00070009    ; Flat Shaded Triangle, Palette:37  Vertices: 26,7,9
0106; 00010025001a0009    ; Line, Palette:37  Vertices: 26,9
0107; 0000    ;
0108; ffffffff    ;
0109; 003f000400f2    ;  If 003f (Time??) test(4), Jump to line 147
0110; 00620000018b000001be    ; Vertex :0  X=395  Y=0  Z=446
0111; 0068ff41fd6a    ; Vertex :1  X=204  Y=0  Z=-216
0112; 006800e20132    ; Vertex :2  X=430  Y=0  Z=90
0113; 0068ff060028    ; Vertex :3  X=180  Y=0  Z=130
0114; 00680320005a    ; Vertex :4  X=980  Y=0  Z=220
0115; 0068fd62feb6    ; Vertex :5  X=310  Y=0  Z=-110
0116; 0068fb96ff38    ; Vertex :6  X=-820  Y=0  Z=-310
0117; 006804baff88    ; Vertex :7  X=390  Y=0  Z=-430
0118; 0068fafdff8a    ; Vertex :8  X=-893  Y=0  Z=-548
0119; 006806d40495    ; Vertex :9  X=855  Y=0  Z=625
0120; 0068ffcd00a6    ; Vertex :10  X=804  Y=0  Z=791
0121; 0066fa92    ; Vertex :11  X=804  Y=0  Z=-599
0122; 0068ffa202cf    ; Vertex :12  X=710  Y=0  Z=120
0123; 00680004fbd8    ; Vertex :13  X=714  Y=0  Z=-944
0124; 0064fc44    ; Vertex :14  X=-242  Y=0  Z=-944
0125; 00680488072d    ; Vertex :15  X=918  Y=0  Z=893
0126; 0068000df920    ; Vertex :16  X=931  Y=0  Z=-867
0127; 0068fa4506ad    ; Vertex :17  X=-536  Y=0  Z=842
0128; 0068ff70f9b4    ; Vertex :18  X=-680  Y=0  Z=-770
0129; 0068003c044c    ; Vertex :19  X=-620  Y=0  Z=330
0130; 0068ffc800c1    ; Vertex :20  X=-676  Y=0  Z=523
0131; 0068ff1aff67    ; Vertex :21  X=-906  Y=0  Z=370
0132; 006801f0fdbc    ; Vertex :22  X=-410  Y=0  Z=-210
0133; 006804e400ac    ; Vertex :23  X=842  Y=0  Z=-38
0134; 006800a602f0    ; Vertex :24  X=1008  Y=0  Z=714
0135; 0068fe5efb38    ; Vertex :25  X=590  Y=0  Z=-510
0136; 0068fc5efee8    ; Vertex :26  X=-340  Y=0  Z=-790
0137; 00680064008c    ; Vertex :27  X=-240  Y=0  Z=-650
0138; 0068036effa6    ; Vertex :28  X=638  Y=0  Z=-740
0139; 0068fbac04b0    ; Vertex :29  X=-470  Y=0  Z=460
0140; 0061001e0000    ;
0141; 00020022000000050003    ; Flat Shaded Triangle, Palette:34  Vertices: 0,5,3
0142; 0071000300070001    ; Flat Shaded Triangle, Palette:34  Vertices: 3,7,1
0143; 00720009000a000f0018    ; Flat Shaded Quad, Palette:34  Vertices: 9,10,15,24
0144; 00720011001d00130014    ; Flat Shaded Quad, Palette:34  Vertices: 17,29,19,20
0145; 007100040017000c    ; Flat Shaded Triangle, Palette:34  Vertices: 4,23,12
0146; 0071001a001b000e    ; Flat Shaded Triangle, Palette:34  Vertices: 26,27,14
0147; 0000    ;
0148; ffff    ;
0149; 002000200020    ;

 

lib_col.png

In this picture, I replace the TAW 1400 palette with libya.col, but the result is a bit a apocalyptic.

By the way, those contrails look amazing in motion.:thumbsup:

Share this post


Link to post
Share on other sites

Oh, the “ground is drawn via background color” approach. I know this one from the first Ace Combat. This will take me some time because the ground does not always fill the screen up to the horizon.

BTW you can display 3View’s run-time interpretation of the bytecode by hitting F12 (or was it F10/F11?) and looking at the console window.

Share this post


Link to post
Share on other sites

Maybe you don't need to worry about the horizon so much since it's mainly obscured by fog.

Just fired up the real TFX. It's quite painful in a 640x400 window.
realtfx.png

Share this post


Link to post
Share on other sites

Fantastic job :thumbsup:

I am hoping to figure a way to convert the maps to something tfx3 usable in one of our terrain editors. The concern with the background color feature in tfx1 is a real one, nevertheless you've given us a wide collection of new maps to play around with. :)

Share this post


Link to post
Share on other sites

Always things to do. :)

Now I'm wondering why I don't see any buildings at the airbase on Malta that I landed at. It has plenty according to this guy's video:

I need to open the airbase ssd in 3View, but I'm having trouble understanding how it sorts out its paths for palettes etc when opening TFX1 items.

Share this post


Link to post
Share on other sites

3View treats the TFX1 .3 files as TFX2, but opens the vast majority of them OK. I can't find a texture list for TFX1, but I created a dummy init3d.txt file to put the half a dozen or so unidentified textures in. With some trial and error, I've found 3 of the first 4 textures in the list.
efpit.png

I'm not getting much joy using 3View for opening ssds, although maybe that's only implemented for TFX3?

I still don't know why there are no buildings visible on that airbase although all the shapes can be individually loaded in 3View.
The only significant ssd difference from TFX2 is that there is no Block5.

 

;File ;36_rway1.ssd
;Size ;2006

;Block1   0   10
;Block2   10   0
;Block3   10   120
;Block4   130   114
;Block5   244   0
;Block6   244   164
;Block7   408   118
;Block4_Pointer_1   526   162
;Block4_Pointer_2   688   406
;Block4_Pointer_3   1094   10
;Block4_Pointer_4   1104   10
;Block4_Pointer_5   1114   10
;Block4_Pointer_6   1124   20
;Block4_Pointer_7   1144   16
;Block4_Pointer_8   1160   12
;Block4_Pointer_9   1172   20
;Block4_Pointer_10   1192   16
;Block4_Pointer_11   1208   12
;Block4_Pointer_12   1220   20
;Block4_Pointer_13   1240   16
;Block4_Pointer_14   1256   12
;Block4_Pointer_15   1268   20
;Block4_Pointer_16   1288   16
;Block4_Pointer_17   1304   12
;Block4_Pointer_18   1316   20
;Block4_Pointer_19   1336   16
;Block4_Pointer_20   1352   12
;Block4_Pointer_21   1364   20
;Block4_Pointer_22   1384   16
;Block4_Pointer_23   1400   12
;Block4_Pointer_24   1412   20
;Block4_Pointer_25   1432   16
;Block4_Pointer_26   1448   12
;Block4_Pointer_27   1460   20
;Block4_Pointer_28   1480   16
;Block4_Pointer_29   1496   12
;Block4_Pointer_30   1508   20
;Block4_Pointer_31   1528   16
;Block4_Pointer_32   1544   12
;Block4_Pointer_33   1556   20
;Block4_Pointer_34   1576   16
;Block4_Pointer_35   1592   12
;Block4_Pointer_36   1604   20
;Block4_Pointer_37   1624   16
;Block4_Pointer_38   1640   12
;Block4_Pointer_39   1652   20
;Block4_Pointer_40   1672   16
;Block4_Pointer_41   1688   12
;Block4_Pointer_42   1700   20
;Block4_Pointer_43   1720   16
;Block4_Pointer_44   1736   12
;Block4_Pointer_45   1748   20
;Block4_Pointer_46   1768   16
;Block4_Pointer_47   1784   12
;Block4_Pointer_48   1796   20
;Block4_Pointer_49   1816   16
;Block4_Pointer_50   1832   12
;Block4_Pointer_51   1844   20
;Block4_Pointer_52   1864   16
;Block4_Pointer_53   1880   12
;Block4_Pointer_54   1892   4
;Block4_Pointer_55   1896   6
;Block4_Pointer_56   1902   104
;Lab_Block   2006   0

;Block1 Starts 0 Length.10

281ae803ca01ffff3914

;Block2 Starts 10 Length.0

 

;Block3 Starts 10 Length.120

000000005802;    X=0        Y=0        Z=600
00000000a8fd;    X=0        Y=0        Z=-600
07010000ab00;    X=263        Y=0        Z=171
0000000038ff;    X=0        Y=0        Z=-200
00000000c800;    X=0        Y=0        Z=200
ecfe00001e00;    X=-276        Y=0        Z=30
95ff0000a4fe;    X=-107        Y=0        Z=-348
e6fe0000fcfe;    X=-282        Y=0        Z=-260
8c01000060ff;    X=396        Y=0        Z=-160
af0000003e03;    X=175        Y=0        Z=830
780200005d02;    X=632        Y=0        Z=605
e70100005e02;    X=487        Y=0        Z=606
51010000ec00;    X=337        Y=0        Z=236
5e0100003101;    X=350        Y=0        Z=305
f20000000101;    X=242        Y=0        Z=257
eafe0000ce00;    X=-278        Y=0        Z=206
4701000060ff;    X=327        Y=0        Z=-160
96ff0000c300;    X=-106        Y=0        Z=195
95ff0000f3ff;    X=-107        Y=0        Z=-13
780000003903;    X=120        Y=0        Z=825

;Block4 Starts 130 Length.114

3900c5001501df01e301e701eb01f401fb0100020902100215
021e0225022a0233023a023f0248024f0254025d0264026902
720279027e0287028e0293029c02a302a802b102b802bd02c6
02cd02d202db02e202e702f002f702fc0205030c0311031a03
210326032f0336033b033c033e03

;Block5 Starts 244 Length.0


;Block6 Starts 244 Length.164

05000000140f0100000000800000; Object 0 Scale 1 Rot X 0.0 Rot Y -180.0 Rot Z 0.0  MR_MRK18
03000100150f; Object 1  MR_MRK36
03000200160f; Object 2  MR_BS1
03000300170f; Object 3  AIRTWR3
03000400180f; Object 4  MR_RWY
03000500180f; Object 5  MR_RWY
03000600190f; Object 6  HANG1_10
030007001a0f; Object 7  HANGA1
03000800190f; Object 8  HANG1_10
030009001a0f; Object 9  HANGA1
03000a00ac0e; Object 10  XDISH1
03000b00f00e; Object 11  WAREH10
03000c00f00e; Object 12  WAREH10
03000d001b0f; Object 13  OIL_TNK1
03000e001c0f; Object 14  OIL_CYL1
03000f00cf0d; Object 15  B_LONG1
030010001d0f; Object 16  HANG2_5
030011001a0f; Object 17  HANGA1
030012001a0f; Object 18  HANGA1
030013001a0f; Object 19  HANGA1
03001400b20e; Object 20  GLOBE_5
03001500d60d; Object 21  SMOKE_5
03001600d70d; Object 22  SMOKE_10
03001700be0e; Object 23  FIRE_1
03001800b40e; Object 24  FIRE_5
03001900bf0e; Object 25  FIRE_10

;Block7 Starts 408 Length.118

1b001500060000000100030cfeff05001b0016000600000001
00030cfeff05001b001700060000000100030cfeff05001b00
1800060000000100030cfeff05001b00190006000000010003
0cfeff050014000a000700000001000312feff0400fbff0a00
0000030000000000ff7f13000200b2020000

;Block4_Pointer_1 Starts 526 Length.162

080000000000080001000100070002004a000300020015004a
000400030015004a000500040015004a000600050015004a00
0700060015004a000800070015004a000900080015004a000a
00090015004a000b000a0015004a000c000b0015004a000d00
0c0015004a000e000d0015004a000f000e0015004a0010000f
0015004a001100100015004a001200110015004a0013001200
15004a001400130015000000
;Formatting aborted due to opcode :4a00

;Block4_Pointer_2 Starts 688 Length.406

5100c4fff6ff18fc3c000100e8030300540251021c00d8fffb
ff44fd28000100a8fd03001c00d8fffbff580228000100bc02
03001c00d8fffbffe0fc28000100200301001c00c4fff6ff18
fc3c000100e80302004100e000edff8d003b010000c5000400
a800b1004100c0fee7ff070017ff000036000500b600bf0041
0084fff6ff96fea6ff0000b4fe0600c400cd004100bbfee7ff
e6fe12ff000015ff0700d200db0041007b01f6ff52ff9d0100
0070ff0800e000e9004100aa00f8ff3403b700000047030900
ee00f70041004a02edff4702a502000073020a00fc00050141
00b901edff49021402000075020b000a01130141002f01efff
cc006f0100000c010c001801210141005101e0ff2701680100
003b010d0026012f014100ea00f9ffe500fa0000001f010e00
34013d014100b6feebffb7001aff0000e4000f0042014b0141
003601f6ff53ff5801000071ff100050015901410085fff6ff
b600a7ff0000d40011005e016701410085fff6ffe6ffa7ff00
00040012006c01750141006800e9ff29038800000049031300
7a0183010000
;Formatting aborted due to opcode :5100

;Block4_Pointer_3 Starts 1094 Length.10

02003e0002006c000000
;Formatting aborted due to opcode :0200

;Block4_Pointer_4 Starts 1104 Length.10

020099000200f7000000
;Formatting aborted due to opcode :0200

;Block4_Pointer_5 Starts 1114 Length.10

02002401020002000000
;Formatting aborted due to opcode :0200

;Block4_Pointer_6 Starts 1124 Length.20

1b00030008000000060008000100030cfeff0500

;Block4_Pointer_7 Starts 1144 Length.16

0d00e000edff8d003b010000c5000000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_8 Starts 1160 Length.12

4f0007010000ab0003000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_9 Starts 1172 Length.20

1b0006000800000006000b000100030cfeff0500

;Block4_Pointer_10 Starts 1192 Length.16

0d00c0fee7ff070017ff000036000000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_11 Starts 1208 Length.12

4f00ecfe00001e0003000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_12 Starts 1220 Length.20

1b0007000800000006000e000100030cfeff0500

;Block4_Pointer_13 Starts 1240 Length.16

0d0084fff6ff96fea6ff0000b4fe0000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_14 Starts 1256 Length.12

4f0095ff0000a4fe03000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_15 Starts 1268 Length.20

1b00080008000000060011000100030cfeff0500

;Block4_Pointer_16 Starts 1288 Length.16

0d00bbfee7ffe6fe12ff000015ff0000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_17 Starts 1304 Length.12

4f00e6fe0000fcfe03000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_18 Starts 1316 Length.20

1b00090008000000060014000100030cfeff0500

;Block4_Pointer_19 Starts 1336 Length.16

0d007b01f6ff52ff9d01000070ff0000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_20 Starts 1352 Length.12

4f008c01000060ff03000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_21 Starts 1364 Length.20

1b000a0008000000060017000100030cfeff0500

;Block4_Pointer_22 Starts 1384 Length.16

0d00aa00f8ff3403b700000047030000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_23 Starts 1400 Length.12

4f00af0000003e0309000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_24 Starts 1412 Length.20

1b000b000800000006001a000100030cfeff0500

;Block4_Pointer_25 Starts 1432 Length.16

0d004a02edff4702a502000073020000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_26 Starts 1448 Length.12

4f00780200005d0203000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_27 Starts 1460 Length.20

1b000c000800000006001d000100030cfeff0500

;Block4_Pointer_28 Starts 1480 Length.16

0d00b901edff49021402000075020000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_29 Starts 1496 Length.12

4f00e70100005e0203000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_30 Starts 1508 Length.20

1b000d0008000000060020000100030cfeff0500

;Block4_Pointer_31 Starts 1528 Length.16

0d002f01efffcc006f0100000c010000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_32 Starts 1544 Length.12

4f0051010000ec0003000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_33 Starts 1556 Length.20

1b000e0008000000060023000100030cfeff0500

;Block4_Pointer_34 Starts 1576 Length.16

0d005101e0ff2701680100003b010000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_35 Starts 1592 Length.12

4f005e010000310103000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_36 Starts 1604 Length.20

1b000f0008000000060026000100030cfeff0500

;Block4_Pointer_37 Starts 1624 Length.16

0d00ea00f9ffe500fa0000001f010000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_38 Starts 1640 Length.12

4f00f2000000010103000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_39 Starts 1652 Length.20

1b00100008000000060029000100030cfeff0500

;Block4_Pointer_40 Starts 1672 Length.16

0d00b6feebffb7001aff0000e4000000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_41 Starts 1688 Length.12

4f00eafe0000ce0003000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_42 Starts 1700 Length.20

1b0011000800000006002c000100030cfeff0500

;Block4_Pointer_43 Starts 1720 Length.16

0d003601f6ff53ff5801000071ff0000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_44 Starts 1736 Length.12

4f004701000060ff03000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_45 Starts 1748 Length.20

1b0012000800000006002f000100030cfeff0500

;Block4_Pointer_46 Starts 1768 Length.16

0d0085fff6ffb600a7ff0000d4000000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_47 Starts 1784 Length.12

4f0096ff0000c30003000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_48 Starts 1796 Length.20

1b00130008000000060032000100030cfeff0500

;Block4_Pointer_49 Starts 1816 Length.16

0d0085fff6ffe6ffa7ff000004000000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_50 Starts 1832 Length.12

4f0095ff0000f3ff03000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_51 Starts 1844 Length.20

1b00140008000000060035000100030cfeff0500

;Block4_Pointer_52 Starts 1864 Length.16

0d006800e9ff29038800000049030000
;Formatting aborted due to opcode :0d00

;Block4_Pointer_53 Starts 1880 Length.12

4f0078000000390303000000
;Formatting aborted due to opcode :4f00

;Block4_Pointer_54 Starts 1892 Length.4

10000000
;Formatting aborted due to opcode :1000

;Block4_Pointer_55 Starts 1896 Length.6

490000000000
;Formatting aborted due to opcode :4900

;Block4_Pointer_56 Starts 1902 Length.104

0b0003009001
0b000400fa00
0b000500fa00
0b000600fa00
0b000700fa00
0b000800fa00
0b000900fa00
0b000a00fa00
0b000b00fa00
0b000c00fa00
0b000d00fa00
0b000e00fa00
0b000f00fa00
0b001000fa00
0b001100fa00
0b001200fa00
0b001300fa00
0000

;Lab_Block Starts 2006 Length.0

Share this post


Link to post
Share on other sites
4 hours ago, mikew said:

I still don't know why there are no buildings visible on that airbase although all the shapes can be individually loaded in 3View.
The only significant ssd difference from TFX2 is that there is no Block5.

My first guess has to do with state. It appears to me that each building shape has 3 Block4 pointers with 3 opcodes: 1b00, 0d00 and 4f00. 1b00 manipulates the shape w.r.t. parameter 7, 4f00 assigns the collision explosion, 0d00 is unknown and I don't believe TFXplorer recognizes it for any of the building shapes...

Share this post


Link to post
Share on other sites
15 hours ago, mikew said:

3View treats the TFX1 .3 files as TFX2, but opens the vast majority of them OK. I can't find a texture list for TFX1, but I created a dummy init3d.txt file to put the half a dozen or so unidentified textures in. With some trial and error, I've found 3 of the first 4 textures in the list.
efpit.png

Fantastic! In case you have problems with the format conversion: You can copy a SPR image via Lean Viewer, then paste it into an image manipulation program of your choice. This destroys the palette, though (I can work around this if it’s a matter).

15 hours ago, mikew said:

I'm not getting much joy using 3View for opening ssds, although maybe that's only implemented for TFX3?

Due to time restrictions, I always only implemented the bare minimum to get the original game working. I have to work my way through the other files. Please give me a list of the most urgent cases so I can prioritize.

15 hours ago, mikew said:

I still don't know why there are no buildings visible on that airbase although all the shapes can be individually loaded in 3View.
The only significant ssd difference from TFX2 is that there is no Block5.

I need to take a look in the debugger (too long ago to have an idea right away).

Share this post


Link to post
Share on other sites

In that cockpit picture, it's .tm files we're dealing with, not .spr....or rather files with unknown names of exactly 49152 bytes which behave like .tm files when combined with a TFX1 palette.

It's been a long time since I looked at ssd/3 bytecode level as well, but will need to do that (as DKD suggests) in order to give recommendations for 3View/TFXplorer.

One comment though, is that I can't open a TFX3 ssd file with the 3View that gets built with the latest source, but I can with a much older version from 2012 that I happened to have on the PC. No version can handle TFX2 ssd files that I can see.
Can I run 3View separately in Visual Studio debugger? If I press the start butten, it starts TFXplorer.

Share this post


Link to post
Share on other sites

In the Solution Explorer, right-click 3View and select “Set as Startup Project”.

Very interesting to hear about the unknown TMs. I was looking for anything that could be a texture list in the unknown files, but my search turned out empty. Whatever you find in that direction, tell me and I can implement it in 3View/TFXplorer.

Please tell me the name of the SSD that doesn’t load with the current version and I’ll investigate …

Share this post


Link to post
Share on other sites

It's all ssds that I've tried, but as an example I know luxor.ssd works with the old version.

EDIT:
Thanks for the VS tip. This doesn't mean much to me though...

Exception thrown at 0x000000013FDCD968 in 3View x64.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000000000073000).
Unhandled exception at 0x000000013FDCD968 in 3View x64.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000000000073000).

 

vs_error.png

Share this post


Link to post
Share on other sites

Oh, that’s a mean one. We ran out of stack space (it doesn’t grow infinitely). Right-click 3View -> Properties -> Linker -> System -> Stack Reserve Size -> enter 2000000

I think that fix is already done in the 32-bit versions, but since I never distributed a 64-bit version of 3View, I missed that one.

There are other issues as well; I’m checking them now.

Update: Two more crashes: Go to TFX Supershape.cpp (1456) and change the initial value of “greatestDistance” from 0.0f to -1.0f. Do the same in line 1553.

Otherwise, while sorting the shapes by distance for rendering, no closest shape would ever be chosen if the viewer is exactly at the center. And that’s the next issue: For some reason, you’re always placed in the center. I’m at it.

Share this post


Link to post
Share on other sites

If anything, I'm placed underneath the centre, so for an airbase like Luxor, I can alter the angle to look up at objects.

Share this post


Link to post
Share on other sites

Yes, I meant the origin, not the center.

ThreeView SupershapeSession.cpp (83): Replace with

auto const worldToEye = computeWorldToEye();

Replace the call in line 91 with:

		supershape.prepareEntireRasterization(
			shapeRasterizeJobs.toEnd,
			timeOfDay,
			zeroParameters,
			rotationOf(worldToEye),
			1.0f,
			transformed(offsetOf(worldToEye), transposed(rotationOf(worldToEye)))
		);

 

Share this post


Link to post
Share on other sites

Great!

For the airbases:
TFX3 luxor.ssd opens OK and all objects visible
TFX2 bardu.ssd opens OK and all objects visible
TFX1 36_rway1.ssd opens OK, but I see exactly the same as the screenshot above, ie not seeing any buildings.
That gives something to work with.

Ship ssds don't work, but their associated 3 files open OK.

Share this post


Link to post
Share on other sites

Could there be a rendering order issue?

From the shape header, TFX1 seems to follow the same format as TFX3, ie most positive rendered first, but the control tower has a value of zero, whereas in TFX3, buildings tend to have a negative value for that parameter:
ffba0fa0000000007fff000000000000 0000 0000000200030003 :TFX1 airtwr (control tower)
fed40190000000007fff000000000000 0bb8 0000000200030003 :TFX1 mr_mrk46 (runway end)
fc220bb80fa03e80000000007fff0000 1388 0000000000000002 :TFX1 mr_bs1 (airport base)

fc001f40000000007fff000000000000 07d0 0000000200030003 :TFX3 terrain
fdd403e81f40000000007fff00000000 03e8 0000000000020003 :TFX3 airport concrete base
fc181770000000007fff000000000000 00fa 0000000200030003 :TFX3 runway
ff830fa0000000007fff000000000000 fe0c 0000000200030003 :TFX3 control tower

Share this post


Link to post
Share on other sites

Well, that's not it, but there's some weird view distance problem.
If I replace the airport base with the control tower shape, it can be seen at the centre of the tile. The only other thing visible is one of the runway ends and only if it is near the camera.
air_mal.png

Share this post


Link to post
Share on other sites

I think DKD was on the right track with the Block4 pointers. I didn't think these were used by TFXplorer, but I guess Block4_pointer_1 must be used in order to display TFX2 airbases properly where shapes are cloned. This is a typical example (bardu.ssd):
07000000
080001000000
080002000100
080003000200
07000400
080005000300
080006000400
080007000500
080008000600
080009000600
08000a000700
08000b000700
08000c000800
08000d000800
080019000900
08001a000900
08000e000a00
08000f000a00
08001b000b00
08001c000b00
080010000c00
080011000d00
080012000e00
080013000f00
080014001000
080016001100
080016001200
080017001300
080017001400
07001800
08001d001500
08001e001500
0000

TFX1 has some new opcodes though (36_rway1.ssd):
080000000000
080001000100
07000200
4a00030002001500
4a00040003001500
4a00050004001500
4a00060005001500
4a00070006001500
4a00080007001500
4a00090008001500
4a000a0009001500
4a000b000a001500
4a000c000b001500
4a000d000c001500
4a000e000d001500
4a000f000e001500
4a0010000f001500
4a00110010001500
4a00120011001500
4a00130012001500
4a00140013001500
0000

It looks like the 4a00 opcode can be treated like 0800 if we ignore the 1500.

Share this post


Link to post
Share on other sites

Yay, that's basically the problem. I edited the ssd file to replace the 4a00 with 0800 and take away the 1500, then padding after the block to maintain file integrity:
air_good.png

Still some minor issues like the runway heading numbers missing, lights etc, but we can worry about that later.

Share this post


Link to post
Share on other sites

Investigating a different crash. Mike, how many LODs does 3\CLOUD2.3 have?

In TFX Shape.cpp (691), please replace

			UCount const numberOfLODs = 1;
			while(0x0000 != *toWord && 0x7FFF != *toWord && Shape::maximalNumberOfLODs > numberOfLODs) {

with

			while(0x0000 != *toWord && 0x7FFF != *toWord && toEndOfLODs < toCapacityEndOf(lods)) {

Because I hard-coded a limit of 4 LODs (TFX 2 and TFX 3 never use more) and the buffer runs over with said file.

Furthermore, in TFX Supershape.cpp (451), replace

				case 0x0014:
				case 0x001A:
				case 0x001B:
				case 0x004A: {

with

				case 0x004A: {
					if(6 > sizeOf(block)) {
						return "file too short";
					}
					struct OffsetObject {
						UInt2B shapeIndex;
						UInt2B positionIndex;
						UInt2B twentyOne;
					};
					auto const & information = read<OffsetObject>(block);

					if(header.numberOfShapes <= information.shapeIndex) {
						return "block 4 pointer 1 opcode 004a: bad shape index";
					}
					if(header.numberOfPositions <= information.positionIndex) {
						return "block 4 pointer 1 opcode 004a: bad position index";
					}
					auto & shape     = block6.shapes[information.shapeIndex];
					auto & newObject = *shapes.toEnd++;
					newObject.indexInShapeList = shape.indexInShapeList;
					newObject.scale            = shape.scale;
					newObject.yaw              = shape.yaw;
					newObject.pitch            = shape.pitch;
					newObject.roll             = shape.roll;
					newObject.xyz              = block3[information.positionIndex];
				} goto readNext;

				case 0x0014:
				case 0x001A:
				case 0x001B: {

which is an ugly copy-paste solution from the block above, but it should work for now :) 

Share this post


Link to post
Share on other sites

cloud1,2,3&4 all crash my parser, and as I'm not using them I've renamed them so TFXplorer doesn't try to load them either.
I'll have a quick look at them manually...
There are some other TFX1 .3 files that cause problems, but I haven't had time to investigate.

Share this post


Link to post
Share on other sites

Weird. The bulk of the file indicates 4 LODs (or different models ending with FFFF) but the header seems to think we have 6.

Share this post


Link to post
Share on other sites

The cloud files should load with the above fixes. At least they shouldn’t crash TFXplorer any more.

Thanks a lot for sorting out the whole stuff. I just checked out Libya in-game, and you did a fantastic job with it!

Regarding the missing run-way numbers … I found them:

36.png

Look a kilometer away!

(Probably a transformation opcode has different meanings in TFX 1 & 3, or variables are initialized differently.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now