We cannot spare more than a few for such a perilous task

After the problems earlier in the year with Marmalade getting out of the SDK market, I started working on porting Lords of Midnight to Cocos2d. I initially decided to park the games and start on something new to get me going. As it happens that the new thing was The Citadel. I managed to get TME – the Midnight Engine – which is the backend game code that runs both LoM and DDR, up and running. I then worked on the Landscaping technique.
Happy with that working, I dragged the Map data out of The Citadel and started rendering that. The real big issue I needed to address for the Citadel is water, so I started working on that.

I spoke with Jure and he mocked up some potential imagery, so we could get and idea of what it might look like.

I then had a lot of problems with Cocos2D getting it to build under windows, and to be honest, I got a bit disheartened and gave up for a few months. It’s frustrating when the OSX Build all works without any issues, but the code just wouldn’t build on Windows.

Since I’m working closer to home at the moment, I started to get that coding itchy feeling, and so I returned to the game. After a bit of restructuring I managed to get the code compiling on Windows – however, it completely wouldn’t build on OSX anymore. Xcode would completely barf and kill my machine taking up over 52gb of memory!

I spent three evenings trying to get it to work. The upshot of all that pain, is that I seem to be back into my groove…

I spent a bit of time thinking about the whole process, and I’m not sure if it’s because my Facebook feed keeps reminding me of what I was doing five years ago… desperately trying to complete LoM to get it submitted to Apple before the Winter Solstice as it happens, but it feels right to get these games back up and running an ready for any future release.

At the moment I am slowing making my way through every UI screen and rebuilding it under Cocos2d. It’s painful because as powerful as Cocos2d is, the documentation is a complete bag of horse turd. I’m really stumbling around trying to translate the UI Engine I had already built into a new one.

Once I have all the periphery screens complete, I will make my way into the game screens.

I’m not abandoning The Citadel, I’m just taking some time out to get the whole engine fresh again. I’d like to get LoM and DDR released under the new system early next year.

As an aside, the complete progress can be found in the GitHub repository. All the code and assets are there.

You must travel through wild and troubled lands

It’s no secret that I have been looking at The Citadel again with a view to retro fitting it into the original landscaping mechanic. I tend to drop in on it every now and then. At the moment though I have been paying it more attention than normal.

There are a number of issues that need to be ironed out.

  1. Understand the logic of the game
  2. Convert the data to something I can use
  3. Write code

The first item comes from a number of things. Firstly actually playing it – easier said than done. I have it running under DosBox on my Mac, but it’s still very unstable and secondly, as a game, it’s pretty impenetrable.

I have to be able to understand the game in order to decide how the retro fit version should play. I suspect it will deviate a little from the original mainly because of the different style, but some things like giving your lords quests should be ok. Why not just be able to tell your lord to Goto Place? Obviously it won’t be realtime like the original but will probably happen at the end of your turn.

I also have some of the code that James Shaw sent me a few years back. It doesn’t cover everything but it does handle the quests that the characters attempt to follow. I’m trying to get some more code from James because I don’t fully understand the overall game structure that is occurring – basically the motives. I understand what many of the characters are doing, just not why!

Converting the data is interesting. Over the years I have reverse engineered some of the data, and that combined with James’ code means I pretty much have everything for the characters, objects, citadels, castles, armies… etc.. I also have quite a bit on the map. And that is where things get more interesting or difficult depending on how you want to look at it.

I have a number of pieces of data for The Citadel maps. Some from the game, and some that James sent me. The problem is, they are at varying scales. The original manual explains that the Bloodmarch is around 500 leaves by 500 leagues with 20 leagues being a good days march. So that suggest an internal map of 512×512. (A league in the original games was one location). The maps I have vary from 1024×1024 to 120×120 and they contain different information. You have the the map of the 12 realms. The map of the 130 regions. The map of the terrain. The height maps. The Route maps. Maps for building placement…. etc..

A 512×512 game map would be way to big. LoM was 64×62 and DDR was 64×96. So firstly I needed to settle on a better size. I chose 256×256 as being affectively 12 LoM maps which was the intention for Mike for EotM.

So I needed to scale all my maps to the same size and then grab the data from the.

I wrote tools to create TILED maps of the terrain as mentioned previously.

I’ve not revisited those maps and cleaned them up a little. There are a number of things that come out of the process. Firstly, The Citadel is all about terrain i.e.. Mountains, Plains, Forests, Trees, Sea, Rivers… etc.. and not so much about places. Because the display of the game map in 3d is so much different that the original 2d landscaping, many of those features share the same space.ie. The concept of a mountain is only a named area, the land is actually different height maps, and thus things like trees and and plains and hills often inhabit the same space, and this doesn’t work so well for the 2d game. There are only two main forests on the Bloodmarch, but there are a gazillion trees.

Those mountains also break down into different terrain types, so we now have Large Mountain, Mountain, Hills, Foothills, Downs… many of them also inhabiting in the same space. From a gameplay point of views, this terrains are probably important. For example the mountains seemed to be used for passes through the large mountains, same with hills and foothills.

The other problem is that of noise caused by the scaling process of different sized maps. I’ve ended with things like trees in lakes, rivers, and the sea. Here is an example that covers many of these aspects followed by a cleaned up version. ( Ignore the colours and the graphics, these are just placeholders and things to allow me to see things better.)

Original converted map

Cleaned up map

I’ve cleaned much of this by eye because I think I’ll get a better result and understanding of the map, and have now done most of the map, but I suspect much of this will still take further refinement as I focus on particular areas of the map, and especially as I focus more on the gameplay aspect of it.

The next step on the map is to start adding new features. The game is missing many of the things that gave LoM and DDR character. There are some shelters ( although I have yet to find how they are placed on the map), but they are a generic building that gives the character some safe place to rest . What the map really needs is villages, fortresses, palaces, stones, henges, etc… and this is going to take time!!!

I actually plan to start making this stuff available on GitHub because in the end, some help would be really appreciated.

The way was obscure but he moved onwards…

The ersh has finally settled on the whole Marmalade Licence Issue. My licence no longer works so I cannot build LoM or DDR anymore, and the new company who I know nothing about, nor what their long term intentions are, require $600 for a one year bridging licence.

I just about managed to get the new 64bit build out for iOS and Android, but never managed to update Windows, Mac, Windows Phone, and Amazon. I’m a little disappointed by this, but I think I can live with it.

However, the iOS version of Doomdark’s Revenge seems to have a little bug on iPhone7 where it doesn’t always show the splash screen and the main menu backdrop. The rest of the game works fine. This can be fixed by running your phone in Zoom mode. I wish I’d managed to get the fix out for this in time. What this actually means, is that this fix would cost me $600.

I’ve though long and hard about this, and I’ve decided to let it go. GMO Internet group Japan, who now own the Marmalade Tech, have said that they will be changing the technology in 12 months. Currently their bridging licence is a no support, no update licence. So come a new iOS or Xcode, both which will happen in September, then there is no guaranty that it would continue to build after that. Then there is the little issue of the compatibility of their new tech, should they make it available, and the new cost.

I don’t honestly think the DDR bug will affect that many people, after all, there are not that many people playing it. Should the problem become a real issue, then then, and only then, might I consider buying the licence to allow me to fix, compile, and release.

Until then, I need a new plan.

And here it is…

My next game was going to be Timbles – my children education title that has been kicking along for way too long. This is also written under the same system and thus I can no longer work on it. I cannot currently bring myself to port it to another system, therefore it will be shelved until some future time.

My intention was to move my system to Cocos2d-x and I have started working on that. But, I have decided that rather than spend time in the past again, porting to another system, I am going to start a new game that will allow me to familiarise myself with Cocos2d-x and build up the system I need, and then after that I will take Timbles, The Lords of Midnight, and Doomdark’s Revenge across to it. If I can get another game out, then follow it with Timbles, I am strongly leaning to spending time on The Citadel.

It’s worth point out that I have over the years ported The Lords of Midnight from a Z80 code base that I hand disassembled and crafted to 80×86. I wrote a Visual Basic version, and C version. Developed the Midnight Engine in c++ for Windows, then took this across to the Marmalade system as the base of the current releases. Timbles was developed under Visual Basic 10 years ago. Then moved to DirectX. Then rewritten in c# for Silverlight to run in a browser, before finally being coded in c++ under the Marmalade system.

I think you can see why I am a tad reluctant to revisit these code bases right now. 🙂

In the mean time I will update the GitHub repositories to include the full final source.