[patch] Graphical Combat Summary

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

Moderator: Committer

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

Re: [patch] Graphical Combat Summary

#46 Post by Geoff the Medio »

Looks pretty good. Two small suggestions:
-Consider giving the window minimum height before the bottom buttons overlap the graphs
-Make it possible to click or right-click bars corresponding to ships to jump to that ship in the fleetwnd?

And some issues:
-If I resize the window while in log view mode, then switch back to the graph view, the layout is messed up until I resize the window again...
-The window bottom/right borders are oddly thick, and the bottom-right resize tag is hard to see / looks odd as result, compared with other windows.

For code, please:
-Indent code within a namespace block
-Put opening braces for a constructor with several variable initializations on its own line, in order to break up the code sections more clearly (and have the {} on its own line if that's all there is to the function body)

I'm inclined to commit anyway, and hope for an update patch...

Also:
-I feel like you could do some good on the empire statistics graphs display...
Attachments
layout after switching back to graph view after resizing in log view
layout after switching back to graph view after resizing in log view
combat_layout.png (11.48 KiB) Viewed 1338 times

mel_o
Space Floater
Posts: 26
Joined: Tue Mar 10, 2015 8:23 am

Re: [patch] Graphical Combat Summary

#47 Post by mel_o »

I've been following this project for a while (excellent game so far btw) and since I recently got MSVC working I decided to familiarise myself with the codebase. So far I've played around with the graphical summary idea and got a basic alternate design working, based on Mitten.O's code. I apologise for jumping in on this feature but I had a few ideas I wanted to try. :)

I'm personally a fan of the 'equal bar widths' style -- the abscissa of a bar graph already denotes the discrete categories (each battle participant in this case) and giving it an extra meaning clutters things and makes the graph harder to parse at a glance IMO. You can already figure out the approximate fraction of max/current fleet health contributed by a given ship by comparing the length of its bar to the rest of the fleet.

I used horizontal bars to make comparison of ships between empires easier. The fleet total bars also have a different scale from the individual ship bars, I'd like to make that more obvious from the design itself though... Haven't tested it yet with planets invovled or with hundreds of ships, and there's an unfortunate choice of empire colour for the Commonwealth in the screenshot but let me know what you think of the design. Don't mind the debug readouts, I'll make sure the relevant stuff gets to the log instead :P I could neaten this up, add axes & a scale, etc. and implement this as another tab alongside Mitten.O's design (couldn't have done this from scratch so thanks for putting up your patch) and post a patch if people approve of it.

P.S. I noticed that on svn 8018 that if I resign while the Combat Report window is open, it remains open. Starting a new game closes it. I could look into that also if it hasn't been sorted out yet.
Attachments
combat report 3.png
combat report 3.png (26.98 KiB) Viewed 1325 times
Unless stated otherwise, code and scripts provided by me are released under GNU GPL 2.0 (or later) and other content is released under CC BY-SA 3.0.

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: [patch] Graphical Combat Summary

#48 Post by MatGB »

Playtest feedback.

On first glance, I hated it, and changed the settings multiple times with the smaller skirmish fights that you get in the beginning. Just had my first actual fleet battle.

It's awesome. Really nice job. I'll go through the en.txt wordings ASAP to fix a few grammar errors and similar, but I really like it.

Edit: Referring the the version in the most recent test release, SVN #8019.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: [patch] Graphical Combat Summary

#49 Post by Mitten.O »

@mel_o: Your design certainly succeeds in being immediately obvious and unambiguous. Those are the weak points of my design, so good work there. But I believe that once you get used to mine, you get the relevant information more concisely and elegantly. Plus, I think the color scaly one just looks cool.

I would not object to having your design on a tab if the people who find mine confusing feel it would be nice. I myself am not convinced that is necessary, but I don't have a lot of time in my hands right now, so having someone else fix obvious bugs in the summary would be exquisite. I have (now distant) dreams of adding more tabs to the window myself, so having one extra wouldn't hurt. What would be even better is if you managed to expand the framework I created for the various settings to be generic enough to contain you design as just another combination of settings. A "separate graph for total fleet health" should not be too hard, but "Use horizontal bars" would be pretty challenging. Maybe even crazy. Do what you feel is best, but to get anything but a lukewarm reception from me to a conventional design, the effect on the lines of code will need to be reasonable. The confused ones may feel differently. (I like how negative a term I managed to entirely naturally use for people who don't like my graph :twisted: )

Hmm... perhaps I'll share some of my tab notions, in case you get inspired and feel like doing something about them yourself. I was thinking of having a graphic that would help the player understand how damage occurred in the battle. The current graphs answers the question "how badly was each ship hurt?". I would like to answer also the questions "How much damage did each ship (type) deal?", "How did shields effect the damage that occurred in this battle?" and "How much damage was wasted on shooting incapacitated planets or already dead ships?". I was originally thinking of having that information in the same graph as the health; believe it or not, this thing that most had trouble interpreting was meant to be a simple starting off point for a way to show much more information. After all the tuning that was required to make even this one understandable, I now think we need a separate tab for such damage analytics. Not that they are very relevant until we get tactical orders and/or more types of weapons.

@MatGB Glad you like it. It does suffer a bit in very small fights. I'm not sure what, if anything, to do about that. Some settings are better than others for them.

@Geoff I'll put the issues you found on the top of my "stuff to do when have time for freeorion" pile. No promises about when I get to the pile, though.
Any code by me in this post is released under GPL 2.0 or later.

mel_o
Space Floater
Posts: 26
Joined: Tue Mar 10, 2015 8:23 am

Re: [patch] Graphical Combat Summary

#50 Post by mel_o »

Thanks for the feedback. I think this is definitely worth pursuing further because a "post-combat summary" will be increasingly useful as the game gets more tactical depth and some of the features added while implementing this could be useful elsewhere.

I suggested a separate tab so that people could use whichever design they prefer, but as you mentioned, a more robust solution would be to make it more configurable. To that end, I think it would be helpful to implement some UI controls such as a bar graph control which could handle e.g. sizing of bars and their orientation which could also be used to generalise the MultiMeterStatusBar (if that would be useful in the future). Also, a pet peeve of mine is that the ListBox requires the top of the control to always be lined up with the top of an element which would be an issue for rows that are taller than the height of the container and would require breaking them down into smaller elements.

I did have more ideas for information to display and I think we are looking in similar directions here -- I would like to hear those ideas of yours (and ideas from anyone else!) but I think I'd rather work on the UI stuff I mentioned above and making sure that everything I've added makes use of user configurable options (stringtables, colour options etc). Right now, adding more information to this summary would require having more information available in the CombatLog (and CombatParticipantState, and CombatEvent, etc.) plus adjusting the serialisation and I'd rather not get into that :P . For example, I could add a yellow section to the health bars that shows each unit's previous health (and therefore how much damage it has taken) by reconstructing the damage taken from the AttackEvents, but that doesn't take into account structure repair from organic/robotic hulls. Could probably work around that by detecting hull type/techs researched but that's just a headache waiting to happen and having prev_health or similar available in the participant state would be the way to go.

I've dealt with the graph-not-resizing-when-you-switch-to-its-tab issue that Geoff mentioned, can upload a small patch for that once I update my local copy to the latest SVN.

EDIT: Is there a style guide that I should be following?
Unless stated otherwise, code and scripts provided by me are released under GNU GPL 2.0 (or later) and other content is released under CC BY-SA 3.0.

mel_o
Space Floater
Posts: 26
Joined: Tue Mar 10, 2015 8:23 am

Re: [patch] Graphical Combat Summary

#51 Post by mel_o »

Sorry for the double post but I have a bugfix patch ready, hopefully in time for the git migration.

It addresses some of the graphical layout and code layout issues brought up earlier such as proper sizing & layout of the graphical summary when first opening it/switching from the other tab, preventing the buttons from overlapping the graphs, hiding the graph window after resigning, moving curly braces on initializing constructors. Also a couple of extra things like preventing the graph window obstructing the resizing tab and making sure the proportional graph height mode respects the minimum height.

Found the Code Standards page on the wiki, doesn't mention line endings though. We're using LF line endings, yes?
Attachments

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

Unless stated otherwise, code and scripts provided by me are released under GNU GPL 2.0 (or later) and other content is released under CC BY-SA 3.0.

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

Re: [patch] Graphical Combat Summary

#52 Post by Dilvish »

mel_o wrote:We're using LF line endings, yes?
Yes, and I've added that to the coding standards page now.
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
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: [patch] Graphical Combat Summary

#53 Post by Vezzra »

mel_o wrote:Sorry for the double post but I have a bugfix patch ready, hopefully in time for the git migration.
Hm, Geoff will have to review this, and unfortunately he's on the road for, well, I guess another one and a half week. Don't know if he'll get around to it before we make the switch, but that shouldn't be too much of a problem.

Post Reply