Sign in to follow this  
Fuji

tile map questions

Recommended Posts

I have some questions about tile maps. 1) Is it possible to darken an image in GIMP to make it seem like night, but then allow light sources to still appear bright (using different layers, etc.)? 2) Is it better to put the map together as one image file for each area, or use programming to choose which tile goes where, like 010 would be ground, water, then ground again. 3) Is it possible to use layers when mapping to make it seem 3D, like having one tile of an object on a seperate layer above the player. Are there any free tile engine with layering? 4) If I choose to go tile by tile, should I save each as a seperate file? On another note, should I save everything as a seperate file? Even if maps won't work as a single image, should I still create the map so I know what I want in advance? It would really help if you could explain these things to me.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fuji
I have some questions about tile maps.

1) Is it possible to darken an image in GIMP to make it seem like night, but then allow light sources to still appear bright (using different layers, etc.)?

2) Is it better to put the map together as one image file for each area, or use programming to choose which tile goes where, like 010 would be ground, water, then ground again.

3) Is it possible to use layers when mapping to make it seem 3D, like having one tile of an object on a seperate layer above the player. Are there any free tile engine with layering?

4) If I choose to go tile by tile, should I save each as a seperate file? On another note, should I save everything as a seperate file? Even if maps won't work as a single image, should I still create the map so I know what I want in advance?

It would really help if you could explain these things to me.


Wow, this is a lot... Unfortunately, most of your questions are rather specific to the program/API/SDK/Engine you might be using.

1) Depends if you want true lighting effects or not. If your engine or target API has lighting routines, you'll have to work around that. If your engine has no lighting routines but you want to similate a night time effect, then yeah, you'll probably have to draw light and dark versions of each tile.

2) The whole point of tiling is using smaller images to compose a larger image. So yeah, there's some programming glue that takes a tile map format (an arrangement of tile IDs) and picks which image to draw for that tile ID.

3) Engine specific, of course. You can do layering tricks to do backdrop only or foreground only, and then the players/objects are rendered somewhere in between. How good the effect is, is up to your art and style of presentation. As for free engines, I'm not sure. Tiling is quite simple, so I'm sure there's plenty out there.

4) Depends on the SDK, I suppose. In general, you would compile your tiles onto one image file, and then they would be loaded by grid clipping. At least, this is the more traditional way of doing it.

From the sound of it, you may try reading a primer on tiling and how it works. It would likely answer most of your questions with more depth.

Share this post


Link to post
Share on other sites
1) yes, you can either use gimp to create a dark tile set and draw the bright tile set in the area you want lite, either doing a quick ray trace to determin which tiles you want lite or just have an area with in a circle lite. this idea here is by no means hard it just might not give you the effect you actually wish for.

2) i find it better to use the second method for describing the map, it is going to be more programming but i think it makes it easier to make better maps, with the first option you are less likely to change something about the map if you are annoyed with it and its harder and much more memory intensive to animate the single image map.

3)The Basics of a tile engine is fairly easy, if you can describe in words what you want to do, then the next step is to work out the logic, my tile engines well more tile map drawers tend to have 3 or 4 layers depending on what type of game i'm making and the requirements my steps tend to be

a. Draw Layer 1 - this is the base layer with your ground tile on it
b. Draw Layer 2 - folage like trees and plants and static objects the player can run into
c. Draw Objects - these are my characters, npcs, chest and what not things that change when the player interacts with them or move on there own
d. Draw Layer 3 - these are things that hang over the player like leaves of trees roofs eves and what not
e. Draw effects - this is where i draw my fogs and clouds and smoke
f. Draw interface - the mouse cursor and the gui, menus ect...

what i tend to use for drawing my tiles is sfml or openlayers you can use anything that will let you draw a tile on the screen.

4)when i'm making my tilesets i create each tile separately and then combine them into one large image, just so its easier for me to manage. and as for creating the maps, yes create them in advance but do your self a favor and write an editor.

Share this post


Link to post
Share on other sites
The only problem is, I can't program at all...Anyway, for question 1, I want only dark tiles, but I tend to make things too light occasionally. Anyway, thanks for the advice. I'll try to find a tile engine now.

Also, can you put an animation into a tile engine? Like, if I wanted the lights to flicker on the map, could I do that?

Share this post


Link to post
Share on other sites
for darker tiles you will want to keep your pallet darker and stay away from warmer colors like reds greens and yellows, and use dark grays, browns, blues and purples. and maybe a few gray greens or blue greens, like any thing you would have that would normally be white make it 55%red , 55% Green, 60% or 65% blue. you could probably get a fairly decent dark tile set by multiplying all of your tiles by something that colors maybe with a few tweaks here and there

Share this post


Link to post
Share on other sites
Is there something I can do that darkens all colors, like a plugin or something? I can't really draw the dark style I want, but making everything a little darker is perfect for what I want.

Share this post


Link to post
Share on other sites
off the top of my head, i would say creat a new layer in gimp with the said color values (138r, 138g, 170b)<--these are guesses and then make it a multiply layer or darken only layer then on top of that add any warm colors you may want for like a lamp or window

Share this post


Link to post
Share on other sites
I can't really see a reason for saving each tile as an individual image. The point of a tile"set" is so that the game only has to load the one tileset image and then can just cut/paste any tiles it needs from there. That way you're not loading hundreds of separate images. Just the one.

Share this post


Link to post
Share on other sites
How exactly does the program refer to part of the saved tileset image without referencing the image as a whole? Is there a special format or file extension to use when saving an image to use as a tileset?

Share this post


Link to post
Share on other sites
an example of doing this would be drawing only the part of the tile set that you need kinda like using a pallet

lets say you have a grid of 8 tiles wide and 32 tiles high and each tile is 48x48 pixles, then in your map you store the tile_id as a value between 0 and 255

to get the rectangle for the tile you want to draw lets say number 28

tile_position_x = mod(tile_id,columns) * tile_width
tile_position_y = int(tile_id/columns) * tile_height

these equations will give the x and y cords for the upper left hand corner of the tile then you would use a some kind of draw function to draw the tile on the screen

edit: i for got to mention what mod and int do
mod functions pulls the remainder form a division so in the case of mod(28,8) it would return 4
and the int function will help drop the remainder so in the case of int(28/8) you will get 3 instead of 3.5 so our coordinates don't end up in the middle of the tile

draw_tile(screen,draw_position_x,draw_position_y,tileset,tile_position_x,tile_position_y,tile_width,tile_height)

this is just an example of a function to draw the tile not a real tile unless you make it one ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by Fuji
How exactly does the program refer to part of the saved tileset image without referencing the image as a whole? Is there a special format or file extension to use when saving an image to use as a tileset?


Well what exactly are your goals? Are you an artist working with a programmer to create a tileset? Are you an upstart programmer trying to get started with tiling?

Since you already said you don't program, you're maybe an artist making a tile set? Or just someone trying to make a game with an existing engine?

The reason I ask is, explaining it to you as a programmer may be meaningless. At which point, it doesn't really matter how it works ;)

Share this post


Link to post
Share on other sites
I'm an artist and I want to start doing some mapping, but I haven't done anything of the sort, mainly character and item type things. I want to start doing environments now.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fuji
I'm an artist and I want to start doing some mapping, but I haven't done anything of the sort, mainly character and item type things. I want to start doing environments now.


Okay then. Most things you can think of are possible. However, your art will require some criteria or need to follow a certain pattern/format depending on the engine you are targetting. Your art is only as good as the program (if you are targetting games, which I think you are).

I'd stick to the more traditional tile method, which is tilesets. One image file, many tiles all stored together spaced by 0 or 1 pixels. Sets are then only loaded based on the map.

Whereas the maps only ever refer to the tiles in the set (the actual image file). Hence why some or many games seem to be broken up by environment type (winter, forest, desert, etc). This not only saves memory, but it keeps things nice and clean and organized. Modern 3d games might even use similar tactics in their texture sets.

But most of these restrictions are non-issues now (particularly for 2d). Modern PCs have more memory and processing power, you probably don't even need to worry about the technical reasons why things are done how they are done; the reasons might be insignificant, but it still serves as good organization. Just that it's a widely accepted format and if you're doing these to provide to the public for free use (or for a price), this is probably the most acceptable way to organize it. It's also easy to reorganize if a serious end user wants to. And chances are, since it's rather the standard, any engine you try to use will be able to load the tiles.

Try to stick to power of 2 as a precaution (that is 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, etc).



I've programmed a tile engine that didn't even bother with tilesets, I just loaded what was needed for the map and did some basic memory management (buffering). I didn't even bother to put my tiles in a single file, they were in fact all a separate file. At the end of the day, it just didn't matter. And while some of my programming brethren could make arguments about speed or efficiency, the end results are probably not measurable enough to make a real compelling argument.

Anyway, hope this helps a little.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this