Resource icon

[vanilla] The Mechanics of Combat (vanilla)

Hello.
In the article: https://forums.civfanatics.com/resources/the-mechanics-of-combat-vanilla.25621/#CombatWindow - there is a section "Combat Information Table" - it has an image (https://forums.civfanatics.com/attachments/combatwindow-jpg.296079/) and an explanation in the "Damage Formula" section - about the possible damage for each side when exchanging blows. I.e. the damage varies in a certain range: from minimum to maximum.
Test from my game: I attacked with my warrior, for example, a barbarian warrior. Yes, the interface displayed the average damage and it differed from what was actually inflicted during the exchange of blows. The damage to both sides was the same each time when the game was repeatedly restarted and attacked again. May be the game can already "know" the exact value of the possible damage when exchanging blows..., or calculates it at the moment of exchanging blows.

A few questions:
1) Which game files are responsible for the visual display of this information (i.e. the "Combat Information Table" interface)?
2) Is it possible in this interface to display the exact damage value (not averaged) or at least the range: from minimum to maximum? Any opinion: mods, editing files, etc.
 
The interface before attacking shows the predicted damage. Major Victory sometimes is a Kill, and Decisive Victory often leaves an enemy standing.

Two other points:
1. I recall from Civ 4 or earlier that an article explained "random" aspect of combat calculation. This goes way back to BASIC where RND would simply repeat the "random" number that the previous run got from a huge list. However, RANDOM command would actually generate a new random number from the list. I think if you restart the game (reload the save), you will get a different result from the random component of an attack.
2. Back in Civ 3 or so, someone gave feedback: "How could a battleship be beaten by an archer?" In that game, you could actually bombard tile improvements, not only units or the city. And ranged units suffered damage. I'm surprised to read in this thread that this combat result persists.

OTOH, I assume that any unit with a rifle can hit a low-flying aircraft and damage it slightly. Also Fighters take damage and get XP while defending.

I'm sure most people playing Vanilla know by now that a city can be reduced to Zero strength, in which case any further attacks do NOT give XP.

AI sometimes acts like a cat toying with a trapped mouse -- repeating the attack each turn without taking the city, in order to increase XP.
 
A few additions to my post:
1) For the latest version of the game ("...\Expansion2\...").
\Assets\DLC\Expansion2\UI\InGame\WorldView\EnemyUnitPanel.xml
\Assets\DLC\Expansion2\UI\InGame\WorldView\EnemyUnitPanel_small.xml
\Assets\DLC\Expansion2\UI\InGame\WorldView\EnemyUnitPanel.lua - for example, for Melee Combat - around line 816 (iMyDamageInflicted - for unit player):
Controls.MyDamageValue:SetText("[COLOR_GREEN]" .. iMyDamageInflicted .. "[ENDCOLOR]");
For example, 31 damage is shown (
1.jpg
). But in fact, 26 damage was caused (
1.1.jpg
) regardless of the number of reboots.
2) raw:
Controls.MyDamageValue:SetText("[COLOR_GREEN]" .. iMyDamageInflicted * 0.67 .. "-" .. iMyDamageInflicted * 1.33 .. "[ENDCOLOR]");
For example, range: 20.77 - 41.23 (
2.jpg
).
 
Well, I could be wrong. I've had changes in result even without a reboot. Save and reload is my strategy to avoid a crash if I want to convert a city during an auto-save turn. That changes the crash result.

It's been over 50 years since I programmed Basic. I'm not sure if that's the model for random component in Civ combat. Read the first paragraph here, which suggests that there is no true "randomness" though unpredictable results can be concocted by running an algorithm at different times of day, etc:

 
Top Bottom