by DonHopkins | 2025-08-15 12:30:29+00:00
I hated all the heavy traffic in SimCity, so I created the Church of PacMania, which worships PacBot: a gargantuan yellow road following car devouring PacMan.

The Church of PacMania generates a mobile traffic-seeking PacBot agent, plus a whole lot of traffic, the point of which is to attract the PacBot to the church, to sacrificially feed its followers to god, in contrast to the Catholic tradition of worshipers devouring the flesh and blood their god.

Kind of like an automotive version of PKD's "Rautavaara’s Case":

https://philipdick.com/mirror/websites/pkdweb/short_stories/...

Micropolis Online (SimCity) Web Demo:

https://youtu.be/8snnqQSI0GE?t=56

https://news.ycombinator.com/item?id=22849908

DonHopkins on April 12, 2020 | parent | context | favorite | on: Enemy AI: chasing a player without Navigation2D or...

In Micropolis, the open source version of SimCity, I scripted a "PacBot" agent in Python: a giant PacMan who follows the roads around, looking for traffic to eat, always turning in the direction of the most traffic.

The PacBot only has a limited local view down the roads a few cells, and can't see around corners.

Even though they're extremely simple and stupid and short-sighted, they still have interesting emergent behavior when multiple PacBots are competing for the same traffic, like how PacBot will give up and turn around when its competitors eat the cars it was wok-a-wok-a-ing towards.

There is a good example of lots of competing PacBots around 0:55:

https://www.youtube.com/watch?v=8snnqQSI0GE

>Now you have some good, uuh, there's some traffic here. There's this thing called a PacBot. It's this PacMan that follows the road around looking for traffic. And then he eats it. So that's good for your city. And you can have a lot of different PacMans on the thing, and you know, just editing the road gives the PacMan somewhere to go. So their score is how many cars they've eaten. So it's an "agent", and it woks all around, and he follows roads. And you can put a lot of them on the map to keep the traffic low.

MicropolisRobot.scanRoads looks down the road in a given direction for a given distance, and counts the number of cars (in the traffic density layer), attenuated by distance (further away cars don't count as much).

https://github.com/SimHacker/micropolis/blob/b0c5a3f495ebabb...

Then the PacBot simulator calls scanRoads in all possible different directions to get a score, and moves in the direction of the best score.

https://github.com/SimHacker/micropolis/blob/b0c5a3f495ebabb...

As it turns out, the PacBot is actually the God of the Church of PacMania (each Polytheistic PacMania Church spawns up to four PacBot God Agents, if it's connected to a road), and the church zone itself generates a LOT of traffic, in the hopes of attracting the PacBots. The emergent behavior is that followers of the Church of PacMania happily drive back and forth between church, home, work, and shopping, again and again, in the hopes of sacrificing themselves to their God, PacBot. And the PacBot Gods hang out around the Church of PacMania, eating their followers, and raising their scores -- everybody's happy!

class MicropolisZone: def generateRobots(self):

https://github.com/SimHacker/micropolis/blob/b0c5a3f495ebabb...

class MicropolisZone_ChurchOfPacMania(MicropolisZone):

https://github.com/SimHacker/micropolis/blob/b0c5a3f495ebabb...