Walkable Tiles

Started by
5 comments, last by EnigmaticCoder 15 years, 3 months ago
As I was waiting for a haircut today, I jotted down a few ideas on how I can implement walkable and overhead tiles in my game. As it is now, I parse a map and assign numbers to tiles in a sprite sheet. What I forgot to add, however, was the "walkability" of the tiles. There are several approaches I could take: 1. Make each layer have uniform walkability. 2. Add a third table that determines the walkability of each tile in the sprite sheet. 3. Use one of the above methods but allow overrides. 4. Assign specific walkability for each map coordinate (I don't like this idea). Has anyone faced a similar design issue. Did you use any of the methods listed above, and if so, would you choose a different approach in retrospect?
--------------------Enigmatic Coding
Advertisement
Option 2 is the normal method I believe, although, in my view, option 3 being better. Isn't the answer... whatever works for you?
Quote:Original post by tonyg
Isn't the answer... whatever works for you?


Indeed. [smile]
--------------------Enigmatic Coding
If you don't ever need the flexibility of assigning walkability separately from the tile appearance, then #2 is probably easiest to implement.

If you do need that flexibility though, I'm not clear why #3 would be better than #4. You are going to need to store that override information in a way which can be easily queried, which means some kind of spatial structure (probably either a straight 2d map or a quad tree). In that case, storing the information for both the override and the default seems more complex.

For dynamic collision, you may want to store that information separately from the static walkability data.
One thing to keep in mind is that "walkability" may not be a boolean value. For example, lets say you have a swamp tile and you want to slow the player down while she is walking through that tile. It might be better for you to predetermine all of the attributes associated with a each tile in the editor, then when you place that tile at a specific map location then all you need to do is look at tile details for everything from collision to walk speed to transparency, etc.
Can't find back my bookmark about tile collision, but start here : http://jnrdev.72dpiarmy.com/
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]
Thanks, guys!
--------------------Enigmatic Coding

This topic is closed to new replies.

Advertisement