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

Combat Odds 0.0%

Discussion in 'Civ4 - Better AI' started by Venger, Jun 6, 2009.

  1. Venger

    Venger Give it a tumble, sport

    Joined:
    Apr 18, 2002
    Messages:
    782
    So why? Why? WHY? Does the AI throw stack after stack of unit against a non-bombarded unit when it has 0% chance? Charlemagne sends 10 transports that manage to race ahead of his escorts, which are a turn or so behind and can at least bombard my city (playing a OCC game) to give them a fighting chance? Nope... wave after wave of Infantry, Cavalry, and other units crash upon my C6D4W3 fortified Infantry and three to five units manage to thrash 40 some units with no loss. I check the logs, just to see the story, and almost all of them range between 0.0% and maybe 2% max chance of winning. Two turns later, he can cut my 80% bonus with a naval bombardment.

    Running .70 by the by, figured someone would want to know. Since it doesn't seem better to ever, ever, EVER attack with a 0% chance of winning. And it didn't even land them, either, it attacked from the sea. Just made no sense.
     
  2. Woody1

    Woody1 Prince

    Joined:
    Feb 19, 2002
    Messages:
    468
    Location:
    Texas
    I don't think it matters much whether a single attack has a 0% chance of winning, it really matters what chance of winning the entire stack-battle has.

    Is there an easy algorithm the AI can use to tell it what chance of winning it has with its entire stack? If so, perhaps it could have a rule somewhere that it doesn't attack if doesn't have at least a 25% chance of winning the battle. (Or maybe 50%, whatever.)
     
  3. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    A lot of times a 0% chance of winning actually does greatly improve the odds for the next unit in your stack to attack. (If it manages to damage the unit.)
    It's still a bit iffy because really low odds have a significant chance of not damaging the opponent at all.

    Oh and you don't want a hard rule about unit attacks. Seige weapons are not allowed in BTS to kill a unit when attacking, they auto retreat if they hit the max damage allowed to their target.
    You instead want to consider the odds of your stack winning against their stack as Woody mentions.
     
  4. BobTheTerrible

    BobTheTerrible Just Another Bob

    Joined:
    Jan 5, 2003
    Messages:
    927
    Location:
    Middle of Nowhere
    I think that's part of the problem - If I recall correctly, it is very difficult to get an accurate simulation of stack vs stack combat, even for rough heuristic purposes. Thus while a human can eyeball two stacks and have an OK idea of the winner, it's nearly impossible to write a good chunk of code for the AI to do that (unless you want to wait for a much longer time between turns).
     
  5. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    Indeed, it is like bob said. if you dig in this sub-forum , there is a thread with some discussion on making the AI aware of a stack chances in a fight, by simulated combats..... but , by some reason ( there is a good number of them, to be honest ) it was not implemented yet.

    And to say the truth, humans are not as good as that at knowing the odds of a stack... we normally over-build, just to make sure :D
     
  6. peter450

    peter450 Prince

    Joined:
    Sep 24, 2006
    Messages:
    392
    The way it works is although the first unit has zero chance, there is a high chance it will dmg the unit, so the follow up will win through or dmg further for the next unit to then get the kill

    This goes all wrong however when the defending unit has at least double the str of the attacker and 4 or more FS, because of the str differance all of the FS are practically guranteed to be converted to damaging hits and because of the str differance, you only need 4 hits to kill, so combat is won in the FS phase with zero dmg to you, so one unit can hold of waves until a very lucky blow causes it to maybe loose a bit of str, however unless this loss is enough to bring it's str down to below double it will carry on

    I had a warlord unit with drill 4 Woods 123 and combat 6, hold off 40 units on a wooded tile once, earning about 80 xp in the proccess

    these instances are rare though as generally only a warlord would be able to amass enough str, garriosn or terrain, + drill promos to do it
     
  7. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Oh, very interesting ... that's a good point you make peter450, an advanced unit with enough first strikes can be effectively invincible. I've never created a unit with more than maybe 35 exp points myself, it must feel a little ridiculous to get up to level 12 or whatever!
     
  8. peter450

    peter450 Prince

    Joined:
    Sep 24, 2006
    Messages:
    392
    My record without cheating (reloading when if unit lost) was around 576XP, from a warlord mech inf (started as a swordman)

    He was a tough customer!!

    One thing though is even with loads of promo's warlords are quite vunrable on open terrain, and will get taken out, you need to be on def terrain like hills or forest + have the terrain promo's, if you got all that + all the drills + combat 6 + the pinch, formation etc your in good stead to hold off a lot and i mean a lot of units

    Excepting early cav units as they are FS immune so a group of them is death for a warlord defender, even with all the needed promo's

    The tank warlords are good too but because lack of def bonus's they don't make such good defenders, but with city raider 3 + combat 6 and pinch you get 99.9 even on city garrison 3 fortified mech inf, + the extra move meaning 3 attacks means you can clear out tough defenders in no time

    I do like the warlords, but getting a really bad ass one is not all that easy, but once there they really do prove there worth
     
  9. Woody1

    Woody1 Prince

    Joined:
    Feb 19, 2002
    Messages:
    468
    Location:
    Texas

    That's why you use units immune to first strikes, like most mounted units, when attacking those kinds of "+4 first strikes" units. If they're in a stack, hopefully they're still chosen as the defender. And on attacking a stack with one, hopefully a "immune to first strikes" unit is chosen to defend against them.
     
  10. MadmanAtW

    MadmanAtW Knight

    Joined:
    Apr 13, 2008
    Messages:
    579
    Location:
    San Leandro, CA
    Or you sink the transport he's on. ;) (This is how I unknowingly killed the highest level warlord unit I've ever seen in a multiplayer game. Not as high as the one mentioned above, though.)
     
  11. Venger

    Venger Give it a tumble, sport

    Joined:
    Apr 18, 2002
    Messages:
    782
    My Maximus unit is not quite there, but he's in spitting distance and is one good war from likely hitting 600. Only year 1917 right now, so plenty of time. Lucullus and Crassus are in the 400's as well.

    The OCC really does enhance getting GG's, especially if you build the Great Wall - with the Great Wall and the 2x XP from LEadership, these units really crank out the XP on battles within your borders. And since in an OCC you are almost always inside your borders... cha ching.
     

    Attached Files:

  12. joncnunn

    joncnunn Senior Java Wizard Moderator

    Joined:
    Mar 17, 2008
    Messages:
    8,621
    Location:
    Missouri
    Venger, I take it your trying to win via spaceship on the OCC you play since if you were going for Conquest it's going to be quite difficult to win if your always fighting within your own borders.
     
  13. Venger

    Venger Give it a tumble, sport

    Joined:
    Apr 18, 2002
    Messages:
    782
    Yes - I am on a huge map, there is no way to win domination or conquest that way.

    Of course, the Sumerians launched a spaceship, and *I* had to cross half the map to take out their capital city. Nobody else even tried. To me, that makes no sense - if you launch a spaceship you should get dogpiled. It was sickly easy too, I took 2 transports but could have done it with 1. Three units to crack their mech inf, a marine to sack the city and get dogpiled by the counterattack. Very poorly defended.

    Which brings me to one thing that bugs me on OCC - if I take a city, I should have the opportunity to liberate it to it's original owner. Instead, it gets razed to the ground without question. So, when France takes and English city and then I take it back a few turns later, I piss off the English... sigh...
     
  14. peter450

    peter450 Prince

    Joined:
    Sep 24, 2006
    Messages:
    392
    I do like the warlords, i just finished tweaking the warlord units in my game as it goes, it took around a year lol, of intermitent tweaks to get it feeling right from a power/balance perspective, funny as when i look at it theres not many changes at all, but with all the time i spent playing it online with friends and vs computer each change actually ended up needing quite a lot of follow through behind it to make sure it was right
     
  15. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    The end game scenario will change ... it might be few months, but I've got some plans which should make it much more challenging.

    Sounds like a good suggestion for an unofficial patch ... cross-posted over there.
     
  16. JujuLautre

    JujuLautre Deity

    Joined:
    Apr 9, 2007
    Messages:
    3,112
    Location:
    Kansai, Japan
    I disagree. Not a human-like AI please...
     
  17. r_rolo1

    r_rolo1 King of myself

    Joined:
    May 19, 2006
    Messages:
    13,818
    Location:
    Lisbon, Portugal
    Insta-dogpile on SS launch = erasing SS victory of the game in 90% of the cases, especially for the AI.....
     
  18. MadmanAtW

    MadmanAtW Knight

    Joined:
    Apr 13, 2008
    Messages:
    579
    Location:
    San Leandro, CA
    Well, that dogpile needs to take the capital- if they don't follow new rules for picking targets they'll just do a war and it might take them too long to get to the capital, right? If they are smart about targeting the capital then it'll be tricky... but worse will be if they are smart about dogpiling someone who is nearing cultural victory, since you have three targets the razing of any one of which knocks the civ out of the game entirely.

    Would make SP more like MP.
     
  19. jdog5000

    jdog5000 Revolutionary

    Joined:
    Nov 25, 2003
    Messages:
    2,601
    Location:
    California
    Having everyone dogpile whoever launches a spaceship would be ridiculous and gamey for SP, but as it stands now neither your enemies nor your friends react when you launch a spaceship or get close to winning a cultural victory ... to me, there should be some extra drama when the game is on the line. Spaceships and cultural victories in SP are often simply about waiting out the clock ... unless the AI is significantly ahead of you (or you're playing OCC), there often isn't much of a race in the space race.

    The AI is built to play the game, but not to win it right now. The one exception is Blake's earlier work on cultural victories, there the AI will decide to go for it and make civ-wide decisions to reach that goal. For space it has bits and pieces, but it's not a coherent whole ... with one part to go before launch, the AI may decide it wants to declare war on some random civ (not one that's going to beat it or anything) and then build tanks for a while instead of finishing its spaceship. There is no particular decision by the AI to go for conquest/domination either, some of the more aggressive civs will get there based on personality but it's never a coherent strategy. That is something I intend to address.

    The other piece to the puzzle is making the AI react to the potential end of the game. In a test game I just watched, Mansa Musa won a cultural victory and on the turn when he won, Saladin was in the middle of preparations for war against Mansa Musa ... the poor AI though had no idea that it was now or never, it was just plodding through its normal path to declaring war. If someone's about to win, I want the AI to accelerate decisions it probably would get around to anyway ... if Saladin doesn't like Mansa Musa and is going to lose, then he should take his best shot before the final buzzer. But, if they're old friends/allies or Saladin otherwise wouldn't normally even consider declaring war on Mansa Musa, then doing so at the end would just be gamey and out of character.

    That's where I'm thinking of taking things.
     
  20. Yakk

    Yakk Cheftan

    Joined:
    Mar 6, 2006
    Messages:
    1,288
    Hmm. Call it the Doomsday Clock value? (the projected point where the game will end)

    Calculating that for cultural victory is quite reasonable. End of game also. Spaceships... before launch, it is harder to calculate (but you could take 50%-100% of a civilisations production rate and allocate it to building components for a half-assed guess).

    Domination might be interesting. I suppose you could project the last 100*(sqrt(game_speed_multiplier)) rate of expansion of population and land area, and use that for an approximate count down (do it both for free and dominated territory). (100 pulled out of ass. Sqrt used because unit movement doesn't scale with game speed, but production of units etc does.)

    A UN Secretary General Doomsday clock value is tricky. An AI could pull off an extrapolation similar to Domination?

    Conquest ... I suppose you could do a pseudo Domination, aiming for 100% of the world's population and/or territory, but treating vassals as 100% and not 50%?

    Of interest with a Doomsday clock method is that as you add more ways to detect 'the end of the game', the Doomsday clock is just the minimum of each of these values. So if you are missing something like UN Sec Gen victory, it doesn't make it fundamentally broken.

    And if done right, the Doomsday clock might just encourage action, rather than action against the possible victor. So you might have a nuclear war getting triggered by you launching a space craft, but it might be a nuclear war that is quite unrelated to you (but might drag you in...)

    Also of interest is that the Doomsday clock might make a civilisation that is near to world conquest 'move up plans' to conquer the world, as their own projected Doomsday victory is encouraging them to "just go to war already"! :)
     

Share This Page