Jump to content
Sign in to follow this  
rhumbaflappy

FS2002 Shorelines

Recommended Posts

Hi Christian.Sorry I left you talking to yourself. I been busy with personal commitments the past couple of days.The macro I made for FS2002 lines is very crude, and is incomplete. M$ used bits of some of the numbers as flags of some type. I think we're looking at bits added to the x,y values... so there is still more to discover. You'll note a codeline:LINE_POINT 35 + 00000h, 253The 00000h was included as a clue, here. That value can be 08000h, 0a0000h, 0c0000h, 0f0000h ( 9,b,d won't work )... so this is a flag or switch of some kind. Other values may be possible.I'm not sure the start-point ( or anchor-point ) is the actual start... but perhaps a ref-point... but the start/anchor/ref point never has a width, and starts a new section. The end of a section of points usually has a width of 0. That helps ID the end/start of line segments.If you play with the other points, you'll see they are hard to predict the effect of change.... I just thought the example was a 'stable' place from which to start altering values, or adding more points. The width points are good 'locators' when playing with the values of the lines... their effects are recognizable immediately.... and the width of 0 usually marks the end of a line segment ( not '1' as I used in the example... substitute '0' there and see the effect ).Also, why do we have to add '34808' to the y value of the anchor point? That doesn't seem right at all! There's a lot to learn here, yet.The CFS2-style lines are easy, once they were cracked! But what a pain for the designers! No wonder the CFS2 world was only partially done. It would have taken months for them to place shores and streams all over the world! The design team learned their lesson, and redesigned the lines structures for FS2002, so vector data could be used to locate shores, streams, and roads, and the process could be then be automated, using mapping data.

Share this post


Link to post
Share on other sites
Guest

Hi LeeThanks for that very interesting post. For a moment or two I actually thought I understood what your saying. Although I

Share this post


Link to post
Share on other sites

Hi Ken.Very good comments in your post. I've noted that the designers of Airport for Windows are now making a commitment to BGLC code. I don't know if they are abandoning SCASM completely. That, of course would make no difference to those of us using their program... a BGL is still the end result.The good news is this. By concentrating on BGLC, they will be able to use the info we are uncovering about TMF files, and incorporate that in their program, if they so choose. That would give us a sophisticated graphical interface for creating water, flattens, lines, and decals. Other GUI scenery programs will have to follow suit, as Microsoft is going to abandon the FS98 style scenery commands, possibly by CFS3. I haven't contacted the creators of Airport about this, but possibly someone could get their take on incorporating flattens, decals and lines. Although FS2002-style lines are not yet fully understood, the other types of TMF polys are pretty well documented.

Share this post


Link to post
Share on other sites
Guest falko

Waves can be excluded by using exclude areas, the only thing is that the exclude areas have to be larger then ususal, maybe one have to hit the anchor point of the waves.

Share this post


Link to post
Share on other sites
Guest

Thanks DickI've been eagerly watching the Airport for Windows site for the BGLC upgrade. Frankly though I don't see this happening real soon at this point or until we finally see the new 2K2 SDK's. Wow, wouldn't it be great if MS would release the SDK's about 6 months before it's version upgrade? Even better still if they would release a decompiler within the SDK's. To one step farther though, how about they release a full scenery design program package. One that really works!!!Thanks rhumba "You Da Man"Ken

Share this post


Link to post
Share on other sites
Guest christian

Hi, I made the comment about writing to myself and the rolling eyes because I wrote the messages within a few hours as I discovered stuff, so that really was meant to show how weird I am, I wasn't expecting any answers :-lolBack to the lines, I had an idea last night, I thought that the width byte also carries some info on how many points follow. I was really sure it would be the case, however that turned out to be fluke once again.I'll have to do some more experimenting...Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian and all.My current thinking on the macro structure is going this way:

; TMFLineMacrosV1.incLINE_PCOUNT	MACRO	count	DB	count + 020h	ENDMANCHOR_POINT	MACRO	x, y;		x or y may be 1 to 8160 ( 32 * 255 )	DW	x + 4080;		y values might be 2x scale of x numbers	DW	y + 2040 + 8000h	ENDMLINE_POINT	MACRO	x, y;		x may be + or - 1 to 255	DW	( x + 4080 ) MOD 4080;		y may be + or - 1 to 127;		y values might be 2x scale of x numbers	DB	 y + 128 	ENDMLINE_WIDTH	MACRO	width	DB	width	ENDM

This way allows + or - numbers to control the direction of x and y points, from the reference/anchor point. That allows the line coding to look like this:

; 1st line ----------------------------------------------		LINE_PCOUNT	5		ANCHOR_POINT	2946, 1562		LINE_POINT	35, 125		LINE_WIDTH	45		LINE_POINT	-15, 125		LINE_WIDTH	45		LINE_POINT	-15, -125		LINE_WIDTH	45		LINE_POINT	35, -125		LINE_WIDTH	1

A little more user-friendly.

Share this post


Link to post
Share on other sites
Guest

Thanks for helping me to see where your coming from Ken. I agree with you that there is a distinction between programmers and scenery developers. You nailed it on the head when you discussed your sceneries that you have developed. I too have Airport, AS&D, etc. But what I don't have is the patience to learn the skills to effectively create high quality sceneries such as yours. Could I create high quality scenery, yes, I probably could. By I like to tinker with the dirty dark secrets and work out the usable solutions. Christain and Richard have a better knack of digging out the nasty details of the BGL. Me, I'm an applications developer. I do this for a living. But I'm also an old school programmer from the late seventies. So I know about some of the older technologies like the BGL (remember, Bruce came up with this back in the late seventies).On that note, I have the ability to understand what Richard and Christian discover, thank god for them! So I'm taking their discoveries plus what I know from the SDK and I am working on some sort of GUI interface so that the designers like you have a better tool to work with. Will it ever compete with Airport for Windows? I'm not sure and I really don't care, but if they aren't incorporating terrain mesh technology into their application, mine will hopefully be able to fill the gaps.The way I see it we have three groups of folks here...The Red-eyed hackers (not to be confused with Crackers) working out the Structures.The Application Developer taking the discoveries and creating usable tools.The Scenery Developers taking the tools and making FS magic.I hope that the Airport For Windows folks do incorporate FS2002 terrain mesh technology into their product, or that Microsoft really does release a SDK. But I'm not holding my breath.Lee.

Share this post


Link to post
Share on other sites
Guest

Very interesting! I've got a buch of questions here.Does the anchor point define a point within a LOD 8 block?Does the width value pertain to distances between LOD 13 points? There is no scale value? BGL lives on scale values, I'm surprised nothing is here for that. Maybe this isn't required since the actual distance between LOD 13 points is rather small.Also, using your example.. LINE_POINT 35, 125LINE_WIDTH 45Is the width of 45 the segment width from the previous segment or next segement defined by the point? Is the actual line segment defining the left side, middle or right side of the rendered line?I've cut some line segments out of some BGL files and created tiny sceneries to use as test data. I'm going to run your line macro against it to see if I can find any inconsistencies. This is really getting to be exciting!Lee.

Share this post


Link to post
Share on other sites

Hi Lee.Some of your guesses are as good as mine! :-lol The anchor point does define a spot within the LOD8 quadrant... but I haven't worked out the details.The width maybe scaled in hardcode somehow... I don't know how wide a line can go ( also, the preceding x or y point may have data bits relating to width ). Width defines the endwidth of the line section. A width of zero is usually marking the end of the line. So most lines start with 0 width and return to 0 width... looking like snakes or worms.The x,y point appears to be the middle of the line. The newer macro makes the point placement a little more clear:

	ANCHOR_POINT	2946, 1562	LINE_POINT	35, 125	LINE_WIDTH	45	LINE_POINT	-15, 125	LINE_WIDTH  45	LINE_POINT  -15, -125	LINE_WIDTH  45	LINE_POINT	35, -125	LINE_WIDTH	1

Starting at the anchor_point ( 2946,1562 ): drawto right ( 35 ), up ( 125 ) and end in width ( 45 ) drawto left ( 15 ), up ( 125 ) and end in width ( 45 ) drawto left ( 15 ), down ( 125 ) and end in width ( 45 ) drawto right ( 35 ), down ( 125 ) and end in width ( 1 )I think this is close to where we are at. There is more to learn. I think Christian is also looking at this, but he's also working out the details of decal structures ( point-count rules, etc... ). Also, remember, I altered the newer macro to be user-friendly. The macro decode the -15 value to a usable number ( DW 4065 ).The wave effect is called by the texture definition, but requires land to be under some of the shoreline... ( no land ) = ( no wave ).I haven't looked at FS2002 streams or roads, yet, so I don't know how they are built. They have a lower urgency for me, because CFS2-style lines work fine. We needed the shorelines for the waves, as I don't believe CFS2-style shorelines can have waves.Also, when verifying waves in FS2002, make sure the 'pause' is off... a paused sim will not show waves, and may lead to you to believe they aren't working ( happened to me! ). :-lol Dick

Share this post


Link to post
Share on other sites
Guest

That helps. Your macros definitely help with the math!>>The wave effect is called by the texture definition, but >requires land to be under some of the shoreline... ( >no land ) = ( no wave ). >>I haven't looked at FS2002 streams or roads, yet, so I don't >know how they are built. They have a lower urgency for me, >because CFS2-style lines work fine. We needed the shorelines >for the waves, as I don't believe CFS2-style shorelines can >have waves. >I'm hoping that Microsoft would perform some code reuse here. I'm going to see if the lines that produce shorelines also have a similarity to lines for streams and roads. Maybe those extra bits are used here in some way. Or could they be some form of scale value?I too am glad that you figured out the CFS2 line structure, but to be honest, coding a user interface for that is going to be a bear. Also, FS2004 may not support that CFS2 structure. :~PLee.

Share this post


Link to post
Share on other sites
Guest falko

;Hi Dick,;here is an example for creating an exclude file using the SCASM compiler.;The SCASM compiler creates an file "HER1_exc.bgl and stores it in the Scenery folder ;for ADDONS;This exclude file excludes some waves at the baltic sea coast north to the airfield Heringsdorf; where the habour of Swinemuende shold be placed.;*****************************************************Header( 1 54.20383 53.75383 14.27643 14.02643 )LatRange( 53.75383 54.20383 )GenExcl( "E:FS2002ADDONS~1SCENERYHER1_exc.bgl" 1 N53:56:52.6820 N53:54:33.4260 E14:17:54.5460 E14:16:02.3360 N53:56:52.6820 N53:54:33.4260 E14:17:54.5460 E14:16:02.3360 );*****************************************************;and here a second one witch exludes some waves in the north sea at Helgoland germany; airfield DUENE as there should be two small islands instead of one lager one.;***********************************************************Header( 1 54.20383 53.75383 8.000 7.5000 )LatRange( 53.75383 54.20383 )GenExcl( "E:FS2002ADDONS~1SCENERYHEL2_exc.bgl" 1 N54:12:25.2131 N54:09:45.2000 E07:54:40.6133 E07:52:21.7054 N54:12:25.2131 N54:09:45.2000 E07:54:40.6133 E07:52:21.7054 );************************************************************;the stars are optional

Share this post


Link to post
Share on other sites
Guest christian

Hmm, I think roads, streams, and shores are all the same. I had a go at the railway lines from the Oshkosh scenery, they look the same as the shorelines in NZ. I think the crucial flag is the 20h in the overall point count.So far, the commands don't makes sense. Why would x be dw, but y be db? This isn't logical. I found as well that it seems to work like that, but I'm not satisfied with it. Somewhere there must be some info as well if a width command is to follow or not, or a point count to the next width command or something. I'm not saying that your macros don't work, rhumba, I'm sure they do, but I can't use them to decompile lines yet, so we still are missing something crucial. I'm just taking the reverse engineer aproach, if every single file will decompile, I'm sure the format is finally cracked. We need a system I think. How about we settle on the railway lines from the Oshkosh scenery for now? They seem to be more structured. For one thing, the width is constant. I think it starts off with the first 4 bytes as the location point and next follows a width specifier, it is always 2D (a luxury you don't get with the shorelines). Now my next step was to go through the file and find all width bytes. A bit of work, but once I have the width bytes, maybe the structure will become clearer?I'm side tracked for a couple of days with some other work, so any volunteers to start bringing a system into the oshkosh rail lines :-lol ?Cheers, Christian

Share this post


Link to post
Share on other sites

Hi falko.Yes. Your excludes do stop the wave effects! I'll play with excludes for awhile to see just how they affect the effects... perhaps they have to cover the entire LOD13 area ( just a guess ), because if they are too small, they don't work.Meanwhile, your code is an older style. SCASM also supports this:

;***********************************************************; Her_ex.txtHeader( 1 54.20383 53.75383 14.27643 14.02643 ) exclude( 1 N53:56:52.6820 N53:54:33.4260 E14:17:54.5460 E14:16:02.3360  );***********************************************************

This can be drag'n'dropped over the SCASM icon, and will produce an exclude file named "Her_ex.bgl" in the same folder as the text file... no naming of the file is needed, no LatRange() needed, and no 'dummy' BGL is produced.Thanks, falko. :-beerchug

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  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...