Game Development Community

Polysoup vs. DIF

by John Doppler Schiff · in Torque Game Engine Advanced · 07/04/2008 (3:00 am) · 14 replies

Hi guys,
I've been looking back at my project's development, and I've realized that the overwhelming majority of my time has been spent wrestling with malfunctioning DIFs. It seems that any structure I create that's more complex than a bunch of shoebox hallways strung together suffers from dropped faces. It's made me seriously consider migrating from Torque to another product.

But recently, I upgraded to TGEA and discovered the Holy Grail: polysoup. Transparency, concave structures, no dropped faces, no inexplicable Map2DIF crashes: good God, it seems to good to be true!

Which means it must be... =)

So, my question to you is, what am I missing in these preliminary tests? Are there show-stopping issues with wholly DTS polysoup levels I'm unaware of? What features won't work in a DTS/polysoup environment? Where's the worm in this golden apple?

Thanks in advance for your comments!

-- JohnDopp

#1
07/04/2008 (3:29 am)
I'm not sure if you can use portals with DTS objects, that'd be really cool though.
#2
07/04/2008 (2:22 pm)
No lightmaps on the DTS polysoup currently. You can do stuff to make you levels look good anyway but that might be a problem for you.

Other than that it ought to be pretty much good to go.
#3
07/04/2008 (5:26 pm)
I can live without lightmaps, if it means functioning interiors! Thank you Ben!
#4
07/04/2008 (6:49 pm)
Although there is no light-maps on the DTS, if you are making a game where the position of the sun doesn't change, or you don't really care if the shadows always match up, look at the buildings in World of War-craft, and in a similar fashion to their constructions you can bake in light-maps on top of you textures or just paint them into the textures, i think it makes things look just fine, and is a suitable alternative;)
#5
07/04/2008 (7:54 pm)
John,
There are some drawbacks to using just polysoup.
If you place too many polysoup objects too closely together, you'll get lag in that area.
You can fake the shadows, so that's not a problem. I just placed a transperant dif that sort of resembled the shape of my buildings. It worked well enough to fool everyone who looked at it.
#6
07/04/2008 (11:17 pm)
@Bobby: Yup - exactly.

@Mike: I think you'll find that if you place similarly complex interiors with no zones in the same configuration you'll have similar problems. ;) A hybrid approach would be to set up an interior with appropriate zones, and disable collision/rendering for it, then stick polysoup objects inside of it (being careful that their bounding boxes stay inside the zones).

You could also make an occluder object really easily; make a simple C++ object you can scale, rotate, and place in the editor. Have it only render itself when you're in editor mode. Now, go find a function (using find in files) called terrCheck; the scenegraph calls it to cull things against the terrain. Keep those occluder objects in a list, then do raycasts against them in terrCheck. You'll need to carefully optimize this occlusion logic and monitor your number and placement of occluder objects, but for some scenes it can be a huge win. I think for an experienced Torque coder this would be a week or less of work.
#7
07/05/2008 (12:22 am)
Quote:A hybrid approach would be to set up an interior with appropriate zones, and disable collision/rendering for it, then stick polysoup objects inside of it (being careful that their bounding boxes stay inside the zones).

Ooh, that sounds sharp. How does one disable collision for a DIF? Is that an engine modification, or is there a simple flag that can be toggled?

And would that DIF shell enable you to use portals?

Quote:You could also make an occluder object really easily; make a simple C++ object...

Okay, for the record, you could make it really easily. I compiled my Hello World program last week, but it just repeated "You suck" 50 times and then crashed. =D
#8
07/05/2008 (6:55 am)
@ Ben yes. Wasnt trying to discourage the use of polysoup. Just pointing out a potential problem. (heck, I use polysoup almost exclusively now. :-) )

Quote:How does one disable collision for a DIF?
Can't answer as I have no clue.

Quote:I compiled my Hello World program last week, but it just repeated "You suck" 50 times and then crashed. =D
That's all?? You are doing better than I did. :-D lol

Have you tried seperating your mesh into 2 parts? You can make the "boxed dif parts" and the "pretty parts" seperate. Then in constructor, you can combine them into one dif. You can make some awesome dif objects that way. Just a thought.
#9
07/07/2008 (6:55 am)
Never disabled dif collision detection before but it's in player.cpp

line 92

static U32 sCollisionMoveMask = (AtlasObjectType        | TerrainObjectType    |
                                 InteriorObjectType     |
                                 WaterObjectType        | //PlayerObjectType     |
                                 StaticShapeObjectType  | VehicleObjectType    |
                                 PhysicalZoneObjectType | StaticTSObjectType);

We can clip through players in our game (hence why its commented out). If you want to clip through difs just remove InteriorObjectType from the mask.
#10
07/07/2008 (7:23 am)
That won't disable collision for a DIF, only player collisions against interiors.
#11
07/12/2008 (11:49 pm)
You can also put a return up at the top of InteriorInstance::castRay and the functions to get the polylist and convexes (I can't remember their names right now - been a while since I looked at Torque code). That will disable everything.

If you do the "invisible interior + pretty DTSes" then you'll get portals (from the interior) and collision (from the DTS). You want to test a bit to make sure things are really occluding properly from the portals, though.

@John: Fair enough. :P
#12
07/15/2008 (1:36 am)
Awesome, thanks Ben!
#13
10/18/2008 (8:50 am)
Dang it.

Why is it you can search till you are blue in the face, then right after you post a question, A similiar question has already been posted just a few lines down:)

Thanks. This info helps me some.
#14
01/31/2009 (12:58 am)
you can add shadow system to tsstatic !