PDA

View Full Version : Clipping: Crazy Polygon Shenanigans



RobotPants
10-27-2005, 08:44 AM
I won't ever claim to know anything about game programming or 3D animation beyond what can be learned through the making-of portions of Pixar movie DVD bonus features, but is there any reason why lots of games still have so many objects clipping into each other? I'm sure there are legitimate technical reasons, but it seems the games that are the worst offenders tend to be rather sloppy overall. Plus, there are a lot of games that don't really do it at all, at least not in obvious places, which would seem to indicate to me that 3D technology in general is at least good enough to avoid the problem with some effort.

I'm sure it's an issue with development costs or having to cut corners with certain engines or just running out of production time to tweak things, but I really don't know. I do know that it's a huge immersion-breaker for me, especially when it shows up in cut scenes and even more especially when it shows up in an animation that you see throughout the entire game. If your character's holding a sword while idle, that sword shouldn't appear to be slicing through his ankle. I know MMORPG's or games with a huge amount of character customizability would make this way more difficult to avoid, but I don't see any excuse for it in a single player game.

To you folks here in game development, please don't take any of this as me being condecending. Again, I'm ignorant to the inner workings of games, so please enlighten me. :) I've just seen enough games that avoid clipping to make me think that there shouldn't be so many that still allow it to happen, but I'm sure it's much more complicated than I'm making it out to be.

Moore
10-27-2005, 09:07 AM
basically, afaik, the model you see isnt what the game is bothering to keep track of. It's likely just keeping track of where it is, or has some simple SUPERBOXY version of the model at best (bounding box) to determine collision.

I think having polygon perfect collision detection on a nice high poly modle would be very expensive performance wise.

RobotPants
10-27-2005, 09:35 AM
Right, but I'm not demanding perfection. I'm talking about avoiding the really obvious object intersection that just looks silly.

mouselock
10-27-2005, 09:55 AM
Right, but I'm not demanding perfection. I'm talking about avoiding the really obvious object intersection that just looks silly.

Such as?

In general, large straight objects don't clip through stuff as much this generation as they did last generation, because these are the easy problems to take care of.

However, hair, capes, other small stuff that looks pretty bad still does. It's not only the per polygon clipping you have to worry about, but also dynamically deforming the mesh somehow. If you want to, for example, prevent clip through on a cape, you have to be able to bunch and gather the cape at points where things would make it naturally bunch and gather. This looks just as horrible if you have a low poly model, but who wants to spend 4000 polygons on just a cape? You can try to divide up the cape so that the points that are likely to bunch have more polys and the rest has less, but then why not just hand animate everything anyway and make sure the animations don't clip in the first place?

Charles
10-27-2005, 10:01 AM
Right, but I'm not demanding perfection. I'm talking about avoiding the really obvious object intersection that just looks silly.

A lot of the time the really obvious ones are due entirely to laziness on the developer's part. There are many things devs can do to minimize the amount of visible clipping, without resorting to absurd and expensive per-poly collision calculations. A lot of it is making sure the player's shape (usually a cylinder) always encompasses the entire model of the character at all times.

I mean, on a smaller more precise level, you are going to usually have some, just because there's a point at which the performance costs outweigh the potential benefits.

Moore
10-27-2005, 10:01 AM
the only modern game with clipping that drives me NUTS is WoW. Capes clip through everything I can put on my back, EVERYTHING. Bliz have to be aware of it, and since you stare at the back of your character all the time... it's kidna worse than the poorly assigned vertices on the flying creature the hordes travel on (his head near his ears or horns or whatever actually seems to have 1 vert on each side linked to his wings or shoulders, so part of his head 'flaps')

Nothing alse has really been glaring at me for awhile now, though some psp games are pretty nasty with clipping. (looking at you gundam tactics, with your robot's feet 40 yards under ground)

Charles
10-27-2005, 10:02 AM
Yeah, that annoys me too. Which is why I usually turn capes off. Realistically they could have added a new cape model per armor type, to make sure it doesn't clip through yourself.

Weapons also should be properly placed and animated so that they clip through as little as possible. The problem comes when some artist makes a wacky weapon that doesn't conform to the standard weapon shape and size.

As for player on player clipping in WoW, that was a design decision on their part.

slantz
10-27-2005, 10:13 AM
I think the issue is that, when it comes down to it, they have more important things to spend their dev time on that cape clipping.

And frankly, I'm glad that's the case. I'd much rather have them address the hundreds of gameplay/balance/usability issues people whine about (rightly or not) rather than cape clipping.

Charles
10-27-2005, 10:19 AM
Entirely true. I do hope they put in optional physics based capes in the expansion though. It would add so much.

Union Carbide
10-27-2005, 10:19 AM
As for player on player clipping in WoW, that was a design decision on their part.

If you couldn't clip through other players, then people could block entrances to things by lining up.

In Asheron's Call, if you were PVP+ you couldn't walk through other PVP+ players. We used this to get through at least one dungeon (I think it was the one added for the first monthly event) by stacking players to get over a wall to the other side of a locked door.

Also, we discovered that if you were inside another player when you became PVP+ again after the death immunity expired, you froze that player in place. We used this in one of the "OF THE HILL PEOPLE" events on Darktide (naked noobs vs the world!) to good effect vs lvl 60 players :)

Charles
10-27-2005, 10:21 AM
That's why I said it was a design decision.

Personally though, I'd like for enemy players to be able to block each other. It would add a lot of depth to PvP gameplay.

ElGuapo
10-27-2005, 10:26 AM
The whole "looking at your character's back most of the time" comment raises an interesting, probably unrelated question. All this time is spent making detailed character faces. Faces show the emotion of the character you are playing. Yet when you are playing a 3rd person game, 90% of the time you are walking around you are looking at your character's back. You'd think that the artist's time would go into creating a really detailed back.

Backs are to gun models as 3rd person games are to first person. Put "created really good back and butt model" on your resume.

One alleviation of this tedium of looking at your character's back has been the "lock on" feature of games. For instance, in Fable, Hulk: UD, Link: OoT and WW, and other games, you get to see more of your character's model because you are not always facing the front while locked on.

Because we need to look forward when moving forward, and in so doing need to show the character's back, is there any way to break this paradigm? Or are we stuck looking at character's backs for the next 10, 15, 50 years in gaming?

Didn't mean to steal this thread, as the clipping issue is one I'm interested in also. Also related is the funny "legs stick out in rigor mortis over ledge" issue.

Moore
10-27-2005, 10:27 AM
I think the issue is that, when it comes down to it, they have more important things to spend their dev time on that cape clipping.

And frankly, I'm glad that's the case. I'd much rather have them address the hundreds of gameplay/balance/usability issues people whine about (rightly or not) rather than cape clipping.

They have their animators doing gameplay/balance/usability issues?

interesting approach, I guess.

mouselock
10-27-2005, 10:35 AM
I think the issue is that, when it comes down to it, they have more important things to spend their dev time on that cape clipping.

I think the issue is they have to reasonably be able to display Ironforge with everyone in there, wearing conceivably all the different visually distinct armor types, at a reasonable framerate. So the capes are low poly count.

It's really hard to make low poly count "cloth" look, well, cloth-like.

Yeah, the capes in CoH look a lot better. On the other hand, the armor/character models and such aren't nearly as ornate as WoW, and are much more limited. (Which is an odd thing to actually type out given the character creation process, but much of that is pushing around vertices to make thick/thin body parts, with a bit here and there for textures and tinting. There's nothing like the horribly ostentatious epic armor sets and different weapons and different hats and the like, so there's more resources for cool capes.)

Moore
10-27-2005, 10:43 AM
CoH also has some terrible clipping issues, I forgot about those.

tromik
10-27-2005, 10:49 AM
What is the opposite of clipping called? Where the objects should be touching/intersecting but you see a gap in between them? In SotC, when you grip one of the colossus and it's swinging you around, it sometimes looks as though you've let go, despite what the grip metre says. Almost caused a few heart attacks.

Charles
10-27-2005, 11:05 AM
floating.

EvilIdler
10-27-2005, 01:20 PM
The clipping issues in EQ2 are even worse - they're not just visual, but
a line of sight issue on the server. Enemies often hide in walls in narrow
corridors, and can attack you while being immune to your attacks.

CoH sorta solves its issues by not actually having collision detection for a
lot of the mobile units. Pedestrians are "on rail", and you're pushed out
of their way for being in their track rather than within a "bounding box".
The only actual collision detection is between players and hostile NPCs.
(I haven't looked at PvP at all, but presume there's detection there also.)

These are multiplayer games, though, where N players multiplied by every
NPC and wall becomes very expensive for the server to calculate.

In a single-player game, or the typical FPS with no more than 32-64
players, it feels like laziness. Even Half-Life (the Quake 1 engine with
skeletal animation) had reasonable collision detection. Shoot between the
legs of someone, and you hit the wall.

kathode
10-27-2005, 01:44 PM
The quick and dirty answer is that it's hard. As games get more and more complex, it becomes extremely difficult to model every collision that's taking place in the environment. Sure Half-Life 1 had great collision detections. It had like 1500 polys on the screen at once. Super Mario Brothers had fantastic collision detection too. Doesn't mean squat when we're now running around with games that use 10k polys per character.

Collision boxes/capsules are used to simply collision modeling - the math for calculating collisions on a regular geometric object is infinitely simpler than for some crazy thing an artist creates. The problem is that these objects are not malleable - it screws up the math. So you've got a collision box around you character. Great, but now you need your character to stick his arm out. What happens then? Well obviously, you either let it go outside the box, or you introduce complications by allowing your box to scale dynamically.

The other problem is that games are not necessarily constant simulations. The vast, vast majority of real-time games operate on a per-frame basis. That means they are only concerned with how much things change between one frame and the next. They don't care that a bullet "moves" through infinitely divisible space between two frames. It's in one place, then it's in the next. This model means for perfect collision calculations you are limited to performing the calculations after all the frame data is ready for rendering, retroactively changing the scene. For slow-moving objects, you can fudge the numbers a bit and get a reasonably good system without much overhead. For fast moving objects you run into something known as the "bullet through paper" problem. It took Havok themselves three full versions to solve the "bullet through paper" problem, and they do it by running a full-on constant simulation of physics data concurrent with the game they're working on.

So yeah, not the easiest thing in the world, and one of those places where you've got to pick your battles.

Charles
10-27-2005, 01:53 PM
The other problem is that games are not necessarily constant simulations. The vast, vast majority of real-time games operate on a per-frame basis. That means they are only concerned with how much things change between one frame and the next. They don't care that a bullet "moves" through infinitely divisible space between two frames. It's in one place, then it's in the next. This model means for perfect collision calculations you are limited to performing the calculations after all the frame data is ready for rendering, retroactively changing the scene. For slow-moving objects, you can fudge the numbers a bit and get a reasonably good system without much overhead. For fast moving objects you run into something known as the "bullet through paper" problem. It took Havok themselves three full versions to solve the "bullet through paper" problem, and they do it by running a full-on constant simulation of physics data concurrent with the game they're working on.


Actually, it's pretty easy to determine that kind of thing for a bullet. The problem is for larger objects which move at a reasonable speed, but need to have their entire large size swept through time.

Tyrion Lannister
10-27-2005, 02:10 PM
Among many other things I'm a physics/collision system programmer for games. kathode's answer is spot on.

I get really annoyed when poor collision is referred to as "clipping" though. :-).

In my experience the majority of the problems are caused by poor art. Which probably means inadequate tools supplied to the artists. You should see far less of these issues in future games, as developers learn their lessons about managing tools and collision assets.

EvilIdler
10-27-2005, 02:13 PM
In my experience the majority of the problems are caused by poor art. Which probably means inadequate tools supplied to the artists. You should see far less of these issues in future games, as developers learn their lessons about managing tools and collision assets.

So, is there a book on programmer-to-artist communication? :)
(Only half joking - I could use one myself!)

mouselock
10-27-2005, 02:25 PM
Among many other things I'm a physics/collision system programmer for games. kathode's answer is spot on.

I get really annoyed when poor collision is referred to as "clipping" though. :-).

In my experience the majority of the problems are caused by poor art. Which probably means inadequate tools supplied to the artists. You should see far less of these issues in future games, as developers learn their lessons about managing tools and collision assets.

You sure about that? Seems to me as people demand more and more realistic systems (hair, cloth, etc) in their graphics, it's going to get worse. Not much an artist can do alone to solve that. (Maybe pinning the flexible system along with telling the programmer to make it stiff enough so it barely moves..)

Marcus
10-27-2005, 02:30 PM
Here is what bugs me in the new DOA for the 360 everything looks great except the chicks hair. Some of it still falls through her body... I mean really now there is like nothing else in the game except the chars how hard could it be to at least get that right?

RobotPants
10-27-2005, 02:54 PM
I get really annoyed when poor collision is referred to as "clipping" though. :-).

So what is clipping, then? I always thought that was the term for when a 3D object passed through another 3D object that it wasn't supposed to, like someone's hair going into their back instead of resting upon it, as in ranvarian's example.

LarryLard
10-27-2005, 03:00 PM
Here is what bugs me in the new DOA for the 360 everything looks great except the chicks hair. Some of it still falls through her body... I mean really now there is like nothing else in the game except the chars how hard could it be to at least get that right?

Hair is astonishingly hard. I'm trying to think of newish examples from animated movies... can't come up with anything more recent examples than Toy Story and the Final Fantasy movie. Both were state of the art pre-rendered, and even with that advantage in both the hair was terrible.

Marcus
10-27-2005, 03:02 PM
Yeah I really have no doubt its hard but really its DOA and there is like nothing to that game. I dunno thats just how I feel.

bago
10-27-2005, 03:27 PM
The whole "looking at your character's back most of the time" comment raises an interesting, probably unrelated question. All this time is spent making detailed character faces. Faces show the emotion of the character you are playing. Yet when you are playing a 3rd person game, 90% of the time you are walking around you are looking at your character's back. You'd think that the artist's time would go into creating a really detailed back.

Why do you think Tomb Raider was popular.


On another note it's called clipping because drawing a pixel on screen was expensive, and when doing 3d you rendered from back to front. This meant that in order to save pixel drawing time, if something in front occluded something in back, the thing in back was "clipped" so that it didn't draw pixels that were just going to be drawn over by the pixels of the thing in front.

Raife
10-27-2005, 03:30 PM
the only modern game with clipping that drives me NUTS is WoW. Capes clip through everything I can put on my back, EVERYTHING.

I've had that problem with capes as well, but at least you can turn those off. Weapons bug me a lot more. Weapons are generally fine on Humanish-sized characters, but give a Gnome a sword and it will extend through the ground. Give a Tauren most two-handed weapons (aside from staves and polearms), and they will extend through their tails when sheathed. Some shoulderpads are also bulky enough that a weapon sheathed on the back can go through them.

It doesn't affect gameplay, but it is one of those niggling things that gets annoying.

Tyrion Lannister
10-27-2005, 05:10 PM
I get really annoyed when poor collision is referred to as "clipping" though. :-).

So what is clipping, then? I always thought that was the term for when a 3D object passed through another 3D object that it wasn't supposed to, like someone's hair going into their back instead of resting upon it, as in ranvarian's example.

Clipping is what you do to polygons etc to cut them to fit the screen, a volume etc.

Intersecting, interfering, overlapping, passing through each other, staying in collision is what objects do when you think of clipping.

And... I'm currently solving the hair, cloaks thing with a set of particles that check for collision against a limited set of precalced primitives each and do a simple constraint relaxation between the particles on each strand. It mostly works. Still not perfect though.

mouselock
10-27-2005, 05:58 PM
And... I'm currently solving the hair, cloaks thing with a set of particles that check for collision against a limited set of precalced primitives each and do a simple constraint relaxation between the particles on each strand. It mostly works. Still not perfect though.

Doesn't that tend to make things "bouncy"? (I would assume you necessarily have to overconstrain to begin with, otherwise you get the intersection problems back if you have lots of velocity.)

ElGuapo
10-27-2005, 06:18 PM
This is why I love Qt3. Some guy says "yeah, this clipping thing, this bothers me". Another guy comes along and says "yeah, that is annoying, I'm fixing that there problem".

Boo-ya!

bago
10-27-2005, 06:44 PM
Yeah, but DOA4 pretty much does what he's describing, and yet people are bitching about it still because it's not per-poly-perfect.

But whaddya expect from the internet?

Kool Moe Dee
10-28-2005, 01:17 AM
Yeah, but DOA4 pretty much does what he's describing, and yet people are bitching about it still because it's not per-poly-perfect.

But whaddya expect from the internet?

Not only that, but it sounds like the same technique that Hitman has been using for years.

And in response to people saying that "hey, DOA4 only has the two characters onscreen, how hard can it be??/??.?"...just because a problem "sounds" simple doesn't mean that it is. :?

mouselock
10-28-2005, 05:37 AM
Yeah, but DOA4 pretty much does what he's describing, and yet people are bitching about it still because it's not per-poly-perfect.

But whaddya expect from the internet?

Not only that, but it sounds like the same technique that Hitman has been using for years.

And in response to people saying that "hey, DOA4 only has the two characters onscreen, how hard can it be??/??.?"...just because a problem "sounds" simple doesn't mean that it is. :?

There's a bit more onscreen in all the DOA4 screenshots I've seen than the two characters.

Tyrion Lannister
10-28-2005, 09:48 AM
Yeah, the IO paper is a great intro to the loose constraint behaviour I'm using for my hair stuff. Simple and effective. Particle collision response with non-hair is not handled as in that paper though. Also, I have to do some additional damping for particles known to be in resting contact, that stops most of the unwanted fly-away behaviour, and extra bounciness.

It still doesn't look good enough for me yet - but it's games, so we'll ship with the best we have at the time we need to ship. If I'm lucky I'll have worked out some of the other problems before then.

The point is: this stuff is still at the research phase for almost everyone. It is hard to do right, much harder than drawing pretty pixels. And I'm pretty sure it won't be appreciated enough to justify all the effort - but nerds like me will still try just because the problems are interesting.

mouselock
10-28-2005, 10:01 AM
The point is: this stuff is still at the research phase for almost everyone. It is hard to do right, much harder than drawing pretty pixels. And I'm pretty sure it won't be appreciated enough to justify all the effort - but nerds like me will still try just because the problems are interesting.

Speaking of which, got a link (or at least a real cite) for "the IO paper" since this isn't actually my field?

Also, I recall seeing about a year or so ago some nice research being showcased at siggraph dealing with controlling hair/styling by guide volumes/splines. Are you implementing something similar?

Tyrion Lannister
10-28-2005, 10:14 AM
The point is: this stuff is still at the research phase for almost everyone. It is hard to do right, much harder than drawing pretty pixels. And I'm pretty sure it won't be appreciated enough to justify all the effort - but nerds like me will still try just because the problems are interesting.

Speaking of which, got a link (or at least a real cite) for "the IO paper" since this isn't actually my field?

Also, I recall seeing about a year or so ago some nice research being showcased at siggraph dealing with controlling hair/styling by guide volumes/splines. Are you implementing something similar?

I think its on GamaSutra somewhere, google for IO interactive - also there is a nice paper by some guys at Rainbow Studios.

And yeah, I'm playing with that paper right now - maybe it'll stop my hair from looking quite so weird.

RobotPants
10-28-2005, 01:53 PM
So basically, Mr Lannister's going to save us all! :D

Lots of interesting stuff, guys. I can almost feel your big giant brains pulsating from here. :)