↓
iaen.es Devlog Leer en español

Gotic · 3 min read

A night festival with a rhythm dance and fireworks in Godot 4

On even nights, Brumacosta hangs up lanterns, the music starts and you dance round the bonfire to the drum. At midnight, fireworks that I had to rebuild because they weren't being drawn.

#minigames#towns#audio#bugs#godot

A night festival with a rhythm dance and fireworks in Godot 4

With day and night working, Brumacosta deserved a party. On even-numbered days, from 21:00 to 01:00, the village strings three garlands of coloured lanterns across the street, six dancers circle the bonfire and, within 70 m, the festival music replaces the usual tune. At midnight, fireworks.

By the fire, R (USAR, "use", on mobile) gets you dancing. A ring closes in over a circle and the drum sounds: press SALTAR ("jump") as it closes. There are sixteen steps. Spot-on timing is worth 2 points, close enough is 1. With 20 out of 32 the villagers give you a scarf; with 28, three rockets go up as well. The first festival is on the night of day 2, about 28 minutes of play, so the sign at the village arch tells you when it is and lets you wait for it by moving the clock forward.

How it's built

Whether there's a festival is a two-line function with no nodes, easy to test:

static func is_fiesta(day: int, hour: float) -> bool:
	return day % 2 == 0 and (hour >= FROM or hour < TO)

While you dance, the festival acts as the player's mover, like the boat or the broom: you don't walk, and moving the joystick takes you out of the dance. The music runs at 100 beats per minute and each step falls 0.6 s after the last. When you press, it looks for the closest step that hasn't been judged yet:

if nearest < 0 or gap > GOOD:
	feedback.text = "fuera de ritmo"
	return
if gap <= PERFECT:
	judged[nearest] = "perfecto"
	score += 2
	feedback.text = "¡PERFECTO!"
else:
	judged[nearest] = "bien"
	score += 1
	feedback.text = "BIEN"

PERFECT is 0.1 s and GOOD is 0.2. A step that goes by without a press is marked as a miss.

The dancers aren't the villagers: at night the village already seats them by the fire, so I added six new people. The fireworks run from 00:00 to 00:30, one rocket every 1 to 2.4 s.

A rocket bursts red over Brumacosta on a starry night
The midnight fireworks: each burst is a hand-animated MultiMesh

What went wrong

  • The fireworks didn't show up. The bursts were a one-shot CPUParticles3D (one_shot, explosiveness 1). In a separate scene they were drawn; with continuous emission, too; inside the game, no. Now each burst is a MultiMesh animated by the mod itself, with its own draw box (custom_aabb), and a test checks that box covers every last spark. The tip for next time: if something doesn't appear, check the number of objects drawn in the screenshot; if it doesn't go up, the engine isn't even trying.
  • The rhythm indicator covered the character. A screenshot showed it; it now sits to their right.
  • A test from another part of the game failed once: the terrain one that waits for loading threads, with the machine loaded down by other sessions. On its own and in the next run, fine. Before hunting for the bug in your change, check the load.

Mutations seen failing: forgetting the festival continues past midnight, scoring everything as perfect, not leaving the dance with the joystick, and the usual music not coming back. With the festival, the suite reached 1,073 passing checks.

Still unverified

Nothing on a phone: not the cost of the festival (six extra dancers) and fireworks, nor pressing SALTAR on the beat with a real finger. The music, drum and rockets were generated in code and measured, but nobody has listened to them. And the dance timing comes from arithmetic, not players.

More from Gotic →