Weekend side project: sap2mid

A couple of days ago I realized there was no such thing as a program to convert SAP files into MIDI files. This sucks, as I wanted to experiment with "orchestrating" some of my favorite tunes found in the Atari SAP Music Archive.

Now, I'm not by any means great at this, but I've done some experiments before using manual transcriptions, and in the end I found that these chiptunes do have a lot of potential:

ABBUC 20 for strings

And that was transcribed by hand, which was more time consuming than necessary and it gets very hard for more complex chiptunes.

So when I started hunting for a way to automate it, I found out there's a convoluted way to convert SAP files into CSound files, but this seemed like an unnecessary chore, and the patches aren't compatible with the modern ASAP code which actually supports playing a lot of the tracks in the Atari SAP Music Archive, which previous versions weren't able to.

Something had to be done about this. I'm not an Atari wizard, but I decided to give it a shot anyway.

Continue reading

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

Haunted Mansion DevBlog #01 - In the beginning...

Ludum Dare is an online competition that happens every four months. Developers join in from all over the world in order to create a game from scratch in 48 hours, all by themselves. The game must follow a theme, decided previously by 5 rounds of community voting.

You can use any libraries and any tools, as long as they are easily available to others. But any assets (graphics, audio and music) must be created just for the event. The definitions are a bit fuzzy on this, but nevermind about that.

The last Ludum Dare had an incredibly amount of activity, resulting in almost 600 games total. This is a huge success in comparison to previous years.

I did attempt to make a game, but there was no time to finish it. While I failed the deadline by a mile, it was an interesting experience and I had a lot to learn from it.

Here's a video of some of it:

I also have an older version you can play online.

Since I couldn't make it in time for Ludum Dare, I decided to keep working on the idea anyway. Here's the experience so far.

Continue reading

The amazing work of Graham Annable, AKA "Grickle"

About a month ago I came across this Reddit post, "Totally creeped out by a cartoon." The link pointed to The Hidden People, a short YouTube video by artist Graham "Grickle" Annable. Turn on your audio and watch it:

Continue reading

Creating human-readable scales for data visualization in charts.

If you ever had the task to generate a graphic from scratch, then you probably encountered this problem: how do we pick a "round" number for the maximum range of the graphic which will fit all of our data nicely?

Here's an example. Your app has a statistics section which displays a line chart of the number of entries versus time. At the beginning, when the number of entries is small - say 6 entries - your graphic could display a range from 0 to 10. But after a while you'll have some hundreds, or even thousands of entries.

A line chart.
Here's an example of a line chart with a range up to 500.
The maximum value in the dataset is 476.

How do you find which is the next "best display range" for any given maximum value <m>m</m>? For a maximum value of 332, which would be better: a range from 0 to 340, 400, 500 or 1000?

In this post, I'll show you how to create a function <m>\mbox{R}(m)</m> that will give you that display range value, and we'll be using logarithms to achieve that.

Continue reading