Defender Withdrawal

killmeplease

Mk Z on Steam
Joined
Nov 22, 2007
Messages
2,794
Location
Samara
In this mod, units with withdrawal ability can escape combat wile defending. If defender withdraws, the battle with a next defender starts. Defender can not withdraw at battle round 1 and it can not withdraw if attacker is a missile (or any other suicide unit) as well.

some screenshots to show how it works:
Spoiler :

spearman attacks charriot and warrior









Version 2.0 additions:
  • There is a limit on number of combats with defenders occuring when a unit attacks an enemy stack now: no more than 3.
  • If there is only one defender, and it is about to die, it will try to escape from battle plot in the direction opposed to attacker (3 or less plots available to do this). If there are no free plots to withdraw to, it will be killed. also in this case defender has to have more base moves than attacker.
    Spoiler :

    spearman attacks:


    horse archer flees the battle:


In source code modded lines are marked with @MOD DWM signature. search for it and copy those blocks, or use the files as they are to compile the game core dll if your mod does not do anything with cvUnit.cpp/h.

You can download it herehttp://forums.civfanatics.com/downloads.php?do=file&id=14308
 
Nice work :goodjob:.

And some hints: CFC has it's own download database.
You can add files to it, 10 mb per file, and it doesn't count in your attachment limit.
Compile that, and add the compiled dll with the sourcecode to the database.
It's much nicer :).

The same for your other modcomp ;).
 
Great, I was about to release my next version of my mod, and then you make an irresistable new game option. Figures. :p

Nice work!
 
So... the withdrawing unit doesn't actually leave the tile it was defending? And the spearman automatically engages the warrior. What kind of withdrawal is that? :D If the chariot retreats, and the warriors are defeated, shouldn't the spearman capture the tile?
 
So... the withdrawing unit doesn't actually leave the tile it was defending? And the spearman automatically engages the warrior. What kind of withdrawal is that? :D If the chariot retreats, and the warriors are defeated, shouldn't the spearman capture the tile?
No. Charriot has retreated to the back of the barbarian army. Spearman killed a warrior and thus spent his mps. I mean it's a principle of the game that there is only 1 unit can be killed per attack. If charriot could not withdraw in defense, spearman just killed it but warrior remained undamaged.
 
I understand. I just thought that withdrawal would mean that the withdrawing unit leaves the tile, leaving the warrior intact and the mps of the spearman spent, which would be an interesting outcome. Your outcome is also acceptable. Had you used an axeman instead of the warrior, I guess the chariot would never have been chosen as defender. With the current promotion lineup, I guess this situation would not occur so often?

But nice work! :goodjob:
 
I understand. I just thought that withdrawal would mean that the withdrawing unit leaves the tile, leaving the warrior intact and the mps of the spearman spent, which would be an interesting outcome. Your outcome is also acceptable. Had you used an axeman instead of the warrior, I guess the chariot would never have been chosen as defender. With the current promotion lineup, I guess this situation would not occur so often? But nice work! :goodjob:
If defenders were to leave a plot, it could be possible to knock them out of SoDs and cities and then kill in open, that would be a strange behaviour. I suspect that meaning of "withdraw" word is slightly different to "retreat", and do not suit the added functionality well, but retreating is what defenders with withrawal ability do in this modcomp :). I also thought of possibility for defender to escape attacked plot (as you stated) if it's an only unit in stack. I'll add this later maybe.
In my games defenders withraw quite often as mounted unit can be a best defender in many cases, as well as ships with flanking and also drill-promoted units (i modded drill line to give withdrawal chance, +5/10/10/15 for levels 1-4)
Thank you for feedback!
 
I've long considered the same for Drill. That way, it's possible for archery and early gunpowder units to simulate skirmish tactics. Instead, I might make a skirmish promotion line. Do you think the Drill line is still balanced, even if withdrawal chance is added?
 
I think drill have its use even as it is (mop up squads, strong point defenders), and with withdrawal it would be even better.

I also have an idea of "occasional promotions" mod so there will not be a "combat or drill" dilemma (idea of this mod is promos being assigned to units on probabilistic and conditional base, i.e. attacking swordsman and winning may result (with a certain chance) in shock promotion, if there is a combatI already present, etc).
 
I think drill have its use even as it is (mop up squads, strong point defenders), and with withdrawal it would be even better.

I also have an idea of "occasional promotions" mod so there will not be a "combat or drill" dilemma (idea of this mod is promos being assigned to units on probabilistic and conditional base, i.e. attacking swordsman and winning may result (with a certain chance) in shock promotion, if there is a combatI already present, etc).

I'm interested in this hypothetical "occasional promotions" mod you speak of.
Would you kindly keep me informed if you create such a mod?

I think I'd enjoy having a game option that forced all promotions to be automatic but based on the sort of battles you fight. I'm not sure how you'd keep track of what sort of battles were used for each xp, but I suppose (I'm just guessing here) you'd pick a promotion when you win a battle that puts you over the threshold. Just writing these things has already got me asking more questions about how it could work. :) I better not derail this thread though!

To be clear, it'd be PIG Mod that I'd consider including it in.

Cheers,
PoM

@killmeplease,

This mod looks like some nice work! I'm hesitating to put it on my list of things for PIG Mod because it's a reasonably significant change to combat rules. I do have a few questions...

If a defender retreats, does that mean it gets the normal amount of xp for withdrawal (1xp in unmodded game) and then the attacker gets none, or does something else happen?
I think the defender shouldn't get any xp but I can imagine reasonable arguments for why it should.

If this mod is to be included in mods that use Advanced Combat Odds, some work might be necessary to ensure the odds remain correct. Do any mods use this yet?

A question:
Let's say you are attacking a tile with 2 chariots with a spearman of your own. Suppose your spearmen damages the chariot all the way to 10HP at which point it is lucky enough to retreat and during that battle your spearman was injured down to 30HP. The spearman now engages in combat with the second chariot while significantly injured? I think this would be an issue. If you had 2 spears, for example, in the unmodded game you'd never expect to lose a spear out of 2 while attacking 2 chariots, but with this modcomp it would be a very real possibility to lose one.

My fear here is that because in most combats in Civ the victorious unit takes a fair amount of damage (it's not unusual for the victor's expected hitpoints to be below 50) when a withdrawn-from attacker begins attacking the second defender it's almost always going to die.
 
I'm interested in this hypothetical "occasional promotions" mod you speak of.
Would you kindly keep me informed if you create such a mod?
ok i'll PM you when i'll start a thread on it.

Just writing these things has already got me asking more questions about how it could work. :)
I have not really dug into it so far. But i think a solution will be found. :cool:


If a defender retreats, does that mean it gets the normal amount of xp for withdrawal (1xp in unmodded game) and then the attacker gets none, or does something else happen?
I think the defender shouldn't get any xp but I can imagine reasonable arguments for why it should.
if defender escaped, both attacker and defender get xp. in ordinary combat a withdrawn unit get xp but his enemy does not. personally i think every unit should get xp from battle as they get experience of fighting, no matter how they do it good or bad. but if they fight good they should get more xp of course. thus, i'm advocating for change of rules here. any unit survived a battle should get xp IMO.

If this mod is to be included in mods that use Advanced Combat Odds, some work might be necessary to ensure the odds remain correct. Do any mods use this yet?
i have no info about it. seems not. tough it'd be great to see DWM included into PIG :rockon:

A question:
...
My fear here is that because in most combats in Civ the victorious unit takes a fair amount of damage (it's not unusual for the victor's expected hitpoints to be below 50) when a withdrawn-from attacker begins attacking the second defender it's almost always going to die.
I see no problem here as it was a common horsemen tactic - decoy an enemy to an abmush. also if foot soldiers tried to flee a battle in disorder they got slaughtered, until tactics and organization of armies evolved and what's called organized retreat became customary. in my military mod to come i plan to represent this by making drill promotions give additional withrawal chanse, and also by commander's promotions providing this for all units of a stack.
 
absolutely perfect for ACW. I'll be using this for sure. Thanks :goodjob:
 
absolutely perfect for ACW. I'll be using this for sure. Thanks :goodjob:

Good news!
I like ACW and will be glad if my work will be included there. Also i'm about to finish my work on Commanders modcomp (see my sig) - i think it will fit the theme as well ;)
 
well I'll have to check that out too. I've already got a commander unit added, with 2 UU's, including art for Lee and Grant, so that would be perfect as well.
 
What happens in a 1 vs. 1 battle? Can the defender still break off from combat? I think I would like to include this for naval battles, but only if I/you can make it so that 1 vs. 1 combat is unchanged. Reason being, if you're the defender in a ship battle you can't very well retreat due to damage (you could argue the same thing for the attacker, but since that is a part of vanilla CIV that is okay).
 
What happens in a 1 vs. 1 battle? Can the defender still break off from combat? I think I would like to include this for naval battles, but only if I/you can make it so that 1 vs. 1 combat is unchanged. Reason being, if you're the defender in a ship battle you can't very well retreat due to damage (you could argue the same thing for the attacker, but since that is a part of vanilla CIV that is okay).
No, if there's no other units in defending stack, defender can not break off (so in 1 vs 1 battle there will be no difference from vanilla)
It also can not to retreat at the first round of battle and from suicide attacks (missiles).
 
This Modcomp receives my seal of approval. :goodjob:

 
fabulous work killmeplease :thumbsup:. Looking forward to trying it out within ACW!
 
Top Bottom