Procedurally Generated City

I’ve been working on a procedural city generator using tilesets. It can generate a city of any size with fully enterable buildings in one minute.

Features (planned and current:)

  • Generates a city based on a tiled grid (tilemesh)
  • Fully enterable buildings with generated interiors (toggleable per building)
  • Separate the city into district types (Residential, Commercial, Highrise, Park, Industrial)
  • Individual buildings can be collapsed in editor, allowing for further customization
  • Easy to modify base, meaning you can change the overall look to suit your map.

Limitations:

  • Doesn’t support angled roads or height variations. You have to create separate “cities” and connect them manually
  • You still have to compile the map (obviously)
  • I can’t figure out how to guarantee houses face the roads. This should be possible but I can’t figure it out atm. Currently, you have to manually select which side is facing the road.

Advertisement:
Follow my twitter to stay up to date and view more gifs. https://twitter.com/gvarados/status/1328506801835433984

35 Likes

One method of solving this would to store edge information on each tile, this would allow your buildings to snap only to sides that have a specific edge type. You could also leverage this to have tiles with different terrain types (like lakes that consist of multiple tiles).

Are you planning on also having generated roads?
Another cool thing would to have zoning for building types in areas, so you can generate districts.

It’s pretty good!

3 Likes

I have edge information but can’t seem to use neighboring tile’s user-defined info. I can detect when an edge is not next to another tile though. Maybe it’s unimplemented or I’m misinterpreting it (it’s undocumented.)

The roads are generated. Location is determined by the user via tile size, but the appearance is randomized. It could be possible to generate a road path if I get edge info working.
You actually can right-click tiles & select a district type (Currently Residential, Commercial, Highrise, & Park) :wink: :+1:

1 Like

Procedurally generated maps will be useful for minigames like TTT or Murder.

It’s pretty good! :+1:

1 Like

Saw you posting about this in the discord, this is really awesome and seems really easy to iterate on. Can’t wait to see it built up over time

1 Like

A friend of mine has been keeping me posted with your tweets. We come from the ACF community for gmod and were super interested in cooking up procedural terrain to do the old rooty tooty shooty shooty on in s&box whenever it came around. When he saw your tweets he showed me because ~random generation things~ and it’s super cool to see you’ve cropped up here already.

That looks pretty interesting, saw you post it on Discord.

Looks cool. Reminds me of an addon someone made for blender called SceneCity. https://www.cgchan.com/

I already like this. Makes me more hopeful for the quality of RP gamemodes to come out.

Why play on a server with the same old boring map for countless hours, with maybe some slight variations, when you could be running around in a huge dynamically generated city that’s prone to tons of changes all the time?

1 Like

The project is actually very interesting, I try to observe from the day it was started, and I wanted to know are you going to open it for free?

1 Like

Can we add our own prefabs to the mix? For example: A park, gas station, etc.
Also would it be possible in the future to include curbs, squares and other green space (Edit: Not a park district, green space EVERYWHERE)? The city looks artificial without them. Also we’d need a simple way to integrate this generated city into an environment. (Think about how the city merges with the suburbs/countryside on one side and sea on the other in GTA V.) Also perhaps we could have an intensity heatmap (Highest intensity gives taller buildings, skyscrapers etc, and lowest gives small suburban houses)

You can add your own prefabs and change existing ones.
I don’t plan on having proper transitions to outside the city. I figure it’d be easy enough to do manually (and is out of scope for this project) It uses tilesets so it’s not possible atm to use a heatmap unfortunately :frowning:
You can select tiles & right click to change the district type though.

What about in-tile green areas? City without them looks bland and artificial. (E.g. have a road with trees on the side)

Thank you! I will probably release it for free when it’s done. (unless it gets officially added <3 )

1 Like

Yeah I’m going to add lots of green. I haven’t actually done any detailing yet. These houses are literal boxes with windows floating in front of them.

Thank you! Little trees and bushes give an artificial city lots of believability!
Also perhaps you could think about a multi-tile tile (e.g. a building block that takes more than one tile, some more advanced intersections, etc)

A big ALSO!
Maybe think about hexagons instead of squares. Lets you have much more variety and will be able to make cities more natural instead of griddy. (Think london instead of LA Suburbs)

1 Like

I’d love to use non-squares, but this uses the built in tileset system, which currently only supports rectangles :frowning:

Maybe it can be tricked somehow?

1 Like

I don’t know if possible, but I think it would be really nice if you can use custom presets for houses and stuff for the generation of the map

Yes, you’ll be able to edit everything :wink:

1 Like