jLOM - Java reimplementation of Lords of Midnight

jLOM is a Java reimplementation of Mike Singleton's epic game Lords of Midnight, originally written for ZX Spectrum in 1984. Since then, Lords of Midnight has been ported to MS DOS (by Chris Wild), and it still has an active player audience that hangs out on its mailing list where they discuss their strategies and other game-related issues. This project reimplements Lords of Midnight using Java's object-oriented idiom and -- I hope -- good programming practices. At the same time, however, I have tried to remain as close as possible to the original, and have used Chris Wild's notes on the game's algorithms and the annotated source of his PC port.

Why jLOM?

Thanks to the similarity between Z80 and 8086's architectures, Chris Wild's PC port is almost a 1-to-1 opcode translation of the original game, with the exception of the I/O routines and some small bug fixes, and is therefore almost identical to the original Spectrum experience. Since that port was released in 1991, there has been a number of other reimplementations of the Lords of Midnight, including Wild's own "The Midnight Engine", a Windows reimplementation in C with better graphics and internals that can be customized for a whole range of similar games. Others have added 3D graphics or taken the game in their own direction, changing the game mechanics, etc.

The question then remains why write jLOM in the first place. Many years ago, circa 1987, I came across a description of Mike Singleton's Lords of Midnight published in a small computer-gaming magazine that soon went out of business. The game etched itself into my mind for its unique combination of fantasy (I had just read Tolkien's Lord of the Rings about the same time), strategy, and first-person perspective, all in a 48K package running on Sinclair ZX Spectrum.

Unfortunately, I owned a C64 at the time, and never got to play the original LoM. Then a few years ago I tried out for the first time a Spectrum simulator running on a Linux machine and one of the first games I rushed to try was, of course, LoM. I was even more excited when I soon learned about the PC port, which came with the full, and very-well commented, source of the game. Not content to just play the game, I now wanted to know its insides too. Since Intel assembler was a little difficult to keep in my head, I started writing it down more compactly in C and was soon toying with the idea of using that C source to write my own version of the game, which would be easier to maintain, port, and modify.

This went on in fits and starts (mostly sitting idle, though) over the following year and finally went dormant for the next two or three. The C project wasn't really going to go anywhere because my code was a mess and it was virtually impossible to divide it into bits small enough to write and test separately before I integrated the whole thing. Then in late summer of 2002, just as a kick while practicing Java refactoring in the Eclipse IDE, I started creating the game's object hierarchy and architecting the engine in Java. In just a few days of work, I had a simple text-only client that let me walk and "look" around and recruit other characters. A bit later I decided to try adding the graphics and wrote the user interface as an applet that used the existing classes in the game model. This was so much fun that it turned into a minor obsession, trying to get the look and play of the game "just like the original" (plus a few small details, such as the game map, which was originally used to check that the Foul regiments moved around correctly, although it's also useful for cheating since it lets the player know exactly where all the enemies and game objects are).

With this work now largely done, I'm releasing jLOM to the LoM player community: for their playing enjoyment, to help the curious understand how the game works, and the adventurous tinker with it and create new variants of it. This version of the game runs as an applet in a Web browser. I've also been working on a MIDP version that runs on Java phones and PDA's, and which uses the same game engine as the applet (with the exception of classes and methods that don't exist on the CLDC platform). I used to have this version available for download here, but I removed it after Mike Singleton told Chris Wild he would prefer not to see any LOM remakes for mobile phone platforms because he was considering a commercial one himself. However, thanks to its OO-design, any programmer could code up a MIDP version of jLOM fairly quickly, as the differences would be minimal, except in MIDP vs. applet graphics routines.

As for myself, I'm continuing to tinker with jLOM and looking for new platforms to run it under. I am currently working on splitting it into a client that does just the UI and a server that does the game mechanics, with the intention of evolving it into a multi-player game, similar to what is now done by sending saved game files over email. And then... Who knows? Maybe repeat the whole exercise for Doomdark's Revenge -- after all, as Chris Wild himself pointed out, "The code for Doomdark's Revenge almost lends itself to being changed into a two player network game!". I only hope it will take less than three (or was it four?!) years that jLOM took, if I count from when I first writing the C pseudo-code.

Downloads

jLOM is currently implemented as an applet to run in a Web browser, and it can also be run as a standalone application. You can download the source code and jar.

jLOM is free software; you can use it, redistribute it and/or modify it without fee under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. jLOM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Lords of Midnight is copyrighted by Mike Singleton.

Play jLOM online

To play jLOM in your browser, enable Java and follow this link.

Release history

07.11.2006
v1.0.1: Fixed Foul armies' movement algorithm. Fixed the graphic for the Wise when not on horse.
19.10.2006
v1.0: Added help, refactored key handling in screen-drawing code.
13.04.2004
Removed the MIDP version
30.10.2003
v0.2: The applet JAR can run as a stand-alone Java application. Do not print out location coordinates.
21.10.2003
Initial release v0.1.

Davor Cubranic: cubranic [at] cs.ubc.ca
Last modified: Wed Oct 19 21:54:34 PDT 2006