Jump to content
  • Advertisement
Sign in to follow this  
SoulSharer

Game environment collision

This topic is 2593 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
http://img825.images...s/f/trailc.jpg/

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.
http://img717.images...s/i/ithink.jpg/



So am I right or there is another more efficient way to do this?
I believe Nevermore 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
http://img132.images...roundabove.jpg/

Share this post


Link to post
Share on other sites
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!