Feed cows, hens, pigs, sheep, goats and horses the right feed. Every animal burns energy at 70·M0.75 kcal/day (Kleiber) times its activity, production and cold factors — keep each one between starving and stuffed and the farm earns.
Tap an animal (with no feed selected, or tap the selected feed chip again) to inspect it.
Compares the code with closed-form results: log-log slope, a hand-computed reference value, an energy-balance integration and an analytic starvation curve.
The science
Kleiber's law. Basal metabolic rate scales with body mass to the power ¾, not 1:
BMR = 70 · M^0.75 [kcal/day, M in kg]
A 600 kg cow needs ~8,500 kcal/day at rest, a 2 kg hen ~118 kcal/day. Per kilogram the hen burns ~7× more, so small animals must eat more often relative to their size.
Daily requirement (metabolisable energy, ME):
R = BMR · kspecies · production · (1 + 0.02 · max(0, 5 − T))
kspecies (1.5–2.0) lumps activity and maintenance above basal; production (1.0–2.0) covers milk, eggs or growth; the last factor adds 2 % per °C below a lower critical temperature of 5 °C (a simplification — real values depend on coat, wind and housing).
Feed. Each feed has an energy density (kcal ME per kg as fed) and each species uses it with a utilisation factor u (0 = refuses). Net energy per scoop = kg · ME · u. Hay is great for ruminants and horses but useless to hens; mash suits pigs and hens; silage must never be fed to horses.
Energy store. Reserve S loses R/24 kcal each hour and gains scoops. If S < 0 the animal burns body tissue at ~7,700 kcal/kg, so mass falls and (because R ∝ M0.75) the requirement falls too. Reserve above 100 % R is slowly stored as tissue at 50 % efficiency; the gut limits stuffing to ~160 % R.
Welfare & money. Animals earn (milk, eggs, wool, riding) only while their reserve stays between 35 % and 180 % R and health > 50 %. Starving (< 12 % R) lowers health; feed costs per kg.
Honest simplifications: one pooled energy store instead of rumen/gut kinetics, constant k, no protein or mineral balance, no digestive upset, feed prices and incomes are invented game values. Species masses are typical adults. Not affiliated with any farm brand; the model is educational, not veterinary advice.
Baked 3D scene. Animal and building models and baked textures come from Blender 5.2; the terrain, tree/rock/grass scatter and a baked occlusion & sun-shadow lightmap come from Unity 6; Three.js r160 runs the live part.