difficulty

(info) Other great resources: Official JS API docs, Scripting Forum

difficulty

A constant representing the difficulty level selected for your script.

 

Overview

End users can choose a difficulty level for AI players in skirmish or multiplayer games on the game set-up screen:

In challenges, the difficultly level is defined in the player sections of the challenge settings file. If a particular AI player doesn't have a difficulty specified, the end-user can choose the difficulty for that player.

The difficulty global tells your script what level has been selected for the player your script is associated with. Ideally, your script should become more challenging as the difficulty level increases.

You can determine the difficultly level set for other AI players by looking at their playerData[].

Values

If you're making Challenge Games, the "Difficulty" property for a player in the .ini file should be assigned a string value as shown in the "Challenge Value" column.

Value

Icon

Description

Challenge Value

Value

Icon

Description

Challenge Value

EASY

Mostly harmless, like a bunny rabbit. (Not a killer bunny though!)

  • On Warzone 3.2+, "Easy" AIs produce 25% less oil

"Easy"

MEDIUM

Keep the enemy on their toes.

"Medium"

HARD

Be a fierce opponent.

"Hard"

INSANE

Take no prisoners. Cheat if you have to. Pwn the enemy.

Warzone helps your AI cheat:

  • Oil production is doubled (on Warzone 3.2 and above)

  • Fewer structures are removed based on the base type setting

"Insane"