Topic: News about AI
Nordfriese |
Posted at: 2017-08-06, 11:24
I´ll have plenty of time the next couple of weeks and as I offered some weeks ago, I can spend some of it training the AI. Just to make sure I understand it correctly – AI training works like this:
Or did I misunderstand something? You also mentioned an aitrainingmode which has to be switched on – how does that work? (The files in ~/.widelands/ai are not created for me at the moment. I think the creation of these files should be turned on/off by a command-line option which should be specified in the --help listing, defaulted to off. By the way, compiling the frisian branch which uses the trunk AI from bzr8410 works fine on my Linux computer.) Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-06, 12:42
Well such linkage is not needed. I usually run 4 games concurrently and winner of first map goes to first position and so on..
Training mode has 3 effects:
Sedond and third bullet are activated here: http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/src/ai/ai_help_structs.h#L122 and first bullet here: Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-06, 12:45
Note that when you play 100 games with 300 AI opponents in total, all of them will have unique DNA (try a diff on generated wai files). So somebody should take the best one and copy the generated file into one of 4 "source" wai files. No training is done automatically Top Quote |
Nordfriese |
Posted at: 2017-08-06, 19:45
I trained AI for one round now. The losing AIs were very weak, many got deadlocked (no logs/foresters, no granite/marblemines, no spiderfarm/spidercloth…). In two out of four games I considered the only AI that wasn´t deadlocked after some time the winner. In the other two games, one AI grew surprisingly strong and easily outproduced and defeated its enemies. These AIs are already much stronger than the AI of build19, and can even become a serious challenge for experienced players. Great work! An observation: Barbarians always without exception enhanced all their metal workshops very quickly, so they soon ran out of tools and never built a new metal workshop. Could this be an issue with general rules about enhancing and basic economy, not with training? What should I do now with the winning DNA files? Is there a branch to upload them to, or should I keep them on my local disk until I trained the AI many more times? Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-06, 20:50
Let me use the word ROUND. So you did one round of testing and have 4 winners. You copied them to 4 source files to be used for next round, correct? Now you will pick different map and do another round of testing/training and promote 4 winners to source files. And you repeat such rounds basically forever - with different maps... When doing automated training, I (script in fact) pick 4 winners from 60 players. 60 players for manual training is too much probably, but dont go very deep below this number, though there is no exact minimal limit... As for enhancement, this is probably hardcoded, but I would need to investigate. This can be one of points for next AI branch. As for results of your training, it is too soon create new branch and merge to trunk, but it is trivial to share your AI files if anybody is interested. Also there is something like mutation rate - I plan to decrease it bit before release.... EDIT: I am off for next week, so I hope everything is clear enough.. Edited: 2017-08-06, 22:54
Top Quote |
kaputtnik |
Posted at: 2017-08-07, 06:55
So 'AI Learning' is done automatically, but getting the stuff the AI has learned into the game is done by a human (one has to copy the files from his home folder into the data folder). I think the files should then be created only in aitrainingmode with a commandline switch. Otherwise the folder .widelands/ai/ get spammed with files which are useless for a 'normal' player. Maybe adding a text file in there, describing what this folder is used for. Something like: "This folder is used when using the command line switch 'aitrainingmode'. If you are interested in training the ai, see the wiki page at https://wl.widelands.org/wiki/Ai Traininghttps://wl.widelands.org/wiki/ai training" Fight simulator for Widelands: |
GunChleoc |
Posted at: 2017-08-08, 11:00
Yes, we definitely want a command line option for this and have plans to implement one in another follow-up branch. Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-12, 17:00
Almost 100% exact. You are right about copying the files... But frankly 'learning' is not the best word. New AI is generated on initialization and save to the file. The file is not updated afterwards so technically no learning is taking place. We just pick one of multiple unique DNAs that seems to perform the best. Top Quote |
Tibor Topic Opener |
Posted at: 2017-08-12, 17:03
@Nordfriese I am back now and I can resume the training. I need your files to continue from them. Did you have time for more than one round? Top Quote |
Nordfriese |
Posted at: 2017-08-12, 17:22
I had one round every day since I started sometimes two rounds a day In every round, I watched 10-20 games with 6-16 players each until I had selected 4 outstanding AIs. Every round had maps in the categories quick fights, seafaring, long games and difficult terrain (so AI can be flexible). In every round, every winning AI was noticeably better than the winners of the previous round. Top Quote |