Flaw in Military Might formula

(I'm sorry if this isn't the right forum to post this, I wasn't sure if it should go here or ideas)

I play on "tough" difficulty, and I've found that when I compare military ratings I am usually pretty far behind, yet when I end up going to war with the "strongest" opponent I can utterly decimate him, often with no casualties. There are many reasons for this, but ultimately, it is the military might formula that is to blame- if I can easily eradicate someone it should say so. In other words, it should be an reflection of each player's military might, but it isn't.

This has bothered me, so I've been digging around the mathematics to see if I could figure out what's wrong. It's a simple formula that the game uses. That's good.

A+D+H/10
(A=Attack, D=Defense, H=Hit points)

Where does it go wrong? After my analysis, I've determined it's 3 things (which I will explain):

#1 Hit points are drastically undervalued
This is best explained with an example. And let's look at an extreme case to make it clear. Imagine a Ship Alpha with 10A and 100H. It's military might (henceforth "M") is 20. How many 10A, 10H Beta Ships in a single fleet would it take to beat it? For the sake of simplicity, I am going to use the approximation that all attack rolls result in the maximum possible roll. While this approximation is not precise, it is actually quite close to actual results except that battles take half as many volleys to reach the end. I'm also going to let both sides attack at the same time which is fair since either side is equally likely to go first.

Thus, it takes 4 Betas to destroy 1 Alpha (the Alpha destroys 1 Beta each turn, the Betas do 40 damage the first round, 30 the second round, then 20, then 10). Both fleets are annihilated with no overkill, so a fleet of 4 Betas (M=44) is approximately equal to 1 Alpha (M=20). The military mights of the two fleets would be equal if the hit point factor was H/2 instead of H/10 (the new military mights would be 60 for both sides). I showed this process in detail for one example, but the result is general and works for any example you can come up with.

#2 Speed is not taken into account
I think everybody knows how easy it is to beat the snot out of another player if you have significantly faster ships even if they're weaker. I don't have a good way of quantifying why speed is so valuable, but I hopefully you agree that it is self-evident. However, it is tricky to include speed in military might because it helps more on offense. So I have a 2 pronged approach:
2.1) Speed determines the number of turns a ship gets, so speed is even more valuable for "good" ships than "bad" ships. Thus, speed should have a multiplicative factor: like (A+D+H)*spd. Since the first points of speed are more valuable than the last points (3 is a big upgrade from 2, but 11 is not much better than 10) I suggest a function like [sqrt(speed)] that reflects this.
2.2) The computer should make a "Defensive Military Might" check against a player it plans to attack. The reason for this is that a ship with 1 speed who has no other purpose than to defend a planet gets undervalued with my above suggestion (and a human can easily exploit this knowledge). So "Defensive Military Might" is identical to military might, except it puts a floor on how low the speed factor can go, something like [max(2, sqrt(speed))].

#3 Logistics is not taken into account
This clearly has a large impact on military might, but the best way I could think of to include it is as a multiplier on the hit points factor (reason: think about how example #1 would have been different if the Beta ships didn't have enough logistics to make a full fleet). The subtlety of this change is not worth the complexity it brings to the military might formula, so I don't think it's worth adding it as long as we remember that the formula does lose accuracy because of this.

In summary, my revised military might formula, which is much closer to fool-proof is this:

Military Might: (A+D+H/2)*sqrt(spd)
Defensive Military Might (used only by computer players): (A+D+H/2)*max(2, sqrt(spd))
6,667 views 12 replies
Reply #1 Top
Military Might: (A+D+H/2)*sqrt(spd)
Defensive Military Might (used only by computer players): (A+D+H/2)*max(2, sqrt(spd))

I don't understand it, but looks great, reminds me of my algebra days when i used to fall a sleep!

But seriously, get Frogboy and stardock to look at it. If it helps make the AI harder to beat all the better.
Reply #2 Top
I find I can decimate military powers that have a rating twice that of mine! This new formula looks like it could stop those blasted Drath from declaring war on me all the time even though I know I can decimate them.

I have fought three-sided wars against the top military powers and have held them off easily with a small number of super-fleets, using superior speed to intercept anything near my borders and decimating their star bases and trade with fast strike fleets.

In other words rebalancing is needed. Maybe the AI could take into account what military rating you needed to hold them off in the last war?

"A+D+H/10 " does this mean that the AI doesn't take your military starbases into acount? That could explain alot.
Reply #3 Top
(This may all be wrong)
AFAIK It doesn't take military starbases into account, but it does take mining bases and spin centers into account. Furthermore, if it can see the mining base it'll destroy it.
Reply #4 Top
Military Might: (A+D+H/2)*sqrt(spd)


So speed 0 = No effect?

I agree It makes sense for general military might to exclude speed 0 ships used for defending only, it's damn misleading to the AI since he declares war on me, when his military is 95% a ton of 0 speed defender ships lol.

Also, right now because speed is not taken into account, people just build throw away 0 defender ships not for the even necessarily for actual value of the ships for defense, but just to boast their attack/defense ratings to fool the comp into thinking they have a military worth a damn. Most of the time I end up with tons of zero defender ships stuck in my homeworld doing squat even though my homeworld is damn far away from the frontiers and is in no danger at all.

Defensive Military Might (used only by computer players): (A+D+H/2)*max(2, sqrt(spd))


I like the idea of defensive military might, but doesn't your formula mean 'Defenders' with 0 speed don't contribute? For defensive purposes, speed 0 defenders should certainly count.
Reply #5 Top
@Richrf
There are NO speed 0 ships. the minumum speed is 1 wihtout any engines. And max(2, sqrt(spd)) means that for ships that got less than 4 speed the multiplier is fixed to 2. this way defensive ships without engines dont get underrated when deciding to attack.
Reply #6 Top
I think that there are three main reasons why the ai miscalculates military might;
1) The ai rarely attacks first (even with slower ships I can usually predict where the ai will go and then position my ships accordingly) and so is at a big disadvantage.
2) Huge numbers of ai ships sit on planets doing nothing, their attacking fleet is usually only a very small proportion of their might. This means you can take their ships out at your leisure.
3)They usually don't have big fleets. I tend to go with as many ships in a fleet as I can but the ai usually only has 2-3 ships per fleet and one of those usually goes when I attack first.
Reply #7 Top
The AI would do well to factor in other considerations besides military might when deciding who would be "easy pickins".

I'd call it something like a "War machine" rating. It would rate not what your current military status is, but how easily you could ramp up and become a juggernaut.

Tha main factors:
- Current civ-wide production capacity (how fast can you crank out new fleets)
- Current ship-related technology levels - weaps, defs, hull size, logistics, miniaturization. (Just because you haven't built any doom-ray dreadnauts doesn't mean you can't!)
Secondary factor:
- Research capability (how fast can you research techs to trump their techs - ie: shields vs their beams)

The AI might then be able to decide that to take on a civ with a low military rating but a very high war machine rating is suicide and avoid it. Or, it might decide that it calls for a huge peacetime build up and then a massive sneak attack strategy aimed at taking out key production centers before they can be ramped up.

Reply #8 Top
It's still wrong though. If someone has lots and lots of weak ships they're no match for a single powerful ship.

Say one side has a 100hp ship, speed 1, with 10 attack, no defense. The other side has 10 ships with 10hp, 1 speed, 1 attack, no defense.

Game formula says both are 20, your formula says both are 60.

In your simplified battle scenario, the fleet of smaller ships will never ever win (they're all dead after dealing 55 damage to the large ship). If you try it in the battle simulator, they don't ever seem to win either, especially when on the defense (large ship gets first shot).

In fact according to your simpler battles they wouldn't even win if there were 13 of them. (They do in the simulator though, already with 11 of them they have some chance of winning, not huge, but still significant).

So although the formula would say that 11 of the smaller ships makes a better force than the single big ship, in fact the big ship is at a huge advantage.
Reply #9 Top
Very interesting thread. I certainly agree that hitpoints are undervalued, and the modification A+D+H/2 looks good. I would propose a different approach to calculating speed, however.

My reasoning begins with two of the primary combat-related abilities which speed affects: number of attacks and the ability to attack first. Being able to move and attack multiple times is obviously better than being able to do so only a few times. And whoever attacks first has a clear advantage in any battle. Making speed more of a factor in calculating military might should take these two abilities into account.

The key to taking them into account, I think, lies with the attack. The attacking ship always makes its "rolls" first, and those rolls are a number between 1 and the total attack value (a ship with an attack rating of 4 rolls between 1 and 4). The average roll one could expect can be found simply by dividing the total attack by 2. One could express the potential advantage of the attacking ship by its ability to do damage before the defender can respond - and for each ship the potential damage it could do, on average, is its attack divided by 2 (Att/2).

Because speed is the crucial factor in determining whether a ship can apply its attack first (and whether it can apply that attack multiple times against different targets), I agree with the above suggestion that speed be added in as a multiplier.

The formula I'd suggest, then, would take a ship's attack divided by 2 (the average roll it would have when going first or when attacking however many times it attacks) and multiply the result by the ship's speed. A ship with 4 attack and 7 speed would receive a modifier of +14 to its total value when calculating for "military might" purposes.

This formula probably should be modified down a little to account for the fact that damage does not "carry over" in fleet combat. That is, if your ship is firing and the enemy ship targeted only has 2 hp left, your ship's "roll" will always be 2 - it will not, say, "roll" a 4 and apply 2 damage to the ship with 2 hp left and 2 damage to the next ship in line. A minor reduction can account for this (say, -1 modifier to the attack value).

The formula would look like this:

(A + D + H/2) + [(A-1) / 2 * (Spd)] = Military might value for ship

If you take two ships with identical values in everything but speed - say, 4 attack, 2 defense, and 10 hp - those ships will now be given a value which takes into account the possibility that, the faster the ship is, the more likely it will get to fire its weapons first and the more likely it will be to fire those weapons in multiple combats. And this value will increase dramatically as attack ratings go up - which reflects reality to the extent that as ships' attack values get higher, it becomes dramatically more important who gets to fire the first shot.

The only other glaring weakness I think would need to be accounted for after this is the AI's failure to account for ship potential when determining relative strength. That is, the AI should consider not only the ships currently available to someone, it should consider the ships which a given civ could have at its disposal if it chose to apply its military production to making them. Right now, "production" and "military might" seem to be entirely separate.

But as the Japanese admiral in WWII noted, "We're going to lose this war: I've seen Detroit." In other words, production capacity should count for something when it comes to determining military might. Perhaps 1/10 of total shields could be added in to military might...






Reply #10 Top
This is a good discussion, and I agree that something in the calculation needs to change. Something to consider about speed though is that at this point humans use it far more effectively than the AI, so giving it a static rating is going to be tricky.

What I really like though is LintMan's idea of a War Machine rating. From reading the board, it appears that most good players rarely build any sort of combat ship until they are actually at war (or preparing to go to war). At which time, they use their massive manufacturing planets to pump out top of the line ships with bleeding edge technology every other turn or so, quickly flipping the balace of power.
Reply #11 Top
It's still wrong though. If someone has lots and lots of weak ships they're no match for a single powerful ship.

Say one side has a 100hp ship, speed 1, with 10 attack, no defense. The other side has 10 ships with 10hp, 1 speed, 1 attack, no defense.



I don't think you can take this into account. There's a limit to the amount of detail that you can pack into a single indicator, and I think it isn't worth while to factor this in. There will always be inaccuracies.

Besides, the side with more ships has other advantages, they can hit more places, while your single super ship is limited to only one location at the time...

The fact is even the best indicator, models the 'reality' of military strength only approximately, and whatever the formula, there is still room for the human to 'game' the system, particularly since AI's use it for decision making and they can figure out at what levels the AI will be triggered into attacking and sysmatically build ships designed to give the best bang for buck in terms of projecting military strength , even though such ships would be less than useful in battle.

That said, the closer to the 'truth' the system is, the better the AIs play. And not taking into account speed is a very big flaw in the model.



Reply #12 Top
Thanks for all the comments everyone! I see now that maybe speed is too complicated to fit into the formula, but at least the hit point modification should be made. Everyone agrees that hitpoints should be worth more (since big ships beat don't suffer from fragmentation like little ships do).

chriskruz, you make an excellent point and I don't know how I missed it. I'll have to think about it and get back to you.

Dwellsian, you did a much better job of explaining why speed is valuable than I did, and your formula seems more refined. I just made up the sqrt() part without thinking about it much, but you have better analysis so if they include speed they should use your formula.

PS- in the next patch, combat will in fact be simultaneous, so my approximation will be that much closer to accurate!