PieceOfMind's Advanced Combat Odds

Does this spacing look ok?

By the way, yes I left Survival "odds" in just to make it competely clear, especially for the low setting.

As for the idea of hodling Ctrl making the Everything detail pop up, that sounds neat. You'd have to tell me how to do it though. Is it more likely to conflict with other mods though?

 

Attachments

  • example12.PNG
    example12.PNG
    48.4 KB · Views: 218
Looking very good so far. Putting the survival odds over the color coded display bar was a nice touch. The % for the one hit left survivability % would be clearer if it were split colored, the green section being the victory & yellow being retreat, much like the top survivability bar (but only for the % of barely surviving).
I had another idea, too. We can detect when the shift and/or ctrl keys are pressed and have different detail settings for each. This would let the user set normal to Medium and ctrl to Everything. That way when you want more detail, you don't have to open the options screen (for BUG) or restart Civ (for stand-alone).
Interesting idea. Might make it simpler as well to code, as it would only need two display levels: medium & everything. If it goes this way, make medium default, and holding down ctrl/shift would bring up everything.

Edit:
One last thing, I think the HP for retreat should be green (as it refers to the attacking unit's HP, which in all other respects is green), and the average HP for the defender on a retreat being displayed is redundant, just remove it.
Edit2:
I think average HP should be added to the medium display.
 
Looking very good so far. Putting the survival odds over the color coded display bar was a nice touch. The % for the one hit left survivability % would be clearer if it were split colored, the green section being the victory & yellow being retreat, much like the top survivability bar (but only for the % of 1hit left and living).

I had thought about doing this. I'll see how it looks.
 
Edited into previous post:
One last thing, I think the HP for retreat should be green (as it refers to the attacking unit's HP, which in all other respects is green), and the average HP for the defender on a retreat being displayed is redundant, just remove it.

I think average HP should be added to the medium display.
 
phungus,

I don't wish to add Average HP to the medium display because it already has the average HP conditioned on each outcome. I'm really trying to keep away from overloading the medium setting with much information because it is meant to be the default and I want it to be as approachable as possible.

Regarding the redundant defender HP beside retreat, it's true that it's redundant if you know what you're doing. I'm wondering though, is it usually obvious to everyone that the average HP on attacker retreat or death is the same?

I've decided against colouring part of the attacker's bottom HP value yellow. For a few reasons but mainly that it's not really the point of those bars. There's already enough information about retreat odds I think.
 
I don't wish to add Average HP to the medium display because it already has the average HP conditioned on each outcome. I'm really trying to keep away from overloading the medium setting with much information because it is meant to be the default and I want it to be as approachable as possible.
OK
Regarding the redundant defender HP beside retreat, it's true that it's redundant if you know what you're doing. I'm wondering though, is it usually obvious to everyone that the average HP on attacker retreat or death is the same?
To be honest, it's not that obvious at first, but once you think about it, it is. For some reason, just seeing the same value appear twice, right next to each other just bothers me. I don't know, maybe I'm just being OCD on this, but I simply think it would look better with the defenders survival average HP listed once.
I've decided against colouring part of the attacker's bottom HP value yellow. For a few reasons but mainly that it's not really the point of those bars. There's already enough information about retreat odds I think.
Well, I disagree, I think it would be helpful to see it, it's a visual display, and seeing the split color in that bar will convey information to visually oriented thinkers in a way that the numbers at the top simply can't.

This is just nitpicky stuff though. I think the current versions you've posted look great.

:goodjob:
 
This looks incredible. I have one nitpicky suggestion for the Show Everything mode. The various (attacker) Defeat outcomes should have their order reversed, so that the most damage done to the defender appears on top, and the least on the bottom. That way all the detail lines show a continuum from attacker-unharmed/defender-dead to attacker-dead/defender-unharmed, and the bars will get longer, then shorter, like a proper probability histogram.
 
Version 0.4 has just been uploaded! (link)

I'm just as the compiler merges it with Better AI and then that will be up soon as well.



@The Monster,
I will take your suggestion into consideration in the next version. At a few points I wondered whether the arrangement you described would be more sensible. I'm still not entirely convinced, as I think the way the bars flow at the moment looks good.

EDIT
The mod merged with Better BtS AI v0.60N is now up as well! link
 
Sorry to chime in so late--I gotta sleep sometime! :lol: I like the spacing a lot. It provides a little breathing room. If there is a huge strength difference, are there so many bars shown in the Everything mode that the hover goes off the top of the screen on 1024x768?

I can't decide either about The Monster's idea of reversing the bottom bars. I can see the reason for both methods. Keep in mind that the bars at the top--except when there is a chance for retreat--will form a normal distribution themselves, so reversing the bars won't actually make a single normal distribution. [I'm probably using the term normal distribution here improperly; I mean a bell-shaped curve. It's been way too long since I did any statistics. :blush:]

As for checking for the control key, I don't see how it could interfere with mods. I right-click-hold over a tile to see the odds, but you can also alt-hover as well. Is it possible some other mod uses ctrl-hover/click-hold to do something else? Maybe, but if they merge in this mod, they'll have to account for that (change one or the other). Doing it is trivial, though:

Code:
if (gDLL->ctrlKey())
{
    ...
}

I want to keep the different detail levels and allow control to switch between two presets. I hate taking away options without a good reason. I think this would be too much, but we can also use the shift key. That would allow us to switch between the four detail levels using just those two keys.

  • None: User's choice, Low by default
  • Control: Medium
  • Shift: High
  • Control + Shift: Everything
Or we could use the two keys as toggles. The user specifies their default view and then uses the keys to add in more info. Holding control will add all the non-histogram data (High - AttHP Hist). Holding shift adds the two HP histograms.

Personally, I think both of these schemes are too complicated for most users and will cause more questions. While I'd rather have one of these options since it allows me to see all view modes without going into the options screen, for the mod I recommend sticking with our current two selected modes and use control to toggle between them.

Finally, on the line showing the three R values, would it look better to color them like the other rows, or would that be overkill?

(1.00:4XP) (R=1.25:3XP) (>1.33:2XP)​
 
My only concern is that Better AI reveals information using the debug keys. IIRC buttons like ALT and CTRL reveal tile debug information usually.

Personally, I don't think I'll be using these shortcut keys because I'll probably be using the everything setting all the time! :D

But seriously, I don't think adding more control is a bad thing. When it comes to putting these in BUG it's totally up to you how you want users to be able to control the features. I also would like to preserve at least the four different detail settings over the option of reducing everything to only two settings.

For the more cyan highlighting you suggested, I'm not so sure... It's a bit more complicated because when R is such that you'll get 1 or 10XP, there is only one bracketed thing beside it. Having the R value highlighted only, means you can quickly pick it out. To be honest, it's a line that I don't feel a need to make look particularly pretty. lol

By the way, it might be hard to notice but I stretched out the bars for the detailed HP outcomes. Originally it was 1 pixel per 1%. Now it's stretched by 1.6 making it 1.6 pixels per 1%. To make the bars look nicer, I had to fiddle round for a while and I actually forced a minimum bar length of two pixels (both of the end images). So technically the bars will be slightly off when near about 1%. Very small odds will not make a bar appear at all.
 
IIRC buttons like ALT and CTRL reveal tile debug information usually.

Only if the chipotle cheat code is in the INI, I think. But that's a good point. I play with that on because I'm always testing BUG and have just gotten used to ignoring it. Others may play with it in there to get access to WB, though. It won't cause a conflict, but it will mean that holding control to see the other level of detail will also show the debug info.

I also would like to preserve at least the four different detail settings over the option of reducing everything to only two settings.

Same here. I was only proposing alternate methods of showing those levels. As I said, in the end I think we already have a pretty good method.

Having the R value highlighted only, means you can quickly pick it out.

That reminds me. I wouldn't remove the R value from the line above when the Everything level is used. It's usually bad to have things move in a UI, so having the R value be on one line in one view and then move to another line in another view is confusing. I think it's good to have it above to be highlighted and show it again below. It's redundant, but not overly so.

To be honest, it's a line that I don't feel a need to make look particularly pretty.

It's not about being pretty to me. Color highlighting makes it easier to pick out the numbers for those of us with poor vision. ;) But it's not like that line is overly full of info, so it's your call.

To make the bars look nicer, I had to fiddle round for a while and I actually forced a minimum bar length of two pixels (both of the end images). So technically the bars will be slightly off when near about 1%. Very small odds will not make a bar appear at all.

My original code didn't consider the end caps as part of the bars, so all bars had them, causing the shortest bar to be 2 pixels. Are you saying that you added 2 more pixels? (That's fine) Or are you saying that you double-up the end caps, showing both twice (left, left, bar, bar, . . . bar, right, right)?

And given the 2 pixel minimum, how can very small odds not show up at all? I'm confused. :confused:
 
Re the pixels, it really was a bunch of fudging with them to get it looking right. I know originally the ends weren't being counted as pixels. I only considered this a slight problem because a 0 pixel bar looked like it was half as long as a 2 pixel bar. The odds for various HPs are often very low, like below 1%, so I felt dealing with this issue was necessary.

At the moment on each bar I basically count the two ends of each bar to be one of the pixels. This made it a lot more complicated doing the final attacker HP bar with the two colours.
Basically, at the moment the pixels are determined as follows:

Code:
int pixels = (int)(Scaling_Factor*prob + 0.5);

Low probabilities will be rounded to 0 pixels still. At the moment the scaling factor is 1.6. So odds below 0.9375% will not be displayed.
It's really hard to explain why this seems to work. The main thing it avoids is 1pixel wide bars which looked really weird. They almost looked like a 1 in front of the number of HP.

EDIT
lol I think some of what I said doesn't make sense. I'm a bit tired so I'll explain it better tomorrow maybe. In any case, it seems to work well.
 
Question: In the medium setting, what does the line above "Unharmed" actually mean?
 
The first pair of numbers are the damage per hit that each unit will inflict on the other. This is determined by the R value.*

The second pair at the number of hits required to kill the other unit. These are calculated from the first pair and the units' starting HP.

The % is the probability that the attacker will win each combat round.* This is determined by the R value.*

The R value is the ratio of attacker strength to defender strength.*

* This is my understanding.
 
OK, so I have no experience with C++, but I need to learn anyway, and this seems like a good place to start. The instructions of how to compile a new DLL are pretty clear. Looking through the source code of this mod though, I wasn't able to figure out how to do what I wanted. Not all that surprising, but anyway, figure I should start. Anyway my goal is to learn by doing, not just have it done for me. I'd greatly aprecciate the help from PeaceOfMind or EmperorFool.

Goal:
-Add function where holding down shift brings up Everything detail display
-Add text to Medium Display box that says "Hold Shift to see Detailed Display"
-Add text to Everything Display "Release Shift to return to Default Display"

So now, where in the Source code would I add in the function to switch displays by holding down Shift, and How would I write this code? And how do I add in the relevant text?

I'm hoping that by doing these two things, I'll have the practical knowledge to figure out how to do the rest of what I want to do on my own, or at least with minimal help.
 
phungus, I'll just warn you in advance that at the moment my code is pretty horrible in terms of being able to make much sense of it. I haven't done too much yet in the way of tidying it up.

You'll note that most of the code I have written is in GameTextMgr so that is where all the changes you have mentioned will need to be made.

By the way, the first step is being able to compile the code. I only learned a couple weeks ago, but I just found the source code provided by Firaxis in the CvGameCoreDLL folder and made sure I could get that to compile to make a working DLL before I attempted to make any changes. Only after that did I start to mess around by adding code.
 
:lol: I was thinking R was something R-square'ish! I kinda liked the old display where you had R be green if in favor of the attacker, and red if in favor of the defender. However, you just know that when you pitch your spearman against that tank, it's gonna be red anyways, so cyan works too, of course... ;)

Anyways, looks really good by now. Will the XP points awarded for victory, retreat and defeat ever be different from 3, 1, and 2? If not, I think the information may be superflous.

The minimum display may even be reduced further, to just show the Survival odds and the bar (and still the strength factors, of course). And I think you should consider going to just one decimal point for percentages (can you increase decimal points by using CTRL/SHIFT?).

All minor nits, keep up the good work! :goodjob:
 
Will the XP points awarded for victory, retreat and defeat ever be different from 3, 1, and 2?

XP for withdrawal and retreat is always 1XP, but XP for victory and defeat depend on R. The line in the Everything mode that shows the three R values shows the cutoff values that result in +/- 1 XP.
 
OK I've succefully baked up two functioning gamecores, one default and one of the current version of this modcomp. I'm interested in trying to add the switching details functionality. How would I go about writing this (So that by holding down shift the display changes from whatever default is set as to Everything).
Also How do I get white text to display, specifically below all the new stuff and above the default modified combat values in the pane?

Found a minor aesthetic bug. Also not sure if it's fixable, or even worth messing with, but I'd figure I'd note it. If you're in the Everything detail, and the combat has a few modifiers, the top of the pane gets cut off/written over by the tax information displayed at the top of the screen..
 
Top Bottom