1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Defender Withdrawal

Discussion in 'Civ4 - Mod Components' started by killmeplease, Jan 13, 2010.

  1. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    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 here
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator

    Joined:
    Oct 22, 2008
    Messages:
    29,793
    Location:
    Germany / Netherlands
    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 ;).
     
  3. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    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!
     
  4. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    Thank you guys for words of encouragement!

    uh i does not know about it!
    i'll place modcomps with dlls there.
     
  5. Ninja2

    Ninja2 Great Engineer

    Joined:
    Nov 17, 2005
    Messages:
    1,142
    Location:
    Denmarkia
    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?
     
  6. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    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.
     
  7. Ninja2

    Ninja2 Great Engineer

    Joined:
    Nov 17, 2005
    Messages:
    1,142
    Location:
    Denmarkia
    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:
     
  8. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    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!
     
  9. Ninja2

    Ninja2 Great Engineer

    Joined:
    Nov 17, 2005
    Messages:
    1,142
    Location:
    Denmarkia
    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?
     
  10. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    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).
     
  11. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,312
    Location:
    Australia
    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.
     
  12. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    ok i'll PM you when i'll start a thread on it.

    I have not really dug into it so far. But i think a solution will be found. :cool:


    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.

    i have no info about it. seems not. tough it'd be great to see DWM included into PIG :rockon:

    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.
     
  13. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    absolutely perfect for ACW. I'll be using this for sure. Thanks :goodjob:
     
  14. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    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 ;)
     
  15. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    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.
     
  16. Ninja2

    Ninja2 Great Engineer

    Joined:
    Nov 17, 2005
    Messages:
    1,142
    Location:
    Denmarkia
    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).
     
  17. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    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).
     
  18. killmeplease

    killmeplease Mk Z on Steam

    Joined:
    Nov 22, 2007
    Messages:
    2,690
    Location:
    Samara
    version 2.0 released
     
  19. Supercheese

    Supercheese Zeppelin Commander

    Joined:
    Aug 2, 2009
    Messages:
    378
    Location:
    Idaho
    This Modcomp receives my seal of approval. :goodjob:

     
  20. Shiggs713

    Shiggs713 Immortal

    Joined:
    Mar 11, 2007
    Messages:
    2,361
    Location:
    Indianapolis
    fabulous work killmeplease :thumbsup:. Looking forward to trying it out within ACW!
     

Share This Page