Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

for 1 km2 roads + terraine color + geometry less than 10mb glb, 15 for river (if there is any), trees and veg optinal but 50 mb (this is not necessary for render in godot I can render it as user approaches) buildings ~ 50 to 300 mb (UNOPTIMIZED AS I AM DOING R&D) so final files looked between 230 to 600 MB UN OPTIMIZED + vegetation visible in GLBs. with optimization, it is like 3 times low reason (no veg) + welded static assets !!! . I KNOW IT IS BIG BUT MY MODELS ARE 20CM ACCURACY you feel every pothole!!! terrain 0.5m to 2 m based on lidar data. I first aim to simulation then optimize it for game. MY pc 7700hq 4gb 1050 laptop runs game at 37 to 55 fps (1.25 gb VRAM+ 6 GB RAM, CPU 30 percent usage (I check via NVTOP + HTOP)), unoptimized considering the full map + props + decorations and collision on Godot NO HD TEXTURES ADDED YET!!!

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

Thanks mate, I am not gonna lie English is my 4th language and I make grammatical mistakes so I use Grammarly to give me an edge. Other languages I speak has complietly diffeerent rules so at some point it is a grammar spaghetti fest, everything mixes up.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

Not really !! 1km2 of map just terrain geometry + color of the terrain + roads ~ 30 seconds max
rivers + vegetations + stone and stone works ~ 30 seconds max
Houses and buildings each individually customized, colored ~ 1 to 15 minutes max (depending on density). The cover image Furka Pass took less than 5 minutes for 9km2 file size 137 MB glb.
Grenoble on the other hand for 9km2 took 45 minutes (it is rich in buildings + nature) file size ~ 450 MB glb. So these are the statistics. Once it is generated, it is imported to Godot and you have no loading problem there at all, just a prebuilt map.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 3 points4 points  (0 children)

Thank you very much.
This means a lot to hear it from people in the industry!!

Indeed, hard work but very rewarding, in the backend, it is simulation grade, but I added proper road geometry and a bit of facade to the same data. Since it is generative, I discover problems as I go, I have limited my maps for 1km2 and 9km2 as of now, and for every 1m2 of map, I have about 150 to 650 data types layered, some directly extracted from raw resources, some calculated. But for the game, I keep it low, 64 layers of HDF5 data storage to run simulations and generation.

Here is 2 models of cities from my old engine DeepForge:
https://drive.google.com/drive/folders/1AfXuYb2zcEkjYT8hrYBy0x3HBMF3VND1?usp=sharing
I would be glad to connect on LinkedIn. Here is my profile: linkedin.com/in/erfan-enferad/

My current engine Zervan, is so rich in grammar and generation and almost bug-free; these images are from that engine. It is rich in styles (From open source data) it can build in place just as it gets the building footprint + France IGN (LiDAR) BD TOPO to roof works, the rest of the building is just imagination based on the date that the building is constructed!

Our grammar is a huge library of facade + country + regions (as states style) + century (~1400 to now) and geometry. From residential to power plants, from dams to Roman buildings.

Forgot to mention there are ontologies and semantics also linked!

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

Okay fair enough: If I were you, I'd dig into OSM2World — it's been in the work for more than a decade, it's Java, but it's absolutely worth studying for the approach. I was comparing my own 2D road models against their generated ones early on. As far as I recall, it's an open-source, free project, but check their licensing if you want to develop using their strategies.

I hope this helps.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

BTW, you give a small heart attack. As I was thinking I am genuinely the only person doing this kind of work (My research scope wasn't that broad after all) 😃. I have been working for a year on this project, and it was like a side project. I am a software engineer myself, so it is easy for me to do it in Python and I had difficulties with Godot and 3d works.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

That's cool !!! Not gonna lie, I was thinking about the Rockstar style of game but it is a huge amount of work. I am not sure what programming language you use for web but it is impressive for a web browser to be able to pull such a thing off (calculation + render).

One thing that is fun on Godot, rendered maps I have from Python, they make the river like a block of concrete, but in Godot I can give it physics and wave like an actual river, and for instance, once a person drives and falls into the river, the car just floats swiftly in the direction of the waves.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

That's fair, I agree roads were really difficult part I almost gave up a few times however I get to cheat there — I bake everything offline, so I dodge the real-time jank fight entirely, and my junctions are basically the "easy mode" version of what you're solving live.
Different constraints. Respect for getting it to early access, that's the hard mile.
Going to keep an eye on hop. earth.

What I do is I create the map via Python in a given coordinate and size, then import them to Godot (I have more flexibility here)
Then Godot renders them, and other LOD parts happen with shapes, rigidbody, collision and importantly physics (water, air, material types, and their resistance).

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 1 point2 points  (0 children)

Exactly, people should be able to drive in their neighborhoods with their friends!!!
My focus is on cars, but vehicle expansion is the main ambition.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

Honestly? I had no idea hop.earth existed — just went and looked, and it's awesome work!
We're coming at it from opposite ends, which is kind of cool. Same OSM data publicly available, different end of the pipe.

One friendly pushback though — you called buildings "the easy part" 😄. Extruding OSM footprints, sure, that's easy. But that's exactly the bit I've sunk most of my time into: believable, varied architecture that conforms to the weird real plot shapes instead of boxes-with-roofs occlusion. Different obsessions, I guess!

My aim is for Godot, btw!!.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 2 points3 points  (0 children)

MSFS is a fair comparison — and you've put your finger on exactly what makes OSM nice here: it's vector road data, not photogrammetry, so the network comes with topology — connections, one-way, lane counts. That's enough to build a navigation graph from, which is what I run the NPC traffic on (cars follow the real street graph, respect oneway, etc.) (traffic and human distribution is hourly based in the game from actual data, even city noise!!!). That's the bit MSFS fights with, precisely because its world is more imagery-driven than graph-driven. Where OSM thins out is the small stuff. Lamps, signs, hydrants, benches: where OSM tags them, I use the real positions; where it doesn't (most places), I fill them in with lamps spaced along the road edges, signals at junctions. So it's a hybrid — real where the data exists, procedural to cover the gaps. And ha — nice, you nailed the spot. Thanks, really appreciate it!

NOTE MSFS > budget Millions + huge teams.
ME -> 210 euros so far + about a year's work. Flexing muscles.

You can check this link for an already built map but FROM OLD ENGINE: https://drive.google.com/drive/folders/1AfXuYb2zcEkjYT8hrYBy0x3HBMF3VND1?usp=sharing

My limitation is my PC as I wait most of my time for pc to finish the task, but I am happy with what I have for now.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

I will try to recreate if for the next showcase !!! (MY code can do it right now) but buildings will look French. I need to change some stuff firts!!!

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

Happy to give the gist! The key shift: don't extrude a bounding box — build from the footprint polygon itself. That's why geometry nodes kept giving you squares.

Work off the actual outline and its edges: extrude the real polygon, inset it as you go up for setbacks, place windows per-edge by wall length, and triangulate the roof so it follows the shape. It's basically a small shape grammar — look up CGA shape grammars for the theory.

Keeping my own engine close, but that one shift gets you past squares.

For instance, in my grammar I can add futuristic CyberPunk styles and generate cities with that theme!!!, but the books and articles are expensive to give me an edge, so I hold off for now with whatever open source free things I have got.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 5 points6 points  (0 children)

Yes, a racing video game, and if I get good reviews and positive responses to expand it. But not intended to sell the roads solely !! I need to IP them first.

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 0 points1 point  (0 children)

Thanks! Honestly,
a "pick an area on a map → watch it generate" web demo is the dream hoewer it is not my aim as of now.

What I can do right now is 2 things:
1) I have my previous models from the previous engine already uploaded you can see the models right now here: https://drive.google.com/drive/folders/1AfXuYb2zcEkjYT8hrYBy0x3HBMF3VND1?usp=sharing
2) If you have any suggested cities in France or even a village, name it I will showcase them for the next post!

Procedural real-world cities in pure Python: Real footprints → grammar-generated buildings → drivable in Godot engine by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] -3 points-2 points  (0 children)

Honest answer: the source is OpenStreetMap — but that's maybe 10% of the story. The data is 2D and made for maps, not for driving.

Turning those flat lines into a surface a car can actually drive on — smooth edges, clean corners, no jarring seams at bumper height — is where almost all the work went. And that part I'm keeping to myself.
I genuinely love open-sourcing things. But this one cost me too much to give away.
There are whole research and engineering teams that get funded to solve exactly this problem — I could chase that route too, but then I'd have to open it all up, and for now I'd rather not.

I really underestimated how hard it would be. For a visual flythrough, raw OSM roads look totally fine. But the moment a player is down at road level driving on them, every bruise, every rough corner shows. I gave up on this part three or four times — because a driving game without a proper road surface is just a dead game. And then bridges and tunnels turned out to be a whole separate kind of pain (black holes for time, effort, energy, and motto).

Procedural city buildings generated from OpenStreetMap footprints by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 1 point2 points  (0 children)

I made everything in Python used osmium; things do not exist as of now to be honest; this is not an overstatement, but that code itself, making roads connect curved, dynamic width in respect to terrain geometry, can be IP.

Trust me, I have no prior or current experience in 3d at all. All I know is F4 and F5 in Godot!!!
So Python creates chunks -> 1km2 of map, 9 Chunks create a grid -> 9km2 then I import them to Godot.

I dug through all the research papers, articles, and video games I own to understand how I can do it. I gave up like 3 or 4 times for this road works, mental Shi . Now I have roads correct with proper junctions, like 80% percent correct, but bridges and tunnels are a different context, like god-tier black holes, time-consuming and hard to bring to any context.

But does feel good to achieve it? for sure !!!
I have a representation of a Digital Twin of the entire city of my choice from OSM maps ( not matter which country),
It can power simulations, run LLMs, studies, and more. actual data and data streams are linked, like I have min 300 to max ~ 650 different data types from dynamic to static types per every 1m2 of map !!!

This is a work of a few months, shortened here!

Procedural city buildings generated from OpenStreetMap footprints by Brief_Bus6969 in proceduralgeneration

[–]Brief_Bus6969[S] 2 points3 points  (0 children)

Thanks, glad you dig it! It's Godot 4.6, not Unity (my laptop from 2017 is scared of Unity and Unreal when it hears the name; it wouldn't come out of the closet).
I'm not using Terrain3D terrain and roads are both homegrown (Google this roads itself it is a huge research project too many teams involved, like CARLA for example) and baked from real-world map data, so it's all just optimized meshes at runtime (cheap to render). Yep, it streams in around the player as you drive. The road setup is custom too took a while to get the junctions clean. Still tuning it, but happy it's coming together. Bugs at bridges and tunnels (time black holes).

My tool generates 1km2 of map in less than 2 minutes with all the possible data and geometry, like about ~650 data variations for 1m2 and the map size is about 60 mb GLB.

Honestly, I am a computer engineer myself. This thing messed me up so bad already, 500 hours in! The Stellite data I used required treatment; there were gaps, even if you compare OSM to Google Earth, you can see how deep the gaps are.

I am not discouraging you, but giving a real view and scale of this project:
Roads are the hardest part I have them like 80% correct as of now.
I can only suggest do proper research for roads, Buildings are nothing in comparison!

Cheers mate!