AI won't use trains/railroads
-
I noticed that in maps which have them, the AI will not use trains to transport land units and instead will walk the units over long distances. However, when the AI has the option to use trucks it WILL use them to transport units and actually uses them quite handily. So the issue is not with the isLandTransport option as I thought it was.
The only difference between these two units is that the truck can move wherever it wants, but the train can only move on rails. I think that the problem might be that the AI doesn't recognize the requiresUnitsToMove option.
It would be great if we could get this unit working because it is very thematic (trains were used to move a lot of troops in WWII, WWI, the American Civil War, etc.) and makes moving units across large maps a lot faster and more fun.
-
Also here are the unit attachments I am using:
<attachment name="unitAttachment" attachTo="truck" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="6"/> <option name="attack" value="0"/> <option name="defense" value="0"/> <option name="canBlitz" value="true"/> <option name="isLandTransport" value="true"/> <option name="transportCapacity" value="2"/> <option name="isInfrastructure" value="true"/> </attachment> <attachment name="unitAttachment" attachTo="railroad" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="0"/> <option name="isInfrastructure" value="true"/> <option name="isConstruction" value="true"/> <option name="constructionType" value="railroad"/> <option name="constructionsPerTerrPerTypePerTurn" value="1"/> <option name="maxConstructionsPerTypePerTerr" value="1"/> </attachment> <attachment name="unitAttachment" attachTo="train" javaClass="games.strategy.triplea.attachments.UnitAttachment" type="unitType"> <option name="movement" value="6"/> <option name="attack" value="0"/> <option name="defense" value="0"/> <option name="isInfrastructure" value="true"/> <option name="isLandTransport" value="true"/> <option name="transportCapacity" value="6"/> <option name="requiresUnitsToMove" value="railroad"/> </attachment>
-
@iratoric you could ask @RogerCooper He knows how to manipulate the AI into doing certain things.
-
Railroads as units doesn't make a lot of sense. Most wargames treat railroads as terrain.
Easy ways of handling railroads are:
-
Increase the movement allowance of all ground units and make non-railroad areas must stop terrain
-
Have train stations give a movement bonus to ground units (like air bases giving a bonus to air units)
-
-
@rogercooper I will try increasing the move value of all the units. The base problem I am trying to solve is that I have a large map and I don't want it to take forever to move units across it.