• Advertisement
Sign in to follow this  

A little isometric guidence

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

Well, I finally got my tile map to display with a single layer. My question is from here to use other terrain types would it be best to use multiple map layers do display them? I started counting up the graphics I would need to display what I want and the number is getting pretty dang big. Is there a better method out there? And things like walls, trees, and other items. What is a good way of displaying them on top of the map? Are there any good books that discuss this? I am using 2d and at the moment have no interest in 3d for this solution. Maybe later. Thanks for any help. Here is what I have so far:

Share this post


Link to post
Share on other sites
Advertisement
id just go with layers, if you worried about too many layers you could just put a link list under each tile

Share this post


Link to post
Share on other sites
Well to start with your "map" in memory should only hold an ID to the base tile type that is to be displayed. So for example you could have something like:
MyTileType
int *TileID
int SpecialID
end
MyMapType
MyTileType *Tiles
end
(I'm quite rusty on my C and I know thats not valid in any language, but you
get the idea)


Read up on Texture Splattering and keep your layer count to a minimum (say 3-4) for ground tiles. Raymond was kind enough to put his code up for the whole thing (including shader code) in the new EDI Project 2 Thread.

When it comes to items on the map, its a different story. Keep a list, sorted by y and x, of objects and placements. Then when your drawing your scene find the start and end object on screen in this list (I've found per row works well) and render them after you have rendered your ground. Your player object and everything belongs in this 2nd list.

This stops you from too much overage in your map structure and has the added effect that to save out a world/level save point you simply itterate both lists and write them out. There are quite a few good articles on the subject uner Resources\Articles & Resources on this site as well as many other sites.

As far as books go:
Isometric Game Programming with DirectX 7.0
ISBN: 0761530894 (while its dated the info in it was still a good read)

- Jeremy

Share this post


Link to post
Share on other sites
I've just recently started my own isometric game and I was able to add walls and other stuff. Here's what I did:


class Tile
{
int TileType; //What kind of terrain the floor is
int WallType; //What kind of wall it has on top, can be used for trees, etc
bool Walkable; //Can it be walked over? you could walk through a tile with wall, or whatever you want
//other info...

friend class Map;
};

class Map
{
Tile Tiles[20][20]; //20x20 tiles
//other info and functions
};

//Then when you render walls and floors, you do this

//a function
{
DrawFloor(); //This draws the floor, you check only the TileType in class Tile
DrawItems(); //Draw this, only works if the item pictures are contained in a tile boundaries,
//otherwise it gets overlapped, then you'll have to move it into the DrawWall() function
DrawWall(); //This draws the walls, you check only the WallType in class Tile

//Draw other info
}



The reason the wall is drawn after all the floor is drawn is that it avoids being overlapped by the floor tiles.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Look at the 2 Isometric Engines at http://www.isogames.de

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement