Game Development Community

TGEA 1.7.1 - Interiors Not rendering correctly

by Andy Rollins · in Torque Game Engine Advanced · 10/23/2008 (7:18 am) · 6 replies

We've been porting over to TGEA from TGE and have had some issues with bleeding on scaled interiors, more details are over at this thread

I believe the bug is in the provided Map2Dif program provided with TGEA (we've tried other tgea versions including the one with constructor and the same is true of them)..unfortunately despite asking for help over in this thread on compiling the map2dif program as the source is no longer included with the engine nobody has responded.

So doing some more digging, if you open the stronghold mission in stock TGEA 1.7.1 and scale the tower.dif to say "0.6 0.6 0.6" it also has problems with pink hue applying to any DTS objects set to receiveLMLighting as shown below:
www.cfor.co.uk/gg_img/pink4.jpg
The .MAP files are included with the starter kit so I've tried recreating the DIF file with mapdif and it still suffers the same issue.

However if I open the .MAP in Constructor and "export as Legacy TGEA DIF" the problem goes away, as seen below:

This first one created with map2dif.
www.cfor.co.uk/gg_img/pink2.jpg
Second one with constructor
www.cfor.co.uk/gg_img/pink3.jpg
I am guessing that there is a version of map2dif built into constructor itself that doesn't suffer whatever bug is in the TGEA map2dif.exe code?????

#1
10/23/2008 (8:05 am)
If you just choose "Export as dif" in constructor, do you see the problem?
#2
10/24/2008 (1:55 am)
Yes Export as Dif works ok too - not really sure what the difference is between this and the Export as Legacy TGEA dif?
#3
02/23/2009 (11:38 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.
#4
02/23/2009 (5:28 pm)
@Alan - great work on this one, I'd got as far as tracking it to the lightmaps not scaling correctly but without the Map2Dif source I haven't been able to dig deeper.

Perhaps you could share your source code for map2dif as I'd love to have a stab at solving the issue as we've not seen much response on it from GG (unless Alex with bug squashing boots fancies another challenge :) )
#5
02/23/2009 (8:26 pm)
@Andy,

Check your email and see if it went through properly. Let me know if you make any progress on this, and hopefully we'll see the Map2Dif stuff added back in to an 1.8.1 update!
#6
02/24/2009 (12:47 pm)
OK, here is a super duper hack, all I changed with this one is the default colors of the lightmap borders (neutral grey). This one should work with pretty much any sized .MAP, obviously the issue still is that the lightmapping effects on the player will not be accurate, but at least it's very subtle depending upon the map itself - and they're not purple or green!:

www.monsterpacks.com/contentpacks/code/v2/map2dif_plus_tse.exe