Sign in to follow this  
SoulSharer

Game environment collision

Recommended Posts

Hello everyone!

I wonder what collision method for environment is used in most games today. I've been thinking and searching for information quite a while now, but still not sure if I'm right or not. I will explain my thoughts on Rayman: Origins example (because this is what I want to achieve)


I think that this game has a trail on which character moves
[url="http://img825.imageshack.us/f/trailc.jpg/"]http://img825.images...s/f/trailc.jpg/[/url]

My guess is that its made of lines connected to each other and game logic calculates slope of the line to determine point of a trail.
[url="http://img717.imageshack.us/i/ithink.jpg/"]http://img717.images...s/i/ithink.jpg/[/url]



So am I right or there is another more efficient way to do this?
I believe [url="http://www.newgrounds.com/portal/view/488613"]Nevermore[/url] game uses the same method.

Maybe there is a book or tutorial on such topic?
Thanks for any help!

P.s. I will need to make floating grounds like this as well
[url="http://img132.imageshack.us/i/floatgroundabove.jpg/"]http://img132.images...roundabove.jpg/[/url]

Share this post


Link to post
Share on other sites
Try Box2D and look for the 'prevent rotation' (or the like) setting on the fixture or body definitions (im sorry, I just had forgotten).

Hope this might help (look at the tutorials first!).

Share this post


Link to post
Share on other sites
One of the things you could do (and one of the neater methods I've seen executed well) is represent the map by two parts: the map and the collision texture.

Yes. Texture. :) You could draw up a texture map in which all non-alpha/arbitrarily chosen colored pixels could be used for collision data.

The collision texture:
http://www.berecursive.com/wp-content/path.png

The map you see in the game:
http://www.berecursive.com/wp-content/map-2.png

You can then check for collisions but referencing the texture data at the coordinates the player has landed on, do some per-pixel detection and linear smoothing, apply pseudo-physics, and there's your general idea. :)

This is just one way you could go about doing something like this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this