Learning Dark Souls Combat Through Pixel Input With Neuroevolution

Jim O’Connor, Gary B. Parker, Mustafa Bugti · 2025

Read Learning Dark Souls Combat Through Pixel Input With Neuroevolution by Jim O’Connor, Gary B. Parker, Mustafa Bugti (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-03793.txt.

Introduction

Teaching a computer to fight in Dark Souls, a punishing action game, usually means feeding it the game's hidden state. Jim O'Connor and co-authors instead evolve neural networks that see only pixels. Their method grows network shapes and weights together, a technique called neuroevolution of augmenting topologies. A custom tool reads the screen in real time to extract health bars for the player and the enemy.

Evolved agents learned to beat the game's first boss, the Asylum Demon, in up to 35 percent of attempts. No hand-written tactics were supplied. The team presents the result as evidence that vision-only evolution can handle visually complex play.

Catalog record

CREATORJim O’Connor, Gary B. Parker, Mustafa Bugti
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE18 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-03793

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Learning Dark Souls Combat Through Pixel Input With Neuroevolution Jim O’Connor, Gary B. Parker, Mustafa Bugti Abstract This paper investigates the application of Neuroevolution of Augmenting Topologies (NEAT) to automate gameplay in Dark Souls, a notoriously challenging action role-playing game characterized by complex combat mechanics, dynamic environments, and high-dimensional visual inputs. Unlike traditional reinforcement learning or game playing approaches, our method evolves neural networks directly from raw pixel data, circumventing the need for explicit game-state information. To facilitate this approach, we introduce the Dark Souls API (DSAPI), a novel Python framework leveraging real-time computer vision techniques for extracting critical game metrics, including player and enemy health states. Using NEAT, agents evolve effective combat strategies for defeating the Asylum Demon, the game’s initial boss, without predefined behaviors or domain-specific heuristics. Experimental results demonstrate that evolved agents achieve up to a 35% success rate, indicating the viability of neuroevolution in addressing complex, visually intricate gameplay scenarios. This work represents an interesting application of vision-based neuroevolution, highlighting its potential use in a wide range of challenging game environments lacking direct API support or well-defined state representations. I Introduction The development of artificial intelligence (AI) capable of playing video games at a human or superhuman level has long been an important benchmark in AI research [ 1 , 2 ] . From early rule-based systems to modern deep learning approaches, various techniques have been used to train autonomous agents capable of solving complex game environments. Among these, neuroevolution [ 3 ] is an approach that evolves artificial neural networks using evolutionary algorithms, making it a promising method, particularly in cases where reward structures are sparse or environmental dynamics are not easily modeled [ 4 ] . Traditional AI approaches to game playing have been successfully applied to well-defined rule-based environments such as chess [ 5 ] , Go [ 6 ] , and Atari games [ 7 ] , where state representations are either explicitly provided or easily inferred. However, more complex modern video games, particularly those lacking official APIs, present significant challenges for AI-driven gameplay [ 8 ] . These games require agents to interpret high-dimensional visual information, navigate complex and nonlinear world structures, and respond dynamically to unpredictable enemy behaviors. Traditional reinforcement learning methods like Deep Q-Learning (DQN) [ 9 ] often struggle when rewards are sparse or delayed, as is common in challenging 3D games like Dark Souls, due to difficulties in propagating meaningful error signals through large convolutional neural networks. In contrast, NEAT addresses these limitations by directly optimizing network structure and weights through evolutionary selection, thereby bypassing the credit assignment problem inherent in RL and potentially leading to more rapid adaptation to complex visual inputs. This capability makes NEAT particularly promising for games where direct reward signals are limited or non-existent. [ 10 , 11 ] . This paper investigates the application of Neuroevolution of Augmenting Topologies (NEAT) [ 12 ] to a notoriously difficult video game, Dark Souls [ 13 ] . Unlike many other games used in AI research, Dark Souls does not provide easily accessible state representations, requiring agents to learn directly from raw pixel data. Additionally, the difficulty of Dark Souls is a fundamental part of its design philosophy [ 14 ] , built upon the legacy of classic action RPGs and influenced by game mechanics that emphasize deliberate combat and meticulous level design. Overcoming these mechanics through the creation of AI agents presents a unique challenge for evaluating the capabilities of neuroevolutionary methods in high-dimensional, visually complex environments. The methodology presented in this work builds upon previous studies in evolutionary computation and neuroevolution. Early implementations of evolutionary algorithms in game-playing AI, such as Fogel’s work on evolving neural networks for board games [ 15 ] , demonstrated the potential of artificial evolution in decision-making tasks. More recent applications, including the HyperNEAT Atari General Game Player [ 16 ] , showcased the viability of neuroevolution for large-scale pixel-based game environments. However, much of this prior work has focused on relatively constrained two-dimensional games with well-defined objectives. By extending these principles to Dark Souls, we seek to further push the catalogue of games approached by neuroevolution techniques and concepts. In this paper, we detail the development of a NEAT-based agent trained exclusively through visual input to defeat the first boss of Dark Souls. The agent begins with no prior knowledge of the game world, learning through evolutionary selection based on in-game performance metrics. II Methodology Released in 2011 by FromSoftware, Dark Souls is a third-person action role-playing game renowned for its punishing difficulty, intricate level design, and deep combat mechanics [ 14 ] . It has achieved notable acclaim for its challenging gameplay, which requires players to develop precise timing, pattern recognition, and adaptive strategies to overcome formidable enemies and environmental hazards. To address these challenges, we developed the Dark Souls API (DSAPI) 1 1 1 Available at: https://github.com/ConnAALL/darksoulsapi , a Python-based interface designed to facilitate AI interaction with the game. DSAPI enables direct extraction of key game metrics from the user interface, such as player health, enemy health, and the in-game currency known as Souls. It also provides functionality for navigating menus and initializing the game at specific checkpoints, allowing for more efficient training and evaluation of AI agents. By leveraging computer vision techniques, DSAPI processes real-time screen capture to extract necessary gameplay data, eliminating the need for manual intervention or external game modifications. Through this framework, we aim to demonstrate the feasibility of applying neuroevolutionary methods, and more specifically NEAT, to Dark Souls, paving the way for further research into AI-driven gameplay in highly complex and visually intricate gaming environments. II-A Neuroevolution of Augmenting Topologies NEAT is an evolutionary algorithm designed to optimize artificial neural networks by evolving both their structure and weights. Unlike traditional fixed-topology neural networks, NEAT begins with minimal architectures and incrementally increases their complexity over generations. This is achieved through mutation operations that add new nodes and connections, allowing for adaptive growth in response to environmental challenges. Speciation ensures that effective structures are preserved by grouping similar networks together, and a crossover mechanism allows genetic material to be recombined, fostering diversity in the population. NEAT leverages historical markings to track genes through generations, ensuring effective crossover between compatible structures. It also dynamically adjusts mutation rates, allowing networks to evolve complexity in a controlled manner. This is particularly useful in environments where optimal network structure is not known ahead of time. In Dark Souls, where the agent must infer spatial relationships and control dynamics from raw pixel input, NEAT provides a powerful mechanism for discovering optimal actions through iterative refinement. Fig. 1: The processed image serves as input for the neural network. The downscaling of the screenshot greatly reduces input size while retaining enough important features to keep the game playable by a human player. This approach improves computational efficiency and allows even low-end computers to run and train in the game. To apply NEAT to Dark Souls, we designed a neural network with raw visual input processed through simple downscaling, as shown in Figure 1. The network outputs a discrete set of control actions, corresponding to movement, attacks, and defensive maneuvers. Fitness is evaluated based on damage dealt and damage

Read the complete text