One of the things I wanted with my MMR was to be ability to download the original copy from Todd Daggert's site, unzip it anywhere you'd like, drop in my new EXE and perhaps another data file and it would just go - working somewhat like a patch. That meant the original art, sounds and puzzles would all have to be used. That goal was met - all you need is my EXE and another data file (containing some extra art) and Bob's your uncle! Say goodbye to your Windows 95/98 virtual machine!
This post has some thoughts on my earlier work. It's not very complete or detailed, but some may still get something out of it. A lot of it is to do with the artwork which is in a proprietary format - which I won't be giving out the secrets too, you'll have to make do with this excellent developer blog.
You have to start somewhere so I started with loading puzzles. I could have simply made up my own puzzle format but that would have disregarded the intro paragraph - that and I liked the idea of mine being able to open puzzles made some 20 years earlier. The first stop was Jason Summer's Lode Runner page. In case you have never been there (I doubt any LR fan hasn't), Jason's site is like Wikipedia for Lode Runner. He doesn't maintain it anymore which is a bit of a shame - I remember that being the first LR site I found when my family got dial-up internet in the '90's.
Our family had one Windows 95 PC at the time so any game you could play with two players on the same PC was like Christmas. My brother and I loved playing the puzzle group called debra.pzl from Jason's site.
Puzzle 41 of Debra.pzl. Player 2 UI is not yet complete
There is not a lot of information out there about the inner-workings of Presage LR titles - in fact, nothing apart from the puzzle format. After several somewhat successful attempts at loading a puzzle I got a little stuck. Some puzzles would load, others wouldn't. My help came from Jim Winkler who wrote an open-source (C++) puzzle editor in 1998 and the code is still available Jason's site (the code via the Yahoo! Groups message board).
Off-topic: I just noticed that "Nuff said...Dennis" is still a LR fan and active in the Yahoo! board. Dennis is a huge LR fan like Jason Summer and me. If you're reading this Dennis, you might remember you loaned me your Lode Runner 2 CD either in the late 90's or very early 2000's. You sent it to Australia to Harry Ranquist (alias borrowed from the film 'True Lies' - I was about 15 at the time) if I remember correctly. Thanks for that Dennis - I still remember and appreciate that ;)
And thanks to Jim, I found the RLL decoding bug that my code suffered from and bingo!, I was able to open and alter puzzle groups. If you want to know more about the Presage LR puzzle formats (not LR2, that is a different beast altogether), it is definitely worth downloading LodeEdit. Jim's put plenty of info boxes in there full chock full of information.
My MMR rewrite does have a repair feature to fix some things made by LodeEdit, however. LodeEdit appears to exploit the way the sprite sheets are loaded, allowing you to have gold looking like a jackhammer or ladders looking like exit. Puzzles made in LodeEdit do still load in my version, but it will detect these sort of things as nonsense and either put it to what it should be or remove the quirk altogether. Sorry Jim.
After loading puzzles, what I started doing was to attempt to load the artwork. This would need to be loaded from the original located in the PRS data archives (in the 'DATA' folder where you installed MMR). Without any documentation on any of the files it took a couple of months to make any headway.
A segment from the moss background with an incorrect colour palette
Loading the images was one thing; assinging the correct colour palette was another. The Legend Returns and Mad Monks' Revenge use colour lookup tables or CLUTs to store colour information. Without these, the images have no colours to reference and the end result is like an acid trip.
Can you find information on CLUTs on the internet? Yes. Plenty of it.
Can you find much information about processing colour lookup tables? Yes. Plenty of it, including the ones used in older Bitmaps.
Can you find information about processing colour lookup tables made on Macintosh computers in the early 90's? Very little. It may have been easy to some, but for the life of me that took weeks. I put that down to Apple being difficult and moved on.
Moss world background loaded in XNA
After the colour palette issue was sorted out I set out trying to fix the an image decoding glitch. I was somehwat busy at the time and couldn't work out why. Some art loaded fine, others looked like the did in the image below. In the end I gave the code to my brother and he found the bug and fixed it.
Editor border with a decoding glitch
So, once being able to load puzzles and artwork, I installed XNA with the goal of starting to programme the editor. Turns out installing XNA on Windows 8.1 with Visual Studio 2013 is quite tricky. StackOverflow has plenty of posts on this but they all vary quite a lot. The simplest way of doing it is to use the VS 2013 XNA extension from CodePlex (works with VS Express too). Install that and you are good to go.
The XNA content pipeline is very handy. Making a game without it though can be a little bit of a hassle at times, but luckily there are plenty of ways around it. You can't just go willy-nilly using any .NET Framework libraries (such as anything in Windows.Forms or Windows.Imaging as that might exclude other platforms such as the Xbox 360). If this was a brand new game I'd be using it, but since I want to stick to the my goal of reusing, it was a definite no-no. The screenshots in this post are an example of loading content without the pipeline whilst still being able to support the Xbox 360 (which uses the .NET Compact Framework).
Next time, on MMR!
The next post will be a flash-back post on the making of the editor. I have quite a few early work-in-progress screenshots of that. The editor as a whole probably accounted for 70% of the time I've spent on the project so far.