AI: Difference between revisions
m typo. |
No edit summary |
||
Line 1: | Line 1: | ||
The | The WarLight AI's behavior is determined by a set of algorithms. The source code behind these algorithms can be viewed on GitHub at https://github.com/FizzerWL/WarLight.AI. | ||
== Weighted Random == | == Weighted Random == | ||
Line 9: | Line 9: | ||
Confirmed: | Confirmed: | ||
* | * The only cards it can play are the [[reinforcement card]], [[sanctions card]], [[bomb card]], [[blockade card]], and [[diplomacy card]]. | ||
* It prefers to expand as long as it still sees [[neutral]] [[bonuses]] to expand to | * It prefers to expand as long as it still sees [[neutral]] [[bonuses]] to expand to, as long as the bonus meets its criteria for being a good bonus. {{Ref|http://warlight.net/Forum/Thread?ThreadID{{=}}136&Offset{{=}}12}} | ||
== Behaviour of the AI in team games == | == Behaviour of the AI in team games == | ||
Line 29: | Line 22: | ||
* The AI will not play cards when teamed with a human teammate unless it must play cards by rule. The only circumstance where an AI must play cards when teamed with a human teammate is if the last player on a team turns into an AI via boot or surrender and [[cards]] must be used by that team that turn. | * The AI will not play cards when teamed with a human teammate unless it must play cards by rule. The only circumstance where an AI must play cards when teamed with a human teammate is if the last player on a team turns into an AI via boot or surrender and [[cards]] must be used by that team that turn. | ||
== Playing Itself == | == Playing Itself == |
Revision as of 06:05, 10 April 2016
The WarLight AI's behavior is determined by a set of algorithms. The source code behind these algorithms can be viewed on GitHub at https://github.com/FizzerWL/WarLight.AI.
Weighted Random
The AI constructs a list of actions it could take on each turn, along with a value of how strongly it feels it should do that action. It then does a weighted random against that list. This means that the AI is never perfectly predictable, but it does have tendencies.
General behaviour of the AI
Confirmed:
- The only cards it can play are the reinforcement card, sanctions card, bomb card, blockade card, and diplomacy card.
- It prefers to expand as long as it still sees neutral bonuses to expand to, as long as the bonus meets its criteria for being a good bonus. [1]
Behaviour of the AI in team games
- It will only attack teammates in two circumstances:
- If a bonus is entirely controlled by teammates and it has >= 50% of the territories. It will only do attacks of 2 then.
- If it's expanding into a new bonus that no teammates control. [2]
- The AI will not play cards when teamed with a human teammate unless it must play cards by rule. The only circumstance where an AI must play cards when teamed with a human teammate is if the last player on a team turns into an AI via boot or surrender and cards must be used by that team that turn.
Playing Itself
Under the single-player tab, you can set up a game full of AIs, no fog and watch the entire game play out on its own.
However, under the multi-player tab, the AI will not play a game without any humans involved. If only AIs remain in a game, the AIs will simply vote to end. If voting to end is not possible, such as in a tournament game, the AIs will just pick a winner randomly. This restriction is necessary due to the way that multi-player games work. Due to WarLight's flexible engine, someone could construct a game that took thousands or millions of turns to finish. For example, a game with no bonuses or large wastelands separating players. The WarLight server would strain to complete these games, likely causing the entire site to grind to a halt.