View Single Post
  #1830  
Old April 24th, 2008, 11:37 PM

Loren Loren is offline
First Lieutenant
 
Join Date: Nov 2006
Posts: 739
Thanks: 1
Thanked 8 Times in 8 Posts
Loren is on a distinguished road
Default Re: Bug thread

Quote:
vfb said:
Without auto-death, it's possible that a battle could never end. You could have two fatigued armies passed out on the battlefield, neither able to kill the other, and not even able to retreat even if they wanted to.

Oh wait ... maybe I see what you're saying. When turn 100 is reached, just treat the entire attacking army as if it *had* retreated, and flee it to the surrounding provinces. Sounds like it might work.
Somebody's going to wake up and start bashing again.

I think the answer is different: Starting at turn 40 count the total hp's of the real (not battlefield summons) units in the fight. Note the highest value in the 40-50 turn range. In every subsequent 10 turn range note the highest value, compare with the saved value. If it's equal or higher it's time for a rout. If it's lower, replace the saved value with the new value. Note that since the hp's must always be declining the battle will end eventually.

If it's determined that a rout should happen look at the retreat options for both sides. If a side can retreat, rout that side. Do not rout a side that can't retreat at this point. These routs apply to *ALL* units, even those normally immune from routing.

Continue the hp checks, if they call for a rout *AGAIN*, rout both sides.

If the check hits a third time then you force everything off the battlefield. Anything capable of teleporting to the capital does so, anything else dies.

So long as the battle is making progress it will continue. If it deadlocks the guy who can retreat does so--realistically the guy who has noplace to go won't stop a useless battle.

The second case is to deal with the possibility that nobody can retreat. Two armies teleport into battle or the like. The final case removes any units that can't move.
Reply With Quote