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

Combat Explained....

Discussion in 'Civ4 Strategy Articles' started by Arathorn, Nov 4, 2005.

  1. Breunor

    Breunor Deity

    Joined:
    Jul 2, 2004
    Messages:
    2,388
    Location:
    Earth
    Arathorn,

    You were amazing for Civ III and here you are again! Great stuff!

    Breunor
     
  2. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    Spurred on by Arathorn, another test on the HP to take into account for promotion/bonus changes.

    Tank w/Combat I vs Cavalry

    Initial Full Strength Combat
    Tank 30.8 (28 + 10%) vs Cavalry 15.0
    Damage dealt per round win: Tank 28 vs Cavalry 14
    Cavalry died in 4 hits
    Tank hit once for 14 (86/100 HP remaining)
    Strength: 24.08/28.0

    Weakened Second Combat
    Tank 26.48 (24.08 + 10%) vs Cavalry 15.0
    Initial Tank HP: 86/100
    Damage dealt per round win: Tank 26 vs Cavalry 15
    Cavalry died in 4 hits
    Tank hit 3 times for 45 (41/100 HP remaining)
    Strength: 11.48/28.0

    Weakened Third Combat
    Tank 12.62 (11.48 + 10%) vs Cavalry 15.0
    Initial Tank HP: 41/100
    Damage dealt per round win: Tank 18 vs Cavalry 21
    Cavalry hit once for 18
    Tank died in 2 hits
    Strength: 0.0 - poor tank

    Nothing new (or unexpected) here, time to move on. :)
     
  3. Speaker

    Speaker Deity

    Joined:
    Nov 4, 2002
    Messages:
    2,097
    Location:
    Section 1
    Very nice work Arathorn, Snepp, et al.

    Any chance of writing up your "Tank w/Combat I vs. Cavalry," but change Cavalry to Spearman and show how many Spears it truly takes to knock off a tank. Post that in GD and end that discussion once and for all. The community would be much better off....
     
  4. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    :lol:

    It will never end. The spearman/tank debate has moved beyond calculations and realism, it has taken on a life of its own.
     
  5. Short Timer

    Short Timer Chieftain

    Joined:
    Nov 9, 2005
    Messages:
    2
    Location:
    Lakewood, Colorado
    Yes, the graph is symmetric around 1.00, which suggests that I managed to type in the formulas correctly. I would think that it should be symmetric based on the presumption that, all other things equal (first strikes, etc.), an attacker with a favorable R-value should have the same odds of winning an encounter as a defender in an entirely different encounter, with the same favorable R-value versus a weaker attacker. Since there are only two outcomes in an encounter, and the probability of success adds up to 100%, the odds of success will always be (A/D) 90/10, 80/20, 20/80, 10/90, etc.
     
  6. Arathorn

    Arathorn Catan player

    Joined:
    Jan 10, 2002
    Messages:
    3,778
    Location:
    Illinois
    First two posts updated. Just trying to clean things up before doing the collateral damage.

    To answer an earlier question about bonus peculiarities, I hope the following example helps....

    Example: A sword (str:6) with City Raider I, II, and III is attacking a pike (str:6) defending a city. The city has a 30% defensive bonus. The attacker’s strength is just 6, but the defender’s strength is 6/(1+1.1-.3) = 3.33, for an attack ratio of 1.80. The “right” way of doing things would have a strength 12.6 unit attacking a 7.8 unit, for a ratio of 1.62. So, here, the bonus peculiarity is helping the attacker.

    It's also in the "main" stuff in the first two posts, which is now well over the 20K character limit. A number of clarifications, clean-ups, and such were made. Most notably, additional discussion on lower hps was added.

    Arathorn
     
  7. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    A good example. It is clear to me now what the exact effects of the unit bonusses are (2.1/1.3 < 1.8).

    I was wondering if there is actually a reason for Firaxis to create this strange way of calculating the effect of the bonusses of units. I see that it has some effects on the outcome of battles, but mostly (with small bonusses) the effects will not be too big. And it is also not exactly clear why the effects of the strange combat calculations are preferable compared to how you would expect the system to work (adding bonusses to the strengths of units instead of substracting them from the defender).

    Any insight in the matter, Arathorn?
     
  8. zienth

    zienth Chieftain

    Joined:
    Oct 31, 2005
    Messages:
    79
    Location:
    Silicon Valley, CA
    Question regarding first strikes. If a unit has first strikes and also is immune to first strikes, and is fighting a unit with first strikes, how many first strikes would happen?

    For example, a Keshik (which has a fs) with Flanking II, which makes it immune to first strike, attacks an archer (which has a fs). Would there be no first strike because they both have 1, or would the keshik still get his first strike, since the archer's fs is negated, but the keshik's isn't?

    What if the Keshik had Drill I, giving him an extra fs chance, so he might have 2 vs. the archer's 1? Would the keshik get 1 first strike (his 2 minus the archer's 1) or 2 (his 2, since the archer doesn't get his 1)?

    Basically, it seems to boil down to when the immunity is applied. Does it negate the opponents first strike(s) before the relative numbers are compared (thus always giving the unit first strikes), or after the comparison (and thus only has effect of the opponent has more first strikes)?

    Keith
     
  9. Arathorn

    Arathorn Catan player

    Joined:
    Jan 10, 2002
    Messages:
    3,778
    Location:
    Illinois
    Just a semi-educated guess that it's for ease in programming. This way, they can simply calculate the attack value of the unit in question and have it "stored" in memory and then go through all the defenders, looking for the highest value in the stack. As you alt-mouseover different values, the program only has to calculate the new relative defensive values.

    As BomberEscort pointed out at one point, though, it wouldn't be that much harder to simply regenerate the modified attacker strength and modified defender strength for each unit in a defensive stack and pick the one with the lowest A/D value. It might take a bit more programming, but the speed is such that the user would never notice. And it would eliminate such odd things, where the listed bonuses aren't really bonuses, but negatives to the opponent. I also wouldn't be surprised if they noticed (what we've said) that it's the same thing with no other effects and didn't consider the other effects. I get the feeling mathematic sophistication is NOT one of Firaxis's strengths. Which is OK, but semi-problematic in cases like this.

    Unfortunately, the hp issue and jump points don't have such "easy" programming resolutions.

    @zienth: Dunno. First strike testing is on the list, but I'm still not quite completely sure how to even detect a first strike, let alone count how many rounds were that way. Anybody have good insights?

    Arathorn
     
  10. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    "I get the feeling mathematic sophistication is NOT one of Firaxis's strengths." That sentence actually made me laugh, although it is not really funny. It is quite possible that they do not realise that the effects of adding percentages to the attacker or subtracting them from the defender are not the same thing. Probably 95% of the worlds population wouldn't realise the difference. Most people aren't mathematical sophisticated. Which is OK (as you say), but indeed problematic if you're a programmer of a game in which mathematical formulas dominate gameplay.

    The jump points were something that I immediately realised when I looked at my first combat log (although I of course didn't calculate the exact jump point values which are very good to know). The hp issue (you mean that a unit has decreased strength and hps when it is wounded) just means that units decrease in strength quadratically. If that is a good thing or not is more a philosophical discussion.

    Although all these combat specifics are helpful to know, I don't think they will influence the game of the average player. But knowledge of these formulas is probably beneficial for a player who wants to compete at the highest levels.

    I would like to know how the actual knowledge of the first strike (which is written down in the first posts) is discovered. When looking at the naming of the 'first strike' and the 'chance of a first strike', I would expect the "first strike' to always do damage (independent of actual unit strength but damage amount dependent on A/D) and the 'chance of first strike' to do damage sometimes (dependent on A/D to hit and damage dependent on A/D). If this was true than it would be easy to test by taking a unit of great strength and attacking it with a very weak unit that has a 'first strike' and a weak unit that has a 'chance of first strike'. The first unit should do a light amount of damage, the second one shouldn't.

    But the above is inconsistent with the knowledge of the first posts. How was this knowledge acquired?
     
  11. Arathorn

    Arathorn Catan player

    Joined:
    Jan 10, 2002
    Messages:
    3,778
    Location:
    Illinois
    Collateral damage section added. Experience points section added. (both to the first post) A couple more minor corrections made.

    The information on first strike comes from the DeepO/Solver article. It should be re-verified, because it may be inaccurate, like much of the rest of their descriptions. I think first strike stuff is now on the top of my list. But probably, I won't work on it all until next week -- the next few days are busy (unless snepp starts providing me with data... :))

    Arathorn
     
  12. Roland Johansen

    Roland Johansen Deity

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    The collateral damage section is very interesting.

    Just an example: If a catapult would attack a stack of 6 full health catapults than it would do 5*10 = 50 hps of collateral damage. That is not huge, but weakening strong units to a level below the strength of your attacking units is very important as you have shown in the jump point analysis. And the catapult (and other siege weapons) can weaken a whole stack of units to a strength level below your attacking units. That is the strength of the siege units, correct? (of course next to weakening defensive bonusses) I'm asking this just to get a feeling for the units as I've not fought a lot of battles yet.
     
  13. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    Nice work on the collateral damage. I still haven't looked at it myself and probably won't, choosing instead to assume everything is accurate. :lol:

    I'm not sure of the best (or could say easiest) way to test first strikes, with the combat log not distinguishing between first strikes and normal rounds.

    For the time being, here's a couple combat logs to chew on that I found quite interesting, not for the result, but for the start....

    Archer Attack 3.0 vs Archer Defend 3.0
    Both have Drill I, II, III, and IV, giving them 4-7 first strikes each.

    D hit for 20 (100/100)
    D hit for 20 (100/100)

    D hit for 20 (80/100)
    D hit for 20 (60/100)

    A hit for 20 (80/100)
    A hit for 20 (60/100)

    D hit for 20 (40/100)
    D hit for 20 (20/100)

    A hit for 20 (40/100)
    A hit for 20 (20/100)

    D hit for 20 (0/100)

    2nd test, same conditions...

    D hit for 20 (100/100)
    D hit for 20 (100/100)

    D hit for 20 (80/100)

    A hit for 20 (80/100)
    D hit for 20 (60/100)
    D hit for 20 (40/100)
    D hit for 20 (20/100)

    A hit for 20 (60/100)
    A hit for 20 (40/100)
    A hit for 20 (20/100)
    A hit for 20 (0/100)
     
  14. Speaker

    Speaker Deity

    Joined:
    Nov 4, 2002
    Messages:
    2,097
    Location:
    Section 1
    Here is a pictoral sequence which describes the power of upgrades and bonuses.





     
  15. meowsqueak

    meowsqueak Chieftain

    Joined:
    Nov 2, 2005
    Messages:
    96
    Location:
    New Zealand
    Will all doubt about these things be removed when the SDK is released? Or is the combat mechanism implemented in closed code? That would be a pity.
     
  16. Luhh

    Luhh Chieftain

    Joined:
    Nov 7, 2005
    Messages:
    67
    Are you sure collateral damage is only dealt on offense? That would make machine gun unit useless, and I think I've suffered collateral damage when attacking artillery/catapults from a stack of my own.
     
  17. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    Yes, collateral is on offense only.
     
  18. Arathorn

    Arathorn Catan player

    Joined:
    Jan 10, 2002
    Messages:
    3,778
    Location:
    Illinois
    I dunno. But I'd wager the combat mechanisms could be changed fairly easily once the SDK is released. Finding out what it does might be harder than writing a new one from scratch, honestly.

    Like snepp said, Yes. It's 100% certain. Attackers are always a single unit anyway, in calculations at least.

    Definitely interesting. I'm going to tentatively interpret those as defender first-strike rounds that "missed". That is, the defender had a first-strike advantage, but the attacker had the combat round roll go in his favor. That would mean.... We should be able to determine the number of first strike rounds an attacker has if the defender is a TON stronger, in general, because we'll get a bunch of "A hit for 30 hps (100/100)" messages. (if I'm right)

    (1) An archer with all the drill promotions vs. a mech infantry (for example, a HIGH strength unit with no first strikes) would be a good set of info to have full combat results on. It might help determine the 4-7 thing. The more results, the better.

    (2) An archer with an exact number of first strikes (2, I think, from drill I and drill II? I need to learn my promotions better) against a mech infantry (again, e.g.) should help nail down whether the DeepO/Solver article is right on how first strike rounds work. A consistent set of "2 rounds of D wins but A takes no damage" would be pretty convincing. A single counterexample would also be good, as it would disprove at least one theory.

    (3) Some kind of "immune to first strike" unit with first strikes and with a combat disadvantage (like horse archer vs. a modern armor, if I recall my units correctly) might help us determine how immunity and first strikes work. If the horse archer consistently gets a first strike, that would mean one thing and if it didn't, it would mean another. Drill promotions for both sides would also potentially yield interesting information.

    With all of those, full combat logs would be required to determine what's going on. But at least we have a shot at determining first strikes from combat logs! That's something. If my theory is wrong, well, there's SOMEthing to be gleaned from what's going on.

    Any chance of getting some more tests run, snepp?

    We're getting there.
    Arathorn
     
  19. Vol

    Vol Sophist

    Joined:
    Nov 19, 2001
    Messages:
    349
    Wow. Fascinating stuff with the collateral damage and keeping HPs.

    So doing collateral damage has a cubic effect on the probability of victory! By lowering the combat strength of the unit and lowering its HPs, three seperate "multipliers" are affected. Firstly, it takes less damage to kill the unit. Secondly, you do more damage per round. Thirdly, you are more likely to win each round. What an incredible combination, none of which is obvious from the in-game combat odds pop-up.
     
  20. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    That's a bit different than what I had decided to interpret them as (100% pure unbridled speculation), that they represented both the attacker and defender hitting with a first strike at the same time, thus negating any damage. I observed the same thing happening with other first strike combinations, Archer vs Archer (1 first strike per) and Archer vs Archer (drill 2 and 4, giving 4 first strikes per). Though after looking at it a bit more this seems unlikely, as they always appeared as the first or second entry in the log. If it did work this way, you'd think the situation would arise where there was a mutual hit, a one way hit, then another mutual hit, but I never saw one.

    Hypothetical Example:
    D hit for 20 (100/100)
    D hit for 20 (80/100)
    D hit for 20 (80/100)

    I think I can spare a bit of time. Was tempted to get into it last night, but *gasp* actually played a game last night. My first experience using Praetorians, I was not a friendly neighbor. :lol:
     

Share This Page