Topic: Improving the AI
hessenfarmer |
Posted at: 2020-02-16, 13:07
As said it would work the other way round as well just choose village for yourself and trading outpot for AI. this should give you a challenge. Top Quote |
king_of_nowhere |
Posted at: 2020-02-16, 13:26
I think we should have different AI for different tribes, and at least a couple different setting for each tribe for small and big maps (ideally, every map should be tagged for the AI; those who are not, the AI uses the generic algorithm). the reason is that optimal strategies change completely. In a large map you want to build 10+ woodcutters and foresters to expand quickly. in a small map you build 5-6 of them because you'd run out of space otherwise. in a large map you postpone the production of military buildings for when you have a strong economy. in a small map you build them first to have a few soldiers with some promotion, otherwise you will be smashed by early game attacks. also economy target change; in a large map you want a large stock to absorb fluctuations in the demand while wares need a long time traveling through the economy; in a small map you want a minimal stock to avoid wasting resources. differences between tribes are even greater. with barbarians you must make early mines and weapon smith to give your soldiers some attack promotions; you cannot give evade promotions early, because the brewer needs training time. with empire and atlanteans you want instead to train in evade first. with amazons you need to prioritize attack again. with atlanteans you're not going to make any mine in the first 40 minutes (at least) because they are very expensive. and you may skip stone mines entirely. with empire making a stone mine is a top priority. with atlanteans you have few logs and many planks, so you want to build many woodcutters first and wait to make a sawmill, do it too early and it will suck precious logs to give planks that you already have aplenty; with barbarians it is the opposite, fail to make one early and you'll run out of hardwood. and the genetic algorithm is tested with different tribes on different maps; it can never improve this way, because there is no way to make one single algorithm for all situations. it would be like trying to "optimize" the fit of a piece of clothing while trying to fit it alternatively to people of different sizes and genders. a generic ai should stay there for things like modding new tribes and maps, but nothing more. many players report that AI has gotten worse in the latest iteration; i think it should be acknowledged that the current attempt at optimizing the ai is not working. Top Quote |
hessenfarmer |
Posted at: 2020-02-16, 13:53
that would be possible if we would get to the point that we could train the AI per map per tribe. Problem is if we discover a real issue in the code like in recrent changes we need to retrain every permutation we already did. It is not undoable but we would need acces to a big cluster of computers, which is expensive if nobody has any connections in that area.
there is already a definition problem: what is a large map? this can't be determined from size. cause if you have only some small islands it is different again and it doesn't need to be water there are other unbuildable terrains as well. So really there can't be any general rule for anything like this. So we would again end with a per map per tribe AI. this could only be achieved if ever with a genetic algorithm trained for this but having the same code base. As developing code for every permutation would be more then overkill (btw defaultai.cc already has m ore then 7000 lines of code)
see above as long as I am not confident that the code base is mature enough (no fundamental shortfalls in the decisions to be made) I just would feel that any attempt to make these specific AI instances would be a waste of time.
Which iteration? Edited: 2020-02-16, 13:53
Top Quote |
king_of_nowhere |
Posted at: 2020-02-16, 16:53
that's why i suggested that any map has a tag for it. humans themselves can't figure out the big/small map distinction if they don't know the map in advance. and the generic, unmodified algorithm running if there is no tag on the map. now, to truly optimize one would have to prepare for each map specifically, as is done sometimes in tournaments by some players. but i'm not so crazy as to suggest running a different ai on any different map.
i see. it makes sense, and you certainly know the issue of ai development better than i do
Top Quote |
Nordfriese |
Posted at: 2020-02-16, 17:02
I haven't been following the discussion closely, but the AI has full access to the entire game state, including full knowledge of all terrains, heights, resources etc. So there is no need to use tags – it could be possible to define some "Map Types" (small, big, many_small_islands, …) which can be determined by the AI when the game starts using all the information there is (possibly weighted with genetic neurons to define whether a medium-sized map is considered big or small), and take the Map Type into account when making decisions. Top Quote |
the-x Topic Opener |
Posted at: 2020-02-16, 17:35
I dont know if it can be useful, but maybe we could make 2 different types of AI, economic and rush - they wont solve all the seafearing problems, but the problem with the size of the map. So every player can chose the tribe for the AI and the type of AI? And another question: the generic algorithm works if i have different versions of widelands, so i can spot the difference if i watch AI playing against themselves for many times? Edited: 2020-02-16, 17:37
Top Quote |
hessenfarmer |
Posted at: 2020-02-16, 17:55
my point is that we either have a map specific AI for a map or we have the algorithm we are trying to improve currently. There are so many different things to take into account for a good strategy that you can't implement them in the code. Basically we have a lot of if statements that are only vlaid in certain circumstances and these circumstances are mutually dependent on each other. So if we are happy with the content we could speak top train a per map per tribe AI. However until then and even then I don't see this happen due to the amount of computing power needed. Top Quote |
hessenfarmer |
Posted at: 2020-02-16, 17:58
you can already choose. however the choice is not very useful as normal Ai is still much to weak for an experienced player. Train 2 different types would be possible however someone with a lot of computing power has to do this.
you can always watch the AI. just setup a local Ip multiplayer with only AI slots you will be an observer then and watch. Top Quote |
Tibor |
Posted at: 2020-02-16, 18:05
As for small vs big maps - it is true that AI sees all map, but to interpret what it sees is close to impossible. AI does not have such capabilities. And it is not matter of training at all. It would be job for neural network, but we are far from this now. To train own branch of AI is possible (needs some work to set up), just remember that results are not mergeable back into AI in the main branch. Top Quote |
the-x Topic Opener |
Posted at: 2020-02-16, 18:08
+1 exactly that is it, maybe we need sth like a "hard ai" Top Quote |