↓
iaen.es Devlog Leer en español

Gotic · 3 min read

A cow to milk and bees that need flowers: my farm's barn mod in Godot

Lucera gives milk every 5 minutes and, with affection, sometimes two bottles. The hives only make honey if at least three plots are planted. A small mod that hooks into the farm without changing it.

#farming#animals#mods#audio#testing

A cow to milk and bees that need flowers: my farm's barn mod in Godot

The Granja del Roble already had a field and chickens, but two more animals were left on the idea list: a cow and some bees. The establo (barn) mod adds Lucera, a white cow with black patches who grazes in a paddock west of the house, and two beehives next to the field.

R (USAR, "use", on mobile) next to Lucera milks her, once every 5 minutes. In between you can pet her (every 2 minutes), and affection counts: at full affection, half the time she gives two bottles. The hives give a jar of honey every 6 minutes, up to three per hive, but only if at least three plots are planted: bees need flowers. Milk and honey sell in the shipping box (30 and 45 coins), go into three new cooking recipes (flan, milk with honey and pancakes) and into the villagers' likes and requests.

Two wooden beehives next to the farm field, with the scarecrow, the well and the house behind
The two hives by the field: without three planted plots, no honey

How it's built

The barn requires the farm and leans on it without changing it. It stores milk and honey in the farm's items, so the shipping box, the cooking mod and the villagers all see them without knowing the barn exists. The bees only look at the state of the plots:

func planted() -> int:
	var count := 0
	for plot in farm.plots:
		if plot["state"] == "planted":
			count += 1
	return count


func bees_busy() -> bool:
	return planted() >= FLOWERS

The cow's affection is one line:

var bottles := 2 if rng.randf() < love * DOUBLE_PER_LOVE else 1

With 10 points of affection at 0.05 each, that's 50 %. Measured with a fixed seed: 107 double bottles out of 200 milkings.

Lucera has no physics. She picks a spot in the paddock, ambles over, lowers her head to graze for a while and picks another. Staying inside is a rule, not a fence: in a 300 s simulation she never left. The bees are nine per hive in a MultiMesh and are only visible within 45 m.

One decision: the barn runs on game time and doesn't advance while the app is closed. The farm does grow watered crops while you're away; the cow and bees don't.

What went wrong

  • The moo came out at −11.5 dBFS, far louder than every other sound. Lowered to −16.6 like the rest. I caught it by measuring, not by ear: nobody has listened to it yet.
  • "Milking without waiting" survived as a mutation. The test always milked through the button, which already checks the wait, so removing the check inside broke nothing. There's now a direct test.
  • I wrote down a number without measuring it. Twice I put a figure in the PLAN that the test didn't actually measure, because it only checked a range, and the cow's double bottles were one of them. The rule that went into the lessons: if a test checks a range, have it print the value so you can quote it.

The other mutations, honey without flowers and a cow leaving the paddock, failed straight away. With the barn, the suite reached 1,112 passing checks, and the cow and hives were checked with and without culling.

Still unverified

Not tested on a phone. The moo and the buzzing haven't been listened to. The timings (5 minutes for milk, 6 for honey) come from arithmetic, not players. And neither the cow nor the bees have physics.

More from Gotic →