Sea infrastructure capturable only if combat in territory

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Sea infrastructure capturable only if combat in territory

Pulicat
Confirmed testing report:

Units that are isSea and isInfrastructure behave normally (gets captured, or can be destroyed when captured) only when there is combat in the sea zone.

When naval units encounter undefended enemy infrastructure, no capture or destruction takes place.

puli
how now brown cow?
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

Veqryn
Administrator
can you test with the pre-release please?
i might have already fixed it
Please contribute to the TripleA 2013 donation drive:
http://tripleadev.1671093.n2.nabble.com/2013-TripleA-Donation-Drive-tp7583455.html
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

Pulicat
Just tested with pre-release, same.

Normal behavior with infrastructure captured after combat. Without combat in territory, the infrastructure just sticks around and nothing happens and the territory is still displayed as a striped combat zone even though no battle took place. Also, naval units passing through undefended enemy infrastructure on the way to another sea zone, does not capture or destroy them.

I have tested both with and without territory attatchments for the sea zones, it is the same.

puli
how now brown cow?
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

Frostion
In reply to this post by Pulicat
I can confirm that this bug still exists.
I have been using 1.8.0.5 and the latest Hard AI.
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

redrum
Administrator
@Pulicat/Frostion - Can you guys upload a save game that can be used to reproduce this? Also did you open a bug report for it?
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

Frostion
@redrum
I didn’t open a bug report. I have never really tied to make any bug report yet.

I can see that the problem is occurring on my un-released Dragon War map. I got a “Young-Water-Dragon” unit that is supposed to be capturable, just like the other dragons. As you know, the young ones should turn into the normal ones when lost in battle:
XML wrote
        <attatchment name="unitAttatchment" attatchTo="Young-Water-Dragon" javaClass="games.strategy.triplea.attatchments.UnitAttachment" type="unitType">
            <option name="isInfrastructure" value="true"/>
            <option name="attack" value="4"/>
            <option name="defense" value="4"/>
            <option name="isSea" value="true"/>
            <option name="movement" value="4"/>
            <option name="hitPoints" value="3"/>
            <option name="repairsUnits" value="1:Young-Water-Dragon"/>
            <option name="whenCapturedChangesInto" value="any:any:true:Water-Dragon:1"/>
            <option name="unitPlacementRestrictions" value="Lake 1:Lake 2:Lake 3:Lake 4:Lake 5:Lake 6:Lake 7:Lake 8:Lake 9:Lake 10:Lake 11:Lake 12:Lake 13:Lake Doom:Lake 15:Lake 16:Lake 17"/>
        </attatchment>
        <attatchment name="unitAttatchment" attatchTo="Young-White-Dragon" javaClass="games.strategy.triplea.attatchments.UnitAttachment" type="unitType">
            <option name="isInfrastructure" value="true"/>
            <option name="isConstruction" value="true"/>
            <option name="constructionType" value="dragon"/>
            <option name="constructionsPerTerrPerTypePerTurn" value="1"/>
            <option name="maxConstructionsPerTypePerTerr" value="1"/>
            <option name="attack" value="4"/>
            <option name="defense" value="5"/>
            <option name="isAir" value="true"/>
            <option name="movement" value="5"/>
            <option name="isKamikaze" value="true"/>
            <option name="hitPoints" value="4"/>
            <option name="repairsUnits" value="1:Young-White-Dragon"/>
        </attatchment>

        <attatchment name="unitAttatchment" attatchTo="Water-Dragon" javaClass="games.strategy.triplea.attatchments.UnitAttachment" type="unitType">
            <option name="attack" value="5"/>
            <option name="defense" value="5"/>
            <option name="isSea" value="true"/>
            <option name="movement" value="5"/>
            <option name="hitPoints" value="3"/>
            <option name="repairsUnits" value="1:Water-Dragon"/>
            <option name="unitPlacementRestrictions" value="Lake 1:Lake 2:Lake 3:Lake 4:Lake 5:Lake 6:Lake 7:Lake 8:Lake 9:Lake 10:Lake 11:Lake 12:Lake 13:Lake Doom:Lake 15:Lake 16:Lake 17"/>
        </attatchment>
        <attatchment name="unitAttatchment" attatchTo="White-Dragon" javaClass="games.strategy.triplea.attatchments.UnitAttachment" type="unitType">
            <option name="attack" value="5"/>
            <option name="defense" value="6"/>
            <option name="isAir" value="true"/>
            <option name="movement" value="6"/>
            <option name="transportCapacity" value="1"/>
            <option name="isAirTransport" value="true"/>
            <option name="isKamikaze" value="true"/>
            <option name="hitPoints" value="4"/>
            <option name="repairsUnits" value="1:White-Dragon"/>
        </attatchment>
The young land dragons are now capturable (thanks to you, redrum, pointing out a flaw in the xml), but the water version is not.
• If a human player or AI player with a “Young-Water-Dragon” looses a sea battle, he does not lose the dragon. The battle ends with the victorious ships and the “Young-Water-Dragon” (still enemy) in the sea zone. The sea zone keeps being red. After one round the “Young-Water-Dragon” can just combat/non-combat move out of the red sea zone, and the red marking go away. The “Young-Water-Dragon” unit does not seem to be capturable. No java error.

Another problem I got now is (and I don’t know if it is related):
• All not-young dragon units (including the “Water-Dragon”), with multiple hitpoints, can actually use the hitpoints in land/sea battle. Both AI and humans can choose the hitpoints as casualties.
But all the “young” dragons (including the “Young-Water-Dragon”) cannot use their hitpoints as casualties in battle.
Maybe because they are also isInfrastructure and isConstruction?

I can post a WIP version of “Dragon War” is you would like to test out what happens? I guess a save game is not worth much without the map?
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

redrum
Administrator
Alright. Yeah, I need some sort of save game and the map to test the sea infrastructure capture issue. So either providing your map with a save or reproducing it on another map would work.

Yeah, if a unit has 'isInfrastructure' then it overrides the hit points to be 0. The units can fight in combat but won't take any casualties and will either be destroyed or captured if there are no other remaining units with hit points in the battle. I'm not aware of any way around that but maybe some of the experienced map makers could explain whether what you are trying to accomplish is currently possible.
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

Frostion
This post was updated on .
Besides the “sea infrastructure capture issue” there seems to be another bug that is also beyond my comprehension. If you run an all AI vs. AI game, this error seems to show up at some point, when the player “AI” (the only one who is normally moving around with young dragons) is at a non-combat phase. The error show with the different "Young" dragons, not only the "Young-Green-Dragon" like bellow:
ErrorAtAINonCombatMove.tsvg
Error wrote
triplea.engine.version.bin:1.8.0.5
SEVERE [Triplea start thread] ConcurrentOddsCalculator -> 4 Battle results workers aborted by exception
java.lang.IllegalStateException: Duplicate Units Detected: Original List:[Young-Green-Dragon owned by AI, Young-Green-Dragon owned by AI, Ogres owned by AI, Ogres owned by AI]  HashSet:[Young-Green-Dragon owned by AI, Ogres owned by AI, Ogres owned by AI]
        at games.strategy.triplea.delegate.DiceRoll.rollDiceNormal(DiceRoll.java:1075)
        at games.strategy.triplea.delegate.DiceRoll.rollDice(DiceRoll.java:394)
        at games.strategy.triplea.delegate.Fire.rollDice(Fire.java:92)
        at games.strategy.triplea.delegate.Fire.access$300(Fire.java:25)
        at games.strategy.triplea.delegate.Fire$2.execute(Fire.java:244)
        at games.strategy.triplea.delegate.ExecutionStack.execute(ExecutionStack.java:51)
        at games.strategy.triplea.delegate.MustFightBattle.fight(MustFightBattle.java:438)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.calculate(OddsCalculator.java:277)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.calculate(OddsCalculator.java:170)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.call(OddsCalculator.java:175)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.call(OddsCalculator.java:58)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Exception in thread "Triplea start thread" java.lang.IllegalStateException: java.lang.IllegalStateException: Duplicate Units Detected: Original List:[Young-Green-Dragon owned by AI, Young-Green-Dragon owned by AI, Ogres owned by AI, Ogres owned by AI]  HashSet:[Young-Green-Dragon owned by AI, Ogres owned by AI, Ogres owned by AI]
        at games.strategy.triplea.oddsCalculator.ta.ConcurrentOddsCalculator.calculate(ConcurrentOddsCalculator.java:315)
        at games.strategy.triplea.oddsCalculator.ta.ConcurrentOddsCalculator.setCalculateDataAndCalculate(ConcurrentOddsCalculator.java:328)
        at games.strategy.triplea.ai.proAI.util.ProBattleUtils.callBattleCalculator(ProBattleUtils.java:192)
        at games.strategy.triplea.ai.proAI.util.ProBattleUtils.calculateBattleResults(ProBattleUtils.java:160)
        at games.strategy.triplea.ai.proAI.ProNonCombatMoveAI.moveUnitsToDefendTerritories(ProNonCombatMoveAI.java:739)
        at games.strategy.triplea.ai.proAI.ProNonCombatMoveAI.doNonCombatMove(ProNonCombatMoveAI.java:156)
        at games.strategy.triplea.ai.proAI.ProAI.move(ProAI.java:172)
        at games.strategy.triplea.ai.AbstractAI.start(AbstractAI.java:469)
        at games.strategy.engine.framework.ServerGame.waitForPlayerToFinishStep(ServerGame.java:665)
        at games.strategy.engine.framework.ServerGame.runStep(ServerGame.java:541)
        at games.strategy.engine.framework.ServerGame.startGame(ServerGame.java:333)
        at games.strategy.engine.framework.startup.launcher.LocalLauncher.launchInNewThread(LocalLauncher.java:100)
        at games.strategy.engine.framework.startup.launcher.AbstractLauncher$1.run(AbstractLauncher.java:57)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Duplicate Units Detected: Original List:[Young-Green-Dragon owned by AI, Young-Green-Dragon owned by AI, Ogres owned by AI, Ogres owned by AI]  HashSet:[Young-Green-Dragon owned by AI, Ogres owned by AI, Ogres owned by AI]
        at games.strategy.triplea.delegate.DiceRoll.rollDiceNormal(DiceRoll.java:1075)
        at games.strategy.triplea.delegate.DiceRoll.rollDice(DiceRoll.java:394)
        at games.strategy.triplea.delegate.Fire.rollDice(Fire.java:92)
        at games.strategy.triplea.delegate.Fire.access$300(Fire.java:25)
        at games.strategy.triplea.delegate.Fire$2.execute(Fire.java:244)
        at games.strategy.triplea.delegate.ExecutionStack.execute(ExecutionStack.java:51)
        at games.strategy.triplea.delegate.MustFightBattle.fight(MustFightBattle.java:438)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.calculate(OddsCalculator.java:277)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.calculate(OddsCalculator.java:170)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.call(OddsCalculator.java:175)
        at games.strategy.triplea.oddsCalculator.ta.OddsCalculator.call(OddsCalculator.java:58)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        ... 1 more
I still have this problem:
Here is a “sea infrastructure capture issue” savegame… but you can set the scenario up yourself by using edit mode. Would be more easy.
DoesNotConvertRound1.tsvg

I have noticed something:
The “Young-Water-Dragon” CAN be lost/converted if lost by the attacker in an attack. This can be reproduced by editing, place a Young-Water-Dragon and attack with it.
The “Young-Water-Dragon” CAN NOT be lost by the defender.
Weird!?  Or is there some logic behind this?
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

redrum
Administrator
@Frostion - Interesting map. Definitely looks nice and some interesting mechanics.

So the error you posted is resolved in the latest pre-release and had to do with the AI not handling place phase before move phases. Not many maps have place before move so it had never been tested.

So the sea infrastructure capture issue is interesting. I definitely can reproduce the behavior you describe that whether there is a battle or not the water dragon isn't captured by enemy sea units. This has to do with non-convoy zone sea territories can't be captured so it doesn't run the logic to capture or destroy infra units. Essentially, it boils down to whether the logic calls a method in order to capture/destroy infra units. I'm pretty sure this is unintended so I made a few changes and submitted a patch to change the behavior: https://sourceforge.net/p/triplea/patches/105/

This is pretty core territory capture logic that involves lots of complex issues so I'm not going to commit the patch until Veqryn reviews it. It could have lots of unwanted side effects that are very difficult to test for.
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

Frostion
@redrum

This is great news

I guess the Dragon War map will not be release-ready for some time anyway. So, I cross my fingers and hope the fix will be a part of a new TribleA release at some point.

It seems like my map will be dependent on the Hard AI. The Medium does not even place the Young-Dragon units when they are given to the AIs purchase list. I will have to write it in the notes, that Hard AI should be used.

• But, are there plans to make the Easy and Medium AI “dumber” versions of the Hard AI? I mean with the same functions as the Hard AI, but making deliberate dumber moves.

• Is there a way to play or install the Sea_Infra_Capture_Patch_2015-02-09.patch on my computer? Any install guide on the forum?
Reply | Threaded
Open this post in threaded view
|

Re: Sea infrastructure capturable only if combat in territory

redrum
Administrator
@Frostion - Dumber versions of the 'Hard AI' are not currently on the TODO list but it would be possible. I'd say its pretty low priority though.

You can but you'd need to download the code base through SVN, apply the patch, and rebuild the pre-release jar. If you don't have any coding experience this would probably be rather difficult. This is essentially what I do to create pre-releases. You'd have to follow the high level instructions here: http://triplea.sourceforge.net/mywiki/Developers