Telegraphing an attack means announcing it before it can hurt you, for the same length of time every time. The charger below warns 0.55 s before it charges: enough to read the attack and answer it.
- warning (550 ms): 0.55 s warning, In time: the charge comes out n ms later. t pressed: 0.05 s, Too late: with T, the charge came out at 50 ms.
- with T (50 ms): 0.55 s warning, In time: almost the whole warning is still ahead. t pressed: 0.05 s, The charge comes out in n ms: too short to read.
Telegraphing: a pose, a ring and a sound
The warning is a state of its own with a fixed length, and the attack only comes out when it ends. The body leans back and shakes, a ring closes over its head to tell you when, and a rising chirp covers the enemy you aren't looking at. Because the length never changes, after two or three tries your hands know it. Press T and the charger is exactly as fast, but it stops telling you what it's about to do.
How to implement a telegraphed attack
- Make the warning its own state, with a fixed length per attack. The attack only comes out when that timer runs out.
- Drive every cue from that one timer: the ring closes with the fraction of the warning that has passed, and the sound plays the moment the state starts.
- Pick the attack's direction when the warning starts and never correct it. An attack that steers after the tell punishes the player for reading it.
- Give the enemy poise during the warning. If a hit could interrupt it, mashing would cancel every attack.
The code in Godot 4
## TELEGRAFIAR: entra en el estado de aviso. El ataque sale cuando `windup_done()`.
func telegraph(attack: StringName, seconds: float) -> void:
attack_name = attack
set_state(&"windup")
windup_total = seconds if Lab.on(&"telegraph") else minf(seconds, 0.05)
Combat.enemy_telegraphed.emit(self, attack, windup_total)
func windup_done() -> bool:
return state == &"windup" and state_time >= windup_total func _think(delta: float) -> void:
match state:
&"patrol":
patrol(walk_speed, delta)
if is_on_floor() and sees_target():
face_target()
telegraph(&"embestida", windup_time)
&"windup":
if windup_done():
contact.attack = &"embestida"
release(&"charge") face_target() runs once, before telegraph(), so the charge goes exactly where the warning pointed.
Quick answers
How long should an attack telegraph be?
Regular enemies here warn for 0.45 s (the hopper) to 0.65 s (the drone). The shortest real warning is the boss's hammer in phase two, 0.425 s. At 0.05 s it stops being a warning.
Does telegraphing make a game too easy?
No. The warning gives you the information, and you still have to act on it in time. To make a fight harder, shorten the warning or chain attacks: the boss cuts every warning by 15% in its second phase.
Should a telegraph have a sound?
Yes. The pose and the ring only work if you're looking at the enemy. A chirp the moment the warning starts makes an attack from the edge of the screen readable too.
Discussion
Comments are hosted on GitHub Discussions — sign in with GitHub to reply.