Jump to content
  • Advertisement
Sign in to follow this  

Big tile maps

This topic is 5052 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 have tried tiling some small maps by hard coding the maps with numbers which represent the different types of tile. I thought of trying to tile big maps but i guess it will be quite tedious to hard code big maps. Can anyone offer any advice how to tile big maps efficently? thanks in advance for any advice

Share this post

Link to post
Share on other sites
Make your self a mapeditor, write it in Java, C# or VB so you can get it done nice and quick.

Split the screen into 2 the left hand 2/3rds of the screen is a grid of blank squares with its X,Y specified by the user at start up. the right hand 1/3rd shows the tilemap (bitmap with your tiles on). Also make the user specify the tile size on startup.

Give both windows scrollbars when the user clicks on a square in the tile map the program makes that tile the "brush" and also logs its position on the map as:
point at mousedown[(int)x/tilesize,(int)y/tilesize)] this will give you the row and column of the tile clicked on,remember to cast them to integers to get rid of any floating points. Next paint the tile on the sqaure the user clicks on in the blank grid.
The blank on screen grid represents a 2D array defined at start up that has as many elements wide and high as the map is TILES (not pixels) wide and high.
When the user clicks on a blank tile in the leftwindow with a brush selected get the: point at mousedown [(int)x/tilesize,(int)y/tilesize)] to get the row and column of the array.
now just write the loggeed x,y from the tile map into x,y co-ord on the array.
When the user is done and clicks save stream the data out of the array into a text file in the manner you will be reading it back.

There you go, a simple map editor with a front end that stores the map in a text file your program can read into an array.
at a later date you can add "paintable" collision data to the choices of your editor, 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!