Merry Christmas, Community - Poly Soup
by Kyle Carter · 12/24/2006 (5:03 pm) · 143 comments
Wow - almost three months since my last .plan. I guess I should write these things more often. What have I been up to? Nothing that's quite ready to be talked about in depth, but in brief: developing ways for us to do more releases at a higher quality and with bigger feature sets.
And probably some smaller stuff that I'll be posting about in coming months, too. :)
Speaking of smaller stuff, I took a few days about a month ago and extended 3space and TSStatic in TSE to support more flexible collision scenarios. Or to speak more directly, polysoup collision. I've collaborated on this with Tom Spilman, who spent some time debugging it, integrating it into a project, and cleaning it up a bit, and the end result is a polysoup implementation that seems fairly usable.
So, here's a screenshot of an orc on a concave donut:

Now, some caveats: this is just the result of a few day's hacking, not an official announcement of GG support for polysoup in Torque. So while it's pretty easy to integrate, you do have to have some coding knowledge to use it.
It's also not bullet proof. We use OpCode, so it's pretty fast & efficient, but if you expect to drop ten orc models into a level and not have a performance hit when you run a buggy into them, you'll have to think again. But if you want to build a building in DTS, and don't go overboard in your model complexity, you should do just fine.
Finally, it collides against ALL the meshes in your model, including invisible ones. So if you want a model to work for polysoup you probably want to kill all your Col-1 meshes & so forth for proper results. Adding some sort of filtering rule wouldn't be hard but it was unclear the best way to do that so we left it a bit braindead.
You can get this at its page on TDN, if you're a TSE owner. Remember, you're on your own using it!
I figure I can't very well give you hearty Christmas cheer this holiday, so I may as well post up something nice and useful. :)
And probably some smaller stuff that I'll be posting about in coming months, too. :)
Speaking of smaller stuff, I took a few days about a month ago and extended 3space and TSStatic in TSE to support more flexible collision scenarios. Or to speak more directly, polysoup collision. I've collaborated on this with Tom Spilman, who spent some time debugging it, integrating it into a project, and cleaning it up a bit, and the end result is a polysoup implementation that seems fairly usable.
So, here's a screenshot of an orc on a concave donut:

Now, some caveats: this is just the result of a few day's hacking, not an official announcement of GG support for polysoup in Torque. So while it's pretty easy to integrate, you do have to have some coding knowledge to use it.
It's also not bullet proof. We use OpCode, so it's pretty fast & efficient, but if you expect to drop ten orc models into a level and not have a performance hit when you run a buggy into them, you'll have to think again. But if you want to build a building in DTS, and don't go overboard in your model complexity, you should do just fine.
Finally, it collides against ALL the meshes in your model, including invisible ones. So if you want a model to work for polysoup you probably want to kill all your Col-1 meshes & so forth for proper results. Adding some sort of filtering rule wouldn't be hard but it was unclear the best way to do that so we left it a bit braindead.
You can get this at its page on TDN, if you're a TSE owner. Remember, you're on your own using it!
I figure I can't very well give you hearty Christmas cheer this holiday, so I may as well post up something nice and useful. :)
#82
10/01/2007 (1:25 am)
You need to make the changes manually. It's not just a drop-in anymore. WinMerge or whatever you use to merge makes things go quick.
#83
10/01/2007 (9:38 am)
Oh wait I get it now!
#84
The other error I still get is perhaps similar:
10/01/2007 (12:29 pm)
Hmm it looks like some of this is potentially more challenging. I've manged to get rid of the TSShapeInstance::selectCurrentDetail errors by merging in one of the functions from TGEA 1.03, and at least the functions referring to it are compiling now. There are two errors left which appear more difficult than a simple merge:6>..\engine\game\tsStatic.cpp(230) : error C2665: 'DetailManager::selectPotentialDetails' : none of the 2 overloads could convert all the argument types 6> d:\tgea\engine\sceneGraph/detailManager.h(102): could be 'void DetailManager::selectPotentialDetails(TSShapeInstance *,const MatrixF &,const SceneState *)' 6> d:\tgea\engine\sceneGraph/detailManager.h(112): or 'void DetailManager::selectPotentialDetails(TSPartInstance *,const MatrixF &,const SceneState *)' 6> while trying to match the argument list '(TSShapeInstance *, F32, F32)'If I'm reading this right, the polysoup version of tsStatic.cpp is trying to call a function in detailManager.cpp improperly. This implies to me that there should be a polysoup version of that? Or is this more serious than a simple merging of code?
The other error I still get is perhaps similar:
6>..\engine\ts\tsMesh.cpp(430) : error C2440: '=' : cannot convert from 'GFXTexHandle *' to 'GFXTextureObject *' 6> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
#85
10/01/2007 (12:49 pm)
The selectDetails calls changed in more recent TGEA. It's completely unrelated to polysoup. Just grab the current rendering code from TSStatic and copy it over into the polysoup version of that file. The files should be largely identical, with some additions for polysoup stuff in the collision and networking sections. Rendering isn't changed for polysoup.
#86
Now I've just got tgea.exe complaining about the missing opcode.dll...I've seen this before...I'll figure it out. Actually, how do you tell VS to build a dll as opposed to a *lib?
Thanks for the help!
Edit: I found an old one I'd built, but this whole dll vs. lib building is an annoying mystery.
Anyone else have an issue specifically with airplanes colliding with polysoup? I'm getting some massive slowdowns when that happens. Still, I LOVE this stuff.
10/01/2007 (2:27 pm)
Ah, That did it! Thanks! For anyone who comes after, TSShapeInstance was the hairiest, and I found it much simpler to merge in the Opcode stuff from the polysoup download into the TGEA 1.03 version, rather than the other way around. Now I've just got tgea.exe complaining about the missing opcode.dll...I've seen this before...I'll figure it out. Actually, how do you tell VS to build a dll as opposed to a *lib?
Thanks for the help!
Edit: I found an old one I'd built, but this whole dll vs. lib building is an annoying mystery.
Anyone else have an issue specifically with airplanes colliding with polysoup? I'm getting some massive slowdowns when that happens. Still, I LOVE this stuff.
#87
10/02/2007 (1:08 am)
When you build the DLL I think you still need to add the opcode.lib to the Additional Dependencies under Properties->Linker->Input for your TGEA project.
#88
TGEA links with the *.lib file fine (apparently--it's building). But it does need the *.dll to execute.
I only ask here because I see it's happened before and I'm sure some other non-developer type will run into it trying to use this cool polysoup stuff.
10/02/2007 (9:32 am)
Actually, the problem I have is building the dll in the first place. All I get is a *.lib when I build Opcode.TGEA links with the *.lib file fine (apparently--it's building). But it does need the *.dll to execute.
I only ask here because I see it's happened before and I'm sure some other non-developer type will run into it trying to use this cool polysoup stuff.
#89
I don't have a major problem with a Windows-only TGEA/polysoup client, but the thought of a Windows only server is like having a rusty nine-inch nail driven through my eyeball.
10/04/2007 (1:18 pm)
Hey, has anyone managed to build this on Linux? For the server side, that is. I was looking at the code and it's labled as MFC code, but I was wondering how portable it is (this is currently over my head to judge).I don't have a major problem with a Windows-only TGEA/polysoup client, but the thought of a Windows only server is like having a rusty nine-inch nail driven through my eyeball.
#90
10/04/2007 (1:31 pm)
Opcode is cross platform, as are the changes to Torque to use it - you might have to change how it loads the dynamic library but otherwise ought to be straightforward. I don't have Linux on me so I can't show you the changes myself - but I know it's very possible, probably without changing a line of C++.
#91
10/04/2007 (3:48 pm)
Hey, cool! Very encouraging, thanks!
#92
10/05/2007 (12:38 am)
Okay I gotta question. Let's say I'm a crazy, stupid bastard and I've decided to make a level solely in polysoup. Would it be better to have all my DTS shapes in one DTS file, or to have them all separated as separate objects in the mission file?
#93
10/05/2007 (12:04 pm)
As long as the chunks are fairly coarse (2-3k polygons) then breaking it up into multiple DTSes is probably smart. If any part of a DTS is visible all of it is drawn, so building a huge level in one DTS would always draw the whole level - not so good. So you probably want to try to break things up into rough "cubes" of geometry, in a sort of grid pattern, so things can get culled efficiently. You might want to do tests with different size chunks to get maximum performance.
#94
10/05/2007 (12:50 pm)
Very interesting. That'll help a lot, I think. Thanks!
#95
10/05/2007 (1:23 pm)
Actually...not to belabor the point..but you seem to be talking about client-side rendering (which is quite useful to know). But how about the server side of life? My intuition is it wouldn't make much difference, there, that "polys is polys". But then again I don't think I know that...?
#96
An extension that would work well with this polysoup collision would be to do per-mesh culling when rendering DTS shapes. That way you could just make one big DTS that was cut up a bit and it would draw fast and collide efficiently too.
(PS - it's not a big performance hit to have multiple big DTSes rather than one huge one and do collision against them.)
10/05/2007 (1:50 pm)
You're right - on the server side it's probably a bit more efficient to have on big DTS (ie, for just collision queries). For rendering though that would be costly.An extension that would work well with this polysoup collision would be to do per-mesh culling when rendering DTS shapes. That way you could just make one big DTS that was cut up a bit and it would draw fast and collide efficiently too.
(PS - it's not a big performance hit to have multiple big DTSes rather than one huge one and do collision against them.)
#97
Sorry if this is the wrong place to ask, but it seems like it applies most to people doing the polysoup stuff.
P.S. I'm thinking of the latest Marble Blast here, where the marble rolls quite smoothly on the meshes.
10/14/2007 (9:04 pm)
I'm trying to make a smooth curve transition for cars to drive over. I find that even in 32 face transitions, the feeling is generally bumpy. Is there a way to put in a small number of points and do a sort of "smoothing", or desribe a bezier, or something like that in a way that Torque understands? Sorry if this is the wrong place to ask, but it seems like it applies most to people doing the polysoup stuff.
P.S. I'm thinking of the latest Marble Blast here, where the marble rolls quite smoothly on the meshes.
#98
10/14/2007 (10:22 pm)
We don't do anything special for MBU - in fact, the whole game uses interiors. You might want to try playing with the settings on your shocks. 32-faces ought to be pretty smooth for something like a 90-degree bend...
#99
C:\Torque\TGEA_testing\engine\ts\tsPartInstance.cpp(356): error C2661: 'TSShapeInstance::selectCurrentDetail' : no overloaded function takes 3 arguments
C:\Torque\TGEA_testing\engine\sceneGraph\detailManager.cpp(180): error C2661: 'TSShapeInstance::selectCurrentDetail' : no overloaded function takes 3 arguments
C:\Torque\TGEA_testing\engine\game\tsStatic.cpp(230): error C2665: 'DetailManager::selectPotentialDetails' : none of the 2 overloads can convert parameter 2 from type 'F32'
C:\Torque\TGEA_testing\engine\game\showTSShape.cpp(296): error C2664: 'S32 TSShapeInstance::selectCurrentDetail(Point3F,F32)' : cannot convert parameter 1 from 'MatrixF' to 'Point3F'
C:\Torque\TGEA_testing\engine\game\shapeBase.cpp(2268): error C2664: 'S32 TSShapeInstance::selectCurrentDetail(Point3F,F32)' : cannot convert parameter 1 from 'MatrixF' to 'Point3F'
C:\Torque\TGEA_testing\engine\game\projectile.cpp(943): error C2664: 'S32 TSShapeInstance::selectCurrentDetail(Point3F,F32)' : cannot convert parameter 1 from 'MatrixF' to 'Point3F'
10/20/2007 (9:41 pm)
ive looked through everyone elses problems and Im left with these, any idea?? im not good with C++C:\Torque\TGEA_testing\engine\ts\tsPartInstance.cpp(356): error C2661: 'TSShapeInstance::selectCurrentDetail' : no overloaded function takes 3 arguments
C:\Torque\TGEA_testing\engine\sceneGraph\detailManager.cpp(180): error C2661: 'TSShapeInstance::selectCurrentDetail' : no overloaded function takes 3 arguments
C:\Torque\TGEA_testing\engine\game\tsStatic.cpp(230): error C2665: 'DetailManager::selectPotentialDetails' : none of the 2 overloads can convert parameter 2 from type 'F32'
C:\Torque\TGEA_testing\engine\game\showTSShape.cpp(296): error C2664: 'S32 TSShapeInstance::selectCurrentDetail(Point3F,F32)' : cannot convert parameter 1 from 'MatrixF' to 'Point3F'
C:\Torque\TGEA_testing\engine\game\shapeBase.cpp(2268): error C2664: 'S32 TSShapeInstance::selectCurrentDetail(Point3F,F32)' : cannot convert parameter 1 from 'MatrixF' to 'Point3F'
C:\Torque\TGEA_testing\engine\game\projectile.cpp(943): error C2664: 'S32 TSShapeInstance::selectCurrentDetail(Point3F,F32)' : cannot convert parameter 1 from 'MatrixF' to 'Point3F'
#100
Did you ever get to the bottom of the problem where your player was falling through the surface and then getting stuck inside?
I have just got it compiling with no errors and warnings (TGEA 1.0.3). I run the exe, drop in my dts file (which is just a simple cube exported from lightwave for testing).
If I shoot at the cube, I get collision and an explosion on the side. However, if I walk into it I walk right through the side and then collide with the 'inside' at the opposite end. From there I am trapped inside the model and have to drop my player back outside the object.
Any help / advice would be greatly appreciated - thanks!
10/21/2007 (11:01 am)
@AlienForce / Jeremiah Fulbright / Anyone who has this working :o)Did you ever get to the bottom of the problem where your player was falling through the surface and then getting stuck inside?
I have just got it compiling with no errors and warnings (TGEA 1.0.3). I run the exe, drop in my dts file (which is just a simple cube exported from lightwave for testing).
If I shoot at the cube, I get collision and an explosion on the side. However, if I walk into it I walk right through the side and then collide with the 'inside' at the opposite end. From there I am trapped inside the model and have to drop my player back outside the object.
Any help / advice would be greatly appreciated - thanks!

Torque Owner Lee Latham
Default Studio Name
It's been a while since I visited polysoup collision, last time was with TSE MS4. I'm trying to build it into TGEA 1.03, and I'm getting a lot of stuff along these lines:
1>..\engine\ts\tsPartInstance.cpp(356) : error C2661: 'TSShapeInstance::selectCurrentDetail' : no overloaded function takes 3 arguments
All the errors seem to have to do with overloaded functions specifically for TSShapeInstance::selectCurrentDetail that I guess are not there anymore. I tried TGEA 1.02 which I also happened to have with similar results. Has anyone else run into this?
Is there a way to get TGEA 1.01 and try it? Or have I just bodged my Visual Studio configuration?
Edit: Hmmm I grabbed tsPartInstance.cpp from TSE MS4 and still no joy. I know I must be an idiot, and would be grateful for any crumbs of knowledge anyone would deign to throw my way :-)