Live data from Hacker News

How Pizza Tycoon simulated traffic on a 25 MHz CPU

pizzalegacy.nl

51–60 of 67 posts

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#51

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…

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

> Of course I'll have my own bugs...

... but they'll be just as entertaining?

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#52
I would argue it's not that you don't need pathfinding because the roads tell the cars where to go, it's because the cars aren't trying to get anywhere. Unlike cities skylines and co where a car is going from a place to a place, random directions at intersections are dramatically simpler. Which isn't necessarily worse, it's just a different problem.

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#53
Fast Food Tycoon 2 (AKA Pizza Connection 2) was absolutely amazing. I spent so many hours customizing my pizzas and filling up the competing pizzerias with cockroaches and woodworms (and occasionally kidnapping their employees).

The English version had some bizarre translation quirks, but those just add to the retro charm.

One time I found a bug where the game would crash if you followed a courier into an enemy HQ building while they had guards inside (I guess they kill the courier, which then leads to a null reference or something?). When the game crashed I was so scared that I had broke my grandpa's computer. Good times.

The only thing it was missing was multiplayer. I hope that somebody creates a full OpenRCT2 style remake of it someday; it has so much potential for online multiplayer and wacky mods.

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#54

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.

Me too. A whole blog post about spending years on and off on something that's just aesthetic and not even central to the game

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#55
Hmm - it occurs to me that it would be cool to have modules inside a regular city-simulator like SimCity or CitySkylines such that you can build additional games on top of that engine. A bit like Unity (?) or Roblox (?)

Then you could take advantage of the deep simulation capability, not worring about traffic and things like that - for your Bookstore Tycoon or Donut Tycoon franchise.

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#56
I was impressed with folks who learned so many games as kids -- I got sucked into Simcity 2000 for quite a spell... then Simcopter and "Streets of Simcity", which I soon found out had almost zero ppl looking to play online. It was kind of like GTA3, if in GTA3 your car could hop over other cars, glide with an airfoil, drop mines, and had a machine gun and/or rockets. Also no sex workers, though in Simcopter one developer did insert an easter egg involvinging a bunch of dudes showing up... I got yelled at in middle school for activating it in the school computer lab. (they also threatened to have me dragged downtown to the fbi for repeatedly playing the word 97 pinball egg -- being a "hacker" post columbine was not fun).

anyways i've been looking for offline, open source games so thanks for sharing.

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#57
post #39

> 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 mil…

Thank you for writing effectively what I was curious about. "Simulating traffic" can mean a lot of things, I remember on the old SimCity they just "colored" each road-tile as red/yellow/green, (no doubt from a ternary flag) and the visuals just sort of blended between the states (car density.)

Being able to do millions of things each second should enable all sorts of behaviors, especially for a game of the era when you asked the OS to kindly step aside while you run your program.

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#58
post #29

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…

The distance is not static because of cars stopping for one another.

And Factorio belts can have stuff added or removed, also.

The thing is a belt is modeled in terms of deltas rather than positions--there is no need to move each object each cycle. An object has a distance from the object in front. When the belt moves forward this relationship does not change--no need to update every pointer (and there can be a *lot* of belts in the game!) If the head of a belt can't move you only need to update one delta--the gap between the first free item and the stuck item in front of it and that value can already be known, no need to search. If you move the free item up against the stuck item you walk down the belt to find the new first free item.

You only need to modify the belt model if something is either added or removed from the belt. Objects get removed only by inserters, inserters examine only one cell of the belt, grabbing anything in that cell that matches what they are willing to grab (if they are feeding a machine they will only grab what the machine wants, otherwise they'll respect the filter list assigned to them.) When something gets added to a belt you add it to the list and update the delta of the object behind. No general update of the belt is needed in any situation, any more than you need to do anything to the items in a queue as you add and remove items.

Factorio is a game about optimization and the developers did a very good job of applying that idea to the game math. That is, until the masses of asteroids in the Space Age DLC.

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#59

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

Corncob 3D was a flight simulator with quite realistic physics and flat shaded 3D graphics written in x86 assembly. It ran pretty well on a 286!

Re: How Pizza Tycoon simulated traffic on a 25 MHz CPU

#60
post #39

> 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 mil…

Thank you for writing effectively what I was curious about. "Simulating traffic" can mean a lot of things, I remember on the old SimCity they just "colored" each road-tile as red/yellow/green, (no doubt from a ternary flag) and the visuals just sort of blended between the states (car density.) Being able to do millions of things each second should enable all sorts of behaviors, especially for a game of the era when y…

> especially for a game of the era when you asked the OS to kindly step aside while you run your program.

totally! I was also wondering this. I know each operation takes some number of cycles, but there's still 25,000,000 of them happening per second, and there's no multi-tasking... :shrug: :)

Post reply on HN