Personal Log »

Kitsune's Curse is Open Source

A couple of years ago I released the Return of Traxtor source, because I thought it could help people willing to start making games for the CPC writing things from scratch, and also for some historical value: it was my first good enough Amstrad CPC game.

Since then I have been busy and I must confess I totally forgot about open sourcing more games –although Gold Mine Run! was open source from the start–. I have different engines for making CPC games that I consider current, and unfortunately not that many ideas –or time– to make games, so it is kind of sad that the code is not being used in new projects.

Kitsune's Curse

Kitsune's Curse screen

From my Amstrad CPC production, Kitsune’s Curse is probably my favourite, and it uses a very special engine that is intended to make mid-size games on 64K by using as little memory as possible. It implements what I called mini-buffers, as opposed to a large buffer covering all the drawable area.

It tracks dirty tiles and minimises the amount of drawing on the screen, which is nothing new, but by using small buffers that are dynamically allocated so background and masked sprites can be drawn to it, the memory use is reduced drastically. In “Kitsune’s Curse” only 2560 bytes are used for mini-buffers, compared to the 16384 bytes of a hardware back-buffer.

Yes, that makes things complicated and it affects performance, but “Kitsune’s Curse” had 60 screens, 8 different enemies, 64 tiles, and all in 64K with one single load; and can handle up to 10 sprites of 8x24 pixels. So I think it was a success!

I used the same engine in The Dawn of Kernel as well, but then I wrote two more engines: one focusing on performance (used in Brick Rick) and another one for vertical scrolling games (used in Hyperdrive). I should make more games and less engines, isn’t it?

In any case, the source code of “Kitsune’s Curse” is available on this git repo. Like in my previous releases, this is how the code was when I released the game in 2020 –although I made some effort to update the tools, so things compile in a current operating system and no Python 2 is required–. It is not a framework or a library. Yet I think it may be an interesting read or a good base to start new projects, who knows?

I have documented most of the generalities of the code in the, specially the interesting bits regarding the engine. There is a lot of Z80 assembly but, when possible, there is also the equivalent C code in a comment. Hopefully that will make understanding the code easier!

Over the last few years we have enjoyed some great games that included the source code, and I have learned a lot from them. I’m glad that “Kitsune’s Curse” is joining that club.

Would you like to discuss the post? You can send me an email!