# Managing Tilesets

This topic is 4038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Can anyone help me out with this? I'm using C++ and the Win32 API (no MFC). I want to load tilesets into my map editor. Should I just load them from a specific directory such as C:\Map Editor\Tilesets\ store them in an array? If not, how else would I do it? I need some input on how most of you seasoned programmers manage your tilesets in a map editor. Thanks!

##### Share on other sites
are you designing the map editor or using someone elses?

If the tileset files are big you might want to just store the filenames in an array and open them only when you need them.

##### Share on other sites
I wrote a map editor recently. The way I handled tiles was to have the user, when they create a new level, to also select a scheme file. This file described the tiles to use a bit like:

block 32 "grey block" img "C:\Graphics\grey.bmp"block 10 "blue block" img "C:\Graphics\blue.bmp"block 19 "teleport"   rgb 127 127 127

This allows the scheme file to specify any combination of bitmaps, solid-filled colours and so on. The scheme file is specified at the start of the level file (just ignored when the game loads a level file) and seems to be working out as quite flexible.

Hope that is the kind of thing you were looking for. Quite a big and general issue this.

##### Share on other sites
Well, EasilyConfused easily confused me, because I've never heard of a scheme file and only have about a year-and-a-half of C++ under my belt.

As for you, michael879, I am writing my own map editor from scratch. I want it to be able to be used for future projects, so I can't just store my filenames in an array. The tilesets I will use per game will differ, and I don't want to have to go directly into the code to change the tileset filenames for each different game.

Like I said yesterday, I was thinking of just using a specified folder directory for tilesets (that can be changed by the way). For example, if any of you have played unreal tournament, you know that new created maps go under the Unreal Tournament\Maps\ folder. I was thinking of doing something like Editor\Tilesets\sample_tileset.bmp (or .tls or something). Is that an effecient way of using them? Or is there a better way?

Any suggestions or guidance would be helpful.

Edit: BTW, I have created a game before (yes, a fully functional color windows game, not a DOS console game), so I think I am ready for this.

##### Share on other sites
Sorry to confuse.

The scheme files for my map editor are just plain text files that specify the paths to each tile graphic. I also wanted an editor I could use to create levels for different games and this was my solution.

If you want to keep it simpler, you could put all the tiles for a game on a single bitmap and have the user select the bitmap they want to load. If you put all the tile images in one directory, I don't see how the editor could know which ones were for which game.

Anyway, I just wanted to clarify what I meant by "scheme file" really. Just my fancy name for a text file containing configuration instructions.

##### Share on other sites
Hmm, that is a good idea. I just have one question. If you want the editor to recognize a new tileset you have created, all you have to do is go into the text (or scheme) file and create a new path there, correct?

##### Share on other sites
That's the general idea. The way I have it is to have different scheme files for different games, but if I wanted to add new tiles to an existing game, it is just a question of using Notepad or something to edit the scheme file.

I suppose a more fully featured level editor would have the capacity within the editor to modify the schemes through some kind of user interface.

##### Share on other sites
Alright, thanks for that! I'll begin working on it right away.

##### Share on other sites

This topic is 4038 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628730
• Total Posts
2984431

• 25
• 11
• 10
• 16
• 14