Well threadtitle almost says everything, are there any shortcuts when the task is to create convex collisionmeshes? I hate hate hate doing it by hand, aren#t there any semi automatic approaches?
We use Havok, it includes an automatic tool for this. We eventually wrote our own in MAXScript though, we wanted to create hulls from selections of faces/vertices/multiple objects. That doesn't help you much though, sorry.
Depending how complex you want the collision mesh to be and if its to be used in UE .You could use the tools inside UE3, open up the mesh viewer and under collision you have some tools there.
Depending how complex you want the collision mesh to be and if its to be used in UE .You could use the tools inside UE3, open up the mesh viewer and under collision you have some tools there.
thats way, way, way too simple, now i know why most games are just planar surfaces...
I've tried a few automatic solutions and they always sucked in one way or another. Doing it by hand guarantees good collision. Bad collision can make your game feel frustrating or even broken.
Another thing, about the "planar surfaces" stuff - in id Tech 4 anyway, the collision calculations are done in such a way that any planar group of triangles counts as a single "polygon", so it's actually more efficient to have a perfectly planar quad instead of two triangles which are just slightly off from being a quad.
This also means that flat cylinder caps are always treated as a single polygon even if your cylinder has up to 64 sides. I'm not sure if this is the same in other games, but it means you can really optimise stuff quite well like that.
Is it really that much work, Neox ? A few boxes, convert to poly, drag some verts and done ? What sort of crazy models do you make that collisions become such a burden ?
the tower itself is easy, the platforms too, the suspensionbridges (not in that image) also, what really is annoying is the terrain as it is really wavy and organic
Yeah, terrain is annoying and usually has it's own collision done. Since it's such a small bit what you can do is select the mesh, convert to tri's, explode all of them to individual tri's and extrude down a tad keeping the original face. Then name them all :P. Another thing to is if you're using Havok, it will bitch and maybe crash that the number of collision prims are excessive. So make multiple meshes if you have to...
I had to do this in a pinch and it worked.
But watch out for gaps and stuff, not sure how your pathfinding works, but Kismet might freak out.
Oh and you're supposed to duplicate the mesh BEFORE you do all that stuff... I forgot to mention that.
You might disagree, but you can run such a big piece without collision mesh, using the view mesh as collision. In the commercial UE3 engined game I worked on, we did it for pretty much every big enviro piece. It was never a problem performancewise, even on Xbox or Playstation, since Physx handles that sort of stuff very efficiently for static meshes.
I guess you know how to set a mesh to that sort of collision ?
problem is that you get stuck everywhere especially on those rocks on the tower, however for some reason i have a BAD framdrop when using collision meshes instead of per poly collision, i don't get it...
ok got it had to turn off UseSimpleRigidBodyCollision, now we are back on 60fps - great
as for blocking volumes on problemetic areas, well i would have to either split up the lighthouse which will be fun as its in some sequences and we would need to plug more assets in those sequences then (this night is msuc so no time for big changes) or i would have to create collisions that are bigger then the per face collision and thats definitely a thing i don't want to have i don't mind the player to cross the rock a bit with his shoulder when jumping as long as the gameplay is solid, so taking space to jump around is really not an option
Replies
I hate doing it by hand, but it's a necessary evil as the results can be tailored to what you need.
thats way, way, way too simple, now i know why most games are just planar surfaces...
Another thing, about the "planar surfaces" stuff - in id Tech 4 anyway, the collision calculations are done in such a way that any planar group of triangles counts as a single "polygon", so it's actually more efficient to have a perfectly planar quad instead of two triangles which are just slightly off from being a quad.
This also means that flat cylinder caps are always treated as a single polygon even if your cylinder has up to 64 sides. I'm not sure if this is the same in other games, but it means you can really optimise stuff quite well like that.
the tower itself is easy, the platforms too, the suspensionbridges (not in that image) also, what really is annoying is the terrain as it is really wavy and organic
http://codesuppository.blogspot.com/2006/04/approximate-convex-decomposition.html
there is supposed to be a implementation for this
also I found
http://portal.acm.org/citation.cfm?id=1375749
which was rather new
I had to do this in a pinch and it worked.
But watch out for gaps and stuff, not sure how your pathfinding works, but Kismet might freak out.
Oh and you're supposed to duplicate the mesh BEFORE you do all that stuff... I forgot to mention that.
kinda old. works well sometimes, doesn't work so well other times.
:P
I guess you know how to set a mesh to that sort of collision ?
as for blocking volumes on problemetic areas, well i would have to either split up the lighthouse which will be fun as its in some sequences and we would need to plug more assets in those sequences then (this night is msuc so no time for big changes) or i would have to create collisions that are bigger then the per face collision and thats definitely a thing i don't want to have i don't mind the player to cross the rock a bit with his shoulder when jumping as long as the gameplay is solid, so taking space to jump around is really not an option
but it works now, with a good amount of fps, phew