triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.32k stars 392 forks source link

AI Purchase is not looking at the unplaced units from current & previous turns #12436

Open TheDog-GH opened 5 months ago

TheDog-GH commented 5 months ago

I am working on a new map, it has random starting territories, Risk like. So this is difficult to reproduce, but I am willing to test the following.

Using FastAI or HardAI the AI is buying Factories even though there are Factories available for placing, just given to it that turn and in previous turns.

The AI Purchase is not looking at the unplaced units from current & previous turns that have not been placed.

This property is important <property name="Unplaced units live when not placed" value="true"

Extract from Game History Trigger NationalTheme Germany-AI: 2 Industry-Hvys, 2 Industry-Lgts and 2 Industry-Meds gained by PlayerId named:Germany Germany buy 2 Armor-Infs, 1 Base-Camp, 1 Biplane, 6 Cavalrys, 2 HQ-Armys, 1 Industry-Hvy, 1 Inf-Elite, 6 Inf-Traineds and 1 _Dev-Armor-Lgt; Remaining resources: 6 PUs; 2 Tech;

beelee1 commented 5 months ago

Does it do the same in 2.5 ? Might have always been like that. Did you ask wc ? Maybe it's a map making/xml thing ?

Idk :)

TheDog-GH commented 5 months ago

Yes it does the same in 2.5 :)

In Risk style maps the AI conquers territory and will not place Factories unless it thinks it needs them, here I am trying to emulate what a human would do, buy pre-buying the Factories so as the AI expands it will need Factories, but because it has the Factories it will place them. The AI does not know the Factories generate PU & Tech, but a human does.

For AI purchasing it might be 'messy' to look what is already unplaced and then the AI decides what to purchase.

A big problem with Risk style maps is that, the AI does not always place Factories when a human would.

Maybe another answer is the AI placement has a new phase, at the end of its current AI placement phase & places the best Factory in a Territory. This way it would use up its stock of Factories and not interfere with the current AI purchase & place phases?

beelee1 commented 5 months ago

Right on. Should this be a Feature Request then ?

TheDog-GH commented 5 months ago

Maybe, yeah I suppose it should, could you do the honors?