Sign in to follow this  
wsieffert

VTP Method1 BUG

Recommended Posts

Hi all.Davidg58 had pointed out to me that my CellGrid method of visually gridding off an LOD8 Cell into LOD13 Areas sometimes crashed his system! He uses Windows98.On my system, WindowsXP Home, I do not get a system crash, but occasionally I would crash to desktop. As I looked into the problem, I became sure my BGLC coding was correct. I then discovered FS2002 will crash if a VTP Method1 polygon exists, and the time turns to Dusk ( or Night, or Dawn ).I had wondered why there was no native VTP Method1 polys or lines in FS2002, and now I know why. The don't work unless it's day.This bug does not effect CFS2.With VTP Method1 polys useless in FS2002, we have a serious problem. The only way to display a mesh-clinging poly with control over display orientation, was with Method1. It would have allowed us to 'cut' a section from a texture and 'paste' it as we like in FS2002. Method2 'tiles' textures, so we have no control over orientation, just shape... fine for micro-managing small areas as landclass corrections, and they display autogen. Additionally, Method1 and Method2 have bugs in that they display mirror-image ( vetically ), and that cannot be worked-around in Method2.This is a serious limitation in FS2002. Unless a work-around can be found, the ability to display small, customised, mesh-clinging textured shapes is impossible in FS2002.Dick

Share this post


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

Dick,will this bug affect the possibility to create roads fs2002 style ?TN

Share this post


Link to post
Share on other sites

Hi TN.FS2002-style roads, shores, and streams are all VTP Method2 lines, and are fine. Vtp2 polys are fine, as well, but they are basically just ways to display lanclass in a polygonal shape. No control over orientation or what part of a texture actually gets displayed.But this VTP1 BUG does place a serious limitation on designers who wanted a method of laying photoreal or custom-textured polys.There are drawbacks to using the CUSTOM method of displaying an entire photoreal groundtile. VTP1s promised a way of overcoming all these problems... except they don't work at night, and the seasonal texture changes mentioned in the SDK don't work, either. So VTP1s are worthless for FS2002 ( but invaluable for CFS2 ).Another example of why I believe the team responsible for the publishing of the FS2002 Terrain SDK had never tried any of these methods... just like they obviously never used the newer Resample.exe ( or the older one for that matter ). I suspect they were temporary contract help, and they just didn't know what they were talking about.The actual design team knew the defects of VTP1, because they never used them in FS2002!Dick

Share this post


Link to post
Share on other sites

Dick, there is one isolated VTP1 file in FS2002. It's in the scenedbworldscenery dir and called lak.bgl. It is used for lakes in Iceland.Cheers, Christian

Share this post


Link to post
Share on other sites

Humm, interesting.Untill now we used the method2 and we have now covered the entire Netherlands with cities and villages, forests, industrial zones, etc using that.While adding all these polygons we often ran into crashes of the sim. These were caused by coding errors (of course :)) but also by missing textures or textures with the wrong format (only DXT1 seemed to work OK).So this brings me to the idea, does it maybe automatically expect a night texture and could that be the problem? I have haven't tested this, just a wild guess :).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Christian.That file appears to be an LWMPoly1 ( left over from CFS2 ? ). Those are CFS2-style mesh-clinging water masks. They work fine.The VTP1s are CFS2 shorelines and roads ( as strips ) and I don't believe VTP1 fans ( regular polygons ) exist anywhere.I'm going to import some CFS2 strips today, from CFS2, and see if there is a night crash. Maybe I'm missing something the SDK did not describe. ;)Dick

Share this post


Link to post
Share on other sites

Hi Arno.Method2 is fine. Method1 doesn't seem to allow a night texture to be accessed, or seasons, for that matter. And the Cellgrid generated polys are fine in CFS2, which has no night textures.I really believe this is a CFS2 poly only... never meant for FS2002, and the SDK material was just dead wrong. This is very symtomatic of the corporate method of completing projects by splitting them into goal-orientated components. One team is in charge of the terrain engine design, MS designates a team leader, he hires temporary ( contract) employees, they design to hit a goal, and deliver the engine to the scenery design team leader.....Nowhere in the process does anyone say " Wait! This doesn't work!". By the time the design team is formed, the engine team isn't even on the payroll anymore! There is no one left to fix the engine problem.And with the nature of goal-seeking, bonuses are paid to those team leaders that deliver their portion of the product on time. You actually lose money by finding and correcting defects. So you don't find them!Do any of us believe there is now anyone left to correct the SDK errors, or fix Resample, or Annotator? :-lol Maybe for FS2006.Sorry for the rant, Arno. For now, tell your friends to avoid VTP Method1s ( the 2s are OK ).Dick :-fume

Share this post


Link to post
Share on other sites

Hi all.Importing CFS2's "C:Program FilesMicrosoft GamesCombat Flight Simulator 2SCENEDBworldscenery" into FS2002 reacts as I expected.The VTP Method1 polys work in the daytime just fine. At night, they crash the sim.Don't use VTP Method1 in FS2002!--------------------------------------------Regarding VTP Method2s. These can be used to display CUSTOM textures. But there is no way to accurately 'cut and paste' a part of the texture into the sim. The textures are tiled to the LOD13 dimensions... our VTP2 shape just cuts a 'window' to allow us to see the preplaced tile. We can't rotate it or slide it over a little. All texture manipulation needs to be done in the texture itself.Additionally, for newer designers, you need to know that the VTP2 texture is mirror-imaged vertically. You cannot change this with VTP2. So you need to vertically flip the texture in a paint program, before you use imagetool for the final processing. Remember to do this, or your photoreal textures won't display right.Here's a pic that shows a VTP2 at dusk ( impossible with VTP1s )... note that the star has it's North indicator Mirror-imaged vertically... and would need to be changed to display correctly. Also note I used a Layer 4 to display the custom texture, so the default road will show over it ( might be useful for photoreal to allow default items... unwanted items can be excluded! ). The image was 8-bit, mipped, with alpha for transparency. As Bob Bernstein mentioned to me, the transparent area is slightly darker than the surrounding groundtiles... something to remember when blending-in the edges of photoreal slices. Dick

Share this post


Link to post
Share on other sites

Hi all.Here's a pic showing the tiling of the VTP2s. I just expanded the polygon, and the sim automatically tiles the texture to the LOD13 Areas exposed by the poly shape and size.Dick

Share this post


Link to post
Share on other sites

I just had a talk with the team member who has build all the mesh coding into our scenery tool and he has already build in the method1 polygons and they work fine. He also told me that he has got the night texture working fine.I'll try to get a piece of code here soon from the working file.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Hi Arno.The snippet of code would be great... also the code showing how he got the seasonal textures to work properly.Dick

Share this post


Link to post
Share on other sites

I haven't received the entire code yet, but he send me an example for the seaons/night textures:

Share this post


Link to post
Share on other sites

Hi Arno.Are you saying the zero-delimiter with the string is not used ( just the comma-delimited names, then the type and size info... no zero-delimiter to mark the end of the names )?Also, this appears to be from the SDK, as it is written for C++ code, not BGLC.Has the designer used this technique on polys ( not lines ). Has he used this on Method1 polys?Sorry for the questions, but I cannot get seasonal textures to work with custom-textured VTP Method2 polys ( fans ).And I cannot get Method1 to stop crashing FS2002 at night.I'm suspecting we are comparing apples and oranges... not really talking about the same thing.Dick

Share this post


Link to post
Share on other sites

Dick,The only way I survived working was to read Dilbert on a daily basis! At least, you can see you are not alone or you can see how inane that latest "Win-Win" course you boss just sent to was a big waste of time, but they still paid you!Really enjoying retirement! What's a timesheet!? Please remind me!:-lol

Share this post


Link to post
Share on other sites

Hi Arno.I just found a use of seasonal textures called by name in FS2002. :-lol MS has just 4 examples in the sim ( that I can find )! They are in "C:Program FilesMicrosoft GamesFS2002SCENEDBEasthemmadagasScenery" and are named "nphyp??????.bgl"The hex editor told me the separating delimiter is a semicolon ( ; ), not the comma ( , ) that the Terrain SDK tells us... so they are wrong again.I tried a file with the Semicolons, and it worked... commas do not work.Here's the code I used:include TDFMacros.incinclude TDFHeaders.inc; Delavan Single VTP1; 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, 1, 30, 22 VTPLayer 4, 0 VTPNumTexturesInLayer 1, 0 VTPTextureId 0, 0 VTPPolyCount 1, 0 VTPPolyMethod2 4, 0, 0 VTPPointXY2 11730, 9690 VTPPointXY2 11986, 9690 VTPPointXY2 11986, 9946 VTPPointXY2 11730, 9946datamark_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 "DelavanWi.bmp;DelavanHW.bmp;DelavanSp.bmp;DelavanSu.bmp;DelavanFa.bmp;DelavanLm.bmp" VTPTextureType 1, 0, 0, 4 texturemark_1 label wordTextureDataEnd label word; ---------------------------------------------------------------------------------------------------------VTPEnd label wordThis will place a seasonal/night texture set with a VTPm2 polygon. You might want to pass this code example along.Dick

Share this post


Link to post
Share on other sites

Hi all.After realizing the SDK was errored again, it got me thinking about Arno's suggestion that the sim was expecting VTP1s to have a night texture.So, I included a seasonal/night texture set, and used the newly discovered semi-colon ( ; ) as the name delimiter... and it works!!!No more bug. VTP Method1 polys MUST be supplied with a seasonal set ( semi-colon delimited ), or it will crash the sim at night.Here's the code... check out the 'VTPTextureName' entry:include TDFMacros.incinclude TDFHeaders.inc ; Delavan Single VTP1; 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, 30, 22 VTPLayer 4, 1 VTPNumTexturesInLayer 1, 0 VTPTextureId 0, 0 VTPPolyCount 1, 0 VTPPolyMethod1 4, 0, 1 VTPPointXYUV 0, 0, 0, 0 VTPPointXYUV 255, 0, 255, 0 VTPPointXYUV 255, 255, 255, 255 VTPPointXYUV 0, 255, 0, 255datamark_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 "DelavanWi.bmp;DelavanHW.bmp;DelavanSp.bmp;DelavanSu.bmp;DelavanFa.bmp;DelavanLm.bmp" VTPTextureType 1, 0, 0, 4 texturemark_1 label wordTextureDataEnd label word; ---------------------------------------------------------------------------------------------------------VTPEnd label wordThis is really great news! We can now use the advantages of VTPm1's placement andf orientation, with photoreal or custom textures.What a relief...I'm still mad at Microsoft. Those SDK editors had no experience with terrain design at all!Many thanks to you and your team Arno, for helping me think this through.Also, as Arno indicated, the set can be one texture, but must be named 6 times, then:"DelavanSu.bmp;DelavanSu.bmp;DelavanSu.bmp;DelavanSu.bmp;DelavanSu.bmp;DelavanSu.bmp"Dick

Share this post


Link to post
Share on other sites

Hi W.:-lol I can imagine how the worker bees of the terrain design team reacted when they were told "Well, don't use them if they don't work!"Thanks to Arno's insistance they should work... I found MS's error... it's in the SDK docs, again. :~P I should have known.Dick

Share this post


Link to post
Share on other sites

Hi W.No kidding! I'm enjoying some time in a "job bank". My corporation decided to give about 700 workers full 40 hour pay, with full benefits, to sit at home ( until at least next September! )It makes the manhours-per-product ratio look very nice, as we are paid from a different pocket. The obscene thing is, my co-workers who do not have enough seniority must still work... and they are working them 10 hours overtime per week!At least it gives me time to obsess over VTP polygons.:-beerchug to your retirement!Dick

Share this post


Link to post
Share on other sites

Dick,I can't wait until tutorial #next. There is just so much you guys are finding. Us novices can't keep up!!And so keep asking, were have all the scenery developers gone?! They're all right here trying to fix the SDKs, once again.However, it doesn't do any good getting mad at Microsoft. Just think of the satisfaction of discovering the solutions to their errors.Great Job, I really enjoy reading all the designers posts, even if I can only grasp 1/4 of it.:-beerchug

Share this post


Link to post
Share on other sites

Sorry for being too late, but I knew that...I had discovered those style 1 left over bgls a ehile ago, my decompiler can process them. They work the same as in the terraintextures.cfg, ';' instead of ','. I never noticed the SDK was wrong...You were right, Dick, I mixed those bgls up, lak.bgl is indeed LWM, it's those other ones you found now too, that still are VTP method 1...Cheers, Christian

Share this post


Link to post
Share on other sites

Hi Christian.It's lucky some MS designer experimented with them! We could have searched for weeks/months for a seasonal/night solution. Who knows what else will be wrong! I'm going to spend some time retracing our steps, and documenting what we know to be different from the Terrain SDK.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