Jump to content
Sign in to follow this  
rhumbaflappy

FS2k2 roads using the Terrain SDK?

Recommended Posts

Hi jmf.Your file's fine. I can see the waves.Maybe you'e not zooming close enough? Or your folder's 'Scenery.DAT' file needs to be erased so it can be rebuilt? Do you see the default waves? Maybe you need to tweak your graphic hardware settings.Dick

Share this post


Link to post
Share on other sites
Guest

Hi Dick,You are right! It works!However, I had to disable the bgl that defines the photo terrain. This bgl was produced by resample and is a ClassU8 type where 254 define sea tiles and 252 land tiles. The coastline itself was defined by using transparency on the relevant tiles.Now the question becomes. Can this be done? Is it a matter of priority? Or it does not work at all? How to place the wave effects with photo terrain? even with the BGLPlacer it does not work!Any ideas?ThanksPS - You were also right about the info in the SDK! By reading back and forward several times you start to see the pattern. Regarding the FP maths, I think that in VStudio there are assembler libraries for floating point math but I need to check that! I think I remember something that came included in the processor packs.

Share this post


Link to post
Share on other sites
Guest

If you look at the picture there are two errors in the shorelines at each side of the plane.When I look at the code it looks like this; VTPWidePoint 10797, 0, 12147, 0 VTPWidePoint 10818, 0, 12154, 0 VTPWidePoint 10830, 0, 12174, 0 VTPWidePoint 10830, 0, 12193, 0 VTPWidePoint 10848, 0, 12208, 0 VTPWidePoint 10877, 0, 12218, 0 VTPWidePoint 10896, 1, 12238, 0 VTPWidePoint 10891, 0, 4094, 0 VTPWidePoint 10896, 0, 4103, 0 VTPWidePoint 10927, 0, 4129, 0 VTPWidePoint 10933, 0, 4146, 0 VTPWidePoint 10936, 0, 4168, 0 VTPWidePoint 10934, 1, 12335, 0 VTPWidePointWidth 0 It looks like there are some problem at the border between two cells.Has someone else found this error or is it just me?

Share this post


Link to post
Share on other sites
Guest falko

Did you test the SCM2VTP version from 21.10.2002? This version should sort the cells in the correct order.

Share this post


Link to post
Share on other sites
Guest fumey

Has anyone checked id the breplace flag in the VTPlayer structure works ?What I have done : taken a running code to show one road, thanks to Falko, changed the breplace flag and tried the 3 usual layer ID : 16, 31 and 32.I see my road, but FS roads and streams are always at their place.We can read in the SDK two different informations about the layer ID : in the table giving the possible layer ID we can read that for General, the ID can be 8 to 100, but in the VTPLayer structure the ID is limited to 63.Thanks for your pertinent informationsChristian

Share this post


Link to post
Share on other sites

Hi Christian.The bReplace flag excludes only the exact layer number from the LOD13 Area your line goes through. The surrounding LOD13 Areas are unaffected. I think MS did this to help designers, because if the whole LOD8 Cell was excluded, there would be a lot of replacing to do!Dick

Share this post


Link to post
Share on other sites
Guest fumey

Thanks for the answer.The answer was in fact already in a another message; I have to read carefully !Christian

Share this post


Link to post
Share on other sites
Guest

How do you change the asm file to exclude the excisting layer but not draw anything?In the SDK it says "If you want to clear the default data without drawing anything, set the bReplace flag in the layer and set the number of textures to 0." VTPDataArea 1, 1, 0, 0; Road Exclude VTPLayer 32, 1 VTPNumTexturesInLayer 0, 0 VTPTextureId 1, 0 VTPPolyCount 1, 0I tried this but FS crashes.Is there anything in the texture part that I need to change?Btw This SCM2VTP program works great :D

Share this post


Link to post
Share on other sites

Hi knnygar.I haven't been able to exclude without drawing something in the LOD13 Area of the exclusion... I think that's why they called it "replace" instead of "exclude".A VTP Method1 poly can "replace" all the layer in an LOD13 Area. Doesn't matter if they are lines or polys. VTP1s allow you to snip a portion of a texture, and place that portion wherever you like in an Area. The road textures have parts of the textures that are tranparent. Use a road texture ( Wave effects may be tied to the shorelines! )You can make a tiny VTP Method1 poly that will snip a tiny 2x2 pixel chunk of the transparent area of the texture, and place it somewhere in the LOD13 area. It is almost invisible ( a slight darkening can be noticed ).You could make a macro yourself ( maybe called "LayerGone" ), and specify the Layer and location you'd like to vanish ( 'LayerGone 8, 13, 240' could exclude Layer 8, and place the tiny transparent poly at location 13, 240 of the LOD13 Area ). The macro would make the coding less tedious. I have not tried the following:VTP Method1s allow you to draw to Row and Column 0, and I suspect those are reserved to blend LOD13Areas together. If that's true, then perhaps you could try to make a 2 point poly ( a line ), and hide the transparent poly in the upper edge or west column. Then it would truly be invisible. Might be worth a try. The left edge seems the better of the two... 0,1 to 0,2...Dick

Share this post


Link to post
Share on other sites
Guest fumey

I have found an other solution :In a first step I thought that putting away the textures structure and changing the offset to this structure to 0 by modifying the VTPTextureListHeader macro it would work. FS2K failed.Then, I have kept only one entry in the texture structure, without polygon in the area data, and putting the number of texture to 0 in the VTPNumTexturesInLayer line, and it works now.See the following code.include TDFMacros.incinclude TDFHeaders.inc; VTP Method2 Roads 46.747754 5.994167 BGLHeader 48, 45, 7, 4, TerrainHeaderStart, VTPHeaderVTPHeader label word VTPFileHeader 256, VTPIndexStart, TextureStart, VTPEndVTPStart label word datamark_v0 label word VTPDataArea 1, 0, 17, 0 VTPLayer 32, 1 VTPNumTexturesInLayer 0, 0 VTPDataArea 1, 0, 18, 0 VTPLayer 32, 1 VTPNumTexturesInLayer 0, 0 VTPDataArea 1, 0, 18, 1 VTPLayer 32, 1 VTPNumTexturesInLayer 0, 0 ---- ---- VTPDataArea 1, 0, 20, 7 VTPLayer 32, 1 VTPNumTexturesInLayer 0, 0 VTPDataArea 1, 0, 20, 8 VTPLayer 32, 1 VTPNumTexturesInLayer 0, 0 datamark_v1 label word; ---------------------------------------------------------------------------------------------------------Cellv_396_123 EQU VTPCellID 0, 396, 123; --------------------------------------------------------------------------------------------------------- VTPIndexStart label word VTPIndexHeader 1, VTPIndexData, VTPStart VTPIndexData label word VTPIndexEntry Cellv_396_123, VTPStart, datamark_v0, datamark_v1; ---------------------------------------------------------------------------------------------------------TextureStart label word VTPTextureListHeader 1, TextureIndexStart, TextureDataStart, TextureDataEndTextureIndexStart label word VTPTextureListEntry TextureDataStart, texturemark_0, texturemark_1TextureDataStart label word texturemark_0 label word VTPTextureName "1162" VTPTextureType 2, 0, 0, 4 texturemark_1 label wordTextureDataEnd label word; ---------------------------------------------------------------------------------------------------------VTPEnd label wordHope this code helps you.Christian

Share this post


Link to post
Share on other sites

Hi Christian.I haven't tested this very much, but your code seems to be the perfect solution to knnygar's problem.Using your method, I'm able to exclude any layer from any LOD13 Area.Note to users... this is the best example of why you should list the LOD13 Area numbers, even for VTP2 use ( unlke the SDK's information on VTP2s ).Here's some code I made, using Christian's great suggestion:include TDFMacros.incinclude TDFHeaders.inc; DelavanVTP2fumeyDelete.txt; N42* 38.13' W88* 37.33'BGLHeader 44, 41, -87, -90, TerrainHeaderStart, VTPHeaderVTPHeader label word VTPFileHeader 256, VTPIndexStart, TextureStart, VTPEndVTPStart label word; --------------------------------------------------------------------; Cell_194_134datamark_0 label word VTPDataArea 1, 0, 31, 22 VTPLayer 32, 1 VTPNumTexturesInLayer 0, 0 VTPDataArea 1, 0, 31, 23 VTPLayer 4, 1 VTPNumTexturesInLayer 0, 0 datamark_1 label word; --------------------------------------------------------------------Cell_194_134 EQU VTPCellID 0, 194, 134 VTPIndexStart label word VTPIndexHeader 1, VTPIndexData, VTPStart VTPIndexData label word VTPIndexEntry Cell_194_134, VTPStart, datamark_0, datamark_1; --------------------------------------------------------------------TextureStart label word VTPTextureListHeader 1, TextureIndexStart, TextureDataStart, TextureDataEndTextureIndexStart label word VTPTextureListEntry TextureDataStart, texturemark_0, texturemark_1TextureDataStart label word texturemark_0 label word VTPTextureName "1054" VTPTextureType 2, 0, 0, 4 texturemark_1 label wordTextureDataEnd label word; --------------------------------------------------------------------VTPEnd label wordIn Area 31,22 I excluded the major road with Layer 32. In Area 31,23 ( just to the south ) I excluded the Layer 4 Airport background. Each exclusion was confined to the proper LOD13 Area!I think this code can be included as a valid technique , right in the data stream of a BGL... we need to test that just a little further, by excluding the layer in the cell, then rewriting the layer, after the exclusion. The TextureID apparently isn't needed, because it's not called by the code... nor is the VTPPolyCount, VTPPolyMethod2, or VTPPointXY2 , because the poly is never drawn!This looks very good "fumey" !Dick

Share this post


Link to post
Share on other sites

Hi all.Using Christian's coding idea for VTP Layer exclusions, a Macro can be made to exclude Areas, and Cells.include TDFMacros.incinclude TDFHeaders.incinclude VTPLayerExcludes.inc; DelavanVTPExcludes.txt; N42* 38.13' W88* 37.33'BGLHeader 44, 41, -87, -90, TerrainHeaderStart, VTPHeaderVTPHeader label word VTPFileHeader 256, VTPIndexStart, TextureStart, VTPEndVTPStart label word; --------------------------------------------------------------------datamark_0 label word; Cell_194_134 VTPAreaExclude 32, 31, 22 VTPAreaExclude 4, 31, 23datamark_1 label word; Cell_195_134 VTPCellExclude 8datamark_2 label word; --------------------------------------------------------------------Cell_194_134 EQU VTPCellID 0, 194, 134Cell_195_134 EQU VTPCellID 0, 195, 134 VTPIndexStart label word VTPIndexHeader 2, VTPIndexData, VTPStart VTPIndexData label word VTPIndexEntry Cell_194_134, VTPStart, datamark_0, datamark_1 VTPIndexEntry Cell_195_134, VTPStart, datamark_1, datamark_2; --------------------------------------------------------------------TextureStart label word VTPTextureListHeader 1, TextureIndexStart, TextureDataStart, TextureDataEndTextureIndexStart label word VTPTextureListEntry TextureDataStart, texturemark_0, texturemark_1TextureDataStart label word texturemark_0 label word VTPTextureName "1054" VTPTextureType 2, 0, 0, 4 texturemark_1 label wordTextureDataEnd label word; --------------------------------------------------------------------VTPEnd label wordHere I call a new 'include' ( Macro ), called "VTPLayerExcludes.inc"You can call:"VTPAreaExclude Layer, U, V"... to exclude an LOD13 Area's Layer number.To exclude an entire LOD8 Cell's Layer number call:"VTPCellExclude Layer"VTPLayerExcludes.inc is attached as a TXT file. Save it as "VTPLayerExcludes.inc"This macro can save some typing, if you're doing a lot of excluding.Dick

Share this post


Link to post
Share on other sites
Guest fumey

Your macro is a very good idea.Nevertheless, for the fun, I have created a program that allows to create exlude BGL for roads, rivers, shoreline ...You will find this program in the 'FS2002 utilities' library : DefArea.zipThat's for people who don't know about LWM/VTPChristian

Share this post


Link to post
Share on other sites
Guest

Bonjour ChristianThanks for you program.I hope for the same to create rods???I get a message for vb6fr.dll not found when starting it.Where can i found it?DANIEL

Share this post


Link to post
Share on other sites
vbr6fr.dllI'll try your program this week Christian. It seems like a perfect solution for people using 'scm3vtp', and wanting to avoid BGLC directly.The bgls may need to be "ordered" in the scenery folder. The exclusion BGL needs to be accessed before the laying of new VTP line BGLs. This is easily done by naming the exclusion something like 'aaaexclude.bgl' so that it has alphanumeric priority in the folder, and the data stream.Dick

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