Combat_Rounds effect: to kill or to survive?

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Combat_Rounds effect: to kill or to survive?

Post by Ignatus »

In FC3.0 the effect Combat_Rounds is introduced which limits how many blows can units exchange in a battle. As a result, now an attack may result in survival of both parts. Even if the defender is very weak, it can have 100% chance to survive if just has more hitpoints then attacker's firepower * max_rounds. See wikia for the maths.

One who have already played 3.0 sandbox where all attackers have 15 rounds limit may have noticed that, since most units are 20hp, both parts surviving is a common case (and thus there is much more Elite units). How can this effect be applied in a real ruleset? First thing I have thought about were turrets, attackers that can damage strong targets and can kill them but usually only in a complex action.

My actual question is what a Combat_Rounds-aware get_defender() function (specifying which unit in a stack defends) should do, I'm trying to code it. Currently, it does not know about this effect and thus sometimes will not send forth a weak unit with many hp even if it actually has better chances to survive. It's crucial for vulnerable stacks, and even safe ones may have difficulcies in receiving reinforcement. On the other hand, we don't want to grant our enemies free vet. statuses and wait a turn or two when they will try again, so sometimes we would like to see defending a unit which less survives but more kills. Should we sort units by P(survive) in vulnerable stack and by P(kill) - P(die) in safe ones, or some better risk estimator can be suggested?
bard
Veteran
Posts: 121
Joined: Fri Jun 14, 2013 2:00 pm

Re: Combat_Rounds effect: to kill or to survive?

Post by bard »

I'd vote to use always the defender with more chances to survive. I'd be annoyed if my unit was killed because it was automatically selected instead of another defender that would have survived.

However, I have not tested this feature yet. I admit you have a good point about giving free veterancy, I might change my mind in the future :P
nef
Elite
Posts: 324
Joined: Mon Jun 25, 2018 5:01 pm

Re: Combat_Rounds effect: to kill or to survive?

Post by nef »

Perhaps could I point out that free veterancy WAS an issue with bombard. The answer in that case was to deny any upgrade to either of the parties. If I understand the situation here, the problem is that if you may want a general rule for limited bouts to apply. In the case of bombard you had the choice (depending on unit etc.). So something along the lines of a precalculation so that if there is NO chance of a lethal outcome in any one particular attack then no vet upgrade to either party so the general rule would be: no skin in the game - no upgrade. This code already exists for bombard.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Combat_Rounds effect: to kill or to survive?

Post by Ignatus »

Well, it's possible; probably the vet.chance should be proportional to the risk in all the cases, you hardly can become a legendary swordsman if you have beheaded thousands but all of them were chickens. The main problem of the "cushion" defending is that the attacker may very soon come back as fresh as it is, wether veteran or not, and then bring some friends up. Of course you can sometimes solve this with counter-attacking, but it's not the task of defender selecting algorithm (though keeping stronger attackers from defense service has been suggested long ago). It often would be just much more advantageous to fight a battle which is 1% lost and 99% won than one that is 100% drawn.

I think, as a rule of thumb thresholds from the autoattack mechanism could be reused in this case. There, a unit will go to hunt a target that worth autoattacking if the winning chance is greater than 25%, but for sole city defender this value is risen to 90%; if the chance is less, another way of coping with the trouble is supposed to be used. Thus, what if we range defenders by P(survive)+MAX(P(win)-0.25, 0) in a safe stack and P(survive)+MAX(P(win)-0.9, 0) in a vulnerable one? (Except when the attacker is a missile, which is of no use to kill, or the defender is a king who can't afford any chance to die).
Wahazar
Elite
Posts: 362
Joined: Mon Jul 02, 2018 1:49 pm

Re: Combat_Rounds effect: to kill or to survive?

Post by Wahazar »

I agree with the idea, that veteran status gain need to be reworked - probability of promotion should be proportional to the probability of losing battle (PLB),
with some bias for freshmen, for example 20%+PLB for green unit, 10%+PLB for v unit, PLB for vv unit, -10%+PLB for elite or higher rank, if exists.
No more easy training on warriors.
Of course any promotion can happen only, if enemy unit is completly eliminated, not bombarded or, like in OP, both survived.
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
Lachu
Elite
Posts: 472
Joined: Sat May 04, 2013 2:19 pm

Re: Combat_Rounds effect: to kill or to survive?

Post by Lachu »

If you make promotion calculate, when enemy dies, it causes badly things to promotion system (with combat_rounds enabled of course). We can attack enemy many times, kill it in next time, so risk calculation is done only once. We can also attack enemy with stronger units and then attack with weaker.

Solution is to use experience points, like in CivIV-CivVI, but... With change to promote based on experience points value. For example Warrior with 0 - 20 EXP have 0% to promote, Warrior with 21-40 EXP have 10% change to promote and for each next range 20x+1 - (20+1)x Warrior will have (10 + x * 10)% change to promote. Promotion will be checked on each success battle (after increasing EXP).
Of course, unit will receive EXP after each round, based on the risk. Ruleset vendors could configure this system, so giving 50% to promote independent of exp points is very similar to the current approach.
nef
Elite
Posts: 324
Joined: Mon Jun 25, 2018 5:01 pm

Re: Combat_Rounds effect: to kill or to survive?

Post by nef »

Wahazar wrote:I agree with the idea, that veteran status gain need to be reworked - probability of promotion should be proportional to the probability of losing battle (PLB),
Are you suggesting I should no longer be able to level up all my defenders by attacking diplomats that are kindly being sent to me as cannon fodder? This wont do! In the game I am playing as we speak I have managed to get all my phalanxes in one front line city to elite. How else am I supposed to win the game?

As an alternative to PLB and EXP my old idea was to assess upgrade chance each time the candidate lost hp, so if chance = 50% and MAX HP was 10 then chance of upgrade is 5% for each HP point lost during battle. The bombard criteria would still apply or could be severely modified so that there is some small chance.
wieder
Elite
Posts: 303
Joined: Thu Jul 27, 2017 10:43 am

Re: Combat_Rounds effect: to kill or to survive?

Post by wieder »

I would not allow any gained veteran levels if both units survive. Or maybe at least have a ruleset setting for controlling how close to getting killed the unit(s) need to be so that a promotion is allowed. Maybe a setting for both defender and attacked.

Another thing with gaining experience is exactly getting to high veteran levels by killing chickens. It would be great if there would be a way of controlling how good (maybe with the bonuses?) the unit should be in comparison to the other one. For example, it might make sense to make a warrior v it would would beat a phalanx/pike/musk or even another warrior but might not make sense to give a musk v level for killing a warrior. Or maybe a musk would get a v level if the defending warrior is vv and in a city on hills with walls. This would most likely not work for traditional rulesets but might be very useful for some different ones. Not even talking about lt.org rulesets.

Just trying to think how it could be while supporting different kind of ruleset ideas.
Hans Lemurson
Veteran
Posts: 108
Joined: Mon Aug 22, 2016 10:25 pm

Re: Combat_Rounds effect: to kill or to survive?

Post by Hans Lemurson »

One thing to keep in mind is that when you remove "to the death" from battles, the result is that the winner of a battle has lower unit losses than he would otherwise. You could, for example, destroy a fortifed Tank with endless waves of Musketeers and not suffer any deaths.
Wishes he could convert Civ2's scenarios to FreeCiv...
But instead, he made his own tileset variants, RoundSquare and Sextant-enHANSed, and refuses to play on anything else. Check them out!
Wahazar
Elite
Posts: 362
Joined: Mon Jul 02, 2018 1:49 pm

Re: Combat_Rounds effect: to kill or to survive?

Post by Wahazar »

nef wrote:Are you suggesting I should no longer be able to level up all my defenders by attacking diplomats that are kindly being sent to me as cannon fodder?
Well, in multiplayer such training on weak units is treated as a cheat, isn't? Of course there should be option for control such behavior: standard promotion or improved "fair" one.
One must also add new messages string to cover new situation, if your units survived, but opponent was not so pathetic to be killed.
BTW, is there any message about bombing?

EDIT: Number of rounds should depend on unit HP (those which is higher) - it should resolve problem with stream of immortal musks (20 hp) vs armor (30 hp).
Augmented2 ruleset/modpack for freeciv2.6: http://forum.freeciv.org/f/viewtopic.php?f=11&t=91047
Post Reply