[Paper Review] Using Fractal Neural Networks to Play SimCity 1 and Conway's Game of Life at Variable Scales
This paper introduces a reinforcement learning environment called gym-city, using Micropolis (an open-source SimCity 1 clone) to train agents that optimize urban population across variable map sizes. It proposes fractal neural networks with recursive, weight-shared architectures to enable scale-agnostic policy learning, demonstrating superior generalization in SimCity 1 and Conway’s Game of Life compared to standard convolutional baselines.
We introduce gym-city, a Reinforcement Learning environment that uses SimCity 1's game engine to simulate an urban environment, wherein agents might seek to optimize one or a combination of any number of city-wide metrics, on gameboards of various sizes. We focus on population, and analyze our agents' ability to generalize to larger map-sizes than those seen during training. The environment is interactive, allowing a human player to build alongside agents during training and inference, potentially influencing the course of their learning, or manually probing and evaluating their performance. To test our agents' ability to capture distance-agnostic relationships between elements of the gameboard, we design a minigame within the environment which is, by design, unsolvable at large enough scales given strictly local strategies. Given the game engine's extensive use of Cellular Automata, we also train our agents to "play" Conway's Game of Life -- again optimizing for population -- and examine their behaviour at multiple scales. To make our models compatible with variable-scale gameplay, we use Neural Networks with recursive weights and structure -- fractals to be truncated at different depths, dependent upon the size of the gameboard.
Motivation & Objective
- To develop a reinforcement learning environment that enables training agents to optimize urban population across variable map sizes in a city simulation.
- To investigate whether fractal neural networks with recursive, weight-shared structures can learn policies that generalize across different scales of urban and cellular automata environments.
- To evaluate the effectiveness of hierarchical, depth-variable neural architectures in capturing global, distance-agnostic relationships in spatially complex simulations.
- To explore how human interaction during training and inference influences agent policy learning and performance.
Proposed method
- The authors created gym-city, a custom RL environment based on Micropolis, which emulates SimCity 1’s game engine and supports variable-sized gameboards.
- Agents observe the entire gameboard at each step and take actions on any tile, enabling global policy learning with full state visibility.
- Fractal neural networks are implemented with recursive weight-sharing and hierarchical depth, allowing the same core block to be truncated at different depths depending on map size.
- The architecture includes strictly convolutional (StrictlyConv), fully convolutional (FullyConv), and fractal blocks with intra- and inter-column weight sharing for ablation and comparison.
- The environment supports human-in-the-loop interaction: human actions are queued and treated as agent actions during training, enabling hybrid learning.
- The model is trained to maximize population in both SimCity 1 and Conway’s Game of Life, with performance evaluated across multiple map sizes (e.g., 16×16, 32×32, 64×64).
Experimental results
Research questions
- RQ1Can fractal neural networks with recursive, weight-shared structures generalize policies across variable map sizes in urban simulation and cellular automata environments?
- RQ2How does the receptive field size of a policy network affect performance in tasks requiring non-local, global strategies?
- RQ3To what extent can human actions during training influence or shape the agent’s learned policy in interactive simulation environments?
- RQ4Does weight-sharing across fractal network columns improve generalization and performance compared to independent training of subnetworks?
- RQ5Can a minimal, highly parameter-efficient architecture (e.g., one layer repeated recursively) match or exceed performance of larger, standard convolutional networks in spatial reasoning tasks?
Key findings
- StrictlyConv consistently matches or outperforms FullyConv in both SimCity 1 and Game of Life, suggesting that its recursive, parameter-efficient structure improves generalization.
- The 8-layer fractal column with intra- and inter-column weight sharing outperforms FullyConv in Game of Life, indicating that larger receptive fields enhance performance on global tasks.
- Fractal networks with only one or two layers perform worst, suggesting that shallow receptive fields are insufficient for capturing complex spatial dynamics.
- When the initial population is reduced on larger boards, agents successfully scale their strategies, indicating that high local activity can inhibit effective global planning.
- Human players who build near agent structures often trigger immediate agent responses, showing that agents can adaptively respond to external interventions.
- The use of weight-sharing in fractal blocks allows for dramatic parameter reduction while maintaining competitive performance, suggesting efficient reuse of learned spatial patterns.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.