MantisBT - VCMI
View Issue Details
0000949VCMIGUI - Battlespublic2012-05-04 10:492023-04-11 11:53
0000949: Add projected attack outcome hintbox when mouse is over enemy unit stack
In the new King's Bounty (KB - The lgened and KB - Armored Princess) games there is a very neat in-battle feature, which I think would be great to have in VCMI.

In a battle, when you place the mouse over an enemy unit it it pops hintbox over the enemy unit which displays a projected attack outcome, i.e. shows a message which reads kind of like: "damage - 370 HP, kills - 24 units", meaning that an attack (with your currently selected unit) against this enemy unit stack will result in 370 health points of damage against this enemy stack and would kill 24 units from the stack.

This makes it easy for the player to estimate which enemy stack would incur the most damage from their current unit.

Even though simply trying to incur the most damage with each of your units is not always the most beneficial strategy, there are many battles when this indeed WOULD BE the most beneficial one. In any case this feature would give the player more info and more predictability when planning their moves and would remove some unnecessary element of randomness and "guestimation" from the battles.

Will see if I still have KB installed and will try to add a screenshot here to illustrate this feature.
No tags attached.
? kb-projected-attack-result-256.bmp (239,158) 2012-05-07 17:06

patch show-kills-on-hover-over-enemy-stack.patch (44,710) 2012-06-15 14:33
? BatEstBG.bmp (15,182) 2012-06-19 15:22
Issue History
2012-05-04 10:49ench0New Issue
2012-05-04 13:55majaczekNote Added: 0002402
2012-05-07 17:06ench0Note Added: 0002408
2012-05-07 17:06ench0File Added: kb-projected-attack-result-256.bmp
2012-06-15 14:33ench0File Added: show-kills-on-hover-over-enemy-stack.patch
2012-06-15 14:35ench0Note Added: 0002692
2012-06-15 14:38ench0Note Edited: 0002692bug_revision_view_page.php?bugnote_id=2692#r1725
2012-06-15 14:39ench0Statusnew => feedback
2012-06-15 14:43ench0Note Edited: 0002692bug_revision_view_page.php?bugnote_id=2692#r1726
2012-06-15 14:44IvanNote Added: 0002693
2012-06-18 16:14ench0Note Added: 0002746
2012-06-18 16:14ench0Statusfeedback => new
2012-06-18 18:09IvanNote Added: 0002752
2012-06-18 18:35douggie_mNote Added: 0002753
2012-06-18 18:38douggie_mNote Edited: 0002753bug_revision_view_page.php?bugnote_id=2753#r1758
2012-06-19 15:22ench0Note Added: 0002756
2012-06-19 15:22ench0File Added: BatEstBG.bmp
2012-06-19 15:24ench0Note Edited: 0002756bug_revision_view_page.php?bugnote_id=2756#r1762
2012-06-19 16:47IvanNote Added: 0002757
2023-04-11 11:53IvanNote Added: 0008532
2023-04-11 11:53IvanStatusnew => resolved
2023-04-11 11:53IvanResolutionopen => fixed
2023-04-11 11:53IvanAssigned To => Ivan

2012-05-04 13:55   
Yeah please include it. It's already done in Yona mod for ERA (but with a bit another syntax).
2012-05-07 17:06   
Explanation of added screenshot.
- The currently active unit are my Beholders. This is indicated by the greenish runic-like aura the movement shadow underneath them.
- My mouse pointer is over the enemy Skeleton Archers (the ugly mouse pointer is just for illustration purposes, coz I cant capture the mouse in the screenshots).
- The Beholders are a shooting unit, meaning they can deal damage to the enemy unit currently under the mouse pointer, and so a hint box pops up. My Beholders would deal between 138 and 259 dmg to the skeletons killing between 17 and 32 of them.
2012-06-15 14:35   
(edited on: 2012-06-15 14:43)
I have a first cut of this feature (see the patch file show-kills-on-hover-over-enemy-stack.patch, based on revision 2753).

It is usable and helpful, but is still pretty raw so maybe someone more experienced could take a look and polish it up a bit?

To enable this feature both "View Cursor Shadow" and "View Movement Shadow" must be enabled in the battle settings.

- What I tested works, i.e. it does the job of providing the player with helpful info of how many enemy creatures would be killed by the player's active stack should they attack this enemy stack. When hovering the mouse over an enemy stack you will see a message "Kills Y to Z" displayed to the right of the enemy stack.

The BAD:
- The implementation is probably conceptually incorrect, because at present it is just some logic in CBattleInterface, whereas the proper approach would probably be to put it into some more appropriate class (BattleInfoCallback?) as a method.
- It uses a CLabel object to display the info. Kinda ugly...
- The message is displayed to the right of the (main) hex of the enemy stack which results in the following problems: a) part the message may go out of the screen, particularly in the beginning of the battle when all enemy creatures are at the far right of the screen; and b) the message is displayed over rear hex of a "big" creature, e.g. a dragon.
- Need to change the message to say "Kills N" when the projected enemy death toll is not a range of two diff numbers but just one number.

What was tested:
I tested with my hero attacking some creatures on the map. None of the more "fancy" battle types have been tested, like: creature banks, hero-vs-hero battles, siege battles, etc.

- - -

... that's about all that comes to mind atm.. Like I said it is kinda raw :) But at the very least it provides some framework and entry points to insert the appropriate calls of a possible better future implementation...

2012-06-15 14:44   
2 out of 3 issues can be solved by moving text to status bar. H3 interface does not have any hover messages at all - everything should go to the status bar.
2012-06-18 16:14   
well... it is true that there's no hover windows in the original H3. But we do have the creature info windows which appear when you right-click a creature... So if we want to do it without any hovering messages we could use those, maybe? They are not exactly "on-hover" windows, in that you need to R-click a stack first, but they are the closest thing we got...

I think I don't like the status bar because it is a very old (conceptually old - even at time of original game creation!) UI solution. And definitely not the best one for this particular problem. Your eyes are already at the enemy creature stack and now you gotta look all the way down and find the info in the status bar and link it to the image of the creature on the battleground... To me a small hovering window which appears when you point your mouse to the creature are a much better, more natural approach... Even the R-Click info windows are better than the status bar...

I don't know where you (Ivan) or Tow or any of the other project-"fathers" want to draw the line between "improving H3" and "destroying the H3 look and feel" but IMHO this would be an improvement and I am sure there is a way to implement it without destroying the H3 look and feel... My suggestion would be a very small hovering window with the typical H3 decorations, or if that is deemed not acceptable - then we could put the message into the R-click creature info window..?
2012-06-18 18:09   
R-click is not a good idea IMO. Unlike hover texts it is not subtle - user
1) needs to know about this feature
2) r-click every time he want to find this info.

More logical place for this will be those "help windows" which you can enable in settings (not implemented in VCMI right now).

I agree that status bars are ancient but in case of H3 it also a _consistent_ way to provide information to player - I definitely got habit to look on status bar while playing H3.
In any case replacing status bar with hover text should not be done on per-case scenario but for a whole game.

>> a very small hovering window with the typical H3 decorations
Unfortunately windows decorations in H3 are quite heavy - you'll end up with either unreadable text or quite large 100x250px window.
You'll have to draw or generate in run-time something more light-weight.
2012-06-18 18:35   
(edited on: 2012-06-18 18:38)
Maybe enough "new features from another games"? Maybe just fix existing bugs, go to 1.0, and then try to add all the features from King's Bounty 2012 for Windows, World of Warcraft, and so?

UPD: It's up to devs, anyway. I just told my opinion. Sorry.

2012-06-19 15:22   
(edited on: 2012-06-19 15:24)
>> You'll have to draw or generate in run-time something more light-weight.

Yes I was also thinking along these lines, i.e. take only the border decorations and draw a window using those. I am attaching a bitmap with a sample window so its clear what I mean. This one is 164x86... is this considered large, I dunno..? It could probably be shrunk some more without it looking ugly (I am not a graphics artist, I just drew this for illustration purposes)

2012-06-19 16:47   
>> Maybe enough "new features from another games"?

You have a point. But ench0 is not a dev so no harm done I suppose.

>> I am attaching a bitmap with a sample window so its clear what I mean.

I was more thinking about something similar to KB: filled with black rectangle with 1px yellow border.
On your image area where you can't place text is still pretty big - ~20px on each side. This is mostly due to that large ornament in corners.

Check for hover texts in any program\game\etc. - they are always as minimal as possible.
2023-04-11 11:53   
Kill count estimate is implemented in 1.2