Jump to content
COMBATSIM Forum
Krycztij

TFXplorer

Recommended Posts

Yes, I found a quite a few. The problem seems to be the interpretation of the ssd file.

I have changed the original ssd file 'fact.ssd' for new indices, and there are couple of wrong indices at the end of Block 6. Other than that, the old and new versions are the same. In the following picture, the new file is on the left, and the section we are looking at is the transition between Block 4 and Block 6.

I can't remember what the bytes starting with oa 00 are supposed to do.

ssd_blocks.png.65fd457d6cea1f3a5d2db291cc29290d.png

 

 

 

Share this post


Link to post
Share on other sites

Haha, Mike, I’m very sorry for the confusion.

 

If you open TFX Supershape.cpp, and search for ErrorOrNull loadBlock6( around line 500, you will quickly see:

if(0x0003 == type || 0x000b == type || 0x0013 == type) { // TODO: what does 000B mean? (TFX2 lost worlds, e.g. FACT.SSD)

I didn’t know what it means and just assumed it was <block 5 index> <shape index>. Same for 0003, which you use. So it clearly is my fault :D

 

Please suggest how exactly the file should be handled, especially 0003 and 000b …

 

Edit: There are two problems here.

  1. my code mis-calculates the beginning of block 6 by -6 bytes, and reads the 000b marker as index 0002 for the first shape.
  2. my block 6 in fact.ssd looks different from the one you posted above.

image.png.4442c33147327956c1e5978f3864733a.png

 

Edit: Mike, change the above line to

if(0x0003 == type || 0x0013 == type) {

(i.e. remove the 0x000b check), then search for

if(0x007A == marker) {
  
}

and change it to

if(0x007A == marker) {
	
} else if(0x000b == marker) {
	if(6 > sizeOf(remainingBytes)) {
		return "legacy block 5 too short";
	}
	remainingBytes.toBeginning += 6; // skip 000B 0000 0002
}

This fixes HEAVENLY popping up and it also fixes the missing last shape.

 

Please let me know if this fix works or if it screws something up. (I must test it before release, and I guess due to your work with TFX 2 you’re better at this than I am. Also, I’m working on other issues right now.)

Share this post


Link to post
Share on other sites

I found my scripts from that time and I think this is a case of getting 95% of the perfect result by only using 5% of the effort required.

It looks like I parsed the TFX1 ssd file to text using roughly TFX2 rules....but without enough analysis of the TFX1 file structure.

I then parsed it again looking for 0300 opcodes to change each shape index. I just jumped over 0a00 and 0b00 lines leaving them as they were.

Why the 2nd parser missed those last two shape indices, I don't know.

Finally, I just reconverted back to binary.

TFXplorer can handle most things, so the end result works quite well.

 

While I'm sure I could reconstruct these TFX1 ssds to make them act like TFX3, it would be good to know exactly what TFXplorer uses so that only the necessary data is included.

 

Share this post


Link to post
Share on other sites
1 hour ago, mikew said:

It looks like I parsed the TFX1 ssd file to text using roughly TFX2 rules....

Please understand that I have worked just a bare minimum with TFX 2, so I don’t fully understand its rules either :) Did you try my fix above? I’d like to give you a compiled version for testing, but I’m having difficulties doing so because I’m amidst major code restructuring …

 

1 hour ago, mikew said:

I just jumped over 0a00 and 0b00 lines leaving them as they were.

Yes, that’s exactly what the fix above should do.

1 hour ago, mikew said:

Why the 2nd parser missed those last two shape indices, I don't know.

At least the last index I can explain: My code falsely assumed the 000b line was part of block 6. It read six bytes too early, and therefore skipped the last six bytes (i.e. the last index) to exactly match block 6 size.

 

1 hour ago, mikew said:

While I'm sure I could reconstruct these TFX1 ssds to make them act like TFX3, it would be good to know exactly what TFXplorer uses so that only the necessary data is included.

I don’t know either; the SSD code is a spaghetti hell :D That’s a 95%-for-5% problem again, so just keep throwing TFX 1 problems at me. I’ll fix the low hanging fruits as I can (improving overall TFX 1 compatibility) and if we find something that cannot be handled at all, we can still fall back to TFX 3 formats.

Share this post


Link to post
Share on other sites

Thanks! That code fixes the sun/stars problem.

I have some holes in the terrain now, but I have some problem with the shape indices that I need to investigate. In 'fact.ssd', shapes 0x17 and 0x18 still had the old indices. That's the only file I've looked at in detail, so I assume there's issues elsewhere.

Your fact.ssd is probably from the extracted TFX2 dataset which is why it has different indices. I'm guessing EF2000 doesn't use it and it's one of the 'padding files' that seems prevalent in that dataset.

Apart from parsing it, not much effort has been put into understanding the TFX2 ssd structure and none at all for TFX1.

 

The yugoslavia map has lots of these pointy things that don't rotate to face the viewer, thus ruining the immersion factor, so there's some work to be done with the TFX1 shape files as well...if we can be bothered.

monoliths.png.8d05a1d03bfde2d2d955f2f43696f3ee.png

 

Share this post


Link to post
Share on other sites

Very pretty! Please tell me the opcode. You can open the .3 file in 3View, then hit one of the F keys (F12?) to dump the execution path to the console.

Share this post


Link to post
Share on other sites

No idea yet, but hit a problem when trying to find out.

After changing that code, 3view now crashes with files that worked OK yesterday. I rebuilt the whole project, so it's probably my fault.

exception.png.8eace6636d655f7c5aa831f55b344e25.png

 

Share this post


Link to post
Share on other sites

Rebuilding the whole project is actually encouraged, because Visual Studio sometimes chokes on incremental building :)

 

The crash means that the supershape does not contain a single shape, i.e. none of its shapes could be loaded. Can you hint me to one of its shapes that should load, but don’t?

Share this post


Link to post
Share on other sites

Ah, now I see it's only the TFX1 ssds that had the sun/stars problem and get "bad object type in block 6" in the console when it freezes.

Share this post


Link to post
Share on other sites

The file fside1.3 is a tile sized shape witha lot of those pointy things.

fside1.png.188a2d24894ba3288796da7d327da250.png

If I try to press F12, I get an assertion violation 'toBeginning <= toEnd' and a crash if I ignore it.

 

Using my 6 year old '3 to text' parser gives me this:



header ;fc000bb83e80000000007fff000000000bb800000000000200030003000000000000000e04c205360536053600000000ffff
0000; 0008000e    ; Jump to Sub at line 4
0001; 003f00400006    ;  If 003f (Time??) test(64), Jump to line 3
0002; 0008017e    ; Jump to Sub at line 51
0003; 0000    ;
0004; 00620000fc00fff90400    ; Vertex :0  X=-1024  Y=7  Z=1024
0005; 00640800    ; Vertex :1  X=1024  Y=7  Z=1024
0006; 0066fc00    ; Vertex :2  X=1024  Y=7  Z=0
0007; 00660200    ; Vertex :3  X=1024  Y=7  Z=512
0008; 0064f800    ; Vertex :4  X=-1024  Y=7  Z=512
0009; 0066fe00    ; Vertex :5  X=-1024  Y=7  Z=0
0010; 00650007    ; Vertex :6  X=-1024  Y=0  Z=0
0011; 00640800    ; Vertex :7  X=1024  Y=0  Z=0
0012; 0068fe58ff9c    ; Vertex :8  X=600  Y=0  Z=-100
0013; 0065fff9    ; Vertex :9  X=600  Y=7  Z=-100
0014; 0068fda800c8    ; Vertex :10  X=0  Y=7  Z=100
0015; 0066039c    ; Vertex :11  X=0  Y=7  Z=1024
0016; 00640200    ; Vertex :12  X=512  Y=7  Z=1024
0017; 0064fc00    ; Vertex :13  X=-512  Y=7  Z=1024
0018; 0068000cfb38    ; Vertex :14  X=-500  Y=7  Z=-200
0019; 00650007    ; Vertex :15  X=-500  Y=0  Z=-200
0020; 006801f4012c    ; Vertex :16  X=0  Y=0  Z=100
0021; 006100110000    ;
0022; 0001003000000001    ; Line, Palette:48  Vertices: 0,1
0023; 0001003000000005    ; Line, Palette:48  Vertices: 0,5
0024; 0001003000010002    ; Line, Palette:48  Vertices: 1,2
0025; 000300300009000200070008    ; Flat Shaded Quad, Palette:48  Vertices: 9,2,7,8
0026; 0072000a000900080010    ; Flat Shaded Quad, Palette:48  Vertices: 10,9,8,16
0027; 0072000e000a0010000f    ; Flat Shaded Quad, Palette:48  Vertices: 14,10,16,15
0028; 00720005000e000f0006    ; Flat Shaded Quad, Palette:48  Vertices: 5,14,15,6
0029; 000200320000000d000a    ; Flat Shaded Triangle, Palette:50  Vertices: 0,13,10
0030; 000200310000000a000e    ; Flat Shaded Triangle, Palette:49  Vertices: 0,10,14
0031; 000200300000000e0004    ; Flat Shaded Triangle, Palette:48  Vertices: 0,14,4
0032; 00710004000e0005    ; Flat Shaded Triangle, Palette:48  Vertices: 4,14,5
0033; 00020032000d000b000a    ; Flat Shaded Triangle, Palette:50  Vertices: 13,11,10
0034; 00020031000b000c000a    ; Flat Shaded Triangle, Palette:49  Vertices: 11,12,10
0035; 00020032000c00010003    ; Flat Shaded Triangle, Palette:50  Vertices: 12,1,3
0036; 0071000c0009000a    ; Flat Shaded Triangle, Palette:50  Vertices: 12,9,10
0037; 00020030000c00030002    ; Flat Shaded Triangle, Palette:48  Vertices: 12,3,2
0038; 00020031000c00020009    ; Flat Shaded Triangle, Palette:49  Vertices: 12,2,9
0039; 003f0040007a    ;  If 003f (Time??) test(64), Jump to line 50
0040; 001a000000300000000c0005    ;
0041; 001a00010031000000030004    ;
0042; 001a00010031000b0009000d    ;
0043; 001a00000030000b00010005    ;
0044; 001a000100320000000a0004    ;
0045; 001a00000030000c0002000a    ;
0046; 001a00010032000000020004    ;
0047; 001a00000030000d000e0000    ;
0048; 001a00010030000c0003000a    ;
0049; 001a00010031000b00010009    ;
0050; 0000    ;
0051; 00620000fd300000ff8d    ; Vertex :0  X=-720  Y=0  Z=-115
0052; 00750000    ;
0053; 004900000e00000000000000000000000000000000000050    ; Vertex 0 , jump to 61
0054; 00620001ff100000ffd5    ; Vertex :1  X=-240  Y=0  Z=-43
0055; 00750001    ;
0056; 00490000eb8000000000000000000000000000000001002a    ; Vertex 1 , jump to 61
0057; 0062000201380000fffd    ; Vertex :2  X=312  Y=0  Z=-3
0058; 00750002    ;
0059; 004900000cc0000000000000000000000000000000020004    ; Vertex 2 , jump to 61
0060; 0000    ;
0061; 00620000ffe30000fffa    ; Vertex :0  X=-29  Y=0  Z=-6
0062; 00750000    ;
0063; 002d000001f8    ; Vertex Test 0 , jump to line 140
0064; 0062000100590000fff5    ; Vertex :1  X=89  Y=0  Z=-11
0065; 00750001    ;
0066; 002d000101e4    ; Vertex Test 1 , jump to line 140
0067; 00620002003d00000001    ; Vertex :2  X=61  Y=0  Z=1
0068; 00750002    ;
0069; 002d000201d0    ; Vertex Test 2 , jump to line 140
0070; 00620003006b00000001    ; Vertex :3  X=107  Y=0  Z=1
0071; 00750003    ;
0072; 002d000301bc    ; Vertex Test 3 , jump to line 140
0073; 0062000bfffb0000fff2    ; Vertex :11  X=-5  Y=0  Z=-14
0074; 0075000b    ;
0075; 002d000b01a8    ; Vertex Test 11 , jump to line 140
0076; 0062000c001f0000fffe    ; Vertex :12  X=31  Y=0  Z=-2
0077; 0075000c    ;
0078; 002d000c0194    ; Vertex Test 12 , jump to line 140
0079; 0062000dffc80000ffe8    ; Vertex :13  X=-56  Y=0  Z=-24
0080; 0075000d    ;
0081; 002d000d0180    ; Vertex Test 13 , jump to line 140
0082; 00620004ffcb00000000    ; Vertex :4  X=-53  Y=0  Z=0
0083; 00750004    ;
0084; 002d0004016c    ; Vertex Test 4 , jump to line 140
0085; 00620005ffb70000fff9    ; Vertex :5  X=-73  Y=0  Z=-7
0086; 00750005    ;
0087; 002d00050158    ; Vertex Test 5 , jump to line 140
0088; 00620009ff840000ffec    ; Vertex :9  X=-124  Y=0  Z=-20
0089; 00750009    ;
0090; 002d00090144    ; Vertex Test 9 , jump to line 140
0091; 0062000affe10000ffe2    ; Vertex :10  X=-31  Y=0  Z=-30
0092; 0075000a    ;
0093; 002d000a0130    ; Vertex Test 10 , jump to line 140
0094; 0062000e00330000ffe1    ; Vertex :14  X=51  Y=0  Z=-31
0095; 0075000e    ;
0096; 002d000e011c    ; Vertex Test 14 , jump to line 140
0097; 00620007007c0000ffde    ; Vertex :7  X=124  Y=0  Z=-34
0098; 00750007    ;
0099; 002d00070108    ; Vertex Test 7 , jump to line 140
0100; 00620008008f00000003    ; Vertex :8  X=143  Y=0  Z=3
0101; 00750008    ;
0102; 002d000800f4    ; Vertex Test 8 , jump to line 140
0103; 00620010000300000003    ; Vertex :16  X=3  Y=0  Z=3
0104; 00750010    ;
0105; 002d001000e0    ; Vertex Test 16 , jump to line 140
0106; 0062000f00b900000002    ; Vertex :15  X=185  Y=0  Z=2
0107; 0075000f    ;
0108; 002d000f00cc    ; Vertex Test 15 , jump to line 140
0109; 0062000600160000ffe8    ; Vertex :6  X=22  Y=0  Z=-24
0110; 00750006    ;
0111; 002d000600b8    ; Vertex Test 6 , jump to line 140
0112; 00620011ff7100000000    ; Vertex :17  X=-143  Y=0  Z=0
0113; 00750011    ;
0114; 002d001100a4    ; Vertex Test 17 , jump to line 140
0115; 00620012ff9a00000002    ; Vertex :18  X=-102  Y=0  Z=2
0116; 00750012    ;
0117; 002d00120090    ; Vertex Test 18 , jump to line 140
0118; 00620013ff4900000004    ; Vertex :19  X=-183  Y=0  Z=4
0119; 00750013    ;
0120; 002d0013007c    ; Vertex Test 19 , jump to line 140
0121; 00620014ff380000ffeb    ; Vertex :20  X=-200  Y=0  Z=-21
0122; 00750014    ;
0123; 002d00140068    ; Vertex Test 20 , jump to line 140
0124; 00620015ffa60000ffd4    ; Vertex :21  X=-90  Y=0  Z=-44
0125; 00750015    ;
0126; 002d00150054    ; Vertex Test 21 , jump to line 140
0127; 00620016ff560000ffc3    ; Vertex :22  X=-170  Y=0  Z=-61
0128; 00750016    ;
0129; 002d00160040    ; Vertex Test 22 , jump to line 140
0130; 00620017ff630000ffe2    ; Vertex :23  X=-157  Y=0  Z=-30
0131; 00750017    ;
0132; 002d0017002c    ; Vertex Test 23 , jump to line 140
0133; 00620018ff1900000002    ; Vertex :24  X=-231  Y=0  Z=2
0134; 00750018    ;
0135; 002d00180018    ; Vertex Test 24 , jump to line 140
0136; 00620019fef50000fff9    ; Vertex :25  X=-267  Y=0  Z=-7
0137; 00750019    ;
0138; 002d00190004    ; Vertex Test 25 , jump to line 140
0139; 0000    ;
0140; 002701900046    ; If Distance >400 then jump to line 152
0141; 006200000000ffec0000    ; Vertex :0  X=0  Y=20  Z=0
0142; 006c00140003    ; Vertex :3  X=0  Y=0  Z=0
0143; 006e0007fffc0002    ; Vertex :2  X=7  Y=4  Z=0
0144; 006bfff20001    ; Vertex :1  X=-7  Y=4  Z=0
0145; 00750000    ;
0146; 00750003    ;
0147; 00750002    ;
0148; 00750001    ;
0149; 00020032000200010000    ; Flat Shaded Triangle, Palette:50  Vertices: 2,1,0
0150; 00020030000300010002    ; Flat Shaded Triangle, Palette:48  Vertices: 3,1,2
0151; 0000    ;
0152; 002703200028    ; If Distance >800 then jump to line 159
0153; 006200000000ffec0000    ; Vertex :0  X=0  Y=20  Z=0
0154; 0067fff90010    ; Vertex :1  X=-7  Y=4  Z=0
0155; 0064000e    ; Vertex :2  X=7  Y=4  Z=0
0156; 006100030000    ;
0157; 00020032000200010000    ; Flat Shaded Triangle, Palette:50  Vertices: 2,1,0
0158; 0000    ;
0159; 002704b00018    ; If Distance >1200 then jump to line 164
0160; 00620003000000000000    ; Vertex :3  X=0  Y=0  Z=0
0161; 00750003    ;
0162; 003400300003    ; Light (Short range): Palette:48  Vertex: 3
0163; 0000    ;
0164; 00620003000000000000    ; Vertex :3  X=0  Y=0  Z=0
0165; 00750003    ;
0166; 003300300003    ; Light (Long range): Palette:48  Vertex: 3
0167; 0000    ;
0168; 0000    ;
0169; ffffffff0062    ;
0170; 0000    ;
0171; fc00    ;
0172; fff9    ;
0173; 0400    ;
0174; 00640800    ; Vertex :4  X=2048  Y=0  Z=0
0175; 0066fc00    ; Vertex :5  X=2048  Y=0  Z=-1024
0176; 0064f800    ; Vertex :6  X=0  Y=0  Z=-1024
0177; 00680658ff9c    ; Vertex :7  X=1624  Y=0  Z=-1124
0178; 0068fda800c8    ; Vertex :8  X=1024  Y=0  Z=-924
0179; 0068fe0cfed4    ; Vertex :9  X=524  Y=0  Z=-1224
0180; 006100070000    ;
0181; 0001003000000001    ; Line, Palette:48  Vertices: 0,1
0182; 0001003000000003    ; Line, Palette:48  Vertices: 0,3
0183; 0001003000010002    ; Line, Palette:48  Vertices: 1,2
0184; 00020030000000060003    ; Flat Shaded Triangle, Palette:48  Vertices: 0,6,3
0185; 0071000000050006    ; Flat Shaded Triangle, Palette:48  Vertices: 0,5,6
0186; 0071000000010005    ; Flat Shaded Triangle, Palette:48  Vertices: 0,1,5
0187; 0071000100020005    ; Flat Shaded Triangle, Palette:48  Vertices: 1,2,5
0188; 0071000500020004    ; Flat Shaded Triangle, Palette:48  Vertices: 5,2,4
0189; 0000    ;
0190; ffff    ;
0191; 002000200020    ;

Maybe those things are not supposed to billboard, although the 0049 opcodes tend to indicate rotation.

Share this post


Link to post
Share on other sites
1 hour ago, mikew said:

Ah, now I see it's only the TFX1 ssds that had the sun/stars problem and get "bad object type in block 6" in the console when it freezes.

 

I see – I was wrong removing the 000b from the condition; sorry. Please go back to the line I asked you to change to

if(0x0003 == type || 0x0013 == type) {

and change it back to

if(0x0003 == type || 0x000b == type || 0x0013 == type) { // TODO: what does 000B mean? (TFX2 lost worlds, e.g. FACT.SSD)

FACT.SSD loads fine for me now.

image.png.8a332790f10121085f7a774d74e7b8a7.png

 

55 minutes ago, mikew said:

Maybe those things are not supposed to billboard, although the 0049 opcodes tend to indicate rotation.

 

I’m absolutely sure they’re meant to be billboards, and they used yaw/pitch/roll not for rotation but for degrees of freedom. Maybe we understood that opcode wrong before. Is 0049 a common opcode in TFX2/TFX3? Do we have expressive sample files from TFX2/3 to compare them to?

Share this post


Link to post
Share on other sites

That's a rather untidy fact.ssd. It should look more like this I think:

fact.png.7fbcd0f235bc1e0d6cac043775bfacd9.png

..but as you see, it loads but the sun is back.

 

I've just run all the TFX1 shape files through my parser, and there are some other problems. It may be best if you carry on with what you were doing and we can come back to this later when I've done some investigation.

 

If you really want to see the 0049 opcode in action, you could try TFX3's logo.3. This rotates around the vertical axis with the 'parameter' setting.

Share this post


Link to post
Share on other sites
22 minutes ago, mikew said:

That's a rather untidy fact.ssd. It should look more like this I think:

fact.png.7fbcd0f235bc1e0d6cac043775bfacd9.png

..but as you see, it loads but the sun is back.

 

I disagree. Apart from the colors, there are only two differences:

  1. no sun
  2. the “untidy” triangles, which could well be terrain shades

so I assume one shape index is wrong, and on your machine it resolves to “sun” while it resolves to “terrain” here. I suggest:

  1. look up all shape indices in your file like your code parses them
  2. check if the terrain is listed – if so, my version is working and I give it to you
  3. if it isn’t listed, tell me whether it’s the first or the last shape index that I screwed up and I’ll check (your parsed code is a great help here; thank you!)

 

22 minutes ago, mikew said:

If you really want to see the 0049 opcode in action, you could try TFX3's logo.3. This rotates around the vertical axis with the 'parameter' setting.

 

I see … so this is an actual case of “in TFX 1 it means degrees of freedom, in TFX 3 it means rotation”. That’s a pity. I’ll put it on my to-do list for a later time. (Do you believe, exactly the same instruction exists in VRML and is on my to-do list for Lean Viewer? :D )

 

22 minutes ago, mikew said:

carry on with what you were doing

 

I’m trying to add a level API for you. It’s mostly about tearing apart very messy 6 years old code and trying to rename that god-like class that is referenced by hundres of others :(

Share this post


Link to post
Share on other sites
20 minutes ago, Krycztij said:

I’m trying to add a level API for you. It’s mostly about tearing apart very messy 6 years old code :(

Please do not be distracted from that. :D

 

Yes, I'm missing those untidy bits of terrain with fact.ssd, but I'm not referencing the sun as far as I can tell.

If you notice, my 3view is going into 'Total Air War' mode. If I run it where my extracted TFX1 files are, it's in EF2000 mode and I see the same as you.

 

Share this post


Link to post
Share on other sites

I was scanning through the few hundred .3 shapes used for TFX1 terrain, and exactly 2 of them have a texture name in the header: GAMESPR.

Since I didn't have this file extracted, with a bit of trial and error I could find it as spr/gamespr.tm and matched it to an unknown file.

I then repacked the combined did.dat with this new file, and was ready to be dazzled by the textured shape.

 

Anyway, it turns out that terrain textures are only used for damage, as far as I can see. There are some other textures referenced by index by other shapes, so it's harder to find the exact texture as I don't have a list...so I probably won't try to find them.

 

Anyway, enjoy!

tfx1_tex.png.5c9493149a5c924f94fdf7ea359a9213.png

Share this post


Link to post
Share on other sites

Perfect detective work; amazing :o

 

Looking at the terrain API, every little TFXplorer feature becomes a major refactoring adventure:

  1. TFXplorer’s moving map is implemented in the F-22 and uses terrain data directly.
  2. It should rather be a function of the terrain engine, because every level should bring its own overview maps.
  3. In order to correctly draw the map to MFDs, you need to define rotation/translation.
  4. There are no 2D vector/matrix structures in the API yet.
  5. So right now I find myself defining a new handle type, ten functions, and the memory layout of 3×2 matrices … because … terrain :D

 

A different example is coordinates.

  1. In the long term, I want to replace 2D terrain coordinates with something spherical.
  2. (We may even want TFX terrains to be flat like we’re used to them, while fancy new terrain is mapped to an Earth sphere.) 
  3. So planes shouldn’t have direct access to global coordinates. They should rather only use local coordinates.
  4. Engine Sounds & Co. use, of course, global coordinates everywhere. (And there are other issues, too. They were introduced even before DKD’s XL terrain …)
  5. So I find myself reworking the SFX API … because … terrain.

 

Talking about local plane coordinates … I guess I finally need to change that coordinate space soon …

 

… and all the issues are rooted in terrain data using different tile sizes than TFX’s strange “4096 · 8 ft” squares.

 

tl;dr: Please don’t expect VRML too soon :(

Share this post


Link to post
Share on other sites

Well, VRML is only a more convenient way to package the types of information already stored in ssd/3.

Much more important to get the overall structure of where you want to go defined in some way.

Share this post


Link to post
Share on other sites
16 hours ago, Krycztij said:
  • In the long term, I want to replace 2D terrain coordinates with something spherical.
  • (We may even want TFX terrains to be flat like we’re used to them, while fancy new terrain is mapped to an Earth sphere.) 
  • So planes shouldn’t have direct access to global coordinates. They should rather only use local coordinates.

I'd far rather work with flat tiles, but it would be good if that flat world was a defined projection from the real world.

The mathematics defeats me though. :(

 

Imagine a square 'cookie cutter' with sides 1200 miles long cutting into the Earth's crust, then hammer flat the resulting piece.

You'd end up with a square-ish shape that you could turn into a perfect square with a bit of mathematical distortion.

This is the 2D world with distances at the centre slightly (I assume you wouldn't notice) stretched and slightly compressed at the edges.

 

We could then treat each tile as we do now, but since it should be possible to calculate the WGS84 coordinates of each tile, it would allow the use of some real world information and the whole thing could be converted back onto a round earth later.

As usual, I'm probably over-simplifying things. :)

 

 

Share this post


Link to post
Share on other sites
56 minutes ago, mikew said:

Imagine a square 'cookie cutter' with sides 1200 miles long cutting into the Earth's crust, then hammer flat the resulting piece.

You'd end up with a square-ish shape that you could turn into a perfect square with a bit of mathematical distortion.

This is the 2D world with distances at the centre slightly (I assume you wouldn't notice) stretched and slightly compressed at the edges.

 

I see no alternative to using square-ish shapes. However, there is no projection of the Earth to square-ish shapes without singularities, and that’s a huge problem.

 

I was thinking about each player using their own square-based coordinate space. So instead of mapping the entire Earth to squares, we just need to map the visible cap below the player (up to the horizon) to squares, which can be done without too much distortion. Whenever a player leaves a square and enters the next one, its squares are re-normalized to match the new cap.

There are two problems, though:

  1. Terrain data must still be available for any point on Earth, and must therefore use a different system. When the player enters a different square, causing a re-normalization of the coordinate space, the entire visible world must be re-projected into the new coordinate space, with new square-ish borders. This is huge and very costly.
  2. If two players meet over network, their coordinate spaces must be synchronized. (Remember Tourmal’s Unity project?) Worst case is 100 F-22’s, each 400 km apart – Earth’s circumference covered by F-22 radars. This means the entire sphere must be mapped and we’re back where we started.

Then there’s the possibility to prevent players from reaching the poles. But distortions start way earlier, TFX 2 takes place high up in the North, and have you seen how many real flight routes cross the polar region (caution, Crackpot site)? 

 

There are just two things I know for sure:

  1. No matter how we solve it, the world coordinate system must be decoupled from vehicle code – and fortunately, that’s almost finished.
  2. I need to read more about the coordinate systems in big simulators like X-plane and FSX. Maybe this will enlighten us …

Share this post


Link to post
Share on other sites

There was a really good document from one of the MSFS developers, which unfortunately I can't find now. Anyway, they basically reset the origin every now and then.

Both FSX and X-Plane are essentially single player games with some multiplayer components which don't involve paths of bullets. They don't have to keep track of the damage state of their theatre either.

 

I was considering that we just have one TAW sized theatre at a time with a local datum at the centre of the 'cookie cutter' which could include a pole, although that would make it harder to get WGS84 coordinates for each tile.  There's probably not a great amount of real world sat that's relevant in those regions though

This would only be used to create the 2D map and a dataset that starts with a TAW level of sparseness.

 

What about Snart View or AWACS mode? Hopping around between different units in the theatre is one of the joys of TAW.

Share this post


Link to post
Share on other sites
47 minutes ago, mikew said:

What about Snart View or AWACS mode? Hopping around between different units in the theatre is one of the joys of TAW.

 

I’m always having that in mind during development. You can open the menu -> View -> Debug -> Tile State and you have a very rough overview of all objects in the scenario (of all tiles having objects on them, actually). Replacing it with an interactive 3D view can be done with moderate time, but first I need to split level description from rendering (i.e. after VRML).

 

We just need to find a good way of expressing SmartView in UI – using F-keys to filter units, without any mouse or joystick support, is very 1994 (but in a bad way). The AWACS overview, in 3D with infinite mouse wheel zoom, would be a great start, I guess.

Share this post


Link to post
Share on other sites

I get 'bad plug-in' errors after running in a new folder (so it shouldn't be confused by existing files)

This is on a win7 64 bit machine.

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

×