The system simple: the more deverse food you eat, the more health.
Absolutly simply to understand for newbies, and no too much space needed in the wiki to get informed all the players.
Encourages commerce
Specially of currently useless goods, as some nourishing foods that are ignored since there is another more efficient food yoy can eat.
Anthony, I really don't see why you states that this system would force to full up the inventory with foods.
A (complex?) example just intended for you understanding your error (never for explaining anything to the players):
A char has three kind of food in the inventory, 500 g. potatos (200 g. needed in a day), 200 g. smoked meat (22 g. needed), 44 gr. rice (166 gr. needed). And it's time to lunch.
Potatos: 200/3 = 133
Smoked meat: 22/3 = 7
Rice: 166/3 = 55
As there is no enough rice (only a 80%), a 80% of each food type would bee eaten, and the loop would be repeated, stateing that now 80% of the hunger has been satisfied (so only 20% is needed):
Potatos: 200/2*20% = 100*20% = 20.
Smoked meat: 22/2*20% = 11*20% = 2.
Finally, the char has eaten three types of food in a 80% and 2 kinds ina a 20%. Given the example of Jur, a char with 100 of current health, we have: ((120-100)*10%)*80%=1.6 plus ((105-100)*10%)*20%=0.1, total 1.7 (2 if rounded to nearest, or 1 if just floor) health points earned by that char.
Code: Select all
hunger := 1.0
begin:
foodCount := 0
for each item in inventory
..if item is foodstuff then
....foodcount := foodcount+1
maxFeedRatio := 1.0
for each item in inventory
..if item is foodstuff then
....feedRatio := foodCount * itemAmount / maxDailyAmountFor(item)
....if feedRatio <maxFeedRatio> 0.0 and foodCount > 0 then
..jump begin
else
..loses (1.0 - hunger) * hungerStandardPoints
I think hungerStandardPoint is 5, the percentage substracted from health when the char eats nothing in a day.
And I don't care about code complexity concerning the players: they shouldn't deal with that issues. A chess machine could be quite complex, but the player doesn't have to understant artificial neural networks, self-organizing maps or even the minimax problem, isn't it?
Concerning the code, the only requirement is to be fast, and the only goal is to facilitate playability (easy interface plus diversity plus fun) and realism (again diversity and fun for those realists).
