Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Terrain SDK Problems

Featured Replies

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

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

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

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

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

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.