From: Brian W. <bwe...@xb...> - 2005-10-02 20:21:18
|
On Sat, 1 Oct 2005, Roland Clobus wrote: > There was a bug in the AI that prompted me to look a little closer at > the AI code. > > I think the AI could make better decisions when to play a development > card. The AI is called greedy, so it should get as much resources and > build as fast as it can, but I think it could delay some actions when > it will have no direct benefit. This sounds like a good idea. > > Year of Plenty: > Current: will be played anytime the bank has at least 2 resources. If > the bank does not contain anything the AI likes, it will request the > resources for a road, and if the bank is too empty, it will just pick > something at random. > > Proposed: the bank must have at least 2 resources. If the bank does > not contain anyting the AI likes, determine whether it is possible to > get enough resources to perform a maritime trade to get the resource > the AI needs (in the next turn). If not, determine whether the AI is > allowed to place a road [*1] and the resources are in the bank, and > request that. If all fails: don't play this card yet. I'm a bit confused by this logic. If the bank doesn't contain any resources the AI wants, it doesn't matter whether the AI can get enugh resources to be able to perform a maritime trade next turn, since there's a good chance there still won't be any resources it wants, and it also means the AI is more likely to have over 7 cards. I wonder if it would be possible to figure out if the AI is 1-2 cards short of a city/settlement/road it wants to build, and only play the card in that case. > Monopoly: > Current: will be played when the other players have at least six > resources cards in total. If the AI doesn't need anything in > particular, it will pick the resource that all players have the most > of. > > Proposed: will be played when the other players have at least six > resources cards in total. If the AI doesn't need anything in > particular, don't play it yet. Agreed, although I wonder if the AI should take into account the number of cards. For example, if the AI wants a lumber, and will only get 1 lumber by playing monopoly, but could get 10 brick, taking the brick would be a much better idea, since it could do a 4:1 (or better) trade and still come out way ahead. I know I've played monopoly after a ton of cards of one type have been given out, just to use them for trading. > Road building: > Current: play whenever two or more road segments are left. > > Proposed: play whenever two or more road segments are left, but not > when road segments are not allowed to be built [*1] OK. > Gold: > Current: when the AI does want something, get it. Otherwise, start > emptying the bank starting from the first resource. > > Proposed: when the AI does want something, get it. Otherwise, start > emptying the bank starting from the resource that has the best > maritime trade ratio. Unlike the dev cards, gold can't be deferred until later, so there might be situations where the AI doesn't want anything because it can, for example, already build a settlement. It might be worth it to figure out what the AI will do first, and if its first action is to buy something, re-evaluate what it would want after buying it, then choose that, falling back to something like your suggestion afterwards. This might be too complicated, though, and your idea would still help. Brian |