1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Surround and Destroy mod

Discussion in 'RoM Modmods' started by dexy, Nov 8, 2009.

  1. dexy

    dexy Warlord

    Joined:
    Sep 30, 2008
    Messages:
    124
    Location:
    Greece
    Surround and Destroy mod
    for Rise of Mankind

    Version 1.0 (for RoM 2.8)

    Requires Rise of Mankind 2.8, Civ IV BtS 3.19

    This is a very simple, but effective mod. It increases combat odds of an attacker who has allied units surrounding the defender.

    This enables strategic positioning of defensive forces (to trap the enemy). Forts can be more valuable now - no more simply bypassing them and heading for the cities - this will make you more vulnerable if the enemy uses good tactics to surround you in his territory.

    Also, you can prepare more strategic attack, for instance city siege is much more effective if you can surround the city from all sides (realistic, ain't it?).

    Modular loading
    Not possible :sad:.
    The download is a merge of my previous mod (Fixed Borders) and this one, since all the changes are in the dll (plus some XML config and text). You can easily turn off one or another in the XML.
    I'll see with Afforess to include this mod in his modpack, it should be very easy.

    Config

    In GlobalDefinesAlt.xml, you can find properties that start with "SAD_". Changing them will change how much surrounding units affect the battle. Higher values add more power to attacker, lower add less (setting them to 0 will effectively turn off the mod).

    - FACTOR_1..4 properties determine the level of involvement (in the battle) of surrounding units per "surrounding factor". Surrounding factor (1 - 4) is the distance from attacker to the allied unit helping in the attack (tiles adjacent to attacker have a value of 1, the total opposite tile of attacker (across the defender) has a value of 4.
    - MAX_MODIFIER This is the max percentage an attacker can gain from having allied units surrounding the defender (for comparison, forest gives 50% to the defender, if attacker has 50% from the surrounding units, it nullifies the forest modifier for the defender)

    Download (includes dll src)

    http://forums.civfanatics.com/downloads.php?do=file&id=13609
     
  2. os79

    os79 Deity

    Joined:
    Mar 14, 2009
    Messages:
    3,091
    Location:
    Eastern USA Coast
    Clarify "allied" please. You mean actual allied AIs of yours or do you mean yiour own forces that you just call allied because it is a cool term?

    Either way, COOL mod!!! :D
     
  3. dexy

    dexy Warlord

    Joined:
    Sep 30, 2008
    Messages:
    124
    Location:
    Greece
    I mean "the units that belong to the same team as the attacker", but "allied" is way cooler than that, isn't it? :cool:
     
  4. dexter_inside

    dexter_inside Warlord

    Joined:
    Oct 8, 2007
    Messages:
    141
    I second that, can hardly wait to finish my current game to try it out :king:
     
  5. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    First off, This was a rather easy merge, which was nice.

    Secondly, I didn't see any AI code for this. Perchance, could you see if you could code the AI to take advantage of this too? It seems rather unfair that only humans should know about this, and I'm sure you'll receive more feedback on this once I release the next beta with this in it...
     
  6. dexy

    dexy Warlord

    Joined:
    Sep 30, 2008
    Messages:
    124
    Location:
    Greece
    I am aware of that problem, but for now it is almost impossible to code AI to consider this surrounding and tactical placement of units.

    The problem lies in the original BtS AI code that treats all units as if they were completely unaware of other units - each unit has its own priorities (independent of other units) and based on them it decides its next move. There's no central command like "place those 5 units on that city attack, 3 of those as decoys over there, leave those 4 to defend...". Even worse, each decision is made based on the current situation on the field, no matter what the previous move (during the same turn!!!) was. That's why you can see headless AI ships going back and forth, finishing turn without ANY valuable move (why move them in the first place then?).

    BetterBtS AI has tried to improve this. Those guys did a great work, but still not good enough for me to be able to use it for my specific mod. Basically, the whole AI unit code would have to be rewritten, which is a huge task.

    You can think of this as another flaw of AI. Humans, btw, have much more other tactics that they apply, which are impossible for AI, so one more is not a big deal :king:. For instance, when I want to take some cities of an enemy, I'll try to cut the enemy in half making a part of their empire defenseless (without resources or fresh unit supply). Also, have you ever seen an AI attack your empire from several different sides? No. But I do that to AI all the time, very effective.
     
  7. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    I realize the way the AI was coded is suboptimal. There are a myriad of problems, and the way it was coded was pretty poor. However, I believe Jdog5000 thought about changing it to a centralized command structure, and realized that it would slow the game down considerably. I suppose we have to live with what we have.

    However, perhaps you could make it "advantageous" to the AI to split it's attack forces up when it reaches a city, and approach from multiple sides. I know that the AI can force units into stacks, and then considers stacks as one entity. As of now, the AI will just keep the stack together, but with this mod, it is advantageous to split up.
     
  8. dexy

    dexy Warlord

    Joined:
    Sep 30, 2008
    Messages:
    124
    Location:
    Greece
    Not so easy again. You must consider the defensive value of the stack. If you have mixed units in it, longbowmen and axemen for instance, they will be much more vulnerable separated than in a stack. And to take this into account and separate one of each into sub-stacks.....again, too complicated.

    I've been thinking about AI in this mod a lot and I always end up giving up; it seems impossible to improve anything without ruining other AI aspects.
     
  9. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    Yeah, good point. That's why I've avoided doing anything involving units, with any of my SDK changes. Far too complex, too easy to botch.
     
  10. BlueTemplar

    BlueTemplar Prince

    Joined:
    May 14, 2006
    Messages:
    392
    Where are these values in AND? They aren't in GlobalDefinesAlt.xml...

    Have these values been changed? I'm trying to understand how that works exactly, but I don't find the same values...
     
  11. Afforess

    Afforess The White Wizard

    Joined:
    Jul 31, 2007
    Messages:
    12,239
    Location:
    Austin, Texas
    They are in the A_New_Dawn_Global_Defines.XML

    Enjoy! ;)
     
  12. Johntiler

    Johntiler Chieftain

    Joined:
    Jun 27, 2009
    Messages:
    7

Share This Page