-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Enemy Health Bar #3035
Conversation
soh/soh/SohMenuBar.cpp
Outdated
UIWidgets::PaddedEnhancementCheckbox("Enemy Health Bars", "gEnemyHealthBar", true, false); | ||
UIWidgets::Tooltip("Renders a health bar above enemies when Z-Targeted"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm torn between this being added under "Enhancements > Graphics", or "Enhancements > Gameplay"
Looking for feedback on placement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would argue for gameplay since we're effectively changing the state of the game in a minor manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed with Enhancements > Gameplay
|
||
// Build vertex coordinates for a quad command | ||
// In order of top left, top right, bottom left, then bottom right | ||
void Interface_CreateQuadVertexGroup(Vtx* vtxList, s32 xStart, s32 yStart, s32 width, s32 height, u8 flippedH) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to trying this out on kaleidoscope 🔥
// For alpha supported options, retain the last set alpha instead of overwriting | ||
if (cosmeticOption.supportsAlpha) { | ||
newColor.a = cosmeticOption.currentColor.w * 255; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this PR enables support for alpha control in the cosmetic editor (on supported options, currently only the health bar), I decided that alpha should not be change for rainbow and randomize.
Randomizing alpha seems like a weird idea. My thinking is that the user can choose their own alpha (i.e. a 50% opacity health bar), and then they can still randomize/rainbow it while keeping the alpha they chose.
Looking for feedback here on this decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, randomizing alpha feels odd to me, i'm on board with this decision
Maybe a new GameInteractor Hook is in order for these situations? i.e. an |
I don't actually have the list of enemies that treat health differently. That statement was more so a reflection of decomp mentioning that colíder health isn't used for all actors. This mostly applied for bosses, which I have omitted in this PR. I think eventually it will be useful to have it for bosses and any other edge cases. But I was considering treating boss health bars in a different way (large bar at the top maybe). I figure that could be v2 territory. |
Oh yeah agreed v2 territory, just spitballing something that could make it easier to handle all forms of enemy health in the future. Bosses are especially tricky when you get to stuff like Barinade that don't track their health in a traditional way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
That's a great idea! I may have some suggestion on the V2 side of it.
Allowing players to choose whether a mask (maybe the Mask of Truth?) can be used to show the life bar (or not), similar to the Amulet in The Wind Waker. It would offer more customization options.
Additionally and because of my last point, it might be worth considering the possibility of implementing further quality-of-life improvements for other masks in the future?
* add enemy health bar * add more cosmetic editor options to health bar * add tooltip * fix enemy health texture when no magic bar
* add enemy health bar * add more cosmetic editor options to health bar * add tooltip * fix enemy health texture when no magic bar
This adds an enhancement to display health bars above enemies when Z-Targeted.
This health bar is rendered by reusing the magic bar textures with a red color by default (supports cosmetic editor overrides). The health bar is placed above the actors projected target center by following similar logic of the Z-Target placement. The health bar will slide in from the top edge of the screen, mimicking the Z-Target triangle fly in effect.
In HUD placements, the health bar can either be anchored to the actor, or anchored to the top/bottom edges. The up/down offset values apply to all anchor positions, where as left/right apply only to top/bottom anchor types. The health bar width can be changed from here as well.
The actor struct was updated to add a new
maximumHealth
property that is set after init, to track the total health of all actors.Some enemies may use their own health calculation outside of the collision health, meaning the bar may not drain in those instances.
This health bar will only apply to enemies and not bosses. In a future PR, I will investigate what it would take to add boss health bars.
enemy-health-bar.mp4
Other additions in here is adding support for alpha setting in the cosmetic editor. When enabled, randomize/rainbow changes will retain the last set alpha value. This allows the enemy health bar to have an alpha applied to it. This is controlled by
supportsAlpha
.Similarly, there was a
supportsRainbow
flag, but it wasn't hiding the rainbow toggle. Now it is.Build Artifacts