Abstract
Optimising game-playing agents is a complex task due to the stochastic nature of games and the high computational cost of evaluations. This paper introduces the N-Tuple Bandit Evolutionary Algorithm (NTBEA), a framework designed to navigate these "noisy" and "expensive" fitness landscapes. By combining N-tuple fitness modeling with Multi-Armed Bandit logic, NTBEA efficiently balances exploration and exploitation, significantly outperforming traditional grid search and standard evolutionary methods in game agent hyper-parameter tuning.
Introduction
Tuning the hyper-parameters of a game agent—such as the planning horizon or mutation rate—presents two primary challenges. First, noise: games are often stochastic, meaning an agent's performance can vary significantly between matches even with identical settings. Second, expense: obtaining a reliable fitness score requires running full game simulations, which is time-consuming. Traditional methods like Grid Search are often too slow and fail to account for noise, while standard Estimation of Distribution Algorithms (EDAs) frequently struggle to balance exploration and exploitation in discrete, combinatorial search spaces.
Methods
NTBEA operates at the intersection of three distinct fields to overcome these hurdles:
- N-Tuple Systems: Borrowed from pattern recognition, these model high-dimensional spaces by tracking statistics for lower-dimensional "projections" (tuples). For instance, instead of only modeling a 5-parameter combination as a single unit, the system tracks statistics for individual parameters (1-tuples) and pairs (2-tuples), allowing the model to generalize from sparse data.
- Multi-Armed Bandits (UCB1): The algorithm employs the Upper Confidence Bound (UCB1) formula to evaluate candidate points. This approach considers both average fitness (exploitation) and an exploration term based on visit counts. If a region remains unexplored, its UCB value increases, prompting the algorithm to sample it.
- Evolutionary Search: To avoid the need to evaluate every possible combination, NTBEA uses an evolutionary strategy. It maintains a current best point and generates neighbors via mutation. The N-tuple model then "imagines" the UCB values of these neighbors, selecting the most promising one for actual evaluation in the game environment.
Experimental Setup
The algorithm was benchmarked by tuning a Rolling Horizon Evolutionary Algorithm (RHEA) agent on two distinct games:
- Asteroids: A Java implementation of the classic arcade game where fitness is determined by the game score.
- Planet Wars: A real-time strategy game where fitness is a win/loss/draw value (+1, -1, or 0). This creates an extremely noisy landscape where small changes in parameters can lead to drastically different outcomes.
The search spaces for these benchmarks ranged from 240 to 336 possible parameter combinations, providing a manageable yet significant test for sampling efficiency.
Key Insights
A core strength of NTBEA is its use of overlapping models. By updating statistics for all constituent tuples of an evaluated parameter set, the algorithm "borrows" information across the search space. Furthermore, the explicit exploration pressure provided by the UCB1 logic prevents the algorithm from being misled by lucky random seeds early in the search process. Finally, the N-tuple models function as efficient look-up tables, ensuring that the optimizer's overhead is negligible compared to the game simulation time.
Results
NTBEA was compared against Grid Search and SWcGA (a sliding-window genetic algorithm). In both benchmarks, NTBEA demonstrated superior performance and sample efficiency.
In Asteroids, NTBEA achieved an average score of 8,756, outperforming Grid Search (7,716). The results in Planet Wars were even more pronounced; NTBEA achieved a positive win-rate-equivalent score of 0.54, while Grid Search failed to find an agent better than the fixed opponent, resulting in a negative score of -0.53.
Conclusion and Future Work
NTBEA proves to be a highly effective tool for tuning game agents in noisy, discrete environments. However, limitations remain, particularly regarding the combinatorial explosion of tuples as the number of parameters increases. Future research will focus on scaling the algorithm to massive hyper-parameter spaces and developing methods to automatically select the most relevant tuple structures based on parameter dependencies.
Summary updated