1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SBuilder Causing GPS CTD?

Discussion in 'Ground2k4, SBuilder, SBuilderX' started by davidglaister, 7/1/06.

  1. davidglaister

    davidglaister

    Joined:
    26/12/05
    Messages:
    13
    Country:
    england
    Hi,

    I've posted this at the Avsim forum, but thought I would also post here hoping for a quick response.

    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:

    “IOW_Solent_LWM2.BGL” and “IOW_Solent_LWM3.BGL”

    I have have searched for a solution and the most likely fix I can find is this thread from a forum post from the PTSim forums:

    ==================================================
    The answer is in the SCASM macro Area01x01.scm that you find in the Tools folder. Here it is:

    ; Area01X01Poly.scm macro

    ; used instead of AreaFill 1X1 to avoid crashes (?)

    ; %1 = type 0=water 1=land 2=flatten 3=transparent
    ; %2 = column 0 ... 31
    ; %3 = row 0 ... 31
    ; %4 = height if type=0 or =2

    mif( <%1 == 2> )
    LWMAreaDrawPoly( 1 2 %2 %3 )
    melse
    LWMAreaDrawPoly( 1 3 %2 %3 )
    mifend

    mif( <%1 == 1> )
    LWMPoly( 4 1 %4 1 1 255 1 255 255 1 255 )
    melse
    LWMPoly( 4 0 %4 1 1 255 1 255 255 1 255 )
    mifend

    Just change %4 to -9999 in the 2 LWMPoly lines and then compile again. The first LWMPoly it will look like:

    LWMPoly( 4 1 -9999 1 1 255 1 255 255 1 255 )

    Attention: do not forget to replace the file when you are ready with this patch.
    ====================================================

    Does anyone know if this would be the problem, and if so how do I fix it?

    Thanks, David
  2. Ayrsimming

    Ayrsimming

    Joined:
    2/1/05
    Messages:
    110
    Country:
    scotland
    Hi David

    In the Preferences-BGL settings do you have the 'Area Fills as Polygons' option activated.
    If not, I have found that this can cause your type of problem.

    Iain
    Scotflight
  3. davidglaister

    davidglaister

    Joined:
    26/12/05
    Messages:
    13
    Country:
    england
    Hi Iain,

    Thanks for the reply, I'll see what happens.

    David
  4. davidglaister

    davidglaister

    Joined:
    26/12/05
    Messages:
    13
    Country:
    england
    Hi again,

    I have made the change that you suggested, this fixes the Crash, But the mesh and remesh is flattened in the coastal areas.

    Are there any other changes I need to make?

    David
  5. Ayrsimming

    Ayrsimming

    Joined:
    2/1/05
    Messages:
    110
    Country:
    scotland
    Hi David

    You must have some areas as 'land masks' around the coast. ' Land mask' will flatten the area covered. If you have areas which are water but should be land then use the 'landclass' feature to fill these areas and you will not lose your mesh.

    Iain
    Scotflight
  6. davidglaister

    davidglaister

    Joined:
    26/12/05
    Messages:
    13
    Country:
    england
    Hi Iain,

    I have found that after changing the Sbuilder preferences as you said, and changing the line in the "Area01X01Poly.scm macro" from

    LWMPoly( 4 1 %4 1 1 255 1 255 255 1 255 )
    to
    LWMPoly( 4 1 -9999 1 1 255 1 255 255 1 255 )

    the CTD appears to be fixed, does that seem logical?

    I don't want to post a patch for the scenery and find the CTD still happens.

    David
  7. Ayrsimming

    Ayrsimming

    Joined:
    2/1/05
    Messages:
    110
    Country:
    scotland
    Hi David

    Someone else will have to comment on the changes you have made to the file.
    For exactly the same problem with CTD's that you were experiencing the only step I had to take was the one I mentioned earlier. The scenery involved has been released for a couple of months now and I have had no feedback on further CTD's.
    If you are in doubt about the changes working, have you access to some testers who can run your revised files for a few days?

    Iain
    Scotflight
  8. bpahe

    bpahe

    Joined:
    3/6/04
    Messages:
    333
    Country:
    sweden
    Hi David!

    The solution that you have used is the one that I had to implement using earlier versions of SBuilder, as I had the same problem with AreaFills. The theory is that by using -9999 you make the fill/polygon mesh-clinging. As I have not repeated the procedure using the latest versions of SBuilder, I cannot confirm whether it is right or not, all I can say is that several users have tried out the files that I made without having any problems.

    /hans
  9. davidglaister

    davidglaister

    Joined:
    26/12/05
    Messages:
    13
    Country:
    england
    Thanks for the answers,

    After recompiling the files with the settings discussed, I sent them to four or five people who had reported the CTD. All replies reported that they had not experienced the crash after installing the new files, and nobody has reported any other side effects, so I think I may release the patch now.

    Thanks for the help, David

Share This Page