Sign in to follow this  
ManifestDestiny

Object collision for Maps

Recommended Posts

This is a very basic question, and I probably should have dealt with it before I started on this little project of mine. Anyways, I'm making a very simple RPG; the style resembles console RPGs, where you walk around a field and then get 'warped' to a battle. The problem I have is doing collision testing for the maps in the field. Basically, given any .x file, how would I set up bounding boxes for it? Is it possible to read vertices from the .x file and check to see which ones should be labelled for collision? This is about the only way I could come up with other than hard-coding bounding boxes for each map into the game, and that's OBVIOUSLY not the way to go. I was thinking perhaps a file to go with each .x file that would hold the bounding boxes for that map, maybe? I'm still not too sure how to do that either, though. Any help is gladly appriciated, and please try to explain it simply since I'm new to a lot of concepts. Thank you very much. =)

Share this post


Link to post
Share on other sites
Why don't you just use tiles? Read in a set of tiles:

0:0 0:0 0:0 0:0 0:0
0:0 0:0 0:0 0:0 0:0
0:0 0:0 0:0 0:0 0:0
0:0 0:0 0:0 0:0 0:0
0:0 0:0 0:0 0:0 0:0

The first number would be the tile number on the tileset. The second number would be the tile type (ground, wall, water, etc...).

Then just collision with a defined tile size.

Share this post


Link to post
Share on other sites
Quote:
Original post by MetaCipher
Why don't you just use tiles?


I agree with MetaCipher. It would be the most efficient method of collision testing. It appears that the best mathematical solutions are ones which don't include any mathematics... :P

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