tile map questions

Started by
11 comments, last by catch 14 years, 10 months ago
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.
C++: Where your friends have access to your private members
Advertisement
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.
"Creativity requires you to murder your children." - Chris Crawford
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.
0))))))>|FritzMar>
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?
C++: Where your friends have access to your private members
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
0))))))>|FritzMar>
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.
C++: Where your friends have access to your private members
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
0))))))>|FritzMar>
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.
[size="3"]Thrones Online - Tactical Turnbased RPG
Visit my website to check out the latest updates on my online game
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?
C++: Where your friends have access to your private members
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 ;)
0))))))>|FritzMar>

This topic is closed to new replies.

Advertisement