Sign in to follow this  
rhumbaflappy

BGLC - Attention

Recommended Posts

I have nearly completed my first pure BGLC airport and will hopefully upload it into the file section later today. I will include the source BGLC files, new include files for MASM/BGLC, and a fairly rough description of how to do it. This should be of interest for people who want to learn how to use the new mesh features (water/flatten polygons and decal polygons).I will hopefully also have some time to test my airspace bgl and wipe out the last bugs. I will also include a source file with some very brief documentation in this file.Watch out for these files, which will hopefully appear today, and if not over next week:Ryans Creek aerodromeNew Zealand airspaceCheers, Christianps: if you can't stand the wait make sure you have already downloaded my MASM howto and are comfortable to generate your own bgls using MASM!!!

Share this post


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

Hello Christian.Thank you for your generous donation of time and knowledge. You are truly a model for freeware contributors.:-beerchug

Share this post


Link to post
Share on other sites

Hi Christian.Just for an experiment, I tried your Ryan's Creek airfield in CFS2.:-lolIt works! And that leads me to an interesting theory about the differences between CFS2 and FS2002:I believe the decals and lakes of CFS2 are either not compressed, or they are using a different compression than FS2002, because the default lakes and decals of FS2002 won't work in CFS2!In fact, the default mesh of FS2002 won't work in CFS2, and has a compression rate of almost 50% smaller filesize than CFS2.Yet, your uncompressed Ryan's Creek works in CFS2.So...I know you don't have CFS2, and it's not of any great interest to you, but...You may be able to decode the lakes and decals of CFS2 more quickly than FS2002, if there is no compression in those CFS2 files. The few lakes in CFS2 aren't flat, but you've already decoded flattening files for FS2002 ( and CFS2 ). CFS2 has streams, roads, and beaches for decals.Just a guess, but examining files from CFS2 may be of some help for you in decoding FS2002.

Share this post


Link to post
Share on other sites

Well, from what you're saying I believe that the decals and flatten polygons of CFS2 and FS2002 are the same. They aren't compressed anyway. I don't understand why the default ones don't work, but my ones do work. As I said there is no compression, my ones look 100% as the default ones...You can actually compare that yourself. Since I included the sources it should be quite easy for you to open up a hex editor and simply compare values. If you have difficulties I can help you.Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian.The 'flt' files of FS2002 work in CFS2 ( as does your Ryan's Creek ).The decals ( 'rdl' 'stl' 'hyl' 'hyp' ) don't work in CFS, yet CFS2 has roads, streams, and lakes with shorelines in select locations... hence my guess about a different coding or compression.The above decals will cause a crash in CFS2 ( terrain.dll ).The base mesh of FS2002 does not crash CFS2, but displays walls, spikes, flattened areas, and dropoffs... Also the size of the 'dems' is about one-half the filesize of fs2000 base mesh, which displays correctly in CFS2. That's what led me to believe that a different form of compression may exist in files run through FS2002's unpublished resample program. And that's what led to the hope that the decals of CFS2 might be easier to decode.The prospect now, is that CFS2's decals may not be the same as FS2002. Over the next few weeks I'll look at the coding of CFS2, and see if there's anything of value I can find for FS2002 ( if I can make sense of it :-lol ).... for example, some lakes of CFS2 don't appear to be flattened, which could lead to interesting uses for polygons in FS2002 if decoded.And, yes, I'm sure I'll need help later. Thanks.

Share this post


Link to post
Share on other sites

The flatten and hydro polygons are the same in FS2K2 really. I'm surprised that the hyp files crash CFS2.Yes, the decal lines are a pain. You're right, it may be helpful if I could have a look at one of those. Maybe that'll give me some ideas for the FS2k2 ones.I'm away for a week now, so lets catch up on this in a weeks time...Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian.More oddities from CFS2! Shoreline corrections and lakes appear identical in CFS2, and are of the flattening type...but with no altitude! I wondered why coasts and the few lakes were not level. Apparently, that part of the terrain.dll was never developed for CFS2. FS2002 hyp files crash CFS2. Oddly, I believe I can eventually create the water polygons, then lay them over your flattening bgls. ( The old 2-step ) :-lol I hope to get MASM functional within a week, then I'll try to do some real damage.Another oddity, is that the CFS2 decals and water polygons function in FS2002. Roads, lakeshores, rivers, seashores. It appears those bitmaps are called by name, so other types of "lines" may be possible, as they aren't hard-coded.In fact, I found a CFS2 ground polygon island, with shoreline, that does not appear in FS2002. When added with the scenery library, to FS2002, the island does appear in the ocean, with a ground texture... so landmass may be added to FS2002... something I thought not possible. We may be able to create Atlantis, after all. :-eek Also, conflicts betweem CFS2 terrain-style scenery and FS2002 scenery are common, and might actually yield some information ( by deduction ), about FS2002.I present Gilligan's Isle:

Share this post


Link to post
Share on other sites

Interesting, to say the least...Keep us updated :)Christian

Share this post


Link to post
Share on other sites

Hi Christian.I've been studying your MASM macros for Flatten routines, and I'm unclear on two points:The FLATTEN GROUP macro defines the location as a number corresponding to a world LOD8 cell. I understand that.The FLATTEN DATA macro then reduces the cell-size to ( basically ) a 32 X 32 grid of the world LOD8 cell. I understand the concept of the rows, subrows and switches, as a way of cramming the binary data into 2 Data Bytes.Am I then correct in assuming the FLATTEN POINT is sub-dividing the original FLATTEN GROUP World LOD8 cell ( sub-divided to 256 X 256 )? That gives us a resolution of about 0.6 meters at the equator ( LOD15 size )? If so, does the FLATTEN DATA correspond to the Startpoint position of the FLATTEN POINT.Or is FLATTEN POINT a further reduction of the FLATTEN DATA sub-cell-size ( about 0.002344 meters resolution )? Also:Is it true a TMF polygon cannot cross a FLATTEN POINT area, but must be split and recoded for the new FLATTEN POINT area? Sorry to bother you about it. I can see that you may have been tormented by discovering this coding! *:-*

Share this post


Link to post
Share on other sites

>Or is FLATTEN POINT a further reduction of the FLATTEN DATA >sub-cell-size ( about 0.002344 meters resolution )? yes!>Is it true a TMF polygon cannot cross a FLATTEN POINT area, >but must be split and recoded for the new FLATTEN POINT >area? Yes!Try the flatten switch with the 'hydro bit' enabled. Then you'll actually see what happens. Otherwise the flatten polygons are impossible to see!:)Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian.I've made some discoveries concerning CFS2, and TMF files.The terrain engine is rather crippled in CFS2. 'HYP' files do not work for coast correction or lakes. Instead, CFS2 uses water decals that are mesh-conforming:FLATTEN HEADER mode = 256 ;decimalFLATTEN POLYGON MACRO countThese snippets of code illustrate the difference between a FS2002 Flatten code and a CFS2 Water polygon. The header mode is 256 decimal. There is no height or scale data for the polygon. Otherwise, the code is identical to a FS2002 'FLT' bgl.Here's my 'TMFCFS2WATERmacro.inc':; --------------------------------------------------------------------;TMFCFS2WATERmacro.incCFS2WATER_HEADER MACRO mode, list, data, end LOCAL startstart LABEL WORD DD 14h ; length DD mode DD ( OFFSET list ) - ( OFFSET start ) DD ( OFFSET data ) - ( OFFSET start ) DD ( OFFSET end ) - ( OFFSET start ) ENDMCFS2WATER_DATA MACRO count, rowOffset1, rowOffset2, colOffset, switch1, switch2, switch3 DB rowOffset2 * 40h + switch1 * 20h + switch2 * 10h + switch3 * 8h + count DB colOffset * 8h + rowOffset1 ENDMCFS2WATER_POLYGON MACRO count DB count ENDMCFS2WATER_POINT MACRO x, y DB x DB y ENDMCFS2WATER_LIST MACRO count, groups LOCAL startstart LABEL WORD DD 0Ch ; length DD count DD ( OFFSET groups ) - ( OFFSET start ) ENDMCFS2WATER_GROUP MACRO row, column, start, data, end DD ( row * 400h + column ) * 1000h + 0C00h DD ( OFFSET data ) - ( OFFSET start ) DD ( OFFSET end ) - ( OFFSET data ) ENDM; --------------------------------------------------------------------Here's my 'NZRC_CFS.asm'; --------------------------------------------------------------------; place the following macro in the same folder as MASM or BGLCinclude TMFCFS2WATERmacro.inc; Ryans Creek, NZ area ; CFS2-style TMF water decal; does not flatten; CFS2WATER Polygondata_base label word; DATABASE HEADER dw 1 ; world set number dd -5204614 ; North Bound dd -5223136 ; South Bound dd 2006306482 ; East Bound dd 2004318071 ; 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 MESH DATABASEterrain_data label word; TERRAIN MESH HEADER 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 CFS2WATER_header - terrain_data ; CFS2WATER 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; TERRAIN CFS2WATER POLYGON HEADERCFS2WATER_header label word CFS2WATER_HEADER 256, CFS2WATER_list, CFS2WATER_data, CFS2WATER_end; TERRAIN CFS2WATER POLYGON DATACFS2WATER_data label worddata_start_0 label word CFS2WATER_DATA 1, 4, 3, 12, 1, 1, 1 CFS2WATER_POLYGON 4 CFS2WATER_POINT 243, 198 CFS2WATER_POINT 248, 211 CFS2WATER_POINT 151, 255 CFS2WATER_POINT 105, 255 CFS2WATER_DATA 1, 4, 3, 13, 1, 1, 1 CFS2WATER_POLYGON 4 CFS2WATER_POINT 105, 0 CFS2WATER_POINT 151, 0 CFS2WATER_POINT 82, 28 CFS2WATER_POINT 75, 13data_end_0 label word; TERRAIN CFS2WATER POLYGON LISTCFS2WATER_list label word CFS2WATER_LIST 1, CFS2WATER_groupsCFS2WATER_groups label word CFS2WATER_GROUP 389, 742, CFS2WATER_data, data_start_0, data_end_0CFS2WATER_end label word; --------------------------------------------------------------------Note the CFS2 Water TMF conforms to the mesh:

Share this post


Link to post
Share on other sites

Aha, looks like the water polygons were very similar to the decal section initially. In FS2K2 they obvioulsy evolved a bit further...Do those CFS2 hydro polys work in FS2K2? And can you land on them with a float plane? I suspect not, but if yes this would be great because then you wouldn't have to know all the lake elevations.Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian.Yes, the CFS2 water polys work in FS2002... the above picture is your 'Ryan's Creek' done in water, in FS2002.The behaviour of the water is landable... and you can take off, with water spray.But it's a little strange going over a water hill. :-lol I was mistaken about Flatten behavior in CFS2... it doesn't work. The runway command raised and flattened the ground to the right elevation! So this will probably be a dead-end for my project to populate CFS2 with lakes. The Area16N SCASM commands of FS2000 work for flattening under lakes and coasts, but framerate hits are probably too large for a combat flight sim. CFS3 should be released by November, and time may be better spent developing skills and tools that will work with more advanced TMF coding. I'm disappointed a new terrain SDK is not available to help us. Admittedly, with some work, a code converter might be made that could automatically recompile FS2002 HYP files into CFS2-stlye water polygons. The code is very similar, but the address offsets would need to be recomputed, as each set of FLATTEN POLYGON macro code needs height and scale removed ( 3 DB removed preceeding each set of points ).I still believe a good way to produce streams and roads is available in CFS2 code... I know the bgls work in FS2002, but I need to try to decompile them. They are different than FS2002 code, but have the same visual effect... and you can name the BMP file, rather than reference it by an index number ( lots of possibilities there ). I'm not sure if seasonal changes are possible for those CFS2 line decals.

Share this post


Link to post
Share on other sites

>I was mistaken about Flatten behavior in CFS2... it doesn't >work. The runway command raised and flattened the ground to >the right elevation! Works the same in FS2K2. The flatten polygons are good though to set the whole airport background polygon to that height. If your runway is close to a cliff, the ground will drop off from the runway borders.>I still believe a good way to produce streams and roads is >available in CFS2 code... I know the bgls work in FS2002, >but I need to try to decompile them. They are different than >FS2002 code, but have the same visual effect... and you can >name the BMP file, rather than reference it by an index >number ( lots of possibilities there ). I'm not sure if >seasonal changes are possible for those CFS2 line decals. Sounds interesting. I can have a look if you send me a file, but the next 2 weeks I'm flat out with work. (plus, I can't really rest it).Cheers, Christian

Share this post


Link to post
Share on other sites

Hey Christian!!!>Yes, the CFS2 water polys work in FS2002... the above >picture is your 'Ryan's Creek' done in water, in FS2002. >>The behaviour of the water is landable... and you can take >off, with water spray. >>But it's a little strange going over a water hill. :-lol >If I am understanding what's being said here (no promises), then here is a method of laying down polys over elevated mesh without them being flattened. Is this the case?If so, this might be a good alternate to your decal problem / solution! You could create polys that provide roads and rivers. For rivers, this could be a big development. He is why I think this...Right now we have big fat flat rivers using flattening polys that mold the mesh to their elevation and little skinny rivers using decals that lay over the mesh (which we can't seem to figure out). But now it looks like we can have big rivers using this CFS2 method that should lay down onto the elevated mesh. If the mesh is created properly, then the river polys can follow the contour of the mesh and a great visual appearence should result. I look at my LOD 10 stuff and you can see the flat area where the river should go. This could be real nice because in mountainous areas, even large rivers are rarely flat. So this should follow the rivers eventual drop in elevation as it winds its way through the mountains. And it's landable with spray?!! What do you think?Leland Steffensen

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