Game Development Community

dev|Pro Game Development Curriculum

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:

farm1.static.flickr.com/85/272842689_bb8f17c445_m.jpg

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. :)
#41
01/02/2007 (9:02 am)
@Ben: i've just sent it to you. Thanks.
#42
01/03/2007 (3:18 pm)
Man I hope you guys get it up soon or email me a copy, I have to deploy with the military and wont be back for a few months, maybe I will have internet there, maybe not, but this would totally rock.
#43
01/03/2007 (3:56 pm)
I've uploaded it as a new revision of the .RAR on the TDN page. Enjoy!
#44
01/04/2007 (6:08 am)
Still having the same problem as in my posts above and with the TGE version it does not matter if i export from Max or Milkshape the player falls thrue the shape and get stuck.
I dont get any errors when compiling the .exe or the .libs
Could someone who has a working opcode.dll and tge.exe please email it to me so i can try to track where the problem is. If possible please include a working simple shape.
#45
01/04/2007 (8:54 am)
Hey Ben, where is the TGE version on TDN, I can't find it

Thanks
#46
01/04/2007 (9:16 am)
http://tdn.garagegames.com/wiki/Torque_Shader_Engine/PolySoupAddon
The RAR containes both TGE and TGEA
#47
01/04/2007 (9:17 am)
Only problem is I can't get there without Torque Shader Engine, or was the extending it to 1.5 owners only if you own TGE and TSE?
#48
01/04/2007 (11:10 am)
Whoops - updated to allow 1.5 users in.
#49
01/04/2007 (11:14 am)
Excellent, I'm in :)
#50
01/04/2007 (5:15 pm)
Brilliant stuff - just what we need :-).
#51
01/05/2007 (9:37 pm)
I am trying something with this with projectiles and having some trouble, perhaps you guys can tell me what I am doing wrong?

www.garagegames.com/mg/forums/result.thread.php?qt=56205
#52
01/11/2007 (1:20 pm)
I simply couldn't get this working as I can't seem to find an opcode.dll anywhere(TSE won't load without it). Am I supposed to be building it or am I just doing something wrong?
#53
01/11/2007 (2:17 pm)
You have to build the opcode lib/dll.
Just add it to your Tse project and build it before you compile the tse..
And you need to add the referece to the opcode.lib.
#54
01/13/2007 (10:07 pm)
I have this up and running fine, and projectiles seem to collide fine, but the Orc just falls thru to the "other" side of the mesh and basically gets stuck inside of it..

Does the Player model also have to use polysoup collision or is there something I need to switch elsewhere
#55
01/14/2007 (10:43 am)
With the licensing agreement, what do we need to have to use it in commercial games? A Commercial License to Torque or a Commercial License to that specific code?
#56
01/14/2007 (4:39 pm)
@Jeremiah: Do you have a "weird" mesh? Warning signs are places where you have a skinny part of the mesh. Also, it may take backface culling into account - so you may have problems colliding w/ something that is facing away with you.

@James: Just drop me an e-mail, we'll get you taken care of right away.
#57
01/14/2007 (5:03 pm)
Ben: I have the same problem as Jeremiah. Is the Poly Soup code really working with skinned meshes or is developed for more static meshes like Vehicles ??
#58
01/14/2007 (5:30 pm)
@Ben:

I tried it with the Orc model and I made a pillar out of a cylinder (almost as wide as the Orc) and just used some boxes on top of it, like a base for something...

Projectiles work great, but the Orc model basically goes thru the Mesh and then collides once inside the mesh.
#59
01/14/2007 (5:33 pm)
It's question of what's colliding with what.

Will a Player class instance collide correctly (example: stand on) a TSStatic with the polysoup flag turned on and a non-animating static mesh? Yes.

It doesn't matter what type of mesh the player class is rendering in that case because it is asking the environment for the geometry around it so it knows how to move.

However, if you loaded the orc DTS into a TSStatic and turned on polysoup collision - it might work for a player standing on top of the TSStatic as long as the orc mesh wasn't animated but as soon as skinned animation started happening the collision results wouldn't match up with the animated shape, if you got any at all.

Beyond that - you should start a thread in the private SDK forums and we can discuss it in more detail there. Please post a link to the thread here if you start one!
#60
01/20/2007 (6:28 am)
Ok... i had a pretty stupid bug in the polysoup code:

In TSStatic::unpackUpdate() change the // OPCODE_POLYSOUP block to this...

// OPCODE_POLYSOUP!
   bool usePolysoup = stream->readFlag();
   if ( usePolysoup && !mUsePolysoup )
   {
      mUsePolysoup = true;
      if ( mShapeInstance )
         prepCollision();
   }
   else if ( !usePolysoup && mUsePolysoup )
   {
      mUsePolysoup = false;
      if ( mShapeInstance )
         prepCollision();
   }
   // OPCODE_POLYSOUP!

This was a pretty serious issue as it was keeping the polysoup collision data from being generated on the client side and then you would get all sorts of vibrations and glitches as the client side falls thru the shape and the server corrects it.

Anyway... sorry guys.