Battle Simulator Scenario

Discuss or develop strategies here!
User avatar
Kaleel
Knight
Posts: 76
Joined: Mon Feb 20, 2012 12:37 pm

Postby Kaleel » Sun Mar 04, 2012 12:45 pm

OMG!! I figured it out!! So simple!!

*holds head and screams*

But it doesn't seemingly follow the LOGIC of troop of defense speciality?

The total attacking for is counted against the sum of the cumulative defense and the losses are deteremined by a percentage which is EVENLY DISTRUBUTED across all troop types!

Run this scenario and you'll see what I mean:

ATTACK: 1,000 Knights (110,000 attacking points)
-vs-
DEFEND: 1,000 Lancers & 1,000 Sentries & 1,000 Guardians (total of 185,000 defense-against-cavalry points)
===============================================
RESULT: Defenders win, with 594x of each troop type lost (total of 1,782x troops lost), leaving 406x of each troop type surviving (total of 1,218x troops surviving).

Yes, the defenders win, but look at the number of defender troops which are lost. It's an equal 594x of each troop type, DESPITE the fact that Lancers have have a greater amount of defense-against-cavalry points than Sentries.

A lost of 594x troops out of a 1,000x troops = a loss of 59.4%. This is derived when you DIVIDE the TOTAL amount of attack points (Knight = 110x attack points, so 1,000x knights = 110,000 attack points) by the TOTAL amount of defense-against-cavalry points (1,000x Lancers = 50,000 defense-against cavalry points; 1,000x Sentries = 25,000 defense-against-cavalry points; 1,000 Knights = 110,000 defense-against-cavalry points ==> total of 185,000 defense-against cavalry points).

110,000 attack points / 185,000 defense points = 0.59459... = 59.4% troop loss on the defensive side.

59.4% x 1,000 defending Lancers = 594x Lancers lost
59.4% x 1,000 defending Sentries = 594x Sentries lost
59.4% x 1,000 defending Guardians = 594x Guardians lost.

Here's why I argue that this doesn't make sense:

Lancers are TWICE as capable as Sentries when defending against cavalry, and Guardians are at least as FOUR TIMES as capable as Sentries when defending against cavalry. In this scenario, the Sentries are the weakest against cavalry, so shouldn't the Sentries have taken the greatest damage, followed by the Lancers, then the Guardians? I was hoping that the amounts of troop lost would have been weighed against their respective defenses. Maybe something like


ATTACK: 3,000 Knights
-vs-
DEFEND: 1,000 Lancers & 1,000 Sentries & 1,000 Guardians.
===============================================
RESULT: Defenders win... but the losses are not evenly distributed.... wait, I gotta think this through. How would such a mechanism actually be applied? Hmm...

-Kaleel
-Kaleel, casual gamer
==========================
The forum search function is your friend.
Please use it before posting.
It won't let you down.

TheBoyMort
Lancer
Posts: 18
Joined: Sun Jan 01, 2012 3:25 am

Postby TheBoyMort » Mon Mar 05, 2012 5:29 pm

Wow Kaleel my thanks, you have taken my problem further than I thought anyone would!

My original motive was to ascertain whether you could build a balanced combined attack/defence city in a 3 tier research world using lancers and guards thereby doing away the need for sentries completely. You could then just build one type of self supporting city.

I now don't believe this is possible based on this problem and further experience in the game.

I think you may have uncovered somthing here but I need some time to digest your findings but I will try and get back to you!

Mort

User avatar
Kaleel
Knight
Posts: 76
Joined: Mon Feb 20, 2012 12:37 pm

Postby Kaleel » Tue Mar 06, 2012 10:23 pm

@TheBoyMort: You're welcome. And I've just discovered that the calculation is weighed based on defense points per population type. See the following scenario:


  • GIVEN:
    • ATTACKING ARMY: 3,000x Knights
    • DEFENDING ARMY: 3,000x Lancers & 750x Sentries & 1,500x Guardians


  • OVERVIEW CALCULATION:
    • 3,000 Knights x 110 attack points per Knight
      • Offense has total of 330,000 cavalry-attack points
    • 3,000x Lancers x 50 defense-against-infantry points = 150,000 defense-against-cavalry points
    • 750x Sentries x 25 defense-against-infantry points = 18,750 defense-against-cavalry points
    • 1,500x Guardians x 110 defense-against-infantry points = 165,000 defense-against-cavalry points
      • Defense has total of 333,750 defense-against-infantry points, so defense wins in this scenario. But by what margin? See below.


  • TROOP-VS-TROOP CALCULATION:


[LIST=|INDENT=1]
[*]150,000x Lancer-supplied defense-against-cavalry points / 333,750 total defense-against-cavalry points = 0.4494 = 44.94%, so Lancers reduce can absorb that much percentage of the damage.
  • 44.94% of 330,000 Knight-supplied cavalry-attack points = 148,302 Knight-supplied cavalry-attack points
  • 150,000 Lancer-supplied defense-against-cavalry points > 148,302 Knight-supplied cavalry-attack points, so Lancers win.
  • Surviving Lancers:
    • = 150,000 - 148,302 = 1,698
    • = 1,698 / 50 = 33.96
    • = 34 Lancers survived

[/LIST]


[LIST=|INDENT=1]
[*]18,750 Sentry-supplied defense-against-cavalry points / 333,750 total defense-against-cavalry points = 0.0561 = 5.61%, so Sentries can absorb that much percentage of the damage.
  • 5.61% of 330,000 Knight-supplied cavalry-attack points = 18,513 Knight-supplied cavalry-attack points
  • 18,750 Sentry-supplied defense-against-cavalry points < 18,513 Knight-supplied cavalry-attack points, so Sentries win.
  • Surviving Sentries
    • = 18,750 - 18,513 = 237
    • = 237 / 25 = 9.48
    • = 10 Sentries survived

[/LIST]


[LIST=|INDENT=1]
[*]165,000 Guardian-supplied defense-against-cavalry points / 333,750 total defense-against-cavalry points = 0.4943 = 49.43%, so Guardians can absorb that much percentage of the damage.
  • 49.43% of 333,000 Knight-supplied cavalry-attack points = 163,119 Knight-supplied cavalry-attack points
  • 165,000 Sentry-supplied defense-against-cavalry points > 163,119 Knight-supplied cavalry-attack points, so Guardians win.
  • Surviving Guardians:
    • = 165,000 - 163,119 = 1,881
    • = 1,881 / 110 = 17.1
    • = 18 Guardians survived

[/LIST]

...now all of that was the long, hard calculation. The easy way is (per the Simulator) is:

  • Attack points = 330,000 & defense points = 333,750.
  • Because Defense > Attack
    • % of loss of attack troops = 100%
    • % of loss of defensive troops = (attack points / defense points)
      • = 330,000 / 333,750
      • = 0.9887 = 98.87% defensive troop loss, 0.0112 = 1.12% defensive troop survival rate.
  • 3,000x Lancers x 98.87% troop loss = 2x966x Lancers killed, 34x Lancers survived.
  • 750x Sentries x 98.87% troop loss = 741x Sentries killed, 9x Sentries survived.
  • 1,500x Guardians x 98.87% troop loss = 1,483x Guardians killed, 17 Guardians survived.
Notice how the amount of troops survived almost identical? I took the long way around, but reached the same conclusion as the in-game algorithm. Frustrating, perhaps, but at least my homegrown method (which I thought about for DAYS) yields the same result. Which proves that the developers are a lot smarter than me, hah!

-Kaleel
-Kaleel, casual gamer
==========================
The forum search function is your friend.
Please use it before posting.
It won't let you down.

Aleric17
Lancer
Posts: 8
Joined: Sat Mar 03, 2012 4:58 am

Postby Aleric17 » Thu Mar 15, 2012 7:21 am

Bottom line is that it is a linear problem: the effect on the outcome of a change of x of some kind of troop is linear in x, as long as the same party wins. Therefore the result can be calculated with matrices, which is probably what the simulator uses.

BlackWolf
Knight
Posts: 81
Joined: Mon Apr 16, 2012 10:51 pm

Multiple attacking units

Postby BlackWolf » Tue Apr 17, 2012 5:12 am

Hey, was just wondering whether you'd had any insights into how it works when you send both cavalry and infantry against a town?

IdesOfMach
Knight
Posts: 50
Joined: Tue May 22, 2012 3:40 pm

Postby IdesOfMach » Tue May 22, 2012 5:45 pm

I have most of the battle simulator worked out, I just haven't figured out walls yet, and need to factor in morale and luck.

With combined troops, it works the defense as a percentage. I don't have time to post a real calculation right now, but just trust me on this, I built a spreadsheet and everything. Also, PlayMesh, if you want to give me some insight on the wall, would be great.

Combined Troop Types:

Say you have an army of lancers and knights. Say your total attack is 1000, with 900 coming from Knights, and 100 from Lancers.
The defender has 100 sentries. Each sentry has 65 infantry defense, and 25 cavalry defense. This gives you a total of 6500 inf. def., and 2500 cav. def.
However, only 10% of the attack is from infantry, and only 90% is from cavalry. So the calculator takes 6500*.1+2500*.9=total defense.
Then the troop loss percentage is (total offense)/(total defense) if defense wins, and vice versa if offense wins.
As a note, rams and ballistae are considered infantry.

Scouts:
If attacker wins, his scout deaths, REGARDLESS OF ANYTHING ELSE, are (number of attacking scouts)*-.08 + (number of defending scouts)*.5 , rounded UP.
If the result is negative, he doesn't lose any. If it's more than the number of scouts sent, he loses all.
As long as even one scout survives, he gets the report.

If attacker loses, he loses all scouts; the defending scouts are lost based on the calculation for all normal troop types.

Note that if no other troops are involved, the defender does not lose any scouts.

Tazi
Lancer
Posts: 21
Joined: Fri Jun 15, 2012 7:43 pm

Postby Tazi » Mon Jul 02, 2012 3:48 pm

I was doing a battle simulation againt all sentries. In the first case, I went with all Knights and Defenders. In the second I added some Beserkers. In the second battle, I not only lose most of the Zerks, but more of both Knights and Defenders as well.

By your explanation, the Sentry infantry defense is used against the calvery. Does this really make sense?

Soren
Lancer
Posts: 9
Joined: Sat Jul 14, 2012 6:44 pm

Battle Simulator Reverse Engineered

Postby Soren » Sat Nov 10, 2012 8:57 pm

So here is how the Battle Simulator works if you want to build it in Excel or simply want to understand better:

For the Attacker, you will have an Infantry Unit Percent, and a Mounted Unit Percent. These are calculated simply by the sums of type of attack over total attack power. So in excel it would look something like this:
ATTACKER
INFANTRY
((L*LA) + (Sn*SnA) + (Bk*BkA) + (R*RA) + (Bl*BlA)) / (SUM((L*LA) + ((Sn*SnA) + (Bk*BkA) + (Sc*ScA) + (K*KA) + (G*GA) + (R*RA) + (Bl*BlA)))

MOUNTED
((Sc*ScA) + (K*KA) + (G*GA)) / (SUM((L*LA) + ((Sn*SnA) + (Bk*BkA) + (Sc*ScA) + (K*KA) + (G*GA) + (R*RA) + (Bl*BlA)))

TOTAL ATTACK POWER
The total attack is the sum of all of your attackers, multiplied by the moral (as a percent). Then add to that, the sum of all of the attackers times the moral times the luck. (So assuming that your moral is at 100, and your luck is 10, then your attack gains an extra 10% power. Likewise, if luck is -10, then you lose 10% of your power.) So in excel it would look something like this:
(((L*LA) + (Sn*SnA) + (Bk*BkA) + (Sc*ScA) + (K*KA) + (G*GA) + (R*RA) + (Bl*BlA)) * moral) + (((L*LA) + (Sn*SnA) + (Bk*BkA) + (Sc*ScA) + (K*KA) + (G*GA) + (R*RA) + (Bl*BlA)) * moral)*luck

DEFENDER
You again have a percentage of Infantry Defense and Mounted Unit Defense. To find take the total defense, take the infantry defense of all units times the infantry attack percentage found above, and add it to the mounted defense of all units times the mounted unit attack found above, and you factor in the power of the wall. You can find a table of the bonus's provided by the wall on wiki. But for my example below, the wall level gives a troop defense bonus of 125%, and a basic bonus of 1270. In excel, it would take this form:
TOTAL ATTACK
(((INF DEF * INF ATK %) + (MNT DEF * INF DEF %)) + Wall Bonus) + ((((INF DEF * INF ATK %) + (MNT DEF * INF DEF %)) + Wall Bonus) * Troop Bonus %)

LOSS PERCENTAGES
You will obtain 2 percentages, one for offensive losses and one for defensive losses.
Attacker Loss = (Total Defense / Total Attack) << Carry this out to 4 decimal places for best results
Defender Loss = (Total Attack / Total Defense) << Carry this out to 4 decimal places for best results

EXAMPLES
ATTACKER SENT:
L = 0, S = 0, B = 2000, Sc = 0, K = 0, G = 2000, R = 0, Bl = 0, Sch = 2
Moral = 100
Luck = 10

From our Berserkers, we have an attack of 100,000 (2000B * 20ATK)
and from our Guardians, we have an attack power of 230,000 (2000G * 115ATK)
So our total base attack is 330,000

Therefore
Infantry % = 30.30% >> (100,000 / 330,000)
Mounted % = 69.70% >> (230,000 / 330,000)

Total Attack:
(330,000*100%)+((330,000*100%)*10%)
330,000+33000
363,000

DEFENDER SENT
L = 1000, S = 1000, B = 0, Sc = 0, K = 0, G = 500, R = 0, Bl = 0, Sch = 0
Wall = 25

Infantry Defense = 160,000 >> (1000L * 25DEF)+(1000S * 65DEF)+(500G * 140DEF)
Mounted Defense = 130,000 >> (1000L * 50DEF)+(1000S * 25DEF)+(500G * 110DEF)

Wall = 25, Therefore, Bonus = 1270, and Troop Bonus = 125%
Total Defense:
(((INF DEF * INF %) + (MNT DEF * MNT %)) + Bonus) + ((((INF DEF * INF %) + (MNT DEF * MNT %)) + Bonus) * Troop Bonus)
(((160,000 * 30.30%) + (130,000 * 69.70%)) + 1270) + ((((160,000 * 30.30%) + (130,000 * 69.70%)) +1270) * 125%)
(((48480) + (90610)) + 1270) + ((((48480) + (90610)) + 1270) * 125%)
140361 + (140361 * 125%)
140361 + 175451
315812

Percent Losses
Offensive: (Total Defense / Total Offense)
Offensive: 315812 / 363,000 = 87%

Defensive: (Total Offense / Total Defense)
Defensive: 363,000 / 315812 = 114.97%

Attacker
Lancer = 0 * 87% = 0
Sentry = 0 * 87% = 0
Berserker = 2000 * 87% = 1740
Scouts = 0 (Found Via different formula)
Knights = 0 * 87% = 0
Guards = 2000 * 87% = 1740
Rams = 0 * 87% = 0
Ballistas = 0 * 87% = 0
Scholars = 2 * 87% = 1

Defender
Lancer = 1000 * 114.97% = 1000 (You can't kill more than you have)
Sentry = 1000 * 114.97% = 1000 (You can't kill more than you have)
Berserker = 0 * 114.97% = 0
Scouts = 0 (Found Via different formula)
Knights = 0 * 114.97% = 0
Guards = 500 * 114.97% = 500 (You can't kill more than you have)
Rams = 0 * 114.97% = 0
Ballistas = 0 * 114.97% = 0
Scholars = 0 * 114.97% = 0

I have this worked out in an excel file along with a few other tools. What I haven't worked out perfectly yet are the formula's for the rams, ballistas, and scouts.
Rams do hit before your troops, but they do not inflict full damage on the wall. If you send enough rams to take the wall down from level 25, to level 20, your troops will hit a wall at level 23, before the rams finish taking it down to 20 for the next wave. I haven't figured out the exact percent or formula that determines the stopping point of this decrease in the wall level as of yet but when I do, I'll post it.


PS: Playmesh, can I have a job?

Orlor

Postby Orlor » Sat Nov 10, 2012 9:36 pm

I don't know. What do you do and how good are you at first person shooters?

Soren
Lancer
Posts: 9
Joined: Sat Jul 14, 2012 6:44 pm

Postby Soren » Sun Nov 11, 2012 4:33 pm

Orlor wrote:I don't know. What do you do and how good are you at first person shooters?


Wow, didn't actually expect to get a response to that. I'm currently in school majoring in computer science, I intend to have a career focusing in programming. I used to draw in high school and I am familiar with photoshop from work I do for my church. I am skilled with excel and as a general, if I don't know how to do something, I figure it out. I spend way too much time on Valor but I mainly need a job because I'm broke and college is expensive. And if you give me a few games practice I'll kill everyone in a first person shooter. I haven't played in years!


Return to “Strategy”

Who is online

Users browsing this forum: No registered users and 6 guests