Project

General

Profile

Feature #809470

DefenseMultiplier and DefenseDivider should be upgraded from crude integer multipliers to percent multipliers, similar to other mechanics.

Added by Lexxie L about 2 months ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The reason is simple. Using small integers for bonuses allows no finer gradation or tuning.

Consider a unit which defends at 8, and you want to give it small a bonus in a special context, The smallest bonus you could give it is a full 2x, raising it all the way up to an invincible 16. When we consider other defense bonuses in the game -- such as from terrain or veteran levels, many are lower than 2x and allow the ability to specify fine gradations.

Consider this has already been done in other areas, for example:

[effect_city_walls]
type = "Defend_Bonus" 
value = 200

Tuning the relative strengths of things to all work together in a ruleset is a very fine art. Often differences as small as 5% or 10% wildly alter game dynamics. The current crude integer multiplier system forces game designers to paint fine details with a huge roller paint brush. It has resulted in no ruleset in existence ever being able to tune out its imbalances. It has held us back and alienated finer talent from moving freeciv to much higher levels.

History

#1 Updated by S.C. L. about 2 months ago

I apparently can't mark this resolved myself, but it's done:
PR#16 on Github; also attached as a patch.

Current possible points of contention:
  • The help text for DefenseDivider and DefenseDividerPct might be confusing. Dividing defense is effectively equivalent to multiplying attack, so it could be rephrased like this, either as part of this or as a separate issue.
  • In the same vein, defense dividers could be properly replaced with attack multipliers. This would make the civ2 ruleset technically no longer accurate, but it would be more straightforward and reduce rounding in defense calculations, making combat marginally more precise. That would of course be a separate issue.
  • Alternatively, the defense multipliers and dividers could be united into one calculation. Since this patch changes the defense multiplier cache to store a percentage instead of an integer multiplier, this cache could actually include the defense divider. That way, other code (e.g. AI) could directly use that value without dealing with the details.

Any thoughts?

#2 Updated by S.C. L. about 2 months ago

Added a missing /100 in AI code that may have caused AI to vastly overvalue units with defense multipliers.

#3 Updated by Marko Lindqvist about 2 months ago

  • Target version set to 3.1.0

data/ruledit/comments.txt needs to be updated too.

#4 Updated by S.C. L. about 2 months ago

I knew I was forgetting something. Here we go.

Also available in: Atom PDF