Sign in to follow this  
LuisFelizTirado

GPS causing crash

Recommended Posts

Hi,I have just released my isle of wight scenery at avsim. Feedback has been very good, but I have had a bug reported.When the GPS or map is displayed a CTD occurs. I think I have narrowed the problem down to two files created by SBuilder, these are:

Share this post


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

Hello David,There was some talk a few years ago about Fills no longer working correctly. While there are Fills in the default scenery, for some reason our replacement Fills would cause crashes when in GPS or Map view.The solution was to draw Water Masks instead of Fills (until somebody figures out what is going on - Dick, we need you again!). SBuilder will provide you this possibility in the Options menu. Just check this setting and recompile your scenery.Best regards.Luis

Share this post


Link to post
Share on other sites

Hi Luis,Thanks for the reply.I checked "area fill as polygons" in SBuilder, and recompiled the scenery.This has now cured the CTD but, now the mesh and remesh areas are flattened in the coastal regions.Any idea why this is happening?David.

Share this post


Link to post
Share on other sites

Hello David, Sounds strange. Normally, the Fills are out beyond the Water Mask defining the coast and so should not have an effect on the land.Perhaps you could provide more details and some illustrations so that we could better understand the problem?Best regards.Luis

Share this post


Link to post
Share on other sites

Hi Luis,As I mentioned, after a changed the BGL option in Sbuilder the crash to desktop was fixed, but the mesh and remesh areas were flattened.I have attached two screenshots one from the sim and one from Sbuilder. The flatten area appears to be where the 1x1 area fill land masks are.If I edit the lines in the

Share this post


Link to post
Share on other sites

Hello David,I think, you put your finger exactly at the right spot: Using -9999 as height value of the flatten-polygon, you told the engine to not use any height value from this poly and rather use height values from below (other polygons or mesh data).Best regards,Edgar

Share this post


Link to post
Share on other sites

Right, right, I am starting to see now.As Edgar pointed out, it all probably has to do with the change you made in the altitude of the polygon.I misunderstood at first and thought that you were using Water Fills.So, a short explanation. Fills are probably a more efficient method of changing the characteristics of an Area than a LWM polygon. No points to draw and less code for the graphics engine to read. A Fill can be either Land or Water (or a Flatten, although I have never used one. Here is an example of Fills in the water surrounding the Water Mask:http://forums.avsim.net/user_files/138463.gifYou can set the altitude of a Fill to anything you want. SBuilder seems to assume, as I did, that the Fill will be used in water and so, by default, sets the altitude to 0 metres.But, if you are using a Fill on land, then you want it to follow the relief of the underlying mesh. In this case, you should set the altitude to the mesh-clinging value of -9999.If I understand correctly, your previous Fill, with an altitude of 0 metres, was smashing the relief down (and, in addition, provoking crashes). By setting the altitude to -9999, you have now got the altitude mesh back and it looks strange and unexpected. But, it should be the normal relief.To resume, you do not have to change the altitude value of the Fill in the SBuilder configuration file. This can be done in the Fill dialogue box. Use -9999 as the altitude if you want the Fill to "cling" to the mesh.I hope that this is right!Best regards.Luis

Share this post


Link to post
Share on other sites

Hi,I'm still not convinced on this.The grey areas in the SBuilder screenshot in my earlier post are land mask area fills and SBuilder has the altitude box greyed out.The reason they are included is because even if I set set a landclass for the area the sim has it marked as water, and will not show land.Until I checked the box in SBuilder for "area fills as polygons" everthing would display correctly, but a crash would occur if the GPS window was shown.Now the box is checked, the sim will run, but I get the flatten effect unless I edit the "Area01X01Poly.scm" file.Is it possilble to mark the areas for land using another method other than setting the squares for land mask in SBuilder?Thanks for the help, David.

Share this post


Link to post
Share on other sites

Hello David,why not follow the way of using "area fills as polygons" and replacing the "%4" paramter with "-9999", when it works? :)To explain it the other way:The way described in the FS SDK to fill an area with land (or water) is to use a BGL macro "LWMDataAreaFill1x1" - unfortunately this works only in FS2002, but crashes in FS2004. (*)The known workaround is, to replace the small BGL macro (1 macro with 3 parameters) by a larger construct: a LWM polygon of 4 points, covering a whole area. At least 4x2 parameters and 5 macros.But here you must provide a height value (which seems to be 0 with SBuilder). If you provide the value -9999 you get a mesh clinging polygon. This is, what you need here.I believe, SBuilder uses SCASM commands rather than BGL macros, but the principle applies to both approaches. Both compile to the same binary data.I see too in your second picture, that Sbuilder shows the value 0 and grayes out the Edit-Box. See, if you can change the value to -9999, if you select flatten and later switch back. An other way is to create a LWM mask of land for the desired place. This polygon can have any shape, not only an area-square. But how to do this with SBuilder? I am not familiar with SBuilder.Best regards,Edgar(*) I think I remember a message here in the forum, that LWMDataAreaFill-macros work in FS2004, when you use LWMPoly3 macros. But then you need height values for all points. ... I might be wrong anyway...

Share this post


Link to post
Share on other sites

"Curiouser and curiouser", as a wise man once said. This is becoming more and more interesting, David.I think that Edgar has got it right and I have not been understanding this problem at all.According to the SCASM documentation:LWMAreaFill( size type col row height ) Fills a subsection of a cell.This command combines the 5 LWMDataAreaFill?x? commands described in the FS2002 SDK. row and col define the upper left corner of the fill area.Note: it is reported that the use of this instruction can crash FS2004. Maybe FS2004 does not allow to replace/overwrite this part of its database.size Area size to fill, covering areasize: covering: column/row range:1 1x1 0 - 312 2x2 0 - 154 4x4 0 - 78 8x8 0 - 316 16x16 0 - 1type Fill attribute0 = water1 = land2 = flatten3 = transparentcol Column of the fill arearow Row of the fill areaNote, the column and row range depend on the cell covering area.height Area height value in meters, only used if type is water or flatten.Please note the last line. Since Manfred must know much more about this than me, we can assume that Fills only have height information when they are either Water or Flatten types. So, this is most likely why Luis de S

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