---
title: "NYU Researchers Evolve Readable Python Rules That Build Playable Game Levels"
subtitle: "A new research paper reframes cellular automata as evolvable Python modules, letting genetic programming discover readable rules for level generation."
url: "https://alphasignal.ai/news/nyu-researchers-evolve-readable-python-rules-that-build-playable-game-levels"
author: "AlphaSignal Newsroom"
author_url: "https://alphasignal.ai/editorial-team"
company: "AlphaSignal"
company_url: "https://alphasignal.ai/company/alphasignal"
published: "2026-09-05T13:54:18.000Z"
updated: "2026-09-12T00:08:12.935Z"
type: "Paper"
topics:
  - "Development"
  - "Vibe Coding"
subtopics:
  - "Code Generation"
  - "Ui Generation"
upvotes: 266
source_url: "https://arxiv.org/abs/2609.06102"
comments: 0
truncated: true
---

# NYU Researchers Evolve Readable Python Rules That Build Playable Game Levels

> A new research paper reframes cellular automata as evolvable Python modules, letting genetic programming discover readable rules for level generation.

Cellular automata update a grid by applying the same rule to every cell, usually in synchronized steps. Simple rules can produce complex behavior, but designing useful ones becomes difficult as the number of cell states and neighborhood size grow. In a [new preprint](https://arxiv.org/abs/2609.06102), researchers from NYU and the University of the Witwatersrand, led by Ahmed Khalifa, introduce Programmable Cellular Automata (PCA), a framework that evolves modular Python rules and tests them on procedural game-level generation.

## Why richer rules become opaque

In a lookup-table cellular automaton, every possible neighborhood configuration maps to a cell’s next state. For a neighborhood containing _n_ cells with _s_ possible states, the table may need to cover _sn_ configurations. Larger neighborhoods and richer state spaces therefore make explicit tables unwieldy.

Neural cellular automata replace the table with a learned network, gaining expressive capacity while making the resulting behavior harder to inspect. PCA preserves an evolutionary search process while expressing each discovered rule as source code that a researcher can read, test, and modify.

## A rule set assembled from programs

PCA divides each cellular automaton rule into three kinds of Python functions:

| Function     | Input                            | Role                                                                    |
| ------------ | -------------------------------- | ----------------------------------------------------------------------- |
| **Local**    | A neighborhood window            | Extracts information near the cell being updated                        |
| **Global**   | The complete grid                | Computes optional board-wide information such as counts or connectivity |
| **Decision** | Outputs from the other functions | Selects the cell’s next state                                           |

Evolution treats the full list of functions as a chromosome. Crossover swaps complete programs between parent chromosomes, preserving their modular boundaries. Mutation replaces one program with newly generated code.

_Preview only. Full text requires an AlphaSignal Pro account._

## Sources

- [Programmable Cellular Automata](https://arxiv.org/abs/2609.06102)
- [Programmable Cellular Automata (HTML)](https://arxiv.org/html/2609.06102)
- [PCG Benchmark](https://github.com/amidos2006/pcg_benchmark)
- [Author announcement thread](https://twitter.com/Amidos2006/status/2097711237974868322)
