Sign in to follow this  
Guest Che Monro

VPT2 lines issues in Ground2k4 v5.40

Recommended Posts

Every so often someone asks me with some incredulity why I am still using ground2k4 to design my scenery. The implication being that there are newer and better tools out there now. The fact is that I haven't found anything better or more reliable than Ground2k4 for making the kind of polygon based ground scenery that I do.However I have experienced problems with VPT2 line definitions with greyed and empty texture boxes and I know I'm not alone in this. People have previously reccommended:* Rolling back to version 5.33* Redefining the FS9 directory to re-hook G2k4 up with the lines cfg file* Installing the latest version of tdfmacros.I have had some success with:*reinstalling Ground2k4 from scratch*loading a file with working lines and then swapping back to the scenery giving problems. *Entering the line texture number in the text box referring to ownlines4.txt (in the ground2k4/resources folder) for the correct number.In the process of this fiddling around I have had the opportunity to observe this error at close range and I am going to speculate as to what I think might be going on. I've been using custom textures to define VPT2 polygons, and I've used Holger's custom line textures to make white water lines, editing ownlines4.txt to define a custom line type. I think that what is happening is that the "polygon data cache" in ground2k4 is getting corrupted and this is confusing the line editing dialogue box.When you draw a polygon ground2k4 stores the information about the polygon type in what I call the "polygon data cache". When you subsequently start a new polygon it pulls this data up and so you can continue to draw a new poly of the same type without redefining texture and height and options etc, if you wish to.I think that when I draw a VPT2 poly with custom textures, or something comparatively unusual like this, the values in the data cache are retained so that if I go in to try and draw a line such as a road or a river the dialogue is reading these old values and attempting - but failing - to draw them - so it shows up either a greyed out texture list or just an empty box. Unfortunately these corrupt values seem to be persistant so even if you save the file and come back the line editor is still upset which effectively blocks the user from defining or editing any more lines in that file. I think what the editor should do when it gets to this situation where the stored data is inappropriate is to detect the problem and initialize the data, that is "lossy" in that it spills information, but um, if I'm going from trying to define a complex custom poly back to laying down a common line I believe that I'm more worried at this point - speaking as a user - about the line editor working properly than I am about loss of cached data. In fact, you could just have the line editor initialize the values every time you go into it. Simple fix, I think, if I am right about the cause of the problem. I'm going to send a copy of this post to Christian Fumey in the hope that it's useful to him.In the meantime, I've been trying to manually edit the LWM file to put in the appropriate line texture for my lines. This is how the LWM file represents a railway I'm trying to define:The bottom numbers are the points, the middle numbers are the line type definitions and the empty quotes are filenames of custom textures. The thirteenth number along: 121 seems to represent the texture type of the line (or polygon). "" "" 1 11 -9999 0 0 1183 20 2 0 31 0 0 1 121 4 0 0 1 16 0 0 0 1 1 1 "" "" "" "" "" "" 96.8006600715836 563.703983459958 226.14005754985 513.673798940892 400.582614669065 469.61312507467 507.971049233818 458.811153417144 612.295354452552 446.303607287378 747.099351133607 419.074324612062 850.57086911622 408.272352954536 964.781601569937 408.556615366577 972.172424282981 408.556615366577 1025.61375774653 424.475310440825 1035.84720457997 427.033672149186 Therefore my question is: What number should I change this 121 to in order to define a railway, rather than the pale grassy line I'm getting now? What other numbers are significant?Che

Share this post


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

Hello Che,The incredulous who wonder why anyone still uses Ground2K simply have not been around to see the entire development of terrain scenery design. Ground2K is still the most complete terrain scenery tool available, the only one that will handle all terrain elements (even many that nobody ever uses!) and that contains very extensive and intricate algorithms that simplify design (for example, the "Coastlines" option that automatically draws a Water Mask, or the automatic detection of nested polygons and automatic layering of them.)While other tools such as Luis de S

Share this post


Link to post
Share on other sites

Hello Luis,I think, the Ground2k$...asm files are not the problem. These are simple bgl source files, not data caches. Everytime you compile a scenery, the asm files are generated. In a second step these files are compiled by bglc.exe to the bgl library files. If you load another G2k project and press compile, these file are overwritten by new data from the new project.I find Che's theory quite interesting. At least it would explain why I never had this problem: I never used own textures.As far as I know, G2k leaves not much persistent data (other than the project and the ini file and maybe in the registry). When the data inside the program gets corrupted during execution, a simple program restart should help.Maybe you should load another "working" project files. (*)Perhaps you must pay attention, that your last VTP object is one without "own textures". Or the first one... Or... :)Well, pure speculation, maybe Che can invite Christian Fumey back into the G2k scene.Cheers,Edgar(*) A test would be, if, when G2k menus are grayed out, the creation of a new project would restore the menus.

Share this post


Link to post
Share on other sites

Note: There are two error states that the lines dialogue gets into - greyed and whited. Greyed is where the lines textures are there but unselectable, whited is where the textures are missing and the box is completely white. Experimentation reveals the following: 1. Deleting the ASM files and loading pipeline.LWM and selecting a line brings the dialogue box to the greyed error state. 2. Starting a new project and starting a new line puts the dialogue box into the whited error state.3. Recompiling the pipeline file, exiting and re-entering reveals that selecting a line gets greyed box and starting a new line gets whited box.Conclusion:What I have demonstrated here is that1. ASM files are generated by the compiler and deleting them has no effect. 2. Starting a new project has no effect either.Can someone please email me and I'll send you my pipeline.lwm and pipeline.jpg and we can see if the effect migrates to your computer?c h e m o n r o @ b i g p o n d . c o m What I'm really looking for is a work around where I manually edit the values in the lwm file and get it working again. That will satisfy ME. Che

Share this post


Link to post
Share on other sites

Thanks for the comments, guys, and thanks for testing it, Che.As far as that goes, I have never, not once, used ownlines with Ground2K4, and yet I have gotten the missing lines problem occasionally. Not often, though. My solution is simply to re-confirm the location of the FS folder (since Ground2k4 gets line definitions from the default terrain.cfg) and this always works for me.But, apparently not for many others.Which leads me back to Che's comments concerning some sort of cache. While there does not seem to be one, we do know that Ground2K4 has problems handling very large files (large background bitmaps and large project files). I believe that Christian even mentions this in his lengthy notes.Just pure supposition again, another stab in the dark, but perhaps this is happening to those with large projects. It might be that the program exceeds allocated memory and starts losing bits of information.So, Che would be right and it would somehow have something to do with a cache. But, again, this is all just a guess on my part.As for editing the lwm file, Che, just replace with your values and see what you get. By the way, Che, I suspect that you want to replace the value "1183" - this is grass, according to the terrain.cfg. But, then, this value refers to an airport background, not to a line(?). Anyway, a railroad should be value "1210".Best regards.Luis

Share this post


Link to post
Share on other sites

Luiz, your solution works, thank you. I'd like to conclude by listing the work-around I'm using to get past the lines problem because it may help others. 1. I define the lines I need for the project without defining a texture - leave the box blank.2. In my particular instance of the lines problem the "line texture" seems to be stuck at 1183 - an invalid grass texture. I go into notepad and edit the ground2k .lwm file for the project and I see poly/line definitions that look like this:1 11 -9999 0 0 1183 20 2 0 31 0 0 1 121 4 0 0 1 16 0 0 0 1 1 1The line texture is the sixth number - 1183 in my case. For other people it may be something different - the point is that it's invalid. 3. I do a search and replace on "1183" changing it to "1210" which is the railway line texture. 4. I save the file.5. I go back into ground2k4 and open the project.6. All of my lines are now set up as railways - I edit them all and change them to the correct texture and save again. I find that once this has been done the editor is happy again and seems to work for defining new lines or working in new projects. Hope this helps, Che

Share this post


Link to post
Share on other sites

Hello Che,glad to here, that you solved your problem!It would be interesting to know, how your line texture changed to 1183 anyway. It is not in (my copy of the) ownlines.txt and I cannot select such value in the line box.Best regards,Edgar

Share this post


Link to post
Share on other sites

Today I got for the first time the "disappearing/white VTP2 Line" problem.I got it solved by changing the Ground2K4.Ini file in the g2k/Resource folder. I replaced the line "Lt_Rt_Effet= 1183" by "Lt_Rt_Effet= 1181". After restarting G2k4 I got all line texture ids back.I think, the problem is caused by a mix of "vtp2 line" texture parameters and "airport/park" background texture parameters.The LWM project file contains a field for line textures (the 6th) and a field for vtp2 polygon textures (the 14th).Unfortunately Ground2k4 writes the vtp2 poly texture id for "airport/park" polygons in the line texture field (the 6th.). But I think, it should be the 14th - for polygons...The value of every element in the dialog box is saved into the ground2k4.ini file. After you used any "airport/park" textures, their ID is saved into the value "Lt_Rt_Effet". When you open the object dialog again, then select "Line/lakeShore" and try to select a vtp2 line texture in the box, Ground2k4 tries to initialize the line box with the value i.e. 1183 (from "airports/parks"), but fails, because 1183 is not a valid value for line textures. Result: a blank box.Changing "Lt_Rt_Effet" to a valid number (like 1181 - 'dirt / 10 lanes') repairs everything (after a G2k4-restart). (Or simply delete the line with 'Lt_Rt_Effet = ')For something completely different: What is the difference of using landclass ids and 'airport/park' texture ids for VTP2 polygons anyway?Why are they different? When to use what? Do have polygons with 'airport/park' texture ids no autogen?Best regards,Edgar

Share this post


Link to post
Share on other sites

Great news, Edgar. This solution will solve a big headache for many.I have "1183" as the value in my copy of the ini, and it does not prevent me from seeing the lines in the selection window. Perhaps we could compare files to see if there are any other discrepancies. Here is mine:[Ground2K4]Fl1Fois=1KeepSrce=0Language=US;DerApt1=C:Ground2K4proyectoslas terrenasLas_Terrenas.LWMDerApt2=C:Ground2K4proyectosantiliaAntilia.LWMDerApt3=C:Ground2K4proyectosVirgin_Islandstestvirginstest.LWMDerApt4=C:Ground2K4proyectosVirgin_IslandsBritish_Virgin_Islands_terrain.LWM;DirFS=C:Program FilesMicrosoft GamesFlight Simulator 9Editor=ShowVTP1L=0DerRefLu=Lt_L13_Attrib= 0Lt_L13_Alti= 0Lt_L13_Ck11= 1Lt_L13_CkIM= 0Lt_L13_OtIMV= 2Lt_L13_CkCustom= 0Lt_L13_OtLC= 1Lt_L13_LC= 253Lt_L13_Layer= 7Lt_L13_Texte=Lt_L13_Tex_Name_0=Lt_L13_Tex_Name_1=Lt_L13_Tex_Name_2=Lt_L13_Tex_Name_3=Lt_L13_Tex_Name_4=Lt_L13_Tex_Name_5=MLOD_Chk_Fill1x1= 1MLOD_Opt_Attrib= 1MLOD_Alti= 1MLOD_Chk_InvertMask= 0MLOD_Opt_InvertMask= 0Lt_Rt_Attrib= 0Lt_Rt_Alti=-9999Lt_Rt_Opt_Meter_Feet_LWM= 0Lt_Rt_Opt_SurfShore= 0Lt_Rt_Effet= 1183Lt_Rt_Largeur= 64Lt_Rt_Chk_LandOnRight= 0Lt_Rt_Chk_FermerLine= 0Lt_Rt_Layer= 32Lt_Rt_Text_Rt=Lt_Rt_Imbrication=Lt_Rt_Nr_Ima= 0Lt_Rt_Opt_LWM_VTP2= 1Lt_Rt_Opt_LandClass= 2Lt_Rt_LandClass= 135Lt_Rt_Layer_Vtp2= 35Lt_Rt_Alt_Coast= 0Lt_Rt_Chk_Line_Night= 0Lt_Rt_Chk_Vtp1_Line= 0Lt_Rt_Chk_Drive_Right= 1Lt_Rt_Chk_Effil_Deb= 0Lt_Rt_Chk_Effil_Fin= 0Lt_Rt_LayerScasm= 16Lt_Rt_Opt_VTP1_SpecNor= 1Lt_Rt_Chk_Flip_VTP1Texture= 1Lt_Rt_Texture_Name_0=Lt_Rt_Texture_Name_1=Lt_Rt_Texture_Name_2=Lt_Rt_Texture_Name_3=Lt_Rt_Texture_Name_4=Lt_Rt_Texture_Name_5=That value seems to refer to effects (although I assume that "Rt" means "route", or street). Probably it just means the line type as you say.Interesting that Ground2K writes the value in the wrong place. Does this mean that vtp polyogns do not work correctly for you?I have no idea about the airport backgrounds. I have not been able to get them to work, and only get normal grass when using different types. Perhaps the airport background option is meant to provide different ground textures without their accompanying autogen.Best regards.Luis

Share this post


Link to post
Share on other sites

Hello Luis,unfortunately I have no access to my copy of g2k4 until the weekend.I'll send it to you on Saturday.The compilation seemed to be fine. But I didn't checked the result bgl in the FS.I made a simple test project with 3 rectangels: a line, a VTP2 landclass poly and a VTP2 'airport/park' polygon.The resulting asm file contained 2 polygons: one with the texture of a landclass id (i.e. '24') and a second polygon with an 'airport/park' texture id (i.e.'1183'). The asm code is fine and compiles. It is identical, just different texture ids. The 3rd rectangle formed a line (as expected).Best regards, Edgar

Share this post


Link to post
Share on other sites

More on this, Edgar. Here is what I found:Selecting an existing line and calling up the Properties window, if I change it to a Poly - VTP2 and then choose the Airport/Park section,EVEN IF I DO NOT CONFIRM the change of the line to this, but CANCEL, then when I next try to get the Properties of the line, the line selection box is empty!I can always get it back by going to General Parameters and clicking on OK (confirming the path to terrain.cfg.)If I create a new Line/Poly and make it a VTP2 and choose the Airport/Park section, even if I do NOT confirm but just CANCEL, I lose the line selection window for other created lines.Again, going to General Parameters and clicking OK always brings back the line types.So, for me, just going to Airport/Parks in the VTP2 section causes this behavior.I tried small projects and also my largest project with a 80 MB bitmap, just to see if there was any difference, but they were all the same.I tried changing the entry in the ini file to value 1024 - the first of the lines, a stream, and was still able to get the lines to disappear. Then, I took out that entry from the ini, but it was still possible to have an empty line selection box, so for me this did not work.So, as far as I am concerned, the problem is with the Airport/Parks section.It would be interesting to know if Che or anyone else who has had this problem was trying to create an Airport background using this section. For that matter, when you had the problem, were you in there as well?If this turns out to be the cause, then the solution is easy enough. As far as I know, the Airport backgrounds can be created using land class for grass, thereby avoiding this section.Parks, on the other hand, may be a problem. I have created City, Grass, and Forest Parks in SBuilder and they seem to work fine, but they may not work in Ground2K. More testing is needed.Best regards.Luis

Share this post


Link to post
Share on other sites

Hello Luis,I had a look at my copy of the ground2k4.ini file, but didn't see any obvious difference. Although I was able to destroy and repair the function of the line-texture-id box with changing the value of "Lt_Rt_Effet", there is a more radical way to repair the problem:After closing the application ground2k4, you can delete in the file '(ground2k4-folder)/Resource/Ground2k4.ini' every line starting with "Lt_Rt_*" and "Lt_L13_*". The next time you start ground2k4 and open and close the object dialog box, the values are restored to default values and the lines in the ini-file are rewritten.Maybe someone else can check this out on his copy (keep a backup!) and confirm it.The problem seem to be caused, as Luis said, be selecting any value in the "airport/park" line box and leaving this page of the dialog box.The question remains for me, for what are these textures good for anyway - they seem to have an equivalent in the landclasses...Best regards, Edgar

Share this post


Link to post
Share on other sites

Great news, Edgar. I shall get back to you privately as soon as I can do some more extensive checking.As for the airport backgrounds, I assume that the FS team wanted some way of providing alternatives to grass, particularly thinking of typical American strips (such as in the bush in the Pacific Northwest, or somewhere in the Sonoran desert in Arizona or New Mexico) where grass would not be appropriate.The advantage, then, of airport backgrounds is that one could pick a ground texture that matches the surrounding terrain and, since AB excludes autogen, not have to worry about trees sticking up in the airport.However, this VTP - airport backgrounds does not work. I thought that it was just because the entries in the terrain.cfg do not contain the lines that refer to the necessary textures. All entries in terrain.cfg have such references to the textures used, except for airport backgrounds.Well, could it be fixed, and could the various types of airport backgrounds be made to work by adding these references? These are the changes that I made to the terrain.cfg: Airport Backgrounds // UnknownType=1Size=4ExcludeAutogen=1MaskClassMap=2 // GrassType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=128 // AridType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=129 // DirtType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=131 // TundraType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=013 // CoralType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=132 // LavaType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=133 // Low Sparse GrasslandType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=052 // Cold GrasslandType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=009 // Cool Grasses and ShrubsType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=009 // Marsh WetlandType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=018 // Mire Bog FenType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=017 // Sand DesertType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=002 // Bare DesertType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=002 // Semi Desert SageType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=003 // Semi Desert ShrubType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=003 // Barren TundraType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=013 // Upland TundraType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=013 // IceType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=001As usual, replace with square brackets as needed. As you can see, I simply added a reference to a texture for each entry. Rather tentative, as a few use the same texture.However, I have not noticed that this has worked. It still needs more testing, but in some existing airport backgrounds, I still seem to be getting grass (although I could very well be mistaken, I shall get back to you on this.)Parks, on the other hand, work fine, because they already have this texture reference, for example:// Parks // City ParkType=1Size=4ExcludeAutogen=1Textures=134Unfortunately, it seems that this part of the Ground2k4 selection window is faulty.So, if you want to create a parks VTP, then you will temporarily lose the line selections, unless you follow Edgar's advice and apply his solution.On the other hand, there is NO point in trying to create an airport background this way since that is not functional in the terrain.cfg. So, for airport backgrounds, use VTP - land class instead, and if you do not use grass, but some other ground texture, then create an exclude for your airport background.I hope that we have found a solution for this problem and that nothing else pops up to spoil our fun!Best regards.Luis

Share this post


Link to post
Share on other sites

I made a silly mistake. In the above modifications to the terrain.cfg, I used the ground texture values instead of the land class, and that is why it did not seem to work.Here are the correct texture references - modify your terrain.cfg accordingly: Airport Backgrounds // UnknownType=1Size=4ExcludeAutogen=1MaskClassMap=2 // GrassType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=128 // AridType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=129 // DirtType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=131 // TundraType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=63 // CoralType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=132 // LavaType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=133 // Low Sparse GrasslandType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=2 // Cold GrasslandType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=42 // Cool Grasses and ShrubsType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=40 // Marsh WetlandType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=45 // Mire Bog FenType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=44 // Sand DesertType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=50 // Bare DesertType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=8 // Semi Desert SageType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=52 // Semi Desert ShrubType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=51 // Barren TundraType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=53 // Upland TundraType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=9 // IceType=1Size=4ExcludeAutogen=1MaskClassMap=2Textures=122And it does work as you can see:http://forums.avsim.net/user_files/149036.jpgBut, just remember that you will have that problem with the line selection box in Ground2k4 if you make airport backgrounds this way.In addition, autogen is not excluded, which is probably why the developer chose not to activate the airport backgrounds for this version. This means that you will get autogen on probably all your default airports if you make the changes to the terrain.cfg. Too bad.Best regards.Luis

Share this post


Link to post
Share on other sites

Great work, guys. :) Yes, I have tried using airport/park textures and custom background textures - kind of significant that it was a "grass" texture that was showing up I think - that's a airport/park texture, not a line texture.For mine I'm happy enough that there's a solution/work around so that I can keep plugging away with ground2k4. And I'll avoid the airport/park section in future!Che

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