Jump to content
  • Advertisement
Sign in to follow this  
diddy10000

RTS tile editor

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

I'm trying to make a tile editor for a 2D RTS game using Direct x. I'm looking for some suggestions on what's the best way to set up the tile. My plan is to make an array of tile structure which will have an int for the tile texture, 8 tile pointers that points to the surrounding tiles (for AI pathfinding), and a flag to check if it's walkable etc. Any comments or suggestions will be appriciated, and btw, what's the best way to scroll the tiles?

Share this post


Link to post
Share on other sites
Advertisement
The way you represent your map is entirely independent of either the type of game you're building (i.e. RTS) or what you're using to render your graphics (Direct x).

Personally I'd recommend that you don't store the texture on the tile, rather store some information telling you what sort of tile it is to the game, then look up based on some rules what sort of texture you might need to represent that.

It's redundant to store 8 pointers to the surrounding tiles as you can trivially determine where they are by adding / subtracting one from the x and y coordinates.

Tiles don't *really* scroll, you simply set up your frustum so it only shows visible ones, i.e. cull ones which are out of view. To make it appear to scroll, either you write a transformation function to transform world coordinates into screen coordinates, or you let your rendering hardware do that for you, and call whatever functions necessary to set up this transformation there.

As far as editing the tilemap itself and loading / saving, have you considered:
- Use a pixel drawing program with one tile per pixel
- Use a text editor and have different characters for different tiles
- Use an existing third party tile editor (there are many free ones)

All of which will save you effort over writing your own (and probably have more features, like copy / paste and undo)

Mark

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!