Druchii.net http://www.druchii.net/phpBB3/ 

GAPI  using AI to execute pileins http://www.druchii.net/phpBB3/viewtopic.php?f=165&t=77680 
Page 1 of 1 
Author:  Daeron [ Thu Mar 02, 2017 12:15 pm ] 
Post subject:  GAPI  using AI to execute pileins 
Greetings, Just introducing a new project, Genetic Algorithms for PileIns, which is going live in a few days. I sometimes see discussions on the value of formations, or quantifying the value of range on melee weapons (or bonus distance on pileins), but we never have a good way to examine this. This is a project to create a decent AI over time that can handle pileins pretty well, and can then serve as a testing platform for formations and pilein strategies. Although I wouldn't exactly call it empirical research, it does give us a "neutral" opponent that will try to counter what we throw at it. It could prove to be a stepping stone in examining the value of combat range, formations and even terrain elements. Anyway, here's a video with the introduction: 
Author:  Daeron [ Mon Mar 06, 2017 1:25 pm ] 
Post subject:  Re: GAPI  using AI to execute pileins 
A slightly longer introduction. GAPI stands for Genetic Algorithm for PileIns. Genetic Algorithms are a form of machine learning (or artificial intellgence). They are particularly suited to find solution where a more intuitive solution to a problem is required. Pileins are a key element to Age of Sigmar, where a lot of variables meet. The formation of a unit, the clever use of a piece of terrain, the combat range of melee weapons and potential bonuses to pilein moves all come together at this point, and they can influence the combat performance of a unit greatly. But because of the fluid nature of pileins it is difficult to calculate exactly how good or how bad a situation is exploited by a player. Then, there is also the opponent's ability to counter the plan. If we can not exactly calculate the effectiveness of formations, combat range and terrain, then there seem to be two alternatives:
GAPI will be designed to automate pileins, for any situation we throw at it. We start with a proof of concept, and aim to gradually improve the A.I.'s:
A tool will be published where GAPI can be displayed and seen in action. 
Author:  Daeron [ Wed Mar 08, 2017 9:02 am ] 
Post subject:  Re: GAPI  using AI to execute pileins 
G.A.P.I.1 GAPI1 is the first algorithm for computing pileins. It serves primarily as a proof of concept, that using a genetic algorithms works to discover pilein strategies. GAPI1 kicks off the project to develop a more sophisticated and robust A.I. that can handle more complex pileins, and adheres to the game's rules and physical nature more closely. The algorithm of GAPI1 Like any genetic algorithm, GAPI tries a number (population size) of random solutions. These solutions are evaluated, and the best are selected for reproduction, recombining their properties. Over the span of a few generations, the best combination of properties is pushed forward. So how does that translate to pile ins in GAPI1?
Indepth look in GAPI1's elements The Chromosome, is the pilein strategy. A gene is a single pilein move. A randomly generated gene is a random move of a single model in any direction and distance up to 3". The genes are strictly ordered, with the position of the gene denoting which model is moved by the pilein as well as the order in which the model is moved. Therefore, models are always being piledin from left to right. A mutation replaces one gene with an entirely new one. So, one move in the entire pilein strategy is changed by a random move. A mutation does not retain any information from its source, other than the starting position of the model. The fitness function is rather crude, but seems to work:
The Elimination rate is the amount of bad solutions being removed, which is the set to be the same as the crossover rate. The remaining population (100%  crossover rate) are the only eligible candidates for offspring. As a result, we can not support 100% crossover rates as this would delete the entire population. The Crossover rate is the percentage of the new generation that will be created through recombination (offspring). This is implemented as a fixed size with respect to the population, not as a chance for offspring to be a recombination. Uniform parent selection gives all survivors of the elimination an equal chance to produce offspring. Their fitness is no longer taken into account. Furthermore all parents are cloned. This is a logical consequence of how crossover works in GAPI1. A crossover rate of 70% kills 70% of the population. For the new generation 70% are children from recombined parents. This leaves a 30% to be filled by clones, which is the exact amount of parents left. Tweaking the parameters Population size determines how many pilein strategies are tested in each generation. A larger population permits more exploration per generation, and thus increasing the chance of finding a solution. But it also requires more calculations per generation, where a smaller population might try several generations with the same effort. Crossover rate determines how many of the new generation are offspring by combining 2 results. Currently, this also indicates how many of the worst results are removed to make room for this offspring. The bigger this number, the stronger the selection. This will increase the focus to a single solution, but also kill off looking for creative answers. Mutation rate increases the chance for a single pilein move to be replaced by a new one. This permits the algorithm to get unstuck, for example when it has 2 models blocking a third. A very high rate can make the program unfocused and jumpy. On the other hand, a low rate will limit the AI's ability to look at juggling about a few models. What works What seems to work is a high population (200+), high crossover rate (80%) and high mutation rate (20%). Arguably, the search space for bad pilein strategies is so big that it a strong selection quickly narrows down the search to a reasonably good combination of individual moves. However, this also makes the algorithm "stuck" when 2 models block a third. And so a high mutation rate is required to move models about a bit. 
Author:  Calisson [ Wed Mar 08, 2017 3:35 pm ] 
Post subject:  Re: GAPI  using AI to execute pileins 
Fascinating... 
Page 1 of 1  All times are UTC 
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ 