Original Post
Hello there,
I'm fairly new to game programming and, even though it's probably not the best idea, i've decided to try and build a 2D isometric engine as a first game programming project (with XNA). Probably not the easiest project for someone totally new to game programming, but i find it motivating, so meh...
I've been reading around about 2D isometric engines and rendering techniques, and have got some of the basic stuff pretty much figured out, but there's a big question still bugging me.
Since i want my engine to support heights (and my tiles aren't flat), i'm working with many layers of tiles. For now my tiles are actually really just blocks that i'm stacking on top of each other.
My drawing test sandbox looks a little bit like this currently:

On to my concern: Since i have many layers of blocks, and want pretty large maps, i'll be dealing with a lot of blocks when it comes to rendering the game world. Now it's quite obvious that, for a full cube of 5 x 5 x 5 blocks, i'd only need to render 61 blocks, since the blocks inside/at the back of the cube wouldn't be visible anyways.
Now let's say i want to render a map with dimensions 25 x 25 x 10... At that point i assume it would be a pretty big waste of ressources to render every single block, including the ones that aren't visible to the camera. What if i have holes in my map, making some blocks from the inner layers visible, and others invisible? When i iterate through my blocks, how do i know if the block i'm about to render is actually visible to the camera, and doesn't already have a cube/cubes hiding it entirely from the camera? Since i want to avoid drawing blocks that are hidden, that's pretty much what i need to figure out in order to decide if a block should or shouldn't be rendered, right? I get the feeling there probably is a pretty simple solution, but i can't seem to think of it... It just seems to me that there wouldn't be an efficient way of doing this, since blocks really far away from each other can still overlap and hide each other visually because of their height...
(The reason i'd want my 5 x 5 x 5 blocks cube to be made up of 125 blocks rather than just 61 is because i'm planning on making some cubes breakable, so the inner layers have to actually exist)
Any idea?
I'm fairly new to game programming and, even though it's probably not the best idea, i've decided to try and build a 2D isometric engine as a first game programming project (with XNA). Probably not the easiest project for someone totally new to game programming, but i find it motivating, so meh...
I've been reading around about 2D isometric engines and rendering techniques, and have got some of the basic stuff pretty much figured out, but there's a big question still bugging me.
Since i want my engine to support heights (and my tiles aren't flat), i'm working with many layers of tiles. For now my tiles are actually really just blocks that i'm stacking on top of each other.
My drawing test sandbox looks a little bit like this currently:

On to my concern: Since i have many layers of blocks, and want pretty large maps, i'll be dealing with a lot of blocks when it comes to rendering the game world. Now it's quite obvious that, for a full cube of 5 x 5 x 5 blocks, i'd only need to render 61 blocks, since the blocks inside/at the back of the cube wouldn't be visible anyways.
Now let's say i want to render a map with dimensions 25 x 25 x 10... At that point i assume it would be a pretty big waste of ressources to render every single block, including the ones that aren't visible to the camera. What if i have holes in my map, making some blocks from the inner layers visible, and others invisible? When i iterate through my blocks, how do i know if the block i'm about to render is actually visible to the camera, and doesn't already have a cube/cubes hiding it entirely from the camera? Since i want to avoid drawing blocks that are hidden, that's pretty much what i need to figure out in order to decide if a block should or shouldn't be rendered, right? I get the feeling there probably is a pretty simple solution, but i can't seem to think of it... It just seems to me that there wouldn't be an efficient way of doing this, since blocks really far away from each other can still overlap and hide each other visually because of their height...
(The reason i'd want my 5 x 5 x 5 blocks cube to be made up of 125 blocks rather than just 61 is because i'm planning on making some cubes breakable, so the inner layers have to actually exist)
Any idea?