nkzw-tech / athena-crisis

Athena Crisis is an Advance Wars inspired modern-retro turn-based tactical strategy game. Athena Crisis is open core technology.
https://athenacrisis.com/open-source
Other
1.37k stars 105 forks source link

[AI] Prioritize Win Conditions when possible #5

Open cpojer opened 2 months ago

cpojer commented 2 months ago

Right now the AI does not consider win conditions besides escort by label/amount. When there is a capture win condition for another player, the AI should actively try to deny those captures. If there is a capture win condition applying to the AI, it should produce more units with the capture ability and focus on the capture targets (either all buildings or filtered by label). If there are defeat (one) by amount or label conditions that apply to the AI, it should seek out the corresponding units in particular.

You can find more info about how to set up win conditions in code in WinConditions.test.tsx.

Steps

I believe a good start is to tell the AI about capture-able targets (or specific opponents to attack) by adding them to the "interesting vectors" list in getInterestingVectors or getWinConditionVectors. For building more units with the capture ability, determineUnitsToCreate and its callsites are most relevant.

AI Info

The current AI is called DionysusAlpha and its code can be found there. There are also many AI specific helpers in dionysus/lib. Check out the AI Playground.

Test for new AI behaviors should be added to AIBehavior.test.tsx. These tests must fail without the change from this issue, ie. they must ensure that the AI deterministically implements the new behavior.

Funding

Fund with Polar