Posts

OpenMoonstone v0.2 released

Image
OpenMoonstone is a open source reimplementation of Moonstone: A Hard Day's Knight following along the lines of projects like OpenTTD and OpenXcom. You can try it out https://github.com/joetsoi/OpenMoonstone This release is a milestone as it contains the same number of features as the original demo that came out on the Amiga.  Why reimplement an old game? Fixing bugs Original OpenMoonstone v0.2 Enemies always face the player in Moonstone, in the original this meant that for the AI controlled knights, the distance the knight would move was out of sync with the animation causing a "jumpy" animation. Adding New Features I've added the ability for four players to fight at once. The amiga only had two controller ports so was restricted to two players, as a child I always wanted a three way battle with my brothers and adding additional entities in an ECS is easy once it's all set up. As a side project It's hard to stay motivated when worki

Moonstone: A Hard Day's Knight - "The Amiga version is better"

Image
Do a search for "amiga version is better" and you'll get a bunch of results where people discuss whether game <X> was better on the Amiga. In the case of Moonstone, they are completely correct. To quote wikipedia "...developed and published by Mindscape for the Amiga in 1991 and one year later converted to DOS with different sound and music." This is not strictly true, the DOS sound files appear to be based upon the Amiga ones, but either resampled/converted from 8svx to unsigned 8bit PCM changing them slightly in some cases and more noticeably in others So given this information, why does the Amiga dragon sound like this? And prepare yourself, the DOS version sound like this? Well, that's the fault of whoever ported it to DOS. Let's take a look at how the animation and sound data is stored in DOS, below is the swing attack from the data segment of the DOS binary. It's been annotate with some types that I've been annotati

Horrible Things I Regret Doing With Python Part One

Runtime Copy Paste With Global Variable Replacement. "Could you make InlineAdmin in Django paginatable Joe?" Guido asked.  I googled a while before regurgitating a Stackoverflow answer into Guido's lap. "Oh cool, but we have multiple InlineAdmins , can you make it paginate for all of them?" "Sure" I replied, "That'll just be a change to the admin class and some templates" ... Time passes I had quickly changed the 'p' variable so it was dynamically determined by the model name assigned to the InlineAdmin class by adding a page_param property. The only problem was I that needed django's paginator_number template tag to take into account these new page variables as well. from django.contrib.admin.views.main import ( ALL_VAR, ORDER_VAR, PAGE_VAR, SEARCH_VAR, ) ... @register.simple_tag def paginator_number (cl, i): """ Generates an individual page index link in a paginated list.

A Hard Days Knight

Image
After many hours I've succeeded in reverse engineering a small part of the old DOS game Moonstone!I plan on posting all the gory details, but it's a bit late at the moment but just running the image viewer script I hacked together and seeing the working result is so pleasing.

SQLTap and CKAN

Are you a CKAN developer? Have you had a trip or fall at work involving a slow running sql query that wasn't your fault? Do you terribly miss the django debug toolbar , pyramid debugtoolbar , flask  debugtoolbar or similar? Well you're basically screwed, but to help alleviate the pain I made a tiny ckan extension that integrates the SQLTap middleware with ckan, once you've added 'sqltap' to your list of plugins in your development init you'll find the sqltap interface at http://localhost:5000/__sqltap__ When you run the paster development server. Please don't cry when you see the results there, we'll get round to implementing dogpile caching eventually

Translating ckan extensions using the ITranslations

From ckan 2.5 onwards you will be able to translate the strings in ckan extensions in a much more friendly and easy way. Unless there are any major issues in the code review, this pull request should make your life easier. Previously, there were a few, not ideal solutions (see ckan#959 ) which involved having a paster command or script that would munge all the po/mo files together using gettext's msgcat command. This has the downside that the sysadmin of any ckan instance would have to run this script and whatever other series of texts whenever they had a new ckan extension that they wanted to add. The new pull request allows extension writers to provide a translations that will automatically be included without any additional steps other than the standard step specifying the plugin in the ckan.plugins in the configuration file. To do this you'll need to copy the example plugin and edit your plugin so it looks a bit like ... from ckan.lib.plugins import DefaultTr

An Evening With Assembly

Image
Back when I was young child, my brothers and I used to play a game called Moonstone. So it was with a bit of nostalgic glee that I went about spending a few hours or so in evening poking around the innards of the game. I wish I had bothered to take a look at the time, as I managed to remove the unbelievably long, unskippable intro that the game has, which would of saved my brothers and I a few hours of pain, enduring the intro whilst waiting for the game to start. You can find the game itself on various abandonware sites and it runs fine in DOSBox. The game comes with three executables, MS.EXE (the executable to play the game), INTR.EXE (the executable that runs the intro sequence) and MAIN.EXE (the main game itself). DOSBox has a debugger build that allows you to examine memory, step through execution, set breakpoints and more. There's a guide to help you along. The freeware version of IDA, thankfully supports dos exes, so I could open up all three to have a poke around.