Art of Roads in Games (sandboxspirit.com)

568 points by linolevan a day ago

rob74 14 hours ago

> 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

kqr 13 hours ago

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.

spacedcowboy 12 hours ago

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.

NoboruWataya 4 hours ago

direwolf20 10 hours ago

rob74 13 hours ago

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.

bluGill 8 hours ago

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.

fastasucan 12 hours ago

>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?

retired 8 hours ago

red-iron-pine 4 hours ago

cogman10 3 hours ago

> 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.

trinari 13 hours ago

I hope the water comes to the city through a pipe and not with trucks on roads.

fenykep 12 hours ago

S3verin 6 hours ago

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).

bluGill 4 hours ago

troupo 10 hours ago

> 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

wongarsu 11 hours ago

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

Ef996 13 hours ago

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?

vladms 13 hours ago

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.

Ef996 12 hours ago

flomo 13 hours ago

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.

BrtByte 10 hours ago

Urban planners lose sleep over stroads for very good reasons but from a simulation and tooling perspective, streets still need a shared geometric backbone

laci37 7 hours ago

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.

devnullbrain 8 hours ago

>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.

Ef996 5 hours ago

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

JackFr 7 hours ago

Railroad cars don't have differentials and travel on parallel tracks. How?

https://www.reddit.com/r/Skookum/comments/47sbri/richard_fey...

pixl97 4 hours ago

For those that don't read the link, by having conical wheels.

iggldiggl 8 hours ago

See https://www.thecontactpatch.com/ for some interesting reading material related to that.

acherion 17 hours ago

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.

Ef996 14 hours ago

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.

Lichtso 12 hours ago

> 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.

JamesTRexx 4 hours ago

murkt 6 hours ago

Ef996 11 hours ago

BrtByte 10 hours ago

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

abcde666777 18 hours ago

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.

shalmanese 18 hours ago

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...

bestham 15 hours ago

This was also confirmed by a Valve developer recently about a bug in HL2:

https://mastodon.gamedev.place/@TomF/115589925206309168

account42 13 hours ago

yoricm 14 hours ago

amatecha an hour ago

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

LanceH 6 hours ago

> 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.

asimovDev 10 hours ago

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.

BrtByte 10 hours ago

Yep, the most impressive work in games is the stuff players never consciously think about

curiousObject 8 hours ago

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.

nkrisc 5 hours ago

That sounds more like a traffic simulation tool rather than a game.

pixl97 4 hours ago

Simulation games are very popular these days.

hirako2000 18 hours ago

Articles like these are the reason I continue to check hackernews.

Author please keep writing.

Ef996 14 hours ago

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.

stravant 7 hours ago

People who made tools that generate roads using circular arc spines unite: https://devforum.roblox.com/t/new-geomtools-plugin-quickroad...

hirako2000 11 hours ago

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

technothrasher 11 hours ago

Arn_Thor 14 hours ago

"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%!

BrtByte 10 hours ago

Once you do care, there's no going back

frou_dh 6 hours ago

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.

spacedcowboy 13 hours ago

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...

zabzonk 20 hours ago

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.

plomme 15 hours ago

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

closewith 13 hours ago

What an ugly attitude for the landowner to have held. There should be a word for that.

oaiey 15 hours ago

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 :)

Notatheist 11 hours ago

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.

noduerme 15 hours ago

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.

Ef996 14 hours ago

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.

noduerme 12 hours ago

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.

Ef996 12 hours ago

genpfault 19 hours ago

Ef996 13 hours ago

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!

serious_angel 20 hours ago

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...)

vanaur 11 hours ago

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.

muzani 19 hours ago

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.

czheo 18 hours ago

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.

antif 19 hours ago

One game that had a different perspective (first person mmo), but a fun network of road building in a simulated wilderness .. Wurm Online

dandellion 6 hours ago

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.

austin-cheney 11 hours ago

I have never seen a Texas style mixmaster, or stack exchange, in a game. Here is an irregular example:

https://en.wikipedia.org/wiki/Spaghetti_Junction

pixl97 3 hours ago

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.

heyitssim 18 hours ago

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

inflam52 18 hours ago

Timely article for me! I just went through this in my little SimCity remake for MicroPython:

https://github.com/chrisdiana/TinyCity/blob/6c3a7337788655b5...

JKCalhoun 8 hours ago

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.

Gare 16 hours ago

> 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.

Ef996 13 hours ago

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.

raphlinus 14 hours ago

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.

Ef996 13 hours ago

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

masfuerte 3 hours ago

interloxia 13 hours ago

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.

xixixao 13 hours ago

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/

noduerme 12 hours ago

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

Ef996 13 hours ago

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.

pmontra 15 hours ago

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.

brnt 13 hours ago

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.

sam_lowry_ 13 hours ago

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.

ChicagoDave 13 hours ago

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.

bombcar 20 hours ago

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.

hibikir 19 hours ago

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.

left-struck 19 hours ago

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.

oaiey 15 hours ago

prawn 19 hours ago

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.

jak6jak 16 hours ago

Everyone is raving about this article. It feels so much like a tease to me. Maybe I'm just impatient idk.

empiko 14 hours ago

I'm with you. I hope that the other posts will also pop up here.

jet98 2 hours ago

Streets ahead

BrtByte 10 hours ago

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

lloeki 10 hours ago

"if it looks good, it flies good" (or s/good/right/g) is an old aviation adage about aircraft

https://m.youtube.com/watch?v=PG4gr0Q4904

smhinsey 17 hours ago

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

ramonga 9 hours ago

If you liked this you'll love playing mini motorways (available in many platforms including mobile/ipad)

orbit7 15 hours ago

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.

Ef996 13 hours ago

I am a huge fan of satisfactory as well (probably no surprise for anyone)

pixl97 4 hours ago

>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.

raincole 19 hours ago

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!

hobofan 12 hours ago

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.

voodooEntity 13 hours ago

Always thought some streets in city builders just are a bit tooooo off :D

Very nice article - good read !

Wistar 15 hours ago

[Adds “clothoid” to vocabulary]

heliumtera 20 hours ago

The tech seems really cool, but the road showed in the examples is not any less insane, like, why?

aerio 19 hours ago

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.

Ef996 9 hours ago

Will share more soon. I have some more recordings of it on x https://x.com/SandboxSpirit if you're interested.

hresvelgr 19 hours ago

That's the point? Even though they are complex, the improved roads all use circular arcs which guarantee a baseline of good drivability.

cookiengineer 11 hours ago

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.

[1] https://de.wikipedia.org/wiki/Autobahnkreuz

lstodd 9 hours ago

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

cookiengineer 9 hours ago

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.

lstodd 8 hours ago

tgtweak 8 hours ago

Cool - now make it into a mod for cities skyline :)

Ahnonimus 9 hours ago

Minecraft

e2319685 12 hours ago

Daniel

adamrezich 4 hours ago

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!

chongli 19 hours ago

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.

GaryBluto 19 hours ago

> 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.

jak6jak 11 hours ago

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.

prmoustache 11 hours ago

> 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.

IMTDb 19 hours ago

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.

chongli 18 hours ago

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.

jmye 6 hours ago

Qwertious 17 hours ago

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.

bombcar 18 hours ago

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.

matsemann 14 hours ago

> 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.

prmoustache 11 hours ago

You have a weird definition of "realism".

Tarrosion 18 hours ago

[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)

MindSpunk 18 hours ago

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.

dcsommer 17 hours ago

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.

throwerxyz 17 hours ago

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.

CalRobert 17 hours ago

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.

account42 13 hours ago

nine_k 17 hours ago

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.

stronglikedan 18 hours ago

> 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.

vineyardmike 17 hours ago

> 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).

prmoustache 11 hours ago

If you like living and spending all your day in your car yes.

jmye 6 hours ago

account42 13 hours ago

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.

matsemann 12 hours ago

CalRobert 17 hours ago

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...

chongli 17 hours ago

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.

mh2266 19 hours ago

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.