Jump to content
Sign in to follow this  
rhumbaflappy

FS2002 Shorelines

Recommended Posts

Hi all.I've made some progress with FS2002-style shorelines. There's still some I need to discover, but the good news is: there are waves!By themselves, there are no waves for shorelines, but when I laid down a decal... waves magically appear. So as in real life, you need land to make a wave. :-lol

Share this post


Link to post
Share on other sites

Here's the BGLC code I used:

[b]include TMFmacros.incinclude CFS2TMFmacros.incinclude TMFLinemacros.inc; FS2002 ShorelineTest; ===================================================================; DATA_BASEdata_base	label	word	dw	1			; world set number	dd	LAT32_N17:00:00.00	; North Bound	dd	LAT32_N15:00:00.00	; South Bound	dd	LON32_W168:00:00.00	; East Bound	dd	LON32_W170:00:00.00	; 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_DATAterrain_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	0				; flatten polygon header	dd	decal_header - terrain_data	; 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; ===================================================================; DECAL_HEADERdecal_header	label	word	DECAL_HEADER 256, decal_list, decal_textures, decal_end; DECAL_DATAdecal_data	label	word; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -	data_start_0	label	word		DECAL_DATA 1, 5, 2, 10, 1, 0, 0		DECAL_GEOMETRY 1, 9, 1, 0; 1st line ---------------------------------------------------		LINE_PCOUNT	5; 020h + 5 points		ANCHOR_POINT	2946, 1562		LINE_POINT	35 + 00000h, 253		LINE_WIDTH	45		LINE_POINT	4065 + 00000h, 253		LINE_WIDTH	45		LINE_POINT	4065 + 00000h, 3		LINE_WIDTH	45		LINE_POINT	35 + 00000h, 3		LINE_WIDTH	1	data_end_0	label	word; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -; ===================================================================; DECAL_ LIST	decal_list		label	word		DECAL_LIST 1, decal_groups, decal_data	decal_groups	label	word		DECAL_GROUP 208, 23, decal_data, data_start_0, data_end_0; ===================================================================; TERRAIN DECALS TEXTURESdecal_textures	label	word	TEXTURE_HEADER 1, texture_groups, texture_data, texture_endtexture_groups	label	word	TEXTURE_GROUP texture_data, texture_start_0, texture_end_0texture_data	label	wordtexture_start_0	label	word	TEXTURE_DATA "1044", 0, 2, 4texture_end_0	label	wordtexture_end	label	word; ===================================================================; DECAL_ENDdecal_end	label	word; ===================================================================[/b]

And here's the macro ( subject to change! ):

[b]; TMFLinemacros.incLINE_PCOUNT	MACRO	count	DB	count + 020h	ENDMANCHOR_POINT	MACRO	x, y	DW	x + 4080	DW	y + 34808	ENDMLINE_POINT	MACRO	x, y	DW	x	DB	y	ENDMLINE_WIDTH	MACRO	width	DB	width	ENDM

[/b]Note in "DECAL_GEOMETRY 1, 9, 1, 0", I increased the shoreline priority to 9... because I increased the decal priority to 8 ( so it would lie over the water ).

Share this post


Link to post
Share on other sites
Guest

my only problem is that looking at BGLC code baffles me.Could you create a beginning of a lesson on BGLC code? Like to start, outline the purpose of each section of code, and syntax for commands, labels, how conditional code is idicated?or just point me to something like that if it exists?Bob B

Share this post


Link to post
Share on other sites
Guest christian

This looks great!Hopefully I have some time to look at it today.Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Bob.I'll have a tutorial for download here at AVSIM in a week. It will give enough info to create water, flattens, and decals. A part 2 should cover making hills and valleys, creating islands, and a some examples of priority tricks. ( One of my problems with this, is that we're still discovering the rules! )Shorelines and roads will have to wait until we get some better understanding of FS2002 lines, although there's enough info here in the forums for someone skilled in the basics to create CFS2-style shores and roads.BGLC is just the medium. I can't program in it very well. But I do understand the use of macros. Most of the code is headers that can essentially be cut'n'pasted, with a couple of values plugged in. I haven't used any looping or conditionals in any of my code. We have been using labels as placemarkers for the terrain engine. We're not really creating the code, just discovering it, and using new combinations of code.Christian and I are mostly "faking it" and substituting byte values until we get lucky and discover a TMF rule. Then we can write a macro to help the user interface.My goal is to completely divulge all TMF info I come across. I want everyone to be programming this stuff before FS2004 comes along. I really want Airport, or FSSC, or Groundmaker, or someone to create an easy to use GUI for this stuff.

Share this post


Link to post
Share on other sites
Guest

You three, Dick, Christian, and Bob are at the forefront of this new technology for FS. I admire your devotion and timely (not sure if timely is the right word) efforts to unselfishly help bring us all to where we are at today and tomorrow and next year as well. I certainly appreciate all you've done for the FS community and myself. You have my deep respects, Thank You Gentlemen!!!Although it's probably still fairly far off, I'd love to see a single scenery design program with all the features, and bells and whistles. Photoreal, Terrain, and Effects including shorelines with waves. Umm, I wonder if Gmax will do this in the future FS2004 maybe? It would sure be nice if the FS2002 Scenery and Terrain SDK's would be accurate, complete, and here tomorrow as well but we know that isn't going to happen. (strike me with lightning if it does):)After reading MASM.zip by Christian, I'm very interested to learn more about include .inc files. Could a water include be created and used to compile a hand drawn lake poly like we would draw with Airport, GroundMaker, or FSSC? That is of course if those programs used the BGLCompiler?Thanks bunches Guys!!!!!!!:-beerchugKen

Share this post


Link to post
Share on other sites

Do your efforts (APPRECIATED!) hold any promise on making the shorelines more accurate and not the approximation MS gave us???Thanks,Dick


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites

Hi Dick.We can already place a CFS2-style shoreline, stream, road, or custom line, anywhere we want. Soon, we should have all the info we need for FS2002 lines.The remaining problem is how to exclude the current shorelines, without having to delete or deactivate MS defaults. One solution, is that higher priority decals can cover lines, and then higher yet priority lines can be made... The only problem with this is waves... they show through the new covering decal! Waves on dry land is not as real as it gets. :7

Share this post


Link to post
Share on other sites
Guest

Hey Bob,I think what your looking for is not really applicable to BGLC. BGLC is a macro-assembler, nothing more. Now while there are some basic commands for conditional code, it's pretty limited. Basically what is being done here is nothing more then breaking down record stuctures in a set of data files. The FS Scenery Engine then takes those records and converts them into commands or data depending on the op-code of the record.The BGLC commands of DW, DB, and such are nothing more then "Define Word" or "Define Byte" commands. Basically BGLC allows you to think of data in terms of records like "Decal_Data" or "Decal_Geometry" and converts the macro to pure data in the form of bytes or words. In a sense, your going back to the days of assembler programming without the CPU commands! In place of them are BGL commands instead.If you want true progammability in your scenery, then the BGL is where you need to look. There are many commands like "BGL_CASE" and "BGL_IFINF1" that are true programming constructs that can be used to create scenery. So your probably asking, why hasn't anyone really mastered the true BGL command set and used BGLC to make scenery? In my opinion, it's because no one really had to. There are really great BGL compilers out there (SCASM being one of them) that assist in make scenery. But the one thing they lack are the terrain record formats. Thanks to Christain and Rumba, these formats are being discovered, but to use them, we need an assembler that can convert people code to bytes and words. BGLC is all we have right now to do this.Enough of the rant ;) Christain made up a document called MASM.ZIP that explains how to get started with MASM (and BGLC). If you really want to know the in's and out's of the BGLC, you need to know how to use the basics of MASM from Microsoft. His document will help you in obtaining the information you need. I found my copy in the AVSIM files.Lee.

Share this post


Link to post
Share on other sites
Guest christian

Ok, thanks to a little bit of your help, rhumba, and lots of poking myself, I think I have completely cracked the decal polys now.It didn't make sense to me that 04 are polygons, 08, 16, etc lines. And in fact, it isn't how this works. As you pointed out in your shoreline macro, if you add 20h to the number of points, the following points are line points, otherwise they are polygon points. This leaves us with a max point count of 31. However, if the point count is 31, FS will read the next 2 bytes and add them to the point count! This gives us plenty of points.I'm completely stuck with the lines once again :-fume. I believe you that your above macro works. However, it is more complicated still. Even if we have a fixed number of points (say 5) the number of bytes to follow varies. So far, I can't make any sense of it. It looks to me like this:START_POINT x, y dw x dw yCONTINUE_POINT x, y db x db yLINE_WIDTH w db wNow, the syntax can be:start_point x, ycontinue_point x,yline_width wcontinue_point x,yline_width wcontinue_point x,yline_width wThat's what you did. But this is also possible:start_point x, ycontinue_point x,ycontinue_point x,yline_width wcontinue_point x,ycontinue_point x,yline_width wHow the hell does FS know that some points don't have a width?!?And is START_POINT really 2x dw or maybe: db x db y db w??? :-hmmmAnother thought. Maybe it's always x,y,w, but the size of x and y can vary between bb and dw? At the moment this is my favourite theory...Cheers, Christian :-zhelp

Share this post


Link to post
Share on other sites
Guest christian

Quick note:I don't differentiate between CFS2 and FS2K2 decal textures anymore. M$ forgot to delete some 'old' style nph in Madagaskar, they are named nphyp. nph = non-perenial water...The 'old' style texures allow this as an argument:"dirtroadhw.bmp;dirtroadhw.bmp;dirtroadsu.bmp;dirtroadsu.bmp;dirtroadsu.bmp;dirtroadsu_lm.bmp"Now, if you have a look right at the top of the terraintextures.cfg, you'll find that this means you can have seasonal textures even with old-style textures... No effects though...Cheers, Christian

Share this post


Link to post
Share on other sites
Guest christian

And more...I just had a look at the CFS2 lines. They are so easy :-lolBut, do they have any widths on them? They just seem to be points like the polygon points...Cheers, Christian

Share this post


Link to post
Share on other sites
Guest christian

Hey, this is fun talking to myself :-rollYou said that you thought that the 0 in texture entry has an impact on the layer. I think it's something else. CFS2 doesn't seem to have the size and type byte. The 0 is just the string delimiter '0'. This way FS2002 can read both CFS2 and FS2002 decal files. If there is a 0, the name string is over and a size and type byte follow...Christian

Share this post


Link to post
Share on other sites
Guest christian

Please, ignore the last comment. I just read your old CFS2 line post and all becomes clear. Now I know why M$ changed the lines, they would be a pain to do CFS2 style...Christian

Share this post


Link to post
Share on other sites
Guest

Well I'm listening intently... been following the thread dealing with the decals for a week now. You efforts are truly appreciated.

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...