'; ?> format($this->troops + $this->siege + $this->spies + $this->scouts + $this->walls); } public function getTroops() { return $this->format($this->troops); } public function getSiege() { return $this->format($this->siege); } public function getSpies() { return $this->format($this->spies); } public function getScouts() { return $this->format($this->scouts); } public function getWalls() { return $this->format($this->walls); } private function format($number) { $number = (string)round($number, 3); $pos = strpos($number, "."); if ($pos === false) { $number .= ".000"; } else { while ($pos + 3 >= strlen($number)) { $number .= "0"; } } return $number; } public function setSpies() { if ($this->spyLevel > 14) { $this->spyLevel = 14; } $this->spies = (1 + $this->spyResearchBonus / 100) * self::$bonuses[$this->race]["Spy"] * ($this->spyRegs + floor($this->spyRegs / 3)) * $this->spyLevel * 0.55; } function setScouts() { if ($this->scoutLevel > 14) { $this->scoutLevel = 14; } $this->scouts = (1 + $this->spyResearchBonus / 100) * ($this->scoutRegs + floor($this->scoutRegs / 3)) * $this->scoutLevel * 0.4; } function setWalls() { $this->walls = (1 + $this->wallResearchBonus / 100) * 0.025 * self::$bonuses[$this->race]["Defense"] * self::$defenseStrength[$this->wallLevel][1] + $this->wallLevel * $this->wallLevel * 10; } function setTroops() { $regs = $this->troopRegs; // Siege if ($this->hasSiege && $this->siegeLevel > 0) { // Each siege level adds a maintenance point, and troops need 1 per $engineers = floor($regs / ($this->siegeLevel + 1)); $regs -= $engineers; $this->siege = ($engineers + floor($engineers / 3)) * 6 + ($regs + floor($regs / 3)) * self::$siegeStrength[$this->race] / 6.0 * 0.02 * (1 + $this->siegeResearchBonus / 100); } // Merc counts $mercs = floor($regs / 3); $levelThreeMercs = ceil($mercs * self::$mercModifiers[$this->mercModifier][0]); $levelTwoMercs = $mercs - $levelThreeMercs; // Troop rank $this->troops = ($regs + $levelThreeMercs) * 8 + $levelTwoMercs * 5; $this->troops += (($regs + $levelThreeMercs) * self::$troopStrength[$this->race][3][0] + $levelTwoMercs * self::$troopStrength[$this->race][2][0]) * 0.02 * (1 + $this->tacticsBonus / 100) * (1 + $this->experienceBonus / 100) * (1 + $this->forgeBonus / 100); $this->troops += (($regs + $levelThreeMercs) * self::$troopStrength[$this->race][3][1] + $levelTwoMercs * self::$troopStrength[$this->race][2][1]) * 0.02 * (1 + $this->medicineBonus / 100) * (1 + $this->experienceBonus / 100) * (1 + $this->armouryBonus / 100); } public static $races = array("Human", "Dwarf", "Elf", "Orc", "Troll", "Gnoll"); public static $bonuses = array ( "Human" => array("Spy" => 1.15, "Defense" => 1.05), "Dwarf" => array("Spy" => 0.85, "Defense" => 1.1), "Elf" => array("Spy" => 1.1, "Defense" => 0.9), "Orc" => array("Spy" => 0.9, "Defense" => 0.9), "Troll" => array("Spy" => 0.9, "Defense" => 1.05), "Gnoll" => array("Spy" => 1.05, "Defense" => 1) ); // Strength for offensive + defensive public static $siegeStrength = array( "Human" => 200.0, "Dwarf" => 210.0, "Elf" => 200.0, "Orc" => 200.0, "Troll" => 260.0, "Gnoll" => 230.0 ); // Base strength only since here no rounding difference will occur public static $defenseStrength = array( 0 => array("Tent", 0), 1 => array("Armed Camp", 5000), 2 => array("Stockade", 10000), 3 => array("Fort", 15000), 4 => array("Walled Fort", 20000), 5 => array("Walled Fort with Moat", 25000), 6 => array("Keep", 30000), 7 => array("Walled Keep", 35000), 8 => array("Walled Keep with Moat", 40000), 9 => array("Castle", 45000), 10 => array("Walled Castle", 50000), 11 => array("Walled Castle With Moat", 55000), 12 => array("Fortress", 60000), 13 => array("Walled Fortress", 65000), 14 => array("Walled Fortress with Moat", 70000), 15 => array("Citadel", 75000), 16 => array("Citadel 1", 80000), 17 => array("Citadel 2", 85000), 18 => array("Citadel 3", 90000), 19 => array("Citadel 4", 95000), 20 => array("Citadel 5", 100000), 21 => array("Citadel 6", 105000), 22 => array("Citadel 7", 110000), 23 => array("Citadel 8", 115000), 24 => array("Citadel 9", 120000), 25 => array("Citadel 10", 125000), 26 => array("Citadel 11", 130000), 27 => array("Citadel 12", 135000), 28 => array("Citadel 13", 140000), 29 => array("Citadel 14", 145000), 30 => array("Citadel 15", 150000), 31 => array("Citadel 16", 155000), 32 => array("Citadel 17", 160000), 32 => array("Citadel 17", 160000), 33 => array("Citadel 18", 165000), 34 => array("Citadel 19", 170000), 35 => array("Citadel 20", 175000), 36 => array("Citadel 21", 180000), 37 => array("Citadel 22", 185000), 38 => array("Citadel 23", 190000), 39 => array("Citadel 24", 195000), 40 => array("Citadel 25", 200000) ); public static $mercModifiers = array ( 0 => array(0, "None"), 1 => array(0.25, "One quarter"), 2 => array(0.5, "Half"), 3 => array(0.75, "Three quarters"), 4 => array(1, "All") ); // Strength of strongest troops for level 2 and 3, attack/health public static $troopStrength = array ( "Human" => array(2 => array(24, 19), 3 => array(50, 41)), "Dwarf" => array(2 => array(21, 22), 3 => array(48, 48)), "Elf" => array(2 => array(25, 19), 3 => array(56, 42)), "Orc" => array(2 => array(26, 21), 3 => array(55, 45)), "Troll" => array(2 => array(19, 20), 3 => array(44, 44)), "Gnoll" => array(2 => array(24, 18), 3 => array(54, 40)) ); } $compareCount = 1; $action = "Reset"; $result = false; if (isset($_POST["compareCount"])) { $compareCount = intval($_POST["compareCount"]); } if (isset($_POST["calculate"])) { $action = $_POST["calculate"]; $result = true; } if ($action == "Reset") { $compareCount = 1; $rank[0] = new Rank(""); $result = false; } else { $rank = array($compareCount); $fields = array("troopRegs", "mercModifier", "tacticsBonus", "medicineBonus", "experienceBonus", "forgeBonus", "armouryBonus", "siegeLevel", "siegeResearchBonus", "spyLevel", "spyRegs", "spyResearchBonus", "scoutLevel", "scoutRegs", "wallLevel", "wallResearchBonus"); for ($i = 0; $i < $compareCount; $i++) { $rank[$i] = new Rank(); $rank[$i]->race = $_POST["race"][$i]; $rank[$i]->hasSiege = isset($_POST["hasSiege"][$i]); foreach ($fields as $field) { $rank[$i]->$field = intval($_POST[$field][$i]); } $rank[$i]->setTroops(); $rank[$i]->setSpies(); $rank[$i]->setScouts(); $rank[$i]->setWalls(); } } if ($action == "Add") { $rank[] = new Rank(); $rank[$compareCount]->setTroops(); $rank[$compareCount]->setSpies(); $rank[$compareCount]->setScouts(); $rank[$compareCount]->setWalls(); $compareCount++; } elseif ($action == "Add Copy") { $rank[] = clone $rank[0]; $compareCount++; } ?> Rank calculator

Rank calculator By IronFist

This calculator is created for V14 of War of Empires. It automatically calculates the max siege you can use for your troops according to level and gets the appropriate ranking points. Bonuses are factored in for race, experience, research and forge/armoury.

IMPORTANT: siege is optimized for levels above 12, using Trebuchets only. If you have a siege factory of level 12 and below, then it's likely you can get slightly better results using Armoured Siege Towers and Ballistae.

I accept no responsibility for the results this calculator gives you. However, you can inspect my code in the plain text version. There are currently no known issues.

Result
getTroops()?>
getSiege()?>
getSpies()?>
getScouts()?>
getWalls()?>
getTotals()?>
Compare to
getTroops()?>
getSiege()?>
getSpies()?>
getScouts()?>
getWalls()?>
getTotals()?>
Race details
Compare to
Troop details (including engineers)
Compare to
hasSiege?"checked='checked'":"")?> />
hasSiege?"checked='checked'":"")?> />
Spies and scouts
Compare to
Walls
Compare to