Skip to content

Nameplate health fraction assumes 100 max HP, so a training dummy reads wrong #21

Description

@WilsonNet

Summary

Match spawns every fighter entity with fighter.maxHp = 100 and nothing ever
updates it. That is correct for every human and bot, and wrong for a training
dummy
, whose HP is configurable (TrainingConfig.dummyHp).

A dummy configured with dummyHp: 200 shows a full bar at 200 HP and a full
bar at 100 HP, because the fraction is clamped to 1. A dummy with dummyHp: 50
shows a full bar the moment it is above 50.

Why it is minor, and why it is still worth fixing

Nobody is misled in a real match — everyone has 100 HP there. It only shows up in
the training room, which is the one place the numbers are supposed to be exactly
right, because it is the instrument other measurements are taken with. A health
bar that lies in the tool used to check whether an uppercut beat a guard is the
wrong kind of wrong.

Cause

maxHp is client-side guesswork. The server knows the real value —
ConnectedPlayer.hp is initialised from dummy.config.dummyHp — but it is not on
the wire. training-state already carries the resolved config to the client, so
the training room has the number; the nameplate simply is not reading it.

Suggested approach

Cheapest correct fix: have TrainingRoom set fighter.maxHp on the dummy's
entity from the echoed config. No wire change, and it keeps maxHp out of the
snapshot, which is the right call for a value that is 100 for every fighter that
is not a dummy.

Definition of done

  • A dummy at dummyHp: 200 shows a half-full bar at 100 HP.
  • The training probe asserts it, so the next person to touch nameplates cannot
    quietly regress it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions