Sign in

Red Blob Games

@redblobgames.com
2.1K followers 101 following 560 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. www.redblobgames.com

PostsRepliesMedia
Red Blob Games @redblobgames.com · 26/09/2026
Ha, clever!
000
Red Blob Games @redblobgames.com · 26/09/2026
I thought I was being clever by making a "print statement" in javascript (yes, I miss python 2's print statement, and BASIC too) print `${attacker} attacks ${defender} for ${damage} hp.`; But it turns out Mozilla's docs have this same idea developer.mozilla.org/en-US/docs/W... console.log`Hello`;
developer.mozilla.org
Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded expressions, and special constructs called tagged templates.
181
Red Blob Games @redblobgames.com · 26/09/2026
Yeah, I'm getting stupid stuff from iLands bots too :-(
100
Red Blob Games @redblobgames.com · 23/09/2026
Every once in a while I think I should turn off comments on my blog/site, and then there are days like today when I get TWO comments that are so great that I want to keep comments open.
4260
Red Blob Games @redblobgames.com · 18/09/2026
excited to see SVG and MathML updates!
040
Red Blob Games @redblobgames.com · 17/09/2026
New blog post: www.redblobgames.com/blog/2026-09... I was looking at assigning "a" vs "an" articles for English nouns (for procgen purposes), and fell into a rabbit hole …
Diagram showing the first two letters of English words, and whether that word would get the "a" or "an" article in front of it
0238
Red Blob Games @redblobgames.com · 14/09/2026
And here's an example of some code I wrote that was redundant with code I had written earlier. I had forgotten about the earlier code, but llm-buddy reminded me that I had already done this operation and don't need to do it again. It's essentially acting like a linter but on logic instead of style
Screenshot of an LLM pointing out that I had written some redundant code
050
Red Blob Games @redblobgames.com · 14/09/2026
Which models are you using? I had been using Gemma 4 (both 31B and 26B A4B) and am now trying Qwen 3.8 27B
100
Red Blob Games @redblobgames.com · 14/09/2026
I'm also learning new things. Today I was writing my plan for the r/roguelikedev summer event (old.reddit.com/r/rogueliked...), and realized I wanted a partially unique db index. I had written that there's no way to do what I want. But llm-buddy told me there was! en.wikipedia.org/wiki/Partial...
en.wikipedia.org
Partial index - Wikipedia
150
Red Blob Games @redblobgames.com · 14/09/2026
Here's an example of me being careless. It's not a type error, but the code is wrong. llm-buddy got me to look at it again. And yes, I'm careless sometimes :-(
A screenshot of llm-buddy.el telling me that x: centerOfLastRoom[0], y: centerOfLastRoom[0] is likely a bug, and should've been y getting [1]
160
Red Blob Games @redblobgames.com · 14/09/2026
I am *loving* this use of LLMs. For my current project I'm writing all the code myself, but I have llm-buddy reading my code as I type, giving me feedback. And … it's caught a lot of bugs and style issues. It's telling me things I would've never thought of asking an LLM about.
4284
Red Blob Games @redblobgames.com · 10/09/2026
😱
000
Red Blob Games @redblobgames.com · 07/09/2026
I do the sort | uniq -c | sort -n thing a lot too! :)
011
Red Blob Games @redblobgames.com · 02/09/2026
Reading the manual is a superpower!
110
Reposted by Red Blob Games
Etienne Jacob @bleuje.com · 01/09/2026
A little “Brick Territories” experiment. → bleuje.com/js_sketches/...
1127853
Red Blob Games @redblobgames.com · 28/08/2026
We have <kbd> <samp> <output> <code> <var> and then markdown has us use `` for everything ;-)
050
Red Blob Games @redblobgames.com · 27/08/2026
The mono implementation is what I expected but the stereo implementation was quite a surprise to me! I had made the mistake of connecting my computer audio to the PHONO on my amplifier. It didn't sound right because of the RIAA curve correction. :)
050
Red Blob Games @redblobgames.com · 27/08/2026
e.g. www.instagram.com/reel/DchW6fl...
instagram.com
Instagram
Create an account or log in to Instagram - Share what you're into with the people who get you.
130
Red Blob Games @redblobgames.com · 27/08/2026
I hear all the pelicans are now living on the Pacifica Pier … without bicycles.
110
Reposted by Red Blob Games
shri @shrikhalpada.dev · 27/08/2026
My latest interactive explainer all about the technology behind record players is done! perthirtysix.com/how-the-heck...
823051
Red Blob Games @redblobgames.com · 25/08/2026
With a minor change it could be as good as timberborn.org/wiki/maps/he... (I enjoyed playing that Timberborn map quite a lot)
timberborn.org
Helix Mountain
Standard. Helix Mountain is a 256x256 standard-difficulty map centered around a distinctive spiral-shaped river that winds around a…
040
Red Blob Games @redblobgames.com · 20/08/2026
So yes, oceans do affect it, but right now I haven't implemented anything similar for rivers
010
Red Blob Games @redblobgames.com · 20/08/2026
The simulation model is: - evaporate over oceans → increase precipitable water (en.wikipedia.org/wiki/Precipi...) - temperature affects maximum precipitable water vapor, with colder air able to hold less - mountains and latitude affect temperature - wind moves the precipitable water around
en.wikipedia.org
Precipitable water - Wikipedia
100
Red Blob Games @redblobgames.com · 20/08/2026
Oh, that's too bad! I've only tried one time and it went ok: "write javascript for the hexagon functions on www.redblobgames.com/grids/hexago... including unit tests" But that might be because I actually have javascript code linked from that page for it to copy :)
redblobgames.com
Red Blob Games: Implementation of Hex Grids
010
Reposted by Red Blob Games
Daniel Huffman @pinakographos.bsky.social · 19/08/2026
Rediscovered while excavating my archives. Three vignettes show a bit of how I think about geometric relationships in #map labeling. (In case the embedded video gets compressed beyond recognition, it's also on YouTube: www.youtube.com/watch?v=GQws...)
2344
Red Blob Games @redblobgames.com · 19/08/2026
Busy regreening the desert in this simulation
3785
Red Blob Games @redblobgames.com · 19/08/2026
If you make yours a standalone library and want me to link to it, let me know!
010
Red Blob Games @redblobgames.com · 19/08/2026
I'm glad Claude can interpret my pages! :) BTW there are some Godot libraries here: www.redblobgames.com/grids/hexago...
redblobgames.com
Red Blob Games: Implementation of Hex Grids
220
Reposted by Red Blob Games
Raph Levien @raphlinus.bsky.social · 10/08/2026
I just posted a blog post on my hyperbezier curve: linebender.org/blog/hyperbe... I've actually been working on this for years, and only recently figured out a solution to the parameter mapping problem. I think this curve is potentially better than cubic Béziers for 2D vector graphic design.
A plot of two roughly S-shaped curves. In gray is a cubic Bézier, and the Bézier control points are shown. In blue is an example of the hyperbezier, with roughly similar shape but much smoother curvature variation. There is also a "curvature comb" in green.
212325
Reposted by Red Blob Games
Sam Rose @samwho.dev · 13/08/2026
This might be the most beautiful thing I've read in my life. What a privilege to be alive in 2026. ordinaryabundance.com
ordinaryabundance.com
Ordinary Abundance
A walk through a modern apartment, through the eyes of the people for whom everything in it was new.
13590221
Red Blob Games @redblobgames.com · 10/08/2026
I've been mildly tempted to vibe code a web framework that embraces classes …
120
Red Blob Games @redblobgames.com · 09/08/2026
New blog post about the writing of this page www.redblobgames.com/blog/2026-08...
0202
Red Blob Games @redblobgames.com · 09/08/2026
Thank you!
000
Red Blob Games @redblobgames.com · 09/08/2026
I turned down the exposure to see the details on the lit side, but the other side was too dark. I took this last week: I think I need to figure out hdr or stacking or something else to combine high and low exposures.
Photo of the moon
050
Reposted by Red Blob Games
Alex Warth @alexwarth.bsky.social · 07/08/2026
We put a program's entire heap inside an Automerge document. Every object is persistent and shared: you and I can live in the same running program — and change it while it runs. New Livelymerge lab note, with Dan Ingalls and @pvh.ca: www.inkandswitch.com/livelymerge/...
36814
Red Blob Games @redblobgames.com · 06/08/2026
At least in gamedev, people want to use A* right away. I structured my tutorial page to first introduce them to Breadth First Search and Dijkstra's to gently encourage people to consider these instead of A* :)
030
Red Blob Games @redblobgames.com · 02/08/2026
Ooh, neat! (Also: another rabbit hole for me to explore)
130
Reposted by Red Blob Games
Julia's Reruns Bot @b0rk-reruns.jvns.ca · 02/08/2026
unix domain sockets permalink: wizardzines.com/comics/unix-domain-… from our zine Bite Size Linux!: wizardzines.com/zines/bite-size-lin…
### unix domain sockets are files


```
$ file mysock.sock
socket
```
the file's permissions determine who can send data to the socket.

### they let 2 programs on the same computer communicate


Docker uses Unix domain sockets, for example!

process: GET/container (HTTP request)
Docker: Here you go!

### There are 2 kind of unix domain sockets

- `stream`: Like TCP! Lets you send a continuous stream of bytes
- `datagram`: Like UDP! Let you send discrete chunks of data

### advantage 1
Lets you use file permission to restrict access to HTTP/database services!

`chmod 600 secret.sock`

This is why Docker uses a unix domain socket. (lock icon)

evil process: run evil container   
Linux, nonplussed: permission denied

### advantage 2
UDP sockets aren't always reliable (even on the same compute).

unix domain datagram sockets ARE reliable! And they won't reorder packets!

Process: I can send data and I KNOW it'll arrive

### advantage 3
You can send a file descriptor over a unix domain soc
0113
Red Blob Games @redblobgames.com · 02/08/2026
I was inspired by this project toneyalexander.github.io/inclusive-co...
toneyalexander.github.io
What Colors Are We? Constructing A Color Space For Skin Tones
Simple equations and a color picker to inclusively select simplified skin tones in a custom color space for digital art or game development.
050
Red Blob Games @redblobgames.com · 02/08/2026
I added some color and shape options to my procedural face generator www.redblobgames.com/x/1845-face-...
Screenshot of a procedural face generator tool I made, where you can control the mouth shape, face shape, and colors
171
Red Blob Games @redblobgames.com · 02/08/2026
Love this project and writeup! A color space to cover skin colors. toneyalexander.github.io/inclusive-co... (can also be useful for #procgen)
toneyalexander.github.io
What Colors Are We? Constructing A Color Space For Skin Tones
Simple equations and a color picker to inclusively select simplified skin tones in a custom color space for digital art or game development.
413432
Reposted by Red Blob Games
Julia's Reruns Bot @b0rk-reruns.jvns.ca · 29/07/2026
anatomy of a HTTP response permalink: wizardzines.com/comics/anatomy-http… from our zine HTTP: Learn your browser's language!: wizardzines.com/zines/http
### HTTP responses have:
- a status code (200 OK! 404 not found!)
- headers
- a body (HTML, an image, JSON, etc)

### Here's the HTTP response from `examplecat.com/cat.txt`:
```
HTTP/1.1 200 OK
status
Accept-Ranges: bytes
Cache-Control: public, max-age=0
Content-Length: 33
Content-Type: text/plain; charset=UTF-8 Date: Mon, 09 Sep 2019 01:57:35 GMT
Etag: "ac5affa59f554a1440043537ae973790-ssl"
Strict-Transport-Security: max-age=31536000
Age: 0
Server: Netlify
[ASCII image of a cat, labelled "cat!" with a smiley face]
```
The first line, `HTTP/1.1 200 OK` is the status code. "200" is the status.   

The lines from `Accept-Ranges` to `Server` are the headers.

The cat picture is the body.

### There are a few kinds of response headers:

- when the resource was sent/modified:
```
Date: Mon, 09 Sep 2019 01:57:35 GMT
Last-Modified: 3 Feb 2017 13:00:00 GMT
```

- about the response body:
```
Content-Language: en-US 
Content-Length: 33
Content-Type: text/plain; charset=UTF-8
Content-Encoding: g
0102
Red Blob Games @redblobgames.com · 28/07/2026
I've been trying to write this page since … 2015! Each time I try, get frustrated, quit, start over. But this time I think I might have gotten the page to a good state … www.redblobgames.com/pathfinding/...
redblobgames.com
Red Blob Games: Improving Heuristics
37422
Red Blob Games @redblobgames.com · 25/07/2026
- ranger - guide others through many generators/techniques - paladin - explains pros & cons, definitions of procgen Some Dungeons & Dragons campaigns also featured anti-magic groups. And I think it all applies to LLM use! Which D&D class matches your use of LLMs?
120
Red Blob Games @redblobgames.com · 25/07/2026
- artificer - put magic into everyday tools, usable by mortals - cleric - rituals that work but you don't know why, and you don't need to - warlock - bargaining, if you meet its whims you get ultimate power - druid - tending to & observing, teaching/nurturing
140
Red Blob Games @redblobgames.com · 25/07/2026
I still think about this talk. My notes: - wizard - system of rules that can be mastered, fully understand some subset of magic - sorcerer - relies on intuition, introspection, examining one's own beliefs - bard - creativity enhancement, artistic, embraces weirdness
120
Red Blob Games @redblobgames.com · 25/07/2026
At 2019's Roguelike Celebration conference @apepers.bsky.social gave a talk about different types of procedural generation practitioners and how they are similar to Dungeons & Dragons magic classes www.youtube.com/watch?v=mYMd...
youtube.com
Alexei Pepers - A Guide to Proc Gen Practitioners
YouTube video by Roguelike Celebration
1142
Red Blob Games @redblobgames.com · 22/07/2026
Everything goes in the `any` type
150
Red Blob Games @redblobgames.com · 16/07/2026
I got the same recommendation!
010
Red Blob Games @redblobgames.com · 14/07/2026
The temperature setting on LLMs makes me think of mind-altering substances: low: coffee medium: beer high: lsd Related: amitp.blogspot.com/2022/05/beer...
amitp.blogspot.com
Beer mode and coffee mode
Over the years I've mentioned to people that I work in two modes: Beer Mode 🍺 I'm relaxed and make connections between many differe...
030