Usage of Collision Mesh for Games

Started by
23 comments, last by G-Man9566 15 years, 2 months ago
Hi All, I was wondering if you all felt that Collision Mesh is used often in today's and next gen games in general. Are there alternatives besides colliding with the actual Rendered( Visible ) mesh?
Advertisement
Not sure what you mean with your first question, but the latter is definitely a matter of choice. In games like Little Big Planet I assume pretty much that the collisions are calculated with the actual drawn meshes, while in games like Need for Speed you rather use a set of a few boxes instead the complete car, since you don't need to check the curves for the trunk and stuff like that.

I'm developing a Beat'em Up. I'm not using the drawn meshes, but I'm creating a set of boxes for the hit zones on the characters; 3 for each leg [foot, lower leg, upper leg], 2 for torso [upper and lower], 3 for each arm [hand, under arm, upper arm] and 1 for head. I don't really care if the punch didn't hit because of 2 inches. Like I said, it's a matter of choice.

I'm speaking as an amateur, so might as well be that I'm completely mistaken ^.^
I'm not sure about other games but my game uses bones with custom shapes which I export to my mesh format. Once exported from the modeler the objects are ready to be used in game.
Remember Codeka is my alternate account, just remember that!
Hi YoYo,

Collsion Mesh is excactly what you are using for your Beat'em Up. It is a seperate mesh ( apart from you actual visible mesh ) that is used for determining collisions. It is suppose to be much cheaper, if it is implemented correctly, therefore having much less mesh than the rendered mesh.

But obviously as you say it would be a matter of choice, depending on how accurate you collision should be. A trade-off between performance and accuracy.

Where I first got the idea of creating( in your modeling program ) Collision Mesh, was in Chapter 12 of the book "Game Art: Creation, Direction, and Careers" by Riccard Linde.
Sorry you got me wrong. I know what collision meshes are, I just didn't get your first question. But now I get it I think.
Current games like Fallout 3 or GTA 4 don't use alternate collision meshes anymore, at least that's what I feel. Which is good of course, but older computers might get problems with that sometimes. Older games, like GTA San Andreas or...uhm...Giantz: Citizen Kabuto do use them. In fact, in order to be a good player, you have to consider such things the most, as they can be a real pain in the bottom. In Super Smash Bros Melée you were only able to catch items when you hit the A button in the correct frame when the collision mesh of the item hits the one from the character. Getting the wrong frame resulted in not so good results ;)

//EDIT

Making a collision mesh in the 3D modeling program is an option I didn't think of, but it seems much easier than my way of creating collision boxes by code xD haha. Thanks for the hint.
Quote:Original post by YoYoFreakCJ
Sorry you got me wrong. I know what collision meshes are, I just didn't get your first question. But now I get it I think.
Current games like Fallout 3 or GTA 4 don't use alternate collision meshes anymore, at least that's what I feel.


Yes you interpretated it correctly :)

So you would say that the current games do not use an alternate mesh( Collision Mesh ) but uses the actual mesh that is rendered?

Well, that would make sense, since today's hardware is much faster.

Yep, that's what I'm saying.

Do you know of the game Clonk? It's a more or less primitive game of building a village and digging for minerals. The graphics are pretty basic sprites and it's only a 2D world, but the collisions are calculated per pixel. It makes perfect sense, because the rain simulation and using explosives makes the game feel much more real.
But in games like GTA 4, you don't actually have to use the complete car models, at least not for crashs. But well..if you manage to run GTA 4 on your computer at all, you don't care about this anymore I guess ;)
If you take anime games on the other hand, eg DBZ Budokai Tenkaichi, every hit creates a particle effect, so you won't recognize if the punch actually hit as lon as you see the shiny effects. Who cares about detailed collision meshes there? ;) That's also the same way I'm creating my game, since it's also using an anime style.

But here is another thought: how many collision detections does it take to make the cpu really suffer? Once you know that, you can also decide which method you want to use. [if you know any numbers, let me know ;)]
Well, besides performance, there is another reason why I would want to use Collision Mesh to test collisions, for my specific implementation.

I use a ray that I shoot from my "player"(FPS) in 4 directions to test if he collides with anything, and if he does, he can't move in that direction where the object is, but if I have 'n stair railing and the ray shoots over or between 2 railings, then the test indicates that the player does not collide with anything and he just walks right through the railings and falls off the stairs.

So if I have a collision mesh for the railings, enclosing the railing, it will test that it does in fact collide against the railing and not fall off the stairs.

Hope that makes sense.

On the performance issue. I currently do implement the collision testing with the actual mesh and there seems to be no noticible drop in frame rate. But unfortunately I dont have precise numbers now. I also do implement Collision Culling before I do the Collision Detection with an object.
I don't think current games use the same mesh, they may use it at some level, but it just doesn't make sence to brute force test thousands of polygons, at the very least you'd want to separate sections into groups (torso,arms, legs) and save group data into your mesh.

What I would do is create the proxy using bounding boxes for each bone, if pixel perfect collision is required then test the collision point (from a ray, assuming we're dealing with bullets) against an off screen rendered silhouette of the full model mesh.
Quote:Original post by G-Man9566
I use a ray that I shoot from my "player"(FPS) in 4 directions to test if he collides with anything, and if he does, he can't move in that direction where the object is, but if I have 'n stair railing and the ray shoots over or between 2 railings, then the test indicates that the player does not collide with anything and he just walks right through the railings and falls off the stairs.

So if I have a collision mesh for the railings, enclosing the railing, it will test that it does in fact collide against the railing and not fall off the stairs.


For that level of collision detection, you'd want to use a bounding box for the character, be it axis aligned or object oriented, you would use bounding box collision detection methods as well rather than just ray projection.

This topic is closed to new replies.

Advertisement