[patch] Graphical Combat Summary

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderators: Committer, Committer

Message
Author
Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

[patch] Graphical Combat Summary

#1 Post by Mitten.O » Fri Oct 03, 2014 7:53 pm

After the extended game of battleship that the sdl migration is, I wanted to take a break and do some fun GUI stuff.

Since there is very little tactical depth for now, the most interesting information after a battle is how many of mine survived and how many of theirs. Also the resulting healths of the surviving ships are of interest. I made a graphical combat summary that displays all this information at a glance, with plenty of possibilities to expand it with more information. It is intended to make sense, so please take a look at the screenshots in this post before reading the more detailed explanation in the next one to get a feel of how much you feel you can get out of the summary without explanation.

Breaks savegame compatibility, since the current health in the past needs to be stored to make it possible to look at combat reports of past turns.

BTW. There is a segfault on exit not caused by this, since it appears on master.
Attachments
graphical_summary.png
graphical_summary.png (38.8 KiB) Viewed 1634 times

[The extension patch has been deactivated and can no longer be displayed.]

Any code by me in this post is released under GPL 2.0 or later.

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Graphical Combat Summary

#2 Post by Mitten.O » Fri Oct 03, 2014 7:54 pm

Explanation: the x axis is a fleet health bar. The x axis scale is shared between empires. The health is broken into contributions of each ship in the fleet. The dead are collected to the right, where their width is their max health. The bars of individual ships show their max health in red and current health in green. The y axis scale is not shared between empires. This is open to discussion, but the main problem is the huge health of monsters scaling the others too low.
Any code by me in this post is released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12571
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Graphical Combat Summary

#3 Post by Geoff the Medio » Fri Oct 03, 2014 8:14 pm

Mitten.O wrote:It is intended to make sense, so please take a look at the screenshots in this post before reading the more detailed explanation in the next one to get a feel of how much you feel you can get out of the summary without explanation.
I have no idea what I'm looking at... except that the fleet health text should probably be next to the name it applies to, rather than slightly above the next row's name.

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Graphical Combat Summary

#4 Post by Mitten.O » Sat Oct 04, 2014 11:43 am

I labeled the other axis and added tooltips to the bars.

EDIT: Missing change in patch.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

graphical_summary.2.png
graphical_summary.2.png (28.72 KiB) Viewed 1622 times
Any code by me in this post is released under GPL 2.0 or later.

User avatar
Sloth
Content Scripter
Posts: 685
Joined: Sat Mar 17, 2007 12:28 am

Re: [patch] Graphical Combat Summary

#5 Post by Sloth » Sat Oct 04, 2014 3:36 pm

I like the idea of being able to view a combat report.
Mitten.O wrote:Explanation: the x axis is a fleet health bar. The x axis scale is shared between empires.
If i understand it correctly, the length of the x axis is the sum of both fleet health'. Wouldn't it be better for it to be the maximum of the two fleet health'?
That would lead to less empty space.
All released under the GNU GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0 licences.

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Graphical Combat Summary

#6 Post by Mitten.O » Sat Oct 04, 2014 6:15 pm

The x axis is actually scaled to fit the maximum of their full healths. That makes sure there is always room for the dead, whose widths are based on their maximum health to see quickly how big ships were killed.
Any code by me in this post is released under GPL 2.0 or later.

User avatar
em3
Vacuum Dragon
Posts: 605
Joined: Sun Sep 25, 2011 2:51 pm

Re: [patch] Graphical Combat Summary

#7 Post by em3 » Tue Oct 07, 2014 12:29 pm

I'd drop the axes, especially the horizontal one, as it is not, in fact, an axis in mathematical sense. For one, it does not really represent fleet health (but is labeled as such).

I'd also suggest that all health bars should have their width proportional to max health, not current health.
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

User avatar
Dilvish
AI Lead, Programmer
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Graphical Combat Summary

#8 Post by Dilvish » Tue Oct 07, 2014 5:04 pm

em3 wrote:I'd drop the axes, especially the horizontal one, as it is not, in fact, an axis in mathematical sense. For one, it does not really represent fleet health (but is labeled as such).
But if we drop an axis from a 2-D chart won't we be left with a simple line or single bar? :lol: Since the total span of each set of bars (surviving ships & destroyed ships) is directly scaled from a respective sum of ship healths (current healths for surviving ships and max health for destroyed ships), I'm puzzled by the assertion that it is not a mathematical axis-- could you explain the assertion a bit more? Does it help you to explicitly discuss the 'X' axis instead as two axes, an X1 axis extending from the left and an X2 axis extending from the right? I haven't looked at how this plotting is actually being done, but if I were doing it with matploltlib that X1 and X2 setup is how I'd do it.

If what you meant was to drop the axis label (s), by itself that doesn't seem an improvement to me. Since both X1 and X2 are measuring cumulative ship health, and have the same scale, the general idea of having a single label seems reasonable, though perhaps not ideal here, and I'd agree that what is there so far seems to fall short of well conveying the full meaning in this case. I'm not sure if it would reasonably fit it into available space, but here is a proposal: Call them all Ships, not Units, even if that sounds a tad odd for monsters. Take the "Fleet Health X/Y" label and combine it with the empire name, across the top. One the left side, instead of an empire-colored "Unit Health" in the middle, make it a red "Ship Damage" at the top and a green "Ship Health" at the bottom, and use that same red color for the label, the red portion for surviving ships, and the red fill for destroyed ships. Below the horizontal axis, if there are any surviving ships then on the left side have a green "Surviving Ships" and if there are any destroyed ships then on the right side have a red "Destroyed Ships".
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Graphical Combat Summary

#9 Post by Mitten.O » Mon Oct 13, 2014 8:12 am

em3 wrote:I'd also suggest that all health bars should have their width proportional to max health, not current health.
Doing that would make the x axis not be an axis. There would be no way to see the current health of the fleets compared to each other without reading numbers.

The units can be ships, monsters or even planets. I agree that unit is a bit weird, but "ship" just does not cover all the things.

I combined the header with the x label as suggested and added a label for the dead units.

On more detailed labeling of the y axis: I don't think it is unreasonable to expect the user to understand that a bar that is partly red and partly green means that the green is health that is left. This is pretty universal symbology here. There is even a label that explicitly says the bar is talking about health. On top of that, there are the tooltips.

I drew a fake cursor and tooltip on this screenshot, because both fail to be visible in the screenshot, since screenshotting takes focus away from the window.
Attachments
summary_label_combined.png
summary_label_combined.png (21 KiB) Viewed 1572 times

[The extension patch has been deactivated and can no longer be displayed.]

Any code by me in this post is released under GPL 2.0 or later.

User avatar
em3
Vacuum Dragon
Posts: 605
Joined: Sun Sep 25, 2011 2:51 pm

Re: [patch] Graphical Combat Summary

#10 Post by em3 » Mon Oct 13, 2014 10:40 am

Mitten.O wrote:
em3 wrote:I'd also suggest that all health bars should have their width proportional to max health, not current health.
Doing that would make the x axis not be an axis. There would be no way to see the current health of the fleets compared to each other without reading numbers.
Ah, yes. Looking at it again I see, that the rectangles sum up to the health of the fleet. So the x axis label does make sense, after all. My mistake.

Other suggestion - instead of "green/red" use "empire color/darkened empire color".
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: [patch] Graphical Combat Summary

#11 Post by Mitten.O » Mon Oct 13, 2014 11:17 am

em3 wrote:Other suggestion - instead of "green/red" use "empire color/darkened empire color".
I thought of something like that, but I feel the red/green makes it more obvious that they are health bars. It was the color scheme which made me think it would be ok to not even label the y axis, but I labeled it after it was found confusing without it. I still think the colour scheme together with the tooltips should be enough, but I have the label there just in case.

EDIT: What would you think of making the arrows have the empire colour?
Any code by me in this post is released under GPL 2.0 or later.

User avatar
em3
Vacuum Dragon
Posts: 605
Joined: Sun Sep 25, 2011 2:51 pm

Re: [patch] Graphical Combat Summary

#12 Post by em3 » Mon Oct 13, 2014 1:57 pm

Mitten.O wrote:
em3 wrote:Other suggestion - instead of "green/red" use "empire color/darkened empire color".
I thought of something like that, but I feel the red/green makes it more obvious that they are health bars.
That's highly subjective, I guess.
EDIT: What would you think of making the arrows have the empire colour?
I rather like the white of axes as a recurring separator and would vote for keeping it that way.
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

User avatar
Dilvish
AI Lead, Programmer
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Graphical Combat Summary

#13 Post by Dilvish » Thu Nov 06, 2014 4:26 pm

So, Geoff, how is this last version looking to you? I am finding this to be a helpful display.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12571
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: [patch] Graphical Combat Summary

#14 Post by Geoff the Medio » Thu Nov 06, 2014 4:35 pm

Dilvish wrote:So, Geoff, how is this last version looking to you?
From the last posted screenshot, I don't know what the width of the bars means.

I also wonder what happens if there are more than two empires (including neutrals) in a battle.

User avatar
Dilvish
AI Lead, Programmer
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: [patch] Graphical Combat Summary

#15 Post by Dilvish » Thu Nov 06, 2014 8:29 pm

Starting with your second concern first, since it's the simplest to answer:
Geoff the Medio wrote:I also wonder what happens if there are more than two empires (including neutrals) in a battle.
A graph is provided for each empire involved in the combat (and each graph indicates the respective empire); they are all stacked vertically.
From the last posted screenshot, I don't know what the width of the bars means.
Hmm, yes, there should be some explanation in a relevant pedia article somewhere; my feeling is that trying to put a more explicit explanation of that particular aspect on the graph itself would be more clutter than it is worth. The significance of the bar widths is somewhat intuitive and I think can also be reasonably gleaned from use over time with reference to the tooltips for each bar-- the width for surviving ships/units is proportional to their current health and so gives a graphical indication of how much each survivor contributes to the overall remaining health of their fleet; the width for dead ships is proportional to their max health and so gives some graphical indication of the significance of the ships killed. (Of course there could be different ways of assessing and showing significance, this is just one reasonable way.) It seems to me that these are nuanced, noncritical, helpful indicators and better than just having each bar be the same fixed width even if the meaning may initially be merely suggestive and not entirely obvious.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply