Is this language generic/mighty enough to be used for a generic game AI?

134 Views Asked by At

I want to develop a genetic program that can solve generic problems like surviving in a computer game. Since this is for fun/education I do not want to use existing libraries.

I came up with the following idea:

The input is an array of N integers. The genetic program consists of up to N ASTs, each of which takes input from some of the array elements and writes its output to a single specific array element.

The ASTs can be arbitrary complex and consist only of four arithmetic operators (+,-,*,/) and can operate on constants and fixed elements of the given array (no random access).

So for [N=3], we have 3 ASTs, for example:

a[0] = {a[0] + 1}
a[1] = {a[0] + a[1]}
a[2] = {a[0] * 123 + a[1]}

The N ASTs are executed one after another and this is repeated infinitely.

Now my question, is this system "mighty" enough (turing complete?) or will it fail to solve some kinds of problems common for an game AI?

3

There are 3 best solutions below

7
Michal Bida On

From my perpective the Turing completness of the system is not the main problem here. When using a genetic algorithm to evolve some kind of a strategy applied to some game environment one of the features of the algorithm - that would be helpful - is - I believe - that the small change in the "genome" of the solution lead to a reasonably small change in the behavior. If this is not true then every mutation or cross over can produce an entity that behaves completely different and in this kind of landscape it can be problematic for the genetic algorithm to arrive to some optima - as the landscape of the fitness function is not continuous enough.

Having said that it makes sense to me to try to somehow encode a form of decision tree in the genome and evolve that. However - from my experience - the genetic algorithms in AI for games works best when used to "compute" the optimal values of some parameters of some particular behavior then to "evolve" the behavior itself.

1
Manuel Rodriguez On

The abstract syntax tree (AST) is equal to a program flow which is formulated in a domain specific language. If the language consists of possible commands: up, left, down, right a possible AST would be: up, up, up, left. What genetic programming is trying to do is to evolve the AST, that means to figure out many different program flows for solving a game. Instead of only evolving the AST the much better idea is to evolve the grammar. That means, to modify the domain specific language in which the AST is formulated. For example, by adding an additional command like “gocenter”. The new language contains now of 5 possible actions: gocenter, up, left, down, right and it is possible to test out new kind of populations. To systematically evolve a grammar it is needed to learn the grammar by interaction. That means, we are starting with an empty grammar and add carefully new possible action commands. In the literature this is described as “grammar induction” and means to take an input stream from human interaction and generate the new language from scratch. With this grammar it is possible to evolve possible ASTs.

quote: “Grammatical Evolution (GE) is a grammar-based form of Genetic programming that specifies the syntax of possible solutions through a context-free grammar” source: Perez, Diego, et al. "Evolving behaviour trees for the mario ai competition using grammatical evolution." European Conference on the Applications of Evolutionary Computation. Springer, Berlin, Heidelberg, 2011.

0
Mason On

When creating Generative Artificial Intelligence the more content you can give it remember the more generative outcomes it can create and when creating a kid game make sure to have all content that will be intriguing to a kid while they play there game.