X
X
xmoonlight2020-04-17 15:17:32
Algorithms
xmoonlight, 2020-04-17 15:17:32

City generation (procedural)?

Map
2D mode.
There is a square grid level (green field) of dimension X*Y.

Objects
There is a set of objects for tiling of different types:
1. Buildings - 3 types of figures, consisting of squares (analogue: from "Tetris").
2. Trees - 3 types, size: 1x1, 2x2, 3x3
3. Automobile road - size: 3x3 (for one lane).
4. Pedestrian road - size: 2x2.

Conditions:
1. Any buildings and trees can stand on any surface.
2. You can't only walk through 1x1 buildings and trees.
3. Any impassable objects are not adjacent to each other.

Question: how to procedurally tile a given area so that it looks like a city?
How to compose these very criteria for generating the structure of the city?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GavriKos, 2020-04-17
@xmoonlight

Cool task.
I would have generated (most likely with my hands - to make it beautiful) a lot of templates - a la "quarters" less current, and then I glued the city out of them.
If it is directly necessary procedurally, then perhaps you should start with the roads - they have clear requirements a la graph, where the peaks are areas (probably).
Well, a couple of articles:
https://habr.com/ru/company/piter/blog/455004/
https://habr.com/ru/post/320140/ (yes, this is a maze and not a city - but there are common features )

M
mayton2019, 2020-04-17
@mayton2019

A city is similar to a city when the houses and quarters in it have angles close to 90 degrees. Such is the fuzzy criterion.
It seems to me that this problem can be solved by a genetic algorithm simply by throwing random polygons of houses on the map and then, when selecting, select those that are most parallel or perpendicular to the roads.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question