yiotro / Antiyoy

A source code of android game called 'antiyoy'.
421 stars 53 forks source link

AI starts with farms - not ideal #2

Open ThrawnCA opened 7 years ago

ThrawnCA commented 7 years ago

The AI players tend to start by building a farm, before building any peasants. However, this is not the optimal decision.

When there is plenty of room to expand, so that a peasant can increase your territory by one hex every turn, a strategy of building only peasants will pay off better by about turn 7. If there are trees to contend with, peasants become even more important - especially since they can boost your cash by chopping down trees inside your borders. And a rapid expansion often allows you to block your neighbours off and stunt their growth.

The usefulness of farms is later, when your own expansion is constrained (ie when peasants will not be able to expand your territory every turn) and you want to get more out of your existing space.

yiotro commented 7 years ago

Yes, I completely agree with this. The reason for this behavior is simple: Originally this game had only 'slay rules'. 'Normal rules' were added later and I haven't changed AI too much. So at this point AI is better suited for 'Slay rules'. I think I will fix this at some point, thanks for reporting about this problem.

ThrawnCA commented 7 years ago

Hmm...there is a further point in favor of farms, I guess: they stay close to home. Rapid expansion can be very effective, but it also accelerates conflict, and unlike the original Slay, units are not infinitely mobile. Getting a peasant killed and several hexes captured because you wandered close to a powerful neighbour is not efficient at all. And I notice that the AI logic, upon finding that it can't move, will promptly try to merge units into stronger ones, so if you want to box it in, you have your work cut out for you.

Still, it rarely makes sense for building a farm to be your first action. As a minimum, I'd say that as long as the whole region is no bigger than 4*4 - so any unit can cross it in one turn - and you're not cramped, you don't need to switch to farms yet.

ThrawnCA commented 7 years ago

The impact of this AI weakness is significant enough for me to steamroll it on pretty much any large map. As long as there is plenty of room to expand, building exclusively peasants quickly becomes more efficient than building farms (since it grows exponentially instead of approximately linearly), and it means that when I do start to run into my neighbours, I have a bigger army than they do.

The only campaign scenario that has given me any real difficulty was number 24, where the map is more crowded and my starting territories were widely spaced (actually, when I finally won it, that prompted issue #6).

yiotro commented 7 years ago

I've slightly increased income of farms, but yeah, AI needs to be fixed.