hckrnws
> 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
I had never considered there is a difference between the two words, but Wikipedia backs it up:
> The word street is still sometimes used informally as a synonym for road, but city residents and urban planners draw a significant modern distinction: a road's main function is transportation, while streets facilitate public interaction.
Even with this clarification, though, I think you unfairly characterise the quote from the article. Modern society has an insane demand for transportation. Roads – the medium on which we transport things – are the fabric on which cities are built. Not just inside the cities, but the vast network of roads outside the city, that feed it.
Before the 1900s, we weren't able to build cities far from water because of their demand for transportation. We can today, and it is only because of roads we are able to do that.
I think American society is very much road-focussed, having lived there for a couple of decades. I think UK (and European in general) society is very much street-focussed.
A lot of that comes down to geography - the UK is a high-density population compared to the USA but the impact on our lives is significant. In the US, I would drive everywhere. Literally everywhere - to the shops, to the library, to the beach, everywhere. Yesterday I took my son to his archery practice, we walked along the coast road for about 20 minutes, and picked up a "Mr Whippy" 99er ice-cream (yes, even in the cold weather) along the walk back. It was pleasant, and healthier.
This may be true, but I think the points made in the comment you are responding to are nevertheless true for UK and European cities as well. Roads have been a fundamental part of the development of modern towns and cities throughout the Western world.
USA cities are low density because they are road–focused
The United States emerged during a period of abundant frontier land, which normalized the idea that ordinary people could own large, independent plots. This contrasted sharply with Europe’s older, land-constrained settlement patterns. That early culture of space and ownership later interacted with industrialization, the automobile, and government policy to produce the low-density development that characterizes much of the U.S. today.
Another interesting fact about plot sizes in Europe: You can see within an area which kind of inheritance law was in place: If farming plots are large, usually the oldest son inherited everything. If they are small, they were evenly distributed.
Source: https://www.sciencedirect.com/science/article/pii/S026483772...
When you go into the Northeast, a lot of narrower roads were planned for slow-moving horse-drawn carts.
Exactly go Worcester, Providence and Boston and be in awe at how fucking horrendous the maze is.
Boston is only horrendous in a car. Walking around and taking public transit in Boston is very nice. OTOH Providence feels like it's designed for cars, much easier to drive there but always need the car around and their highways and roads are terrible. There's a ton of highway to split the city. Worcester is less highway constricted but still definitely need a car to get around and I still can't figure my way around.
The vast, _vast_ majority of such infrastructure was turn down in the 60s to make way for the almighty automobile.
The number of places in the north american continent that retain their street focused infrastructure is pretty much countable on one hand, and most of that is being terribly managed.
Horse-drawn carts are not any narrower than cars are, and many place (e.g., the Marina District of San Francisco) designed in the horse era have very wide streets.
Pretty much any car that's bigger than a subcompact is wider than a horse drawn cart.
Yeah, maybe I'm overly pedantic, but the author is also overly pedantic about the curvatures of streets/roads in games, so... :)
But, to continue with the pedantry: the Romans already built cities far from (navigable) water. There have been roads since antiquity, then since the mid 19th century it was first the railways that made it easy to transport passengers and goods over large distances. The current version of roads being the main/only form of transportation only came about in the 1950s.
Slight correction: It was the 1830s when the railroad arrived that we started to be able to build cities far from navigable water. (navigable is important - if your water can only support small boats your city will be smaller than if it can support large ships). Trucks in the 1900s allow the same thing, and have enough advantages that we would use them for smaller cities, but large cities are still going to get rail transportation. And water transport is still powerful enough that the largest cities still likely need it even though it isn't a strict requirement.
>Modern society has an insane demand for transportation. Roads – the medium on which we transport things
Why do you say it like roads are the only option? Its even far from the most effective option. You mean rails?
Comment was deleted :(
Railroads are roads.
Only by name.
rail-roads
is in the name mon ami
Not in other languages. In German, for example, it would very weird to think of railroads (Bahn/Eisenbahn/Bahnstrecke) as roads (Straßen). Would you also claim that a hedgehog is a pig?
> Before the 1900s, we weren't able to build cities far from water because of their demand for transportation.
Incorrect.
In the 1800s the train took off as a primary form of transportation. By 1869, we'd completed the first intercontinental railway in the US which ultimately opened up the economy between the east and west.
Sears flourished as a company because of the train.
It wasn't roads which ultimately opened up mass transport, it was rail. It wasn't until the 1950s that rail was ultimately de-prioritized and roads were prioritized.
I hope the water comes to the city through a pipe and not with trucks on roads.
I believe they have referred to the transportation possibilities the water allows rather than the possibility to transport water (which was possible at scale way earlier)
We finally have water–powered cars?
Roads are important for a good transportation infrastructure. However, cities in north america are overreliant on them. In European cities public transit is also important and in my opinion even more important than roads. Cars are not useful in cities compared to public transit / bikes / walking if the city is designed for humans and not cars. ( and yes, you still need roads for delivery and people who sometimes have to transport heavy things).
There is a lot more than people to move around a city. Transit is more visible and yes europe does well there - but freight is less visible and europe isn't doing as well there.
> Modern society has an insane demand for transportation. Roads – the medium on which we transport things – are the fabric on which cities are built. Not just inside the cities, but the vast network of roads outside the city, that feed it.
This is a very American point of view IMO.
Cities are built on streets first and foremost. Otherwise you end up with strip malls separated by endless swaths of car parks.
As for transportation, we have to separate cargo from people, and inner city from inter-city.
For people inside the city you have multi-modal transport options. Walking, biking, busses, trams, subways, commuter trains, taxis, individual cars, ferries.
For intercity people you have trains, planes, boats, busses, individual cars.
Most inner city cargo can be handled by smaller trucks going from warehouses to specific places in the city. And for smaller cargo like mail I've even seen small scooters and cargo bikes.
For inter-city you once again have multi-modal transport (depending on the city). Trucks, rail, cargo planes, boats.
Even the US was built on railways, not on roads. Roads are the "backbone of cities" only if you make them one, as the US has done
The same insights still hold true for streets and paths. Of course a single human or even bicycle can move with fewer constraints than a car, but a stream of humans won't. When we design pedestrian infrastructure with sharp corners people either cut through on the inside, creating desire paths on unpaved surface, or the inside section that lies on the paved path but outside the circle-section-path becomes a low-traffic zone, a place where people sit down or put up food carts or whatever
In remembering that cities are not roads alone, but also streets, paths and tracks, there is a lot of potential for this approach to building all of them
Yep, good point. I am myself a huge fan of livable oriented infrastructure (bike lanes, pedestrian paths, public transportation) but the hard truth is that roads were initially designed for carriages and later for cars. A though I recurrently have is how would a city designed from scratch by a civilization that uses only bikes and walking look like?
Why should you use only bikes and walking? Cars/trucks have a role to play, it's just not the most efficient to move the majority of the people from one point to another. Simple examples: ambulances, firefighters, police, cranes.
True. I mostly meant not personal vehicles, so jut buses, trams etc. I supposed emergency services will use those dedicated lanes. or maybe civilization is so advanced those will be served via flying only. Idk just since fiction thinking.
I will just say the Streets of San Francisco were almost all built by civil engineering principles, even those from the 19th century. If you want some sim SF or NYC, this guy is on the right track by not having fakey roads.
Urban planners lose sleep over stroads for very good reasons but from a simulation and tooling perspective, streets still need a shared geometric backbone
I don't think that much is shared between streets and roads. Roads need all the details about curvature in the article so car traffic flows efficiently. Compare that to the beautiful but narrow streets of a Mediterranean town. Buildings are rarely parallel, angles are odd, but everything is on a human scale, and it just feels good to walk around.
>You see, the shapes of roads in real life come from an underlying essential fact: the wheel axles of a vehicle. No matter how you drive a car, the distance between the left and right wheels remains constant. You can notice this in tyre tracks in snow or sand. Two perfectly parallel paths, always the same distance apart maintaining a consistent curved shape.
Emphasis mine - that's not really true
- Cars have differentials, so the wheel speed can differ between wheels
- Steering geometry isn't parallel! The tyres turn a different amount when you turn the wheel
- Unless you're going in a straight line, cars don't go where the tyres point! Tyres 'pull' the car towards their slip angle
What you will actually see in tracks in snow or sand is non-parallel tracks, describing curves of different radii. You can also see this in racetracks, where the path more closely resembles the limits of car physics without care for passenger comfort or tyre wear. The example 'fail' image looks not dissimilar from a hairpin turn.
Author here: i agree the article oversimplified here and in practice vehicle tracks can sometimes be non concentric. But it has nothing to do with differentials. Differentials just allow wheels to rotate at different speeds (as perimeter of a smaller radius circle is smaller the outer one). Non parallelism usually comes from the Ackerman steering or slipping. But rear tracks of a vehicle going slowly through sand will always be concentric. Parallelism is important for engineers because it also allows multiple vehicles to go in parallel on a multi lane road. You can see how that is failing with bezier paths in the CS2 ss in the article. Also hairpin turns are usually designed with arcs in mind as well
Railroad cars don't have differentials and travel on parallel tracks. How?
https://www.reddit.com/r/Skookum/comments/47sbri/richard_fey...
For those that don't read the link, by having conical wheels.
See https://www.thecontactpatch.com/ for some interesting reading material related to that.
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.
Hello, I am the creator of this road system. The thing is that I myself don't even know what I want to do with it. lol. Maybe an asset or a game (a bit scared to jump in a full fledge game to be honest).
I am a fun of Junxions my self which follow closely. But the approach in my system if very different. Junxions creator uses the same kind of node base/bezier shapes paradigm where intersections happen as node graphs and not automatically as collisions between road segments. It's hard to explain but I am planning to dive into more details on why those two approaches are different in my next blog deep dive.
> The thing is that I myself don't even know what I want to do with it.
Embrace the next challenge: Instead of roads on parabolic (Euclidean) geometry, have roads on elliptic (non-Euclidean) geometry, like the surface of a sphere. Plus, on a sphere every line is already a circular arc anyway (no matter if straight or bent, the difference is just the center, radius and normals). Thus, this system of circular arc segments really lends itself to such a space.
Little prince style micro planets with their own miniature infrastructure will always have a special place in my heart. Half a year ago I started with laying out the basics https://github.com/Lichtso/bevy_ellipsoid_billboard https://github.com/Lichtso/bevy_geodesic_grid but got distracted by fixing some engine bugs in Bevy along the way. That reminds me I have to update to the newest engine version ...
anyway you can find some of the roads on spheres stuff here: https://github.com/Lichtso/bevy_geodesic_grid/blob/main/src/... it can not only generate the extrusion mesh but also calculate how the mesh overlaps with a geodesic grid of triangular tiles on the surface.
Go full science fiction and enable vertical or even upside-down roads for a 3D experience. :-)
Imagine an environment where ground/walls/ceilings always have gravity and one can build literal city mazes in horizontal and vertical directions. All that traffic going everywhere, oh my..
Sounds pretty fun! Do you have any screenshots to show?
Thanks for references! I initially considered bevy for this but I was a bit scared it was not mature enough. How do you find it now?
Really depends: In some areas it is quite advanced (rendering) and in others it is lacking / underdeveloped (editors / tooling). But there is an incredible amount of progress and also churn in keeping up with that.
If someone just wants to zen out building perfect merges, Junxions looks great. If someone wants to fight Bezier math demons at 2am because offset curves keep exploding… this article probably hits closer to home
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.
Another area of hidden complexity is doors in video games. Almost no game has life sized doors because they introduce gameplay issues, almost all doors in video games are at least 30% bigger than in real life and you see an overabundance of sliding doors vs swinging doors because of the complexity swinging doors bring to video game physics.
https://lizengland.com/blog/the-door-problem/
https://www.ign.com/articles/putting-doors-in-video-games-is...
This was also confirmed by a Valve developer recently about a bug in HL2:
Also in their VR titles Valve made all doors swing in both directions because that feels more natural to players when there is no haptic feedback from not being able to push open a door.
The scale difference mentioned in gp isn't just doors though but any structure you can pass through. Many games houses with larger interiors than exteriors and video game ventilation ducts are comically large.
That's an impressive bug hunt. Same code, different behavior. I can't imagine how much time the guy spent on finding this one. And how much satisfaction once he finally nailed it.
Ah yeah, this is actually part of why I never complete games.. I spend so much time messing around looking at all the cool little details, exploring the environment and generally "experiencing the place" moreso that pursuing game mechanics or completing levels/quests/etc. ... some of my favorite games, I've played probably like 1/4 of lol
> 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.
I have a small list of these things in game dev. Over the years, I found some games that were more playable (in my opinion) than I thought they deserved to be. Kind of like a well written book with a bad story.
For me at least, the number one most important thing is how well the character -- person, car, spaceship, whatever -- moves. Does it handle well, as expected. I'm at the point where I think this may be the single most important aspect of a game that finds itself in a competitive space.
I think blizzard stands out for this with Overwatch and World of Warcraft. They avoid the jerky start and stops with their characters. Their characters feel both performant and natural at the same time, adhering to reality but breaking physics as necessary (air strafing for example).
Building out roads correctly feels like an offshoot of this for games which include cars. A car should be able to navigate a turn without going through weird contortions as it hits pinch points, or unnatural wiggles when roads join.
I absolutely love how Skyrim's world is built. A lot of details that would fly past most players' attention are quite thought through. How roads connect, where do rivers intersect, where do lakes get their water from, in which direction do they flow etc.
Yep, the most impressive work in games is the stuff players never consciously think about
This is interesting, I look forward to reading more. But I think it’s wrong, if you want to represent reality.
Real cities were all built in the past, for older vehicles, which moved at different speeds, and were controlled by drivers with different goals from today’s drivers.
So, if your game has bad and unsafe road designs, which have been partly retrofitted to reduce the worst problems, then that is accurate.
A game with optimal roads is not an accurate simulation of reality.
A professional modern road designer will simulate the expected movement of vehicles through a new or redesigned road, to try to discover major problems.
They look for problems with turning radius, visibility, stopping distances, and interactions with other road users.
I believe that a game designer could offer to do the same.
The game could draw a good algorithmic road shape first. But next offer the player an option to run a simulation of individual traffic movements, to discover serious issues, and let the player know about problems.
To the OP, I suggest this simulation approach, not trying to discover flawless algorithms. That’s not how it happens in the real world.
Several comments have suggested similar issues.
That sounds more like a traffic simulation tool rather than a game.
Simulation games are very popular these days.
Articles like these are the reason I continue to check hackernews.
Author please keep writing.
For sure I will. Thanks a lot for your interest. To anybody's disappointment, I didn't even know Hacker News was a thing until I saw a ton of traffic coming from it. But I guess I'll be more active here since there are a lot of like-minded people.
People who made tools that generate roads using circular arc spines unite: https://devforum.roblox.com/t/new-geomtools-plugin-quickroad...
Hackernews is notorious for causing outages when a link to a self hosted site trends.
Beware if you post article's in there.
I also do graphic processing and now with ML, contact me if you ever want to share though, contact via my profile
> Hackernews is notorious for causing outages when a link to a self hosted site trends.
This made me briefly nostalgic for the old glory days of Slashdot, which is the first place I recall that would cause the "hug of death".
I believe the hug of death is Reddit, Slashdot was slashdotted.
/. affect was a real thing for sure. I'm not sure it happens much on HN.
My guess is a combination of tech being better and HN having lower volume vs peak /. (before digg&reddit).
[dead]
"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%!
Once you do care, there's no going back
In 3D games, something that's key for roads to look/feel realistic is to have small amounts of banking here and there all over the place - as opposed to just having a crude categorisation where there are flat roads on one hand and ramps on the other.
If you don't do that then large parts of the game world end up seeming like ice rinks with roads painted on them.
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...
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.
The romans did care about property lines! Romes’ second aqueduct was held up when land owner Crassus refused to give up private land for its construction. Check out the article for a fascinating read: https://en.wikipedia.org/wiki/Roman_aqueduct
What an ugly attitude for the landowner to have held. There should be a word for that.
In my area, streets are often church tower to church tower. From the middle ages. You can nowadays drive these streets and the middle line indicators align perfectly with the church tower showing up. I think the church /church based government share that property right understanding of the Romans :)
In my early days someone told me generating roads is a non-trivial problem and I thought that was bollocks so I spent 4 months smashing my head against a wall to prove them wrong!
>A clothoid gradually increases curvature over distance.
This seems complete overkill? I remember smoothing between tangents of two circles to mostly solve roundabouts. I had to cheat for 3+ lane roundabouts but it worked for any semi-realistic road.
>Just simple rules stacking on each other that result in beautiful patterns. I can’t explain why, but seeing those structures always felt good.
I think in 2026 it's safe to blame your autism. I do. Nobody likes Factorio because it's a good game. We're here for the lines and grids.
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.
Very happy reading this because I was always thinking exactly the same about historical games. One of my turn offs for any historical city building is when they are grid based. I always found that to be highly unrealistic, but I yeah, was aware that it was just some unneeded complexity and just my nerdy nitpicks. The point you make would’ve actually been a strong argument in my article. Too bad I didn’t have the inspiration to include it. The way historical cities developed in an ordered yet intricate way without any central planning (same as ant colonies) is actually very fascinating and I might write about this at some point.
Regarding modern roadways and viaducts that pass around medieval city cores, it's fascinating how they can be seen and still not seen. I tried to do this in Cities Skylines II for awhile, building very narrow streets in "organic" city centers with low-to-mid density, and then transitioning to a new city grid around the old center. Finally, superimposing highways and tunnels without destroying the original historical core. There were some beautiful results, but the traffic jams were astounding, even with limits on the city center roads and highway exits. This is the way cities actually grew, so to me it's much more interesting to simulate than a "perfect" city built all at once. One thing that was fun in SimCity 3000 was that certain technologies didn't become available until you had a certain population. I would almost wish that a city-builder now would allow you to take that to the extreme: Spend 200 years with horse-drawn carts before you can pave a road, and then figure out what to do with the mess. But more than anything: Oddly shaped buildings that fit into oddly shaped lots, which are not limited to hotdog stands.
Haha. I myself tried to play CS like that. Start with a historical core. The thing is the way the game is implemented buildings only have rectangular footprints while in reality buildings occupy the spaces more organically. I actually spent quite some time on google maps trying to see what pattern historical buildings followed to fill in spaces but couldn't get a definitive answer. I drafted it at some point in sketchup. Here is the result
https://imgur.com/a/procedurally-generated-buildings-that-or...
Yes, I don't even know how I didn't know about this at the time of wiring the article. But a must read for sure!
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...)
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.
Comment was deleted :(
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.
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.
One game that had a different perspective (first person mmo), but a fun network of road building in a simulated wilderness .. Wurm Online
Not just roads! I made a small train game for a game jam, and I used splines for the tracks to get them done quickly. It did the job, but they looked wrong to me. So I revisited it a few weeks later and looked into arcs and clothoids as well. I replaced the splines with some basic code using arc and the result looked so much better.
I have never seen a Texas style mixmaster, or stack exchange, in a game. Here is an irregular example:
I think one of the reasons is space. Games tend to pack things in a pretty dense interface, quite often because it seems more exciting that way, and keeps the map size reasonable.
These things are absolutely huge pieces of infrastructure that can take the space of dozens to hundreds of buildings.
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...
Love these deep dives—perfect HN fodder. Add to that articles like this also on the front page today: "Algorithmically Finding the Longest Line of Sight on Earth," "Tesselation Kit"…
HN, keep being HN! We love you.
> 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.
Glad you mentioned it. Cubic parabolas were actually used by eraly railway engineers as good approximations of clothoids back when numerically solving a true euler spiral was a daunting task.
They are visually very close because their curvature increseases approximately linearly along the curve but not exactly. Mathematically speaking if you wirte the cubic parabola as something like y = kx^3, the second derivative (which give the curvature) grows linearly with x which makes it behave similary in gentle transitions.
The problem is that the second derivative is not enough alone for having a true smooth curvature. The real curvature formula has in the denominator the first derivative as well (slope) making it not increase perfectly linearly along the curve. (denominator becomes larger and larger as x incrases)
But yeah, cubic parabola is basaically a good enough approximation. Might be a good solution for a system like this.
Comment was deleted :(
I don't agree that the clothoid is a math nightmare. One of the central problems you have to solve for roads is the offset curve. And a clothoid is extremely unusual in that its offset curve has a clean analytic solution. This won't be the case for the cubic parabola (which is really just a special case of the cubic Bézier).
Sure, you have to have some facility with math to use clothoids, but I think the only other curve that will actually be simpler is circular arcs.
I mean they are not a math nightmare per se if you’re comfortable with the theory. What I meant is that they become comparatively complex to integrate into a system like this. Think about arc length, compute intersections, reparametrization, etc., and with clothoids that usually means some complex numerical algorithms.
Using circular arcs or even simple third-degree polynomials (like cubic parabolas) reduces many of those operations to trivial O(1) function calls, which makes them much cheaper to evaluate and manipulate procedurally, especially when you're computing it 60 times per frame
You might be familiar with these, but GP wrote a couple of excellent pieces on Euler spirals:
https://raphlinus.github.io/curves/2021/02/19/parallel-curve...
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.
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/
Super dumb question but if you have one railway line on the left splitting into two on the right: if you extended the clothoids of the two back to the left past the junction, would their wave patterns intersect each other again? What happens if you take the further left cross intersections and then split to the right from there along bezier curves to two points matching the x+ of the original intersection and an arbitrary y-/y+ where the further-back (left) waves intersected? Purely spitballing but is there a way you could use the previous two points where the ripples crossed before the point of the junction, and interpolate splines from there?
Bad/quick visual: https://pasteboard.co/5QgDdTVVSm1I.png
Wow, that’s a really detailed deep dive, saved it for a read later. I didn’t even realize clothoids are also tricky to connect. I never really dared to jump into actually implementing them myself.
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.
This is why I like Dutch road design, there's a legally required minimum (I think it's 200m, but 300m is more common) for onramps, and we are taught not to merge before you've reached the maximum speed on the road you're merging too, so that you cause minimal disturbance to the traffic currently there. (Think like a zipper.)
I live near the border with Germany, and these guys are used to short ramps and so just merge well below the speed other traffic are going, expecting others to yield. (And many locals also drive like that unfortunately.) So uncivilized.
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.
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.
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.
You can find in developer notes for city sims that sometimes they've tried to keep sizes of roads and parking lots to scale, and then they realize it's all low density and uninteresting, kind of like real aerial photography of a typical US city.
So the difference in scale between real life and the sims is 100% on purpose, as more realism makes the game worse. Just like they don't ask for a long permitting system for anything to get built, or demand a decade of discussion and probable lawsuits before you can move move a road, or rebuild an intersection.
Having played many city building games though I’ve always desired more depth and realism. Like the more I play them the more I want out of them. I wish power lines were limited in capacity and had to be stepped up and down via transformers (Workers & Resources does this) I wish I could make decisions about every intersection and every lane (cities skyline mods allow this) etc. Anyway I think there’s an audience for more realistic games in general, even if most people would find them less fun.
At a certain point these simulators would be so intense that your joy for the game could be your joy for real employment in a city :)
The statement reversed, you might loose your joy because working in the game is no longer fun.
I get you but just want to say: careful what you wish for :)
I regularly drive what I thought of as a quite winding road. Visitors drive it cautiously. It was funny one time looking at the satellite view and thinking "Wait, where is the tight bendy section?" Everything looked like very gentle curves; probably closer to straight lines.
Streets ahead
Everyone is raving about this article. It feels so much like a tease to me. Maybe I'm just impatient idk.
I'm with you. I hope that the other posts will also pop up here.
Nope, most players won't consciously care but systems built on the right constraints tend to feel right even when you don't know why
"if it looks good, it flies good" (or s/good/right/g) is an old aviation adage about aircraft
If you liked this you'll love playing mini motorways (available in many platforms including mobile/ipad)
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
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.
I am a huge fan of satisfactory as well (probably no surprise for anyone)
>Does everything I just rambled about matter? Do 99% of city-builder players care what shape the corner radius of the intersection has? Most likely, no. Then why bother?
To me, yes, then again I may end up with a basement full of model trains when I'm old.
Still annoys me to no end when the game model builds something unrealistic and would be an absolute traffic nightmare in the real world.
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 corner radius discussed in the article is utopian and also only works in street layouts that prioritize car driveability over everything else.
A "properly rounded corner" at an intersection as alluded in the article is one that's great for cars (as they don't have to slow down much or have a tight turn. However, they are awful as pedestrian crossings if you want to do a double crossing, as you have to traverse additional distance. They are also much more space-inefficient, which isn't viable in a densely built urban environment.
Always thought some streets in city builders just are a bit tooooo off :D
Very nice article - good read !
[Adds “clothoid” to vocabulary]
The tech seems really cool, but the road showed in the examples is not any less insane, like, why?
Their animated gif at the very end of their own tech seems very sane?
I wish they'd actually shown more/talked about it though.
Will share more soon. I have some more recordings of it on x https://x.com/SandboxSpirit if you're interested.
That's the point? Even though they are complex, the improved roads all use circular arcs which guarantee a baseline of good drivability.
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.
MKAD, the 101km circle road around Moscow had almost exclusively this style of intersections up until 2010s, when congestion got absolutely unbearable. Then all of them got rebuilt, typically adding overhead ramps, tunnels, and crazy-long but separate right lines, and by now it's almost impossible to navigate w/o gps navigator (which gets jammed often). Also forget about easily changing direction.
Results can be seen on f.ex https://www.openstreetmap.org/#map=16/55.88242/37.72732
Damn, this is pretty interesting that they had to add the additional bridges.
Does that imply that the merge of two lanes is still too costly?
Also it seems the lane from south east to south west is missing :D it's somehow routed via north first and then goes around the circle.
> Does that imply that the merge of two lanes is still too costly?
Yes.
This one https://www.openstreetmap.org/#map=16/55.88495/37.47959 was built from scratch not very long ago. Notice how merges/splits are spread as far as possible.
Cool - now make it into a mod for cities skyline :)
Minecraft
Daniel
Very disappointed that this article ends just before it starts to get into anything concrete and interesting—I'm working on solving (a simplified subset of) very similar problems for a game I'm working on, and would love to learn more about the author's approach!
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.
> 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.
That's because SimCity is not a tool for preaching your personal opinions of what makes "more livable cities" to people who more often than not want to design semi-realistic, typical cities in an entertaining strategy game.
If you want to make your perfect city builder, go ahead, it's easier than ever now for somebody to create a game. Just don't expect everybody else to share your view of "aspirational", more so if you actively punish traditional city structures.
OP must of hit a nerve here but In games like city skylines a big difficulty of large cities built in the game is handling car traffic. A lot of which is solved by public transport, walking paths and other "apirational" city structures that are hard to realize in real life. I've watched alot of fun videos on youTube of a certain youtuber apply these techniques to other people's saves to great success. It's honestly a fun challenge to solve.
> to people who more often than not want to design semi-realistic, typical cities in an entertaining strategy game.[...] more so if you actively punish traditional city structures.
What you call "typical" and "traditional" is not in any way universal.
Or you haven't travelled a lot.
[flagged]
I live in the United Kingdom. I have never once stepped foot in North America.
[flagged]
Please don't cross into personal attack. The idea is to abstain from that here.
That is an interesting interpretation of my question.
Notice how in the continued thread after receiving confirmation that they were not just making up a story as many do, or otherwise living in an area of the UK that is not GMT, I immediately switched to asking for confirmation about their point about simcity.
Could you help me understand how digging is personal attacks?
Your comment implied that the other person was lying.
Ah. I’m not sure I understand how that is considered a personal attack. Especially when I see others calling each others messages AI slop with no recourse. Perhaps people just don’t flag those comments because they agree, whereas people flagged my message because they didn’t.
I have great respect for what you and now also Tom provide to the community, so I don’t believe I have much ground to argue from. So I will just say as I do not understand the application of this rule, I may potentially run afoul of it again in the future. Please understand it won’t be out of disrespect, simply out of ignorance and a need to grow my definition of what a personal attack is one instance at a time until it aligns with your views.
My sleep schedule varies from week to week depending on whatever miscellaneous project is sucking up all my attention (with some constants). It's hard to stay on a strict schedule once I've gotten into "the flow".
Ok so do you feel strongly then that simcity is representative of civil engineering in the UK?
No, but SimCity (and most games) are designed for a primarily American audience by American developers and are "build-from-scratch" games. I feel a game for designing UK cities would be much harder to design, especially because most cities in the UK are the way they are because of historical restrictions while the United States and Canada were unburdened by this.
You're making his point! It's a city builder, not a long-established-city-transformer.
There are plenty of “chill and peaceful” city and town builders that trade realism for prettier, more idealized places.
In more simulation-focused games, cycling and walking paths are often available, and you can use them, but they come with many of the same constraints they face in the real world. In practice, that means they are usually not efficient as the primary way to move large numbers of people across a large city.
Reading your comment, it sounds like you want a game that is realistic in most respects, but treats transportation differently, in a way that makes your preferred options the optimal strategy. That is going to be hard to find, since transportation is a core part of city-building sims, and developers tend to pick either realism or a more utopian/fantasy model rather than mixing both in a single game.
That's not what I want at all. I want a more realistic sim that deals with issues such as sprawl, food deserts, transportation elasticity of demand, mental health issues (and their impact on crime and productivity), and a network-flow theoretical model of transportation and commuting contributes to all this. Building a bunch of sprawling suburbs that feed into a dense downtown core should make your citizens' commute times shoot way up and lead to misery.
A well-built large city isn't just going to be 100% biking and walking paths, it's going to have streetcars, light rail transit, subways, and buses as well as roads with cars. The difference is that people shouldn't be forced to commute across the entire city to get to work because you decided to cram all of the commercial zoning into one downtown core.
> The difference is that people shouldn't be forced to commute across the entire city to get to work because you decided to cram all of the commercial zoning into one downtown core.
Isn't the point that they should be, if that's how I choose to build a city, and they don't have to be, if you choose to build it otherwise? The entire point of a sandbox city-builder is, I assume, that it's a sandbox, and not a dogmatic interpretation of a childish Reddit meme.
It was pointed out elsewhere in this thread that SimCity already distorts reality in an ideological way: it lets you have tons of traffic without worrying about parking. It just gives you magical free underground parking everywhere that you never have to think about, in order to avoid the usual suburban parking sprawl hellscape.
Car-centric transportation is not efficient. Not remotely. They have absolutely terrible bandwidth, and they balloon the size of cities apart the more you try to increase the speed to bring them closer together.
If you think Simcity and Cities: Skylines are realistic depictions, then ask yourself why Simcity famously has no visible parking whatsoever (or don't: the devs are on record saying they excluded it because it made the cities look terrible, there's no need to speculate here), or ask yourself why Cities: Skyline added car pokeballs (where drivers get out of the car and put the car in their pocket) or straight-up delete cars when traffic gets too heavy.
The original SimCity was perfection - you could build no roads and nothing but rail! ;)
Cities Skylines with all the DLC and the right transportation mods gets pretty “realistic” in that you can build a transit paradise but the car still exists.
> Reading your comment, it sounds like you want a game that is realistic in most respects, but treats transportation differently,
It's the opposite, no? Most city builders cheat to be able to be fun. Like, with the amount of roads one build in Sim City, half the map would have had to been parking lots to account for that amount of traffic. But that's boring gameplay, so they remove that constraint to make a fun game. Aka you never have to deal with the consequences of making your city car dependent.
Edit: See another comment from CalRobert about exactly this.
You have a weird definition of "realism".
[citation needed] that some combination of "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." is not in fact optimal! (For certain objective functions)
Do we really need to jump onto a tangent about evil cars and evil car infrastructure on a post about b-splines and curve sections?
Everything in the article applies equally to trains and rails.
We get enough complaining about evil car-centric city designs on the posts directly about cars thanks.
I think GP is simply identifying a potential popular niche that could be satisfied in a future city builder game, which seems quite on topic.
Those areas aren't better to live in. They're just older parts of older towns so they don't have much wiggle room. The wiggle room was amazing for the more modern countries, except now we wiggle in a different direction too. An equal middle can be seen in Asian cities in Korea and China. They mix high density with high quality of life and little self sacrificing.
Neither US or Europe do living areas well due to their historical constraints.
It's subjective but many of us strongly disagree.
And, of course, the fact that the areas you say "aren't better to live in" also tend to be extremely expensive doesn't make a lot of sense.
Except for gates communities, living cost is mostly a function of closeness to high paying jobs.
I don't think that counters what I wrote? One of the benefits of higher density is having more high paying jobs nearby.
When I played Sim City, I gladly built super-dense neighborhoods with high-rises facing parks, and mass transit, Le Corbusier style. One reason was that they brought in enormous income, another, that they looked cool.
> One of the biggest problems with North American cities is their endless, car-centric suburban sprawl.
Most people consider that a benefit. It's just as livable as anywhere else. Just different.
> It's just as livable as anywhere else
People are totally entitled to like what they like, and that's OK. Everyone has something that works for them, and this world has a great variety of options available but the "car-centric suburban sprawl" is linked to various negative mental and physical health consequences. Negative health consequences, IMO, isn't "just as livable".
As a simple example, when people walk more during commuting instead of drive, they tend to be healthier. There are other more nuance (but studied) impacts, such as increased car accidents, mental impacts from increased isolation, etc. In America, there is even a correlation between how car-centric a community is and how often individuals are willing to seek out healthcare (even when accounting for access and affordability).
If you like living and spending all your day in your car yes.
I don't spend anything close to "all my day" in a car - I'm not sure what the absolutely over-the-top and completely-detached-from-reality, snide hyperbole adds, here.
Well that is certainly how it feels when I am in a city in north america.
A small errand that takes me 5 to 10min in my hometown takes me 45min to 2h in suburbialand. Worse, mutualizing errands do not even reduce the overhead of a single trip because infrastructure is usually made in such a car centric way that it makes it super inconvenient if not downright dangerous to walk from one huge parking lot to another one a couple of blocks away so you are kind of pushed to move your car, sometimes navigate a stupidly long loop to simply turn around and go on the other side of a stroad.
By the end of the day you realize you have barely done anything.
Funnily it makes it worse for both drivers and non drivers.
At home I usually opt to not take the car, not because it would be slow but because in many cases it is silly. It would be too short for the engine to even warmup and I would not have the chance to enjoy some time outside and/or exercise at the same time.
I totally see the impact spending so much time in the car and traffic has on my in law family's stress level and they do complain a lot about it while being seemingly unable to envision a better way of living and push for it at political level. It is also super bad on the security side of things because they often opt to take/make calls while driving for it to not make it time totally lost and aren't just as focused as they should be on the road.
Yeah it's strange how some people think that squeezing people like sardines without any space for personal gardens is supposed to be a good thing. Density in European cities is mostly a historical artifact and something objectively chosen.
Huh, wonder what takes up all the space that could've been parks and gardens (hint: it's made of asphalt)
The creators SimCity itself were aware of the problems you mention. Ever notice how there's no parking lots?
https://humantransit.org/2013/05/how-sim-city-greenwashes-pa...
They were aware of the problem and they covered it up, rather than try to show better ways of living. It’s unintentional propaganda for the crappy ways we build our cities. It’s worse than if they’d just show things how they really are.
this is definitely doable in CS (+mods), search YouTube for "cities skylines European" or something like that.
you need "plop the growables" and "move it" mods at minimum to nudge all the buildings close together.
[dead]
Riverdale [1] is a neighbourhood in Toronto with the kind of higher-density mixed single-family and multi-family homes as well as a few small apartment buildings (but no large apartment buildings) that I had in mind with what I described above. It also happens to be one of the most expensive neighbourhoods in the city which I take as an indication of high demand for the houses there.
Compare that with the sprawl of Vaughan also shown in the video [1].
The houses in Riverdale are way too close together. It looks like some of those people could literally open their window and reach into their neighbor's house!
Maybe for you, but that’s why we should have choices. I think Riverdale is beautiful and I’d love to live there but I can’t afford it because the place is in such high demand. It’s illegal to build more Riverdales even though they’d satisfy a lot more demand due to their higher density. All we can build is more sprawl because your complaint was made the law of the land.
Well according to some people there is a loneliness epidemic in north america. What do you want guys? make up your minds! ;-)
Cars and their infrastructure take up a ton of space which could in theory be used by actual people.
In practice that space ends up being used to cram in more people rather than giving people more living space.
[flagged]
Please don't post like this here.
Crafted by Rajat
Source Code