Falsebound Archive
4 Secrets & leftovers 4.7

The Lock-on! label

Bases on the map can be given cannons. When a cannon fires at a unit, the map draws a short label over the target: ダメージ! (Damage!). The same code has a second label, ロックオン! (Lock-on!), for the step before the shot. That one never appears.

Both labels are Japanese in the USA release, drawn with a sheet of kana glyphs that the USA version still carries. The pictures below are the glyph sheet as stored and two mock-ups of the labels put together from it; they are not screenshots.

Where
main.dol, strings 0x800EB398 and 0x800EB3A8; HUD map_draw_hud, cannon sequence map_cannon_update
Lock-on! shown in the retail game
Never; the flag it needs is never set at the right moment
Damage! shown in the retail game
Yes, for about one second after a cannon hit
Text
ロックオン! (Lock-on!) and ダメージ! (Damage!), in Japanese in the USA release
Pictures
The glyph sheet is the game’s own; the two labels are mock-ups
Files
3 · 29 KB

How cannons work

A base has slots for facilities. Two of them are cannons:

Facility Fires at
Anti-Air Cannon Flying units
Anti-Ground Cannon Walking units

Swimming units are never hit. A cannon fires at enemy units within a range of 250, or 500 when the base’s other slot holds a Watch Tower, plus the target’s own radius. Bases of either side fire at units of the other. A cannon fires only when its reload timer is 0. A cannon the map starts with is ready at once, one a mission script adds waits a random 0 to 3,599 frames, one the player buys waits 0x708 (1,800) frames, and after a shot the timer starts again at 0xE10 (3,600) frames, two minutes of play.

The shot plays a short cannon cut-scene, then waits 30 frames, then hits. Each of the unit’s three monsters loses 70% of its maximum HP, down to no lower than 0. If all three reach 0, the unit is removed from the map. Damage! is drawn over the target during the wait and on the hit frame, about one second in all.

Why Lock-on! never shows

The cannon runs as a sequence of four states. The label code draws Lock-on! in state 0 and Damage! in state 2, but only while a map flag (bit 13) is set. That flag is set in the same step that moves the sequence from state 0 to state 1, and it is cleared together with the sequence’s other flag when state 3 ends. So the flag is never set while the cannon is in state 0, and Lock-on! has no frame on which it could be drawn. In state 2 the flag is set, and Damage! draws.

Perhaps Lock-on! was meant to show while the cannon aims, before the cut-scene. The code does not say why the flag is set one step too late.

Evidence

The strings sit at 0x800EB398 (ロックオン!) and 0x800EB3A8 (ダメージ!) in a constant pool of the map code; every character is one of the glyph cells of icon.tpl image 6 in SYSTEM.MRG. The HUD function map_draw_hud (rebuilt byte for byte) tests bit 13 of the map flags; with the cannon state at 0 it draws the first string, with the state at 2 the second, through map_draw_marker, which draws only while bit 0 of the target unit’s flags is set.

The cannon sequence map_cannon_update was read in its machine code. The only instruction that sets bit 13 is at 0x80016E54, at the end of state 0, in the same step that sets the state to 1. The only one that clears it is at 0x80017094, at the end of state 3. Otherwise the flags are only cleared when a map starts. The 70% is the constant 0.7 at 0x800EB358; state 1 starts the cut-scene through evt_start.