Topic: News about AI
Tibor Topic Opener |
Posted at: 2017-07-18, 08:09
I finally started the training again, I did a change in fitness function, obviously it was too much focused to expansion, so now military strength has much bigger weight. I will see how it will evolve... Top Quote |
soulless |
Posted at: 2017-07-18, 11:06
At the moment the ai only had a building economy. Basic_amount is only for buildings needed to get a building economy. Except barbarians where smelting works and metal workshop had a basic_amount. That's why the ai is able to expand fast and also, at least in my case, builds a lot of military building near the border. But ai also needs a military economy to build new soldiers and a food economy to make thoses soldiers stronger and get the mines working. Because in all those military buildings there is only one or two soldiers and a lot of them were empty. And that are no corner cases like "on map x on position y the ai had problems with terrain or lack of resources". tinker describes the same on the map far north and far north and islands at war are easy maps with a lot of building spots and all needed resources available. But ok, if you think there is only training needed please post a explanation how one can help if you finished writing and reading the mentioned files. I am willing to help because I like to play widelands from time to time ... and the stronger the ai the more fun Top Quote |
Tibor Topic Opener |
Posted at: 2017-07-18, 11:59
To list buildings that are involved in "military economy" is not of big use. Even if we hardcoded it, still 95% of work would be algorithm about placing, time, order and so. Basically what AI is doing now (poorly of course). So I still believe that we should let AI to figure it out. At least right now I am not willing to spend many hours coding before I am sure that it cannot be fixed with training. And this I will know only if training will not bring expected results. Current AI was teached to expand at all costs, and it worked well as it played against similarly weak players. Now I want to focus more on training of soldiers and strength of player. I was thinking how can one help with training, but I am skeptic here. First, in current (poor) state it would be waste of human power. But even later, one should need to play like 200-500 games per week, and after every like 10-20 games, he would do some review and AI DNA files shuffling. And at the same time, nobody other would be able to train the AI. Or if few peoples train the ai concurently, they would need to exchange AI files real-time (few times per day) - that is hard to imagine. Biggest bottleneck is a machine where training would run 24/7. If we had one... with four cores so 4 games could run concurrently, as they run here on my PC... Training takes time, I will do it in ai_dna_dump branch so after few days volunters could test it to say if they see a difference... Top Quote |
soulless |
Posted at: 2017-07-18, 12:50
Ok, that is understandable.
But if I understand https://wl.widelands.org/forum/topic/2646/?page=24#post-20844 correctly there are 4 base-dna-files? So at least 4 players can test and give new and hopefully better dna-files, or am I wrong?
Ok, I have a server which runs 24/7 for mail and nextcloud, with a Core i7-4770 and 4 cores and 8 threads and 32 GB RAM but of course with no graphic. There is not much load. At the moment there is running boinc with 2 threads. I will try to get widelands running there in headless mode inside a lxc-container. The container can than have 16GB RAM and 4 threads without problems for the other stuff running there. If this succeeds you can either explain to me how to run the games and what output / saved files you need or perhaps it is also possible to add a widelands-user and give you ssh-access. I will try the next time and give feedback.
Top Quote |
Tibor Topic Opener |
Posted at: 2017-07-18, 13:21
Well 4 players can concurrently train AI the way that after 10-20 games (if 1:1 games), each of them pick (generated) ai file of best performer, and all exchange these files and put them into corresponding "slots". This might mean daily exchange of files. Or more... Quite complicated.... But the other possibility looks much better. I was trying to run widelands in headless mode, but failed due to missing 3D acceleration or whatever. Of course I would help you set up the environment there. I have one python script that "orchestrates" the games and takes care of AI files promotion... Top Quote |
hessenfarmer |
Posted at: 2017-07-18, 19:53
I'm not quite sure if training would help to care all of the problems. As I said my obeservatins were made with the trunk branch at 8402 (which incorporates ai after b 19 branch) As far as I understand the code a ware that is missing over longtime (beer) and keeps mines from working should have gotten a high preciousness regardless the initial weighing factors. This should result in getting the first brewery at some time in the game. the problem might have been that ai saw the enemy almost he the same time than it could build mines to use up the remaining beer. If I understood some of the comments in the code correctly (as I'm not a coder and C++ is not that much readable to me ) this eventually switched the ai into another mode where it remains without evaluating the beer shartage anymore. Top Quote |
Tibor Topic Opener |
Posted at: 2017-07-18, 20:37
I dont think that AI stops considering normal productionsites when enemy is seen, but this fact is of course considered. But we can talk about specific place in code if you wish. But this all is very complicated and hidden beyond genetic algorithm stuff
No, all outputs are checked and "max_needed_preciousness" is calculated from preciousness of products that are needed. If this "max_needed_preciousness" is positive, the building is considered for further evaluation and scoring. Here is where "basic_buildings" come - it forces their building even if the outputs are not needed. Top Quote |
hessenfarmer |
Posted at: 2017-07-19, 06:57
ok I did another game on comet islands with me (frisians) on blue and red and yelllow beeing empire (still on trunk version 8402 where the dna was not in files but rather somewhere else). Here are my observations from watching the replay:
My conclusion so far is that the code works fine for every building that is forced somehow by the code. but it refuses to build any other building that should be chosen based on preciousness. I just can't imagine that this should be due to wrong dna which I consider a weighing factor delaying or speeding up some types of buildings but not to prevent all buildings with no exception. What I am not sure is if it could work in my revision or if important parts are missing that are still in the dna branch. For now I need to consider the state of the ai in trunk not ready for release. Top Quote |
Tibor Topic Opener |
Posted at: 2017-07-19, 08:00
You are right, this what we have been discussing last few days here. Genetic algorithm is open-ended on both sides. If not properly trained, it can build zero or many production sites of the non-basic type. There was not enough review while in branch (and if they were they were quite positive), so it was merged to get attention and this is what happens now. I am heavily working on the issue now. But it takes time. You can test another map, but I dont see a reason why it should work differently... Top Quote |
Ex-Member |
Posted at: 2017-07-19, 10:27
I have also noticed this action in several games over the weekend, As soon as an enemy is seen they thow everything at them without a care. At some point they pause when they run out of soldiers/ If they have got as far as creating a barracks and are making axes they send new recruits to the front as they are created. I watched one do this for 8 hours, send one new recruit to the front where they attack 2 towers (fully manned), about 300 soldiers wasted. The problem of 20% health attackers is I think more of a general code problem than an AI one. Having killed an opponent an injured soldiers returns to his base to heal, as soon as any healing has occured he returns to the front line instead of the 100% fit soldiers in his building going out. It is similar when under attack, the wounded defender goes back in, a new attacked arrives at the door and the most injured soldier goes out to fight while a 100% fit one does nothing. Edited: 2017-07-19, 10:29
Top Quote |