Looking for some opinions on Doomdark’s Revenge battles.
In Lords of Midnight a Lord cannot be killed until they have no army. This is obviously a one way thing as there are no enemy lords.
In Doomdark’s Revenge the overall night processing cycles through all lords from 1 to 128 giving them each chance to fight at their location if they have not been involved in a battle yet.
It then cycles through the lords at that location given them the chance to become the attacker.
FOR ALL LORDS IN LOCATION – (attacker) choose defender = random lord at location 1. attacker vs defender lord attack 2. attacker army vs defender army 3. defender army vs attacker army NEXT choose defender = random lord at location 4. stronghold vs defender 5. stronghold vs lord defender
If there are only two lords in a location then they will both have a pop at each other. If there is a stronghold then it will take a pop at just one of them ( if both are enemies of the stronghold ), or just the one enemy.
If there are multiple lords in a location, then random selection means that some of the lords might get hit multiple times, and some not at all.
During the battle, If an army is reduced to 0 then there is a chance that he relevant lord will flee or die.
However in lord vs lord the the attackers success is calculated from a formula that includes carrying a battle object, energy, despondency, and recklessness. Gives a number between 0 and 255
The defending lords’s chance is a random number between 0 and 255
if attacker’s chance is greater than defender’s chance then the attacker wins.
When defender loses, then chance of dying is 1 – 50:50 survive 2 – is recklessness less than a random number between 0 and 255 3 – If carrying a battle object then 30% chance
The upshot of all that is – it’s pretty easy for a lord to die in a battle against another lord regardless of size of their individual armies. And it has nothing to do really with strength or even attacker initiative.
I’m trying to add a game play rule option for better battle AI and wonder of ways to make the lord vs lord a little fairer!
I’m thinking of adding runes of protection in at step 3 I’m also thinking of doing some maths on the lords army – ie: rather than just if army greater than zero they can’t die, maybe have a low army threshold eg. Less than 100 soldiers, or a percentage compared to the attacker’s…
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..
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.