Luxor nodded his reluctant acceptance of the truth and their talk turned to Midnight

With the re-release of Doomdark’s Revenge and The Lords of Midnight that concludes the last few fraught years of bringing Midnight back from the mobile graveyard caused by Marmalade getting out of the SDK game.

I won’t deny that it’s been a painful process and not one I really want to go through again… and yet… The release is not without it’s problems. I’m not convinced that there isn’t memory crash bug still there caused by the current Cocos2dx SDK. Thanks to all the testers that have helped out over the last few months, I think I have reduced the frequency but can’t be sure. It might just be down to the length of time you play and the size of device that you have.

But, I think the only way to solve the issue is to change the SDK – and I just don’t have that in me.

So, what next.

First, I need to upload new versions of the Lords of Midnight to bring its engine up to date with Doomdark’s Revenge. There are a few small changes that were added during that release that could do with being released into LoM – just having a few Apple issues at the moment with the upload.

Here’s what will be in that release…

Version 2.0.2 (42)

  1. [desktop] Added cursor sizes (small/medium/large)

Version 2.0.2 (41)

  1. fix crash caused by too many armies at a location
  2. panel_think – adjust page indicator size dependent on number of pages

Version 2.0.2 (39)

  1. Return graffiti easter egg
  2. Add confirm night option
  3. panel_look – Add drag down gesture to moves
  4. panel_look – Add drag up gesture for map
  5. [desktop] Add mouse cursor images
  6. [desktop] Consolidate ESC key across all screens
  7. [desktop] Tidy shortcut keys across all screens
  8. [Android] panel_mainmenu Hardware back button now performs Exit
  9. [mobile] Tweak scale of buttons

Version 2.0.2 (38)

  1. Fixed: panel_think – adjust UI on phone
  2. Fixed: potential memory leaks that could be causing crashes

After that I will take a break from this code base. There are a couple of small things that I would like to put back that are missing but that I didn’t feel were critical for the release. I may well add them over time here and there when I find myself in the mood, but I won’t guaranty anything.

  1. [mobile] Pinch and Zoom on the map
  2. Compass Gadget
  3. [desktop] scrolling indicators on popup pages
  4. [desktop] arrow indicators for scrolling on think pages
  5. [desktop] Next/Previous buttons on scrolling pages
  6. [mobile] Vibrate
  7. Review the guide

There are three things that I will be focusing on from hereon in.

  1. Rewrite the engine under c# – this is a long term project in order to make the engine more robust for the future and to make more options available to me. The first is to just straight take the engine to Unity but the other is to also take it online for multi-player. More details to follow in future posts.
  2. Use the current engine to research and develop the new Landscaping needed for The Citadel. The Citadel needs water. I was playing with this technique a few years back but it wasn’t quite gelling. It works fine in a flip screen environment but not so good when the panorama is moving. However, I think with the changes made in order to release using Cocos2dx I’m keen to get back to it.
  3. The Citadel Novel/Game research. Drew’s roadmap currently has The Citadel slated as a 2023 release so we are going to need to get together to work on the details a little more than we did on LoM and DDR. There is going to need to be far more game research which is needed for the book but also for any release that I intend. For one thing the map needs a lot of filling out with details that were sadly missing in the original release.
The Bloodmarch - Northwest corner
The Bloodmarch – Northwest corner

I fear Doomdark may get untimely warning that the Wise are awake

So it’s no secret that I have struggled with development of The Lords of Midnight and Doomdark’s Revenge since the release of the remakes in 2012/13. Part of this because at the time I think I was driven by a sense of duty to get the games released in honour of Mike. The amount of work I did on those two games in such a short amount of time in order to support seven different platforms was frankly quite astonishing.

After the release of Doomdark’s Revenge I took a short break and developed a children’s game Timbles – which never got released. I then supported the two games for the next couple of years but never really got in to any swing and was unable to move them forward. This then became exasperated by the whole Marmalade SDK fiasco which stopped the games in their tracks.

I slowly started moving toward a new SDK and picked Cocos2dx. I then spent a few months rewriting many aspects of the UI to make it work. I finally put the project back down because I was struggling under the new SDK to make it work across multiple screen resolutions.

Last Christmas after over a year of not working on it, I picked it up during my one work break of the year. The reason for this is that I suddenly realised how I could solve the resolution issue. Inspired I got a test release together for iOS, OSX, Android, and Windows. However by mid January I was back working and even more busy than the year before. Another problem that cropped up is that the Cocos2dx SDK appears to have a bug with its Metal implementation that means its either leaking memory or causing a threading issue. This appears to be a random issue that I am some how triggering and have been unable to find.

Over the following few months I spent more time working and eventually I found myself in a situation where I could can no longer sit at my computers without working. I made an association  with my study and my computers with work and haven’t touched any none work projects through the majority of 2021.

At the beginning of October I changed my main client to Sky. What this means is that I am no longer working additional hours whereas working with PureGym I found myself working longs hours or working later and intermittent through the day.

A few weeks after joining Sky, I found myself slowly spending more time at the computer… and I started finding a rhythm.

So here is where I am. I am not making any promises because I don’t want to break them, but I am back on a plan. I have been rewriting the Midnight Engine in c# – part of this is to facilitate a move to Unity which will open up better long term support for LoM, DDR, and facilitate Citadel. I just don’t believe that I can stick with the c++ engine and Cocos2dx anymore – I am already bothered that their c++ SDK hasn’t been updated in 2 years and their time milestone release is also 2 years overdue. 

Mentally I have committed myself to The Citadel in 2d and some campaign changes. I also have a list of features that I want to add to allow a few game variations. My intention is to get a Unity project up and running “The Midnight Chronicles” and LoM, DDR, and the Citadel will all be campaigns within the one game. I also have my eye on Nintendo Switch and some other things which I won’t discuss here yet.

The new engine also means that I am getting closer to having better tools to handle the data allowing me to start modifying the maps etc for alternate campaigns. The original data was held in an Access Database with a binary export. As I’ve been Mac based for so long now, Access is no longer part of my work flow. So I’ve been using the unmodified binary files for some time. To give you an example in order to release Revenge the first thing the code does after loading the binary database is modify all the data that was incorrect previously. I can’t continue that way.

Where I am right now is that I have what I call “The Midnight Engine Database”. This is all the core objects required for the games. This is in a slightly more open format. Shortly I will be able to load the binary data and export/import to a more open text based format. The map is stored in Tiled format and all the other data is just CSV files.

I have also started exploring a new architecture to allow the engine to be even more open. I am trying to move away from the current object oriented approach because ultimately it’s too limiting and confining. I am also resisting the text so that it can be better localised.

So, where does that leave the current c++ game… well I intend to get LoM and DDR released I just don’t know when I am going to start on it. I am hoping that I can use the momentum of working on the new engine to get me through a release. So please bear with me a little longer…

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.