View Full Version: Calculator Submissions

War Of Empires > WOE Help Site > Calculator Submissions


Title: Calculator Submissions


Bhaal - October 10, 2006 03:31 PM (GMT)
This is the place to add calculator submissions such as recruiting calculators.

And here is the first calculation, the recruiting formula.

if(totalTroops+totalMercTroops>0){
troopToWorkers=(workers*1.0)/((totalTroops+totalMercTroops)*1.0);
}
if(troopToWorkers>2){
troopBonus=-2;
}
else if(troopToWorkers>1.5){
troopBonus=-1;
}
else if(troopToWorkers>1){
troopBonus=0;
}
else if(troopToWorkers>.75){
troopBonus=1;
}
else{
troopBonus=2;
}



// Set what the potential recruiting could be.
// This number is for full troop bonus and assumes
// that the walls are fully manned.
int allowableRecruiting=0;
if(walls>1){
allowableRecruiting=1+((walls-1)+(rb/4)+2);
}
else{
allowableRecruiting=1+(rb/4)+2;
}
// If the player just built walls with no troops, only allow peasants for a certain
// level of walls
while((totalTroops+totalMercTroops)<((walls-1)*(walls+walls-2))*2){
walls=walls-1;
}
if(walls<1){
walls=1;
}
int actualRecruiting=1+((walls-1)+(rb/4)+troopBonus);
if(actualRecruiting>25){
actualRecruiting=25;
}
if(actualRecruiting<1){
actualRecruiting=1;
}
int recruitRoom=(ph*DoomBuildingValues.PEASANTHOUSINGCAPACITY)-workers;
if(actualRecruiting>recruitRoom){
actualRecruiting=recruitRoom;
}
if(actualRecruiting<0){
actualRecruiting=0;
}
// Check wall strength if greater than 20 recruiting
// Is recruiting greater than 20? If so, start knocking recruiting down if the walls are damaged too much.
if(actualRecruiting>20){
int wallStrength=new Double(DoomWallValues.WALLSTRENGTH[walls]*(1+DoomRaceValues.DEFENCEBONUS[race])*(1+TechnologyValues.TECH6[tech6])).intValue();
// Is there any damage?
if(damage>0){
// Figure out how much wall is left and how much recruiting will drop
double percentWallLeft=((wallStrength-damage)*1.0)/(wallStrength*1.0);
int negativeRecruiting=0;
if(percentWallLeft>.8){
negativeRecruiting=0;
}
else if(percentWallLeft>.64){
negativeRecruiting=1;
}
else if(percentWallLeft>.48){
negativeRecruiting=2;
}
else if(percentWallLeft>.32){
negativeRecruiting=3;
}
else if(percentWallLeft>.16){
negativeRecruiting=4;
}
else{
negativeRecruiting=5;
}
// Figure out the new recruiting rate
int newRecruiting=actualRecruiting-negativeRecruiting;
// If the new recruiting rate drops recruiting below 20, the new recruiting rate is 20.
if(newRecruiting<20)
newRecruiting=20;

deathgod - October 10, 2006 09:26 PM (GMT)
" // Is recruiting greater than 20? If so, start knocking recruiting down if the walls are damaged too much. "

I think it should be wall level instead of recruit cuz a lot of ppl dun even cross the recruiting of 20...i think the wall level should be keepWM or castle (approx half of the # of walls)

Edit (Dagger): We only wanted to penalise the bigger players who tried not repairing walls as a strategy to surrender easier to castle attacks. Thus, this idea works only for recruiting >20.

" // If the new recruiting rate drops recruiting below 20, the new recruiting rate is 20.
if(newRecruiting<20)
newRecruiting=20; "

If we have wall level to decide whether wall damage will give a recruit negetaive i think we should opt out minmum 20 recruit rule to make it fair for everyone.

"Double(DoomWallValues.WALLSTRENGTH[walls]*(1+DoomRaceValues.DEFENCEBONUS[race])
*(1+TechnologyValues.TECH6[tech6])).intValue();"

I love this idea of not having race bonuses to complicate recruiting but i m not sure if we should not include tech bonuses as we need to spend for tech so ppl with greater defensive tech should be awarded in some way.

"if(percentWallLeft>.8){
negativeRecruiting=0;
}
else if(percentWallLeft>.64){
negativeRecruiting=1;
}
else if(percentWallLeft>.48){
negativeRecruiting=2;
}
else if(percentWallLeft>.32){
negativeRecruiting=3;
}
else if(percentWallLeft>.16){
negativeRecruiting=4;
}
else{
negativeRecruiting=5;"

This part doesnt make any sense to me...does it mean tht if % of wall left is more than 8 then rec -ve will be 0 and if it is more than 64 then rec -ve will be 1 :blink:

Edit (Dagger): This means that if .8 of your wall is intact, or that your wall has more than 80% standing for any defence level, then you will get your recruiting. IF between 64% and 80% of the wall is left, you get a -1 penalty for recruiting. And so on.
ALSO i think we should include # of tech done in rec...if not in rec definitely in points(rankings)

P.S. I dun really know much about coding so if i made a mistake or misunderstood something plz plz dun yell at me but explain it to me...i promise u will find me a attentive student :rolleyes:

Edit: I'll be deleting off this post soon. Please keep your comments/discussions on the game discussions forum; and leave this one to only all the formulae.

deathgod - October 10, 2006 09:42 PM (GMT)
Ranking Points =
+ (No.ofWorkers + NewRecruits)*2
+ (No.ofSlaves*0.5)
+ (Level1Troops*3) + (Level2Troops*5) + (Level3Troops*8) + Engineers*6
+ (BaseStrength+BaseHealth)*0.025
+ (SiegeOffenceStrength+SiegeDefenceStrength)*0.02
+ TroopExperience*0.02
+ (NoOfSpies*SpyBuildingLevel*0.7)*(1+(spybonus/5))
+ WallDefenceStrength*0.075
+ Recruiting*25

This is the current formulae for the ranking...
I think the main purpose of ranking should be giving details about a player...

many former GO have been using the surrender loophole to reduce the number of merc getting killed and keepin their position so ranking should be on current attack and health rather than base attack and health...

also as mentioned in my previous reply if tech is not included in recruits then it should be accounted for points for rankings...also does workers include alchemists?? if yes then why isnt university credited as production building??

Edit (Dagger): Yes, workers includes alchemists. If you want alchemist buildings (universities) to be included in prod buildings, please include all those under game discussions. We'll leave this section to formulae.

Edit (Elzud): This formula here has changed, can the new one be posted please?

Edit (Esopo - nov 12, 2006): corrected minor typo in formula.




* Hosted for free by InvisionFree