Compiling Map2Dif for TGEA
by Andy Rollins · in Torque Game Engine Advanced · 10/02/2008 (7:41 am) · 5 replies
We're just porting our game over from TGE to TGEA and experiencing some real problems with some of the DIF files appearing with a magenta hue. After a lot of digging and debugging the issue appears to be caused by scaling the dif within TGEA which isn't scaling the lightmaps correctly.
One suggestion we've had from the community is:
So I'm trying to build MAP2DIF for TGEA - although there appears to be no source for it? I could use the source from TGE 1.5.2 but that can't be the whole picture as their different versions of the program between the two engines, so I guess where with TGE you build the engine.lib from the "torque tool lib" project that I would perhaps need to build a TGEA version of the lib.
Unfortunately there's no Visual Studio project for that - any suggestions guys as we're tearing our hair out trying to get to the bottom of this.
One suggestion we've had from the community is:
Quote:
Bump the Lighting Border value up or down in your Map2Dif source, or do it directly trough the .map file. Can't remember what the exact name is, but purple is the color of the border of the lightmap.
So I'm trying to build MAP2DIF for TGEA - although there appears to be no source for it? I could use the source from TGE 1.5.2 but that can't be the whole picture as their different versions of the program between the two engines, so I guess where with TGE you build the engine.lib from the "torque tool lib" project that I would perhaps need to build a TGEA version of the lib.
Unfortunately there's no Visual Studio project for that - any suggestions guys as we're tearing our hair out trying to get to the bottom of this.
#2
I'm really at my last place which is debugging the map2dif code to see whether something in there isn't quite right but I need to know how to compile it for TGEA.... the process is easy for TGE so I would guess I just need to get hold of a copy of the Torque tool lib project files for TGEA?
10/07/2008 (3:53 am)
I've tried that Surge with no luck unfortunately, believe me I've been through everything that I can think of trying to resolve this.I'm really at my last place which is debugging the map2dif code to see whether something in there isn't quite right but I need to know how to compile it for TGEA.... the process is easy for TGE so I would guess I just need to get hold of a copy of the Torque tool lib project files for TGEA?
#3
10/23/2008 (7:37 am)
The map2dif source isn't provided with TGEA so no chance to debug that and no response from GG on this here so I've flagged it as a bug over in this thread
#4
I believe I've resolved the issue by reintroducing the SG_LIGHTMAP_BORDER_SIZE functionality into both lmapPacker.h & lmapPacker.cpp (using an old included map2dif from the 1.0.3 version).
What appears to have happened (and remember, I'm an artist, not a coder), is that when certain parts of the TLK/SG lighting code was being phased out(?) of TGEA, the ability to set the lightmap border size was removed/commented out, so no matter what border size you might call for in you .MAP file, it wouldn't resize and therefore if you resized your DIF in Engine, the lightmapping would get wonked, and your player would pass through the lightmap borders, i.e. green or purple.
Like I mentioned, I've reintroduced the code, and it *seems* to work fine, but there are two caveats;
1) I am using an older version of the SDK (since the last several have not included the Map2Dif source).
2) For the life of me I can't seem to get a release build to compile (linker error to engine.lib -- I'm sure that this is something that someone who actually knows what they are doing could resolve easily) and so I'm using a debug version of the map2dif_plus_tse.
If anyone is interested, I'm going to upload it to my host and post a link so that you can test it and see if in the process of fixing one thing I didn't break something else. Also it would be really helpful if the Map2Dif source was reintroduced into the SDK...
I'll crosspost this in one or two other threads where I've seen this issue discussed and not resolved.
Thanks,
Alan
Edit:
Here is the Modified map2dif_plus_tse, remember this is definitely an "as is" piece of coding, based upon an older SDK and your mileage may vary:
www.monsterpacks.com/contentpacks/code/map2dif_plus_tse.exe
*EDIT EDIT EDIT*
Ok, so this works, but it is definitely not right (but I believe heading in the right direction) Map2Dif crashes on complex .MAP exporting in exportGeometry.cpp and I think it has something to do with sgGetLightingScale. Out of 70+ models I test exported, about thirty crashed and they all were over 1500+ faces.
So at this point I've reached pretty much the limit of my capabilities, I've tried selecting out and merging what I thought would resolve this from the standard Map2Dif, but I end up with a half a dozen errors (at best) and I'm way above my head on trying to figure this out.
Hopefully this will point someone who knows what they are doing in the right direction.
02/23/2009 (11:42 am)
I don't know if anyone is still following this thread, but I'm pretty sure the problem was introduced prior to 1.0.3, and I'm also pretty sure I've got a working solution. I believe I've resolved the issue by reintroducing the SG_LIGHTMAP_BORDER_SIZE functionality into both lmapPacker.h & lmapPacker.cpp (using an old included map2dif from the 1.0.3 version).
What appears to have happened (and remember, I'm an artist, not a coder), is that when certain parts of the TLK/SG lighting code was being phased out(?) of TGEA, the ability to set the lightmap border size was removed/commented out, so no matter what border size you might call for in you .MAP file, it wouldn't resize and therefore if you resized your DIF in Engine, the lightmapping would get wonked, and your player would pass through the lightmap borders, i.e. green or purple.
Like I mentioned, I've reintroduced the code, and it *seems* to work fine, but there are two caveats;
1) I am using an older version of the SDK (since the last several have not included the Map2Dif source).
2) For the life of me I can't seem to get a release build to compile (linker error to engine.lib -- I'm sure that this is something that someone who actually knows what they are doing could resolve easily) and so I'm using a debug version of the map2dif_plus_tse.
If anyone is interested, I'm going to upload it to my host and post a link so that you can test it and see if in the process of fixing one thing I didn't break something else. Also it would be really helpful if the Map2Dif source was reintroduced into the SDK...
I'll crosspost this in one or two other threads where I've seen this issue discussed and not resolved.
Thanks,
Alan
Edit:
Here is the Modified map2dif_plus_tse, remember this is definitely an "as is" piece of coding, based upon an older SDK and your mileage may vary:
www.monsterpacks.com/contentpacks/code/map2dif_plus_tse.exe
*EDIT EDIT EDIT*
Ok, so this works, but it is definitely not right (but I believe heading in the right direction) Map2Dif crashes on complex .MAP exporting in exportGeometry.cpp and I think it has something to do with sgGetLightingScale. Out of 70+ models I test exported, about thirty crashed and they all were over 1500+ faces.
So at this point I've reached pretty much the limit of my capabilities, I've tried selecting out and merging what I thought would resolve this from the standard Map2Dif, but I end up with a half a dozen errors (at best) and I'm way above my head on trying to figure this out.
Hopefully this will point someone who knows what they are doing in the right direction.
#5
02/23/2009 (5:25 pm)
@Alan - with you on this one - wish map2dif would be put back in, somewhere on the forums we did get a reply from one of the GG employees and it was along the lines of map2dif got accidently deleted from the SDK and they haven't got round to including it again!!
Torque Owner Surge
MDNAMEDIA