Sign in to follow this  
Guest GerrishGray

Terrain SDK Problems

Recommended Posts

Hi all.Here's a list of interesting errors, ommissions, and tidbits concerning Microsoft's FS2002 Terrain SDK.> Undocumented LWMPoly1 produces mesh-clinging LWMs for CFS2, they also work in FS2002. Added to TDFMacros.inc.> Area filling possible with CFS2........ do not follow with LWMDataAreaHeight structure.> Landclass must exist under land masks. > Waterclass may need to be changed under water masks, to get the right depth.> Ordering of the Cell Index is critical. The best way to look at this, is to imagine latitudinal bands ( V Cell value ) circling the globe, in order of 0 ( North Pole )to 511 ( South Pole ). Within the latitudinal band, the U Cell value ( longitudinal ) should be in numerical order from 0 ( W180*.. international dateline ) to 767 ( wrapping eastward around to the dateline again ). So complete an entire horizontal V band first, by entering the U columns in it from 0 - 767. Then progress to the next V band....LWMIndexStart label wordLWMIndexHeader 6, LWMIndexDataLWMIndexData label word LWMIndexEntry Cell_472_249, LWMStart, datamark_0, datamark_1 LWMIndexEntry Cell_473_249, LWMStart, datamark_3, datamark_4 LWMIndexEntry Cell_472_250, LWMStart, datamark_1, datamark_2 LWMIndexEntry Cell_473_250, LWMStart, datamark_4, datamark_5 LWMIndexEntry Cell_472_251, LWMStart, datamark_2, datamark_3 LWMIndexEntry Cell_473_251, LWMStart, datamark_5, datamark_6> VTPPolyMethod2Ex Extented point polygon code from Terrain SDK wrong. bExPointCount was listed as a UINT8 ( BYTE ) and should have been a WORD. Corrected in TDFMacros.inc.> Concerning VTP Method1 Polygons it was stated that X,Y values of polygons is 0,0 in the northwest, and 255,255 in the southeast. This is true.It was then stated that the texture coordinates, U,V are the same... that is not true. Textures are vertically flipped ( mirrored ). > FS2002 VTP Method1 polys MUST be supplied with a seasonal set ( semi-colon ';' delimited ), or it will crash the sim at night.The delimiter was wrongly listed as a comma in the SDK.> FS2002 VTP1s must have 6 seasonal/night texture names assigned if custom textures are used . This doesn't seem to be required for VTP2s, but good coding practice should require it.texturemark_0 label wordVTPTextureName "TexNameWi.bmp;TexNameHW.bmp;TexNameSp.bmp;TexNameSu.bmp;TexNameFa.bmp;TexNameLm.bmp"VTPTextureType 1, 0, 0, 4texturemark_1 label wordIf only one texture is used, then:texturemark_0 label wordVTPTextureName "TexName.bmp;TexName.bmp;TexName.bmp;TexName.bmp;TexName.bmp;TexName.bmp"VTPTextureType 1, 0, 0, 4texturemark_1 label word> CFS2 VTP Method1 polys should NOT have seasonal name strings, as there are no seasons, or night textures.texturemark_0 label wordVTPTextureName "TexName.bmp"texturemark_1 label word=================================Things I need to check:> The SDK was a little vague on this point. Method1 VTPs require a filename string for the bitmap, with no VTPTextureType structure. ( need to check ). Certainly not wanted in CFS2.> VTP Method1 lists a bPointCount of 63, but the poly seems to be limited to 24 points ( this needs further checking... '24' doesn't make sense ).If anyone has discovered further tidbits about the FS2002 Terrain SDK, please add to, or correct, this list.A current version of TDFMacros.inc is found here.Dick

Share this post


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

Just after playing around with waterclass I believe that the waterclass numbers match the texture numbers and descriptions given in the SDK. I don't know if this is common knowledge or not, but as the landclasses do not match the terrain texture numbers I thought I would share this anyway. The screen shot shows the progression of the classes from 1 to 60 going from top to bottom then left to right.Cheers,Derek

Share this post


Link to post
Share on other sites

Hi Derek.That may well be true. Christian Stock has suspected this. I think TMFViewer, used on 'worldwc.bgl' might confirm all the default use of WaterClass.Thanks for adding to the info!Dick

Share this post


Link to post
Share on other sites

Yes, I have confirmed this now. There is no mapping in lclookup for waterclasses. They match the texturenames directly.Does that mean we can even do our own textures (add more?). Certainly a 'glacial lake' texture is missing...Cheers, Christian

Share this post


Link to post
Share on other sites

There is a way to add more areas, textures, etc, but I'd have to look it up, and still need to play with it a bit more. This is undocumented.VTP2 line points are wrongly / only partly documented. It may work as the SDK says, but the default ones work differently. There are a few bits supposed to be 'reserved' and zero, but they aren't in the default bgls. And they mess the data structure up completely, hence I still can't decompile them...Cheers, Christian

Share this post


Link to post
Share on other sites

Anyone interested in water classes should read the documentation that accompanies Ed Truthan's oceantx.zip download, available from the library as download # 13843. It will save a lot of time, trial and error as Ed has already thoroughly researched this topic.As far as I can remember from the last time I read Ed's stuff, there are actually only 10 different classes, each with a "six-pack" of textures. The mapping of water classes to textures appears to be hard-coded, for speed (as opposed to the data-based mapping via lclookup.bgl that is used for the far more complex land classes) so is probably incapable of being altered. The water class system is nevertheless surprisingly sophisticated and seems to make allowance for the depth of ocean as one moves out from shore, etc. Of course, the actual global mapping of water classes in worldwc.bgl contains inaccuracies, just as all such data in FS2002 does, but thanks to Christian, Dick et al. we now have the capability of putting these things right.Ed's replacement water textures are pretty impressive too, and there is a companion archive, oceansfx.zip, that deals with the 'effects' system for the moving water surface.CheersGerrish

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