They think I am a foolish old man with a hopeless dream

A spring release for The Lords of Midnight and Doomdark’s Revenge. Version 2.0.8 has hit the stores. There are a number of LoM changes but it’s a huge DDR update. Check out the last post for full details of all the changes. Last thing for me to do with this update is to get it back one GoG.

Unless there are any problems then this will be the last Cocos2d-x release. Don’t worry – there is a replacement plan…

As you will be aware if you’ve paid attention to my many troubles with development over the years, I moved from Marmalade SDK to Cocos2d-x a few years ago due to Marmalade getting out of the SDK game. It’s been two years since I managed the v2 release which was the first under Cocos2d-, and. it was six years ago that I managed my last Marmalade build.

Well Cocos2d-x is pretty much no longer supported. After they released v4 they have not done any updates in 3 years. As we all know, mobile platforms move forward very quickly, and there is always the chance that either Google or Apple will change something enough that the games don’t work anymore, and then even though it’s open source you’ll need to be luck enough that someone fixes the problem for you, or you are deep in to it yourself. However, changes are usually just small fixes, if Apple decide something fundamentally needs to change in the system, low level c++ SDKs are going to need a lot of work. There are already bugs in the Metal implementation that have dogged my port since I released it that have never been addressed.

Luckily, there is a new supported fork of Cocos2d-x called Axmol. They’ve pushed the SDK forward and fixed a huge amount of issues that existed in Cocos2d-x. I’ve been eyeing it for a while but I finally took the plunge earlier this year and have ported to it. It was a relatively smooth transition as far as most of the engine was concerned. Because it’s based on Cocos2d-x it was mainly about getting the project setup file correctly formatted and not much about the code. However there were a number of issues with the OSX port, which is the one I started with, that were probably unique to me. I say that because I suspect at this stage not many people have released Mac games fully through the App Store with Axmol, or indeed Cocos2d-x to be fairl. But the team were fantastic and we got them all ironed out relatively quickly.

I just have some tweaking on the Windows version which is more to do with building with multiple assets, (my projects are setup to be both LoM and DDR which is not quite the expected process for Axmol). But I expect to be fully operational across all platforms very soon.

I’d like to get test versions out soon, and will likely start that process in the next month.

With the move to Axmol I believe that the games will be safe on the current platforms for at least a few more years yet. I actually think it’s remarkable that it’s been 11 years since I originally released LoM on iOS.

Anyway, I hope you enjoy the latest updates…

Such a brief summer this starved Sun brought each day

So more solstice releases missed….

I realise that the last official release was actually Spring Equinox 2023 – nearly a year ago!

It’s not that I’ve not been busy. There has been plenty of development, some sideline things, but ultimately I’ve not been visiting the land of Midnight quite as much as I would have liked. I can insert all the usual excuses here, but ultimately it just comes back to enthusiasm and time management.

So I’ve just pushed the button on the next release. It’s heading to testers now and will be available to all soon. if you just can’t wait you can sign up for testing of iOS LOM and DDR or register for Open Testing for Android LOM or DDR (click link from your device). OSX and Windows versions are available from the download pages – LOM and DDR

The observant among you will notice that there are actually two releases. This is because if had a release ready to go last year, but just never pushed the button on it. That is, except for Android. I had to push a mandatory Android release for targeting SDK 33 – so I pushed it out around October and didn’t even mention it. So there is a good chance that if you’re an Android user you already have 2.0.7

This is really a DDR heavy release, and I must also add a shout out to Andrew Smart for keeping on my toes with all his questions while he has been beavering on with his implementation of Doomdark’s Revenge. There are a few issues the the below list that came out of those questions. Particularly the bug fixes…

v2.0.8 (47)

  • ADDED: Game Difficulty – Number of followers should affect outcome of fights
  • UPDATED: Lords should not be displaced when a member of a group
  • UPDATED: Groups should not disbanded when the leader dies in a battle
  • ADDED: Game Difficulty – Number of Soldiers affects the outcome of a fight
  • ADDED: DDR – Game Option – Upgrade to Shareth Army AI
  • FIXED: DDR – Character without an army doesn’t trigger an AI lord deciding to stay at a location
  • FIXED: DDR – ‘prepares to do battle’ message is shown incorrectly
  • FIXED: DDR – Imgorarg’s loyalty is incorrect – should be Dwarf
  • FIXED: DDR – Dawn energy boosts are flipped for AI / Non AI characters
  • FIXED: DDR – Dawn energy boosts for resting are fixed and not based on hours remaining
  • FIXED: DDR – Recruitment does not take in to account the power of the 5 main special objects
  • FIXED: DDR – Incorrect object name / types

v2.0.7 (46)

  • ADDED: Game Difficulty – time affects seeking
  • ADDED: Game Difficulty – time affects hiding
  • ADDED: Game Difficulty – time affects recruiting
  • FIXED: DDR – Think page incorrectly shows Person and Army info outside of tunnels
  • ADDED: DDR – Game Option – Don’t swap after successful approach
  • ADDED: LOM – Game Option – Auto Seek enhancement
  • ADDED: LOM – Game Option – Auto Approach enhancement
  • UPDATED: Android target sdk 33

So let’s talk about what all the above features mean…

Firstly a note on Difficulty. When it is set to NORMAL which is the default, then the game plays as original. Changes only apply to EASY, MEDIUM, and HARD.

Game Difficulty – Number of followers should affect outcome of fights

If a lord goes in to a fight, the chances of death or losing a horse will be removed by fighting as a group. The current rules for LoM of a friendly army being at the location still apply. So really this only applies when all the lords do not have an army. In DDR the lords’s armies could still lose numbers, but the lord will not engage the nasty. The number of followers that has an affect is based on difficulty.

Lords should not be displaced when a member of a group

When a lord loses a battle and does not die and are part of a group, then the lord should not be displaced so that they can stay in the group. They should however not take part in any more of the battle. In hard mode, then they could still be displaced. What this essentially means is that in hard mode you may have to remove the lord from the group yourself, which is a conscious decision as you might not be aware that they are no longer with the group.

Groups should not disbanded when the leader dies in a battle

Aligned Lom and DDR so that groups are not disbanded due to death. This allows the UI to reflect that a lord has died so that the player can see it.

Game Difficulty – Number of Soldiers affects the outcome of a fight

If a lord goes in to a fight, the chances of death or losing a horse will be removed by fighting with soldiers. In DDR the lords’s armies could still lose numbers, but the lord will not engage the nasty. The number of soldiers that has an affect is based on difficulty.

DDR – Game Option – Upgrade to Shareth Army AI

Two changes for this feature. Firstly, AI Lords have the habit of leaving a fight. This option makes them act like LoM and stay until their death or other lords leave. They may also choose to leave if the total number of soldiers is not currently within their favour. Secondly, AI lords have the habit of not attacking enemies that are close by, unlike LoM. This feature makes them act more like LoM.

These decisions are linked to game difficulty and lord traits.

DDR – Lord without an army doesn’t trigger an AI lord deciding to stay at a location

This is a bug fix. AI Lords make a decision to leave a location at the start of their turn. If there is an enemy at the location it’s pretty much a toss of a coin. But lords with no armies don’t get included in the enemy count, and therefore an AI lord will not consider lone lords when they are making the decision on whether to stay at a location.

‘prepares to do battle’ message is shown incorrectly

The addition of the words, “prepares to do battle” was inconsistently shown. It was possible for a lord to still be in battle in the morning and the message would not be correct.

DDR – Imgorarg’s loyalty is incorrect – should be Dwarf

Imgorarg had the incorrect race attached to him.

DDR – Dawn energy boosts are flipped for AI / Non AI characters

The dawn energy boosts that are applied ahead of the nights battles we incorrectly flipped. So AI lords were getting half that of player lords.

DDR – Dawn energy boosts for resting are fixed and not based on hours remaining

Resting characters energy is hard coded to a fixed amount and should have been calculated based on the number of hours remaining when they started to rest.

DDR – Recruitment does not take in to account the power of the 5 main special objects

The Crown of Varenand, Crown of Carudrium, Spell of Thigrorn, Runes of Finorn, and Crown of Imiriel should all have a positive affect on recruitment. But they didn’t.

DDR – Incorrect object name / types

The Spear of Thorthak was incorrectly marked as a sword. And the Bow of Tororthane was incorrectly marked as a hammer.

Game Difficulty – time affects seeking

Seeking is no longer available at night when difficulty is hard. In medium and hard, seeking will actually take an amount of time.

Game Difficulty – time affects hiding

Hiding is no longer available at night for medium and hard. Hiding and Unhide now take 1hr on medium or the rest of the day on hard.

Game Difficulty – time affects recruiting

Recruitment time for both lords has a group of new rules depending on game difficulty. In easy the recruiter loses no time and the recruited is reset to dawn. In medium the recruiter loses one hour and the recruited time is set to the same. In hard they are both set to night.

DDR – Think page incorrectly shows Person and Army info outside of tunnels

When a lord is in a tunnel, information about the outside of tunnels was visible on the think page. This has been corrected.

DDR – Game Option – Don’t swap after successful approach

Added an option to stop the auto switch to the newly recruited lord after an approach. Player can choose to DO NOTHING or stick. After the approach a new icon is displayed next to the Look icon to indicate either the recruited or the recruiter lord depending on the swap option.

LOM – Game Option – Auto Seek enhancement

Added option to auto seek when entering a location. Doomdark’s Revenge already does this.

LOM – Game Option – Auto Approach enhancement

Added an option to auto approach when entering a location in LoM. This was not added as a feature for DDR because approaching is done from outside the location and is also linked to battle.

Not sure when the next release will be. I had one scheduled in for Spring Equinox which I guess this one is kind of becoming. Therefore the next release would be Summer Solstice (June 21st) but I’m not promising anything as I potentially have to perform another SDK switch!

In the mouth of a broad tunnel, they paused to look one more time upon the fair land of Midnight.

Here is something that I have been working on in the background – Tunnels in The Lords of Midnight. It’s not something that is going to be used in the main game, but I am hoping to have a new scenario released later this year, early next at the latest.

For those of you who have read Drew’s novelisation, then the need for tunnels will make sense. For those of you who haven’t, well something for your list…

Normal Tunnels

Now, you’d think that adding tunnels to LoM would be pretty straight forward. It is as you may know from following my posts, the same codebase as Doomdark’s Revenge, having been unified a few years back. However, there are some issues.

Firstly, even though they are the same engine, and use the same data structures etc, the games are built conditionally as separate projects. This means certain part of the engine is not compiled depending on the games. For example, tunnels, mist, AI lords, special objects, are not part of LoM. Regiments, Ice Fear, and Waypoints, are not part of DDR. There are other little things like critters and battles working differently, and small UI changes.

The engine is written in c++ and most of these features are turned on or off using preprocessor macros like this..

            if ( !IsDead() ) {
#if defined(_DDR_)
                flags.Reset ( cf_inbattle|cf_wonbattle|cf_preparesbattle);
#endif
#if defined(_LOM_)
                flags.Reset ( cf_inbattle|cf_wonbattle );
#endif

Some of it is handled with c++ object inheritance.

Some of it is not handled very well. The code base, like many projects has morphed and evolved over the years. I as a 30+ year veteran software developer, understand the vast gulf of academic based code structure, and real world getting it done with deadlines. And it’s no surprise that the engine has many of these pitfalls.

The following piece of code makes sure that two characters tunnel status is the same. ie: These two characters can only see each other if they are both either in, or both out of the tunnel.

#if defined(_DDR_)
            // they both need to be in or out of a tunnel
            if ( c->IsInTunnel() != IsInTunnel() )
                return false;
#endif

The thing you will notice is that the preprocessor check that will include this code is _DDR_ which means, it only gets compiled when I build Doomdark’s Revenge. Ideally this code should either be governed with a _TUNNELS_ feature preprocessor macro or better still, a feature check based on the capabilities of the scenario. So, that was the first thing I had to do and it took a few iterations to get it right.

The landscaping view for DDR is different as it has a header, therefore the tunnel view needed to be modified.

New graphics were used to distinguish the two.

Text had to change. The DDR strings database has ways of describing that a character is in a tunnel, or can see and entrance. LoM did not.

I found a bug on the think page that is in DDR in that it will show you information about a character in a location that does not have the same tunnel status. There were a couple of other UI issues specific to LoM for showing characters or armies in a tunnel. These just come out of different code paths.

Narrow tunnels

You will notice in the above image, a slightly different tunnel view. This is for narrow tunnels. The novel explicitly has Farflame not entering the tunnels when Morkin does even though they are together, and this is because he is too large. This is a story specific plot device, but that makes no sense when we consider the tunnels in DDR. So the change I made to accommodate this was to have normal and narrow tunnels. In this instance Farflame can enter the tunnels, but there are some important areas that he cannot go because they are too narrow, and the game indicates this with the slightly different layout. Narrow tunnels will also be extended to armies, and too many characters in one location.

Something else I have done with the tunnels is to tweak the concept of entrance and exit. In DDR these are always one of four terrain types – Palace, Pit, Gate, and Temple. However using the mapping software you can now override this and mark any location as an exit, an entrance, or both.

Tunnel view in mapping tools

And finally, while I was make changes for the mapping I extended two other features. Firstly impassable mountains. This was added as a rule recently to help make games optionally harder or just different and it was locked to just mountains. However, I have now added a feature to allow any location on the map to be marked as impassable. In this instance it will be used for all the mountains around Ushgarak. This means that the only way to enter the plains of despair is to take Kor and Grarg. The slight pass at Vorgath as been closed off but I am having to think this through a little more because of the consequences to a western attack.

And finally, respawning of things. In DDR critters and things (claws, thorns, springs, etc) regenerate randomly. I am planning on adding this to LoM as a rule, but for the next scenario I am also adding it as a mapping feature so that certain locations can respawn. In this instance I am using it for critters in the tunnels.

Tunnel Exit

There will be more information about the Novel Campaign later as I work my way through it.