Sign in to follow this  
rhumbaflappy

Help with TMF

Recommended Posts

I downloaded the tutorial on TMF-design but I'm having trouble finding the correct values to change.I need to add some land area.With the given coordinates below, what do I need to change in the excample file?include TMFmacros.incinclude CFS2TMFmacros.inc; Mesh-clinging water; ===================================================================; BGL Headerdata_base label word dw 1 ; world set number dd LAT32_N62:19:00.00 ; North Bound dd LAT32_N62:13:00.00 ; South Bound dd LON32_E06:00:00.00 ; East Bound dd LON32_E05:38:00.00 ; West Bound; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - data_start_0 label word FLATTEN_DATA 1, 7, 2, 28, 1, 1, 1 CFS2WATER_POLYGON 4 + 128 FLATTEN_POINT 230, 199 FLATTEN_POINT 236, 193 FLATTEN_POINT 240, 196 FLATTEN_POINT 239, 202 FLATTEN_POINT 244, 202 FLATTEN_POINT 250, 198 FLATTEN_POINT 255, 199 FLATTEN_POINT 251, 207 FLATTEN_POINT 236, 204 data_end_0 label word; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; ===================================================================; TERRAIN FLATTEN POLYGON LIST flatten_list label word FLATTEN_LIST 1, flatten_groups flatten_groups label word FLATTEN_GROUP 189, 437, flatten_data, data_start_0, data_end_0; ===================================================================; FLATTEN_ENDflatten_end label word; ===================================================================

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi knnygar.First, you need to find the lat-long of the points exactly, so you can use fsregen's TMF Calculator to locate the FLATTEN_GROUP numbers, and the flatten_data numbers, as well as the point numbers.Slew to the points, and use the calculator to get the numbers... actually cut'n'paste from the calculator.Assuming the points have the same FLATTEN_GROUP numbers ( LOD8 CELL ), you'll need to see if the points all have the same flatten_data numbers ( LOD13 DATA AREA ).If this all works out, split the shape into 2 convex polys, because the shape is too concave.Don't feel alone if you're confused. Lot's of experienced designers are confused with this, right now.The best way to get used to the process is to use the tutorial to recompile the examples. When successful, move the examples around the world a bit by changing the data or group numbers. Then add a point... or make 2 polys. Then make 2 polys in adjacent data areas... then different group areas.... If you jump in without getting used to the spatial oddities and terminology, you'll get lost.Dick

Share this post


Link to post
Share on other sites

I have FSregen 0.20b, but i cant find a TMF-calculator :-(I have tried to calculate the LOD-grid using Terrain SDK from Microsoft.This is north, south, east, west:LOD135673, 5663, 410, 384LOD8178, 176, 13, 12Do I use these values or the coordinates?

Share this post


Link to post
Share on other sites

I have tried to make a land square, but it doesnt workThe coordinates are N62*29.78 E5*39.12I have used the TMF-calculator.Whats wrong with this?include TMFmacros.incinclude CFS2TMFmacros.inc; Mesh-clinging water; ===================================================================; BGL Headerdata_base label word dw 1 ; world set number dd LAT32_N63:00:00.0 ; North Bound dd LAT32_N61:00:00.0 ; South Bound dd LON32_E08:00:00.0 ; East Bound dd LON32_E04:00:00.0 ; West Bound dd 0 ; VOR data dw 0 ; lowest VOR freq dw 0 ; highest VOR freq dd 0 ; seeds level 8 data dd 0 ; seeds level 9 data dd 0 ; seeds level 10 data dd 0 ; seeds level 11 data dd 0 ; seeds level 12 data dd 0 ; traffic data dd 0 ; minimum safe altitude data dd terrain_data - data_base ; terrain mesh data dd 0 ; object data dd 0 ; library data dd 0 ; facilities data dd 0 ; anchor point data dd 0 ; ATIS data dd 0 ; NDB data dd 0 ; dynamic object paths data dd 0h,0h ; minimum library id dd 0h,0h ; maximum library id dd 0 ; miscellaneous data dd 0 ; title and description data dd 0 ; magnetic variation data dd 0 ; exception and exclusion data dd 87654321h ; magic number dd 0 ; compression switch dw 0 ; spare dd 0h,0h,0h,0h ; GUID dd 0 ; product id dd 0 ; product build number dd 0 ; new facility data pointers dd 0 ; new facility name list data dd 0 ; new facility band list data dd 0 ; new facility data; ===================================================================; TERRAIN_Headerterrain_data label word dd terrain_header_end - terrain_data ; end of terrain header dd 514 ; version dd 0 ; unknown entry dd 0 ; unknown entry dd 0 ; elevation header dd 0 ; land class header dd 0 ; unknown header dd 0 ; class lookup header dd 0 ; season header dd 0 ; class lookup list dd 0 ; water class header dd 0 ; elevation index dd 0 ; land cover index dd 0 ; unknown index dd flatten_header - terrain_data ; flatten polygon header dd 0 ; decal header dd 0 ; reserved dd 0 ; reserved dd 0 ; main terrain data dd 0 ; reserved dd 0 ; reserved dd 0 ; reserved dd 0 ; regions header dd 0 ; reserved dd 0 ; reservedterrain_header_end label word; ===================================================================;FLATTEN_DATA ,0, 1, 7, , , ;FLATTEN_POINT 216, 114;FLATTEN_GROUP 78, 396, flatten_data, data_start_0, data_end_0; Terrain Flatten Headerflatten_header label word FLATTEN_HEADER 256, flatten_list, flatten_data, flatten_end; TERRAIN FLATTEN POLYGON DATAflatten_data label word; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - data_start_0 label word FLATTEN_DATA 1, 0, 1, 7, 1, 1, 1 CFS2WATER_POLYGON 4 + 128 FLATTEN_POINT 1, 1 FLATTEN_POINT 255, 1 FLATTEN_POINT 255, 255 FLATTEN_POINT 1, 255; FLATTEN_POINT 244, 202; FLATTEN_POINT 250, 198; FLATTEN_POINT 255, 199; FLATTEN_POINT 251, 207; FLATTEN_POINT 236, 204 data_end_0 label word; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; ===================================================================; TERRAIN FLATTEN POLYGON LIST flatten_list label word FLATTEN_LIST 1, flatten_groups flatten_groups label word FLATTEN_GROUP 78, 396, flatten_data, data_start_0, data_end_0; ===================================================================; FLATTEN_ENDflatten_end label word; ===================================================================; ===================================================================

Share this post


Link to post
Share on other sites

Hi Knnygar.Your code was perfect!I first used txt2asm.exe to produce the correct ASM file. Then, I compiled it, placed it in a scenery folder structure named "waterfill" and loaded it into the Scenery Library. I mapped my plane to the coordinates... and it didn't show!!!After a few tries of playing with the code, the truth finally revealed itself.There is no landclass under the water to switch on.I made a small landclass BGL, using Landclass Assistant by John Cillis ( AVSIM file library ), and renamed it aalandclass.bgl ( because the "data stream" has alphabetical priority in the same scenery folder ). I placed it in the "waterfill" scenery folder, with your BGL.I restarted FS2002, and the quadrant was land! When you do this, you'll see a good example of the shape of the quadrant being narrowly rectangular at your higher latitude... they are square at the Equator.So we both learned something here, and how to fix it. The nice part is you can decide whatever landclass you'd like to make for your island. It may be that placing a VTP Method2 polygon ( FS2002-style decal ) may also produce land. That eliminates the need for a landclass BGL... in fact, the SDK indicates that both the VTP polygon and the LWM landfill may exist in the same BGL ( but that's another lesson for us both ). And that VTP Method2 poly ( decal ) may have a custom texture, if desired.I'll be writing a newer tutorial soon, that will use Microsoft's newer terminology, with newer macros that reflect those names. I just need a little correspondence with Christian Stock to solidify the macros.Don't worry, whatever you learn now, will be easily translated to the newer code. In fact, I like the new terms and code better. And C language devotees should be able to use the SDK's structure examples to make BGLs with C language, and still use my newer tutorial.Dick

Share this post


Link to post
Share on other sites

By the way Dick, the U.S. Navy just called about you fixing the "big ditch". It seems one of their submarines is now stuck and need you to put the ditch back. They may be visiting you right now, watch for guys in uniforms, and bandanas, saying things like, AVAST Matey, Yo-Ho-Ho, and Shiver Me Timbers!:-lol

Share this post


Link to post
Share on other sites

Hi Knnygar.I'll bet that area has landclass... MS just had data that was a little "rough" for that area. You're on th right track. Try to place whole LOD13 land rectangles over that area, now.Dick

Share this post


Link to post
Share on other sites

Yes, it worked :-)I have found the coordinates, but do I need to make polygons from each of the grids?I have attached a picture with the LOD13-grids and the area I'm working on.

Share this post


Link to post
Share on other sites

Hi Knnygar.The shorelines ( beaches ) can be removed later. You should trim the water and land first. Dick

Share this post


Link to post
Share on other sites

When I tried to combine more than one grid FS crashed :-(This is supposed to be a strip of water to separate a island from the mainland: dd 0 ; reservedterrain_header_end label word; ===================================================================; Terrain Flatten Headerflatten_header label word FLATTEN_HEADER 513, flatten_list, flatten_data, flatten_end; TERRAIN FLATTEN POLYGON DATAflatten_data label word; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - data_start_0 label word FLATTEN_DATA 1, 3, 3, 23, 1, 1, 1; CFS2WATER_POLYGON 3 FLATTEN_POLYGON 15, 0, 0 FLATTEN_POINT 25, 255 FLATTEN_POINT 48, 241 FLATTEN_POINT 54, 198 FLATTEN_POINT 6, 208 FLATTEN_POINT 4, 177 FLATTEN_POINT 17, 167 FLATTEN_POINT 121, 169 FLATTEN_POINT 133, 108 FLATTEN_POINT 71, 77 FLATTEN_POINT 255, 94 FLATTEN_POINT 255, 139 FLATTEN_POINT 67, 212 FLATTEN_POINT 67, 241 FLATTEN_POINT 236, 229 FLATTEN_POINT 242, 255 data_end_0 label word;--------- data_start_1 label word FLATTEN_DATA 1, 3, 3, 24, 1, 1, 1; CFS2WATER_POLYGON 9 FLATTEN_POLYGON 11, 0, 0 FLATTEN_POINT 0, 109 FLATTEN_POINT 9, 111 FLATTEN_POINT 34, 78 FLATTEN_POINT 0, 19 FLATTEN_POINT 25, 0 FLATTEN_POINT 242, 0 FLATTEN_POINT 25, 104 FLATTEN_POINT 186, 197 FLATTEN_POINT 122, 247 FLATTEN_POINT 75, 255 FLATTEN_POINT 0, 255 data_end_1 label word; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; ===================================================================; TERRAIN FLATTEN POLYGON LIST flatten_list label word FLATTEN_LIST 2, flatten_groups flatten_groups label word FLATTEN_GROUP 78, 396, flatten_data, data_start_0, data_end_0; ===================================================================; FLATTEN_ENDflatten_end label word; ===================================================================; ===================================================================

Share this post


Link to post
Share on other sites

Your problem may be here:; ===================================================================; TERRAIN FLATTEN POLYGON LISTflatten_list label wordFLATTEN_LIST 2, flatten_groupsflatten_groups label wordFLATTEN_GROUP 78, 396, flatten_data, data_start_0, data_end_0; ===================================================================Try this:

; ===================================================================; TERRAIN FLATTEN POLYGON LISTflatten_list label wordFLATTEN_LIST 1, flatten_groupsflatten_groups label wordFLATTEN_GROUP 78, 396, flatten_data, data_start_0, data_end_1; ===================================================================

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
Sign in to follow this