Monday, January 19, 2026

Procedural Restaurants

My previous "restaurants" post was a bit misnamed because mall food court fast food stores aren't really restaurants. This time I've added proper restaurants in their own buildings. I decided to start with the house floorplan, since restaurants are smaller than office buildings and there are plenty of houses available to reassign. I limited restaurants to simple single cube houses to keep the logic simple. There are no garages or sheds. I also restricted them to two floor tall buildings with a large horizontal footprint, to provide ample space for the dining area and additional rooms. This produced a reasonable number of restaurants that seems to be around 5% of all secondary city houses. (None of the residential city houses are large enough to be a restaurant.)

The internal floorplan of a restaurant is simple and shared across all buildings of that type. The main dining area occupies around two thirds of the total space, which is separated by the remaining rooms by a wall that runs the entire length of the building and a series of doors. The other rooms consist of a kitchen, two bathrooms, and an optional storage room for large restaurants. The kitchen takes up about two thirds of that extra space. The actual size distribution depends on the number of windows along the exterior walls as the interior room dividing walls can't end at windows. The storage room can either be connected to the dining area or the kitchen with a door. All doors remain unlocked as there are no items for the player to search to find keys. Restaurants currently have no attic or basement.

The dining area features many small wood tables arrayed in a 2D grid pattern. Most of these tables have four wood chairs. Tables can be either square, rectangular, or round, with optional place mat or table cloth of a variety of textures/patterns. Each table has full place settings for each seat with a plate, cup, and silverware. Some plates have food such as fish on them, while some cups contain coffee. I placed either a custom procedural vase or a candle at the center of each table. The result is very repetitive, but also very orderly. I suppose it makes up for the randomness of the kitchen object placement.

I hung spherical lights from the ceiling in a grid pattern and placed rotating ceiling fans between some of these lights. The perimeter of the dining room is decorated with a variety of objects such as 1-2 wine racks, potted plants, pictures, an optional TV, and an optional fish tank. I placed rugs on the floor by the exterior doors and a podium with chair next to the main entrance for guests to wait at to be seated. The ceiling uses a white panel texture, and the floor uses one of two marble or granite tile textures.

3DWorld's procedural buildings are full of critters: rats, spiders, snakes, roaches, and flies. Restaurants are no different. It's actually quite fun chasing rats as they run between the tables and chairs. 

I've included some pictures of restaurant dining areas below. 

Restaurant with pink walls and square tables with table cloths.

The upper row of windows looks a bit odd, but I have the same layout in factories and two story retail buildings. This is one limitation of the current window logic. It's run on the exterior of buildings before the interior is generated, so it can't easily be customized by building type.

Restaurant with light green walls and round tables with darker wood.

Restaurant with pink walls and square table with red table cloths.

Restaurant with light blue walls and rectangular tables, viewed from above.
 

After taking the screenshots above, I realized that the ceilings look kind of plain. There's not much contrast between the light ceiling tiles and the bright walls. I decided to add wooden beams crossing the ceiling and hang the lights on these. Here is how this looks in the first restaurant. It's definitely an improvement. I like how all of the wood textures and colors match between the tables, chairs, wine racks, and beams.

First restaurant with wooden beams added to the ceiling that the lights hang from, and people.
 

Restaurants have commercial kitchens that use the same object placement logic as kitchens found in malls, prisons, schools, and hospitals. They have the same walk-in freezers, ceiling ducts/vents, and shiny reflective cooking equipment. The only difference is that the logic for placing hoods and some of the other objects is a bit more complex to handle the windows.

Kitchen from the restaurant in the first screenshot. There are snakes, rats, spiders, and roaches in here! (And the plates are metal?)

Restaurant kitchen, looking out through the door into the dining area.

The bathrooms are quite small with a single toilet, a sink, and urinal in the men's room. I placed gender appropriate signs on the outside of the doors. They look very similar to office building single use bathrooms, so I'm not adding screenshots of them. I included the medicine cabinets found in house bathrooms because this is a source of healing items for the player, and there are no other drawers or doors for the player to open in these buildings. The only major difference is that they have tall ceilings.

This post was much shorter than the last one, mostly because I only had one topic compared to three. I feel like I'm done with food related items for now. The next task on the list is car washes, so I guess it's back to working on commercial cities. I won't be surprised if I find more restaurant related changes to make though.

22 comments:

  1. Maybe you could do a city gen architecture and terminology overview? I looked through the archives and still have confusion about the distinction between "secondary city houses" and "residential city houses". It seems that now that the code-base is getting fairly mature and solidifying, an overview could be helpful not only for your audience to understand the update posts, but also for yourself to clarify (and maybe improve and streamline?) the overall structure of the city-gen systems. It could be a good opportunity to make a new showcase video too. Let me know if you'd like help with this, I'd be glad to put something together.

    ReplyDelete
    Replies
    1. Where would I put an overview where people would see it? I have 188 blog posts and I'm sure very few people look at the Readme file on GitHub. You may be the only person who reads it.

      I probably have something about this in an early blog post. The procedural world is an island with some flat city areas (currently 8 of them). Some cities are commercial with office buildings, while others are residential with houses. Everything is flat and connected with roads, sidewalks and power lines, with city blocks and yards. Secondary buildings fill in the spaces between cities. It's often rough terrain with other objects such as trees and water in the way, so placement is basically random. I never figured out how to connect these buildings with a road network.

      Houses in residential cities are constrained by yard space and generally a smaller footprint but more vertical. Secondary houses placed between cities can be larger, and these make for better restaurants. The code is basically the same for both types, there are just two instances of the building manager object, so I can do whatever I want with this.

      Delete
    2. Fair enough. So cities come in two types as well, commercial & residential? Would you mind if I made a YouTube video about the project?

      Delete
    3. Sorry for the wait, for a few days I wasn't able to reply for some reason.

      Yes, there are two types of cities chosen with 50% probability. Sure, you can make a video. Send me the link! Thanks.

      Delete
  2. Given the strain of horror that has been creeping into these updates, "Restaurants currently have no attic or basement." evoke a lot of low-hanging fruit.

    ReplyDelete
    Replies
    1. I can add attics and basements to restaurants, but they currently won't be accessible to the player. The attic ladder will be too high up to use with those tall ceilings. Maybe there can be some sort of ladder or stairs to a second level room above the bathrooms or something. That would be significant work.

      Basements don't have a good room to connect stairs to. They won't work in the dining area or bathrooms. Probably not in kitchens, and they may not fit in the small storage room. Unless I make the storage room into the stairs entrance and put the storage in the basement? That could work. I'll add it to my list. Thanks.

      Delete
    2. Restaurants now have basements with the entrance in the kitchen or storage room. I can add attics, but the ceiling is too high to reach them, so they're disabled for now.

      Delete
  3. The big open floorplan reminds me more of a convention center banquet hall than a restaurant. Maybe you could add shoulder-high baffle walls to provide the tables with some privacy? I'll bet you could procedurally generate these! Here's some fractal spatial subdivision code I wrote a while ago which could be helpful for decorative barriers, or even for more interesting city "grids"!
    https://github.com/dudecon/Blender-Scripts/blob/main/addon_add_complex_bookshelf.py

    ReplyDelete
    Replies
    1. I was going to add walls but I guess I forgot about that idea.

      The top block of your code is about as readable as mine! Do you have any example images of what this produces? It sounds like it could be similar to how I subdivide houses, which I recently learned was called a "squarified tree map."

      Delete
    2. Here's a video: https://youtu.be/bFZZzmnu8vw
      It's aparently called "Recursive Spatial Subdivision"
      https://grok.com/share/c2hhcmQtMw_08bf26dd-dd74-493b-885b-fe2128b845e8

      Delete
    3. Okay, that helps to understand what your code does. It's somewhat like one of my building floorplan generators, but with more extreme aspect ratios and nested patterns. Recursive spatial subdivision is a more general name. The specific algorithm is squarified tree map because the regions are all rectangular. At least that's what I was told.

      Delete
    4. I added short walls with a wooden grid pattern that partially blocks the upper half. These are placed between rows of tables in some restaurants.

      Delete
  4. Looks like "The main dining area occupies around a third of the total space" you meant "two thirds"? The dining area certainly looks larger than the kitchen in the screenshots.

    ReplyDelete
  5. I agree, the wooden beams on the ceiling are a big improvement. In general, I feel like darker surfaces would make a more comfortable, cozy, and intimate feel that stand-alone restaurants often shoot for. The pastel and white works for frozen yoghurt stores in malls, but if I'm sitting down to have a nice dinner, I'd prefer to not feel like I'm in a repurposed cleanroom. Maybe you could add some art to the walls? Potted plants? Some big decorative floor-vases (with plants or even trees in them?) and statues (zero-animation people models with a uniform texture applied) would help too.

    ReplyDelete
    Replies
    1. Restaurants use the default colors for houses since they're repurposed houses. I suppose I can start by changing the trim from white to wood. I'm not sure about the walls. Maybe some sort of texture/pattern?

      I do have pictures on the walls, but the placer usually won't put them between windows so they only end up on the middle divider wall. There are already potted plants around the edges of the room. I can probably put plants on divider walls if I add them. There are vases on the tables themselves. I can probably add small trees if there's space. I already have palm trees in malls. I never figured out statues.

      Delete
  6. Could add a mechanical room off the kitchen. Commercial kitchens fameously need a lot of hot water, and a floor sink with janitorial supplies would make sense too.

    ReplyDelete
    Replies
    1. This sort of thing probably goes into the storage room, which becomes more of a janitorial/supply room. I should at least add a water heater and another sink.

      Delete
  7. Overall, restaurants look like a very nice addition to the city! Looking forward to the car-wash post, along with the procedural "car grunge" texture that you'll be adding so there's something for the car-wash to do.

    ReplyDelete
    Replies
    1. Thanks! I don't know how to add a car grunge texture to all 12 car 3D models!

      Delete
    2. Could you dynamically render it over the top of the existing textures, kind of like you do with the dirt on the walls in the basement?

      Delete
    3. I added a car dirt shader effect that works the same as the wetness basement effect. Cars accumulate dirt over time and visit the car wash when they get too dirty. It was some effort to write the car wash navigation logic for cars, and to keep them from interfering with the gas station cars that start from the same lot area. I'll make a video or something when this is finished.

      Delete