How Pizza Tycoon simulated traffic on a 25 MHz CPU

https://pizzalegacy.nl/blog/traffic-system.html

How Pizza Tycoon simulated traffic on a 25 MHz CPU — Pizza Legacy Blog

Reverse engineering the traffic system from Pizza Tycoon (1994): how the original devs drove dozens of cars through a city with almost no CPU budget.

The third image showing the arrows for traffic direction gave me a tiny eureka moment. You don't need complex rules for what cars can do at an intersection. You don't reason about the intersection at all. You reason about the lanes!

At each choice cell, you just weigh the turn lower than going straight when randomly deciding. And if you don't want U-turns, you set a rule like it describes, or any sort of "cooldown" on turning.

Someone hasn't been watching their Biffa!

https://www.youtube.com/watch?v=pGCoLh3NL7g

It's all about the lanes and the flow.

What is Lane Mathematics & How to Control Traffic in Cities Skylines!

YouTube
Had no idea about this channel. 100% down my alley. Thanks for sharing!
It's amazing how "bad/inaccurate" the traffic simulators are in those games, even with great mods, and yet how informative they are about real traffic patterns.

> cars don't need to know where they're going. Each road tile type carries its own direction. Road tile 0x16 is the bottom part of a horizontal road, meaning that cars can only drive from left to right on these roads.

There's always a simple explanation for anything that looks too complicated for an old game to do.

Great! I'll finally be able to buy all commerce spots in Berlin (cheapest city) to avoid any competition, and _then_ open a restaurant.

I used to deal only with "ice cream" (illegal weapons) trading, buying in one city and selling them on another, to quickly earn lots of money, and then buying commercial spots but never opening them (too much hassle, having to micro-manage shops).

But after having bought about 200 or so, the game would inevitably crash a few weeks after my save file, so in the end I stopped playing it. I never got the exact details about the bug, but I hope this remake won't have it!

Besides that, the most fun thing was trying weird pizza recipes and seeing that the taste algorithm was a bit weird. I could put lots of chicken, or pineapple, and mix a few ingredients, and have some age groups rate them very highly.

But sabotaging the competition was still funnier than handling a normal business.

I'm writing the engine from scratch (not re-creating the original engine) so it definitely won't have the original bug. Of course I'll have my own bugs but at least its open source now so it's fixable by more people :D

By making the roads single-direction and roads owning the movement, I think it’s been made equivalent to a conveyer belt… which means factorio’s conveyor belt optimizations might be relevant.

Eg storing the delta between items rather than tracking position directly, because the distance between cars is static for the length of the road, except during compression, insertion or removal of a car

https://www.factorio.com/blog/post/fff-176

Friday Facts #176 - Belts optimization for 0.15 | Factorio

Hi everyone. About half a year ago whenever I was sitting deeply in Factorio and when I needed to spend time in my phone, I was reading FFF or Factorio forum. Later when I decided to move - I suddenly realized that Wube is the most logical target to apply my crazy mind. All thanks to those FFF and you guys. Now I am writing another FFF myself which, looking back at those times, gives me ripping apart feelings (which I believe is a good thing :)).

Factorio
The distance is not static because of cars stopping for one another.
I love that this has been in development for so long. It's a breath of fresh air in this manic vibe coding era, and a reminder to
me that I can slow down.