I was hoping someone else would ask and get an explanation so I wouldnt look dumb but no1 else has yet so here goes:
I dont understand this stuff:
Could someone explain it in terms of 100/500/1000 men, something like that? I dont get ceil or pow either. Its been many years since i used a programming language and that was just pascal.
pow() takes two paramaters and then makes an exponential function out of them. The first paramater is the base and the second is the power. ceil() just rounds up to the highest whole number if it's not already a whole number.
Edit: Just realized you wanted a run through. But I'm too lazy to do it for multiple situation so I'll just do it with 100 troops and and regular Plains.
troop upkeep for heroes:
ceil((pow($troops, 1.03) * 2.5 - 100)/24) = ceil((pow(100, 1.03) * 2.5 - 100)/24) = 8
troop upkeep for locations:
ceil((pow($troops, 1.02) * 1 - 100)/24) = ceil((pow(100, 1.02) * 1 - 100)/24) = 1
faraway goods bonus: (using a distace percentage of 50%)
round(pow($distance_percent*100, 1.26)-80) = round(pow(0.5 * 100, 1.26)-80) = 58
movement speed:
$speed = (0.25 * ($terrain['speed']/100)) = (0.25 * (100/100)) = 0.25
$troop_influence = (pow($troops, $terrain['troops_influence']/200)/100) = (pow(100, 100/200)/100) = 0.1
$speed = $speed * (1-$troop_influence) = 0.25 * (1-0.1) = 0.225
terrain look distance: (using 100 pixel distance and looking into hill terrain)
(distance_in_pixel/(($my_geo['look_out']/100)*($other_geo['look_in']/100)) < 100 ) = (100/1.4 < 100) = true (so basically you can see 100 pixels into hills from the plains)
Btw, math gets really easy when you use 100s for pretty much all the values
Also, why bother putting in the *1 in the troop upkeep for locations formula?