I thought the War was lost and Midnight doomed.

battle_full_linesI’ve been working my way through the outstanding bug list. One of the areas that seems to cause contention, is battles.

It causes me some problems because the original is actually pretty haphazard where battles are concerned. So I’m going to talk about the battles in a little more depth, just so that you can get an understanding as to why certain things seem to be happening.

Firstly, night processing goes like this…

1. Reset all characters at dawn
2. Give all AI characters their turn
3. Process Battles
4. Place things on map
5. Move Mists
6. Remove things from map at location’s where characters are
7. Check if characters can recruit soldiers from strongholds
8. Re-spawn armies at strongholds
9. Check for important deaths

Secondly, the interesting point here is, characters are given a chance to move BEFORE battles take place. So, if you attack a character, there is a good chance he will move and thus a battle will not take place.

To understand that a little more, let’s look at the AI turn.

The AI character must decide what to do every night. Each character will react to a number of objectives.

1. Goto Liege
2. Goto Foe
3. Goto Object
4. Goto Home
5. Do nothing

If they have a liege, and that liege’s objectives are 1 or 2, then this characters objective also become 1 or 2.

Otherwise, we pick a new objective

When picking a new objective we pick a random number between 1 and 16. If we choose 1 to 5, then these are our objective. Otherwise we continue with our current objective.

So as you can see, there is a 68% chance that we will just continue on with what were we previously doing. Which means that unless you are at a characters stronghold, and his current objective is to go home, then the likelihood, he is moving away from you.

There is only a 6% chance that the character will stay at his current location.

Personally, I am very surprised at these stats, because it makes battles bloody difficult. Unlike The Lords of Midnight where a nearby army would drop everything to attack, or an attacked army would stay until the death, in Doomdark’s Revenge, everything apart from battle seems to be of more interest.

Related Posts:

16 thoughts on “I thought the War was lost and Midnight doomed.

  1. It is a bit of an anticlimax, building armies and then the ice guard just stand about and don’t attack anyone. They should be a bit more aggressive to allies of the Moonprince, surely?

  2. Is Shareth different to other AI characters? Because it seems to me that once Shareth is heading for Luxor, that’s all she does, and as you said above, that forces all of her followers to go with her. So in that respect it seems to work well.

  3. This is largely as I remember ddr. I remember also that often the best way to have battles was to put your armies one square in front of your enemy, then they would run into you. However this seems not to happen in the app; for example twice I put someone directly between Shareth and Luxor, and twice she got through, presumably by detouring around!

    I also find I’m not attacked by characters following their liege any more – in one case the AI character just waited next to his liege that I had, instead of attacking (or failing recruiting) as I expected.

    Finally, where is Shareth’s home for this algorithm? Not Imiriel, surely?

    • Shareth’s seemed to trawl between Glireon’s city, and Luxor, apart from when she was either chasing her Crown or just playing silly bu**ers and heading off in a strange direction. I agree that a lot of battles didn’t happen, because the AI characters wandered off location, and putting armies ahead generally worked better

    • Unfortunately in 1.2 her home is indeed Imiriel, as that is her home. I missed the subtle override that makes it Glireon for movement. I fixed that over the weekend.

      I’m going to take one more pass on the movement logic just to make sure I haven’t missed anything that could account for enemy lords skirting round you etc…

      But then I should be pushing out 1.3 tonight/tomorrow.

    • Got it! Finally worked out where the ‘attacking’ problem is.

      Part of the issue is the code handles moving in tunnels, even though AI characters don’t move in tunnels. In fact at the start of the movement code it explicitly stops if they are in a tunnel. I think Mike originally intended for the AI characters to use the tunnels, but then pulled it.

      Anyway, there is a check that effectively says ‘if can’t move forward, and it’s not dawn, then end turn’ The variable used to check ‘Can’t Move Forward’ should include that there are enemies in front, and I don’t think I’m doing that. If it is dawn, then the character has 50/50 chance of moving into that location. He may still move straight through if he has any moves left.
      At the end of the turn the characters check if they should approach, a failed approach places the lord in battle. I’m not 100% if I allow an approach against one of your lords. Which would mean you can’t lose a lord you recruited ( I presume you can in the original ) and more importantly there are no failed approaches against your lords, and therefore less chance of a fight.

      • You can definitely lose recruited lords in the original. A good way to counter this was to press night while controlling a character you thought you might lose (a treacherous one!) Then next dawn if you have lost him you would still have control of him – then you could move him to next to someone you could recruit him back with…lol.

  4. The random aspect of the chars AII is what i always liked, hense every game is different which for me extends my interest in playing the game beyond what i would with normal games, TBH the chars in the game could always be silly sods at one time or another one of the most anoying is when a Liege gets recruited by his follower and then bottlenecks that side, i just remember when fighting if the character stays and fight if they our outnumbered heavily they used to loose there army just not always get killed themselves. I’ve enjoyed the game so far just appart from the less movement, the crown of varenard causing the game to be ruined and taking over enemy bases no working properly but you have fixed this, all in game a great game.

  5. A couple more things I’ve spotted:
    * When you take a stronghold, still says that you “won no victory”.
    * When a lord is killed by critters, his army graphic remains visible (without his avatar though) for the rest of the go. This is the same as the original, but maybe was a bug? Maybe it indicates that the army is still hanging around before disbanding…

  6. Not sure if it’s a bug but seems like one, when I have a group of Lords and they engage in an attack on a Stronghold, it seems that each turn only one Lord attacks at a time, this makes taking a stronghold with a force very slow, surely all engaged Lords should be attacking, not just one?

  7. I’ve noticed that whenever I bump into dwarves, they are always very tired – even when they’ve hardly moved! Is there a problem with their strength?

    • Not that I can currently see. They all stop moving when they start to dip below 96, out of 255. BUT, I don’t think they are doing much stopping. There is some code that should randomly stop their turn if something is blocking them, rather than them move through it. Which could mean they are using all their travel time, every night.

Comments are closed.