Publication:
Animaciones físicas mediante aprendizaje por refuerzo

Research Projects
Organizational Units
Journal Issue
Abstract
En la mayoría de videojuegos, las animaciones de los personajes están predefinidas, los artistas las crean durante el proceso de producción y así se quedan, cómo una serie de movimientos inmutables que se realizan al margen de la física del mundo en el que se encuentran. Las animaciones basadas en físicas vienen a solucionar este problema. Son igualmente creadas por artistas, pero dentro del juego las ejecutan personajes cuyos cuerpos están simulados mediante físicas realistas. Es decir, se simula cada parte del cuerpo cómo un objeto físico diferente, y se conectan entre ellas mediante articulaciones capaces de aplicar fuerzas, imitando el comportamiento de un cuerpo real. Aplicando las fuerzas adecuadas se puede hacer que estos personajes ejecuten las animaciones previamente creadas por los artistas. Esto consigue personajes que, no sólo pueden ver sus animaciones modificadas de manera natural ante perturbaciones externas, sino que también pueden interactuar con su entorno de forma realista. El movimiento natural que se consigue con esta técnica produce en el jugador una sensación de realismo e inmersión que sería imposible con animaciones tradicionales. Sin embargo, simular un personaje de esta forma presenta dos grandes problemas: el equilibrio y la estabilidad. Si simplemente se reprodujesen estas animaciones tal cual fueron creadas, el personaje no se mantendría de pie y perdería su trayectoria ante la más mínima perturbación. Esto se puede solucionar aplicando fuerzas artificiales que aseguren una postura concreta, pero así se pierde gran parte del realismo propio de esta técnica de animación. Una solución mejor es utilizar aprendizaje automático para que el personaje aprenda a estabilizarse aplicando fuerzas en sus articulaciones, intentando que al hacerlo su postura se parezca lo máximo posible a la de la animación. Esto es aún una frontera del desarrollo de videojuegos. En este trabajo exploramos el uso de aprendizaje por refuerzo para resolver la tarea del equilibrio en animaciones físicas. Para ello utilizamos Unity, uno de los motores de videojuegos más extendidos en la industria, con lo cual buscamos también comprobar cómo de accesibles son estas técnicas a día de hoy para los estudios de desarrollo.
In most videogames, character animations are predefined, artists make them during the production process and so they stay, as an immutable series of movements that are played apart from the physics of the world they’re in. Physics-based animations try to solve that problem. They’re made by artists alike, but inside the game they’re played by characters whose bodies are being simulated with realistic physics. Namely, each part of the body is simulated as a different physical object, and then they’re connected by joints that can apply forces, mimicking the behavior of a real body. Applying the right forces one can make those characters play the animations previously made by the artists. And so you can achieve characters that not only can their animations be modified by external perturbations, but they can also interact with their environment in a more realistic manner. The movement attained with this technique provokes a sensation of realism and immersion in the player that would be impossible with traditional animation techniques. Nevertheless, physically simulating a character this way presents two big problems: balance and stability. If animations were just played as they were made, the character wouldn’t be able to stand or it would lose its trajectory when facing even the smallest perturbation. This can be fixed by applying artificial forces that ensure a specific pose, but at the cost of losing much of this technique’s realism. A better solution is to use machine learning so the character can learn to balance applying forces at its joints, trying to reach a pose as close as possible to the animation. This is still a frontier in game development. In this project, we explore the use of reinforcement learning to solve the task of balance in physics-based animations. For that we use Unity, one of the most renowned videogame engines, with which we also aim to test the accessibility of these techniques to game studios as of today.
Description
Trabajo de Fin de Grado en Desarrollo de Videojuegos, Facultad de Informática UCM, Departamento de Ingeniería del Software e Inteligencia Artificial, Curso 2020/2021, tanto el código fuente como todos los recursos que se han utilizado pueden encontrarse en el siguiente repositorio github.com/sergioabreu-g/physical-animations bajo la licencia de uso Apache 2.0.
Unesco subjects
Keywords
Citation