AI Modification for a Single Maps - Robosturm/Commander_Wars GitHub Wiki

The following commands are meant to modify the behaviour of the AI for a single map. Enable or disable the ability of the AI to attack Terrain:

map.getPlayer(0).getBaseGameInput().setEnableNeutralTerrainAttack(true);

The following command allows to modify the score a unit gets the AI builds the unit with the highest score. A modifier of 0 disables a units production and a score of 1 is the normal modifier and a modifier of 2 doubles the score for a unit. The scores are most times between 0 and 100.

map.getPlayer(0).getBaseGameInput().setUnitBuildValue("UnitID", modifier);

You can tell the AI to move around certain terrains by setting a virtual movement cost for a certain field. A value of 5 for a plains means that the AI thinks that it would costs 6 movement points to move over this terrain. The move map is mostly used for planing more than one turn ahead. The movemap is modified by the AI for Black Hole Buildings etc. do find paths around the firerange of those buildings. This won't increase the actual movement costs or fuel costs. It's a pure simulation value for the AI.

map.getPlayer(0).getBaseGameInput().setMoveCostMapValue(x, y, value);