1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

PieceOfMind's Advanced Combat Odds

Discussion in 'Civ4 - Mod Components' started by PieceOfMind, Feb 13, 2009.

  1. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Some nice ideas. I'll give them some thought.

    One comment regarding the stating whether the bonus applies to attacker or defender. It's literally always the defender except attacker strength bonuses. In other words, it would be easier (in terms of work to do) to simply label the +10% strength (for example) as +10% strength [Attacker] and all others are assumed to be on the defender.

    *****

    phungus,
    Thanks for doing that! Just downloading it now.EDIT.. done
     
  2. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Advanced Combat Odds has been merged with Better BtS AI v0.70.

    Download it here.
     
  3. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    Does the Combat line of promos on the defender work just like the other bonuses for the defender? What I mean is does C1 work the same as Shock for a total +35% strength modifier? And then if the attacker has Cover it drops back to +10%? Both assuming Axeman attacking Archer.

    Given the answers I expect (yes and yes), then ya it makes sense to just tag the items that apply to the attacker's strength. I would still like to see the final bonus total for each when it's non-zero. I don't know how you should show a negative defensive bonus--as -20% or /120%. I suppose you could just say /1.2 and x1.2 for +20%, but those don't look as nice to me, nor is it as clear what they are.

    I originally wanted to work the graphing bars into this somehow, but I don't see how they really would apply or be useful.
     
  4. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    And here is ACO + the UP. Not sure what the official UP is, the thread is kind of a mess, so I used Dresdens update, and incorporated Alexman's amphibious landing fix, as I guess that's the most current build :dunno:

    Anyway, same thing as last time, let me know when you've got it in the DB so I can delete the atachment.
     
  5. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    EF,

    The combat promos are unique because they (and Drill as well) are the only ones that always apply directly to the unit owning them. Every other situational modifier (all defense bonuses and modifiers due to promotions or unit-types) are added or subtracted from the defender bonuses. So the only time you'd be sticking the "attacker" tag on something would be for his first strikes and for his combat promos.

    Regarding how to display the total defense modifier, that's a good question. Displaying it as /120% is accurate but might be confusing at first.
     
  6. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Thanks.

    Got it now. Will upload it to the db soon.
     
  7. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    This would require explanation until you learned what it meant, but you could instead show the attacker's non-Combat effects in yellow to denote that they subtract from the defender's bonus.

    • +10% Strength
    • +25% vs. Archery Units
    • +30% from City (Unit Ability)
    • +10% Strength
    • ...

    The reason I'm looking for a different method is that adding [Attacker] to an attacker's line item seems like it would be misleading. Another option is to add [-X%] after the ones that subtract from the defender.

    • +10% Strength
    • +25% vs. Archery Units [-25%]
    • +30% from City (Unit Ability) [-30%]
    • +10% Strength
    • ...
    I don't like that it shows the % twice, one negative of the other. It looks a bit overkill. I suppose if you just memorize the fairly easy rule, there's no point.

    Hmm, I'm starting to like the yellow. :)
     
  8. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Don't like the idea of using Yellow as it's used for retreating information in the rest of the ACO display...

    I think the idea is sound to show visually where the bonuses are applied (in fact this would clear up alot of confusion I think). But I'm not sure the best way to go about it.
     
  9. Caboose

    Caboose Another Drill IV defender

    Joined:
    May 1, 2008
    Messages:
    302
    Location:
    Norway
    Awesome job with this! Also for merging it with Solver and Dresden's unofficial patch.
     
  10. Caboose

    Caboose Another Drill IV defender

    Joined:
    May 1, 2008
    Messages:
    302
    Location:
    Norway
    Oh, after checking out the BUG mod I would LOVE to see a merge with that! :drool: (I've currently merged Better AI with BUG; ACO would make it perfect!)
     
  11. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    Just use the merged DLL above with BUG as you currently use the Better AI DLL. It should work fine.
     
  12. Caboose

    Caboose Another Drill IV defender

    Joined:
    May 1, 2008
    Messages:
    302
    Location:
    Norway
    So all I need is the DLL?

    It didn't work. Maybe I didn't understand. Anyway, I want to use both BUG and Better AI with the ACO tool (all combined in one).
     
  13. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    BUG by itself doesn't have its own DLL. If you merged Better AI with BUG, that means you must be using Better AI's DLL. Replace it with the merged ACO + BAI DLL posted above.
     
  14. Caboose

    Caboose Another Drill IV defender

    Joined:
    May 1, 2008
    Messages:
    302
    Location:
    Norway
    Ok, obviously the DLL wasn't enough by itself for ACO to work.

    So I copied the /Assets/Art/ and /Assets/XML/ files as well. Dunno about the Python files in the merged ACO + BAI posted above. I also added the ACO.ini file to /Assets/.

    Here's how I got it to work:
    First I followed this guide for merging BAI with BUG:
    http://forums.civfanatics.com/showthread.php?t=296534

    Then I added the ACO + BAI merged DLL and the files mentioned above from ACO.

    I am really new at this kind of stuff so I barely knew what I was doing, but I got it to work. Someone more computer savvy than me should make a guide for this, or include all the correct files in a .zip file.
     
  15. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    BULL, the BUG DLL, includes ACO. I'm hoping someone will merge BAI with BULL as soon as it's released in installer form.
     
  16. mc-red

    mc-red King

    Joined:
    Dec 2, 2007
    Messages:
    967
    That sound great. Can't wait :goodjob:
     
  17. gavagai

    gavagai Chieftain

    Joined:
    Feb 22, 2005
    Messages:
    23
    I am not sure if this is the right thread to ask in, but I have a problem...

    I am using Wolf Revolution 1.4, and I get these detailed odds, but it started to look funny when I was going to attack a city with my axemen. I had these two axemen, one of them had +10 strength, the other +20 city attack. They were both attacking the same defense troop, but the axemen with +10 strength had much better odds than the one with +20 city attack. Shouldn't it be the other way around? or am I missing something? Screenshots below. I will be happy for any help, thank you!

     
  18. EmperorFool

    EmperorFool Deity

    Joined:
    Mar 2, 2007
    Messages:
    9,633
    Location:
    Mountain View, California
    PoM is the best to answer this, but I'll take a stab.

    The Combat line of promotions affect the strength of the attacker. In this case, it adds 0.5 (10% of 5 assuming full health) to the Axeman's base strength giving you 5.5.

    The City Raider line of promotions and those versus specific unit types subtract from the defender's base strength. Assuming your are attacking an Archer, this 20% is subtracted from its 50% city defense and 25% fortification, or 75% -> 55%.

    It's possible that this ends up being less valuable than C1 I think, but the math is left as an exercise for the reader. ;)
     
  19. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    In this case the R value is the dead give-away.

    EmperorFool is absolutely right. This is a situation where a single combat promo, because the way it works differently to other promotions, is better than city raider. You'll notice the combat axeman has R = 0.72, and the CR one has R=0.71.

    When both attacker and defender have 100HP, R is the only value you need to know. Whichever promotion increases the R value the most (the higher the better for the attacker) will give the greater odds of survival, ignoring things like Flanking promotions etc.

    Also in this case, having the R value go from 0.72 to 0.71 causes a jump point. The combat axeman does 17HP damage per hit, unlike the CR axeman who does 16 damage per hit. As a result, the combat axemen requires only 6 hits to kill the defender, compared with 7 hits for the CR axeman. This abrupt change is what causes the large difference in survival odds.

    The details of when combat or CR is better for city attackers were looked at in another thread, but basically when you attacking a unit with low base strength and/or with high defense bonuses (like the archer in this example), combat promos compare very well with CR, particulary CR1.
     
  20. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    To apply EmperorFools excellent description of the combat rules to this case:

    It's 110% of 5 strength vs 254% of 3 strength in the first example and 100% of 5 strength vs 234% of 3 strength in the second example. Mathematically speaking, the reason the first example leads to better results is because the 10% is added to a base of 100% strength meaning a relative increase of 10% while in the second case the 20% is substracted from 254% meaning a relative decrease of 254%/234% - 100% = 8,5% for the defender. 10% > 8,5%.

    Or to say it in words, the 20% attack bonus doesn't make a dent in the huge defence bonus of the archer.

    edit: too slow, Pieceofmind already answered too. But maybe my look on things is interesting too.
     

Share This Page