Presentation of the work "Evolutionary FSM-Based Agents for Playing Super Mario Game" at LION 2013 (LION 7).
by Rosa Hidalgo, María Sandra Rodríguez, Antonio M. Mora,
Pablo García, Juan Julián Merelo y Antonio J. Fernández
Conference
http://www.intelligent-optimization.org/LION7/
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
FSM-Based Agents for Playing Super Mario Game
1. Evolutionary FSM-Based
Agents for Playing
Super Mario Game
LION 2013
R.M. Hidalgo-Bermúdez, M.S. Rodríguez-Domingo, A.M. Mora
P. García-Sánchez, J.J. Merelo, Antonio J. Fernández-Leiva
2. INDEX
1. INTRODUCTION
2. PRELIMINARY CONCEPTS AND BACKGROUND
3. MARIO AI: COMPETITION AND ENVIRONMENT
4. EVOLUTIONARY FSM-BASED AGENT
5. EXPERIMENTS AND RESULTS
6. CONCLUSIONS AND FUTURE WORK
3. INTRODUCTION
Why did we choose Mario Bros?
This game is worldwide known and remains very
popular nowadays.
There is an open source clone of the game named
Infinite Mario Bros.
4. INTRODUCTION
The main goal of the game is to go across lateral
platforming levels, trying to avoid different
enemies and obstacles by using some useful
items.
We have developed an autonomous agent using
different approaches based on Finite State
Machines (FSMs) combined with Genetic
Algorithms (GAs) techniques.
5. PRELIMINARY CONCEPTS AND
BACKGROUND
GAs are based on the model of darwinistic evolution. A
standard GA’s procedure is:
6. PRELIMINARY CONCEPTS AND
BACKGROUND
A Finite State Machine (FSM) is a computational model which
represents a set of states and connections between them.
It is represented as a directed graph, where each node
corresponds to a state.
7. MARIO AI: COMPETITION AND
ENVIRONMENT
Infinite Mario Bros is an open source modification of
Super Mario Bros. It includes wide support for
implementing autonomous agents to control Mario
character using AI techniques.
The Agent follows the rules of Mario AI
Championship. The tracks are:
Gameplay Turing Test
Learning Level Generation
8. MARIO AI: COMPETITION AND
ENVIRONMENT
The possible actions of the Agent are:
Go Right Go Left
Jump Down
Shoot/Run
Mario can be in three different modes:
Fire Big Small
9. MARIO AI: COMPETITION AND
ENVIRONMENT
Game data is presented in the form of two 19x19
matrices. Each cell of each matrix holds a value,
which represents a type of obstacle or enemy ,
respectively
14. EVOLUTIONARY FSM-BASED AGENT
Two approaches:
Mono-seed
All the individuals are tested in the same level
The length of the level and the time limit to complete it grow with
each generation
Multi-seed
Every individual is tested in 30 random levels
The fitness is computed considering the results of all the plays
15. EVOLUTIONARY FSM-BASED AGENT
There are two types of fitness:
Generic fitness
Hierarchical fitness
The selection mechanism considers the best individual and a
percentage of the best ones, selected by tournament according to
their fitness.
Crossover is performed considering the best individual of the
present generation as one of the parents, and one of the
individuals with positive fitness as the other parent.
In the mutation operator, various genes in each of these
individuals are randomly selected to be mutated
22. CONCLUSIONS AND FUTURE WORK
An agent has been implemented using Finite State Machine (FSM)
models, improved by means of Genetic Algorithms (GA) and
considering different evaluation schemes: mono-seed and a multi-
seed evaluation approaches.
Mono-seed can yield excellent agents for the level where they were
‘trained’ (evolved), having a quite bad behaviour in a different level.
Multi-seed takes much more computational time and has higher
resource requirements, but the agents it yields are very good
playing in any level of the considered difficulty (in the evolution).
All these agents play much better than an expert human player and
can complete the levels in a time impossible to get for the human.
Esto se puede eliminar si lo consideras sabido por la audiencia
Esto se puede eliminar si lo consideras sabido por la audiencia
Decir que nos centramos en el track Gameplay. Buscamos hacer un agente para superar ese reto (según sus normas)
Las matrices son muy importantes para saber cómo actuar en cada instante (tick)
Supongo lo que son todos esos items. :D
Se codifican los posibles estados, incluyendo el 8 (no hacer nada) y el 11 (saltar y agacharse al mismo tiempo). Este último no está implementado en el simulador de Infinite Mario Bros, pero sí en los juegos de Mario.
Si no te queda claro, mírate esto en el artículo original (el de las 17 páginas).
Mono-seed se ejecuta siempre en la misma pantalla (con el mismo nivel de dificultad), y se va incrementando la longitud de la misma con las generaciones. Con el multi-seed se busca evitar el ‘ruido’ típico de la evaluación de individuos en juegos. Es decir, que un mismo individuo sea valorado como muy bueno en una partida y como muy malo en otra, dependiendo de factores pseudoaleatorios (comportamientos de enemigos, sucesos en la partida, etc).
Mírate los detalles de cada operador en el artículo. ;)
Parámetros de ejecución del algoritmo en mono-semilla. Obtenidos por experimentación sistemática.
Se ve el gran tamaño de población requerido para evolucionar un agente bueno.
El tiempo de ejecución es alto y los requisitos de memoria son un problema que hace que muchas veces ‘pete’ el programa (el algoritmo).
Se ve una tendencia positiva (el fitness mejora paulatinamente), aunque no es tan drástica como nos gustaría y hay oscilaciones debidas al ‘ruido’ al evaluar a los individuos.
Parámetros de multi-seed. Los resultados son similares y los problemas que ocurren (memoria y tiempo) se acrecentan al realizar muchas más evaluaciones y variaciones por individuo.
Mejor si bajas estos ejemplos a tu disco duro por si no hay conexión. Puedes usar el programa “aTube Catcher”, por ejemplo. El del nivel 12 petó, como en todos los casos, pero hasta ese momento su comportamiento era muy bueno.
Los agentes obtenidos se pudieron evolucionar hasta superar el nivel de dificultad 4, más allá ocurrían errores de memoria (más a medida que incrementaba el nivel de dificultad). Aún así, ese nivel es más que suficiente para lo requerido en el GamePlay track.
Las conclusiones, después de realizar este trabajo, son las siguientes: