benilla-re systems structs docs

system objectlayer · source

objectlayer: unit movement

How a unit takes movement: the server's movement messages, monster moves and spline toggles; the local commands the input code queues on the unit's mover; the display and body facing; and the auto-move machine behind click-to-move, follow and walking up to an interaction. The mover is the CMovement embedded at +0x9a8 (collision owns it); +0x118 points at it, so its movement flags are [unit+0x9e8]. The functions here pick the unit, forward to the mover, and refresh the unit's animation and state around it.

Roots: 0x603bb0, 0x603f00, 0x601420, 0x6106b0, 0x611130

Movement message handlers

0x6033c0 registers these handlers. Each reads the unit's GUID, packed except where noted, and forwards; an unknown unit moves the store's cursor to its end and returns 0, except 0x603f90, which returns 1.

handleropcodesforwards to
0x603bb030 relayed moves, 0xb5 to 0x2b10x601580 (time, opcode, store)
0x603ae00xcd, 0xcf, 0xd1, 0xd3, 0xd5, 0xd80x6010e0 (time, opcode, store)
0x603c100x2fe to 0x303, then a float0x601360 (opcode, speed)
0x603c800x304 to 0x30e and 0x31a0x601420 (opcode)
0x603f9016 forced changes, 0xc7 to 0x2de0x602780 (time, opcode, store)
0x603b400x319, then a u320x601560
0x603f000xdd; 0x2ae with a second packed GUID0x617100 transport, then 0x6018f0

Addresses: 0x6033c0, 0x603bb0, 0x603ae0, 0x603c10, 0x603c80, 0x603f90, 0x603b40, 0x603f00, 0x601560 Confidence: verified Proof: two Test: none

0x6033c0 pairs each mov ecx,opcode with mov edx,handler before 0x5ab650. The relayed set is 0xb5 to 0xbe, 0xbf to 0xc3, 0xc5, 0xc9 to 0xcb, 0xd9 to 0xdb, 0xec to 0xee, 0xf1, 0xf7, 0x2ad, 0x2b0, 0x2b1; the forced set 0xc7, 0xde, 0xdf, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xef, 0xf2 to 0xf5, 0x2da, 0x2dc, 0x2de. The handlers call 0x642ed0 for the packed GUID and 0x468460 with mask 8; the miss path stores [store+0x10] into [store+0x14]. 0x603f00 passes 0 as the transport for 0xdd. 0x601560 passes its u32 to the mover's skipped-time call and returns 1. The dispatchers switch inline: 0x6010e0 through 0x6012fc and 0x60132c (12 cases each, value − 0xcd), 0x601360 through 0x601408 (6, value − 0x2fe), 0x601580 through the bytes 0x6018ac (61, value − 0xb5) into 0x601844 (26), and 0x602780 through 0x602a50 (36, value − 0xc7) into 0x602a2c (9); 0x60e0a0 reads 0x60e408 into 0x60e3fc and 0x60e448 into 0x60e438.

Compressed moves

0x603ce0 handles 0x2fb: a u32 inflated size, then a zlib stream. It reserves the size, rounded up to 4, on the stack, inflates into it with the unrounded size as the output limit, and then dispatches each u8 length and length bytes as one message through 0x537aa0, until the cursor equals the inflated size. No test bounds the size between its read and the reserve: one above the free stack faults in 0x40a280, and the top three sizes, 0xfffffffd to 0xffffffff, round to a 0-byte reserve while the output limit stays the size.

Addresses: 0x603ce0, 0x603cf2, 0x603cf7, 0x603d00, 0x603d33, 0x603d67, 0x603da6, 0x603dc9, 0x419ae0 Confidence: verified Proof: two Test: none

0x603cf2 loads the size, add eax,3; and eax,-4 (0x603cf7), and 0x603d00 calls 0x40a280 with it. The limit [ebp-8] keeps the unrounded size and 0x603d33 passes it to 0x660740. The loop reads the length with 0x418cb0 (0x603d67), wraps the bytes in a second store and calls 0x537aa0 on 0x5ab490() (0x603da6); it repeats until the cursor [ebp-0x10] equals the size [ebp-0x14] (0x603dc9). A frame that passes the end moves the cursor to size + 1 (0x419ae0), which that test never meets.

Spline toggles

0x601420 maps opcodes 0x304 to 0x31a through the byte table 0x601544 to the case table 0x601510; opcodes 0x30f to 0x319 return 0. After a case it calls 0x60e480(opcode) and 0x5fd9e0(-1) and returns 1.

opcodemover call
0x304, 0x31aunroot 0x619a40, root 0x619a10
0x305, 0x306feather fall 0x61a4e0 on, off
0x307, 0x308hover 0x61a620 on, off
0x309, 0x30awater walk 0x61a3d0 on, off
0x30b, 0x30cswim start 0x61a130, stop 0x61a160
0x30d, 0x30erun mode 0x617e80 with 1, 0

Addresses: 0x601420, 0x601510, 0x601544, 0x6014ec Confidence: verified Proof: two Test: none

The bound is lea eax,[edi-0x304]; cmp eax,0x16. The byte table holds 0 to 10 for 0x304 to 0x30e, 12 (the return-0 case 0x601508) for 0x30f to 0x319, and 11 for 0x31a; the case table has 13 dwords. 0x6014ec is the shared tail.

Monster moves

0x6018f0(store, opcode) reads the start point, the spline id and a type byte. Type 1 stops: within 3 yards the mover flushes and stops at the point. Types 2, 3 and 4 add a face point, a GUID or an angle. Then come the spline flags, the duration and a u32 count of points. Flag 0x200 sends every point; otherwise the last point comes whole and the middle points as packed offsets. The path is anchored at the unit (0x6021c0), started (0x6187a0) and given its facing; the active mover's input stops; the precast, ranged pose and spell effect are cleared.

Addresses: 0x6018f0, 0x601a58, 0x601a68, 0x601ccd, 0x601e05, 0x602130, 0x6021c0, 0x602e80, 0x6187a0 Confidence: verified Proof: one Test: objectlayer::monster_move_case1_near_gate_difftest, objectlayer::monster_move_direction_sincos_difftest, objectlayer::monster_move_case_delta_sub_difftest, objectlayer::monster_move_case_delta_sub_clone_difftest, objectlayer::monster_move_case2_coincident_gate_difftest, objectlayer::monster_move_case34_coincident_gate_difftest, objectlayer::monster_move_reflect_through_difftest, objectlayer::monster_move_arc_length_difftest, objectlayer::monster_move_speed_duration_difftest, objectlayer::move_event_packed_delta, objectlayer::anchor_region_a_difftest, objectlayer::anchor_region_b_difftest, objectlayer::anchor_region_c_difftest, objectlayer::anchor_region_d_difftest, objectlayer::anchor_region_e_difftest, objectlayer::anchor_region_f_difftest

The path buffer is 0x40a280((3·count + 12)·4), computed in 32 bits (0x601a58 to 0x601a68), and the loops at 0x601ccd and 0x601e05 run to the count. A count of 0x15555552 or more wraps the size, and the loops write points past the buffer. Type 1's 3 yards is a squared distance under 9 (0x80c5bc) before 0x618750; farther, the stop point runs as a one-point path. 0x602130 turns a u32 into x, y and z from bits 0 to 10, 11 to 21 and 22 to 31, each sign-extended and times 0.25, and subtracts them from the reference point. 0x6021c0 empties a one-point path within 1/36 yard of the unit (squared against 0x80c450) and otherwise prepends the unit's position or cuts the points it has passed. 0x602e80(guid) sets the facing toward the object the GUID names through 0x47f220 and 0x6198e0. Facing calls: 0x6188a0, 0x618870, 0x618840. The tests run 0x601982 to 0x6019cf, 0x601ab7 to 0x601ac0, 0x601aca to 0x601b1a, 0x601b7e to 0x601be2, 0x601c1d to 0x601c50, 0x601d41 to 0x601d79, 0x601e83 to 0x601eca, 0x601eda to 0x601f7e, 0x601eda to 0x601faf, 0x602148 to 0x6021b5, 0x6021da to 0x60221e, 0x602252 to 0x6022bb, 0x602324 to 0x602342, 0x60237b to 0x6023ad, 0x602426 to 0x6024c3 and 0x602426 to 0x60257b.

Relayed move events

Thin wrappers forward a relayed or replayed move to the mover. Turn and pitch starts are refused, returning 0, while bit 0x40000 of UNIT_FIELD_FLAGS (stunned) is set. 0x602670 and 0x6026f0 read four floats, a direction and two speeds, and queue or apply a knockback. 0x602fb0 reads a movement status; without the manager's +0xc8 it queues a teleport, else it answers with opcode 0xc7 carrying the GUID.

Addresses: 0x602a80, 0x602aa0, 0x602ac0, 0x602ae0, 0x602b00, 0x602b20, 0x602b60, 0x602b80, 0x602bc0, 0x602be0, 0x602c00, 0x602c20, 0x602e30, 0x602e60, 0x602ef0, 0x602f10, 0x602f90, 0x602760, 0x602670, 0x6026f0, 0x602fb0, 0x602c60 Confidence: verified Proof: two Test: none

Each wrapper is add ecx,0x9a8 and a jump-free call: move start 0x617520, strafe 0x6178e0, stops 0x617b60, 0x617c10, jump 0x617970, turn 0x617cf0, 0x617d80, pitch 0x61a290, 0x61a320, swim 0x61a190, 0x61a1f0, heartbeat 0x61a750, run mode 0x617e30, gravity 0x619c50, facing 0x619910, pitch 0x619960, teleport 0x6186b0, hover 0x61a6b0. 0x602b20 and 0x602b80 test [[unit+0x110]+0xa0] for 0x40000. 0x602670 calls 0x60e990(1,0) and 0x617a30; 0x6026f0 calls 0x617a60. 0x602c60(flags, force) picks a landing's animation: without force or bit 0x4000 it re-picks only when the direction bits 0xf change; else a swimmer, a backward or a walking unit re-picks, no direction plays 39 (JumpEnd), and the rest 187 (JumpLandRun).

Standing on a movement message

Most movement messages stand a seated unit, end its precast and stop the kits of its spell before they are sent. The stops, turns, facing and acknowledgement messages are sent as they are.

Addresses: 0x60e0a0, 0x60e0bb, 0x60e0c1, 0x60e0cd, 0x60e0d4, 0x60e0da, 0x60e139, 0x60e13d, 0x60e14b, 0x60e15d, 0x60e16d, 0x60e1b3, 0x60e1b8, 0x60e3fc, 0x60e408, 0x60be30, 0x5ed430, 0x60d040, 0x614150 Confidence: verified Proof: two Test: none

0x60e0a0(opcode) indexes the opcodes 0xb7 to 0xe3 through the byte table 0x60e408 into the three targets of 0x60e3fc. Class 0 sends at once (0x60e1b8): 0xb7, 0xba, 0xbc, 0xbd, 0xbe, 0xc7, 0xd7, 0xd8, 0xd9, 0xda and 0xe3, and the opcodes 0xe5, 0xe7, 0xe9, 0xeb, 0x2ad, 0x2cf, 0x2db, 0x2dd and 0x2df. Class 1 (0xbf, 0xc0, 0xc1, 0xdb) sends only when the mover flags have 0x200000, swimming (0x60e0d4), and else returns 0. All others, including 0xb5, 0xb6 and 0xbb, take 0x60e139: when the stand state (slot +0xa4) is nonzero it calls SendStandState(0) (0x60e14b, 0x60be30 to 0x5ed430 for a player). Then it clears the precast spell +0xc8c (0x60e15d), stops its kits with force 1 (0x60e16d) and does the same for a channelled spell whose record has bit 3 of +0x5c while the mover flags have 0x200f (0x60e1b3).

Local movement commands

The input code moves its unit through these. Each calls 0x60e990 first, which stops an auto-move the input did not start and closes the loot window unless told not to, then queues the change on the mover. A jump while mounted and standing still is no jump: the active player plays MountSpecial and sends 0x171 with no body. A facing change wakes a sleeping unit (stand state 3).

Addresses: 0x60dc60, 0x60dc90, 0x60dcb0, 0x60dce0, 0x60dd00, 0x60dd80, 0x60dda0, 0x60ddd0, 0x60de00, 0x60de30, 0x60de70, 0x60dea0, 0x60e060, 0x60e080, 0x60e990, 0x60e860, 0x60e880, 0x60e8a0, 0x60e8f0, 0x60e920, 0x60e940 Confidence: verified Proof: two Test: none

0x60e990(stops, keepsLoot): with stops, an auto-move in progress (0x6103a0) and bit 0 of 0xc4da48 clear, it calls 0x60fb60(0,1); unless keepsLoot, an active player who is looting (0x6126b0) calls 0x48f200. 0x60dd00 (turn start) also sends the channel cancel 0x6e9b70 for a channel spell with AttributesEx 0x4000 while auto-moving. 0x60dea0 tests MOUNTDISPLAYID, the direction bits 0xf, turning 0x30 and 0x605650 before the 0x171 path. 0x60de30 compares slot 41 with 3 and calls 0x60be30(0). 0x60e080 passes the walk bit 0x100 to 0x60e060. The input setters 0x60e8a0 and 0x60e940 act only while the input owns the mover, with bit 0 of 0xc4da48 set around the call; 0x60e860, 0x60e880, 0x60e8f0, 0x60e920 press and release input commands 0x200000 and 0x800000 through 0x515090; 0x60e8f0 keeps its facing at 0xc4d8c4.

Movement packets

0x600860 writes a movement message: the opcode, the GUID for relayed opcodes, a u32 for those that carry one, the status, and a float for nine opcodes. Falling (0x2000) sets bit 0x80 of the unit's state word +0xc58.

Addresses: 0x600860, 0x6009b0 Confidence: verified Proof: two Test: none

The GUID test is 0x7ccc10(op) and the u32 test 0x7ccb90(op); the status goes through the mover's init and write calls. 0x6009b0 returns 1 for 0xe3, 0xe5, 0xe7, 0xf6, 0x2cf, 0x2d0, 0x2db, 0x2dd and 0x2df.

Who may send a report

0x600860 builds a report that carries no GUID, which is every opcode but the acknowledgements and 0x2d1, only for the active mover. A unit with an unfinished server spline sends only 0xca, 0xcb, 0x2d8 and 0x2d9. Opcodes that carry a GUID skip both tests. The opcode is already written (0x600874) when the gate refuses.

Addresses: 0x600860, 0x600880, 0x600882, 0x600963, 0x600969, 0x600971, 0x600973, 0x60097b, 0x600984, 0x600989, 0x600994, 0x60099a, 0x6009a0, 0x6008af, 0x7ccc10, 0x7cccb0 Confidence: verified Proof: two Test: none

0x600882 je 0x600963 takes the no-GUID path. 0x600969 loads the spline object +0xa4 of the movement object; with one whose +0x18 lacks bit 4 (not finished), 0x7cccb0 must say the opcode is one of the four (0xca to 0xcb, 0x2d8 to 0x2d9), else 0x600982 returns 0. 0x600989 and 0x600994 compare the unit's GUID with the mover 0xc4da98, 0xc4da9c; a mismatch returns 0 (0x6009a0), a match builds the message (0x6008af).

The active mover

The active mover is the GUID at 0xc4da98. 0x6006e0(guid) switches it: the old mover's auto-move stops, bit 31 of its flags clears and, with no running spline, its queue resets; the active player's old mover sends 0x2d1. The new GUID is stored and, when nonzero, sent with 0x26a; the new mover resets. 0x6006b0 stops the auto-move and clears it.

Addresses: 0x6006e0, 0x6006b0, 0x600753, 0x600783, 0x6007ae, 0x5fa5f0, 0x5fa600, 0x603ea0 Confidence: verified Proof: two Test: none

0x600753 clears bit 31 of [+0x9e8]; 0x619d50(0) resets the old mover when +0xa4 is empty or has bit 4 of +0x18. 0x600783 pushes 0x2d1 for 0x600a10; 0x6007ae 0x26a with the GUID. The new mover gets 0x619d50(1). Client control is bit 0x400 of +0xc58: 0x5fa5f0 reads it, 0x5fa600 sets it and re-picks the camera's mover, and 0x603ea0 (0x159) reads a packed GUID and a byte and calls 0x5fa600(byte != 0).

Client control

0x5fa600(unit, allow) runs for the unit a client control update names and does three things in order. It sets or clears bit 0x400 of +0xc58, for any unit. If the unit is the camera's anchor, it makes the unit the active mover when the bit is set, or clears the mover to GUID 0 when the bit is clear and the unit is the current mover. If the unit is the active player, it stores the bit in the control flag s_playerHasControl through SetPlayerControl, which signals PLAYER_CONTROL_GAINED or PLAYER_CONTROL_LOST.

Addresses: 0x5fa600, 0x5fa621, 0x5fa62a, 0x5fa631, 0x5fa636, 0x5fa63c, 0x5fa64c, 0x5fa662, 0x5fa678, 0x5fa68b, 0x5fa696, 0x5fa69d, 0x5fa6b1, 0x4958e0, 0xb4b3e4, 0x603ea0 Confidence: verified Proof: two Test: none

The bit is stored at 0x5fa636, before 0x5fa662 reads it back through IsClientControlled, so with allow 0 the read is 0. 0x5fa64c compares the camera's +0x88 with the unit's GUID; the clear leg (0x5fa678, 0x5fa68b) builds a zero GUID for 0x5fa696 (SetActiveMover). 0x5fa69d is the test for the active player and 0x5fa6b1 the call. 0x4958e0 stores the flag when it differs; a nonzero flag signals event 0xc5 and a zero flag first runs 0x495920 (clears the cursor, cancels the cast) and signals 0xc4, each ending in FireUsableEvents. Casting, item use, melee and the action buttons test the flag; 0x603ea0 feeds 0x5fa600.

Facing

A unit keeps a display facing at +0xc98 and a second facing at +0xc94. The active mover's display follows the mover; another unit's turns toward its move direction or, idle, toward its target, averaging four samples at +0xc9c. 0x6084f0 wraps an angle into −π to π.

Addresses: 0x600cd0, 0x601020, 0x601050, 0x6084f0, 0x60a110 Confidence: verified Proof: two Test: objectlayer::wrap_angle_difftest, objectlayer::angle_wrap_pi_difftest, objectlayer::swing_transform_args_difftest, objectlayer::u4_facing_delta_difftest, objectlayer::u4_facing_dead_band_difftest, objectlayer::u4_facing_wrap_pi_delta_difftest, objectlayer::u4_facing_box_apply_difftest

0x600cd0 sets bits 0x1 and 0x2 of +0xd58 for key and mouse turning on the active mover. 0x601020 resets +0xc98 from the mover's facing and zeroes +0xc9c to +0xca8; 0x601050 wraps each of +0xc98 and +0xc94 once into 0 to 2π. 0x6084f0 uses fmod past ±π. 0x60a110 scales a swimming unit's model by [+0x94]·[+0x90] times the mount's +0x9c or the unit's +0x98. Slices: u4_facing_delta_difftest 0x600ea5-0x600eb3; u4_facing_dead_band_difftest 0x600ea5-0x600ec0; u4_facing_wrap_pi_delta_difftest 0x600eda-0x600f0e; u4_facing_box_apply_difftest 0x600f7b-0x601013.

Body facing

The facing at +0xc94 is the body's. 0x600cb0 and 0x607eb0 convert the display and body facings to world facings through the transport, 0x601050 adds a transport's turn to both, and 0x608560 (slot 15) places a swimming unit's model with the pitched transform 0x60a110.

Addresses: 0x600cb0, 0x607eb0, 0x601050, 0x608560, 0x60a110 Confidence: verified Proof: one Test: none

0x600cb0 and 0x607eb0 pass +0xc98 and +0xc94 to 0x7c4ae0 on the mover; 0x601050 adds its argument to each.

The display facing goal

0x600cd0 picks the goal the display facing +0xc98 turns to. The active mover takes its own raw facing +0x9c4 at once. Any other unit takes the first of these that holds: the raw facing when it moves (movement flags 0xf), has a stand state, holds an emote state whose Emotes row lacks flag 0x2000, or is stunned (0x40000); the scripted facing +0xcac when +0xc58 has bit 0x1; the raw facing when the unit is a player-controlled player (unit flag 0x8 and the player type); the bearing to its target; the bearing to the active player's target when it is that player; the bearing to the active player when the unit is the interaction target; else the raw facing.

Addresses: 0x600cd0, 0x600cee, 0x600cf5, 0x600d03, 0x600d6c, 0x600d9d, 0x600da5, 0x600db5, 0x600dc3, 0x600dd7, 0x600de2, 0x600deb, 0x600df6, 0x600e0e, 0x600e1c, 0x600e2a, 0x600e3f, 0x600e9e, 0x600eb0, 0x6126f0, 0x47f220, 0xb4e2d0 Confidence: verified Proof: one Test: none

0x600cee and 0x600cf5 compare the unit's GUID with the active mover and 0x600d03 stores the raw facing in +0xc98. 0x600d6c to 0x600d9d read UNIT_NPC_EMOTESTATE (+0x238) and the row's flags +0xc into bl. 0x600da5 tests the movement flags, 0x600db5 calls the stand-state slot, 0x600dd7 the stunned flag, 0x600de2 and 0x600deb the scripted facing, 0x600df6 to 0x600e08 the player-controlled flag and player type, after the scripted facing. 0x600e0e reads UNIT_FIELD_TARGET (+0x28), 0x600e1c the active player's target 0x6126f0 (+0x1d28, 0 for any other unit) and 0x600e2a the interaction GUID 0xb4e2d0, with the player from 0x600e3f. The bearing is HeadingBetweenPoints of the two positions (0x600e9e). A gap under 0.01 (0x600eb0) snaps; otherwise the turn averages the samples.

Auto-move modes

Auto-move drives the active mover toward a target in a mode, 0xc4d888, 12 meaning none. Each mode has a 12-byte row of 0x860a58: enabled, a maximum squared distance, and two flags.

modeusemaximumstop distance²
0, 1keep facing the target or channel objectnonenone
2face a directionnonenone
8walk along a headingnonenone
3follow (AUTOFOLLOW_BEGIN)9009
4walk to a pointnone0.25
5walk to an NPC64007.7160487
6, 10loot; walk to attack6400the reaches + 4/3, at least 5
7walk to a game object64000xc4d998²
9walk into spell range6400range · 0.9, squared

Addresses: 0x860a58, 0x860a84, 0x60e590, 0x60e5a0, 0x611240, 0x6113d8, 0x611310, 0x61132c, 0x6111ab, 0x6110a0, 0x6103a0, 0x611590, 0x60f9fc, 0xc4d888, 0xc4d9c0, 0xc4d910 Confidence: verified Proof: one Test: objectlayer::move_cast_radius_difftest, objectlayer::cast_goal_reach_difftest, objectlayer::u5_in_range_dist2_difftest, objectlayer::u5_in_range_gates_difftest

0x60e590 writes rows 3 to 10 at start-up: 900 at 0x860a80, 6400 at rows 5, 6, 7, 9 and 10, the +8 byte 1 on rows 4 to 10 and 0 on row 3 (0x860a84, 0x60e5a0), and +9 set only on row 8; row 3's enabled byte is the file's. 0x611240(mode, guid) takes row +0 and +9 and switches modes 3 to 10 through 0x6113d8: 3 0xc4d9c4 (3², 0x60e6e0), 4 0xc4d9b0 (0.5²), 5 0xc4d958 (2.7777777²), 6 and 10 the combat reaches (field 130) plus 4/3, at least 5, mode 10 less 4/3, 7 0xc4d998 squared, 9 0x6e3480's range of the spell in 0xb700e4 times 0x804588 (0.9), squared. 0x611130 keeps the value at 0xc4d9c0 and its square root at 0xc4d910 (0x6111ab), so modes 6 and 10, whose value 0x611310 and 0x61132c store unsquared, stop at the root of the reach, not at the reach. 0x6110a0 refuses a target past the row's maximum with message 0x126, ERR_AUTOFOLLOW_TOO_FAR. 0x6103a0 is the active mover with a mode set; 0x611590(mask) tests 1 << mode. Slices: move_cast_radius_difftest 0x6111a3-0x61120b; u5_in_range_dist2_difftest 0x6110ba-0x61110a.

Starting and ending auto-move

0x611130(mode, guid, point, facing) stops any auto-move, checks the range and the stop distance, and stores the mode, start time, start position, target GUID, point (0xc4d890) and facing (0xc4d9a8); a seated unit stands. 0x60fed0(guid, mode) starts one toward an object after per-mode checks. 0x60fb60(face, stop) ends one: follow signals AUTOFOLLOW_END, face turns toward the target, stop releases the move, turn and pitch commands, and the mode returns to 12.

Addresses: 0x611130, 0x60fed0, 0x610094, 0x610084, 0x60fb60, 0x60fc50, 0x60fcc0, 0x6100a0, 0x610100, 0x6102b0, 0x610300, 0x60fe90, 0x60e790, 0x60e7f0, 0x60f900 Confidence: verified Proof: one Test: objectlayer::interact_arrival_scale_difftest, objectlayer::move_cast_radius_difftest, objectlayer::cast_reach_floor_difftest, objectlayer::cast_in_range_difftest, objectlayer::cast_plane_z_difftest, objectlayer::cast_aim_normalize_difftest, objectlayer::cast_aim_key_difftest, objectlayer::cast_aim_endpoint_difftest

0x60fed0 maps modes 0, 1, 5 to "any unit", 3 to follow, 6 and 9 to "a corpse or a dead unit", the rest to refusal, through 0x610094 and 0x610084. Follow runs four tests in order: the target is a player that 0x606ba0 passes, else message 0x128; the follower's health is above 0, else 0x7e; it is not stunned, else 0x191; it has no channel, else 0x134. 0x60fb60 signals event 0x170 for mode 3, turns through 0x60e8f0 and stops through 0x60e7f0, 0x60e920, 0x60e880. 0x60fc50 clears the precast bit 0x400 of +0xd58, ends the ranged pose when the ranged weapon is out, releases the spell effect and stops an auto-move whose mode is in 0x860adc. The walks need 0x60f900: a live active mover and the AutoInteract CVar (0xc4d9a4) on. 0x60fcc0 walks to attack in mode 10, or faces (0x6100a0, mode 2) within reach. 0x610100 (mode 8) pitches a swimmer toward the clicked point first. 0x6102b0 is mode 4, 0x610300 mode 7. 0x60e790 and 0x60e7f0 press and release command 0x100000 and start or stop the move. Slices: interact_arrival_scale_difftest 0x610376-0x610389; move_cast_radius_difftest 0x6111a3-0x61120b; cast_reach_floor_difftest 0x60fcdc-0x60fd1b; cast_in_range_difftest 0x60fd2f-0x60fd5c; cast_plane_z_difftest 0x60fe37-0x60fe54; cast_aim_normalize_difftest 0x610161-0x6101b9; cast_aim_key_difftest 0x610161-0x6101c3; cast_aim_endpoint_difftest 0x61023b-0x61025d.

Steering an auto-move

0x6106b0 runs each frame for the active mover. It reads the target (0x610e40), turns toward it by at most the CVar turn speed, pitches a swimmer, and arrives inside the stop distance. Arrival runs the mode's action through 0x60f940, and 0x60fa20 completes a pending interaction after the move.

Addresses: 0x6106b0, 0x610e40, 0x6103d0, 0x610520, 0x610d50, 0x610da0, 0x60f940, 0x60fa20, 0x611400, 0x6115e0 Confidence: verified Proof: one Test: objectlayer::broadcast_wrap_angle_difftest, objectlayer::dist2_within_threshold_difftest, objectlayer::vec_to_facing_difftest, objectlayer::facing_interp_difftest, objectlayer::pitch_interp_difftest, objectlayer::move_dist_squares_difftest, objectlayer::move_goal_radius_difftest, objectlayer::click_ring_pulse_difftest, objectlayer::click_ring_corner_difftest, objectlayer::b2_arrival_test_difftest, objectlayer::b2_delta_time_difftest, objectlayer::b2_heading_add_difftest, objectlayer::b2_turn_step_difftest, objectlayer::b2_rng_jitter_gate_difftest, objectlayer::b2_heading_add_field_difftest, objectlayer::b2_turn_step_pi_difftest, objectlayer::b2_facing_error_difftest, objectlayer::b2_speed_from_timer_difftest, objectlayer::b2_range_gate_square_difftest, objectlayer::b2_anim_time_speed_difftest, objectlayer::b2_arrival_cos_threshold_difftest, objectlayer::b2_normalize_zdot_difftest

0x610e40 returns the transport-local point for modes 4 and 10, nothing for 2 and 8, else the object 0xc4d980, refusing a taxi rider and, outside modes 6 and 9, a dead unit; its distance drops the height near the target (next entry). 0x6103d0 turns at automoveturnspeedwide (1200, used between 2π/3 and 4π/3 off) or automoveturnspeednarrow (800), in degrees, latched at 0xc4d93c, and stops within 0.001. 0x610d50 compares squared distance with 0.002777778². 0x610da0 is asin of the normalized height. On arrival 0x60f940 stores the GUID for mode 5 at 0xc4da28, 6 at 0xc4da78, 7 at 0xc4d950, 9 at 0xc4da20, and 0x60fa20 hands each to 0x5f0130, 0x5df2a0, 0x5f86b0 or 0x5f05e0. 0x611400 draws a pulsing box at mode 4 and 10 targets. 0x6115e0 moves the target point and facing with a transport. Slices: move_dist_squares_difftest 0x610f7a-0x610fb6; move_goal_radius_difftest 0x610fb6-0x611003; click_ring_pulse_difftest 0x61143b-0x61146f; click_ring_corner_difftest 0x611429-0x611549; b2_arrival_test_difftest 0x61075b-0x6107db; b2_delta_time_difftest 0x61080f-0x610823; b2_heading_add_difftest 0x610872-0x61087f; b2_turn_step_difftest 0x61088a-0x610897; b2_rng_jitter_gate_difftest 0x610915-0x610929; b2_heading_add_field_difftest 0x6109ae-0x6109b7; b2_turn_step_pi_difftest 0x6109ba-0x6109cb; b2_facing_error_difftest 0x610a48-0x610a56; b2_speed_from_timer_difftest 0x610aa2-0x610aee; b2_range_gate_square_difftest 0x610b07-0x610b0e; b2_anim_time_speed_difftest 0x610bd7-0x610c1f; b2_arrival_cos_threshold_difftest 0x610c85-0x610c9a; b2_normalize_zdot_difftest 0x610cb0-0x610d28.

Arrival, height and stalls

Speed widens the arrival: a mover faster than 7 yards a second arrives that much farther out. Near the target the height stops counting unless the mover swims, and modes 5 and 10 cap that window at its unscaled base. A frame that brings the mover no closer, a target behind a drunk mover, a stall while walking forward (modes 4 to 10, not follow), or a target straight above or below ends the walk. A walk along a heading (mode 8) first pitches a swimmer level, steep or straight, by strict thresholds.

Addresses: 0x6106b0, 0x6107e5, 0x6108e6, 0x610a7b, 0x610aaa, 0x610ae8, 0x610b01, 0x610c63, 0x610d32, 0x610e40, 0x610ff1, 0x611007, 0x610100, 0x6101bb, 0x6101f5 Confidence: verified Proof: one Test: objectlayer::b2_speed_from_timer_difftest

0x610e40 ignores height within 0.5 yard (0x80c4c8), or in mode 10 the stop distance 0xc4d910, times max(speed/7, 1) (0x80c4d0), and 0x610ff1 to 0x611007 cap it at that base. 0x610aaa does the same to the stop distance (0x610b01). 0x6107e5 stops when the distance to the target is not below the distance from the last frame's position (0xc4da84) while bit 1 of 0xc4da48, set once the turn is done (0x6108e6), holds, outside modes 3 and 5. With a drunkenness argument above 0 and bit 1, 0x610a7b stops when the target lies 160° to 220° off the facing (0x80c604, 0x80c600), and mode 3 drops bit 1 when a random fraction times it tops 0.07 (0x80c608). Mode 3 starts walking only beyond 4.5·max(speed/7, 1) yards (3·1.5, 0x80c4c0). 0x610c63 stops a forward walk that moved less than 1/360 yard (0x80c4dc, through 0x610d50) in modes with flag byte +8. 0x610d32 stops when the direction's height part tops cos 1° (0xc4d9d0, 0x80c5f8). 0x610100 pitches a swimmer to ±π/2 when the magnitude of the heading's height part is above 0.86602 (0x80c4d4, 0x6101bb), to its asin when above 0.17364 (0x80c4d8, 0x6101f5), else to 0; a threshold value or a NaN takes the lower form. Slices: b2_speed_from_timer_difftest 0x610aa2-0x610aee.