Military Advisor

But I have to say that I'd like a better handling for strategic advantages... I'd like to know if the AI can built a unit which is a SA even if they don't have the resources to do it, because this is an aspect that can change in each moment, while this isn't the case of the needed technologies (once the AI has them, it will be forever)... the same for the player.

So my idea is to show the icons of all the SA available due to the technologies, but marking somehow (grayed out, or with an icon in a corner) the icons of the SA that are not actually available due to unavailability of resources).
And accordingly for war periods, I'll mark these type of SA icons with a question mark in the corner (much better than putting them after a big question mark, IMHO, but I don't know if my solution is technically possible).
In this way, I can tell if a guy can aquire a strategic advantage over me simply by getting a needed resource.
 
We're doing exactly that with one difference, and I like your suggestion. When you know they don't have the resource, we hide the unit, but I agree that we should show it after the ? icon so the player knows they have the tech but not some other aspect (like a saltwater port city for ships or iron for Swordsman). I'll make that addition as I think it lines up with our current methodology.

Edit: How convenient. Though I didn't intend to, this is how I already coded it. :blush:

Regarding the presentation, we wanted to gray out the icons that couldn't be built (or were unknown due to war), but we simply cannot get it to work. :( This is why we put them after the ?. If anyone can figure out how to get it to work using IconGrid, I'm all ears. We've tried the code from CvMainInterface that grays out the icons of units you cannot train due to lack of resources, and while we don't get an error or exception, the icons simply don't become gray or disabled. :mad:
 
We're doing exactly that with one difference, and I like your suggestion. When you know they don't have the resource, we hide the unit, but I agree that we should show it after the ? icon so the player knows they have the tech but not some other aspect (like a saltwater port city for ships or iron for Swordsman). I'll make that addition as I think it lines up with our current methodology.

Edit: How convenient. Though I didn't intend to, this is how I already coded it. :blush:

Good! :D

Regarding the presentation, we wanted to gray out the icons that couldn't be built (or were unknown due to war), but we simply cannot get it to work. :( This is why we put them after the ?. If anyone can figure out how to get it to work using IconGrid, I'm all ears. We've tried the code from CvMainInterface that grays out the icons of units you cannot train due to lack of resources, and while we don't get an error or exception, the icons simply don't become gray or disabled. :mad:

And what about putting a trasparent layer over it with only a question mark in the corner?
 
And what about putting a trasparent layer over it with only a question mark in the corner?

We tried that as well. The problem is that we're using IconGrid that was part of EFA, and it uses a Multilist Button control. This provides scrolling (which we need) and multiple rows of buttons. We have not been able to figure out why disabling buttons works fine on the main interface but not on our screen.

Unfortunately, this is part of the UI code which a) has no documentation whatsoever and b) isn't part of the DLL/SDK, so I can't look at the source code to figure out what's going on. :(

Another option, though it would only work on wide screens, is to have multiple columns. Both sides would have two columns: known and possible advantages. But once you have DefPacts or Vassals or Wars, space gets tight on 1024x768.
 
We tried that as well. The problem is that we're using IconGrid that was part of EFA, and it uses a Multilist Button control. This provides scrolling (which we need) and multiple rows of buttons. We have not been able to figure out why disabling buttons works fine on the main interface but not on our screen.

Unfortunately, this is part of the UI code which a) has no documentation whatsoever and b) isn't part of the DLL/SDK, so I can't look at the source code to figure out what's going on. :(

Another option, though it would only work on wide screens, is to have multiple columns. Both sides would have two columns: known and possible advantages. But once you have DefPacts or Vassals or Wars, space gets tight on 1024x768.

Ok, I think as it is is the best possible solution
 
Speaking of current MA work, I am 99% of the way done with the Strategic Advantages stuff. There is one issue remaining regarding upgrades and unique units.

Here's an example from a recent game: I don't have Military Tradition, but my rival does (along with horses and Rifling which I do have). It shows Cavalry (correct), but it also shows Cataphract and Cuirasier (both incorrect).

The reason is that Cataphract -> Cuirasier and Cuirasier -> Cavalry, but we leave the older units in in case I cannot see Cavalry because I don't know and cannot research Rifling or Military Tradition. But I need to have it remove those older units since I can see that he can build Cavalry.

I think part of the problem is UUs, so I just need to make the code to detect upgrades more generic.

However, before I do that I want to make sure that in the above case we really do want Cataphract and Cuirasier hidden. He certainly cannot build them anymore, and we know that, so it seems wrong to show them as advantages when he has a far better advantage available.
My take on this is that we should show Cataphract / Cuirasier unless we know that he knows Military Tradition (ie we can research it or we know it). However, if we can build the same units, then it isn't an advantage and it shouldn't be shown on either side. As soon as we find that we can research MT, then Cav will pop up on his side and we find that we have been living in a fools paradise. I think that this is correct.
 
Yes, I am only talking about the case where you can research MT and can see that he has Cavalry. In that case, it should hide his CuiCat.
 
Round and round we go . . .

The possibilities of units that can be built is getting more complicated. The cases for the player are pretty straight-forward:

  1. No tech
  2. Tech, no resource required
  3. Tech, have resource
  4. Tech, don't have resource

    • We were originally hiding #4, but we're changing this to put units in this case after a ! so you can see that you can build them if you can acquire the resource.

      The situation for rival players is more complex:
      1. No tech
      2. Tech, no resource required
      3. Tech, has resource (trade network)
      4. Tech, doesn't have resource (trade network)
      5. Tech, don't know if has resource (no trade network, e.g. war)

        • Here are all the combinations and how I'm thinking to display the icon in each case.

          Code:
          Rival: |  T-  | T  r | T  R | T R-  | T  R? |
          You:   |      |      |      |       |       |
            T-   |  -   |  R   |  R   |  R!   |  R?   |
            T r  |  Y   |  -   |  -   | Y  R! |  Y?   |
            T R  |  Y   |  -   |  -   | Y  R! |  Y?   |
            T R- |  Y!  | Y! R | Y! R | Y! R! | Y! R? |
          • Headings:
            • T-: don't have the tech
            • r: unit doesn't require any resources
            • R-: don't have the resource(s)
          • Cells:
            • -: neither gets the icon
            • R!, Y!: shown on their/your side after ! icon
            • R?, Y?: shown on their/your side after ? icon
          The last column is where I'm really not decided. If you can build a unit and they cannot because they lack the tech, it shows the unit's icon on your side, and if they can't build it because they lack the resource, it shows it on both sides (after ! on their side), but when you aren't sure if they have the resource or not (no trading), it moves it after the ? on your side and doesn't show it on their side.

          The reason for this is that for the most part the icon should be on the side who has it as an advantage. If it might be an advantage for you due to their resource availability, it seems a little odd to put it after a ? on your side (because you can definitely build it).

          So the other option is to show the icon on both sides if both sides have the tech, except in the one case where you know that both sides can build it now. In that case the icon would be hidden from both sides because it's no longer an advantage. All other cases show the icon normally, after a ? or after a ! depending on that sides ability to build it and your knowledge about it.

          In that case, the 3rd and 4th values in the last column change from "Y?" to "Y R?"

          This changes the meaning of ? from "this might be an advantage for you or them depending on their resource access" to "we don't know if they can build this or not due to resource access". The key is that ? would never appear on your side.

          I'm sure I'm not explaining this clearly. My main concern is that there's no way users will understand this -- even after reading the help file. I could add a simple mode that shows only the icons of units that are known to be an advantage, skipping the ? and ! icons, or it could put even units you're unsure about as advantages. If you can't trade, it assumes they cannot build Swordsman entirely and shows it as an advantage for you if you can build them.

          I'm talking around in circles now, so I'm going to stop before I fall down. Does anyone have any suggestions about this?
 
I think optionally showing the 'implied' advantage is the way to go. You have a 'simple' setting that only shows clear (known) advantage and an 'advanced' setting that shows all of the '!' and '?' units.
 
And what about that last question: You have tech and resource, rival has tech but you are at war (don't know resources), show as ? advantage for you or full for you and ? for rival?
 
And what about that last question: You have tech and resource, rival has tech but you are at war (don't know resources), show as ? advantage for you or full for you and ? for rival?
Lets work backwards. It cannot be a possible adv for opponent as you can build the unit. It is potentially an advantage to you so I would put it after the '?' on our side.
 
Lets work backwards. It cannot be a possible adv for opponent as you can build the unit. It is potentially an advantage to you so I would put it after the '?' on our side.

That's how I arrived at the same conclusion. But does the same logic apply once we sign peace and learn that they do not have the resources needed for the unit? Does the icon stay in our column but go after the ! icon?

If so, how does the player differentiate between this case and the case where the rival doesn't have the tech while the player has it but not the resource?
 
If the AI doesn't have the tech and we know it, then I would think that this unit is a clear advantage to us and goes before both '?' and '!'.
 
If the AI doesn't have the tech and we know it, then I would think that this unit is a clear advantage to us and goes before both '?' and '!'.

Even though we can't actually build the unit because we lack the resources?
 
Even though we can't actually build the unit because we lack the resources?
oh - missed that part. Hmm - they lack the tech, we lack the resource - honours (or lack there of) are split. Does anyone have the advantage?
 
oh - missed that part. Hmm - they lack the tech, we lack the resource - honours (or lack there of) are split. Does anyone have the advantage?

It depends on the rarity of the resource and the distance away from the tech. It's really a human decision at that point.

Alerum suggested splitting out these columns to a third page. I'd probably leave the absolute advantages on this page and add a new page with all the gory details. This would allow description column headings and splitting apart the various unit states (tech, resource, religion, etc -- there are others in the code, but I doubt we'll ever see them).
 
I'm working on a new tab for the expanded view of the strategic advantages. The Sit Rep page will show only units known to be buildable on either side as advantages. When resources are missing or unknown, the unit will be considered unbuildable. This may cause units on either side to appear and disappear when resource viewability changes.

The new Strat Adv page will have two resource columns showing which strategic resources you have that they do not and vice versa. It will then have columns for the units:

  • Your Advantages
    • Units you have the tech and resources for that they cannot build
    • Units you have the tech for but not the resource
  • Their Advantages
    • Units they have the tech and resources for that you cannot build
    • Units they have the tech for but not the resource, or you do not know if they have the resources
I'm wondering if I should split the last column into two columns: know they do not have the resources and don't know about the resources. I'm leaning against it because no single rival will ever have units in both columns, and they pretty much result in the same thing: an advantage for you.

Does anyone have any suggestions for other columns on this page?
 
How are you defining strategic resources? Are you doing it manually or letting Civ4 decide that? I know that when you go into globe view, you get the option to toggle food resources, lux resources, general resources or all. If you use the general resource filter - it will include stone and marble too.

Actually, we could do a similar thing for wonder building - so that you can take a guess at who is your major challenge for landing a wonder (... or a tech!).
 
My plan was to limit the set of strategic resources to any resource required to build at least one unit. Therefore, Stone and Marble would not be shown, unless you were playing a mod that had Stone Giants. ;)

I did write up an idea for a full resource comparison chart when chatting with Alerum a few months back. I think I put it into the tracker, too.
 
Top Bottom