Jump to content
Sign in to follow this  
rhumbaflappy

Problem with map in FS2004?

Recommended Posts

Guest knnygar

I have for a while worked on changing the shoreline with LWM and VTP2.This worked fine in FS2002 and it looks good in 2004.But when I try to open the map in 2004 it crashes :(I wonder if this is a problem with my scenery or FS2004?Has anyone else experienced this?

Share this post


Link to post
Share on other sites

Hello Knnygar,as Rainer Duda and others reported, there is a a problem with the areafill command in FS9.If this command is used, FS9 crashes in the map view modes and in the GPS. You can replace this command by land-LWM polygons.Regards,Edgar

Share this post


Link to post
Share on other sites
Guest knnygar

After some research I think I found the file that has the problem.It is a LWM-file.I cannot find any problem with it except the map-problem.Could someone please look at the file and see if they can find the problem?

Share this post


Link to post
Share on other sites

Hi knnygar.Christian Stock pointed out a few days ago that LWM polys in FS2004 differ from our FS2004 polys.This difference is enough to cause the crash in the map view. Apparently, they forgot to make the map backwardly compatible.TMFViewer doesn't show these new LWM polys.Dick

Share this post


Link to post
Share on other sites

Hello rhumbaflappy,can you point me to this thread?I can not find this message of Christian.Thanks,Edgar

Share this post


Link to post
Share on other sites

Hi Edgar.http://forums.avsim.net/dcboard.php?az=sho...5&mesg_id=14525Also, I think the Version number:LWMFileHeader 200h, LWMIndexStart, LWMStart, LWMEndwould now be:LWMFileHeader 300h, LWMIndexStart, LWMStart, LWMEndfor FS2004.The LWMs are different. That's not the basic problem... the map is the problem, but I doubt this is serious enough to trigger a patch from MS. But unless someone complains, they certainly won't patch it.Dick

Share this post


Link to post
Share on other sites
Guest knnygar

Is it any parcular LWM combination that causes the problem?I have another smaller LWM area in another file that doesnt seem to have the same problem :-hmmm

Share this post


Link to post
Share on other sites

I've seen it happen with areafills, but your code doesn't have them... so apparently it can also be triggered by larger multi-cell BGLs.I'm not sure there is a reliable work-around. The LWMs seem fine in the sim... just affecting the map. if you turn off the terrain function of the map, the sim doesn't crash.Dick

Share this post


Link to post
Share on other sites
Guest knnygar

But the "funny" part is that one of the cells show up normal.The rectangels show roughly the area I have worked with.Area 396,78 does show in the map and FS does not crash :)But I dont think I have done anything different in this area.http://forums.avsim.net/user_files/39424.jpg

Share this post


Link to post
Share on other sites

Hi knnygar.The LWM file structure has changed, and I've ben playing with it:; LWM3.inc; --------------------------------------------------------------------------------LWMPoly3 Macro PointCount, Reserved, Attrib, HeightStart, FractionStart, HeightEnd, FractionEnd; BYTE bPointCount:6 ; // Up to 62 points; BYTE bReserved:1 ; // Must be 0; BYTE bAttrib:1 ; // Polygon fill attribute, 0 = water, 1 = land BYTE ( Attrib * 80h ) + ( Reserved * 40h ) + PointCount SWORD HeightStart ; // Whole elevation value in meters BYTE FractionStart ; // Fractional elevation value in 1/128 meters SWORD HeightEnd ; // Whole elevation value in meters BYTE FractionEnd ; // Fractional elevation value in 1/128 metersEndM; --------------------------------------------------------------------------------LWMPoly3Ex Macro PointCount, Reserved, Attrib, HeightStart, FractionStart, HeightEnd, FractionEnd, ExPointCount; BYTE bPointCount:6 ; // Must be 63; BYTE bReserved:1 ; // Must be 0; BYTE bAttrib:1 ; // Polygon fill attribute, 0 = water, 1 = land BYTE ( Attrib * 80h ) + ( Reserved * 40h ) + PointCount SWORD HeightStart ; // Whole elevation value in meters BYTE FractionStart ; // Fractional elevation value in 1/128 meters SWORD HeightEnd ; // Whole elevation value in meters BYTE FractionEnd ; // Fractional elevation value in 1/128 meters BYTE ExPointCount ; // Number of polygon points = 63 + bExPointCountEndM; --------------------------------------------------------------------------------LWMPoint3 Macro x, y, z BYTE x ; BYTE y ; BYTE z ;EndM; ------------------------------------------------------------------------------The problem is I don't know why the elevation ( height and fraction ) is repeated... the second value seems to have no effect.The z value of the point description also seems to have no effect.A further problem is that the value of -9999 height is no longer mesh clinging.Here's the BGLC:include TDFMacros.incinclude TDFHeaders.incinclude LWM3.incBGLHeader 43, 41, -87, -89, LWMHeader , TerrainHeaderStartLWMHeader label word LWMFileHeader 300h, LWMIndexStart, LWMStart, LWMEndLWMStart label word datamark_0 label word LWMDataAreaDrawPolygons 4,3,1,31,23; ; Lake_NoBeach; LWMPoly3 6,0,0,296,0,-9999,0 LWMPoint3 255,64,0 LWMPoint3 224,41,0 LWMPoint3 214,31,0 LWMPoint3 229,15,0 LWMPoint3 247,37,0 LWMPoint3 255,52,0; ; Lake_NoBeach; LWMPoly3 4,0,0,296,0,-9999,0 LWMPoint3 255,68,0..................I've attached a zipped file for anyone curious.http://forums.avsim.net/user_files/39587.jpgDick

Share this post


Link to post
Share on other sites

Hi knnygar.EDITED:I think I found the problem. It's not actually related to FS2004!This is how we have been coding Cell ID's:Cell_398_79 EQU LWMCellID 0, 0, 3, 398, 79But we should be coding them as:Cell_398_79 EQU LWMCellID 1, 0, 3, 398, 79That number 1, ( runcount ) folowing the LWMCellID, tells the sim the cell has one identical index... we had been telling it "0".When I changed all instances to 1, the map behaves. :)No new coding needed or fooling with the version number. I rechecked the SDK, and they recommend setting the runcount and the following bit ( indexrun ) to 0... ...but if the indexrun is 0, the cell info will not repeat, so it is safe to use 1 for the actual runcount. And it now appears, for FS9, the runcount must be set to 1 ( and that's true... we're going to have it generate one instance ).I looked at my old LWM Tutorial, and I had stated using 1, unless a cell was composed of only areafills... that is wrong. Areafills can be mixed with poly code quite nicely, as long as you watch the datastream order and don't fill an area after you put polys on it.Cell_398_79 EQU LWMCellID 1, 0, 3, 398, 79Dick

Share this post


Link to post
Share on other sites
Guest knnygar

>Hi knnygar.>>EDITED:>>I think I found the problem. It's not actually related to>FS2004!>>This is how we have been coding Cell ID's:>>>Cell_398_79 EQU LWMCellID 0, 0, 3, 398, 79>>>>But we should be coding them as:>>>Cell_398_79 EQU LWMCellID 1, 0, 3, 398, 79>I tried this but it didnt seem to work :-( I wonder if LWMFileHeader could be a problem?I see you use LWMFileHeader 300h, but I have LWMFileHeader 513.I tried 300h but then FS crashes at startup :-(I'm a little short of time at the moment so I havent had time to experiment to much.I allso wonder if the problem could lie in the code somewhere?But the file is so big that it would take some time to go through it all.

Share this post


Link to post
Share on other sites

Hi knnygar.You're right. I mistakenly thought I had solved the problem.I'm afraid this is a BUG in the GPS and Map. If you don't use the terrain function, all is fine. It really is odd that the one Cell shows fine. How strange.:(Dick

Share this post


Link to post
Share on other sites

Hi, again, knnygar.I found that your code contains many of these types of lines:LWMDataAreaDrawPolygons 0, 1, 1, 27, 29That zero is apparently causing the sim's crashing ( in effect, I think it is an areafill ).I eliminated those lines by commenting out the code, and the Map's terrain view now seems to work.Please try this out, and see if that is the problem.Dick

Share this post


Link to post
Share on other sites
Guest knnygar

Yes, that worked :-sun1 I had to change from this; LWMDataAreaDrawPolygons 0, 1, 1, 27, 29 datamark_86 label wordTo this; LWMDataAreaDrawPolygons 1, 1, 1, 27, 29 LWMPoly2 0, 0, 1, 0, 0 datamark_86 label wordThank you so very much for your help :-beerchug

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