Red Blob Games
@redblobgames.com
1.5K followers 98 following 330 posts
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/
Posts Media Videos Starter Packs
redblobgames.com
I wrote this up in a blog post but I think the comparison screenshots show that the improvement is minor www.redblobgames.com/blog/2025-10...
Mapgen4’s use of WebGL2
www.redblobgames.com
Reposted by Red Blob Games
shrikhalpada.dev
The question of "should I cooperate" shows up everywhere, from biology to geopolitics.

In my latest PerThirtySix piece, we explore the Prisoner’s Dilemma, starting from the basics and building up to population-level dynamics through interactive simulations!

perthirtysix.com/tool/prisone...
Reposted by Red Blob Games
mamassian.bsky.social
A nice shift in perceived colour between central and peripheral vision. The fixated disc looks purple while the others look blue.

The effect presumably comes from the absence of S-cones in the fovea.

From Hinnerk Schulz-Hildebrandt:
arxiv.org/pdf/2509.115...
An array of 9 purple discs on a blue background. Figure from Hinnerk Schulz-Hildebrandt.
Reposted by Red Blob Games
chrisshank.com
You can just make things on the web collaborative by adding a single HTML attribute...
redblobgames.com
This is what I would expect. In calculus terms, "News" is the first derivative of the information, not the information itself. Unchanging information isn't "new".
redblobgames.com
Yeah! I like <output> but don't use it fully, and haven't done enough for screen readers. I've mostly used this to display the result of <input> elements, like this:
Diagram from https://www.redblobgames.com/maps/noisy-edges/ showing the html structure for accessibility, including a <label> element surrounding an <input> and corresponding <output> element
redblobgames.com
Minor request: could you link to the corresponding caniuse pages for these features, so that a year from now if someone's reading your page they can see if there's any progress from Safari? e.g. caniuse.com?search=final... and caniuse.com?search=dispose
"finalizationregistry" | Can I use... Support tables for HTML5, CSS3, etc
caniuse.com
Reposted by Red Blob Games
hillelwayne.com
I have a sparkling new blog post for you all! "A Very Early History of Algebraic Data Types" traces the history from the first innovation by John McCarthy, through its early use in imperative programming, and to its mainstreaming in FP. Come check it out!

www.hillelwayne.com/post/algdt-h...
A Very Early History of Algebraic Data Types
Been quiet around here! I’ve been putting almost all of my writing time into Logic for Programmers and my whole brain is book-shaped. Trust me, you do not want to read my 2000-word rant on Sphinx post...
www.hillelwayne.com
redblobgames.com
Also notice the difference in the black line for the coastline — much smoother in the new code
redblobgames.com
I could, but there were also weird artifacts that I didn't like, so I'm looking for ways to intentionally add noise (maybe blue noise) without getting the other artifacts. But it's more work than putting the bug back in ;)
redblobgames.com
Yeah, it's because I was storing the elevation in two bytes, and the low byte got scrambled, so some of the elevations end up being higher or lower than they should be. And those glitches are at regular intervals, so it kind of looks neat :)

But now I am storing elevation as one float
redblobgames.com
I've been fixing numerical precision issues in #mapgen4 but some of those issues led to interesting textures that I liked.

(It may be hard to see them on the screenshots)

I'd like to have interesting textures that are intentional instead of the result of a bug …
mapgen4 render with a floating point precision bug mapgen4 render with floating point bug fixed looks smoother
redblobgames.com
You can play with it now on www.redblobgames.com/x/2524-mapge... and I will push it to the main mapgen4 page after more testing
Mapgen4 Renderer
www.redblobgames.com
redblobgames.com
I'm working on a slider that lets you control how deep the "folds" on the #mapgen4 mountains are
redblobgames.com
New blog post: rewriting the mapgen4 river render www.redblobgames.com/blog/2025-09...

I had been drawing river segments on the cpu to a texture, and then reading that texture on the gpu. I changed it to draw river segments on the gpu directly.
Old river renderer: draw to the cpu, then read from that on the gpu New river renderer: draw directly on the gpu in a shader
redblobgames.com
I'm outputting to a WebGL R16F texture in mapgen4. It has a float channel, so I thought … I can set my frag shader to write to "out float" instead of "out vec4". But nope! :) I will change it back to "out vec4" and output three dummy values, which get thrown away.

(I'm learning WebGL2 this week)
Screenshot of buggy output from my shader
Reposted by Red Blob Games
b0rk-reruns.jvns.ca
how I got better at debugging

permalink: wizardzines.com/comics/bette...
from our free zine "So you want to be a wizard": wizardzines.com/zines/wizard/
A comic about computing. A transcript may be available at the link in the post.
Reposted by Red Blob Games
b0rk-reruns.jvns.ca
tips for reading code

permalink: wizardzines.com/comics/tips-...
from our free zine "So you want to be a wizard": wizardzines.com/zines/wizard/
A comic about computing. A transcript may be available at the link in the post.
redblobgames.com
New blog post: after a long break, I'm upgrading some of mapgen4's code (features, performance, bugs, ui, etc.) www.redblobgames.com/blog/2025-09...
A screenshot of mapgen4's map generator, with an ocean to the east, a land mass to the west, and a peninsula to the southeast