Game Development Community

Minor 1.5 dtsSDKPlus bug (exporters)

by Joel Davis · in Torque Game Engine · 02/03/2007 (1:32 pm) · 10 replies

In appSceneEnum.cpp, like 146:

AppConfig::SetExportError( 0,"No bounds found");


Later, this gets used in appConfig.cpp:170, which crashes maya when this particular error comes up.

I changed this to:

AppConfig::SetExportError( "12", "No bounds found");


joel

#1
02/05/2007 (12:27 am)
Ok, I found some more minor bugs. These are just little things but it's better if they don't fall between the cracks, and maybe these little patches will be helpful to others just getting started. If nothing else, tracking these down has really helped me in my quest to learn the engine and the tools. :)

I , too, had the problem with the mouselook going away that seems like it happens to everyone on the forums who goes through the "getting starting" tutorial. The common fix, adding the 'noCursor = "1";' line in playGui, fixed this.

Also, I rebuilt the maya2dts plugin for maya 8, if anyone needs a build of this let me know.

in map2Dif and map2dif plus:

-- These don't build with the includes VS2005 project file unless you add the files in /lightingSystem to the Torque Tool Lib project. Not a big deal but worth mentioning.

-- in interiorMap.cc:242, it's calling dSprintf with the strlen of the string rather than the size of the destination buffer, so it fails. In my local copy I set this (and the fixed length array above it) to MAX_PATH.

--in csgBrush.h:
My map had entity lights but didn't have a "sgLightingScaleEntity".
CSGBrush.sgLightingScale is uninitialized, and this was (indirectly) leading to an assertion in writeLMapTexGen:948 ("Not a power of 2? Something wrong" )
Adding initializers of sgLightingScale(32.0f) and sgSelfIllumination(0,0,0) in CSGBrush ctor in csgBrush.h:85 fixed this (though I'm still having some issues building maps).

joel
#2
02/11/2007 (2:11 pm)
Ok, this is not really a bug because it was my bad data, but it was annoying so I figured I'd post it. I had a line in my map file that had a property that was >32 characters (the unused wad path), and this would lead to a crash in Torque because the InteriorDict had a 32 char limit on fields. I put a check for this in map2dif:

interiorMapRes.cc:529
const char *propValueToken = toker->getToken();
		 if (dStrlen(propValueToken) >= 32 )
		 {
			dPrintf("WARNING: entity prop \"%s\" is longer than 32 chars, truncating...\n", 
						propValueToken );
			char *propValueTokenTrunc = dStrdup( propValueToken );
			propValueTokenTrunc[30] = '[[62811335ba5d4]]';
			ent->properties.last().value = StringTable->insert( propValueTokenTrunc );
			dFree( propValueTokenTrunc );
		 }
		 else
		 {
			ent->properties.last().value = StringTable->insert(propValueToken);
		 }

Now I am exporting and build maps, yay!


Joel
#3
03/08/2007 (8:38 pm)
Ah! That sounds like the solution to my woes, Joel! Many, many thanks!

I'm a raw beginner to C++, however... what's the proper syntax to initialize those variables in CSGBrush.h? When I tried using parenthetical assignments, the compiler just laughed at me and gave me the finger.
#4
03/08/2007 (8:56 pm)
Here's what my ctor looks like:
public:
	  CSGBrush() : mIsAmbiguous(false),
	   sgLightingScale(32.0f), 
	   sgSelfIllumination(0.0f, 0.0f, 0.0f) { }

But even with this change, map2difPlus probably won't do what you want (it will stop crashing, tho). I couldn't get the difs from it to load into TGE.

I just switched to regular map2dif instead. I don't know what the difference is and it seems to work fine.

Joel
#5
03/09/2007 (2:53 pm)
Rats... it seems that my problems run deeper than this. Both the rebuilt Map2Dif and Map2Dif_plus crash for me. I think that I'll leave the debugging to those who know what they're doing, and muddle along with the 1.4 release for now.

I'm really surprised that a tool as crucial as Map2Dif was released in this state! wagging finger here

Many thanks for the bugfixes, Joel! Hopefully they'll be noticed and acted on quickly. =)
#6
03/09/2007 (3:43 pm)
In my experience, they seem to work okay when map2dif and friends get the data that they are expecting. It's just the tools aren't very tolerant of unusual data. I'd say that the GG tools are, by game industry standards, very well documented and stable. Which is kind of a sad statement in terms of software engineering practices in the games industry in general, but intended as a compliment to the GG folks.

If you want to send me a dif (joeld42@yahoo.com) I'll take a look this weekend at why it's crashing for you. I'm learning the code and debugging stuff is a good a way as any. No promises, of course, but I'll give it a shot.

Joel
#7
03/09/2007 (10:10 pm)
Not sure if that would help much -- the .map I'm processing is ridiculously simple. I'm using 3D World Studio, but any .MAP file seems to crash and burn Map2Dif in this incarnation, regardless of the design tool.

{
"classname" "worldspawn"
"mapversion" "220"
"wad" "halflife.wad"
	{
	( -256.0 -128.0 0.0 ) ( 256.0 -128.0 512.0 ) ( 256.0 -128.0 0.0 ) BeigeConcrete_Tile128 [ 1.0 0.0 0.0 -64.0 ] [ 0.0 0.0 -1.0 128.0 ] 0.0 4.0 4.0
	( -256.0 128.0 512.0 ) ( 256.0 128.0 0.0 ) ( 256.0 128.0 512.0 ) BeigeConcrete_Tile128 [ 1.0 0.0 0.0 -64.0 ] [ 0.0 0.0 -1.0 128.0 ] 0.0 4.0 4.0
	( -256.0 -128.0 0.0 ) ( 256.0 128.0 0.0 ) ( -256.0 128.0 0.0 ) BeigeConcrete_Tile128 [ 1.0 0.0 0.0 -64.0 ] [ 0.0 -1.0 0.0 64.0 ] 0.0 4.0 2.0
	( 256.0 -128.0 512.0 ) ( -256.0 128.0 512.0 ) ( 256.0 128.0 512.0 ) BeigeConcrete_Tile128 [ 1.0 0.0 0.0 -64.0 ] [ 0.0 -1.0 0.0 64.0 ] 0.0 4.0 2.0
	( -256.0 -128.0 0.0 ) ( -256.0 128.0 512.0 ) ( -256.0 -128.0 512.0 ) BeigeConcrete_Tile128 [ 0.0 1.0 0.0 -64.0 ] [ 0.0 0.0 -1.0 128.0 ] 0.0 2.0 4.0
	( 256.0 128.0 0.0 ) ( 256.0 -128.0 512.0 ) ( 256.0 128.0 512.0 ) BeigeConcrete_Tile128 [ 0.0 1.0 0.0 -64.0 ] [ 0.0 0.0 -1.0 128.0 ] 0.0 2.0 4.0
	}
}

If you've got any insights, they'd certainly be welcome!
#8
03/09/2007 (10:32 pm)
Map2dif seems to expect a path in the wad filename (even though it doesn't really use it). I changed it to this:

"wad" "\torque\sdk\example\gameone\data\interiors\halflife.wad"

And I was able to build this map with map2dif, and import it into torque.

Try running debug builds of your tools, they have a lot of error checking that the opt ones don't. In this case, I got an assert in the debug build "Error, there should be a slash in there somewhere!"

Hope this works! Good luck!

Joel
#9
03/13/2007 (2:29 am)
Yah, the pathname issue has been circumvented, but I've got a slew of new errors. I'll post those later this week, after I've had time to dissect them. Fingers crossed!
#10
03/13/2007 (10:07 am)
Aha! Success, of a sort. I've recompiled Map2Dif.exe, removed the wad entity from the .MAP completely, and bingo! It worked, with mirrorsurface support. =)

Map2Dif_plus still spits in my face, but if map2dif is cooperating, I guess I really don't need it.

Thanks for the help, Joel! You're a lifesaver!