Previous Blog Next Blog
Prev/Next Blog
by date

Merry Christmas, Community - Poly Soup

Merry Christmas, Community - Poly Soup
Name:Ben Garney
Date Posted:Dec 25, 2006
Rating:4.8 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Ben Garney

Blog post
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. :)

Recent Blog Posts
List:02/12/08 - Come See Me At GDC 2008!
10/27/07 - TGEForest Free Release
10/13/07 - Polysoup Free (And IGC)
01/26/07 - Speaking and Running Into Walls (Collision Fix)
12/25/06 - Merry Christmas, Community - Poly Soup
10/05/06 - Community Weekend (Not-IGC)
06/13/06 - Status Update on Atlas! (also, Ben On Vacation)
02/16/06 - GDC & Forest Pack Tech Preview

Submit ResourceSubmit your own resources!

James Bond   (Dec 25, 2006 at 01:18 GMT)
Nice, Merry Christmas. and thank you.

Fucifer   (Dec 25, 2006 at 01:33 GMT)
Thank You! Merry Christmas.

Dave D   (Dec 25, 2006 at 01:49 GMT)
Santa came early to our house, Merry Christmas and Thank you

Anthony Rosenbaum   (Dec 25, 2006 at 02:18 GMT)
Merry Christmas back at ya!

Tom Spilman   (Dec 25, 2006 at 02:26 GMT)   Resource Rating: 5
Great to see this out there! It works great!

Tom Eastman (Eastbeast314)   (Dec 25, 2006 at 02:28 GMT)
Mmmm...soup and donuts...now I'm hungry! Happy Holidays everyone!

Anton Bursch   (Dec 25, 2006 at 03:51 GMT)
awesomeness!!

Ron Nelson   (Dec 25, 2006 at 04:00 GMT)
Merry Christmas and WOW!!

David Blake   (Dec 25, 2006 at 04:14 GMT)
Merry Xmas!

Ishbuu   (Dec 25, 2006 at 04:41 GMT)
Wonderful! Thank you so very much :) Side note: i don't know if its just me but you can't turn the collisions off once they're turned on, a minor detail but thought you should know....

Ben Garney   (Dec 25, 2006 at 04:49 GMT)
The polysoup flag isn't really meant to be toggled at runtime (although it should work well enough for editing purposes) - the object doesn't fully deal with flushing the collision caches and other data structures on toggle. Best results are where it's always one or the other.

If you do change it, moving any objects that are colliding with it away a bit and then back ought to make things work properly again, but I'm not gonna swear to it. :)

- This text added to known issues section of the TDN page

Jeremy Alessi   (Dec 25, 2006 at 07:28 GMT)
Thanks Ben ... been looking for a polysoup solution for TSE for a while!

Alienforce   (Dec 25, 2006 at 08:42 GMT)
Merry Christmas, and thanks!

Stefan Lundmark   (Dec 25, 2006 at 10:20 GMT)
Hehe, pretty cool!

Mike Kuklinski   (Dec 25, 2006 at 15:30 GMT)
:D -- all I can say.

Gustavo Boni   (Dec 25, 2006 at 21:06 GMT)   Resource Rating: 5
Im crazy or it adds the possibility to create interiors in 3D Studio Max instead Quark/CShop?
Edited on Dec 25, 2006 21:13 GMT

Alienforce   (Dec 25, 2006 at 21:23 GMT)
Hmmmmm... Need some input please. What version of TSE does it work with, MS_?.?

Ben Garney   (Dec 25, 2006 at 23:25 GMT)
@Gustavo: You only have access to the usual set of DTS features, so you won't get zoning/portals or lightmapping. If you don't need those things, though, then you might be set!

@Alienforce: The polysoup-related changes should work with any version, though you may need to do a merge by hand (the polysoup related changes are well-marked with comments) to avoid bringing over stuff unrelated to the collision changes. The files as posted are from the latest version of TSE.
Edited on Dec 25, 2006 23:25 GMT

Gustavo Boni   (Dec 26, 2006 at 01:31 GMT)   Resource Rating: 5
Hey Ben, if i was thinking to use that for a track or road for a car game, so i think it will fit very nice =)

I was wondering in a soccer game, maybe polysoup should be usefull too. Or not?

Thanks

Ben Garney   (Dec 26, 2006 at 01:38 GMT)
This polysoup implementation supports all forms of collision in Torque (vehicle, player, and ray casts) properly. So it should be as useful as any other type of object, I'd imagine.

Gustavo Boni   (Dec 26, 2006 at 04:52 GMT)   Resource Rating: 5
Ben, and about to port it to TGE? Is it possible? If yes, how hard it should be?

Alienforce   (Dec 26, 2006 at 09:21 GMT)
@Ben: Got it working. no problems :) Thanks again!

Ben Garney   (Dec 26, 2006 at 18:49 GMT)
@Gustavo: the same advice I gave to Alieforce applies to porting to TGE.

Ron Nelson   (Dec 26, 2006 at 20:33 GMT)
Ben, how about making it accessible to TGE owners? Thank you for this by the way.

Ben Garney   (Dec 27, 2006 at 02:58 GMT)
I'll see about extending it to 1.5 owners. This may have to wait till I'm back in the office (shortly after New Year's) as I ran into some technical issues setting it up as a resource (which is why it's on TDN right now).

Vashner   (Dec 28, 2006 at 01:14 GMT)   Resource Rating: 5
What on my own? What's the phone # for the Polysoup Hotline?

:)
(scratches head.. note to self.. google Polysoup)

Ben Garney   (Dec 28, 2006 at 01:28 GMT)
Poly soup refers to supporting arbitrary polygon (well, triangle in this case) meshes, rather than requiring convex or manifold meshes.

Vashner   (Dec 28, 2006 at 05:00 GMT)   Resource Rating: 5
Thanks i'll have to read up on it. Looks like something good for cliffs, waterfalls etc?

Ok noted it's experimental at this point.

Gustavo Boni   (Dec 31, 2006 at 22:37 GMT)   Resource Rating: 5
@Ben Garney: I'm getting link errors trying to compile that on VS2005.


>tsStatic.obj : error LNK2019: unresolved external symbol "public: void __thiscall TSShapeInstance::prepCollision(void)" (?prepCollision@TSShapeInstance@@QAEXXZ) referenced in function "protected: void __thiscall TSStatic::prepCollision(void)" (?prepCollision@TSStatic@@IAEXXZ)
13>tsMesh.obj : error LNK2001: unresolved external symbol "public: static class SceneObject * TSStaticPolysoupConvex::smCurObject" (?smCurObject@TSStaticPolysoupConvex@@2PAVSceneObject@@A)
13>tsMesh.obj : error LNK2001: unresolved external symbol "public: virtual class Box3F __thiscall TSStaticPolysoupConvex::getBoundingBox(class MatrixF const &,class Point3F const &)const " (?getBoundingBox@TSStaticPolysoupConvex@@UBE?AVBox3F@@ABVMatrixF@@ABVPoint3F@@@Z)
13>tsMesh.obj : error LNK2001: unresolved external symbol "public: virtual class Box3F __thiscall TSStaticPolysoupConvex::getBoundingBox(void)const " (?getBoundingBox@TSStaticPolysoupConvex@@UBE?AVBox3F@@XZ)
13>tsMesh.obj : error LNK2001: unresolved external symbol "public: virtual class Point3F __thiscall TSStaticPolysoupConvex::support(class Point3F const &)const " (?support@TSStaticPolysoupConvex@@UBE?AVPoint3F@@ABV2@@Z)
13>tsMesh.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TSStaticPolysoupConvex::getFeatures(class MatrixF const &,class Point3F const &,class ConvexFeature *)" (?getFeatures@TSStaticPolysoupConvex@@UAEXABVMatrixF@@ABVPoint3F@@PAVConvexFeature@@@Z)
13>tsMesh.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TSStaticPolysoupConvex::getPolyList(class AbstractPolyList *)" (?getPolyList@TSStaticPolysoupConvex@@UAEXPAVAbstractPolyList@@@Z)
13>tsShapeInstance.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TSShapeInstance::ObjectInstance::buildPolyListOpcode(int,class AbstractPolyList *,unsigned int &)" (?buildPolyListOpcode@ObjectInstance@TSShapeInstance@@UAE_NHPAVAbstractPolyList@@AAI@Z)
13>tsShapeInstance.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TSShapeInstance::MeshObjectInstance::castRayOpcode(int,class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@MeshObjectInstance@TSShapeInstance@@UAE_NHABVPoint3F@@0PAURayInfo@@@Z)
13>tsShapeInstance.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TSShapeInstance::MeshObjectInstance::buildConvexOpcode(class MatrixF &,int,class Box3F const &,class Convex *,class Convex *)" (?buildConvexOpcode@MeshObjectInstance@TSShapeInstance@@UAE_NAAVMatrixF@@HABVBox3F@@PAVConvex@@2@Z)
13>tsShapeInstance.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TSShapeInstance::ObjectInstance::castRayOpcode(int,class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@ObjectInstance@TSShapeInstance@@UAE_NHABVPoint3F@@0PAURayInfo@@@Z)
13>tsShapeInstance.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TSShapeInstance::ObjectInstance::buildConvexOpcode(class MatrixF &,int,class Box3F const &,class Convex *,class Convex *)" (?buildConvexOpcode@ObjectInstance@TSShapeInstance@@UAE_NAAVMatrixF@@HABVBox3F@@PAVConvex@@2@Z)
13>../example/torqueDemo_DEBUG.exe : fatal error LNK1120: 12 unresolved externals


What's wrong?

Thanks
Edited on Dec 31, 2006 22:38 GMT

Ben Garney   (Jan 01, 2007 at 02:50 GMT)
You didn't properly apply the changes to TSStatic in the resource.
Edited on Jan 01, 2007 02:50 GMT

Gustavo Boni   (Jan 01, 2007 at 19:44 GMT)   Resource Rating: 5
Thanks Ben, i got it working on TGE 1.5

Thanks for the help!
Edited on Jan 01, 2007 21:33 GMT

Alienforce   (Jan 01, 2007 at 20:12 GMT)
My Player falls thrue the surface of the object and get stuck in the middle of the object.
No compiling issues.... Just the above problem.

Tom Spilman   (Jan 01, 2007 at 20:21 GMT)   Resource Rating: 5
@Alienforce - Make sure the bounding box is set correctly when you export your DTS. I've heard one report that this can cause collision to partially work. Not sure why this is.

Gustavo Boni   (Jan 01, 2007 at 21:42 GMT)   Resource Rating: 5
@Ben: i got it working on TGE 1.5. Where can i upload the file?

Ben Garney   (Jan 02, 2007 at 00:32 GMT)
E-mail it to me - I'll post it up on TDN.

Alienforce   (Jan 02, 2007 at 15:50 GMT)
Arggghhhhhh..... I just found out that its the Max exporters messing up the export :( the same simple mesh works just fine when i use Milkshape for the export... Why is there so much trouble with the Max exporters ?? Its really depressing spending $3495 and have to use a shareware app to make the exporting.
I know iam going to get answears like this "You have the source go and fix it yourself!" :) and Yes i am really tired for all the troubles with Max exporters so does anyone have some directions for me where to start to "rework" the exporters ??? Any good threads to read etc....
Edited on Jan 02, 2007 15:57 GMT

Tom Spilman   (Jan 02, 2007 at 15:54 GMT)   Resource Rating: 5
Looks like the site is having having trouble with weird character codes.

Alienforce said... at least according to the email notification....
Quote:

Arggghhhhhh..... Im going crazy... After many hours working in Max to figure out what i am doing wrong couse my dts export will not work with the Polysoup.. I thought, hey lets try the same export in Milkshape and guess .... It works ... soooooo... whats wrong with Max exporters it feels like there is ALOT of work that have to be done on the Max exporters..


I just removed what looked to be an apostrophe, but it was an ascii code 180.
Edited on Jan 02, 2007 15:58 GMT

Alienforce   (Jan 02, 2007 at 15:59 GMT)
Yes the post was not showing correct so i had to rewrite it above. :) But the questions are the same.

Tom Spilman   (Jan 02, 2007 at 16:00 GMT)   Resource Rating: 5
@Alienforce - Which Max exporter are you using? Is it the new ones?

Alienforce   (Jan 02, 2007 at 16:13 GMT)
Good question. I "think" the one i use generally is the "max2dtsExporter" from TGE 1.5 stock.
I have tried the "new ones" also from the TGE 1.5 but with the same result.

Gustavo Boni   (Jan 02, 2007 at 17:02 GMT)   Resource Rating: 5
@Ben: i've just sent it to you. Thanks.

Ron Nelson   (Jan 03, 2007 at 23:18 GMT)
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.

Ben Garney   (Jan 03, 2007 at 23:56 GMT)
I've uploaded it as a new revision of the .RAR on the TDN page. Enjoy!

Alienforce   (Jan 04, 2007 at 14:08 GMT)
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.

James Terry   (Jan 04, 2007 at 16:54 GMT)
Hey Ben, where is the TGE version on TDN, I can't find it

Thanks

Alienforce   (Jan 04, 2007 at 17:16 GMT)
http://tdn.garagegames.com/wiki/Torque_Shader_Engine/PolySoupAddon
The RAR containes both TGE and TGEA

James Terry   (Jan 04, 2007 at 17:17 GMT)
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?

Ben Garney   (Jan 04, 2007 at 19:10 GMT)
Whoops - updated to allow 1.5 users in.

James Terry   (Jan 04, 2007 at 19:14 GMT)
Excellent, I'm in :)

Edward Smith   (Jan 05, 2007 at 01:15 GMT)   Resource Rating: 5
Brilliant stuff - just what we need :-).

Ron Nelson   (Jan 06, 2007 at 05:37 GMT)
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

Josh Moore   (Jan 11, 2007 at 21:20 GMT)
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?

Alienforce   (Jan 11, 2007 at 22:17 GMT)
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.

Jeremiah Fulbright   (Jan 14, 2007 at 06:07 GMT)
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

Ryan Green   (Jan 14, 2007 at 18:43 GMT)
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?

Ben Garney   (Jan 15, 2007 at 00:39 GMT)
@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.

Alienforce   (Jan 15, 2007 at 01:03 GMT)
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 ??

Jeremiah Fulbright   (Jan 15, 2007 at 01:30 GMT)
@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.

Ben Garney   (Jan 15, 2007 at 01:33 GMT)
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!

Tom Spilman   (Jan 20, 2007 at 14:28 GMT)   Resource Rating: 5
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.

Sorin Daraban   (Jan 27, 2007 at 02:40 GMT)
TGEA ms 4.2 crashes with every static shape, except boxes, when "usePolysoup" is clicked in the Editor.
I followed all the steps mentioned above to incorporate this resource and compile it with VC8 Express.
When I debug TGEA, it breaks at line 3789 in tsMesh.cpp:

// Don't re init if we already have something...
right here -> if(mOptTree)
return;

"mOptTree CXX0030: Error: expression cannot be evaluated"

Marcel Boule   (Feb 07, 2007 at 03:49 GMT)
I would have liked to be able to locate the position and orientation of the mesh (polygon) I'm pointing with my mouse on an animated object (like painting on the orc for instance).
Will that be possible with polysoup ?

Ben Garney   (Feb 07, 2007 at 17:13 GMT)
If you're willing to burn CPU, you can update it every frame or casts and do that just fine.

Lee Latham   (Feb 15, 2007 at 21:35 GMT)
This is awesome! My vehicles are loving some very interesting surfaces, without the hassle of generating terrain!

However, I too am getting the player on foot colliding apparently with the insides of objects, and not so much the outsides. That's how it looks, anyway. I applied Tom Spillman's patch as well, although I don't know if that's relevant (you just gotta put code in front of me and I'll paste it in and compile it!).

Edit: I see the posts above about the animation of the player breaking the collision. I feel like I've just gotten 5 out of 6 numbers on my lottery ticket. I was wondering how this was resolved with terrain, which seems like a similar deal?
Edited on Feb 16, 2007 03:02 GMT

Tom Spilman   (Mar 02, 2007 at 22:00 GMT)   Resource Rating: 5
FYI. My fix above isn't part of the RAR yet and TGEA 1.0 hasn't been merged... so inspect the changes carefully when applying to TGEA.

Frank Korf   (Jun 20, 2007 at 16:31 GMT)
Does the Poly Soup resource work on the Mac platform (yet)? I'm just looking for some advice on how to start including it. In VS2005, I just add the opcode project, add the include path, and build. I'm not really sure how to do this in x-code. Any advice would be greatly appreciated.

Thanks

Ben Garney   (Jun 20, 2007 at 20:52 GMT)
If you can link the opcode lib into your XCode project then the polysoup code ought to work just fine. How to link the opcode lib? Not quite sure the details of that, but I'm sure it can be done. :)
Edited on Jun 20, 2007 20:53 GMT

Adam Brand   (Jul 04, 2007 at 09:48 GMT)   Resource Rating: 4
I'm getting link errors trying to compile that on VS2005.

1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1>msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1> Creating library ../../Projects/Golf/SilverKeyGameLauncher.lib and object ../../Projects/Golf/SilverKeyGameLauncher.exp
1>LIBCMT.lib(crt0init.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1CollisionAABB@Opcode@@QAE@XZ (public: __thiscall Opcode::CollisionAABB::~CollisionAABB(void)) imported in function __unwindfunclet$?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z$0
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1Point@IceMaths@@QAE@XZ (public: __thiscall IceMaths::Point::~Point(void)) imported in function __unwindfunclet$?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z$0
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1AABB@IceMaths@@QAE@XZ (public: __thiscall IceMaths::AABB::~AABB(void)) imported in function __unwindfunclet$?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z$0
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1AABBCache@Opcode@@QAE@XZ (public: __thiscall Opcode::AABBCache::~AABBCache(void)) imported in function __unwindfunclet$?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z$0
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1AABBCollider@Opcode@@UAE@XZ (public: virtual __thiscall Opcode::AABBCollider::~AABBCollider(void)) imported in function "public: virtual bool __thiscall TSMesh::buildPolyListOpcode(int,class AbstractPolyList *,class Box3F const &)" (?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1OPC_Container@IceCore@@QAE@XZ (public: __thiscall IceCore::OPC_Container::~OPC_Container(void)) imported in function "public: virtual bool __thiscall TSMesh::buildPolyListOpcode(int,class AbstractPolyList *,class Box3F const &)" (?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ?Collide@AABBCollider@Opcode@@QAE_NAAUAABBCache@2@ABVCollisionAABB@2@ABVModel@2@@Z (public: bool __thiscall Opcode::AABBCollider::Collide(struct Opcode::AABBCache &,class Opcode::CollisionAABB const &,class Opcode::Model const &)) imported in function "public: virtual bool __thiscall TSMesh::buildPolyListOpcode(int,class AbstractPolyList *,class Box3F const &)" (?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ?SetMinMax@AABB@IceMaths@@QAEXABVPoint@2@0@Z (public: void __thiscall IceMaths::AABB::SetMinMax(class IceMaths::Point const &,class IceMaths::Point const &)) imported in function "public: virtual bool __thiscall TSMesh::buildPolyListOpcode(int,class AbstractPolyList *,class Box3F const &)" (?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0AABBCache@Opcode@@QAE@XZ (public: __thiscall Opcode::AABBCache::AABBCache(void)) imported in function "public: virtual bool __thiscall TSMesh::buildPolyListOpcode(int,class AbstractPolyList *,class Box3F const &)" (?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0AABBCollider@Opcode@@QAE@XZ (public: __thiscall Opcode::AABBCollider::AABBCollider(void)) imported in function "public: virtual bool __thiscall TSMesh::buildPolyListOpcode(int,class AbstractPolyList *,class Box3F const &)" (?buildPolyListOpcode@TSMesh@@UAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1IndexedTriangle@IceMaths@@QAE@XZ (public: __thiscall IceMaths::IndexedTriangle::~IndexedTriangle(void)) imported in function "public: void * __thiscall IceMaths::IndexedTriangle::`vector deleting destructor'(unsigned int)" (??_EIndexedTriangle@IceMaths@@QAEPAXI@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1Ray@IceMaths@@QAE@XZ (public: __thiscall IceMaths::Ray::~Ray(void)) imported in function __unwindfunclet$?castRayOpcode@TSMesh@@UAE_NABVPoint3F@@0PAURayInfo@@@Z$0
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1CollisionFaces@Opcode@@QAE@XZ (public: __thiscall Opcode::CollisionFaces::~CollisionFaces(void)) imported in function __unwindfunclet$?castRayOpcode@TSMesh@@UAE_NABVPoint3F@@0PAURayInfo@@@Z$0
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1RayCollider@Opcode@@UAE@XZ (public: virtual __thiscall Opcode::RayCollider::~RayCollider(void)) imported in function "public: virtual bool __thiscall TSMesh::castRayOpcode(class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@TSMesh@@UAE_NABVPoint3F@@0PAURayInfo@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??GPoint@IceMaths@@QBE?AV01@ABV01@@Z (public: class IceMaths::Point __thiscall IceMaths::Point::operator-(class IceMaths::Point const &)const ) imported in function "public: virtual bool __thiscall TSMesh::castRayOpcode(class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@TSMesh@@UAE_NABVPoint3F@@0PAURayInfo@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ?Collide@RayCollider@Opcode@@QAE_NABVRay@IceMaths@@ABVModel@2@PBVMatrix4x4@4@PAI@Z (public: bool __thiscall Opcode::RayCollider::Collide(class IceMaths::Ray const &,class Opcode::Model const &,class IceMaths::Matrix4x4 const *,unsigned int *)) imported in function "public: virtual bool __thiscall TSMesh::castRayOpcode(class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@TSMesh@@UAE_NABVPoint3F@@0PAURayInfo@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0OPC_Container@IceCore@@QAE@XZ (public: __thiscall IceCore::OPC_Container::OPC_Container(void)) imported in function "public: virtual bool __thiscall TSMesh::castRayOpcode(class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@TSMesh@@UAE_NABVPoint3F@@0PAURayInfo@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0RayCollider@Opcode@@QAE@XZ (public: __thiscall Opcode::RayCollider::RayCollider(void)) imported in function "public: virtual bool __thiscall TSMesh::castRayOpcode(class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@TSMesh@@UAE_NABVPoint3F@@0PAURayInfo@@@Z)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0OPCODECREATE@Opcode@@QAE@XZ (public: __thiscall Opcode::OPCODECREATE::OPCODECREATE(void)) imported in function "public: void __thiscall TSMesh::prepOpcodeCollision(void)" (?prepOpcodeCollision@TSMesh@@QAEXXZ)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0Model@Opcode@@QAE@XZ (public: __thiscall Opcode::Model::Model(void)) imported in function "public: void __thiscall TSMesh::prepOpcodeCollision(void)" (?prepOpcodeCollision@TSMesh@@QAEXXZ)
1>tsMesh.obj : warning LNK4217: locally defined symbol ?SetPointers@MeshInterface@Opcode@@QAE_NPBVIndexedTriangle@IceMaths@@PBVPoint@4@@Z (public: bool __thiscall Opcode::MeshInterface::SetPointers(class IceMaths::IndexedTriangle const *,class IceMaths::Point const *)) imported in function "public: void __thiscall TSMesh::prepOpcodeCollision(void)" (?prepOpcodeCollision@TSMesh@@QAEXXZ)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0Point@IceMaths@@QAE@XZ (public: __thiscall IceMaths::Point::Point(void)) imported in function "public: void __thiscall TSMesh::prepOpcodeCollision(void)" (?prepOpcodeCollision@TSMesh@@QAEXXZ)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0IndexedTriangle@IceMaths@@QAE@XZ (public: __thiscall IceMaths::IndexedTriangle::IndexedTriangle(void)) imported in function "public: void __thiscall TSMesh::prepOpcodeCollision(void)" (?prepOpcodeCollision@TSMesh@@QAEXXZ)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??0MeshInterface@Opcode@@QAE@XZ (public: __thiscall Opcode::MeshInterface::MeshInterface(void)) imported in function "public: void __thiscall TSMesh::prepOpcodeCollision(void)" (?prepOpcodeCollision@TSMesh@@QAEXXZ)
1>tsMesh.obj : warning LNK4217: locally defined symbol ??1Model@Opcode@@UAE@XZ (public: virtual __thiscall Opcode::Model::~Model(void)) imported in function "public: virtual void * __thiscall Opcode::Model::`scalar deleting destructor'(unsigned int)" (??_GModel@Opcode@@UAEPAXI@Z)
1>tsMesh.obj : error LNK2019: unresolved external symbol __imp__InitOpcode referenced in function "public: void __thiscall TSMesh::prepOpcodeCollision(void)" (?prepOpcodeCollision@TSMesh@@QAEXXZ)
1>../../Projects/Golf/SilverKeyGameLauncher.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\Game\SDK\engine\out.VC8.RELEASE\BuildLog.htm"
1>Torque Demo - 4 error(s), 26 warning(s)

can any one please tell me what's wrong ?

Thanks
Edited on Jul 04, 2007 10:32 GMT

James Laker (BurNinG)   (Jul 19, 2007 at 14:53 GMT)
I have TGEA indie license.
So what do I need to do, or who do I need to bribe to allow me to make commercial game with this? (Looking at Ben's Amazon wishlist)

I would like to know this before I get my modeller to start creating stuff.

Ben Garney   (Jul 19, 2007 at 18:04 GMT)
E-mail me and I'll redirect you to the right biz dev person.

You can buy me stuff off my Amazon list but it won't get you commercial access - GG has to approve it, not me personally. :)

Ben Garney   (Jul 19, 2007 at 18:04 GMT)
From the TDN article:


\"Please read the file readme_eula.txt for information on the private licensing of this code. Please contact Timothy Aste at [tima@garagegames.com] for information on the commercial licensing of this code for commercial works.\"

So actually, e-mail Tim Aste. :)

Joti Carroll   (Jul 31, 2007 at 07:04 GMT)
@Sorin Daraban
the fix for your problem is a step back in TSShapeInstance::prepCollision

for(S32 i=0; i<hShape->meshes.size(); i++)
if(hShape->meshes[i])
hShape->meshes[i]->prepOpcodeCollision();


And to fix player collision make this change in TSStaticPolysoupConvex::getPolyList

S32 base =  list->addPoint(verts[0]);
list->addPoint(verts[2]);
list->addPoint(verts[1]);
list->addPoint(verts[3]);


We have upgraded the version of ODE in our system and with some alterations for the memory manager linked with it's OPCODE. The new version also has GIMPACT for determining penetration information for polysoup, still has many bugs in ODE but maybe some one will give it a go in torque.
Edited on Jul 31, 2007 07:08 GMT

PuG   (Aug 02, 2007 at 09:44 GMT)
Hi, just wondered if anyone have tried this in latest TGEA and got it working? throws up a few problems compiling and unfortunately I don't do coding :)
Edited on Aug 02, 2007 09:44 GMT

Joti Carroll   (Aug 14, 2007 at 02:12 GMT)
Not sure if this is right, I've just pasted together code snippets from other parts of the system but it works. This version of TSShapeInstance::prepCollision will load all collision meshes into the soup and if there aren't any it uses the visible meshes. More generally useful I think.

void TSShapeInstance::prepCollision()
{
// start ds - will load all collision meshes into the soup and if there aren't any it uses the visible meshes
/*
// Iterate over all our meshes and call prepCollision on them...
for(S32 i=0; i<hShape->meshes.size(); i++)
hShape->meshes[i]->prepOpcodeCollision();
*/

// step through all the details in the shape
U32 count = 0;
for (U32 dl = 0; dl < hShape->details.size(); dl++)
{
TSShape::Detail *detail = &(hShape->details[dl]);
if(!detail)
continue;

// look for polysoup collision meshes
char* name = (char*)hShape->names[detail->nameIndex];
if (!dStrstr((const char*)dStrlwr(name), "collision-"))
continue;

// check meshes on this detail level...
S32 ss = detail->subShapeNum;
S32 od = detail->objectDetailNum;
if (ss<0)
continue; // this is a billboard detail level
S32 start = hShape->subShapeFirstObject[ss];
S32 end = hShape->subShapeNumObjects[ss] + start;

// should only be one mesh but lets be safe
for (U32 i=start; i<end; i++)
{
TSMesh * mesh = hShape->meshes[i];
if (mesh)
{
mesh->prepOpcodeCollision();
count++;
}
}
}
// we found collision meshes so no need to add any more meshes
if (count!=0)
return;

// add the first LOD of the visible meshes
TSShape::Detail *detail = &(hShape->details[0]);
if (!detail)
return;

// check meshes on this detail level...
S32 ss = detail->subShapeNum;
S32 od = detail->objectDetailNum;
if (ss<0)
return; // this is a billboard detail level
S32 start = hShape->subShapeFirstObject[ss];
S32 end = hShape->subShapeNumObjects[ss] + start;

// add all visible meshes for this detail level
for (U32 i=start; i<end; i++)
{
TSMesh * mesh = hShape->meshes[i];
if (mesh)
mesh->prepOpcodeCollision();
}
// end ds
}

Edited on Aug 14, 2007 02:17 GMT

James Laker (BurNinG)   (Aug 14, 2007 at 07:12 GMT)
Thanx Joti!

EDIT: Pity we need a Commercial license to use this.
Edited on Aug 14, 2007 07:15 GMT

asmaloney (Andy)   (Sep 02, 2007 at 23:03 GMT)
Quote:

Pity we need a Commercial license to use this.


...check again! It has been changed:

TDN article

Share and enjoy!

Lee Latham   (Sep 03, 2007 at 00:27 GMT)
Hey that's totally sweet!

Thanks GG!

James Laker (BurNinG)   (Sep 03, 2007 at 07:33 GMT)
Fantastic!!! I already had it in and was hoping to pay for this with pre-orders... hehe...

Thanx you guys!

James Laker (BurNinG)   (Sep 07, 2007 at 10:06 GMT)
Uuurhm.... Can someone send me their vcproj/sln files? I broke something and cant seem to get it going again :-/

burningza _at_ gmail dot com

Plzzz

James Laker (BurNinG)   (Sep 19, 2007 at 08:47 GMT)
Got it working again.

Have a little more detailed description of how to get it installed, linked n all here.

There's also an include missing in the resource.

Lee Latham   (Sep 30, 2007 at 04:03 GMT)
Hey,

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 :-)
Edited on Sep 30, 2007 22:11 GMT

James Laker (BurNinG)   (Oct 01, 2007 at 08:25 GMT)
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.

Lee Latham   (Oct 01, 2007 at 16:38 GMT)
Oh wait I get it now!
Edited on Oct 01, 2007 18:57 GMT

Lee Latham   (Oct 01, 2007 at 19:29 GMT)
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

Edited on Oct 01, 2007 19:39 GMT

Ben Garney   (Oct 01, 2007 at 19:49 GMT)
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.

Lee Latham   (Oct 01, 2007 at 21:27 GMT)
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.
Edited on Oct 01, 2007 22:13 GMT

James Laker (BurNinG)   (Oct 02, 2007 at 08:08 GMT)
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.

Lee Latham   (Oct 02, 2007 at 16:32 GMT)
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.

Lee Latham   (Oct 04, 2007 at 20:18 GMT)
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.

Ben Garney   (Oct 04, 2007 at 20:31 GMT)
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++.

Lee Latham   (Oct 04, 2007 at 22:48 GMT)
Hey, cool! Very encouraging, thanks!

Lee Latham   (Oct 05, 2007 at 07:38 GMT)
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?

Ben Garney   (Oct 05, 2007 at 19:04 GMT)
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.

Lee Latham   (Oct 05, 2007 at 19:50 GMT)
Very interesting. That'll help a lot, I think. Thanks!

Lee Latham   (Oct 05, 2007 at 20:23 GMT)
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...?
Edited on Oct 05, 2007 20:25 GMT

Ben Garney   (Oct 05, 2007 at 20:50 GMT)
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.)

Lee Latham   (Oct 15, 2007 at 04:04 GMT)
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.
Edited on Oct 15, 2007 04:11 GMT

Ben Garney   (Oct 15, 2007 at 05:22 GMT)
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...

Bobby Leighton   (Oct 21, 2007 at 04:41 GMT)
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'

Eikon Games   (Oct 21, 2007 at 18:01 GMT)
@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!

Lee Latham   (Oct 21, 2007 at 18:12 GMT)
@Bobby: I asked this same question above on (Sep 29, 2007 at 23:03) and I got some good answers, also above. You'll need to manually merge the polysoup code in, things have changed in TGEA.

@Eikon Games: I had this same problem and applied the little patch kindly supplied above by Joti Carroll (Jul 31, 2007 at 02:04). Now my players are colliding reasonably well.

You guys would both save yourselves a lot of time by reading all the posts before posting--you'd already be merrily polysouping along instead of reading my snarky comment.

Eikon Games   (Oct 21, 2007 at 18:20 GMT)
@Lee

You are absolutely right. But (tries to get out of hole) I *did* think I'd read through all the comments. However, I must have missed that one :o(

Implemented that patch and works a treat. Thank you - without your 'snarky comment' I'd still be scratching my head!

Bobby Leighton   (Oct 22, 2007 at 02:51 GMT)
I did read it, and I knew that is the answer but i don't know how to do that. I see the differences between the files but understanding what it goes to is a different matter, could you not post the changes necessary or send me the files, I would be most grateful. I have never had trouble getting anything Torque related to build I'm not sure what I've done wrong, I used Win merge...maybe ill try again...

Lee Latham   (Oct 22, 2007 at 22:57 GMT)
@Eikon: I've gotten far, far too much help around here to be snarky for long :-)

@Bobby: Man, I just barely understand what I did with that, and I really have no business distributing it, I think, even if it does seem to work. Just use winmerge to get a diff between the files distributed in the polysoup resource and stock TGEA, and move the stuff that's in the polysoup resource into the TGEA versions. Feel free to email me if you have more trouble, and I'll send you what I've got.

Bobby Leighton   (Oct 23, 2007 at 16:36 GMT)
Thanks I'm going to try it again, do you think their might be some sort of problem from the Atlas2 bump-mapping resource i added? other than that it was stock TGEA...Thanks ill send you an Email to let you know from here on out:)

Kyle Le Master   (Dec 18, 2007 at 06:18 GMT)
Thanks for the great resource! I am not a strong VC++ user and I was hoping for a little help. I am using this with TGE 1.5.2 and Visual Studio 2005. The Opcode solution is in my solution browser and I have experimented with adding the opcode and opcode/Release folders in the linker as well as adding Opcode.dll as a Refrence in the Torque Demo Properties, I continue to get this error starting:

13>------ Build started: Project: Torque Demo, Configuration: Release Win32 ------
13>Compiling...
13>tsSortedMesh.cc
13>..\engine\ts\tsSortedMesh.cc(57) : error C2065: 'tDiffuse' : undeclared identifier
13>..\engine\ts\tsSortedMesh.cc(57) : error C3861: 'getUVs': identifier not found

I have uploaded the buildLog here: www.soulsandsocks.com/BuildLog.htm

If anyways had any suggestions for me, I am all ears!

Thanks,

Kyle LeMaster
Edited on Dec 18, 2007 06:20 GMT

Lee Latham   (Dec 20, 2007 at 07:14 GMT)
@Kyle: I've hesitated to answer since I am a C++ novice myself, but since no one else has....I'm guessing that you've misapplied or left out one of the header files, presumeably tsSortedMesh.h, since tDiffuse was apparently not declared anywhere.

Kerry Lyon   (Dec 27, 2007 at 05:49 GMT)
I spent the past week attempting to hand merge the proper code with 1.0.3. Unfortunately, even though I was able to get it to compile, once in game it would crash or not collide or not even load. I was using WinMerge, but I had trouble with some of the differences in the code.
I did go through this thread and tested out all the fixes, but without success.

Anyway, if anyone has the correctly merged files or a compiled '.exe' for 1.0.3, would it be possible to email them to me? (I hope this isn't breeching forum etiquette...)

Thanks.

P.S. I did find out where that dastardly 'opcode.dll' was (c:\Program Files\Media)! If anyone needs a copy let me know.

Lee Latham   (Dec 27, 2007 at 19:02 GMT)
@Kerry: You need to build the opcode.dll using the opcode code that comes with the resource. I suspect that is some different opcode.dll you found that is incompatible.

It's a separate build from the opcode/TGEA build.

Lee Latham   (Dec 27, 2007 at 21:50 GMT)
While we're talking about it, I'm trying to build polysoup in a TGE1.5 Linux dedicated server build (Fedora Core 4). The first error message I get is:

./game/tsStatic.h:73: error: ISO C++ forbids declaration of TSMesh with no type

Edited on Dec 30, 2007 00:11 GMT

Kerry Lyon   (Dec 28, 2007 at 03:08 GMT)
@Lee: Thanks for the reply. The opcode.dll is from the TGEA build. The directory is set to something like '../../../../media'. I didn't want to change it for fear of messing it up. The opcode.dll works (luckily). Today I merged the Polysoup into TGE 1.5.2 and got that working. So I think I'll stick with that until there's an update for TGEA.
And sorry, but I can't help with the Linux stuff. No experience there at all...

Lee Latham   (Dec 30, 2007 at 02:38 GMT)
Adding TSMesh.h to the includes at the top of tsStatic.h solved that problem, but building the opcode stuff is kicking my butt. I'm wondering if it's simply a matter of the right compiler options, since ODE uses a nearly identical verison of opcode and it compiles fine.

Currently I'm stuck at:
./opcode/./Ice/IceTypes.h:52: error: __int64 does not name a type

Although there is an error that does not stop compilation before that:
./opcode/OPC_IceHook.h:21:19: error: Math.h: No such file or directory

There is no "math.h" to be found, however.
Edited on Dec 30, 2007 04:20 GMT

Lee Latham   (Jan 01, 2008 at 00:42 GMT)
I've gotten past the __int64 problem (apparently) by defining it as with "-D _int64 = long long" as a compiler flag. But now it's getting really strange, I'm getting a bunch of syntax type errors from the Ice stuff (what is that stuff anyway?). I thought perhaps it wasn't GCC4 compatible, but the g++32 compatibility compiler gives the same messages. Here's the first one (of many similar):


./opcode/./Ice/IceTypes.h:126: error: expected `)' before * token
Edited on Jan 01, 2008 00:43 GMT

sanjaychoudhary   (Jan 03, 2008 at 06:19 GMT)
Hi I checked it with

TGE 1.5.0 and
TGEA 1.0.3

both are giving runtime exceptions when I check the polysoup box.

any idea...

can anyone send me the code for TGEA 1.0.3 if i am doing wrong.

Lee Latham   (Jan 03, 2008 at 06:53 GMT)
At one time I had that happen, but it worked ok if I turned on the polysoup option directly in the mission file instead of the editor. Sorry, I know that's a stretch....in my current version it works fine.

sanjaychoudhary   (Jan 03, 2008 at 08:16 GMT)
can u pass the modified TGEA 1.0.3 files.
I can even cross check!!

Lee Latham   (Jan 03, 2008 at 23:16 GMT)
Well, I'm not gonna "pass" anything, but I'll send you the files. Contact me via email. See my profile.
(If you'd had your email addy in your profile, you'd have them already!)

Kerry Lyon   (Jan 12, 2008 at 04:01 GMT)
@Lee: Any chance you would email me the files as well? I've been working with the polysoup in TGE, but I would really like to take advantage of the shaders in TGEA 1.0.3. Thanks.

P.S. I downloaded and played your Singularity FPS game. I think the concept is fun and I enjoy the variety of vehicles and power ups. Nice work!

Lee Latham   (Jan 12, 2008 at 04:44 GMT)
@Kerry: Thanks, and they should be there now. Y'all feel free to contact me directly for this.

BTW the ICE library is apparently a completely Windows-only deal. I've found a port of it to Linux but it does crazy stuff like ifdef out assembler code and replace it with simple functions. Also a LOT of type definitions needs to be redone in a platform independent way. Although the Opcode lib itself doesn't seem too bad in that regard.

Definitely not a plug-n-play port by any stretch of the imagination. I'm going to feel so dirty renting a Windows server--and even worse potentially telling someone who wants to host my game that that's the only option. :-(
Edited on Jan 12, 2008 04:51 GMT

asmaloney (Andy)   (Jan 12, 2008 at 05:34 GMT)
Quote:

BTW the ICE library is apparently a completely Windows-only deal.


This is not accurate. It's pretty straightforward to take the included OPCODE library and get it compiled on the Mac - it doesn't require a lot of changes. Instead of compiling as a linked library [which IIRC this resource is set up to do], try adding it to your project and linking to it statically.

I haven't tried it on Linux myself, but if it compiles on the Mac it should be fine on Linux too.

Lee Latham   (Jan 12, 2008 at 05:46 GMT)
Hmmm. I'm no programmer, if that's not obvious, but perhaps Mac uses a lot of the same conventions Windows does, these days? Like for that "__int64 does not name a type" I pasted above?

This is in the compiling stage, where I presume it doesn't matter if it's statically linked or not...or not?

asmaloney (Andy)   (Jan 12, 2008 at 06:56 GMT)
No, of course Windows does things differently. Mac and Linux are much closer to each other [both being UNIX-derived] than either is to Windows. For the __int64 stuff, I would just #ifdef it in the header and use 'long long' for non-Windows builds.

As I recall, there were some Windows specific keywords used for indicating linkage [__stdcall, __declspec come to mind]. These would have to be #ifdef'd as well. The other thing I changed was the includes. I think it was using #include <foo.h> instead of #include "foo.h" unnecessarily in a lot of places.

The static linking comment I made was because I just remember finding it easier in terms of some of the crazy Windows linkage defines [I think there was some OP_NO_DLL or something] to just make it static. On Windows you have to do this whole __declspec(dllexport)/__declspec(import) thing which doesn't apply to the rest of the world. So instead of messing with all of that, I just made it static - which I think is a better solution anyways. There's no need for this to be dynamically linked.

Don Hogan   (Mar 16, 2008 at 14:49 GMT)   Resource Rating: 5
Edit for more detail - I'm using TGE 1.5.2, with the resource linked below. I see that Lee L. had a similar issue earlier in TGEA, but I'm not entirely clear how it was he fixed it.

I've managed to work through most of my issues so far, but this one has me stumped. My guess would be it's related to something that's handled differently in the Super Environment Pack www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1415... but I can't find any differences relating to opcode when I compare the files in Winmerge. Here's the error I'm getting from VS 2005 Express

1>Linking...
1>tsStatic.obj : error LNK2019: unresolved external symbol "public: bool __thiscall TSShapeInstance::castRayOpcode(int,class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRayOpcode@TSShapeInstance@@QAE_NHABVPoint3F@@0PAURayInfo@@@Z) referenced in function "protected: virtual bool __thiscall TSStatic::castRay(class Point3F const &,class Point3F const &,struct RayInfo *)" (?castRay@TSStatic@@MAE_NABVPoint3F@@0PAURayInfo@@@Z)
1>tsStatic.obj : error LNK2019: unresolved external symbol "public: bool __thiscall TSShapeInstance::buildPolyListOpcode(int,class AbstractPolyList *,class Box3F const &)" (?buildPolyListOpcode@TSShapeInstance@@QAE_NHPAVAbstractPolyList@@ABVBox3F@@@Z) referenced in function "protected: virtual bool __thiscall TSStatic::buildPolyList(class AbstractPolyList *,class Box3F const &,class SphereF const &)" (?buildPolyList@TSStatic@@MAE_NPAVAbstractPolyList@@ABVBox3F@@ABVSphereF@@@Z)
1>tsStatic.obj : error LNK2019: unresolved external symbol "public: bool __thiscall TSShapeInstance::buildConvexOpcode(class MatrixF,class Point3F,int,class Box3F const &,class Convex *,class Convex *)" (?buildConvexOpcode@TSShapeInstance@@QAE_NVMatrixF@@VPoint3F@@HABVBox3F@@PAVConvex@@3@Z) referenced in function "protected: virtual void __thiscall TSStatic::buildConvex(class Box3F const &,class Convex *)" (?buildConvex@TSStatic@@MAEXABVBox3F@@PAVConvex@@@Z)
1>../example/torqueDemo.exe : fatal error LNK1120: 3 unresolved externals
1>Build log was saved at "file://c:\Torque\TGE_1_5_2\engine\out.VC8.RELEASE\BuildLog.htm"
1>Torque Demo - 4 error(s), 0 warning(s)


Any pointers on where to look? Thanks!
Edited on Mar 16, 2008 14:56 GMT

Don Hogan   (Mar 16, 2008 at 16:41 GMT)   Resource Rating: 5
Ok, I stepped back to a clean version of TGE 1.5.2 and re-merged. It compiled with 0 errors and 0 warnings in both debug and release. I'll try to merge the resource I was using back in and see if it was a conflict in code or in my merge.

EDIT: Ok, so ultimately all I've done is extend this .plan by 2 posts. =) I re-merged after taking a break to clear my head and it works just fine. tsStatic.cc was the culprit, although I can't say that I could tell you where the problem was. I was just more careful, and I do think it was easier merging the Super Environment Pack into polysoup than it was the other way around.
Edited on Mar 16, 2008 23:40 GMT

William Freeman   (Apr 06, 2008 at 04:27 GMT)
Wow this is the best. Works great! I got it going in TGE 1.5.2 (took some work, but followed all the instructions and did some guess work and got it going)

It seems to not like poly meshes with poly's missing ie holes, but thats easy enough to work around. I did some testing on what it does as far as CPU usage and frame rate and it really doesn't seem to bog down at all. I was getting 80 fps on a geforce 8800GT dual core with about 100,000 polys in the soup and I was only using 3/4s of a core.

Thanks so much for this. I have big plans for it.. big plans!

Colin

William Freeman   (Apr 06, 2008 at 04:30 GMT)
Oh and one more question.. should it be possible to have an animated or bone driven polysoup?

Ben Garney   (Apr 06, 2008 at 04:46 GMT)
Not without doing some changes to the polysoup system. It _might_ support moving fixed meshes around, although the meshes won't push anyone around, but skeletal animation definitely won't work. There wasn't a lot of incentive to add that because Torque in general doesn't support static world geometry pushing stuff around. The naive way to do that for skeletal case would be to regenerate the lookup structures after every animation update. Expensive but it would work ok for simple models. For more complex stuff you'd have to be a lot trickier... :)

Lee Latham   (Apr 06, 2008 at 06:53 GMT)
It's awesome enough. I'm using it in my game for 100% dif-free environments, and I'm delighted. No more map2dif for me....

William Freeman   (Apr 07, 2008 at 05:50 GMT)
yes it rocks for sure. Here is a video of some .dts meshes I added to the polysoup.. including a cave ;-)

http://www.youtube.com/watch?v=rM93s_HOmMk

Ben Garney   (Apr 07, 2008 at 06:27 GMT)
Awesome, cool to see a video of it in action!

Lee Latham   (Apr 11, 2008 at 21:15 GMT)
There is one issue I have run into recently. I'm switching from Milkshape to Blender as my primary modelling tool, and one thing that happens is that much of the time my player gets "hung" near triangle edges in the mesh when he's walking along. This will even happen if I import the mesh from Milkshape (via obj) and export in Blender. It will also happen if I export the Blender-created shape to Milkshape and export from there! So clearly Blender does something with the meshes that the polysoup collision code doesn't like--waaay over my head, I think. I have, of course, jacked with the export settings endlessly to no avail.

The most disturbing thing is that it doesn't seem to be related to the exporter per se, since taking it through Milkshape doesn't seem to help.

Any input would be greatly appreciated, as I am completely addicted to polysoup at this point :-)
Edited on Apr 11, 2008 21:16 GMT

Ben Garney   (Apr 11, 2008 at 21:29 GMT)
Maybe one of the tools is duplicating verts or doing other things to change the actual structure of the mesh?

Lee Latham   (Apr 11, 2008 at 22:38 GMT)
Darn, I thought you might be on to something there, but no luck. It did remove about 50 doubles in Blender. Also, I turned on glenableoutline and it seems the guy gets stuck well before the edges of the triangles. He can jump over these invisible obstacles and continue on, usually.

If yourself or anyone is interested, the blend and dts file are here (35k):
www.singularityfps.com/images/kitchen.zip

This is a room that players are meant to run around on, and the issue happens on the bottom of the floor, which is just six big triangles which meet in the center. I've had the issue with grid-like configurations as well, though.

Lee Latham   (Apr 12, 2008 at 00:41 GMT)
Solved! Blender defaults to two-sided meshes. Turned that off, and everything's hunky dory again :-) Thanks Ben for answering, and thanks to Joseph Greenawalt in another thread for helping me find it.

William Freeman   (May 08, 2008 at 05:55 GMT)
Is there a version out there for 1.5.2 with the shadow fixes for 1.7 TGEA? If not what would it take to fix the code for 1.5.2?

K. Anderson   (May 10, 2008 at 03:12 GMT)
@Freeman
This is the rar file that's updated for 1.5.2 that I got from ramen sama when I was having problems. The opcode stuff for polysoup is the same, its just updated with the things added in since 1.5.0 which I believe is a bunch of lightmap stuff. I had used the TGE resource in the rar file above and removed too much when merging them. I uploaded it here:

Polysoup1_5_2.zip

-----------------

One problem that I've started running into with the polysoup is that I'm crashing as soon as my flying vehicle touches the bounding box of a static mesh with polysoup checked. This doesn't happen to all models yet, but the only differences between them is one has a material applied and the other doesn't. Skins or materials on the models and it crashes, no materials and nicely shiney and it works perfectly. I had thought it was the collision with the polygons that was crashing when I hit a smaller mesh but trying a larger mesh its definitely the bounding box.

Anybody else had a similar problem?
Edited on May 10, 2008 03:14 GMT

Lee Latham   (May 10, 2008 at 04:45 GMT)
@K.Anderson:

Yes, I definitely had that problem, and applying a bunch of fixes from this thread helped a TON--although not completely. I still get crashes if someone does a whole lot of plane/mesh collision:

www.garagegames.com/mg/forums/result.thread.php?qt=63305

I'd appreciate it if you could let me know if you get it solid.

K. Anderson   (May 14, 2008 at 07:22 GMT)
@Lee
Will do, I haven't had a chance to get back to this just yet but I'll give that thread a shot, thanks.

You must be a member and be logged in to either append comments or rate this resource.