Sign in to follow this  
rhumbaflappy

FS2k2 roads using the Terrain SDK?

Recommended Posts

Hi!Has anybody got it now how to build FS2k2-roads using Microsoft's BGL Compiler? I don't have many programming skills and for me it would take a year to understand what the "Terrain Vector Data.doc" says.I would be pleased if anybody could send an example of a source-code which would give a much better insight.ThanksSasa

Share this post


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

Hi Sasa.I hope to have a VTP tutorial posted soon. But, for now, you better resign yourself to learning BGLC/MASM.It's not very difficult, as it is mostly plugging values into Macro calls.It may be some while before a 'road consturction set' is made.Start learning with the LWM Tutorial, build water and land and flattens. Then advance to VTP Method1 polygons, and VTP Method2 polygons.Read the posts by 'knnygar'. He started with no knowledge, and was able to build islands, extend coasts, remesh, place new excluding shorelines... all in a few weeks.Read. There is no way around it.Dick

Share this post


Link to post
Share on other sites

It was alot of trial and error and I almost gave upBut I'm glad I continued because the end result was so good ;-)But it takes alot of time :-(PS I uploaded my scenery to flightsim.no today so it should be up in a couple of days :-sun1

Share this post


Link to post
Share on other sites

Congratulations, Knnygar! I know that was tough... my first tiny scenery file is still very much "in the oven". Glad you got yours released!

Share this post


Link to post
Share on other sites

Fantastic fjord !Will you correct also the roads runbning up the mountains ?Thanks so farTN

Share this post


Link to post
Share on other sites

I will continue to work on the scenery.When someone finds out how to move the roads I will try to get that too.

Share this post


Link to post
Share on other sites

Hi Knnygar.The roads are just like the shorelines! They use a road texture, instead of a shore texture, and their layer is 31 or 32. The default roads can be excluded from an Area just like default shorelines.The VTPTextureType should be 3, 0, 0, 4.... as discussed in the Terrain SDK.Dick

Share this post


Link to post
Share on other sites

I just need a little break after the stress of getting the first version out.The roads will be my next project I think, because that's what people notice first.I think I will try this graphical program I have seen discussed in some posts here :-)

Share this post


Link to post
Share on other sites

Hi Sasa,I now have uploadet the file "SCM2VTP.ZIP" to the AVSIM Library. The program SCM2VTP.EXE at this file converts old style FS2000 roads to FS2002 VTP-roads following the tutorial of Richard Ludowise. The input are SCASM input files whitch should contain command lines with the commands "RefPoint(...", "RRStart(..." or "RoadStart(...", and "RoadCont(...". Output is to a file "OUTPUT.ASM" or "OUTPUTx.ASM" so at least nothing is overwritten or destroyd by the program. The OUTPUT.ASM file has to be compiled with the BGLC.EXE program and the then created OUTPUT.BGL file can be tested in FS2002. Until now it only works if not more then ~10 roads are compiled in one task, but at least you will get some ASM demonstration code in this way.Best regards Falko

Share this post


Link to post
Share on other sites

>Hi Sasa, >I now have uploadet the file "SCM2VTP.ZIP" to the AVSIM >Library. The program SCM2VTP.EXE at this file converts old >style FS2000 roads to FS2002 VTP-roads following the >tutorial of Richard Ludowise. The input are SCASM input >files whitch should contain command lines with the commands >"RefPoint(...", "RRStart(..." or "RoadStart(...", and >"RoadCont(...". Output is to a file "OUTPUT.ASM" or >"OUTPUTx.ASM" so at least nothing is overwritten or destroyd >by the program. The OUTPUT.ASM file has to be compiled with >the BGLC.EXE program and the then created OUTPUT.BGL file >can be tested in FS2002. Until now it only works if not more >then ~10 roads are compiled in one task, but at least you >will get some ASM demonstration code in this way. >Best regards >Falko >Dear Falko,Your "SCASM'roads post-processor" solves the graphical interface problem that we have to design with VTP polys. I have 2 questions. Is there a limit on the number of points? Can it be used to generate coastlines (with waves effects and so)?Thank you, Luis

Share this post


Link to post
Share on other sites

Hi Falko.I have not yet tried your program.Is the output VTP Method2 lines ( used in FS2002 ), or are they VTP Method1 "strips", as used in CFS2?Also, I don't think there should be a problem with shorelines... the difference is the texture. The orientation is also a problem with the shores ( I think you keep the land to the right ). Waves are assigned by the texture if you use the numbers in "terraintextures.cfg".Dick

Share this post


Link to post
Share on other sites

Hi Luis, hi Dick,the program generates VTPMethode2 lines. I you want to create coastlines with wave effekt you have to edit the output file and change one of the texture nubers to a texture with wave effekt. The numbers are found in the terraintextures.cfg file in the main FS2002 directory. You also have to change the first number in the VTPTextureId field to match the texture. First texture in the texture list in the output file is 0, second is 1, and so on. The VTPMethode2 generats lines, so you only have to give to points, start point and one continue point to generate an road. Since the roads should match the FS Cell, the program breaks up longer roads in smaller pieces and starts with a new road when the border of a cell is crossed. The number of points in an data block is limited to 158, the program starts with an new road when this limit is reached, at least it should do so.Best regardsFalko

Share this post


Link to post
Share on other sites

I am experimenting with scm2vtp and having problems gettings roads to appear.1) When I run scm2vtp a get a message saying: "Fehler aufgetreten"2)The BGLHeader Line reads:BGLHeader 1, -1, 1, -1, TerrainHeaderStart, VTPHeader, do the coordinates have to be entered manually?3) Does it matter what directory the final bgl is placed in.Thanks David

Share this post


Link to post
Share on other sites

After posting this message I tried generating the same scasm code with FSSC and the bgl compiled ok, odd?David

Share this post


Link to post
Share on other sites

Hi David,thank you for testing my program! The error means the program could not read in the RefPoint line, so all of the calculations will be wrong. If at all, your roads will appear at the equator at the Greenwich meridian. Perhaps you could post an example of your SCASM code so I can correct the program. One RefPoint line and one RRStart line would be sufficient. The BGL files should be placed in the same scenery directory as other custom BGL files for that region.Best regardsFalko

Share this post


Link to post
Share on other sites

Hi Falko, both of these are generated from the same apt code.The Airport 2.6 sca reads: RefPoint( 7 :TagPoly 1 50:40.6881 -001:6.12216 V1= 10000 V2= 2235 ) RRStart( 3 10 -443 0 -258 ) ; 1The FSSC sca reads: RefPoint( rel :lblEnd 1.0 N50:40:41.5860 W001:06:07.5836 v1= 10000 v2= 3180 ) LoadBitmap( 0 5 F0 0 0 0 "v_road_minor.bmp" ) Smoothing( 1 ) RRStart( 3 10 -443 0 -258 )Also could you give details of how to change 'roads' to 'shore/waves', I managed to get the waves but against a road.Thanks David

Share this post


Link to post
Share on other sites

Hi David.If the BGLC code is not too long, attach it as a text file to a post. Then I could see what needs to be done to alter the code to show shorelines and waves.Also, add a comment line to the BGLC code ( starts with ";" ) that gives the Latitude and Longitude.Dick

Share this post


Link to post
Share on other sites

Hi Falco.Over the next few days I'm going to create a new TDFCalc program that reads it's latitude and longitude directly from FS2002 and CFS2 via the FSUIPC module. It will show all the numbers needed for LWM and VTP code, for any given point, automatically. I'll probably call it TDFSlew, as that would be it's usage.It occured to me, if you could develop a program to input these FS2002 derived points to a list, using FSUIPC, then your program could create BGLC code at the click of a few buttons.Input could occur as you slew to a point in the sim, and press a key combination. From your program, you could have a "code" button, that would create and save the BGLC code as the filename of choice, then clear the buffer for a new set of points.This would bypass SCASM entirely, and allow BGLC coding "on the fly", by use of the slewing function of FS2002.What do you think?Dick

Share this post


Link to post
Share on other sites

Hi David.I made some changes of your code you may like. If you 'copy' the code, paste it into WordPad ( not NotePad ), then save as TXT ( that will get rid of the color and size formatting ). Or use the attached TXT.include TDFMacros.incinclude TDFHeaders.inc; VTP Method2 Roads 50.678218-1.1021065 BGLHeader 52, 49, 0, -3, TerrainHeaderStart, VTPHeaderVTPHeader label word VTPFileHeader 256, VTPIndexStart, TextureStart, VTPEndVTPStart label word datamark_v0 label word VTPDataArea 1, 1, 0, 0 VTPLayer 8, 1 ; Layer 8 with replace to eliminate the default shorelines in the LOD13 Area VTPNumTexturesInLayer 1, 0 VTPTextureId 4, 0 ; accessing the 5th color VTPPolyCount 1, 0 VTPPolyMethod2 31, 1, 0 VTPPolyMethod2Ex 4 VTPWidePoint 9265, 1, 11058, 0 VTPWidePointWidth 1 VTPWidePoint 9265, 1, 11058, 0 VTPWidePointWidth 64 ; Greater width VTPWidePoint 9265, 0, 11058, 0 VTPWidePoint 9275, 0, 11059, 0 VTPWidePoint 9307, 0, 11062, 0 VTPWidePoint 9333, 0, 11065, 0 VTPWidePoint 9347, 0, 11063, 0 VTPWidePoint 9356, 0, 11048, 0 VTPWidePoint 9336, 0, 11018, 0 VTPWidePoint 9307, 0, 11004, 0 VTPWidePoint 9275, 0, 10988, 0 VTPWidePoint 9243, 0, 10973, 0 VTPWidePoint 9231, 0, 10967, 0 VTPWidePoint 9243, 0, 10970, 0 VTPWidePoint 9275, 0, 10977, 0 VTPWidePoint 9307, 0, 10985, 0 VTPWidePoint 9339, 0, 10992, 0 VTPWidePoint 9371, 0, 10999, 0 VTPWidePoint 9395, 0, 11005, 0 VTPWidePoint 9405, 0, 10996, 0 VTPWidePoint 9435, 0, 10978, 0 VTPWidePoint 9457, 0, 10965, 0 VTPWidePoint 9466, 0, 10959, 0 VTPWidePoint 9498, 0, 10940, 0 VTPWidePoint 9510, 0, 10933, 0 VTPWidePoint 9530, 0, 10921, 0 VTPWidePoint 9562, 0, 10901, 0 VTPWidePoint 9563, 0, 10901, 0 VTPWidePoint 9594, 0, 10882, 0 VTPWidePoint 9616, 0, 10869, 0 VTPWidePoint 9626, 0, 10863, 0 VTPWidePoint 9658, 0, 10844, 0 VTPWidePoint 9669, 0, 10837, 0 VTPWidePoint 9690, 0, 10825, 0 VTPWidePoint 9699, 1, 10819, 0 VTPWidePointWidth 0 VTPDataArea 1, 1, 0, 0 VTPLayer 8, 0 ; Layer 8 with NO replace, now VTPNumTexturesInLayer 1, 0 VTPTextureId 4, 0 VTPPolyCount 1, 0 VTPPolyMethod2 5, 1, 0 VTPWidePoint 9620, 1, 10929, 0 VTPWidePointWidth 1 VTPWidePoint 9620, 1, 10929, 0 VTPWidePointWidth 64 VTPWidePoint 9620, 0, 10929, 0 VTPWidePoint 9577, 0, 10895, 0 VTPWidePoint 9559, 1, 10877, 0 VTPWidePointWidth 0 VTPDataArea 1, 1, 0, 0 VTPLayer 8, 0 ; again, Layer 8 with NO replace, now VTPNumTexturesInLayer 1, 0 VTPTextureId 4, 0 VTPPolyCount 1, 0 VTPPolyMethod2 4, 1, 0 VTPWidePoint 9559, 1, 10877, 0 VTPWidePointWidth 1 VTPWidePoint 9559, 1, 10877, 0 VTPWidePointWidth 64 VTPWidePoint 9559, 0, 10877, 0 VTPWidePoint 9505, 1, 10862, 0 VTPWidePointWidth 0 datamark_v1 label word; ---------------------------------------------------------------------------------------------------------Cellv_381_111 EQU VTPCellID 0, 381, 111; --------------------------------------------------------------------------------------------------------- VTPIndexStart label word VTPIndexHeader 1, VTPIndexData, VTPStart VTPIndexData label word VTPIndexEntry Cellv_381_111, VTPStart, datamark_v0, datamark_v1; ---------------------------------------------------------------------------------------------------------; Added 2 textures to the list for ocean shorelinesTextureStart label word VTPTextureListHeader 6, TextureIndexStart, TextureDataStart, TextureDataEndTextureIndexStart label word VTPTextureListEntry TextureDataStart, texturemark_0, texturemark_1 VTPTextureListEntry TextureDataStart, texturemark_1, texturemark_2 VTPTextureListEntry TextureDataStart, texturemark_2, texturemark_3 VTPTextureListEntry TextureDataStart, texturemark_3, texturemark_4 VTPTextureListEntry TextureDataStart, texturemark_4, texturemark_5 VTPTextureListEntry TextureDataStart, texturemark_5, texturemark_6TextureDataStart label word texturemark_0 label word VTPTextureName "1162" VTPTextureType 2, 0, 0, 4 texturemark_1 label word VTPTextureName "1158" VTPTextureType 2, 0, 0, 4 texturemark_2 label word VTPTextureName "1160" VTPTextureType 2, 0, 0, 4 texturemark_3 label word VTPTextureName "1131" VTPTextureType 2, 0, 0, 4 texturemark_4 label word VTPTextureName "1045" ; tan ocean shore with waves VTPTextureType 2, 0, 0, 4 texturemark_5 label word VTPTextureName "1054" ; tan ocean shore without waves VTPTextureType 2, 0, 0, 4 texturemark_6 label wordTextureDataEnd label word; ---------------------------------------------------------------------------------------------------------VTPEnd label wordNote the waves in the skinny section are wrong... you'll need to breakup the lines here, and use the non-wave texture.Read through 'terraintextures.cfg' in the main FS2002 folder.If this is Falco's resulting code... it looks good.If there is a restraint on the number of lines allowed, remember you can cut'n'paste segments of code together as they test OK, to eventually create one BGL.There is a rule for spanning multiple cells:Cells are in U,V order ( like x,y ), with U as Longitude, and V as Latitude.The cells need to be arranged in the index as latitudinal V bands, starting with V as 0, then V as 1, etc. in order.Within each V band, they need to be arranged in U order... U as 0, then U as 1, etc.so Cells 0,0...1,0...2,0...3,0....... Until the V band ( latitude ) is done. Then go on to the next V band Cells 0,1...1,1...2,1... until that V band is done.So watch the Cell index order when spanning cells.Within the cell, I haven't seen a problem, but you may wish to rearrage your LOD13 Area entries to follow the same rule. It may make a difference in Framerates or texture 'popping'. Area 0,0...1,0...2,0......then 0,1...1,1...2,1 completing each y band before moving south to the next band.Dick

Share this post


Link to post
Share on other sites

Hi Dick,It is interesting you are suggesting this because I had a similar idea today about the same thing! What I was thinking was something along the same lines as afcad which reads the fs coordinates and allows placement of objects. Unfortunately I have no idea as to how to implement this but I think the idea is excelent.Cheersjmf

Share this post


Link to post
Share on other sites

Hi David,the SCM2VTP program only reads the old style refpoints and does not like the backside of the world. This I will fix in the next days. In the meantime you can get the program to run if you change the FSSC RefPoint coordinates from W001: to W01: To get your roads loking like coasts you should increase the width of the road from 10 m to 63 m. The width is limited since only one byte is used for the width. In the ASM file you have to change the "VTPWidePointWidth 10" to "VTPWidePointWidth 63". Maybe also the "VTPLayer 31, 0" has to be changed to "VTPLayer 8, 0" since 8 is the layer number for coastlines, 31 is for minor roads, as allready mentioned by Dick.best regards Falko

Share this post


Link to post
Share on other sites

Hi,Why is it neccessary to define the first point of a polygon three times as you can see in the following example? . . .VTPWidePoint 9265, 1, 11058, 0 <--- firstVTPWidePointWidth 1 VTPWidePoint 9265, 1, 11058, 0 <--- secondVTPWidePointWidth 10VTPWidePoint 9265, 0, 11058, 0 <--- thirdVTPWidePoint 9275, 0, 11059, 0VTPWidePoint 9307, 0, 11062, 0VTPWidePoint 9333, 0, 11065, 0VTPWidePoint 9347, 0, 11063, 0VTPWidePoint 9356, 0, 11048, 0VTPWidePoint 9336, 0, 11018, 0VTPWidePoint 9307, 0, 11004, 0VTPWidePoint 9275, 0, 10988, 0 . . .Regards, Heinrich

Share this post


Link to post
Share on other sites

Hi Falko!I've tried your programm. Amazing!!!Thank you Falko!!! I never thought making FS2k2 roads could be so easy.By the way: Could you also write a new version that is compatible to the SCA-code by SCC2000 (Schiratti Commander)?Best regardsSasa

Share this post


Link to post
Share on other sites

Hi Heinrich.I think I can answer this.All lines in FS2002 need to start with a width of 1, but unless you want your line tapered like a snake at the end, you proably should repeat the Point with a larger width. The third Point may be redundant, but it does no harm.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