logoalt Hacker News

How Pizza Tycoon simulated traffic on a 25 MHz CPU

211 pointsby FinnKuhntoday at 12:57 PM42 commentsview on HN

Comments

edwcrosstoday at 2:50 PM

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.

show 2 replies
setrtoday at 3:25 PM

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

show 1 reply
Waterluviantoday at 1:55 PM

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.

show 1 reply
manofmanysmilestoday at 4:04 PM

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.

dueltmp_yufsytoday at 5:45 PM

"an open-source reimplementation of the 1994 DOS game" I love that communities band together to keep these things alive and even thrive beyond the original.

bluedinotoday at 2:00 PM

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

dpcxtoday at 1:48 PM

My high school girlfriend and I played this game all the time; trying to build the pizzas to get the best score was always super frustrating. It always felt like I could be a single pixel off and get a really low score, but I loved building my "empire"

show 1 reply
Waterluviantoday at 1:50 PM

Anyone know of any communities/game jams with the theme of "has no business running on such low hardware requirements"? Kind of like the demoscene but for games.

There were many games growing up that gave me such a warped view of what was to be expected from the hardware. Battletoads, Crash Bandicoot, Marathon Trilogy (Macintosh), Age of Empires (Multiplayer), Roller Coaster Tycoon (of course).

show 7 replies
IrishTechietoday at 1:33 PM

I was looking for this game on GOG only an hour ago having regaled a teenager with how great it was! It’s not on GOG unfortunately.

show 1 reply
hiltitoday at 3:53 PM

I love these posts, because I always wanted to get into game development and never found spare time. Thank you so much!

thiretoday at 4:48 PM

Is it me or the last gif actually displays a bug? there is a brown car stuck in the middle and other cars are moving through it

kilroy123today at 2:44 PM

I don't have much to add except to say, I love this trend of people rebuilding old games like this. I hope to see a lot more of this.

timcobbtoday at 4:09 PM

> Maybe 20 or 30 tiny sprites at a time, but they navigate the road network, queue behind each other at intersections, and generally look like a living city. Yes, it was a bit buggy because sometimes they would drive through each other, but it was good enough to just give some sense of life to the map. All that on a 25 MHz 386 CPU.

is that much of anything for a 25MHz CPU? We're talking about something cycling 25 million times per second, surely that's not such a big deal for a 386?

ge96today at 2:57 PM

I see some cars disappearing

edit: actually if it hits an end of a road, it spawns to a lane next to it either goes opposite direction or turns (referencing first gif)

Wonder if they could have considered ensuring no cars stack on top of each other

show 1 reply
jszymborskitoday at 2:10 PM

I couldn't understand why someone would want to reimplement Pizza Tycoon, until I realized I played it's sequel as a child, which is much maligned compared to the original.

show 1 reply
seriousmountaintoday at 3:56 PM

This is a really nice observation. It reminds me of how cellular automata traffic models work in general — instead of giving each car a brain, you encode the rules into the cells and the car just asks "what does this cell tell me to do?" Way cheaper than pathfinding, and the emergent behavior from simple local rules often ends up looking more natural than scripted AI would. The constraint of a 25 MHz CPU basically forced them into the more elegant solution.

fedorsapronovtoday at 3:06 PM

Fascinating how constraint breeds elegance. 25 MHz forces you to find O(1) or O(log n) solutions where modern devs would reach for O(n²) and more hardware.

Same principle applies to on-chain computation: gas costs force you to find closed-form solutions. For example, computing φⁿ (golden ratio to the power n) naively requires n multiplications. Using the matrix identity [[1,1],[1,0]]^n via repeated squaring gives you O(log n) — and the Fibonacci numbers fall out for free. The old game devs would have appreciated EVM constraints.

show 1 reply