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

Why do caravels defend galleons?

Discussion in 'Civ4 - General Discussions' started by rmunn, Mar 5, 2010.

  1. rmunn

    rmunn Chieftain

    Joined:
    Aug 7, 2009
    Messages:
    59
    In a recent game on Noble, I let my military languish while I teched up to Rifles/Military Tradition. I was just a few turns away from Military Tradition when an AI on another continent to the north DoW'ed me. His first sea invasion happened before I could get enough Frigates up north to stop him (most of my production cities were in the south), and I lost a single city. I quickly retook it -- Cavalry vs. Macemen is a joke -- and started destroying his future invasions with my Frigates.

    As I was attacking his sea invasion stacks, though, I noticed something funny. He was escorting his Galleons (strength 4) with Caravels (strength 3). Both his Galleons and the Caravels had Combat I promotions and nothing else, so by my understanding of the combat mechanics, the Galleons should have been picked to defend the stack. But whenever I attacked with my Frigates, I'd kill a Caravel, not a Galleon -- and often one or two Galleons would slip through to drop their troops on my coast, where my Cavalry rapid-response force would quickly mop them up.

    Not that I'm complaining about the free XP for my Cavalry... but why were the AI's Caravels picked to defend his ship stack instead of the higher-strength Galleons? Is it because the Galleons count as "transport ships" and thus won't defend the stack as long as they have any escorts? But if that's the case, why wouldn't Caravels also count as "transport ships" since they have a cargo capacity of 1?

    There's something I don't yet understand about the game mechanics here. Any enlightenment would be appreciated.

    The AI was Mehmed II of the Ottoman empire, by the way -- Exp/Org with the Janissary as his UU, so his ships were perfectly standard units as far as I know.
     
  2. LincolnOfRome

    LincolnOfRome Glutton for Punishment

    Joined:
    Feb 14, 2010
    Messages:
    1,014
    Location:
    Richmond, VA
    Transport ships
    Galley -> Galleon -> Transport

    Fighting ships
    Trireme -> Caravel -> Destroyer -> etc.

    I think you answered your own question. I guess it was the equivalent of sacrificing his caravels so the troops could get through.
     
  3. bakshi

    bakshi Prince

    Joined:
    Jan 31, 2010
    Messages:
    389
    Because a galleon is used as a transport while a Caravel isn't. Also its cheaper to lose a caravel then a galleon.
     
  4. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    If I remember correctly, when there is a unit in a transport, that transport is put at the bottom of the list to defend the stack. Transports with units in them will only start defending the stack if only other loaded transports remain. It's possible it's not quite that clear cut, the getBestDefender function is pretty complex, it's possible loaded transports just get a significant weight reduction in getting selected to be picked as the defender, if this is true though, that reduction is massive so a loaded transport pretty much never defends a stack regardless.
     
  5. God-Emperor

    God-Emperor Deity

    Joined:
    Jul 18, 2009
    Messages:
    3,551
    Location:
    Texas
    This is also why it will pick a destroyer to defend a stack instead of a missile cruiser: the missiles on the missile cruiser push it down in defense priority.

    This annoys me just about every time it happens. It typically works out that my combat 1 + healing 1 destroyer is wiped out by the attacking combat 2 (or whatever) destroyer instead of the attacker being wiped out by my combat 2 missile cruiser. This is why it can be a bad idea to upgrade your battleships to missile cruisers.
     
  6. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    You could also just not load anything on a couple, same effect since an empty transport doesn't trigger the defender value weight reduction. Edit: Actually I do use BetterAI's version of getBestDefender which may cause this, I can't be certain about vanilla, since I haven't played it in quite some time.
     
  7. rmunn

    rmunn Chieftain

    Joined:
    Aug 7, 2009
    Messages:
    59
    I guess what puzzled me is that caravels have a cargo capacity, so I assumed they would fall under the "transport" category. But on second glance, they can upgrade to either a frigate or a submarine, so I guess BTS does consider them warships after all.

    A pretty good ship-stacking tactic on the AI's part, I have to admit. Although it would have been a lot more effective if I hadn't had a stack of cavalry, backed by suicide trebuchets, sitting on my land waiting to roll out the traditional American welcome to the few invaders who actually got through... :lol:
     
  8. Yxklyx

    Yxklyx King

    Joined:
    May 7, 2008
    Messages:
    869
    I assume it works this way for Subs too? It doesn't matter what the ship is carrying then? For instance, a Caravel with a missionary on board would not defend before a Galleon?
     
  9. beestar

    beestar subdeity

    Joined:
    Oct 18, 2005
    Messages:
    1,596
    Location:
    Pacific Standard Time
    In SGOTM10 I did a test and, as I recall, Subs don't defend when they cannot be detected by the attacking unit. Causes problems if enemy Frigates are attacking your Galleons, and you are trying to guard your Galleons with Subs.
     
  10. digitCruncher

    digitCruncher Emperor

    Joined:
    Oct 28, 2007
    Messages:
    1,012
    Just to clarify:

    If a ship has something in it, it is classified as 'loaded' and thus, it will be much less likely to defend the stack. Loaded ships will only defend if there are no unloaded ships in the stack.

    So, if you have a caravel, and a galleon with a Great Prophet in it, the caravel will defend, because it is the only unloaded ship. But if the Great Prophet is in the caravel, then the galleon will defend the caravel (because the Galleon is the only unloaded ship). If there is nothing being carried (the galleon and the caravel are both unloaded), then the galleon will defend, as it has a higher strength value.

    So Civ IV doesn't pick the defender based on 'combat' and 'transport' ships. Instead, it picks the strongest ship which isn't carrying anything, and if all the ships are carrying something, then it will just pick the strongest ship.

    This means that an unloaded caravel WILL defend a Missile Cruiser, if the Missile Cruiser has missiles on board. IE if someone attacks, the caravel will defend, not the Missile Cruiser
     
  11. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    I don't think the getBestDefender is "Better AI's" code as such but rather the code from the Lead From Behind modcomp. I'm not sure whether it's in the UP as well or whether it's been further modified for BBAI's purposes.

    It's got nothing to do with that. Ships aren't picked for defending based on whether they are warships or transport ships generally. It goes a little differently, almost exactl the way this poster describes:
    Basically, when units have a cargo, they are considered to be of greater value and are less likely to defend a stack. I think their "value" even takes into account the relative value of the units onboard, so a boat full of warriors will be picked to defend before a boat full of infantry, though I'm not 100% sure about this.

    I don't think it's true that loaded transports ALWAYS defend last. If the other units defending it are weak enough or injured enough, the transport can get picked to defend.
     
  12. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    I thought that's what I was saying, if a ship has something loaded on it, it's put to the bottom of the list. It may be a little more involved then that though, as I say, getBestDefender is pretty complex, hell if anyone knows you would though PieceOfMind, you already re wrote this code didn't you? If you didn't I know you coded something to hook into the function, so you probably know better then the firaxis developers at this point.
     
  13. PieceOfMind

    PieceOfMind Drill IV Defender Retired Moderator

    Joined:
    Jan 15, 2006
    Messages:
    9,319
    Location:
    Australia
    Not quite. I've never touched the function except for examining it trying to make sense of it. It was UncutDragon who went to town with it, improving its efficiency and changing its logic for the Lead From Behind mod. The reason I have some familiarity with it is that it frequently comes up in discussions, like in this thread, about why a bad "best defender" was picked, plus it has bizarre results for units with lots of first strikes, which I probably see more than the average player. ;)

    IIRC, it's not a matter of generating any sort of list, but rather looping through all units and each time a better defender is found, it becomes the new best defender. It's been a while since I've looked at it though so I could be mistaken.
     
  14. snepp

    snepp King

    Joined:
    Oct 27, 2005
    Messages:
    667
    Location:
    Sioux Falls, SD
    I'm glad I found this thread, I couldn't for the life of me figure out why my "healer destroyers" were defending instead of my massively beefed up battleships.

    I guess I'll have to be a little more selective of which ships I load my seaplanes onto.
     

Share This Page