• Hello, Guest!
    Are you passionate about Tribal Wars 2 and like to help your fellow players?
    We currently have open positions for Forum Moderators!

    >> Join the Tribal Wars 2 Team now! <<
    We would love to hear from you!

Unraveling some myths regarding the battle engine

  • Thread starter DeletedUser2754
  • Start date

DeletedUser1323

Guest
On a separate note, I notice that there is not a variable within the spreadsheet to account for the +attack for the tribe attack skill, am I missing it?
 

DeletedUser2754

Guest
On a separate note, I notice that there is not a variable within the spreadsheet to account for the +attack for the tribe attack skill, am I missing it?
Weapon Mastery. You can choose the level from 1 to 5 ;)

How you know that it is not the case? I know that goofy inexpiable things happen all the time with the game. I am telling you what I know of the original code when it was under discussion for release from beta into the first 1.0 version.
What I know is that there are some goofy things happening from time to time. Not on 90% of the time. And the explanation you are giving seems to me that would have an effect of that magnitude which doesn't seem to be happening in the game. On a normal circumstances a noble still dies when about 50% of the troops die. On specific and rare situations a noble might outlive on worse scenarios. But they are rare cases, not 90% of the cases. That's what I was saying.

Yes, of course the wall was at 0. Otherwise the ram would be killed by the wall.

Personal note: I am not trying to put you down or make you look bad, I guess we are just having a hard time communicating with each other
I don't take this things personally. I'm just continuing the discussion because I want to figure out the bits still unknown. I'm also not trying to bash you down. I don't care if I'm right or you are right, as long as in the end we get it right :) No worries, as long as the discussion is productive... that's all it matters :)
 
Last edited by a staff member:

DeletedUser1323

Guest
Weapon Mastery. You can choose the level from 1 to 5 ;)
very well I was looking for tribe skill, not the actual name of it, which is why I framed the question the way I did.

What I know is that there are some goofy things happening from time to time. Not on 90% of the time. And the explanation you are giving seems to me that would have an effect of that magnitude which doesn't seem to be happening in the game. On a normal circumstances a noble still dies when about 50% of the troops die. On specific and rare situations a noble might outlive on worse scenarios. But they are rare cases, not 90% of the cases. That's what I was saying.

Yes, of course the wall was at 0. Otherwise the ram would be killed by the wall.

The noble must survive through all the group rounds, so if there happens to be a case where the archer group can kill the infantry group but the overall attack groups "win" the fight, then the noble in that case would die. The issue is you do not know if there is going to be more than X units that have > 30 attack power remaining by the grouping until the final round. The X is a % of the total units for that group. This why most players have a lead nuke ahead of a several full noble nukes or train.

I don't take this things personally. I'm just continuing the discussion because I want to figure out the bits still unknown. I'm also not trying to bash you down. I don't care if I'm right or you are right, as long as in the end we get it right :) No worries, as long as the discussion is productive... that's all it matters :)
Sure, now that is out of the way lets try to solve this part, but personally I did not think it was worth the time to solve the nobles due to the pure randomness of the % of units of the group to get to the final round.
 

DeletedUser3586

Guest
The wall bonus is considered in all rounds, except the pre-round, because one of the functions of the pre-round is to calculate the wall bonus. And its value is part of the "DefModifier" you can see in the formulas. All defense bonus combined make the DefModifier, the same way, all offensive bonus combined make the OffModifier.

I guess I forgot to add the following two formulas:
DefModifier = Faith * (1 + WallBonus)
OffModifier = (Faith * Morale * (1 + Luck)) + (WeaponMasteryLevel * 2%) + Officer

Regarding one unit type attacks, that means that 100% of the offensive army is of a specific type, thus 100% of the defense will be allocated to defend in that mini-battle. So, the rule still applies.

Thank you for explanation ^_^
 

DeletedUser1323

Guest
@hibakusha, one other element that maybe nice to add is the obp/dbp calculations for when the battle is complete. Now I also thought of how is obp/dbp count affected by the medic raising units. Since they technically get killed, but are "saved" that would be another component missing from the overall calcs.
 

DeletedUser1891

Guest
noble.png
 

DeletedUser1323

Guest
Interesting michael, I think as a hypothesis that since the remaining 19 axes did not have enough attack strength to get past the level 20 wall the noble smacked into it. That was common back on EN6. So I am beginning to think that the remaining defensive value is what is the base calculation now. When they added the Iron Wall back in the Balancing update II is where the noble deaths really started to spike again from odd cases like this one.
 

DeletedUser2754

Guest
That is not odd at all.

The math:
Wall 20, so the village has a base defense of 1420.
DefModifier = Faith * (1 + WallBonus) = 100% *(1+100%) = 200%
OffModifier = (Faith * Morale * (1 + Luck)) + (WeaponMasteryLevel * 2%) + Officer = 100%*66%*(1+14%)+(5*2%)+0% =~ 85.24%
Offense strength: (∑UnitType*OffStrength)*OffModifier >>> 50*45*85.24% =~ 1918
Defense strength for round 1: (∑UnitType*OffStrength)*DefModifier+BaseDefense = 0*200%+1420 = 1420
KILL ratio: (MiniBattleLooserStrength/MiniBattleWinnerStrength)^(1/2)/(MiniBattleWinnerStrength/MiniBattleLooserStrength)
So, (1420/1918)^(1/2)(2250/1918)=63.71% of the axes get killed.
50 * 63.71% = 32 units killed (probably a rounding issue somewhere or something to do with morale because when you see 66% it can be anything between 65.50% to 66.49%)

Since the percentage of units killed is bigger than 50%, I would expect for the noble to get killed as well.
 

DeletedUser2754

Guest
@hibakusha, one other element that maybe nice to add is the obp/dbp calculations for when the battle is complete. Now I also thought of how is obp/dbp count affected by the medic raising units. Since they technically get killed, but are "saved" that would be another component missing from the overall calcs.

Personally, I don't need the OBP/DBP thing, but I can add that. I just have to know how they are calculated but there was a site that had this working properly. I just need to remember which one...

The medic is also easy to add. It's a simple percentage thing.
 

DeletedUser1323

Guest
That is not odd at all.

The math:
Wall 20, so the village has a base defense of 1420.
DefModifier = Faith * (1 + WallBonus) = 100% *(1+100%) = 200%
OffModifier = (Faith * Morale * (1 + Luck)) + (WeaponMasteryLevel * 2%) + Officer = 100%*66%*(1+14%)+(5*2%)+0% =~ 85.24%
Offense strength: (∑UnitType*OffStrength)*OffModifier >>> 50*45*85.24% =~ 1918
Defense strength for round 1: (∑UnitType*OffStrength)*DefModifier+BaseDefense = 0*200%+1420 = 1420
KILL ratio: (MiniBattleLooserStrength/MiniBattleWinnerStrength)^(1/2)/(MiniBattleWinnerStrength/MiniBattleLooserStrength)
So, (1420/1918)^(1/2)(2250/1918)=63.71% of the axes get killed.
50 * 63.71% = 32 units killed (probably a rounding issue somewhere or something to do with morale because when you see 66% it can be anything between 65.50% to 66.49%)

Since the percentage of units killed is bigger than 50%, I would expect for the noble to get killed as well.

Yes, it is odd, because before the Balancing update II, if DefendingPopulationInMilitary == 0 then the noble auto survived and failed to calculate for the wall on worlds EN6 through EN10 where it was adjusted in an update to prepare for the balancing updates.

This is all well and good, but the issue is with these formulas is that you are not accounting for the separate calculation for the noble itself... Let me expand that by conditionals from what is here. The example is going to add the iron wall... I will describe in pseudo C what the original code was. DefendingPopulationInMilitary (DPIM)


If WallBonus == 0 && DefendingPopulationInMilitary == 0 && IronWall == 0 result: all units survive, including noble if there is X escorted units with it totaling greater than 35 attack, except ram which triggers escapes the WallBonus loop.

else if WallBonus > 0 && DefendingPopulationInMilitary == 0 && IronWall >= 0 result:wall defense is calculated in the case above 1420 && 0 DPIM && 0 (using zero since we do not know what level iron wall is at since there are no rams to trigger it) Run loop for noble survival... SurvivingUnits = Off Modifier (85.24) and OffensiveStrength (19*45*85.24)= 728.892 check to see if able to pass wall defense 728.892 > 1420 ... this case it is not therefore noble died.

else WallBonus >= 0 && DefendingPopulationInMilitary >= 0 && IronWall >=0 same as above but check to determine if any group could have killed the noble based on 'winning a minibattle' group. (Large loop which I am not going to type out) but basic logic is done the same as above but for each group.
 
Last edited by a staff member:

DeletedUser2754

Guest
Ok! I run some tests against myself on nobles that were needing to be "relocated".

REP(+10)_46_0.png REP(+09)_46_0.png REP(+04)_49_0.png REP(-08)_58_1.png REP(-13)_63_1.png REP(-14)_64_0.png

I think this set of reports, at least for me, prove that the survival of the noble is not calculated by a simple formula. The only way I can think of where the noble survived in that last report and was killed in the two before that one is if there is a chance factor that can't be reproduced by a mathematical formula.

Also in the meanwhile I also figured out the troop reserve thing of the noble. The noble is not like the other units who fight in the largest group. The noble always fights with the infantry. Whenever you send the noble without any infantry escort, then it will happen what I described previously of the noble not fighting and the defense troops assigned for him will move to the next round...

(The modifiers in the reports are church level 2, morale 100%, weapon mastery level 5 against no faith and no wall.)
 

DeletedUser

Guest
a noble has a chance of dying if 50% escorts are killed, just like pally i believe.

Maybe the noble doesn't batle at all? i.e like when a noble dies alone
 

DeletedUser1323

Guest
Ok! I run some tests against myself on nobles that were needing to be "relocated".

I think this set of reports, at least for me, prove that the survival of the noble is not calculated by a simple formula. The only way I can think of where the noble survived in that last report and was killed in the two before that one is if there is a chance factor that can't be reproduced by a mathematical formula.

Also in the meanwhile I also figured out the troop reserve thing of the noble. The noble is not like the other units who fight in the largest group. The noble always fights with the infantry. Whenever you send the noble without any infantry escort, then it will happen what I described previously of the noble not fighting and the defense troops assigned for him will move to the next round...

(The modifiers in the reports are church level 2, morale 100%, weapon mastery level 5 against no faith and no wall.)
The last report is a case of a rounded range for survival, i calculated that it should have died with a final modifier of 47.52 Now the rounding could be in play here as anything lower than 45% is instant death. The infantry has ALWAYS escorted the noble, but other players use other troops to get past the power modifier I was stating earlier, thus dropping it into other groups when it should get killed instantly. After the balancing update 2 I am no longer certain that even the paladin rule can be applied to nobles. To go back to what sephyrx stated earlier there can be a set of ranges for different IF calculations to throw us off, so we cannot predict exactly when/how nobles will survive as it will become mundane.
 

DeletedUser2754

Guest
The last report is a case of a rounded range for survival, i calculated that it should have died with a final modifier of 47.52 Now the rounding could be in play here as anything lower than 45% is instant death.
If that was true then the two previous reports wouldn't get the noble killed...

The infantry has ALWAYS escorted the noble, but other players use other troops to get past the power modifier I was stating earlier, thus dropping it into other groups when it should get killed instantly. After the balancing update 2 I am no longer certain that even the paladin rule can be applied to nobles.
Nope, the noble is always escorted by infantry, but if there is no infantry, the defensive troops the noble should fight are reserved and go on to the next round and the noble doesn't enter the fight ever. How it is calculated his chance of survival? I don't know. But he stays out of the fight until his survival rate is calculated and that's why you get reports with surviving units for both sides.

Anyway, they said this would be fixed in the next update so there could be some changes introduced on how the nobles are working. They might simply kill the surviving units of the army that lost the battle and keep everything as it was (lazy approach to the problem, since the glitch would still be there, just no one would see it), or they might allow for the noble to be escorted by the largest group as all other special units, which would make a lot more sense... or they might get even more creative... hahaha
 

DeletedUser2754

Guest
3 more reports that show what I was saying.
On the first two luck -1 and -6 the noble gets killed and on the last one with luck -13 the noble gets through. All other factors are constant. same wall, same faith, and so on.
-1.png -6.png -13.png

I'm not saying you're wrong jehzir. Because there is a mathematical equation at play here and a chance factor. You might be right on your "if/else" on the equation part. But whenever this equation gives you a value that goes beyond 50% for the noble to get killed I think it triggers a chance factor, where sometimes the noble gets through when it shouldn't. And the higher the likeness of the noble getting killed, the lower the chances of this chance factor to take effect. Like hawk.eye described:
70% troops survive(secure nobleman) > Random Chance of dying in each of rounds for noble > 20% troops survive(nobleman is dead)


Regarding your "if/else" formulas. It's hard to test them fully when I believe that the results we see whenever a noble survives, are behind a chance factor. But this is my opinion based on the tests I've done.

1. First the IronWall doesn't make any sense to use as a variable to calculate the likeness of a noble getting killed. The only thing the IronWall does is avoiding that the wall goes below a certain level. Of course if sent an army that should have razed the wall and part of the wall is still there, then the noble is still subject to its effect but that's it. So I will disregard any if IronWall thing.

2. jehzir: If WallBonus == 0 && DefendingPopulationInMilitary == 0 && IronWall == 0 result: all units survive, including noble if there is X escorted units with it totaling greater than 35 attack, except ram which triggers escapes the WallBonus loop.
1 spear has 10 of atack power, doesn't trigger any ram loop and still gets the job done. So I would say that if this was ever a reality it is not anymore.

3. jehzir: else if WallBonus > 0 && DefendingPopulationInMilitary == 0 && IronWall >= 0 result:wall defense is calculated in the case above 1420 && 0 DPIM && 0 (using zero since we do not know what level iron wall is at since there are no rams to trigger it) Run loop for noble survival... SurvivingUnits = Off Modifier (85.24) and OffensiveStrength (19*45*85.24)= 728.892 check to see if able to pass wall defense 728.892 > 1420 ... this case it is not therefore noble died.
I have 6 different reports of 15LC+1NOBLE. Faith 110% and weapon mastery against faith 110% and wall 20. Only thing that varies is the luck: 13%=-6LC; 11%=-6LC; 5%=7LC; 2%=-7LC; -10%=-8LC; -14%=-9LC. On all the noble always survived. According to your proposed method I should need at least 11LC surviving to get past the wall. In none of the circumstances that happens, yet the noble always survives. Was I lucky 6 times in a row?

4. jehzir: else WallBonus >= 0 && DefendingPopulationInMilitary >= 0 && IronWall >=0 same as above but check to determine if any group could have killed the noble based on 'winning a minibattle' group. (Large loop which I am not going to type out) but basic logic is done the same as above but for each group.
This one you will have to type out for me to fully understand. But I have my doubts regarding the previous one, so extrapolating the mechanics from there make me doubt this one as well.
 
Last edited by a staff member:

DeletedUser

Guest
The pally would have died on that last report I posted. The noble did not...
I believe they are checked independently, sadly there is no way of telling if the noble and pally will die do to it being RNG. You can just say they have a chance of dying.

Additionally, there was a glitch, believe it is fixed now, where the noble had a really small chance of surviving even if everyone else died, which is quite funny as it than applied the loyalty round XD
 
it dosen't make much sense for a programmer to make an if/else condition that gives back randomized results ,it usually is used to narrow the entries and give you one solid result out of them.
and the issue here is under similar consequences results vary. so either there is a factor that we dont see or there is a huge percentage of luck involved in the formula for nobleman.

i like to mention 2 things as well.

first , to me it seems like developers as well as other have a problem introducing battle simulator to this game. now that can have a lot of reasons but one of them can be the dependency of formula on "luck" in some cases otherwise it takes a few days really to create a working battle sim when you have a solid line of formula for your battle system , right now you can find forwarded "battle sim" suggestions older than 8-9 in the forums.

second , in all these years inno proved to like involvement of luck in some key features. like in the-west.net we had a key feature called duels and a good percentage of it was actually luck. in tw1 luck was one of the first things introduced to the battle system and this version inherited it as well. so inno like having a little luck factor here and there... it dosent wow me to find out noble survival is randomized in some scenarios.

well that also makes sense in real stuff too. you have a important person escorted by an army , half of army dies and its probable that you find your guy between dead bodies as well.
 
Last edited:
Top