redblobgames.com
Hi! I'm Amit Patel. I explain algorithms and math with interactive web pages (incl. pathfinding, hexagons, procgen maps, voronoi). Wrote Solar Realms Elite; helped w/Barren Realms Elite and Realm of the Mad God. https://www.redblobgames.com/
253 posts
1,338 followers
90 following
Regular Contributor
Active Commenter
comment in response to
post
Excited about this one, especially if Gecko and Webkit follow!
comment in response to
post
Thanks! I was burned out at the end of the project, and I didn't write up enough of how it works, but I have since recovered and am starting to dig into it again this year. Rivers in particular are something I want to write up, and have started a doc www.redblobgames.com/maps/rivers/
comment in response to
post
Yes, there are some tweakable parameters too. You can play with the sliders www.redblobgames.com/maps/mapgen4/ especially lg_min_flow, lg_river_width, flow, raininess, rain_shadow, evaporation
comment in response to
post
A little more written up here:
• simblob.blogspot.com/2018/09/mapg...
• simblob.blogspot.com/2018/10/mapg...
• simblob.blogspot.com/2018/09/mapg...
comment in response to
post
That means the rendering of the rivers can be done on triangles. I was previously generating a texture containing many different river widths, and then drawing one of those rivers widths on these triangles. But now I'm generating the river pattern in a shader.
comment in response to
post
This models where every drop of rain would flow after it falls to the ground. Most of it flows underground in the soil, so I don't want to actually draw those rivers. I only draw the ones above a certain threshold.
I use a triangle mesh, so the triangles can have flow like this:
comment in response to
post
Overall: I simulate evaporation from oceans, humidity, wind, rainfall including orographic (en.wikipedia.org/wiki/Orograp...), then calculate flow rate at *every* point on the map:
comment in response to
post
Agreed — I want to tweak the curvature based on the inner corner's angle. Larger angles need the curve to be curvier, I think.
comment in response to
post
The shader uses a circular arc, whereas the texture used a quadratic bezier. That might be contributing to it being a little less sinusoidal. But for reasons I haven't figured out yet, the new renderer doesn't trigger outlines as well as the old renderer does.
Still, the code is quite a bit simpler
comment in response to
post
The new river renderer is sharper (using a shader instead of a texture). Another example for comparison:
comment in response to
post
Plant the ideas in the baby's mind now, wait 25 years for those ideas to bloom!
comment in response to
post
Oh wow, I didn't even know until you posted this that there were designs other than the old blue and new black ones!
P.S. I still want the Unofficial Seattle Flag on my orca card ;-) www.seattlecityflag.com
comment in response to
post
It looks really weird! but it matched the "hand drawn" style I wanted. The mountains always point up as you rotate.
comment in response to
post
It is off-nadir, but the more unusual thing is that I'm using a non-standard projection designed to mimic how people draw maps by hand, e.g. the Lord of the Rings map. They draw the *side* view of trees and mountains, but the *top* view of rivers and coastlines. web.archive.org/web/20241105...
comment in response to
post
Looks cool when animated. Maybe useful as a very cheap approximation to erosion.
comment in response to
post
exciting! Thank you for posting on your web site too instead of limited to social media
comment in response to
post
I have a 4K monitor for work, but 1440 for gaming (until recently), so Valve's survey only saw my 1440
comment in response to
post
if only css 'will-change' were used everywhere, we could programatically approximate this …
comment in response to
post
I've also had the opposite experience, where the automation is the "gateway drug" that leads me to study the topic myself! So I have mixed feelings about the new automation tools
comment in response to
post
Some candidates
• jackschaedler.github.io/circles-sine...
• natureofcode.com/book/
• pomax.github.io/bezierinfo/
• web.archive.org/web/20131009... ("the sierpinski triangle page to end most sierpinski triangle page")
comment in response to
post
Thank you — I used it today! :)
comment in response to
post
Ahh, thanks, I didn't know about those. I've never looked closely at the diff options.
I wouldn't have thought of this even if I did though, as I had first started with the md5sum, then the find+xargs, and only thought of using diff at the end…
comment in response to
post
Not at all! I composed it step by step. First did the 'md5sum' on one file at a time, then realized I could use 'find' and 'xargs' to run it on all of them, then realized instead of comparing the output manually, I could use 'diff' :-)
comment in response to
post
I'm wondering if "higher numbered" is a proxy for the neighbors() order. Maybe it's always looking in one direction before another direction, and it prefers paths in that direction. Quick test is to try reversing the output of neighbors() to see if anything changes
comment in response to
post
2. If the path it finds is the same as the path you want, then we need to do some "tie breaking" to guide it towards the one you really want. Either we can change the order of the neighbors() function, or we can add a nudge to make it prefer one path over another www.redblobgames.com/pathfinding/...
comment in response to
post
Good question. Things to look at:
1. Are you able to find a shorter path than what's returned, or are they the same length (cost_so_far)? If you can, then there must be a bug somewhere, and we can look at the priority queue code to see if there's something that stands out
comment in response to
post
Wow, 5am to 5pm traffic! Impressive :) Also, thank you for collecting data and sharing visualizations about the roads, transit, and ferry systems.
(btw are there plans to update pages like this?) wsdot.wa.gov/about/data/m...
comment in response to
post
Very nice! Especially love the color matching concepts in the diagram and text
You might also enjoy qris.cool where you can draw on a qr code until the errors are too many to correct 😈 (gives me an idea: drag Dorito around on your error correction diagram to see which areas are more vulnerable)
comment in response to
post
I do have some sliders for adjusting costs www.redblobgames.com/x/2515-mapge... but I think I need more. "mode switch" is the cost of moving goods from land to water and vice versa. But … right now I am not accounting for moving along rivers, which was historically important.
comment in response to
post
Can you allocate the parent after the children ?
comment in response to
post
Clams: www.boredpanda.com/clams-measur...
Cosmetics from supermodel stem cells www.flickr.com/photos/jurve...
Burning gas to get electricity *without* a steam turbine www.lightcellenergy.com
Bose car suspension www.youtube.com/watch?v=3KPY...
Militarized dolphins www.military.com/history/mili...
comment in response to
post
also amazing that it was done in the 1800s
comment in response to
post
I have the same problem with books. Seeing one book in isolation,
"do I want it?" → yes
"do I get it?" → yes, often
But then when I put it on the bookshelf next to the 30 other unread books, it's "oh, maybe I shouldn't have"
comment in response to
post
I've been assuming writing code separately for each octants might be to take advantage of specialized instructions that increment/decrement, like x86's INC and DEC, that might have been faster than storing the delta in a register and then using ADD.