Archived

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

Tile based maps for shooters

This topic is 6568 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

To make it so only part of the tile shows you have to clip it to the screen. This is done pretty easily by checking if what you are writing is outside the bounds of video memory, and if it is, not drawing that pixel.


Gary

Share this post


Link to post
Share on other sites
For the first question, I would recommend not to use tiles at all. 10000x640 level (640x480 is your resolution?) takes only 12 megs of memory if you have 16-bit graphics. Everybody has 32 megs these days! And if you save it as a jpeg, it makes your game quite small to download also (say, 500kb per level).

This way you can also make destroyable walls.

Share this post


Link to post
Share on other sites
Are you sure that's a realistic solution though? Im trying to get experience that will help me get a job later on...

Share this post


Link to post
Share on other sites
Yes, it's a realistic approach. Some good commercial examples that do not use tiles: The Reap (a game like yours), Baldur's Gate.

Tiles are dying like 8-bit gfxs. Except in strategy games where the engine itself needs the map to be tile-based (for AI). Close Combats don't use tiles also..

Non-tile games are easier to do also.

Share this post


Link to post
Share on other sites
Tiles aren't dead. There are a lot of effects that are still easier using tile-based engines. And they make randomly generating maps a whole lot easier. But if you do use a bitmap based map, don't use jpeg. Jpeg is a lossy compression, so there will be strange visual artifacts on your level that you may not like.

Share this post


Link to post
Share on other sites
I agree, JPGs don't look all that good. Plus, even if I could compress a picture, and make the levels 500kb, then, with 10 levels, thats gonna be 5mb in itself, plus all the rest of the data and binaries. With tiles, each tileset will probably end up being about 100 k at most, and with 5 tilesets, then I have 500 kb for all the level graphics, and the level file will probably end up being about 1 mb or more at most, so that's about 1/5 the size of the jpg idea.

Share this post


Link to post
Share on other sites
I don't see how tiles can be beat. A large background like that won't fit into video memory (on most systems), and you won't get any hardware blitting, which is already a big hit. Using tiles, you can easily store most of the heavily used tiles in video mem. There will also be lots of paging when accessing that monster in system memory, which is a fairly big hit. It just breaks all the spatial locality rules.

How can a 12Meg image be compressed into 500K? Without cranking the lossy-ness, that seems very unrealistic (to me).

Rock

Share this post


Link to post
Share on other sites
Hey I know what I'm talking about:
Real-life R-type-stylish gfx material 10000x640 24bit picture, medium quality jpeg (adobe photoshop) -> 359k and still looking good. Jpeg is an impressing format, yep! (doesn't beat wavelet, though)

I have made a game that had 70 megabyte (!) sized levels (including parallax) in system memory and it ran smoothly. Walls were destructable of course.

The "visual artifacts" SiCrane talked about, mean probably the border of transparent and non-transparent on the jpeg level? Yes, that is a little problem, but I have solution:
Make a 2-color pcx (or png) that tells, where is transparent and where is not. And it being only 2-color pcx, it takes only few kilobytes of disk space.
And if you use more colors in that "attribute" picture, you can put there all the enemies starting places as different coloured pixels. So it's very easy to make levels also. You don't even need any kind of editor of your own to make levels!

If you planned to have only 100kb of tiles per theme, then there are not many of them (if they aren't hiqhly jpeg compressed..)!

So back to plain jpeg style:
500kb*20 levels=10 megabytes is not a 'huge' download these days if you get plenty of _good_ graphics in that size.

As I said before, many commercial games (CC,Baldur,Reap) don't use tiles anymore because jpeg graphics are just so much more beautiful.

--
And if you generate your levels, I still don't recommend tiles. Just make your generator draw the level in a huge bitmap, using clipart and stuff the way you like. I've programmed this type of level generator, too and it makes very nice looking levels.

Share this post


Link to post
Share on other sites
I am working on a top view flying shooter, like Raptor: Call of Shadows, and Drone. I was thinking that for my tile maps, I could either have a relativly small number of large tiles on the map, or a large number of small tiles. What do you people suggest? Also, how would I blit the tiles at the top of the screen so that only the bottom area I need shows?

------------------
http://qoy.tripod.com

Share this post


Link to post
Share on other sites