Profile avatar
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/
240 posts 1,321 followers 91 following
Regular Contributor
Active Commenter

“I think interactive diagrams have a lot of potential -- they're not something that classrooms or books really bring to people.” —me, to a friend, in 2006

If you are in a mood for helping you can update your Dear ImGui app to `dynamic_fonts` branch this week-end and write/share all your thoughts/feedback there: github.com/ocornut/imgu... If all goes well : merge to main soon, create a new unpolluted thread for collecting feedback.

While reviewing my mapgen4 rendering code, I realized I was using 'nearest' filtering for the biome colors. What happens if I use 'linear'? (a) I get some river valleys shaded in, even where rivers have dried out (b) I get smoother colors in the oceans (added it to a list of future investigations)

While reviewing my mapgen4 geometry code, I noticed a parameter that I had hard-coded instead of exposing through sliders. I took screenshots of it at 1.00, 0.95, 0.90, 0.85, and added it to the todo list.

It's been a while since I've written about the innards of @compiler-explorer.com. xania.org/202506/how-c... has the details, some statistics and some fun war stories.

Today, working on the Delaunator guide. 1. what it looks like now - point and triangle diagrams showing a *subset* of the data 2. new version - diagrams showing *complete* data including edge cases 3. complete example, with code you can copy/paste, and numbers you can see in the diagram

I've been looking into vertical align of text. Yes, it's complicated (confusingly convoluted) as anything else in the text layout and rendering world. This is great write up on the topic (and very timely for me!) wolthera.info/2025/04/goin...

copy and paste in the terminal wizardzines.com/comics/copy-... (link to the pbcopy script: wzrd.page/pbcopy)

Wanted to compare two folders to see what files were different (unity build succeeded in one and failed in the other). Ran in bash: diff <(cd folder1; find . -type f -print0 | xargs -0 md5sum | sort) <(cd folder2; find . -type f -print0 | xargs -0 md5sum | sort) Presto, found the likely culprit.

New on the blog: "Planetfall," in which I go into great detail about making a fun map based upon a 1999 computer game. One of the most technically demanding projects of my career, for a very niche audience. somethingaboutmaps.wordpress.com/2025/05/20/p... #SMAC

Have you ever scanned a dirty or crumpled up QR code, *certain* it wouldn't work, and then it instantly does? They're built to be really resilient! Here's a guide I put together, full of interactive visuals to show the design choices in the QR spec. perthirtysix.com/how-the-heck-do-qr-codes-work

New blog post: Using flow field pathfinding on a voronoi procedurally generated map to simulate 20,000 traders moving around www.redblobgames.com/blog/2025-05...

Have you ever wished the browser would look at a background color and pick black or white for the text — whichever one provides more contrast? Now, the `constrast-color()` function in CSS does just that. webkit.org/blog/16929/c...

My survey article on line drawing algorithms, pitched for game developers jcd.pub/2025/04/10/t... #gamedev #math #geometry #lines

A wonderful visualization for those of us obsessed by sunlight and geography!

The information density on weatherspark is amazing. The icons on this map are a year's worth of weather data. Left to right on the icon is Jan to Dec. Bottom to top is hours of the day. Each pixel color tells you temperature (blue = cold, red = hot). weatherspark.com/map?pageType...

Working on a blog post, making many diagrams, throwing out many diagrams to simplify the post. This is one that I'm throwing out.

So I finally figured out what's the deal with these quilts

Published my WebGPU Particle Life simulation online! Obviously it requires WebGPU support, and it's quite resource-demanding, so I've set the particle count to 64k for now. Also it probably doesn't work on mobile; will fix later. Enjoy: lisyarus.github.io/webgpu/parti...

Variable Rewards are remarkably powerful. Sometimes, you get something good. Sometimes, you get nothing. But every so often, it's something amazing. That unpredictability keeps us coming back. Life has intermittent variable rewards. Please don't use them for evil.

life of a DNS query permalink: wizardzines.com/comics/life-... from our zine "How DNS Works": wizardzines.com/zines/dns/

What are the different ways software is modified or extended by its users? I’ll go first but please feel free to suggest your own ideas.

Come to Screenshot Conf! with @omar.website and I! screenshot.arquipelago.org