Tag: algorithm

Haunted Mansion DevBlog #03 - Back to Flash, now with depth buffers

Inspired by the last video I posted on this blog, the idea of using z-buffers was knocking me on the back of my head. If I could use a depth buffer, I realized, I wouldn't have any issues with depth sorting ever again, and it would solve all of my problems, and some more.

It also occurred to me that I could, with some clever and heavy caching, have a very reliable and fast depth buffer in Flash, and it would also be infinitely easier to do it in Flash than it would in XNA. (This will certainly be the topic of a future post.)

This resulted in me moving away from XNA and back to Flash. There were other reasons, though, as I'll explain shortly.

So here's a short video showing the pixel-perfect depth buffer running in Flash. It's running at rock solid frame rates, even though it's grossly naive and unoptimized. This is an excellent sign!

Continue reading

Pixel-perfect depth sorting using a depth buffer in 2.5D

The video below shows how far 2.5D can go if you have a depth buffer and normal map for your objects. It is a very, very neat technique:

XNA RPG 2.5D Game Engine - Updated WIP

You can read about the related techniques in this Wikipedia article.

Haunted Mansion DevBlog #02 - Oblique vs. Isometric perspective and perfect depth sorting

For my game, I decided to go with a relatively unusual projection called oblique projection.

Oblique projection cube
A cube in oblique projection.

There are several reasons why I picked this particular projection as opposed to the most popular isometric projection.

For one, it is sprite friendly. This projection works better along with side-view flat sprites, such as those in platform games.

Sprite vs. projections
Flat, side-view sprites in oblique and isometric perspectives.

The image above illustrates this well. Look at the character, especially his feet. You can see how the sprite looks aligned with the plane, and this feels right. You don't need to add any real depth to the character by placing one feet further to the back. Flat sprites like this just work.

Continue reading