Game Development Community

TX 3D Open Beta Bug - Builder crashes with RAW terrain

by Thorsten Schmidt · in Torque X 2D · 10/07/2008 (1:30 pm) · 2 replies

Here are the steps:
1. Open project
2. Create new level-file
3. Add RAW-terrain
4. look around in 3D view using right mouse button
=> Builder crashes:
TorqueXBuilder3D has detected a problem and has to be closed (translated from german).

Edit: Sometimes the crash appears immediately after I press the right mouse button and sometimes
I'm able to rotate the camera a little bit by holding the right mouse button and moving the mouse

#1
10/07/2008 (1:50 pm)
Sorry, this seems to be not a problem of the builder. When adding a RAW-terrain infos by hand into the
.txscene file of a project starter game 3D there also occurs an InvalidOperationException when I'm navigating around.
#2
11/07/2008 (8:15 am)
I'm surprised that nobody at GG ever responded to this...

I can verify that the problem occurs as well. It seems that RAW terrain is simply broken, whether it's used in the builder or in a game.

More specifically, any time the terrain code attempts to recenter the terrain texture (caused my moving the camera around), it will throw this exception : "The operation was aborted. You may not modify a resource that has been set on a device, or after it has been used within a tiling bracket."

Apparently this stems from the fact that TorqueX is trying to modify the texture even though the resource is in use. The ClipMap.Recenter() method calls ClipMapUniqueImageCache.DoRectUpdate() to recenter the terrain's texture while said texture is locked, and I am having absolutely no luck so far in finding out how to resolve the problem.

I would love it if this problem would be fixed eventually, but for now I guess the answer is just that RAW terrain is not usable.


EDIT:
Here's a stack trace for those that are interested -

System.InvalidOperationException: The operation was aborted. You may not modify a resource that has been set on a device, or after it has been used within a tiling bracket.
   at Microsoft.Xna.Framework.Helpers.GetExceptionFromResult(UInt32 result)
   at Microsoft.Xna.Framework.Graphics.Texture2D.CopyData[T](Int32 level, Nullable'1 rect, T[] data, Int32 startIndex, Int32 elementCount, UInt32 options, Boolean isSetting)
   at Microsoft.Xna.Framework.Graphics.Texture2D.SetData[T](Int32 level, Nullable'1 rect, T[] data, Int32 startIndex, Int32 elementCount, SetDataOptions options)
   at GarageGames.Torque.Materials.ClipMap.ClipMapUniqueImageCache.DoRectUpdate(Int32 mipLevel, ClipStackEntry stackEntry, RectangleI srcRegion, RectangleI dstRegion) in D:\Projects\Game Dev\testGameTX\Torque\Materials\ClipMap\ClipMapUniqueImageCache.cs:line 161
   at GarageGames.Torque.Materials.ClipMap.ClipMap.Recenter(Vector2 position) in D:\Projects\Game Dev\testGameTX\Torque\Materials\ClipMap\ClipMap.cs:line 376