One may also be interested in Egregoria (https://github.com/Uriopass/Egregoria). This is a 3D city builder written in Rust, with particular attention to roads. I have never used the project (because it would not be useful for what I usually do), but I have been following its development at the beginning and I think it is quite cool stuff.
The author might get a kick out of an upcoming game called Junxions, which is a sandbox game to just do that... create road junctions.
The subreddit is here: https://www.reddit.com/r/Junxions/
Sure they teased that they've made their own solution, but I think Junxions should scratch the itch of most of us here interested in this kind of game.
Excellent, I’ll look back at it when I find time to progress on my own pet project of custom numeral notation.
Specification: each cipher from 0 to 9 is using n+1 stroke, using only horizontal, vertical or left-bottom to right-top orientations. They also have distinctive traits that let them be identified even with only the very top or very bottom part. So 0 looks like / for example.
I also went above base 10 and made enough glyph to cover a sexagesimal base. The constraints on the drawing are then looser, so to go up to 20 we had a single "\". Incidentally and funnily enough that makes the 10th glyph look like a X. Then to get up to 40 glyphs, we simply square the 20 previous ones. And the plan to reach the 60 glyphs is to have a circled variation.
I’m not versed in the art of font crafting, but I would love to find someone to work in common on that one.
Here is a draft with the first steps for those interested:
https://commons.wikimedia.org/wiki/File:Alternative_cipher_n...
"Do 99% of city-builder players care what shape the corner radius of the intersection has? Most likely, no."
Finally, I am part of the 1%!
There's so many things in games that are taken for granted at play time but which actually take a lot of thinking and work to get right. Roads for instance aren't something which your typical player will look too closely at... but they will notice if they look or behave in a way that seems wrong.
I've been playing Kingdom Come 2 of late, and I find it's natural to just kind of take the world they've created for granted - just like we do the real world. But when you actually stop and look you have to consider that every one of the finely crafted details was built by someone's sweat and tears, be it artists, programmers, or designers at edit time.
No wonder it's an industry of crunch, the work involved can be uniquely daunting.
Articles like these are the reason I continue to check hackernews.
Author please keep writing.
Bézier curves - specifically for things like roads where you want a single definition of the road/path and an extended image that obeys that path, turning it into a pair of offset-béziers aren't the easiest thing to work with. They collapse to a visually unattractive solution at extreme boundary conditions (such as a tight turn)
You can see it in one of his examples where the bézier curve has an inflexion point which crosses over itself on a sharp bend. I ran into this while writing Azoth [1] last year, when wanting to be able to overlay paths with blending into the background at the sides, and curving around existing features on a game map. To solve the problem, I simplified it, and there's an (animated) example of how I got it working here [2]
[1] https://github.com/ThrudTheBarbarian/Azoth
[2] https://github.com/ThrudTheBarbarian/Azoth/blob/main/Documen...
Ahhh.. this is a writer after my own heart. Absolutely brilliant write-up. I had the same obsession with roads, from SimCity onward; they're the circulatory system of any city, and never in the history of cities or the history of circulatory systems have the vessels been straight lines. The streets of a European or Asian village usually tell a story about how roads were built over the fastest footpath from the outskirts to the center, then over time amended to go around some buildings that were built in the way. Whereas roads in rural parts where I come from run in long straight lines and then suddenly swerve to get around a piece of land that a farmer wouldn't sell. But grids only exist in some parts of the few cities that were built mostly by colonial powers, or developed later with master planning. And even those grids usually split from their original orientation to becoming north-south at some point in in the city's development, leading to the interesting downtown triangle blocks of cities like Portland, San Francisco, Los Angeles, Seattle, New York. Other cities started to grid around their core footpath villages, like Madrid, Barcelona.
The cities I find the most interesting (for roads) are the ones which kept gridding out in new directions to follow the course of a river. Cities like Buenos Aires, New Orleans, and Saigon, where the original paths followed curves around the river bends, resulting in multiple intersecting grids.
The intersections and division boulevards between grids are, of course, the most beautiful and architecturally interesting parts of any city. They are where the blocks are strangely shaped and the buildings can't be rectangular, and usually where every inch of land is at a premium as well. It would be nice if a city-builder could simulate that aspect of urban growth: The shift from village center to grid, and old grid to new grid.
As a German, pretty much all of the intersections shown in the article trigger me quite a bit. In Germany, there's a standardized Autobahnkreuz [1] most of the time. If it's a construction site or an incompleted Autobahn intersection, it's usually called Autobahndreieck (and not -kreuz) on the signs.
This way, all drivers can already sort themselves onto the matching lanes without even having seen the signs yet.
The standardized Autobahnkreuz also has always identical ways to change directions, where the left lane leaving the highway is made for change in opposite direction or for turnarounds. So if you took the wrong exit, you can always save yourself by just driving that lane 3 times across the bridge.
If the traffic increases over time, usually the right exit lanes are doubled and that fixes the problem.
Rarely though there's different setups like around the A61 and A67 where the traffic around and towards Frankfurt city / airport is too huge for that system.
Be like the Romans - make them all straight lines :-)
Of course the Romans didn't give a shit who's property rights they might be violating. I live in Lincolnshire UK, where Roman roads are still used. The last one that got changed was years ago when they had to put a kink in Ermine Street (now the A15) at RAF Scampton when they extended the runway to accommodate Vulcan bombers.
In my next game, Canalpunk, I'm planning to keep with bezier splines. The self intersection of the paths will make the disaster system more interesting.
Thank you very much... Ineffably magnificent, as always...
Related: https://www.pushing-pixels.org/2014/04/04/the-craft-of-scree... (The craft of screen graphics and movie user interfaces - interview with Jorge Almeida...)
I’ve been kinda obsessed with getting clothoids to work in a railway track editor. It’s easy enough to build out of clothoids into empty space, but connecting tracks is where it gets really hard.
For now all I have to share is this explainer I made some years ago: https://xixixao.github.io/euler-spiral-explanation/
I studied urban planning back in the university and one of the classes was road design. Though I forgot most, one part of the class was about how to design roads with curves that's safe for cars. This post just brought that memory back to me.
I was fascinated by them since reading a guide for Cities: Skylines that said that roads were like trees. There's a trunk that moves large amounts of nutrients and little branches that distribute the nutrients to the leaves. Such simple rules, but such complex and deterministic results.
Now imagine a city where there is no human driven transport: pedestrians, bicyclists, and automated vehicles exist in different constructs above and below ground and never cross each other’s path completely negating the inherent risks. No roads. No parking. Just fluid, cohesive movement.
At some point I Google Maps was using Bézier curves for roads, but then they started approximating even roundabouts with polylines, and this looks unbelievably clunky.
Some manager at Google should have gotten an appraisal for removing proper curves from Maps, because... who cares, they do not need them on US streets.
The bit about the clothoid finally made me understand the odd shape of highway junctions. I always wondered why they want me to enter turns fast and then slow down progressively until the turn becomes a new straight. Unfortunately sometimes that straight is the highway, and they should give us plenty of space to build up speed and match the traffic inside the highway. Sometimes they do, sometimes they don't.
My version of OP's roads problem is blob autotiling - how tiles connect to their neighbors. 256 possible neighbor combinations reduce to 47 valid patterns once you realize corners only matter when both adjacent edges are present. You paint a semantic type like "wall", the system resolves the right tile from those 47 patterns - but painting one tile cascades outward, neighbors re-resolve, which triggers their neighbors, and you're tracking stale state to keep it all consistent. Same underlying problem as road segments affecting connected intersections.
I've been trying to make this as easy as possible for non technical people to draw terrain in craftmygame (the game engine I'm building) here's what the terrain painting looks like in the editor so far : https://youtu.be/bFrUYM2t3ZA?si=tw1LqBWR7Uyn08lR&t=37
Timely article for me! I just went through this in my little SimCity remake for MicroPython:
https://github.com/chrisdiana/TinyCity/blob/6c3a7337788655b5...
> And they are also… a math nightmare. Differential geometry. Integrals. Oh my… Which is probably why most games don’t even dare.
Wonder if cubic parabola (used by some railways, and visually near indistinguishable from clothoid) has easier maths.
One game that had a different perspective (first person mmo), but a fun network of road building in a simulated wilderness .. Wurm Online
Can relate the fascination with roads I use to like drawing them loads as a kid. I find Satisfactory the most satisfying for building transport systems (and building generally) your work incorporated into a mod for that would be really cool.
Another aspect of these games is the subtle scale issues that aren’t readily apparent - even the newest biggest city simulators are fractions of the size of a real city.
Road and rail curves are massive and it’s hard to understand just how big they are without having to actually walking them.
Always thought some streets in city builders just are a bit tooooo off :D
Very nice article - good read !
This is a really interesting approach but I'm curious to see how it translates to the actual mesh extrusion, or whatever 3d technique they adopt. It's relatively easy to do this in 2d, it's the 3d solution that accommodates terrain variation that introduces the real explosion of complexity
[Adds “clothoid” to vocabulary]
Everyone is raving about this article. It feels so much like a tease to me. Maybe I'm just impatient idk.
Cool shit!
> Do 99% of city-builder players care what shape the corner radius of the intersection has? Most likely, no.
Maybe not... but out of all the players who care corner radius of roads in games, 99% of them probably are into city-builder!
The tech seems really cool, but the road showed in the examples is not any less insane, like, why?
Daniel
I love SimCity 2000 and these roads look really cool but I'd really like to see a city-builder go in a different direction.
One of the biggest problems with North American cities is their endless, car-centric suburban sprawl. SimCity games may be really fun to play but they seem to reinforce this problem and anyone who grows up playing them will not learn about alternatives for more livable cities.
New Urbanism, traditional neighbourhood design, streetcar suburbs, one-way streets, bike paths, walking paths, mixed-zone walkable villages (light commercial with residential), smaller single-family houses and duplexes, triplexes, houses behind houses. Many of these are older and more traditional techniques to yield higher density neighbourhoods without building up to large apartment buildings.
It would be really cool to see a game that focused more on creating these kinds of realistic and aspirational living spaces instead of the usual cookie-cutter suburbs linked up by huge roads and a large downtown core.
> I think roads lie at the heart of every city builder. It’s the fabric on which cities are built.
To paraphrase the article, this is what urban planners have nightmares about. Roads (as in: things made for cars) aren't the fabric of a city, streets (as in: things made not only for cars, but also for pedestrians, cyclists, public transport etc.) are. See also: https://en.wikipedia.org/wiki/Stroad