Game Development Community

Terrain files have full pathnames for textures

by EddieRay · in Torque Game Engine · 03/11/2005 (8:08 am) · 5 replies

I've worked up a quick patch to allow the terrain loader code to find textures in a more reasonable way. This is my first "patch" to TGE, so I may not be doing things "the right way". Also there are some printf's in there that I used for debugging (which can be removed).

This change makes it easier for users who want to copy existing terrain files into their projects, or when making a copy of the starter.fps or starter.racing trees for editing.

Here's the thread I submitted with the proposed change:

EDIT: The code is not ready for the prime time - it fails when a new mission is created...

www.garagegames.com/mg/forums/result.thread.php?qt=23208

#1
04/06/2005 (10:43 pm)
Any chance this kind of enhancement might make it into 1.4?

Thanks,

Ed
#2
04/22/2005 (9:46 am)
I wish terrains were more like skyboxes, a seperate .dml type of file for the terrain textures would be SO great!
#3
04/22/2005 (10:01 am)
Yeah, it'd be nice if terrains were set up with text files, like the mission, etc. I think part of it has to do with the texture mixing... some kind of cache, and some binary structures... but I haven't looked closely at the code.

By the way, don't use the patch... it needs to be fixed up to avoid a crash when a new mission is created in the World Editor. For some reason, several texture paths that get passed into my code during the mission creation process that seem to be "bogus" - and my code makes an invalid assumption about the format of this path. I'll need to rethink it to make it more bullet-proof...

Ed
#4
04/22/2005 (11:01 am)
I'm not sure how your code works (haven't seen it), but to me the logical thing would be to check for a bogus path BEFORE attempting to do anything with it.
#5
04/22/2005 (11:16 am)
Of course. Until running across the crash, I didn't realize that the paths weren't already checked out at the point I modified the code... so as it turns out, their not really validated at all. It's a minor fix... but noone seems to need the patch anyway, so it's just an "exercise" at this point... ;-)