• 23000+ Members! Dear Guest, join the community on the official RD Discord server today.   learn more

Problem/bug with terrain tool

Ghoults

1000RPM
Mar 30, 2009
1,280
918
I have found a problem/bug with the terrain tool in btb. Btb crashes when I try to add terrain next to the track with certain values. Below are a screenie of the error below and a way of reproducing the error.

I've managed to create a simple track and reproduce the error in "small scale". This simple track is attached in the zip.

Howto reproduce:
- start btb and open the track I've attached
- try to add terrain by using the "add to whole track" option. The parameters to use when adding the terrain are:
panels 1
sides right
distances 10
reduce 3 <- seems to be the critical. With value 1 btb doesn't crash for example.
randomness none
- press create and enjoy the fireworks

Btb always crashes and gives out the error message shown in the image when I do this. For some reason trying to add terrain by click&drag works for the track file I've attached but for my own track where this problem occured for the first time both methods (add whole track/click&drag) crash btb on this "difficult spot" of the track. The "reduce 3" seems to be the cause for some reason.

The track surface properties could be the root of the problem as the test track I attached has similar properties in this respect as the other track I'm having this problem with. I was trying to make pitroad so the both ends of the track need to be narrower.

I hope I've attached everything there needs to be. I tried searching but found nothing similar.

System:
windows xp 32bit, latest patches
4gb ram
ati 4870hd
latest directx 9

I'm running windows with admin rights.
Never had any problems I can recall with btb before.


error message:
----
Code:
See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at BobsBits.Track.GetEdges(Int32 MaterialSurfaceStartId, Int32 MaterialSurfaceStartRow, AnchorToLeftOrRight LeftOrRight, Int32 Step, Vector3[]& loRoadEdge)
   at BobsBits.TerrainAreaHelper.Create(Int32 MaterialSurfaceStart, Int32 StartRow, Int32 MaterialSurfaceEnd, Int32 EndRow, Single[] PanelDistances, Randomness r, Boolean MergeEnds, Boolean FixOverlaps)
   at BobsBits.Terrain.CreateOneSideFromSpline(Track Track, BobsMaterial Material, BlendingTypes BlendingType, BobsMaterial BlendMaterial, BackgroundImage BackgroundImage, Single lfBlendingPercentage, Int32 StartNode, Single StartPercentage, Int32 EndNode, Single EndPercentage, Single[] Distances, Int32 Step, Boolean[] Reduction, AnchorToLeftOrRight LeftOrRight, TerrainAnchor[] LastRowOfAnchors, List`1 AnchorsToMergeLater, Randomness r, List`1& NewTerrainAreas, Boolean MergeEnds, Boolean FixOverlaps)
   at BobsBits.Terrain.CreateFromSpline(Track Track, BobsMaterial Material, BlendingTypes BlendingType, BobsMaterial BlendMaterial, BackgroundImage BackgroundImage, Single BlendingPercentage, Int32 StartNode, Single StartPercentage, Int32 EndNode, Single EndPercentage, Single[] Distances, Int32 Step, Boolean[] Reduction, String Sides, Randomness r, List`1 TerrainAreasCreated, Boolean MergeEnds, Boolean FixOverlaps)
   at BobsBits.Venue.AddTerrainToTrack(Track Track, BobsMaterial Material, BlendingTypes BlendingType, BobsMaterial BlendMaterial, BackgroundImage BackgroundImage, Single BlendingPercentage, Int32 StartNode, Single StartPercentage, Int32 EndNode, Single EndPercentage, Int32 NumberOfPanels, Single[] Distances, Int32 Step, Boolean[] Reduction, String Sides, Randomness r, List`1 TerrainAreasCreated, Boolean MergeEnds, Boolean FixOverlaps)
   at BobsTrackBuilder.frmTerrain.butQuickTrackAdd_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
MC
    Assembly Version: 3.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_32/mscorlib/2.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
ˆ†Žš†—�“ˆ�Š”›†š˜–˜
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_32/mscorlib/2.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
License
    Assembly Version: 1.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_32/mscorlib/2.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Management
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Management/2.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
BobsTrackBuilder
    Assembly Version: 0.7.0.6
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_32/mscorlib/2.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
BobsBits
    Assembly Version: 1.1.1.5
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_32/mscorlib/2.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
Microsoft.DirectX
    Assembly Version: 1.0.2902.0
    Win32 Version: 5.04.00.2904
    CodeBase: file:///C:/windows/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
----------------------------------------
Microsoft.DirectX.Direct3D
    Assembly Version: 1.0.2902.0
    Win32 Version: 9.05.132.0000
    CodeBase: file:///C:/windows/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll
----------------------------------------
Microsoft.DirectX.Direct3DX
    Assembly Version: 1.0.2911.0
    Win32 Version: 9.12.589.0000
    CodeBase: file:///C:/windows/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2911.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll
----------------------------------------
Microsoft.VisualC
    Assembly Version: 8.0.0.0
    Win32 Version: 8.00.50727.3053
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/Microsoft.VisualC/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualC.dll
----------------------------------------
ICSharpCode.SharpZipLib
    Assembly Version: 0.85.5.452
    Win32 Version: 0.85.5.452
    CodeBase: file:///F:/BobsTrackBuilder_0700/ICSharpCode.SharpZipLib.DLL
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 

Attachments

chub_pearson

250RPM
Mar 16, 2009
312
2
Thanks, that download worked. Yes, I got the same crash. It seems to be the panel length of the track that's causing it. If I reduce the Panel Length of all Surfaces under Track Surface Properties from 5.00 to 2.00 it works fine. If I up them to 3.00 it crashes again.

I changed all the surfaces, it may be that only certain ones need the lower panel length for it to work ok, I haven't checked that out.
 

Brendon Pywell

Bob's Track Builder
Feb 26, 2009
418
156
Thanks. I can repeat the problem and have fixed it for release 0.8. The "Step" being anything other than 1 is the main cause of the bug.