Monday, October 3, 2011

Collision Detection Thoughts

My collision thoughts are about the way people implement collisions in shmup or platform games for such things as sprite to sprite detection. Though some of the thoughts could apply to ground just as easily.

I only have three main thoughts about the Indie games I have played these last few years.

#1. Man they overthought this collision detection. Some games come with perfect pixel collison systems. Even though they didn't need them. Do i really care as i carouse along a platform that the horn of the rhino kills me the moment a pixel of it crosses into my avatar? Well to be perfectly honest i DO care. In fact i care so much that it does this i am unlikely to keep playing the game. The reason is that i do not think that a pixel of the horn into a pixel of my hand as it swings forward in it's running animation should constitute me taking a hit. Especially as i was a little late in my reaction and i was busy tring to pull away from the charging rhino, but wsa pixel or so too slow. I realy hate this kind of collision. About 30 years ago when i was creating games this was more normal. Then i discovered more friendly detection made everyone a lot happier. Friendly being that the horn would have to penetrate a lot further into my avatars body for me to suffer any damage. In Shmups i used to call the effect scraping paint. The bullets were allowed to scrape the paint off my ship for a while befor ei would take damage. The big benefit to this approach is that the player feels like this soft collision is forgiving and allowing them to be a bit more sloppy. I have to say that i have whooped and hollered before when getting away with this.. So close to death, so alive mwuhahha!

#2 They did not really think about this collision system I reckon. Some collision systems seem to be broken. The Coder has the avatar running around the screen and when the bullet gets to ya you die. However in some games the distance the bullet is away from my avatar when i take a hit seems to vary. I hate this of course. I like games to be consistant, so i can learn the rules and play accordingly around and within them. Collisions that happens at odd times just make me feel like i am being cheated. And i have played several arcade games in the years past where i felt like this as well, it is not just the Indie dev. Thinking about what collision system you need generally goes along with what kind of game you are writng and the graphical shapes of what you are colliding with. Choosing generic geometry shapes i always think of is best, no need to complicate things most of the time. Unless of course you are writing one of the pixel collision games where the player swoops along the pixels you have drawn etc.

#3 I never noticed the collision in this game. OMGoodness they musta done a great job and got it right to the point where i do not think about it. YAY! Nice job you folks. Not much to say here.. and that i think is the point. If collision feels natural. Noone will remark on it.

I tend to use two shapes for collsion, Rectangles and Circles. I do not seem to need anything else and stacking circles is easy as well. If i have a shape that has bits sticking out of it, but not too far, i don't really want the player to suffer a hit if that nodule gets hit by something. so i tend to make the circle inside of the avatar etc. Then i have a multiplier on size that i can easily adjust to make the paint scraping easier or harder. This is also another way to have a more difficult game without having to add more enemies or bullets etc. Now a player would have to be a bit more skillful and accurate as he plays.

Heres hoping your detections stay true,
Da Voodoochief

No comments:

Post a Comment