NPCs have no move-speed mask, which blocks NPC running #27
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
World.Player.report_speed/2tells the client how to render a player's movement,derived from the step the tick actually took. NPCs have no equivalent: nothing in
the NPC info encoder sets a move speed.
This is harmless today because NPCs only ever walk one tile per tick, and the
client's default for a slot is walk. It stops being harmless the first time an
NPC needs to run — combat pursuit is the obvious one — because the NPC info
packet carries distance in its movement bits the same way the player one does,
and speed in a separate mask that is not inferred from it. A two-tile NPC step
with no speed mask is animated at walking pace, the client's render queue for
that NPC falls behind by a tile every tick, and once it saturates it starts
discarding queued tiles.
Same defect class as the player-side one, same symptom: the model drawn several
tiles from where the server has it, sliding between hops.
Worth building alongside NPC running rather than before it, but the mask should
be identified and reserved now so the movement work does not have to be revisited.
Closing — the premise does not hold for rev 149. There is no NPC move-speed mask to identify or reserve, because NPC render speed is not carried by the mask block at all.
method708reads the movement type and hands it straight toNPC.method1663(direction, speed), which stores it on the queued tile itself:1for the single 3-bit step of type1, and2for each of the two steps of type2. The sharedActorrender loop then readspathTraversed[pathLength - 1]and doubles its per-cycle advance when it is2— the same doubling the player path reaches throughPlayers.field1487, off a different source.So type
2is the run mask.{:run, first, second}is already the whole of what an NPC needs to run correctly, and the encoder emits it today. The mask block has nothing spare to reserve either: all seven of its bits are taken by other fields and the eighth,0x80, is never tested inmethod784.The player-side defect this was modelled on is real; the two paths just carry speed differently, and only the player one needs a mask. Combat pursuit needs a server that gives an NPC two steps in a tick, and nothing in
Network.Game.NpcInfo.Written up in the
NpcInfoandNpcInfo.Maskmoduledocs (99a7c76) so the next person to look does not re-derive it.