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

Unofficial BTS 3.13 patch

Discussion in 'Civ4 - General Discussions' started by Bhruic, Oct 5, 2007.

  1. Minmaster

    Minmaster Chieftain

    Joined:
    Jan 14, 2002
    Messages:
    504
    Location:
    California
    yea so basically they don't understand about sacrificing seige units to soften up the defenders, thanks for the explanation. i think it would be better modifier is something like 300 instead of 100 then.
     
  2. Cutlass

    Cutlass The Man Who Wasn't There.

    Joined:
    Jan 13, 2008
    Messages:
    45,355
    Location:
    US of A

    I wish that could be modified. I can see from your explanation why the AI acts as it does. I happen to feel that that is a poor way to program the AI to operate.

    The way I run a combat with siege engines is that after the defenses are reduced, I measure up the odds, and if they are favorable, i'll attack with the stronger units. But if the odds are bad, I'll sacrifice attack the siege from the weakest on up. I'll usually only attack with them till I've lost 3 or 4. And then if the odds are still bad I'll sacrifice my weakest attackers to wear them down even more. I only toss all of my siege into the fray if it's the only practical way of winning.

    I imagine a modification to fight that way would be too difficult of programing.
     
  3. Roland Johansen

    Roland Johansen Chieftain

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    The problem with making a good algorithm to decide whether to attack with a siege unit or another unit first is that it's not always best to attack with siege units first. Collateral damage of siege units automatically damages the secondary, tertiary and so forth defenders, but the primary defender just has to fight the siege unit and never sustains any collateral damage.

    There are several cases where it's a bad idea to attack with siege units first.
    1) The stack is very small (think 1, 2, 3 units) and thus the weakening effect of collateral damage will only hurt very few units (1 or 2).
    2) The primary defender is a lot stronger than the other defenders and an attack with a collateral damage attacker would lead to weakening the already weak defenders while the primary defender easily defeats the collateral damage attacker without sustaining any damage. This situation occurs when one of the stack defenders is a lot better promoted, say one city defender 3 archer and 3 unpromoted archers inside a city. It also occurs when one of the stack defenders has just been upgraded, say a stack of 3 longbowmen and one riflemen inside a city. At some point weakening the already weaker secondary, tertiary and other defenders just isn't that useful anymore.
    3) The chance of victory of the normal unit is good (say 80+% chance) while the siege unit has only a small chance of victory (say less than 20% chance). Often it is better to just attack with the normal unit in such a case.

    I guess, it's pretty hard to write code that recognizes these situations where it's better to attack with a strong unit than with a weak collateral damage attacker and when it's better to attack with a collateral damage attacker. The code presented here by Bhruic tries to recognize these cases and does recognize case 1 and 3 a bit, but the very hard to recognize case 2 is not recognized.

    The main problem however is that it also doesn't attack with a siege unit when the best attacker and the best siege unit attacker both have very bad chances but the siege unit chances are just extremely bad. Say that the best siege unit attacker has a chance of 0.5% and the best normal attacker has a chance of 3%. In that case, the AI will attack with the normal attacker. Often that will be a very bad idea.

    I think to avoid this bad decision by the AI, it's probably best to look at the amount of damage that will likely be inflicted by the various units (measured in hitpoints). Collateral damage attackers will likely inflict more damage when attacking a big stack and that is a pretty good measure for their effectiveness.
    I would prefer a code like this:
    If no collateral damage attackers, then best chance of victory determines favourite attacker.
    If there are collateral damage attackers, then first determine the chances of the best attacker. If these chances are 75+%, then just attack with this best attacker (one could argue about this chance). If there is no unit that has a 75+% chance of victory, then attack with the unit which will inflict most damage (which is likely a collateral damage attacker when facing a big stack).

    It's not too hard to think of a formula that could estimate the amount of damage that a (siege) unit will inflict. I'm quite confident that I could think of a pretty accurate formula that doesn't take long to calculate. If there is any interest in such a formula, then I'll make an effort, but since I've already written enough about this, I'll first see whether this approach to choosing an attack order is perceived as 'better'.

    By the way, Bhruic, if you're reading this: Is the formula that you mentioned earlier taking into account collateral damage promotions which significantly increase the damage output of such units? Is iCollateralDamage modified for such promotions? There are also units (tanks), that start with iCollateralDamage=0 but can get barrage promotions in order to get a significant amount of collateral damage.
     
  4. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    I knew I should have gone into more detail. ;)

    That does happen. Well, close to it. An attacker is chosen using the system I listed. However, if the combat odds are below 68%, then it switches to the secondary selection system (aptly named "getBestGroupSacrifice").

    That selection system seems more likely to choose a collateral damage unit. Although it's still not guarunteed to, because it still takes a lot of other factors into consideration as well (roughly, x current str, x collateral damage, / city defense, x withdrawal, / production cost, / experience).

    Yes, it takes modified collateral damage into consideration.

    Bh
     
  5. Roland Johansen

    Roland Johansen Chieftain

    Joined:
    Apr 29, 2003
    Messages:
    4,292
    Location:
    the Netherlands
    I can't really understand the details of this other algorithm, but the actual idea to switch between two algorithms is quite good (not in the least because I proposed the same general idea ;) ).

    If the AI chooses a unit with an 80% chance of victory over a collateral damage unit with 30% chance of victory, then there isn't that much wrong with that decision. It might in specific rare situations not be optimal, but it probably is. And a second code for low odds victories seems a good way to weaken tough opposition.

    You wrote that with amphibious assaults, the AI is unaware that the various units in the ships actually form a single stack (at least in the human mind) and thus attacks with them as if they were several small stacks. They don't use the siege units from ship 3 before all of the units in ship 1 and 2 are used.

    Could something similar happen during land combat. Does the AI actually combine 2 stacks which converge on a single enemy city and walk on the same tiles into 1 stack. Or does the AI see these 2 groups of units as separate stacks while they are on the same tile.

    I know that there exists code that makes the AI form stacks of units, but I'm wondering if this code sometimes fails to join several units on one tile into the same stack. It would be a shame if such a failure would cause these weird attacks that sometimes happen.
     
  6. Bhruic

    Bhruic Chieftain

    Joined:
    Nov 15, 2005
    Messages:
    1,457
    There's code to join together units with the UNITAI_ATTACK_CITY AI, so I'm assuming that will cause multiple stacks to merge. I've actually seen stacks not merge, but I didn't check the AI for each, so it's possible they were different.

    Bh
     
  7. Tikal

    Tikal Chieftain

    Joined:
    Nov 4, 2004
    Messages:
    18
    This unofficial patch does not fix the one issue I still have with BTS 3.13.

    Lets say you are playing a 2 player multiplayer game... In all previous versions of Civ4 , Warlords and BTS, when your friend got tired of playing (if he/she wasn't doing well) he could simply leave. You could save the game... load it as a multiplayer game later.

    When you loaded it, it would notice that a player is missing and allow you to see the standard 'player dropped' dialog. From which you could continue.

    This unofficial patch does not address the issue that when you load a multiplayer game, the 'multiplayer dropped dialog' no longer appears. Is it supposed to address this issue? Can it?
     
  8. Innocence

    Innocence Chieftain

    Joined:
    Oct 7, 2003
    Messages:
    63
    Did you read the changelog on the very first page of this thread?
     
  9. scu98rkr

    scu98rkr Chieftain

    Joined:
    Nov 2, 2004
    Messages:
    463
    Tikal you can fix this by saving again after the player has left.

    Ie select continue playing. Continue to play for 1 more turn. Then save again. This time you are saving after the pop-up box. You should be allowed to continue playing from here with just 1 player.

    I had the confusion too, but it just requires 2 saves 1 for playing with out the human's and one for with the human's.
     
  10. Zuul

    Zuul Mod lister!

    Joined:
    Nov 13, 2005
    Messages:
    1,117
    Location:
    Sweden
    Bhruic, could we get an status report on an update? Could we get an list on what you have fixed, and what you will fix?
     
  11. `DG`

    `DG` Chieftain

    Joined:
    Jan 17, 2006
    Messages:
    99
    is it possible to make a change, perhaps in the "supplementary fix" which allows the player to examine a city before deciding what to do for city conquests/gifts?

    (may have been posted before but 89 pages and there's no good word to search for...)
     
  12. MusX

    MusX Chieftain

    Joined:
    Apr 17, 2006
    Messages:
    398
    Location:
    Poland
    awesome suggestion! hope it will be added in some patch
     
  13. LlamaCat

    LlamaCat Chieftain

    Joined:
    Dec 29, 2005
    Messages:
    1,212
    if this has been discussed already just ignore my post, but I don't see it on the first page list (only 89 other pages to read through)

    there is a bug when you first raze a city and you happen to get the partisans event, every city thereafter you raze you will keep getting the same event in the same game. seems a very doable fix for the unofficial patch maybe?
     
  14. Wodan

    Wodan Chieftain

    Joined:
    Jun 3, 2005
    Messages:
    4,867
    Location:
    In transit
    If we're giving those kind of suggestions, then let's add others, such as being able to examine the diplomacy and other info screens during AP/UN votes and event outcome prompts.

    Wodan
     
  15. Tikal

    Tikal Chieftain

    Joined:
    Nov 4, 2004
    Messages:
    18
    One doesn't always know when your friend has had enough of the current game. And someone always has to leave first. Meaning that only 1 of us 2 gets to save twice without reloading.

    OH, I DID read the changelog... whomever it was that asked. I tried this patch and it did not fix it.

    Thanks!
     
  16. Dagta

    Dagta Chieftain

    Joined:
    Jun 26, 2006
    Messages:
    97
    I believe I found a bug in the automated worker logic. I am using the un-official patch.

    In the Modern Age, I have one source of Aluminum next to a desert city of size 2. The automated workers changed my mine to a windmill to get the city more food. I had the city governor on automatic with no emphasis. This caused me to lose my aluminum and be unable to manufacture Modern Armors. I manually changed the windmill back to a mine.

    It seems to me that automated workers should not be permitted to change mines to other improvements if that is the only location with that specific resource. In this case, getting more food to a small city seemed a higher priority than using the strategic resource.
     
  17. Platinum Onyx

    Platinum Onyx Chieftain

    Joined:
    Feb 3, 2008
    Messages:
    24
    I downloaded the patch, but now I can't see the amount of culture a building produces in the pop up.
     
  18. Mesousa

    Mesousa -8.38 -6.67

    Joined:
    Apr 19, 2006
    Messages:
    478
    That's a bug that came with the official 3.13 patch, this unofficial patch here fixes it. First install the official patch, then apply the unofficial one, and it should be fine.
     
  19. Duuk

    Duuk Doom-Sayer Supporter

    Joined:
    Dec 16, 2005
    Messages:
    1,835
    Gender:
    Male
    Location:
    Detroit, Michigan, USA
    Go into your options and click "Automated workers leave old improvements".

    Otherwise, you pays your dime and you takes your chances.
     
  20. Platinum Onyx

    Platinum Onyx Chieftain

    Joined:
    Feb 3, 2008
    Messages:
    24
    Ok thanks.:)
     

Share This Page