Should we prepare to do battle against the wind and snow?

I was looking at a battle issue reported recently that battle reports were not always being displayed. I’ve had reports before that the AI Lords don’t appear to engage in battle the same as the original, but I have tested this many times and not been able to find an issue other than the AI being unpredictable and a little shaky.

I had recently done some testing while adding the new game rules in place and had my lords attacked, and indeed failed an approach of lord and been attacked, and attacked a lord and battle had commenced, so on the whole it seemed to be working.

I poured over the code again to check the AI conditions of battle and noticed something interesting. The rule is that if the lord can’t walk forward and it is dawn and they are not blocked, then there is a 50% chance of them staying in the current location and ending their turn.

Analysing that a little; blocked means exactly that, they cannot move in the direction they want to under any circumstances. This is usually because of Icy Wastes or there are too many people in the location. Can’t walk forward is usually a transitory check, something in the location they are in or entering could potentially stop them entering, but nothing that would break the game. The Dawn check is just helping to differentiate moving into a location during the turn from moving out of a location at the start of the turn.

The code that makes those decisions is separate from the code that is handling the AI Turns logic. So I went to look at that to check under what condition the lord could not walk forward, and the thing that caught my eyes was – if there is an enemy in the current location. Combine that with the checks in the AI Turns logic and what you have is, there is a 50% chance that a lord will leave a battle at the start of his turn, but if they enter a location with an enemy they will always stop to fight.

The problem was that this flag was being reset by another piece of logic which was actually more to do with the player and not the AI, and also some shared LoM logic. The net effect was, if you attack an enemy lord, or have a failed approach, then the enemy will pretty much always move on and not engage. Now, this seems counter to what my testing has shown, so I can only posit that there was something else happening in these situations that was keeping the enemy at the same location.

Once I realised this it was a quick fix to isolate the piece of code that was overwriting the can’t walk forward flag. However, this then highlighted another bigger issue, and that was that the lord was not considering the enemy as their enemy, and thus the trigger was not occuring.

Again, I checked out the area of the code that handles this, and clearly it was based on LoM, in that Luxor is the friend, and Doomdark/Shareth is the foe. But this does not take in to account the multi-race nature of DDR. So what in effect was happening is that the AI was not really considering the players lords as enemy, or indeed not always correctly considering the enemy AI lords as enemy, which means they would often over look them. Obviously there were fighting, but again I think other issues were causing them to stay in the location of another lord. And as long as multiple lords are in the same location, the battle algorithm would get the friend/enemy check correct and they would fight.

Now, this looks like it has always been wrong, ie: nearly 10 years since I released the games. But I suspect the problem is actually due to the merging of the code bases and likely crept in in the later stages of v1 and then rolled over in to v2.

Stray boulders made a mountain range of the forest floor

I shall be releasing an update to both The Lords of Midnight and Doomdark’s Revenge toward the end of June. This is the “Summer Solstice” update.

There are currently three fixes.

  • Problem with Android rotation.
  • Cowardly lords can still enter a battle.
  • Characters are no longer correctly tinted by the time of day on the landscape.

Along with these fixes there will be a couple of new features. These features will be driven by the new gameplay rule system. The idea being that you can additionally enable certain features that will have an affect on how the game plays.

Menu showing gameplay options

I have been planning this for a while and intended to introduce it with the c# rebuild that I am working on (slowly), but after requesting features for possible inclusion in regular updates I have decided to bring it forward. It gives an easy way to extend gameplay options.

Neil Swanson contacted me with a few ideas for new features and they have been rolled in to the gameplay rules.

I’ve also always intended to have a game difficulty mode: easy, medium, hard. So the intention is to use this in conjunction with the gameplay rules to leverage different types of play.

The following rules have been slated for development and have issues created for them on my GitHub repos. There are likely a few things to consider for them, so details may change.

  • DDR – Original terrain travel times
  • DDR – Armies attack when near an enemy
  • DDR – Armies will continue a battle without just randomly leaving
  • LOM – Cup of Dreams can replenish overnight
  • LOM – Varied initial start positions
  • LOM – Utarg of Utarg can become disloyal
  • LOM – Doomdark will go after Morkin heavily if the Ice Crown is picked up
  • LOM – Doomdark will guard the Ice Crown more heavily
  • LOM – Change quest completion rules to align with Mike’s original intention
  • LOM – Fey are not recruitable
  • DDR – Fast Tunnels
  • LOM/DDR – Impassable mountains
  • LOM/DDR – AI Impassable mountains

The plan is to have the last 4 in the Solstice update, and the work on Impassable Mountains already almost complete.

It’s interesting that when you think of a simple one line description of a feature, how complex it can become when you start to develop it. For example, impassable mountains are just that. LoM and DDR already have a concept of impassable terrain with the Frozen and Icy Wastes, so dropping in Mountains seems simple enough until….

What happens if the friend/enemy is in a mountain? You need to disable approach and battle. Out of that comes the concept of AI Impassable mountains to stop the AI characters from freely moving around the map. But that has its own issues.

What happens when a lord loses a fight and runs away. Well in LoM they only leave on location and there is already a check that it’s not Frozen Wastes, so that becomes straight forward. But in DDR they move up to 3 locations away. It checks that the target location is not Icy Wastes but not if the locations to get there are. Which is why you can currently be bounced in to the Plains of Anvoril if you enter battle up against the Icy Wastes surrounding it.

In DDR special objects are randomly placed on the map. So they can’t be placed on a mountain, but technically they can’t be placed anywhere that can’t be accessed. There are a handful of locations that would be problematic. So either the map needs to be edited to make those locations accessible, or they need to be marked as un-accessible, or we need to allow particular lords or races to not be affected by Impassable Mountains – like say Giants and Dwarves. The later make sense as there are a few Dwarven fortresses that are locked away in the mountains.

It is better to know your comrade’s mettle before the real battle begins, is it not?

I have finally managed to get The Lords of Midnight and Doomdark’s Revenge ready to return to the stores. Yes I know it’s taken a while and in reality it’s been a labour of love, but we are almost there. I have had both games running on iOS, iPadOS, OS X, Windows, and Android.

I am hoping to release the games during January, I have put a lot of work into this rebuild of The Lords of Midnight and for that the game will now cost a total of NOTHING! I initially intend to keep a price on Doomdark’s Revenge, although if you’ve already paid, you won’t need to pay again. But I also intend to include some In App Purchases in the future.

Right now, I would just like to get as many people testing them to make sure that they are behaving as expected. I am sure there are a few little niggles, and I know there are a couple of small UI features that I removed; awaiting a rebuild. I just decided not to hold up the release because of them.

To start testing The Lords of Midnight…

To report any issues either use the links supplied as part of iOS/Android testing system, visit my issues page on GitHub or fill in the form at the bottom of these page. Please provided as much information as possible, screenshots if it helps, and details of your device.

Some of the things removed.

  1. Detailed map needs the ability to scale.
  2. Desktop – Cursor images need adding
  3. The compass gadget is missing from the look screen
  4. Desktop – Some keyboard shortcuts are missing
  5. Mobile – Some gesture shortcuts are missing
  6. Desktop – Only runs in a window. Should open a window in 16:9 at about 75% the hight go your desktop resolution.

Known issues

  1. Splash and Credits screen crop badly top and bottom
  2. Desktop – Direction number keys are mapped incorrectly
  3. Scrolling indicators/icons missing from think page and popup info pages
  4. Names on the map collide with each other
  5. Options screen has incorrect options on it for platform

Some of the changes.

There have been some UI changes that I have added either for flourish while I was rebuilding or out of necessity.

The landscape view now adapts to your screen resolution much more dynamically. It keeps the same aspect ratio (1.3333) of the original for the height of the view but allows the width to grow. The affectively gives you a wider field of vision or wider devices. I did feel originally that this was an unfair advantage to those on with resolutions closer to the original, but in the end I decided that the advantage was minimal as most people look around them anyway,

The Think page changed a little. The first is that the text now scrolls vertically if it gets to long. Again this was to help with certain resolution issues. But also each think page now scrolls horizontally in a fashion more akin to scrolling pages on mobile devices. Note the page indicator at the bottom of the screen.

He thinks again…

The following screens show some new additions to the think screen that allow to take certain actions direct from there.

Showing the new display when it’s night… more like the original.

Two changes that have happened on the main menu. A bigger scrolling area for the stories and a new stile menu screen.

Report Issue