Topic: News about AI
Nordfriese |
Posted at: 2017-05-31, 20:07
My list for Barbarians is: Wood hardener, Fernery, Lime kiln, Smelting works, 2×Metal workshop, Well, Tavern, Hunter, Gamekeeper, Barracks. Don´t forget that I added 1 Ranger and 1 Lumberjack to every tribe´s BE (including your presets). About finishing the enemy: When the victorious player was conquering his first victim, he built lots of towers at the frontier whenever he couldn´t see his next target. He built nothing near the frontier of the almost-defeated last player. Also, I noticed that AI sends all soldiers to the front where it is attacking at the moment – it is aware all the time of another enemy at its border somewhere else, but the buildings are guarded by only 1 soldier, leaving it vulnerable. Perhaps AI should be taught not to leave a quiet front line unprotected. If AI waits until a trainingsite is full, this means that effectively no training takes place, ever. At least in the games I watched. I´m glad I could help! When further testing is needed, just ask. Top Quote |
Tibor Topic Opener |
Posted at: 2017-05-31, 20:41
militarysites are build based on free teritory nearby, number of enemy militarysites nearby and resources like mountains nearby, also own nearby militarysites are considered - this is complicated and completely controlled by genetic algorithm. Also note that fitness function is mostly land size. So AI can just decide it is not worth to finish the enemy, but focuses elsewhere. It does not even understand the concept of "finish an enemy". If it was possible to get number of "wiped out enemies" from game's statistics I would include it into fitness function. But the game does not provide that. But I agree this is suboptimal. Or if there was info about "conquered land" - as a land that belonged to some other player before - this could go to fitness function as well... For each militarysite AI tests accesibility of enemy (I am not sure now whether land or must be militarysite), if not accessible it might be dismantled, or capacity set to 1. But there still can be an error in code... Anyway thanks for comments I will try to investigate and address them Top Quote |
Tibor Topic Opener |
Posted at: 2017-05-31, 20:53
I updated the barbarians init.lua files:
I hope this is correct. It will be pushed with next revision I also removed few forced_after, prohibited_till flags - though I am not sure if it was good move... Top Quote |
WorldSavior |
Posted at: 2017-05-31, 22:10
Why not? I think that being on the list with the number means for the buildings, that there will no be more buildings of this type than this number (before the basic economy is completed or cancelled). So if just one ranger is on the list, it should be a huge difference to "no ranger on the list".
Cool
Isn't this a huge bug?
But it should be an AI for autocrat, right? Collectors is sooo different... Especially if there is no way to attack...
Come on, the concept "basic economy" didn't work like it should ;-) But if you would like to test again with my lists, I would appreciate if you delete the mines... (bar: coal+iron, emp: marble, atl: none)
Are you sure? The current algorithm requires a lot of them to be optimal...
That is not the worst approximation to the perfect use of the trainings sites, but like I said, it requires a higher number of them to be as good as with perfect use... A special case is the imperial arena: This algorithm isn't really needed, and a maximum capacity of 1 is suboptimal. It should be a little bit higher.
Maybe the statistic "number of conquered military buildings" is not the worst approximation to this Wanted to save the world, then I got widetracked Top Quote |
Tibor Topic Opener |
Posted at: 2017-06-01, 06:56
Small huts especially the ones dependant on reasources in vicinity have different "code path" so the basic economy does not apply to them out-of-box. Consider rangers. The teritery can be full of trees or a desert without trees. Therefore this is bad idea to hardcode the number of rangers, even if for first 30 minutes. Similarly quarries. Lumberjacks as well. On the other side, ANY productionsite is scratched from the list when finished. So basic economy target works as bottom limit for these small huts. Do we have "number of conquered military buildings" available? Even better would be "number of destroyed sites". Top Quote |
GunChleoc |
Posted at: 2017-06-01, 17:27
We have something like that in the general statistics I think - I don't remember right now if it's for soldiers or buildings though. Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2017-06-01, 19:08
Indeed. But this still does not address the issue. If there is a player with 1 remaining militarysite - there is no incentive to attack just that one and not another one of another player. Top Quote |
Nordfriese |
Posted at: 2017-06-01, 19:31
Perhaps you could implement something like this: AI has an array of attack factors long attackFactor[nbEnemies]. Every time a militarysite belonging to enemy X is conquered/destroyed, attackFactor[X]+=increase. When AI decides which site to attack or whether to attack a building belonging to X, attackFactor[X] is taken into account. The more buildings have already been conquered from a player, the happier the AI is to attack him again and therefore to finish him. Genetic algorithm mutations could tweak the value increase to generate more or less offensive AIs. Top Quote |
Tibor Topic Opener |
Posted at: 2017-06-01, 19:41
In fact, the relative strength enemy/we is considered when attacking, but it seems to me that problem happens before - when new militarysites are built. If you have to build a militarysite in area with 1 enemy militarysites or 5 ones, AI will logically pick the second alternative... I created new data in AI - number of destroyed warehouses, and they are well scored (rewarded). I will see what it will do. Top Quote |
WorldSavior |
Posted at: 2017-06-01, 20:59
This might be very good. And maybe ports and HQs should also count as "warehouses"
Well, it's the best in statistics which I could find. "Wares" are also a good indicator for defeating - but the wares of the opponent. And this would be too complicated, I guess.
This are good news
That's what I mean with "the wood economy is too map-dependant" Wanted to save the world, then I got widetracked Top Quote |