Posted by: ZylonBane
« on: 12. March 2020, 00:13:37 »Dark just renders a percentage of the width of the health bar bitmap equivalent to the AI's current HP / max HP. At certain percent thresholds it swaps out the bitmap for a second and third variant so it can change color from yellow to red as health drops. It's nothing like the Thief system where each health shield directly represents a hit point.
The trick to doing non-bar type health indicators is that each successive health bar bitmap is exponentially wider. For example in the Vague Health Bar mod, it displays "Critical" at low health without being visibly cropped on the right because that bitmap is 1024 pixels wide, but it's entirely transparent except for the text on the left. So even at 10% health, the left ~100 pixels will still be there. Sure, if you managed to whack a Rumbler down to exactly 1 HP you'd probably see it get cropped a bit, but for the most part it works.
The trick to doing non-bar type health indicators is that each successive health bar bitmap is exponentially wider. For example in the Vague Health Bar mod, it displays "Critical" at low health without being visibly cropped on the right because that bitmap is 1024 pixels wide, but it's entirely transparent except for the text on the left. So even at 10% health, the left ~100 pixels will still be there. Sure, if you managed to whack a Rumbler down to exactly 1 HP you'd probably see it get cropped a bit, but for the most part it works.