FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
 
 
How is calculated the health?

 
Post new topic   Reply to topic    raceconflicts.com Forum Index -> Suggestion Report
View previous topic :: View next topic  
Author Message
kaoptro



Joined: 15 May 2005
Posts: 88

PostPosted: Sun Aug 23, 2009 11:31 am    Post subject: How is calculated the health? Reply with quote

I wonder how is calculated the health percentage...

I have build all necessary buildings, and employed some workers.All percentages are above 70% but the health indicator is 51.
Religion is fine ...
After some researches..I see I have one extra building for each '
specialty'.

Why the health is not 71% as my minimum percentage???
Back to top
View user's profile Send private message
bashar
Forum Admin


Joined: 18 Feb 2005
Posts: 1443
Location: Bucharest

PostPosted: Sun Aug 23, 2009 5:01 pm    Post subject: Reply with quote

well this is because the efficiency indicator of the buildings is only indicating that the building is operating at full power(it cannot do better).
However even with efficiency at 100% at all buildings health will not be 100 only maybe for low level or people with low population.
This is becouse bonuses are applied or handicaps like the year handicap, surplus population.
I will post tomorrow the full formula to better understand this.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
bashar
Forum Admin


Joined: 18 Feb 2005
Posts: 1443
Location: Bucharest

PostPosted: Sun Aug 23, 2009 10:39 pm    Post subject: Reply with quote

$health->population_covered=round(($max_houses+$cladiri->cladiri_array[extra_houses])*100+$army->nr_mercenaries()*0.2+$army->nr_spies()*0.2);

this is the formula:
in translation all your medical facilities can support population that lives in houses but without the housing research, only 20% of your mercenaries and spies.
What is extra will bring your health down no matter if you have 100% efficiency at every building. If you train mercenaries or spies your health will go down.
Housing research will bring more people to your houses but will increase overcrowding and that's why health will drop.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
dorazdu



Joined: 17 May 2005
Posts: 193
Location: Bucuresti

PostPosted: Wed Sep 09, 2009 7:48 am    Post subject: Reply with quote

@ bashar -=> another way
---------------------------------------------------------------------------
$civ_structure = array(
'p0' => array('name' => 'miner', 'health_need' =>5),
'p1' => array('name' => 'farmer', 'health_need' =>7),
'p2' => array('name' => 'scientist', 'health_need' =>10),
'p3' => array('name' => 'worker_aqueduct', 'health_need' =>9),
'p4' => array('name' => 'barber', 'health_need' =>2),
'p5' => array('name' => 'worker_hole', 'health_need' =>4),
'p6' => array('name' => 'priest', 'health_need' =>7),
'p7' => array('name' => 'fireman', 'health_need' =>17),
'civ_spec' =>7,
);
$mil_structure= array(
'm0' => array('name' => 'archer', 'health_need' =>17),
'm1' => array('name' => 'longbowman', 'health_need' =>19),
'm2' => array('name' => 'championr', 'health_need' =>31),
'm3' => array('name' => 'antipy', 'health_need' =>23),
'm4' => array('name' => 'crossbow_man', 'health_need' =>19),
'm5' => array('name' => 'knight', 'health_need' =>37),
'mil_spec' => 6
);
for($i=0;$i<$civ_structure['civ_spec'];$++){
$health_civ_need += $user[$civ_structure['p'.$i]['name']]*$civ_structure['p'.$i]['health_need'];
};
for($i=0;$i<$mil_structure['mil_spec'];$++){
$health_mil_need += $user[$mil_structure['m'.$i]['name']]*$mil_structure['m'.$i]['health_need'];
};
$bonuses = 1 + $year_bonus + $month_bonus + $religion_bonus;
$prod_health = $bonuses*($barbers*$prod_health_barber + $worker_aqueduct*$prod_health_worker_aqueduct);
$health = 100*$prod_health/($health_civ_need + $health_mil_need);
_________________
n
=> ?
(k!)
k=0
Back to top
View user's profile Send private message Visit poster's website
bashar
Forum Admin


Joined: 18 Feb 2005
Posts: 1443
Location: Bucharest

PostPosted: Wed Sep 09, 2009 10:43 am    Post subject: Reply with quote

I like you way better because is more realistic and you can have more control over things and can have the same results with overcrowding like the old formula.

Some things we have to take care of:
Now all citizens are treated as having the same needs.
With the new formula citizens have different needs and so different things like having only full staff in health and only mercenaries or extreme things like that can be possible negative issues, we have to balance things properly.


Edited a little to better fit into how things are in raceconflicts
$health_need_array = array(
'0' => array('name' => 'farmer' =>5),
'1' => array('name' => 'health_worker', 'health_need' =>4),
'2' => array('name' => 'scientist', 'health_need' =>9),
'3' => array('name' => 'religion_worker', 'health_need' =>8),
'4' => array('name' => 'engineer_worker', 'health_need' =>6),
'5' => array('name' => 'unemployed', 'health_need' =>10),
'6' => array('name' => 'soldier', 'health_need' =>5),
'7' => array('name' => 'mercenary', 'health_need' =>8),
'8' => array('name' => 'spy', 'health_need' =>5),
);

$health_need=0;
for($i=0; $i<sizeof($health_need_array), $i++)
$health_need+=$nr_of_workers[$i]*$health_need_array[$i][health_need];

$bonuses = 1 + $year_bonus + $month_bonus + $religion_bonus;
$prod_health = $bonuses*($barbers*$prod_health_barber + $worker_aqueduct*$prod_health_worker_aqueduct);
$health = 100*$prod_health/$health_need;


Last edited by bashar on Wed Sep 09, 2009 11:16 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
bashar
Forum Admin


Joined: 18 Feb 2005
Posts: 1443
Location: Bucharest

PostPosted: Wed Sep 09, 2009 11:09 am    Post subject: Reply with quote

Also we have to do some computations cause $prod_health will always be fixed limited indirectly by your level so we have a constant.

In a normal city with full staff in all departments, no unemployment , some antispies for defence and no mercs $prod_health=$health_needed right?

Everything extra will couse variations in health like having 500k mercs like some people Smile.
We have to think at this issues.


It's important to think in advance for the exploits but in the same time not to limit creativity to much.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
dorazdu



Joined: 17 May 2005
Posts: 193
Location: Bucuresti

PostPosted: Wed Sep 09, 2009 3:29 pm    Post subject: Reply with quote

I don`t now how deep you want to go.
Simply, i don`t think is right to calculate heath counting houses or other buildings, so i come with other formula.

I think you got the idea.

Now, i don`t understand why $prod_health will be always fixed limited by level?
in theory i can hire all my population in healt departament.

if i have $prod_health ~= $health_needed means i have balanced needs with services.

but it is one bug in my formula, the players will exagerate and will hire people in 1 health building, depending wich worker generate much hp.

--------------------------------------------------------------------------------------------------
$bonuses = 1 + $year_bonus + $month_bonus + $religion_bonus;

$health_need_array = array(
'0' => array('name' => 'farmer', 'health_need' => array(5, 5, 5, 5, 5, 3)),
'1' => array('name' => 'health_worker', 'health_need' => array(1, 3, 2, 5, 5, 3)),
'2' => array('name' => 'scientist', 'health_need' => array(2, 7, 9, 5, 5, 3)),
'3' => array('name' => 'religion_worker', 'health_need' => array(5, 5, 5, 5, 5, 3)),
'4' => array('name' => 'engineer_worker', 'health_need' => array(5, 5, 5, 5, 5, 3)),
'5' => array('name' => 'unemployed', 'health_need' => array(5, 5, 5, 5, 5, 3)),
'6' => array('name' => 'soldier', 'health_need' => array(5, 5, 5, 5, 5, 3)),
'7' => array('name' => 'mercenary', 'health_need' => array(5, 5, 5, 5, 5, 3)),
'8' => array('name' => 'spy', 'health_need' => array(5, 5, 5, 5, 5, 3)),
);
$health_need = array(0, 0, 0, 0, 0, 0);
for($i=0; $i<sizeof($health_need_array), $i++){
for($j=0;$j<6;$j++){
// you have 6 types of heath specialization; j count this type;
$health_need[$j] += $nr_of_workers[$i]*$health_need_array[$i]['health_need'][$j];
};
};

for($j=0;$j<6;$j++){
$prod_health[$j] = $bonuses*$specialists*($prod_health_worker + $upg_prod_worker);
$health[$j] = $prod_health[$j]/$health_need[$j];
};

a) $city_health = average value;
b) $city_health = max($health);
c) $city_health = min($health);
---------------------------------------------------------------------------------------------------
about limitation.
you may play with number (needs) and result this:

a) 500k mercenary needs a few aqueduct and garbage holes, fontains but more hospitals
b) more scientist needs hospital, barbers, fontains but less garbage hall.
c) miner, engineer, farmers more aqueduct and fontains.
--------------------------------------------------------------------------------------------------
_________________
n
=> ?
(k!)
k=0
Back to top
View user's profile Send private message Visit poster's website
bashar
Forum Admin


Joined: 18 Feb 2005
Posts: 1443
Location: Bucharest

PostPosted: Wed Sep 09, 2009 4:20 pm    Post subject: Reply with quote

Quote:

Now, i don`t understand why $prod_health will be always fixed limited by level?
in theory i can hire all my population in healt departament.


How it is now even though you can have as many as you want only a certain number are efficient and that number is limited by level.

You noticed that at buildings you have built: x/y and x can be > than y like 101/100.
Means that even if you have 101 buildings only 100 are necessary and only 100 will work the other is like a spare building. If you have people in that spare building they won't count. That is how health is working in this moment. So that is why $prod_health will be always fixed because you can hire all your people at health but only a certain number depending on your level will work. The others are spare employees if your kingdom grows to already be prepared for growth.

I am on a run so i will re-post after i read again your post more carefully.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
bashar
Forum Admin


Joined: 18 Feb 2005
Posts: 1443
Location: Bucharest

PostPosted: Thu Sep 10, 2009 9:19 am    Post subject: Reply with quote

Brilliant mode for health calculation is the second one.
Probably the correct way to go cause is the most realistic and forces people to have a few from each type of health buildings. Not to have only hospitals with no fountains and things like that.

Your concern of the bug that people could use only a certain type of building depending on what worker they want to use is easily busted by the fact that you can uniform the needs of people like in the first formula but adapted for each building type like in the second formula.

I mean different people to have different needs but keep the same proportions for everybody on how many fountains or hospitals they need.
A worker will need each type of health building, but an engineer will need more of each type of building but same proportions like the worker.

This way you can achieve the results from the first formula but in the same time make people build each type of health building couse having 100 people at fountains and 100 at aqueducts it will not be the same like having 200 people at fountains and 0 at aqueducts like it is now.
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    raceconflicts.com Forum Index -> Suggestion Report All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2001, 2005 phpBB Group