Jump to content
  • Advertisement
Sign in to follow this  
EnigmaticCoder

Walkable Tiles

This topic is 3596 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

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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!