Skip to content

129 worked example the camera in normal play

Alex Diakovsky edited this page Oct 11, 2026 · 3 revisions

129. Worked example: the camera in normal play

Question: issue #91 asked what the camera does once a vehicle is out of the base. Document 126 had found that the nearest-turret numbers are read by a camera function at 0x416480 that picks a "point of interest" (the flag, the submarine, the other player, a Drone, a turret) and seemed to steer the camera toward it. Document 90 had traced the swoop-in, but not the units of the camera's height and pitch: the port borrowed two numbers from the footage instead. Scripts and field names are in the tracing cheat sheet.

Answer, in short: the camera does not drift toward threats in the shipped game. The code to do it exists, but every vehicle type sets the drift to 0. What the camera really does is zoom out and tilt down when the vehicle drives at a steady speed, and come back to the 45-degree view when it stops. A Heli or Drone nearby tilts the view down as well. The height and pitch units are now traced through the projection, so the swoop no longer needs the footage numbers. The footage agrees with both.

Step 1: where the function really starts, and who calls it

0x416480 is the middle of a function. The bytes before it were never disassembled; DisasmForce.java 0x416420 0x416830 shows the real start:

00416420  PUSH EBP ; XOR EAX,EAX ; MOV EBP,ESP ; SUB ESP,0x28
0041643b  CMP ECX,0x1 ; JNZ ...         ; mode 1 = remove this rig (FUN_004294d0)
00416459  MOV EAX,[EBP+0x8]             ; the rig
0041645e  MOV EDI,[EAX+0x14]            ; the object it follows
00416461  MOV EDX,[EDI+0x60]            ; that vehicle's state block
00416464  MOV [EBP-0xc],EDX

So FUN_00416420(rig, view, mode) is a camera rig callback, like FUN_00416300 of document 90. Its only references are data (FindPointerRefsMulti.java 416420): 0x445780, 0x445a68, 0x445d50, 0x446038, i.e. offset +0xc8 of each of the four vehicle-type records (0x4456b8 + type * 0x2e8). Dumping the record around it shows a whole 0x60-byte rig at record +0xbc. Its priority byte (+8) is 0x40 and its callback (+0xc) is 0x416420, followed by the three easing triples at +0x3c, +0x48 and +0x54.

The vehicle's init FUN_0040b700 copies 0x140 bytes of its record (from +8) into the player's state block 0x458100 + player * 0x140, so that rig lands at state +0xb4. It then registers the rig:

0040b84f  MOV [ECX+0xc8],EBX            ; state +0xb4 rig's +0x14 = this vehicle
0040b86c  LEA EAX,[ECX+0xb4]
0040b873  CALL 0x00416060               ; insert the rig into the player's view list (0x48b618 + player * 0x24c)

How the rigs combine. FUN_00429670 inserts a rig before the first one whose priority is not higher (FUN_004160a0), so the list runs from the highest priority down. The view update FUN_00416fa0 clears the three claimed pointers (+0x14c position, +0x150 height, +0x154 pitch) and calls the rigs in that order until one returns nonzero. Each rig fills only what is still unclaimed. FUN_004161e0 gives its rigs priority 0x80. That covers the undock object's rig and the one the new vehicle makes in FUN_0040b1c0, which sets a timer: piVar2[7] = byte table 0x4452e8[type] (60, 90, 60, 180 ticks). So:

  • while the creation rig lives, it claims everything (height swoop_height, pitch 24, the template's triples) and returns 1, and the vehicle rig does not even run;
  • when its timer runs out (FUN_00416300: if (rig[7] && (rig[7] -= dt) < 1) remove), the vehicle rig FUN_00416420 runs the camera for as long as the vehicle lives.

Document 90's swoop is therefore only the first phase: the target -170 holds for the lift's rise plus 60 ticks, and then the vehicle rig takes over.

Step 2: what the vehicle rig does

Force-decompiled (ForceDecompile.java 0x416420), trimmed. veh is the followed vehicle, st its state, rec its type record:

view->+0x128 = veh->z;                                   // the followed height (rig byte +0xb = 0)
near = DAT_00443158[veh->team];                          // squared distance to the nearest Drone (0x7fffffff: none)
/* the point of interest, in order: the other flag (a Jeep, within 128); the submarine hunting this vehicle;
   the other player's vehicle within 320 (a Heli there also lowers `near`); the nearest Drone within 320;
   the nearest turret within 256 (DAT_0044e2c8 / DAT_0045ae30) -> poi, raise_height, raise_triple */
if (view->+0x14c == 0) {                                 // position not claimed yet
  view->+0x14c = &rig->+0x3c;                            // the x/y triple
  h = poi ? heading(veh, poi) : veh->heading;
  lead = poi ? st->+0x124 : rig->+0x38;                  // a FRACTION of the visible ground
  off_x = ((view->+0x120 - view->+0x118) >> 17) * fixmul(cos(h), lead);
  off_y = fixmul(-sin(h), lead) * (view->+0x124 or -view->+0x11c);
  /* clamp the offset to the point of interest; dir = -1 if it was clamped, +1 if the point does not fit */
  st->+0x114 = move_toward(st->+0x114, off_x, st->+0x11c * dt);
  st->+0x118 = move_toward(st->+0x118, off_y, st->+0x11c * dt);
  view->+0x12c = veh->x + st->+0x114;   view->+0x130 = veh->y + st->+0x118;
}
h_new = view->+0x134;  p_new = view->+0x144;             // by default the targets stay as they are
if (view->+0x90 == veh->speed) {                         // the speed has not changed
  if ((view->+0x94 += dt) > 0x1d) {                      // for 30 ticks
    if (veh->speed < 0x3334) { h_new = st->+0x128;  p_new = rec->+0x2d8; }   // still (or reversing)
    else                     { h_new = rec->+0x2cc; p_new = rec->+0x2d4; }   // driving
  }
} else view->+0x94 = 0;
view->+0x90 = veh->speed;
if (view->+0x150 == 0) {
  if (dir == 0) {
    if (view->+0x114 < st->+0x128) { view->+0x150 = &rec->+0x2c0;  view->+0x134 = st->+0x128; }   // below the rest height: rise to it
    else                           { view->+0x150 = &rig->+0x48;   view->+0x134 = h_new; }
  } else { view->+0x150 = raise_triple;  view->+0x134 = dir > 0 ? raise_height : 0; }
}
if (view->+0x154 == 0) {
  view->+0x144 = (near < 0x40000) ? 0x320000 : p_new;    // a Drone or enemy Heli within 512: pitch 50
  view->+0x154 = &rig->+0x54;
}
return 1;

FUN_0042cda0 is the squared distance in whole units (document 98), so 0x4000 = 128², 0x19000 = 320² and 0x40000 = 512². DAT_00443158 / DAT_0048c7c0 are written by the Drone code (FUN_0040a010, FUN_0040a7b0 and the code at 0x40a196/0x40a1e6), so they are the nearest Drone's squared distance and position, per team.

Step 3: the drift is switched off in the data

The lead is st->+0x124 when there is a point of interest and rig->+0x38 when there is not. Both come from the record (+0x12c and +0xf4), and both are 0 for all four types (DumpDwords.java 0x445774 32, and the same at 0x445a5c, 0x445d44, 0x44602c). Nothing writes them later. Ghidra's scan only sees code that some session disassembled, so the whole code section was swept with capstone for any operand with displacement 0x124 or 0x128. That found one reader of state +0x124 (0x416603, this function) and no writer. The other +0x124 writes are the view's own +0x124 (FUN_00416900, FUN_00416ab0, FUN_00416cb0, FUN_00416fa0). There is no absolute reference to the state block other than the init's copy.

With a lead of 0 both offsets are 0, so dir stays 0. The camera always follows the vehicle itself, and the raise heights rec->+0x2dc / +0x2e0 / 150 and the triples at 0x448ef0 / 0x448f00 / 0x448f10 (which document 126 took for "rigs") are never used. The one part of the point-of-interest code that has an effect is near: a Drone, or the other player's Heli, within 512 units makes the pitch target 50.

Step 4: the units, through the projection

FUN_0041afb0 puts each object into view space: (x - view->+0x18, y - view->+0x1c, z) turned by the view's matrix (+0x3c..+0x5c, FUN_0041e770), then subtracts the view's height +0x20 from the depth. FUN_00413d00 looks the depth up in the perspective table, which FUN_0041ae50 builds as entry[i] = F / (F/65536 - i) with F = 0x12c0000 (300.0). So a point at depth d is drawn at scale 300 / (300 - d + height), and the ground point at the centre of the view (depth 0) is 300 + height units from the eye. The focal length is the one document 43 traced and the port's camera already uses, so the port only has to put its eye at that distance.

The pitch is a 24-bit angle in 16.16. FUN_00410be0 / FUN_00410dc0 are cosine and sine with 0x1000000 = one turn: the heading matrix built at 0x48a4b0 is the identity for heading 0, so be0(0) = 1. The view's matrix is [1,0,0; 0,sin p,cos p; 0,-cos p,sin p] (+0x4c = dc0(p), +0x50 = -(+0x28) = cos p, +0x58 = +0x28), so p is the angle below the horizon. 32 is 45 degrees, 24 is 33.75, 50 is 70.3, and 64 is straight down.

So the resting view (height 0, pitch 32) is 300 units away at 45 degrees. That is exactly the camera document 43 calibrated against screenshots (212.13 up and 212.13 back). It is also the constructor's default pitch (FUN_00416cb0: param_1[9] = 0x200000), which PORTING_PLAN 1.10 point 6 had read as a fixed tilt. That reading was wrong. FUN_00408d60, the terrain blitter that draws each view, starts with CALL 0x00416fa0 (0x408d83), so the pitch and its +0x28 that the blitter reads are rewritten every frame.

The swoop now needs no footage numbers. It starts at height 250, pitch 64: 550 units away, looking straight down. It ends at -170, pitch 24: 130 units away at 33.75 degrees. 550 / 130 = 4.2, and document 90 had read "about four times smaller" off the footage.

Step 5: the x/y follow

FUN_00416fa0 eases the view's x and y (+0x10c, +0x110) toward the claimed target. The decompiler hid the float arguments, so this is from the disassembly (DisasmForce.java 0x417070 0x417220):

00417089  ECX = view->+0x128 >> 16 ; IMUL ECX,[view+0x28] ; ADD ECX,[view+0x130] ; MOV [view+0x130],ECX   ; target y += floor(z) * -cos p
0041708f  dx = (view->+0x10c - view->+0x12c) >> 16 ;  dy = (view->+0x110 - target y) >> 16
004170c5  len = FUN_00410df0(dx*dx + dy*dy)            ; FILD ; FSQRT ; __ftol (truncated)
004170da  if (len <= 0) skip                           ; within a unit: no follow
004170e0  ux = (dx << 16) / len ;  uy = (dy << 16) / len
00417106  cap = FUN_00410e20(|dx| * triple[4])         ; sqrt(|dx| * brake) in 16.16
00417115  want = -fixmul(ux, triple[8])                ; -unit * max
00417122  if |want| > cap: want = +-cap, slew = triple[4] else slew = triple[0]
00417143  rate_x = FUN_0042cdd0(view->+0x138, want, slew * dt) ; x += rate_x * dt ; never past the target

It is the same easing shape as document 90's FUN_00417420, done per axis along the direction to the target.

Step 6: the numbers per type

From the records (DumpDwords.java 0x4456b8 744) and the byte table at 0x4452e8. Heights are in units, pitches in 1/256 of a turn, and triples are {accel, brake, max} per tick.

Tank Jeep MSV Heli
creation rig hold (0x4452e8) 60 90 60 180
swoop height (0x4452c0, document 90) -170 -170 -170 -100
rest height (state +0x128 = record +0x130) 0 0 0 60
drive height (+0x2cc) 100 250 100 200
rest / drive pitch (+0x2d8 / +0x2d4) 32 / 50 32 / 50 32 / 50 32 / 50
x/y triple (rig +0x3c) .1, .05, 4 .1, .05, 4 .1, .08, 4 .15, .08, 4
height triple (rig +0x48) .08, .05, 2.5 .1, .05, 3 .08, .05, 2.5 .1, .05, 3
pitch triple (rig +0x54) .03, .01, .8 .04, .01, 1 .03, .01, .8 .04, .01, 1
rise triple (+0x2c0) .08, .04, 1 same same same
zoom toggle height (+0x2d0) -200 -200 -200 -150

So a Tank driving at a steady speed is seen from 400 units at 70 degrees, and a Jeep from 550. Standing still, every type is seen from 300 units at 45 degrees, and the Heli from 360. The two-button toggle that swaps the rest height for the zoom height (0x40bc24) only works when DAT_00442afc is 1, and that flag looks like a cheat code's. It is not built (issue #105).

Step 7: checked against the footage

A contact sheet of the reference video (one frame every 2 s, 30-150 s) shows the same thing. In the frames where the Tank drives across the island, the view is far out and close to top-down: buildings are seen from above and the Tank is small. Around the flag bunker, where it stops and turns, the view is close in at about 45 degrees. Right after the undock the pad is large (the -170 of the swoop's end), and a few seconds later the view has pulled back.

Applied in the port

The per-type numbers are pack data: tools/extract_vehicle_types.py reads them into tools/data/vehicle_types.json (camera_rig), and both importers write them into each vehicle's camera table (camera_def in tools/build_pack.py, _camera_def in importer/pack_builder.gd):

def camera_rig(t):
    hold = byte_at(CAMERA_HOLD_TABLE + min(t, 3))
    return {
        "hold_ticks": hold,                        # 0x4452e8
        "rest_height": fixed(t, 0x130),            # state +0x128
        "zoom_height": fixed(t, 0x2D0),
        "drive_height": fixed(t, 0x2CC),
        "rest_pitch": fixed(t, 0x2D8),
        "drive_pitch": fixed(t, 0x2D4),
        "follow_ease": ease(t, 0xBC + 0x3C),       # rig +0x3c
        "height_ease": ease(t, 0xBC + 0x48),
        "pitch_ease": ease(t, 0xBC + 0x54),
        "rise_ease": ease(t, 0x2C0),
        "air_threat": field(t, 0) == 3,            # the type FUN_00416420 tests
    }

The engine's new game/camera_rig.gd (CameraRig) is the view. It replaces CameraSwoop, and CameraEase.ease_step is FUN_00417420. The vehicle rig, against Step 2:

		var h := height_target                              # view +0x134
		var p := pitch_target                               # view +0x144
		if speed == _last_speed:                            # view +0x90
			_steady += 1                                    # view +0x94
			if _steady > STEADY_TICKS - 1:
				var still := speed < SLOW_SPEED             # 0x3334
				h = rest_height if still else float(def.get("drive_height", rest_height))
				p = float(def.get("rest_pitch" if still else "drive_pitch", 32.0))
		else:
			_steady = 0
		_last_speed = speed
		if height < rest_height:
			height_ease = def.get("rise_ease", TEMPLATE_HEIGHT)     # record +0x2c0
			height_target = rest_height
		else:
			height_ease = def.get("height_ease", TEMPLATE_HEIGHT)   # rig +0x48
			height_target = h
		pitch_target = THREAT_PITCH if threat_d2 < THREAT_RANGE * THREAT_RANGE else p

and the x/y follow, against Step 5:

	var ty := at.y + floorf(follow_z) * -cos(pitch_radians())
	var dx := floorf(x - at.x)
	var dy := floorf(y - ty)
	var dist := floorf(sqrt(dx * dx + dy * dy))          # FUN_00410df0, truncated
	if dist > 0.0:
		var ex := _follow_axis(x, at.x, rate_x, dx, dx / dist, follow_ease)
...
static func _follow_axis(value: float, target: float, rate: float, d: float, unit: float, triple: Array) -> Vector2:
	var wanted := -unit * float(triple[2])
	var cap := sqrt(absf(d) * float(triple[1]))
	var slew := float(triple[0])
	if absf(wanted) > cap:
		wanted = signf(wanted) * cap
		slew = float(triple[1])
	rate = move_toward(rate, wanted, slew)
	value += rate
	if (d > 0.0 and target > value) or (d <= 0.0 and target < value):
		value = target
	return Vector2(value, rate)

TerrainView3D places Godot's camera from it (Step 4), starts the swoop on the lift's rise (begin_swoop), starts the creation rig's timer when the rise ends (vehicle_created), and gives the sound engine the rig's height as the listener's (issue #80):

func _apply_rig() -> void:
	var tilt := _rig.tilt_deg()                 # pitch * 360 / 256
	var dist := _rig.eye_distance()             # 300 + height
	camera.position = _camera_target_position(Vector2(_rig.x, _rig.y), dist * sin(deg_to_rad(tilt)), tilt)
	_apply_tilt(tilt)

The air threat is _air_threat_d2: any other vehicle whose definition says camera.air_threat. The Drones of issue #76 should feed it too once they exist. SWOOP_START_ZOOM and SWOOP_START_TILT_DEG, document 90's footage choices, are gone. RF_DEBUG_CAMERA_TILT_DEG / RF_DEBUG_CAMERA_HEIGHT_PX still give a fixed camera for comparisons, and RF_DEBUG_CAMERA_LOG=1 now prints the rig's height and pitch.

Checks: the engine's tests/camera_rig_check.gd (replacing camera_swoop_check) runs on the synthetic pack's own camera tables. It covers 300 units at 45 degrees at rest; the swoop's ~205-tick arrival; the creation rig's hold; 30 steady ticks before the targets change; 0x3333 being "still" and 0x3334 "driving"; the rise below the rest height; the 512-unit threat; the 4-unit cap and no overshoot; the height shift; and fractional ticks. openfire's vehicle_definitions_check.gd asserts the real pack's numbers in the table above. Screenshots of RFMAP001 show the resting Tank on its pad at 45 degrees, and the same Tank driving with RF_DEBUG_DRIVE=1, seen from further out and more from above.

Corrections

  • Document 126: the function is FUN_00416420 (the vehicle rig in each type record), not part of FUN_00416300. 0x448ef0/f00/f10 are easing triples, not rigs, and the "camera drifts toward the nearest threat" never happens because the lead is 0.
  • Document 90: the swoop's -170 holds only for the rise plus the creation rig's hold (60 ticks for a Tank). After that the camera rises back to the rest height. The port's SWOOP_START_ZOOM = 4 and SWOOP_START_TILT_DEG = 70 are replaced by the traced 550 units and 90 degrees.
  • PORTING_PLAN 1.10 point 6: the tilt is 45 degrees only at rest; the view's pitch changes every tick.

Not done / untraced

  • The death rig and the other rigs (0x40b8fe, 0x4184a4, 0x43285b): issue #104, done; see the follow-up below.
  • The zoom toggle and DAT_00442afc: issue #105, labelled optional.
  • Port choices (issue #106): whole ticks and the 2-unit centre offset, both now done as the original does them; see the follow-up below.
  • The point-of-interest lead is not built, because its data is 0. A mod that wants a leading camera would need it built as a new feature.

Follow-up (issues #104 and #106): the other rigs, the frame's dt, the view's centre

The event rig: one slot per player

FUN_004161e0 does not add a new rig each time. It reuses one slot per player (0x458ad0 + player * 0x60): if the slot is in use, its callback is called with mode 1 (remove) first, then the template is copied over it. So the swoop, the death, the loss and the flag rigs are one event rig that each event replaces. FUN_00416300 is its callback, which document 90 only read for the swoop. Read in full (Step 1's decompile):

if (rig->+0x1c && (rig->+0x1c -= dt) < 1) { remove; return 0; }   // a timed rig
if (obj = rig->+0x14) {
  if (rig->+0x18 == obj->+8) {                       // the object is still the one it was given (id at +8)
    if (rig->byte+0xb) rig->+0x20..+0x28 = obj pos;  // "keep": remember its position
    pos = &obj->+0x40;
  } else if (!rig->byte+0xb) { remove; return 0; }   // gone: a normal rig removes itself
  else { rig->+0x14 = 0; pos = &rig->+0x20; }        // a "keep" rig stays on the last position
} else pos = &rig->+0x20;
claim x/y = pos, z = rig->+0x2c + pos z, height rig->+0x34, pitch rig->+0x30, with the rig's triples;
return pitch != 0;

The four events, from their FUN_004161e0(player, priority, object, z offset, pitch, height, keep, triples) calls:

Event Call Aims at z offset Height Pitch Time
swoop 0x42eea0, 0x40b23b the lift, then the vehicle 10 -170 / -100 24 until the vehicle exists, then 60 / 90 / 60 / 180 ticks
vehicle gone 0x40b8fe (end handler 0x40b8b0) the vehicle, kept 10 -120 (0xff880000) 62 (0x3e0000, 87 degrees) until replaced
loss 0x4184a4 (FUN_00418440) the home pad (player block +0x34), z 0 0 0 24 until replaced
flag 0x43285b (FUN_00432710) the new flag 10 -150 (DAT_00448e88) 24 120 ticks (+0x1c = 0x78)
  • Vehicle gone. 0x40b8b0 is the vehicle class's end handler (class table 0x445438 +0xc). The delete queue calls it for every removed object (0x42c9e7: CALL [class+0xc]). A vehicle is removed on a death (document 87), a drowning (document 62) and a dock (FUN_0042f110, document 77). So all three take the camera down to 180 units, almost straight down, over the spot where the vehicle was. The handler also removes the vehicle rig (FUN_004160c0(state + 0xb4)). Since the object is already being deleted, the "keep" rig stays on its last position.
  • Loss. After the death wait, FUN_0040b5a0 / FUN_0040b5c0 call FUN_00418440(player) (document 88's skull sequence starts there). It registers a rig with no object and writes the point itself: piVar3[8..10] = (player block +0x34)->x, ->y, 0. That is the same pad position FUN_0040b510 creates the undock on. So during the skull and the fade, the camera pans to the home pad at the resting height and the swoop's pitch.
  • Flag. FUN_00432710 is the flag bunker's tile-destroyed handler (data reference 0x44751c). When the flag object is created (class 0x44e3c0), the other side's vehicle (FUN_0040b3c0(team == 0)) is checked against it: if it is within 0x1400000 (320 units, FUN_0042cd70), that side's view is aimed at the flag for 120 ticks.

The Drones in the pitch rule

FUN_0040a150, the Drone's per-tick, resets DAT_00443158 to 0x7fffffff once per clock tick (0x457f94). Each Drone not of team 0 then stores its squared distance to view 0's +0x18, the ground point at the centre of the view (0x48b4d8), if that is smaller, and the same for view 1 in a two-player game (0x48b724). So the 512-unit rule measures Drones against the centre of the view, and the other player's Heli against the vehicle. Both distances are flat (FUN_0042cda0 uses x and y only).

The frame's dt

0x480d2c is written in one place, 0x41d091: ESI = carry (0x458c88) + table[min(elapsed, cap)]; dt = ESI >> 16. It is whole ticks, with the fraction carried, so a frame can be 0, 1 or more ticks. FUN_00416fa0 runs once per drawn frame (FUN_00408d60 calls it first, 0x408d83). Every slew is triple * dt, every move rate * dt, and the counters (+0x94, a timed rig's +0x1c) step by dt. One frame of 2 ticks is therefore not the same as two frames of 1 tick: the rate only reaches 2 * accel once, instead of accel and then 2 * accel.

The view's centre

Corrected in document 134 (issue #111): the one-player view is set up by FUN_00416ab0(view, 0, 12, 288, 140) (pushed at 0x40947d, called at 0x4094ef): +0x1c4 = 0, +0x1c8 = 12 << 16. The (0, -2, 325, 171) read here before is the other branch (DAT_0048c7dc != 0, document 96), which the shipped game never takes; both branches share the CALL at 0x4094ef. FUN_00416fa0 then sets +0x18 = +0x10c - +0x1c4 and +0x1c = +0x110 - +0x1c8. So the ground point drawn at the centre of the view is the followed point minus (0, 12): 12 units north, and the vehicle sits 12 units below the centre.

Applied in the port

CameraRig has one event slot with the four events. The vehicle rig runs only while no event rig claims the view and the vehicle exists:

func _event_rig(dt: float) -> bool:                       # FUN_00416300
	if _ev_hold != 0:
		_ev_hold -= int(dt)
		if _ev_hold < 1:
			event = EventKind.NONE
			return false
	if _ev_has_follow:
		if is_instance_valid(_ev_follow) and ...:
			_ev_at = _ev_follow.get("position")             # the object is still there (a keep rig remembers it)
		elif _ev_keep:
			_ev_follow = null                               # stay on the last position
		else:
			event = EventKind.NONE                          # remove
			return false
	return true

func vehicle_gone(at: Vector2, z: float) -> void:          # 0x40b8b0 / 0x40b8fe
	vehicle_rig = false
	_set_event(EventKind.GONE, null, at, z, EVENT_FOLLOW_Z, GONE_HEIGHT, GONE_PITCH, true, 0)

TerrainView3D fires the events:

  • vehicle gone: on the edge of death_phase != 0 (death or drowning) or dock_state >= 2 (_do_dock, FUN_0042f110);
  • loss: when death_phase reaches 2, the skull, aimed at pad_position();
  • flag: from flag_spawned, when the flag is not the player's side's and the vehicle is within 320 units.

_air_threat_d2 adds the Drones of the other side, measured to CameraRig.centre(). The frame's dt:

func advance(ticks: float, ...) -> void:
	_acc += ticks
	var dt := floorf(_acc)              # 0x41d091: dt = the whole ticks, the fraction carried
	if dt < 1.0:
		return
	_acc -= dt
	tick(at, z, speed, threat_d2, def, dt)
...
	rate = move_toward(rate, wanted, slew * dt)    # FUN_00416fa0 / FUN_00417420: `IMUL ECX,[0x480d2c]`
	value += rate * dt

and _apply_rig() places the camera on CameraRig.centre() (+0x18 / +0x1c) instead of the followed point.

Checks (engine camera_rig_check):

  • A 2.5-tick frame is one update with dt 2 (rate 0.2, x 0.4, against 0.3 for two ticks), and the half tick carries.
  • The centre is 2 units south.
  • Vehicle gone: height -120, pitch 62, and the view stays put.
  • Loss: the pad at height 0, pitch 24.
  • The next undock replaces the event.
  • The flag holds for 119 ticks at -150 and gives the view back on the 120th.
  • A non-keep rig whose object is freed removes itself.

A real run of RFMAP001 (RF_DEBUG_KILL) logs the vehicle-gone rig from the death frame (height 93 down toward -120, pitch 50 up to 62), then the loss rig 120 ticks later as the skull starts.

Next: back to the issues list.

Clone this wiki locally