Resource icon

Improved Range Strike 2.0

This is a very small mod but with a very big potential effect.

Civ 4 actually includes functions for ranged combat, and the AI knows how to use it very well. It even limits ranged attacks to targets within line of sight - all the setup for a great tactical mod. However, the calculation for ranged attack damage results only in positive numbers; a ranged attack will never do zero damage. This means a mod like a WW2 mod is hard to make because even the smallest, tiniest infantry can destroy a tank from a distance in about 15 shots.

In this version (version 2) there are three tiny SDK changes:
  • The base calculation for ranged combat damage now subtracts "RANGED_COMBAT_DAMAGE" (set in global defines) after figuring out the ratio between units. This means that a unit must have greater ranged strength than the enemy combat strength in order to damage them.
  • In all strength calculations, hitpoints are now ignored. Damaging a Tiger tank that is already damaged is just as hard as damaging a full-health Tiger tank. (This should affect regular combat too, but I haven't checked yet.)
  • (Note: the above does not affect the usual AI calculations for damage, so AI units will still think they have a great chance to beat damaged units outside ranged combat, even if they don't.)
  • The AI for ranged combat was adjusted to use actual ranged combat damage instead of "AI attack odds", so the AI will not shoot at things it can't damage.

How to add ranged attacks in Civ4UnitInfos:
Spoiler :

There are 3 tags you need to be concerned with.
  • iAirRange - this gives the unit a ranged attack with this range.
  • iAirCombat - this is the strength of the ranged attack, which functions exactly like the unit's regular combat strength, but is only applied to ranged attacks. A unit can have 1 strength and 100 ranged strength.
  • iAirCombatLimit - this is the amount of total damage that a unit could do with ranged striking. If a unit is already damaged beyond this amount your ranged attack will do zero damage.
Ranged combat is based on the defender's strength (iCombat, modified by tile bonuses, bonuses against the attacker, and all that stuff) and the attacker's ranged strength (iAirCombat, modified by bonuses against the defender).
  • Like
Reactions: tantanmen
First release
Last update
0.00 star(s) 0 ratings

More resources from Merkava120

Latest updates

  1. Improved more

    See description
Top Bottom