# Object collision for Maps

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

## 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 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 on other sites
Quote:
 Original post by MetaCipherWhy 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

1. 1
2. 2
3. 3
Rutin
20
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633656
• Total Posts
3013190
×