TWLan Forum

Full Version: expand a building
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does someone know how to calculate the needed time to expand a building if I have the $factor, $world_speed, $build_level and $build (the dbname of a build, just to find out the buildings expand time);

Let's just supose I have a function as is follows:
PHP Code:
function get_build_time($build,$level,$world_speed) {
    
$time = array('main' => 30'barracks' => 20'stable' => 40 etc); //this is the default time for a building
    
$factor 0.3;
    ..................
    
formula how to calculate the needed time for a building to be expanded in dslan without using the function from include.inc.php
    
..................
    return 
$seconds;


PHP Code:
return ceil($time[$build]*(percentage($level,maxstage($build))*$level/6)); //i used this, as a formula to get similar values like dslan ones 

Does anyone know the formula ? I don't need the function word by word, i can make it on my own, just the formula so I can develop it.
Why you write an own function you can use the Function get_time($main_stage,$dbname,$stage) (part of the builds class, saved in $cl_builds)
PHP Code:
return round(($building_time pow($stage_factor$building_stage)) / pow($main_factor$main_stage)); 
steffengy, it's not about dslan what i'm working at, so I can't use the functions from there Big Grin
then it must be in the section "Sonstige Fragen" when its not about TWLan / DSLan
~moved