Latest Posts

Topic: congratulations to the AI developers

king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-04-24, 01:31

I often complain about how bad the AI is, but now I tried it on a recent version (7442) and I was surprised by how much it had improved. It is good that now it makes training buildings fast. Its power starts to increase around one hour, while it took some four hours with the old version before it started to have decent soldiers. It also took much more to reachmy borders: in one hour I had sighted the enemy, something that previously didn't happen until two or three hours. I had decided to play with a disadvantage (the disadvantage being that I was 1v6, on the map kings and queens where you have to fight four borders at once, and without building the arena, so without having the evade promotions on any soldier) and I actually lost. While my conditions put me at a severe disadvantage, it would have still been fairly trivial to win with those conditions against v18. I then tried the same conditions, but building the arena, and I'm still winning easy, but I can see the difference. While this AI still has no chances to challenge anyone who played the tournament in 1v1, it can offer a passable match for a casual player. In one versus many, on a map with many fronts, it is a challenge to any but the best players.

A couple of suggestions that could improve it further:

since the ai now makes training before fully developping the economy, it does not have enough food to get a continuous flow into the training sites. and on a (relatively) small map, it never has. I saw a barbarian player who had many promoted soldiers, but not a single one of them had more than one promotion: they just didn't have enough ffood to get the second promotion before the soldier was kicked out.

The way to fix that is by micromanaging: stop the training sites until you accumulate some food, then open them for one single soldier. A human who knows what he's doing can make sure to always get level 10 soldiers with this strategy. I'm not sure youu would like the AI to adopt it too, because it is a rather advanced tactic, and casual players won't get it, and they would ot be able to face a level 10 soldier, leading to frustration. Maybe it could be implemented as a sort of hard mode. But in any case, it could be beneficial to tell an AI to accumulate a bit of resources in the training sites before opening them. not enough to have level 10 soldiers with a small economy, but enough that it will have the occasional level 4 or 5. an elite soldier that a casual gamer may have fun trying to take down.

Another thing is that the "aggressive" setting is based on power difference, but the power is considered for every single player, not for the team as a whole. Which in the one versus many scenario is a big problem for the AI. I had more power than anyone, so the AI never attacked me and I could easily build my strenght and take them down one at a time. Instead, if they had realized that as a team they had more power than me, and they had attacked all together at the beginning, they may have prevailed. Also, the fact that the AI does not attack a stronger player allows some abuse. I had found out that a single military building with one rookie soldier inside is enough to stop the AI on one front, while I can concentrate my troops on another player. so it could be added that the AI would attack with one single soldier every once in a while, and see the enemy soldiers coming out, and then make a decision whether to attack with more according to the soldiers it sees. Like a human would do.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-04-24, 21:40

I am glad to read this! :)

to your suggestions:

Training sites - I am not that good player so I am not aware of such details - in regards to training of soldiers, but some tweaks are possible. What AI knows:

- it can query how much of material is in input queues
- it can change capacity of trainingsites.
- it can start/stop them

So it can test if more than x pieces of inputs, set capacity to 1, if 0 pcs of input wares, set soldier capacity to 0. This could be plain and stupid policy. But trainingsites have more then 1 kind of inputs, and this should be somehow considered.

Also AI splits trainingsites into two types: basic and advanced. Should this policy be applied to both or only basic?

re: considering entire team's force - not done yet but will be added, no big problem. There is still another AI-related merge request waiting, so no new code before merging this.

When considering attack, AI does not check available enemy soldiers in nearby buidings, it calculates pure difference of own attack-able soldiers minus count of soldiers in target enemy building. Of course it can still cheat and flatly count soldiers in nearby buildings without invoking an attack. But it is not doing this.

So if it does not attack a building with 1 soldier and there are obviously enough available soldiers, very probably the reason was that enemy was just stronger beyond the limit.


Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-04-25, 11:34

i don't know what it counts as basic and what as advanced, but a goood way to deal with it would be to stop the building once a soldier goes out and reactivate it only if there are at least 3 units of bread and 3 fish/meat. and maybe two beers for barbarian arena. in order to produce the best soldiers from the start, instead, it should be programmmed to stop the building until there are 10 bread and 6 fish/meat and at least one weapon and armor per type in the training camp. 3 bread 3 meat/fish and eventuallly 2 beers is still good for the arena. it would be better to have 10 fish/meat too in training sites, but empire and barbarians cannot produce fish, and atlanteans cannot produce meat, so that may noot be possible. atlanteasn are a bit different. you need 4/4 in dungeon and 8/6 in labyrinth


Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-04-25, 15:03

the full strategy for getting a level 10 soldier with a small economy and fairly early in the game is detailed in section 5 here,

http://student.agh.edu.pl/~rak/widelands/files/StrategyByEinstein/StrategyForWidelands0.05.pdf

although I'm not sure you want to impleent it on the AI. Nor I am sure it would be a good idea to have the AI play llike that against a casual gamer


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-04-25, 20:49

Guys, I will look at it when I have more spare time, but I think I will be able to come up with something.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-04-27, 21:15

OK, after some examination of conf files I would propose following model:

a site starts with 0 soldiers capacity, if following conditions are met:

- count of any food is 6 at least
- with exemption of meat and fish that are counted together and must give 6 together
- count of any other items (not food) is 1

then capacity is changed to 1.

When a soldier is sent away, the capacity it set to 0. This would need to add a notification (to code it), but should be doable.

And back to beginning

So what do you think? :)

Edited: 2015-04-27, 21:19

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-04-28, 01:18

From my point of view- it is good.

The code can be simillar to shipyard face-smile.png and you explained almost the same statement as there face-smile.png


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote