↓
iaen.es Devlog Leer en español

Gotic · 3 min read

A gathering quest in Godot: Lía's breeze flowers and the flower crown

Gotic's first quest: pick three violet flowers for an infusion that makes you run 25% faster, and on the second delivery earn a flower crown you can see on your head.

#quests#mods#testing#characters

A gathering quest in Godot: Lía's breeze flowers and the flower crown

At the green stall in Brumacosta, Lía the herbalist gives you the island's very first errand: she needs three bunches of flowers for an infusion, and she'll mark where to find them. Press ACEPTAR: TRES FLORES DE BRISA (accept: three breeze flowers) and six clumps of violet flowers appear around the village, each with its own map marker. Three are enough. When you hand them in, Lía brews an infusion that makes you run 25% faster for 60 seconds. On the second delivery she gives you a flower crown, and from then on you can ask for another infusion whenever the last one has worn off.

It's a small quest, but it was the first one, and its pattern repeats all over the island afterwards: accept, gather, deliver, the map marker, the quest log line and a reward you can wear.

How it's built

The six flowers are meshes built in code: five stems, each with five violet petals and a golden centre, and a "Flor de brisa" label above. They only show up once you've accepted the errand. Picking one has several conditions:

func pick(index: int) -> void:
	if world.is_blocked() or not accepted or completed >= 2 or picked.has(index) or index < 0 or index >= flowers.size():
		return
	if world.player.global_position.distance_to(flowers[index].global_position) > 3.0 or world.player.mover != null:
		return

In plain words: no picking with a window or the map open, no picking the same flower twice, you must be within 3 m, and you can't be riding anything. That last one stops you from collecting them while flying over on the broom. Every condition has its own test.

Speed isn't just added on. The player has a dictionary of factors, one per mod (speed_factors["encargos"] = 1.25), so the infusion stacks with the flock mod's boots without either mod overwriting the other. The infusion timer pauses while a menu is open.

The errands depend on the village. Turn off Brumacosta and they go with it; turn the errands on and the village comes back.

What went wrong

  • The crown doesn't belong to the mod. It hangs from the player's head bone, and the speed lives on the player too, so freeing the mod's node when you disabled it didn't remove either of them. teardown has to clean up by hand everything the mod has left on other nodes. This became one of the project's general lessons, and a shared test now checks it for every mod.
  • Malformed saves. A saved game with repeated flowers, or more flowers than possible, could leave the errand impossible to finish. Now, when loading, flowers are validated one by one, and if the total doesn't match the deliveries, the errand starts over. A test loads a save like that on purpose.
  • The second finger. On a phone, Godot only emulates the mouse for the first finger. With your thumb on the joystick, a regular button wouldn't respond to your other finger. A test presses USAR (use) with the second finger next to a flower and checks it's picked exactly once.

In the screenshot, Lía's window already shows the friendship hearts from the neighbours mod, which came later.

Still unverified

The round it was born in finished with 429 passing checks, but nobody has picked these flowers with real fingers on a phone, and I don't know whether six flowers around the village feel like a nice stroll or a chore. This screenshot cost 480 draw calls on PC.

More from Gotic →