AI picks obviously the wrong casualty, what could it be?



  • The following casualty selection by AI should not happen as far as i can comprehend.
    3 units involved.
    Infantry, Elite, Bunker.
    5x Infantry (4 PU each) and 1x Elite (5 PU) attack one Bunker.
    Bunker kills one attacker but AI picks Elite as casualty.

    <attachment name="unitAttachment" attachTo="Infantry" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
    <option name="attack" value="1"/>
    <option name="defense" value="2"/>
    <option name="movement" value="1"/>
    <option name="transportCost" value="3"/>
    <option name="isLandTransportable" value="true"/>
    <option name="createsResourcesList" value="-1:PUs"/>
    </attachment>
    
    <attachment name="unitAttachment" attachTo="Elite" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType">
    <option name="attack" value="1"/>
    <option name="defense" value="3"/>
    <option name="movement" value="1"/>
    <option name="transportCost" value="3"/>
    <option name="isLandTransportable" value="true"/>
    <option name="createsResourcesList" value="-1:PUs"/>
    </attachment>
    

    And here is the support attachment for the Bunker which is a negative support attachment against Infantry of all kinds which end up at attack 0 at a 1:1 ratio:

    <attachment name="supportAttachmentBunker" attachTo="Bunker" javaClass="games.strategy.triplea.attachments.UnitSupportAttachment" type="unitType">
    <option name="unitType" value="Infantry:Elite:Mot.Inf:Mot.Elite"/>
    <option name="faction" value="enemy"/>
    <option name="side" value="defence"/>
    <option name="dice" value="strength"/>
    <option name="bonus" value="-1"/>
    <option name="number" value="1"/>
    <option name="bonusType" value="Infantry Combat"/>
    <option name="players" value="Germans:Russians:British:Americans:Neutral"/>
    </attachment>
    

    The AI should pick the cheaper unit if both have the same combat value or do i miss something?



  • How much do they both cost? In the map I am trying to make, it tends to pick the one that costs the least PUs (I have other resources involved though).

    edit: least not last



  • @ff03k64
    i have only PU and the AI sometimes picks a 5PU unit instead of a 4PU unit, while both have the same attack value. And i dont know why.
    Nice to know that it does it properly with another resource involved.



  • No, i don't think it takes the other resources into account. It just takes the one with the least PUs as the casualty. My infantry type unit costs 15, and another costs 10 and some iron say, o r consumes another unit, it only figures in the 10 and 15.

    Though after thinking about it, they might have had different attack values at the time. I have changed that a few times over the course of my planning.


  • Admin

    Ai does look at supports, if the elite is getting the negative one then it would appear to be the weaker unit.



  • @LaFayette Thanks, thats good to know.


Log in to reply