Advertisement

Mapping

Started by April 04, 2009 10:27 PM
2 comments, last by polyfrag 15 years, 10 months ago
Hello everybody I'm making a RPG game. The game will be 2D graphics, based on sprites. My question is: What exactly is a map? How can I draw the map based on player position? I'm using direct3D Thanks
you should post this in the beginners forum...

It depends no what you mean by map though... map as in overworld map? town map? sprite map? bit map?

I'm not too far into this stuff on the programming side so I'm sure this is probably not the right way to do it, but if what you mean is how do you keep you character centered on a map as he moves around it seems to me that what you do is you have a giant drawn map as a sprite on a layer behind the character sprite and simply move it and anything else on it instead of the character sprite...

Most modern RPG I've noticed use a modified approach where they have the towns split up into sections and each section hardly moves, but it does enough so that the character remains centered. The Sprites then move across this... it seems bigger and is easier to process.
Advertisement
Hi, there are many things you could mean by a map.

If you mean the grid where the character appears to walk on, it is an array of tiles. In each draw cycle, the game scans that array and draw the tile stored in that cell. To draw the map using position relative to the character, you would use the character's position to offset the positions of the tiles. Each tile could be a point sprite (look up "billboarding").

You could also make it such that the entire map is a single point sprite.

If you are using Direct3D, I think Direct3D let you specify the projection matrix. That is where you put the coordinate of your camera (the character).


If you are talking about a minimap, then you use the same techniques, but draw everything on a small retangular buffer (your minimap), then you draw that buffer onto your actual buffer that you will flip.
If you are new to programming, maybe you should start with Haaf's Game Engine (http://hge.relishgames.com). It is very easy to use and powerful for 2D games.

This topic is closed to new replies.

Advertisement