↓
iaen.es Devlog Leer en español

Gotic · 3 min read

Cooking with what you fish and farm: 14 recipes that grant buffs in Godot 4

A cauldron on every village bonfire: what you catch and grow becomes dishes that make you run, swim, jump or fly faster for a while. And the cooking mod doesn't know any other mod exists.

#mods#design#UI#godot#testing

Cooking with what you fish and farm: 14 recipes that grant buffs in Godot 4

After fishing and farming I had baskets full of sardines, radishes and eggs that weren't good for anything. Cooking brings them together: every village bonfire has a cauldron on a tripod, and R (USAR, "use", on mobile) opens the recipe book.

The recipe book open at the Brumacosta bonfire, with six dishes ready to cook
The recipe book: what you can cook now at the top, every recipe and what's missing below

At the top are the dishes you can make with what you're carrying; below, all fourteen recipes with what each needs and what it gives. Cooking takes 2.5 s of stirring by the fire. Walk more than 3 m away and it stays half-done, with nothing used up. The dish is eaten straight away and gives a boost for 2 to 5 minutes, from +10 to +50 %: running, swimming, jumping or flying the broom faster. A fisherman's soup (a sea bass and a carrot) lets you swim 50 % faster for 3 minutes.

How it's built

The rule I set was that the cooking mod doesn't know any mod. Not the villages, not fishing, not the farm. Every second it looks through the active mods for any that has a village with a bonfire:

var village = module.get("village")
if village is Village and is_instance_valid(village) and village.fire != null and is_instance_valid(village.fire):
	found[id] = village.fire

If a village is switched off, its cauldron goes; if it's switched back on, it returns. Ingredients work the same way: it asks any mod that has ingredients() and take_ingredient(). Fishing now keeps your catch in a basket (up to 20 of each species) and the farm offers crops and eggs. When the barn arrived later, milk and honey just showed up, and with them three more recipes: flan, milk with honey and pancakes.

Recipes are data, one per line:

"sopa_marinera": {"name": "Sopa marinera", "needs": {"lubina": 1, "zanahoria": 1}, "effects": {"swim": 1.5}, "seconds": 180.0},

The effects needed new bonuses on the player: besides running, swim_factors, jump_factors and fly_factors, which the broom also reads. Measured with the engine's physics: swimming with +50 %, 3.89 m in 1 s (without a dish, 2.6 at most); jumping with +25 %, 2.08 m (without, 1.34); flying with +30 %, 18.2 m/s (without, 14). Races accept dishes just like Lía's herbal infusions: with a stew, the sky rings go faster.

What went wrong

  • With eleven recipes, the cook buttons ended up at the bottom of the list and you had to scroll to find them. A screenshot showed it. They're now at the top, with a test.
  • The swimming mutation survived. I removed the swim bonus and the test still passed, because it also applied the running bonus and the player moved faster anyway. The test had to change until that mutation failed.
  • I wrote numbers down without measuring them. The speeds with dishes were one of the two times I put a figure in the PLAN that the test didn't measure: it only checked a range. The rule that went into the lessons: if a test checks a range, have it print the value.

Other mutations seen failing: jumping and flying without the bonus, effects ticking with the menu open, cauldrons that don't go when a village is switched off, cooking from too far away. With cooking, the suite reached 1,036 passing checks.

Still unverified

Not tested on a phone. The cauldron's crackle was generated and measured, but nobody has listened to it.

More from Gotic →