Forums

Age 74 discussion

Open Archived Bolle opened this discussion on

Acwder -


// Calcs based on owned land + incoming
$iAcres = $arrBuild[LAND]
+ $arrBuild[LAND_T1] + $arrBuild[LAND_T2]
+ $arrBuild[LAND_T3] + $arrBuild[LAND_T4];

// Wood Elf Race Bonus
$iWeBonus = 1;
if ($strRace == “Wood Elf”)
$iWeBonus = 0.9;

$money_cost = max(floor(($iAcres * 9) * $iWeBonus - $iMarkets * 12), 800);

// Dense Forest Penalty
$arrSpells = $objUser->get_spells();
if ($arrSpells[FOREST] > 0)
$money_cost = floor($money_cost * 1.15);

// Cost in citz
$cost_citizens = max(floor($iAcres * 0.08), 20);

// Cost in basic soldiers
$cost_basics = max(floor($iAcres * 0.04), 10);


Those were the rules back then, also that nazgul couldn't explore and max explore was 25% except for classic which at the time ran the same code with an exception thrown in (this was before Max started working on the code) which was that max explore was 1000 acres during protection.

Bolle -

and you started at 250 [;)]

Acwder -

yes indeed.

Acwder -

Btw since Martel unlicensed his part of the code last year I'm gonna post the old code I got from him back in 2008 on github.

Bolle -

Do you have the construction formula from back then? I need to take the construction costs and lost income into account when calculating costs [8)]

Acwder -

( http://alliancesatwar.com/forums/game/671676/unlicensing-aatw/ incase someone missed that post)

https://github.com/BrorHolm/Orkfia-2008

Sure the building cost back then was


function build_cost()
{
global $build_cost, $local_build, $wood_cost;
$objSrcUser = &$GLOBALS[“objSrcUser”];
$local_build = $objSrcUser->get_builds();
$build_cost = floor(($local_build['land'] * 3.5) - ($local_build['markets'] * 50));
$modify = $local_build['land'] * 0.05;
if ($local_build['markets'] > 0)
{
$modify2 = $local_build['markets'] * 0.5;
}
else
{
$modify2 = 0;
}
$wood_cost = round((50 + $modify) - ($modify2));
if ($wood_cost <= (50 + ($local_build['land'] * 0.01)))
{
$wood_cost = round(50 + ($local_build['land'] * 0.01));
}
// Buildings cannot be lower then 400cr for anyone and cannot be higher
// then 15000 for anyone.
if ($build_cost < 400)
$build_cost = 400;
elseif ($build_cost > 15000)
$build_cost = 15000;
// Saved these below for historical reasons.. old formula on building costs
// Build cost = (Land * 2) - (markets*3.5)
}


Source: https://github.com/BrorHolm/Orkfia-2008/blob/master/inc/functions/build.php

Bolle -

That's interesting.

Cuz assuming 25% explores and building markets, exploring, then rebuilding mines, each market costs at least 4k in lost income & construction costs.

edit: nvm, worth it from 1333 acres onwards.

[WOME] Istari -

God banks were cool. I remember getting them post 2000 acres and feeling like I had finally done something with my life. Sorry for the interruption, but this made me nostalgic.
Page 1 2 3 4 5 6