PDA

View Full Version : Collision detection...


Patrick_
29 Jul 2008, 00:48
What are the collision detection methods used for W:A? Is it mainly the use of collision boxes?

Etho.
29 Jul 2008, 01:04
I believe it uses pixel perfect collision detection checked for every pixel moved. So if a worm moves 10 pixels left in 1 frame, W:A will perform up to 10 pixel perfect collision checks. (just guessing)

M3ntal
29 Jul 2008, 01:08
I know mine collisions are detected 5 times per second (every 10 frames).

KRD
29 Jul 2008, 01:31
I know mine collisions are detected 5 times per second (every 10 frames).

That's mines checking for worm proximity, though, not actual mine collision detection. I know you know that, just thought you worded it a little silly.

All, or nearly all objects in the game use a collision mask of the same size and shape, a 7 by 5 pixel rectangle. Worms have a slightly different one, the shape of a vase. Sort of. These two articles would be a good place to start if you're after the details, I think:

http://worms2d.info/Physics_Engine

http://worms2d.info/Worm_Walking

As an aside, I've seen a Homing Missile go through the middle of a worm and not detonate! :eek:

SgtFusion
29 Jul 2008, 08:26
Worms have a slightly different one, the shape of a vase.
Worms are 9×16 pixels big.

yakuza
29 Jul 2008, 08:54
Worms are 9×16 pixels big.

We're talking about collision here, not sprites.

edit: my bad, then.

SgtFusion
29 Jul 2008, 09:08
I know. That's how "big" worms are according to the game's logic. The sprites are bigger than that.

Patrick_
30 Jul 2008, 14:53
Cool, thanks for the info. I appreciate it. :)

KRD
31 Jul 2008, 16:11
Worms are 9×16 pixels big.

Not rectangular in shape... was my point.