#1902 closed enhancement (fixed)
[PATCH] Color hero icon based on health
Reported by: | fabio | Owned by: | Michael |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 16 |
Component: | UI & Simulation | Keywords: | simple patch |
Cc: | Pureon | Patch: |
Description (last modified by )
It would be nice to have the hero icon become reddish when his health is low. Similar to the building icon when you have not enough resources to build them.
Attachments (5)
Change History (32)
comment:1 by , 11 years ago
Milestone: | Backlog → Alpha 14 |
---|
follow-up: 4 comment:2 by , 11 years ago
comment:3 by , 11 years ago
Component: | Core engine → UI & Simulation |
---|---|
Description: | modified (diff) |
Keywords: | simple added |
Summary: | color hero icon based on healt → Color hero icon based on health |
comment:4 by , 11 years ago
Replying to historic_bruno:
What about something blinking? That could be annoying if done improperly (so we do it tastefully ;))
I think a 'pulsating' effect would be tasteful, and in line with what other games do. Unfortunately, I don't think this can currently be done with the existing GUI engine?
comment:5 by , 11 years ago
Alternatively a health bar like this could be added: http://medialib.computerandvideogames.com/screens/dir_1477/image_147776_thumb_wide940.jpg
comment:6 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:7 by , 11 years ago
Need to upload a patch now. Was a trivial change in session.xml and session.js
comment:8 by , 11 years ago
Something like this (top left) would be cool. http://www.armchairempire.com/images/Reviews/pc/rise-fall-civilizations-war/rise-fall-civilizations-war-2.jpg
comment:10 by , 11 years ago
Milestone: | Alpha 14 → Alpha 15 |
---|
comment:11 by , 11 years ago
Milestone: | Alpha 15 → Backlog |
---|
comment:12 by , 11 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:13 by , 11 years ago
Keywords: | review added |
---|---|
Milestone: | Backlog → Alpha 14 |
Owner: | set to |
Status: | new → assigned |
Sorry got back from vacation and was sorting through stuff. So this basically adds an overlay in the XML file which remains hidden unless the hero's health hits 50% or below.
JS new lines added: 477-479; XML new lines: 796
by , 11 years ago
Attachment: | hero_colors.diff added |
---|
comment:14 by , 11 years ago
Next time it's better if you add a diff (a lot smaller, easier to review, and easier to apply).
As for the change itself, IMHO, becoming red when below 50% health is a bit quick. I'd probably change it to orange first, and red only when it's below 25, or even lower.
comment:15 by , 11 years ago
Keywords: | patch added |
---|---|
Summary: | Color hero icon based on health → [PATCH] Color hero icon based on health |
The overlay should be re-hidden if the hero's health returns to above the threshold (from healing or regen).
I agree with sanderd17 that the red overlay may be overkill at 50% health. But it's also ugly and doesn't really catch my eye, would we be better showing a health bar, and blending it from green to red or something as health decreases?
follow-up: 17 comment:16 by , 11 years ago
To have colour changing by health, this would be a nice formula:
var hpp = heroState.hitpoints / heroState.maxHitpoints; var red = 255; var green = 255; if (hpp > 0.5) red = Math.round((1-hpp)*2*255); else green = Math.round(hpp*2*255); getGUIObjectByName('heroOverlay').sprite="colour: "+red+" "+green+" 0 60";
Then it will go smoothly from green over yellow and orange to red (at 50%, it will be yellow). As for where to use that colour (as overlay, or on a health bar), I don't really have an opinion without seeing the different options. But the current one does look a bit weird indeed.
follow-up: 19 comment:17 by , 11 years ago
I agree with sanderd. I simply uploaded the work I did way back and thats how it was specified. I like the idea of gradual change of overlay color better than an additional bar. It does not create clutter and it conveys subtle but noticeable message to the player.
comment:18 by , 11 years ago
Following specifications isn't always needed. maybe it looks better when the opacity is lighter or something. Can you pull off something nice for A14 (I think we should also ask an artist to comment on this)?
comment:19 by , 11 years ago
Cc: | added |
---|
Replying to Geek377:
I agree with sanderd. I simply uploaded the work I did way back and thats how it was specified. I like the idea of gradual change of overlay color better than an additional bar. It does not create clutter and it conveys subtle but noticeable message to the player.
It wouldn't be clutter, only a few pixels on the side, the same style as the health status bars in the unit details panel. The bonus is it would indicate the exact health level without obscuring the hero portrait :)
comment:20 by , 11 years ago
Milestone: | Alpha 14 → Alpha 15 |
---|
comment:21 by , 10 years ago
Keywords: | design added; review removed |
---|---|
Milestone: | Alpha 15 → Backlog |
comment:22 by , 10 years ago
I added a patch which
- adds a health bar to the hero
- creates a faded colour overlay in case the hero gets attacked
Any comments on this ?
comment:23 by , 10 years ago
Keywords: | review added |
---|---|
Milestone: | Backlog → Alpha 16 |
Owner: | changed from | to
Status: | assigned → new |
by , 10 years ago
Attachment: | savegame_hero_health_overlay_test.0adsave added |
---|
Save game to test the new hero features. (r14504)
by , 10 years ago
Attachment: | hero_health.patch added |
---|
Hero healthbar and faded color overlay in case of attack.
comment:24 by , 10 years ago
@sanderd17: (Checking, if heros health changed; see session.js: var g_heroHitpoints)
It should be possible to get the change of the health points using the AttackDetection class but I think this might be an overkill because it would have to loop always through the list of all ongoing attacks.
The minimap notification is handeled by the Engine. (see AttackDetection.js :35)
by , 10 years ago
Attachment: | hero_health_v2.patch added |
---|
Adapted coding style on sanderd17's recommendation.
comment:26 by , 10 years ago
Keywords: | review design removed |
---|
What about something blinking? That could be annoying if done improperly (so we do it tastefully ;)) but is more attention grabbing than a color change alone. A sound would also be helpful, some kind of horn or unique battle-type sound.