Game Development Community

Unable to Compile Starter 3D Project

by Kyle Marcroft · in Torque X 2D · 09/14/2008 (4:19 am) · 9 replies

Hi,

I am trying to get the Torque X example 3D project to build and run.
When I try to build I get the following errors: "Warning 1 Project
item 'terrains\terrain.ter' was not built with the XNA Framework
Content Pipeline. Set its Build Action property to Compile to build
it. Game" and "Warning 2 Project item 'levels\levelData.txscene' was
not built with the XNA Framework Content Pipeline. Set its Build
Action property to Compile to build it. Game"

None of the included XNA Content Importers work with the files. When
I set the build action to "None", the project builds. However on
running, I get the following at runtime on this line:

SceneLoader.Load(@"data\levels\levelData.txscene");

System.InvalidOperationException was unhandled
Message="An unexpected error has occurred."
Source="Microsoft.Xna.Framework"
StackTrace:
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawPrimitives(PrimitiveType
primitiveType, Int32 startVertex, Int32 primitiveCount)
at GarageGames.Torque.Materials.ClipMap.ClipMapBlenderImageCache.DoRectUpdate(Int32
mipLevel, ClipStackEntry stackEntry, RectangleI srcRegion, RectangleI
dstRegion)
at GarageGames.Torque.Materials.ClipMap.ClipMap.FillWithTextureData()
at GarageGames.Torque.Materials.ClipMap.ClipMap.Initialize(IClipMapImageCache
imageCache, Int32 textureSize, Int32 clipMapSize)
at GarageGames.Torque.T3D.TerrainData.CreateMaterial()
at GarageGames.Torque.T3D.XTerrain.OnRegister()
at GarageGames.Torque.Core.TorqueObjectDatabase.Register(TorqueObject
obj)
at GarageGames.Torque.Core.Xml.TorqueSceneData._LoadObjects(List'1 list)
at GarageGames.Torque.Core.Xml.TorqueSceneData.Load(String
filename, List'1 extraAssemblies)
at GarageGames.Torque.Core.Xml.TorqueSceneData.Load(String filename)
at GarageGames.Torque.GameUtil.SceneLoader.Load(String sceneFileName)
at StarterGame3D.Game.BeginRun() in C:\Documents and
Settings\Kyle\My Documents\Visual Studio
2005\Projects\New3D\New3D\Game\Game.cs:line 62
at Microsoft.Xna.Framework.Game.Run()
at StarterGame3D.Game.Main() in C:\Documents and
Settings\Kyle\My Documents\Visual Studio
2005\Projects\New3D\New3D\Game\Game.cs:line 44

It seems that there are two problems. SceneLoader.Load is failing,
and itis not doing so very gracefully.

After working on this posting for 10 or 15 minutes with the
application running in debug mode but 'stopped' at the error, my
desktop stopped responding. Task Manager showed a lot of system idle
process, and I could move the mouse around, but I couldn't switch to
any other application. Once I killed the Visual Studio Express
process, my system began to behave normally again and I continued this
posting. Not sure what kind of leak was involved in this situation.

I did try installing ( where I work, so not an option for real
development ) XNA 2.0 and Torque X 2.0 on a 32-bit vista system with
Visual Studio 2005; the Starter Game 3D (2.0) based project worked
fine, and I got to wander around a barren landscape.

I emailed Garage Games' support, and the person who responded said
that they had gotten everything working fine with C# Express.

Does anybody have any thoughts or suggestions? Has anyone seen this
sort of thing before?

My system information is below.

Thankyou.

Windows XP Home

Microsoft Visual Studio 2005
Version 8.0.50727.762 (SP.050727-7600)
Microsoft .NET Framework
Version 2.0.50727 SP2

Installed Edition: C# Express

Microsoft Visual C# 2005 76544-000-0000011-00126
Microsoft Visual C# 2005

Microsoft XNA Game Studio 2.0
Microsoft XNA Game Studio 2.0
Build 2.0.11128.1

#1
09/15/2008 (1:55 am)
That's a common glitch... the terrain file needs to be set to the following:

Build Action = Content
Copy to Output Director = Copy if Newer

John K.
#2
09/15/2008 (2:08 pm)
The project defaulted to having those two values for those two settings. If I reset them to those values, there is no change in behavior. I get the compiler warnings, and if I run the project I get the same crash ast SceneLoader.load.

Does anyone have any suggestions for stuff for me to check to make sure the right Torque .dll is installed for TorqueX to work properly?

Thank you,
~Kyle M.
#3
09/22/2008 (1:31 pm)
Thanks to John for responding. However, those steps did no resolve my problem. I have been looking at purchasing the indie license, but would very much like to demonstrate that the product works on my main development system before I take the plunge.

Does somebody have any further suggestions for diagnosing and/or treating my problem?

Thank you,
~Kyle M.
#4
09/24/2008 (5:02 am)
I ran DBGView and got the following output:

"[2464] Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.
[2464]
[2464] D3D9 Helper: Enhanced D3DDebugging disabled; Application was not compiled with D3D_DEBUG_INFO
[2464] Direct3D9: (INFO) :======================= Hal HWVP device selected
[2464]
[2464] Direct3D9: (INFO) :HalDevice Driver Style 9
[2464]
[2464] Direct3D9: (WARN) :Vertexbuffer created with POOL_DEFAULT but WRITEONLY not set. Performance penalty could be severe.
[2464]
[1424] [PCMService] --- ====IN PBT_APMPOWERSTATUSCHANGE
[1424]
[2464] Direct3D9: (WARN) :Vertexbuffer created with POOL_DEFAULT but WRITEONLY not set. Performance penalty could be severe.
[2464]
[2464] Direct3D9: (WARN) :Indexbuffer created with POOL_DEFAULT but WRITEONLY not set. Performance penalty could be severe.
[2464]
[2464] Direct3D9: (ERROR) :Vertex shader function usage (D3DDECLUSAGE_COLOR,0) does not have corresponding usage in the current vertex declaration
[2464]
[2464] Direct3D9: (INFO) :The vertex declaration is (Stream, Offset, Type, Method, Usage, UsageIndex):
[2464]
[2464] Direct3D9: (INFO) :0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0
[2464]
[2464] Direct3D9: (INFO) :0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0
[2464]
[2464] Direct3D9: (ERROR) :DrawPrimitive failed. "

Could there be some kind of mismatch with the binary backend of the engine and the xml data installed for the Starter 3D project?

~Kyle M.
#5
05/06/2009 (2:15 pm)
Kyle,

Did you ever find a solution? I'm running into the exact same error.
#6
05/06/2009 (7:52 pm)
Sadly, no, I did not. I have suspected that the issue was involved with running on a laptop copy of XP Home, but never determined if that was the issue. I pre-ordered Torque X 3D. It will be annoying if it has issues on my XP Home laptop, but I do have a Vista Ultimate PC I will be doing my main development on.

Sorry that I can't be of more assistance.
#7
05/08/2009 (8:51 am)
I certainly haven't had problems compiling and running that project.

I don't see why XP Home would be a problem but, unless I'm mistaken, that seems to be the only difference on the software side.

Maybe it's a hardware compatibility or driver issue. What's the make/model of you notebook/GPU and what driver are you using.

My HP notebook with an ATI GPU had a ton of problems running XNA games with the drivers from HP. Using the Mobility Modder tool from DriverHeaven.net I've been able to use the latest drivers from ATI and they work great. There's a different website that provides mods for nVidia GPUs so you can use the latest drivers. I don't remember the url but I'll dig it up if you need it.
#8
05/08/2009 (10:10 am)
Since TX3D is waiting on a registration fix to go live, my time will be put in there. So, I will have to let Brian carry the ball on this one if he wants to continue to pursue it.
#9
05/08/2009 (7:25 pm)
Ok, I resolved the problem that I was encountering. I had noticed a complaint about the pixel shader and vertex shader in the error (unfortunately, I don't have the details in front of me since I've now resolved it). After some research on Google/Wikipedia, I found that my video card only supported up to Direct X 8.1 (I've been evaluating Torque X, so I had just set up one of my old systems to work on). After swapping the video card out with one that supports 9.0c, I ran the unmodified 3D starter and everything works properly now.

That's the second time now that I've run into an InvalidOperationException error because of hardware issues - not sure if there's a way to perhaps add something to the starter kits to make it easier to determine this is the culprit for future users who encounter similar (my first problem had been because the system did not have an audio card installed).