Combat Mechanics

From Alpha Centauri Wiki
Jump to: navigation, search

This article is the result of partial code disassembling and analysis. I did a best effort on reverse engineering but it still could be incomplete or incorrect.

Some relevant statistics gathered by someone else: apolyton(.)net combat mechanics.

Contents

Combat modifiers

A good article listing them is here: alphacentauri(.)gamepedia(.)com Combat.

Many people are asking whether they are additive or multiplicative. For example, if there are two modifiers A (+50%) and B (+50%) do they result in combined factor of (1 + 0.5 +0.5) or (1 * 1.5 * 1.5)? The answer is they are additive within category and multiplicative across categories. The resulting category additive value is displayed as a single effect in combat calculation screen.

In other words, the computation of a combat effect percentage value is a sum of percentage values of this effect sub elements. Whereas the computation of a final strength is a product of base weapon/armor value with all the effects.

effect percentage value = sum of all effect sub element percentage values
final strength = base weapon/armor value * (1 + effect 1 percentage value) * (1 + effect 2 percentage value) * ...

Example

Base defense bonus is an effect. Perimeter Defense bonus (+100%) and Tachyon Field bonus (+100%) are sub elements of this effect. Let's say we have both.

Base defense bonus = 100% [PD] + 100% [TF] = 200%

Unit morale is an effect. Various factors contribute to it. Let's say unit was built in base with Command Center, it has High Morale ability, and we are running -1 MORALE SESocial Engineering (resulting in -1 unit morale).

Unit morale = -12.5% [base Green morale] + 25% [Command Center] + 12.5% [High Morale ability] - 12.5% [-1 MORALE SE] = +12.5%

Base defense and morale are different effects. So when they are both present they magnify base strength independently.

Final strength = base strength * (1 + 200% [base defense]) * (1 + 12.5% [morale])

Combat processing

Setup

Attacker and defender strengths

Final strength of attacker weapon and defender armor is calculated as above. Strength of each unit is multiplied by 0x100 and is truncated to the whole integer. So that something like 0.5 strength value ends up as 0x80.

Firepower

Firepower is the measure how much damage round winner deals to loser.

Conventional combat firepower is always 1 for both units.

Psi combat firepower equals an opponent reactor power for each unit. Meaning psi combat ignores reactor power completely on both units. Both units have their effective total HP count = 10 regardless of reactor power. This is officially confirmed for those wondering if this is so! ^_^. Keep in mind that odds confirmation dialog does it wrong for psi combat. It does not ignore reactor power. So you may see it displaying 1:2 odds when your worm attacks Fusion Reactor unit but in fact they are 1:1.

Combat round

Each unit rolls whole random number 0 to their strength - 1. The unit with larger random roll wins the round. Tie goes to defender. Loser health/power is decreased by winner firepower. Combat continues until one unit dies (out of health/power).

Combat round roll bug

This infamous Civ 1 bug that safely traveled through Civ 2 to SMACX. It could also travel further down Civ ? line but I don't care.

Odds confirmation dialog assumes odds are proportional to unit strength which is completely logical and natural for all 4X games. I.e. unit of strength 4 attacks unit of strength 1, its odds are expected to be 4:1.

As you can calculate from combat roll formula actual round odds applied for 4:1 unit strength ratio will be 7:1. o_O. Seriously??? And nobody bothered for decades of Civ 1 - Civ 2 - SMACX development.

Non standard combat

Land artillery vs. ship

Artillery duel lasts only one round. Unit may die if it is already badly damaged.

Disengagement

Combat may get interrupted in a middle when disengagement conditions are met.