[Freeciv-Dev] Re: Patch: generalized granary size (PR#635)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Thue <thue@xxxxxxx> wrote:
You didn't change food_weighting() ...
I would have if I had understood exactly how it worked. I didn't, but I
went ahead anyway because I expect the AI to handle the default behavior
only. Of course, I also expect to fix it once I have learned how.
Obviously (?) it is a try to take the diminishing value of food as a
city grows into account.
Duh.
So in a city of size 1 food has a value of 57, while in a city of size 2,
whire it takes 50% more to make the city grow, the value of
food is only 2/3*57 = 38. Then you would expect the next value to be 3/4*38
= 28.5, but apperantly the author of this code miscalculated
(used 2/3 instead)...
It doesn't sound unreasonable. Of course, one can't be sure without some
kind of testing or unless the author suddenly reappears.
The correct (and commented) code would be
int food_weighting(int city_size)
{
int foodbox_width = (city_size+1);
/* Assuming size 4 cities (with foodbox_width 5) to be the norm for
which FOOD_WEIGHTING is balanced */
return (5/foodbox_width) * FOOD_WEIGHTING;
}
which could of course the hardcoded as before, perhaps in a soft way
which created the table the first time it was run.
It would have helped a lot if it had been written like that in the first
place...
Mike
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635),
mike_jing <=
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635), Thue, 2000/12/24
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635), Andrew McGuinness, 2000/12/24
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635), Andrew McGuinness, 2000/12/24
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635), Thue, 2000/12/25
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635), Andrew McGuinness, 2000/12/25
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635), Thue, 2000/12/26
- [Freeciv-Dev] Re: Patch: generalized granary size (PR#635), Tony Stuckey, 2000/12/27
|
|