9 ms·
Art of Roads in Games
- zabzonk 8mo agoBe 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.
- oaiey 8mo agoIn 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 :)
- plomme 8mo agoThe 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 https://en.wikipedia.org/wiki/Roman_aqueduct
- closewith 8mo agoWhat an ugly attitude for the landowner to have held. There should be a word for that.
- serious_angel 8mo agoThank you very much... Ineffably magnificent, as always... Related: https://www.pushing-pixels.org/2014/04/04/the-craft-of-screen-graphics-and-movie-user-interfaces-interview-with-jorge-almeida.html 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...)
- heliumtera 8mo agoThe tech seems really cool, but the road showed in the examples is not any less insane, like, why?
- hresvelgr 8mo agoThat's the point? Even though they are complex, the improved roads all use circular arcs which guarantee a baseline of good drivability.
- aerio 8mo agoTheir 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 8mo agoWill share more soon. I have some more recordings of it on x https://x.com/SandboxSpirit https://x.com/SandboxSpirit if you're interested.
- bombcar 8mo agoAnother 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.
- prawn 8mo agoI 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.
- hibikir 8mo agoYou 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 8mo agoHaving 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 8mo agoAt 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 :)
- chongli 8mo agoI 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.
- mh2266 8mo agothis 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.
- IMTDb 8mo agoThere 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.
- Tarrosion 8mo 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)
- muzani 8mo agoI 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.
- genpfault 8mo agohttps://www.redblobgames.com/articles/curved-paths/ https://www.redblobgames.com/articles/curved-paths/
- Ef996 8mo agoYes, 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!
- antif 8mo agoOne game that had a different perspective (first person mmo), but a fun network of road building in a simulated wilderness .. Wurm Online
- raincole 8mo agoCool 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 8mo agoThe 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.
- inflam52 8mo agoTimely article for me! I just went through this in my little SimCity remake for MicroPython: https://github.com/chrisdiana/TinyCity/blob/6c3a7337788655b5984c10907a7f2ffe9b3d7d94/src/TinyCity.py#L232 https://github.com/chrisdiana/TinyCity/blob/6c3a7337788655b5...
- hirako2000 8mo agoArticles like these are the reason I continue to check hackernews. Author please keep writing.
- Ef996 8mo agoFor 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.
- hirako2000 8mo agoHackernews 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 8mo ago> 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".
- danielray324 8mo ago[dead]
- mlrtime 8mo ago/. 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).
- ChoGGi 8mo agoI believe the hug of death is Reddit, Slashdot was slashdotted.
- abcde666777 8mo agoThere'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 8mo agoAnother 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://lizengland.com/blog/the-door-problem/ https://www.ign.com/articles/putting-doors-in-video-games-is-a-nightmare-say-developers https://www.ign.com/articles/putting-doors-in-video-games-is...
- bestham 8mo agoThis was also confirmed by a Valve developer recently about a bug in HL2: https://mastodon.gamedev.place/@TomF/115589925206309168 https://mastodon.gamedev.place/@TomF/115589925206309168
- yoricm 8mo agoThat'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.
- account42 8mo agoAlso 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.
- heyitssim 8mo agoMy 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 https://youtu.be/bFrUYM2t3ZA?si=tw1LqBWR7Uyn08lR&t=37
- czheo 8mo agoI 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.
- smhinsey 8mo agoThis 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
- acherion 8mo agoThe 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/ 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 8mo agoHello, 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 8mo 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_ellipsoid_billboard https://github.com/Lichtso/bevy_geodesic_grid 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/surface_structures.rs 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.
- jak6jak 8mo agoEveryone is raving about this article. It feels so much like a tease to me. Maybe I'm just impatient idk.
- matusp 8mo agoI'm with you. I hope that the other posts will also pop up here.
- Gare 8mo 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.
- raphlinus 8mo agoI 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 8mo agoI 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 8mo agoYou 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-curves.html https://raphlinus.github.io/curves/2021/02/19/parallel-curve... https://levien.com/phd/euler_hist.pdf https://levien.com/phd/euler_hist.pdf
- Ef996 8mo agoGlad 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.
- noduerme 8mo agoAhhh.. 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 8mo agoVery 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.
- orbit7 8mo agoCan 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 8mo agoI am a huge fan of satisfactory as well (probably no surprise for anyone)
- pmontra 8mo agoThe 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 8mo agoThis 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.
- Wistar 8mo ago[Adds “clothoid” to vocabulary]
- Arn_Thor 8mo 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 8mo agoOnce you do care, there's no going back
- rob74 8mo 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 https://en.wikipedia.org/wiki/Stroad
- kqr 8mo agoI 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.
- trinari 8mo agoI hope the water comes to the city through a pipe and not with trucks on roads.
- fenykep 8mo agoI 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)
- direwolf20 8mo agoWe finally have water–powered cars?
- voodooEntity 8mo agoAlways thought some streets in city builders just are a bit tooooo off :D Very nice article - good read !
- spacedcowboy 8mo agoBé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 https://github.com/ThrudTheBarbarian/Azoth [2] https://github.com/ThrudTheBarbarian/Azoth/blob/main/Documentation/AZBezier/README.md https://github.com/ThrudTheBarbarian/Azoth/blob/main/Documen...
- sam_lowry_ 8mo agoAt 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 8mo agoNow 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.
- xixixao 8mo agoI’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/ https://xixixao.github.io/euler-spiral-explanation/
- Ef996 8mo agoWow, 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.
- noduerme 8mo agoSuper 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 https://pasteboard.co/5QgDdTVVSm1I.png
- interloxia 8mo agoIn 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.
- e2319685 8mo agoDaniel
- deleted 8mo ago[deleted]
- vanaur 8mo agoOne may also be interested in Egregoria (https://github.com/Uriopass/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.
- cookiengineer 8mo agoAs 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 https://de.wikipedia.org/wiki/Autobahnkreuz
- lstodd 8mo agoMKAD, 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 https://www.openstreetmap.org/#map=16/55.88242/37.72732
- cookiengineer 8mo agoDamn, 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 8mo ago> 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 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.
- Notatheist 8mo agoIn 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.
- austin-cheney 8mo agoI 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 https://en.wikipedia.org/wiki/Spaghetti_Junction
- pixl97 8mo agoI 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.
- BrtByte 8mo agoNope, 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 8mo 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 https://m.youtube.com/watch?v=PG4gr0Q4904
- Ahnonimus 8mo agoMinecraft
- ramonga 8mo agoIf you liked this you'll love playing mini motorways (available in many platforms including mobile/ipad)
- curiousObject 8mo agoThis 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.
- tgtweak 8mo agoCool - now make it into a mod for cities skyline :)
- JKCalhoun 8mo agoLove 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.
- devnullbrain 8mo 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.
- iggldiggl 8mo agoSee https://www.thecontactpatch.com/ https://www.thecontactpatch.com/ for some interesting reading material related to that.
- JackFr 8mo agoRailroad cars don't have differentials and travel on parallel tracks. How? https://www.reddit.com/r/Skookum/comments/47sbri/richard_feynman_explains_how_a_train_can_go/ https://www.reddit.com/r/Skookum/comments/47sbri/richard_fey...
- Ef996 8mo ago
- frou_dh 8mo agoIn 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.
- dandellion 8mo agoNot 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.
- adamrezich 8mo agoVery 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!
- pixl97 8mo 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.
- jet98 8mo agoStreets ahead
- wffurr 8mo agoThe "circle arcs" system for maintaining parallel road edges is very similar to how the stroke extrusion algorithm in our drawing library[1] works to maintain stroke width, with one difference being that we vary the circle radius for some brush dynamics based on pressure or speed. [1]: https://github.com/google/ink https://github.com/google/ink