Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


map editor

This topic is 6100 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 am kinda new to game programming and I was just wondering a quick way to generate a large 2d map. I use a little program that lets me import the tiles I want and draw the map that way. the only problem is the map files are huge. is there a prog that would let me input a tileset and draw a map, but make a file with the number indexs of the tiles used, so that I could read in the file in my game a blit the correct tile in the correct spot. The only reason i ask is because the map generator I have now makes files upward of 2 megs each. I just think thats a little big......thanks for any help..

Share this post

Link to post
Share on other sites
well, as far as i understand you, you have got a map editor that is perfectly capable of doing what you want, so why to bother with someone''s else tools?
I don''t know how you save your maps, but I do it like that:
what I have:
1.a linked-list of tiles available
2.a tilemap size 128x128 tiles
btw in my linked-list I save how many times a tile is used. I know it''s a bit hard to keep calculating etc. Therefore you could simple calculate it after pressing the save button

I save it like this:
first go thru the linked-list with available tiles from front to back and if a tile is used (usetime>0) I give it a number (from 1 to 65535 - short type)
and now you start to save your file:
1.write how many different tiles you use (a number)
2.here you write all the tiles you use (so you put here tile image or tile filename so you can load it from a file)
3.after the block with tiles description I write down the whole tilemap. But in my case every tile takes only 4 bytes (2 bytes with the number of image used and 2 bytes with specific data about this tile)

If you sum it up, I end with 128*128*4bytes=64kb + some data to save tiles that are used for my map (I save tiles names, so it takes little space)

Hope it helps you a bit.

With best regards,
Mirek Czerwiñski

Share this post

Link to post
Share on other sites
You could also back more than one tile into a single byte in some cases. If you only have a max of 128 tiles you could make a tile only occupy 4 bits. You might also impliment some type of compression scheme.

Invader X
Invader''s Realm

Share this post

Link to post
Share on other sites

  • 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!