Remix.run Logo
ximm 3 days ago

> Hundreds of thousands of cars physically move along roads and have to break, accelerate and change lanes in traffic to safely get to their destination. Future work: Other modes of transport (pedestrians, light & heavy rail, airports, etc.). Multi-modal pathfinding (combining walking, public transport, taxis and driving to reach destinations).

So this is a US simulator.

watersb 3 days ago | parent | next [-]

It would be a US simulator if it also required at least two parking spaces for each of the hundreds of thousands of cars.

CalRobert 3 days ago | parent | prev | next [-]

If your only mode of transport is cars you can hardly call what you're building a "city".

buzzerbetrayed 3 days ago | parent | prev | next [-]

Because cars?

crooked-v 3 days ago | parent | next [-]

Because only cars, and treating everything else as an afterthought.

timeon 3 days ago | parent | prev [-]

Those videos show suburbia with huge roads - that does not sound like 'City'.

db48x 3 days ago | parent [-]

Eh. What they really show is a tech demo. It has simple houses and stores instead of a single apartment building with both in them because it needs to test the path finding and traffic simulation. It also needs to test the agent simulation, where each agent goes somewhere that satisfies a need. If everything were in a single building then there would be no way to find bugs in those systems.

DonHopkins 3 days ago | parent | prev [-]

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...