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
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 · 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 · 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
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
Reposted by Red Blob Games
Etienne Jacob @bleuje.com · 01/09/2026
A little “Brick Territories” experiment. → bleuje.com/js_sketches/...
1127853
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
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
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
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
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 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
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 · 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
Red Blob Games @redblobgames.com · 13/07/2026
This video covers so many of my interests: noise, fractals, hexagons, spherical geometry, map generation, plate tectonics www.youtube.com/watch?v=7xL0...
youtube.com
Maps: Fractals, Tectonics and the Fourth Dimension
YouTube video by Fractal Philosophy
1303
Reposted by Red Blob Games
andrew blinn @disconcision.com · 11/07/2026
all will become fidgetable
1630437
Red Blob Games @redblobgames.com · 06/07/2026
For fans of procedurally generated terrain, watch this video erosiv.studio/publications... h/t @jazztap.bsky.social
erosiv.studio
erosiv - Stochastic Geomorphological Transport for Terrain Erosion Simulation
0253
Red Blob Games @redblobgames.com · 02/07/2026
For a long time 3D graphics had a fixed function pipeline. Over time, that loosened up, and we can now write "shaders" to control how it works. I've been wondering about the same with LLMs—
1110
Red Blob Games @redblobgames.com · 25/06/2026
Love this video! I don't have a perfect system but: - I keep short term stuff on paper - I keep long term stuff on the computer (ideally searchable text files, but I also use Notion occasionally) I don't do a lot of organizing (mindmap, zettlekasten, etc.). My notes are messy.
1100
Reposted by Red Blob Games
amos @fasterthanli.me · 20/06/2026
Broadcasting negative opinions about something is an easy way to get a lot of people to agree with you, because it resonates with them. They've been thinking the same thing, and they were too afraid to say it out loud. And it feels good to have someone else say it. And it becomes self-sustaining...
4486
Red Blob Games @redblobgames.com · 17/06/2026
Bobbie's interview questions were great — it got me thinking about what I'm working on and what I'd like to be working on
1263
Reposted by Red Blob Games
Josh Renaud @kirkman.bsky.social · 15/06/2026
I have finally solved a minor retrocomputing mystery related to my favorite BBS door game, "Solar Realms Elite." It had befuddled me for many years. breakintochat.com/blog/2026/06... #bbs #retrocomputing #ansiart #gamedev #textmode
breakintochat.com
The mystery of the Solar Realms Elite title screen - Break Into Chat
In my recent series ANSI art and webcomics, I debunked a false assertion that began in a history book and propagated across the web. Now it’s time to solve the mystery of an old ANSI art screen that I...
2304
Reposted by Red Blob Games
Ken Shirriff @righto.com · 13/06/2026
Intel introduced the 8087 floating-point chip in 1980 to make math faster. The chip does tangents, square roots, and so forth, but fundamentally everything is computed through additions and subtractions, performed by an adder at the heart of the chip. Let's look at the adder's circuitry... 1/N
A die photo of the 8087 chip, with functional blocks labeled. The die has complex patterns with roughly rectangular shapes. Around the edges, thin bond wires connect the die to the chip's 40 external pins.
In the bottom center, the adder is highlighted. It is a tall, thin rectangle in the middle of the "fraction datapath". Above it is the exponent datapath.
312733
Reposted by Red Blob Games
cira-csu.bsky.social @cira-csu.bsky.social · 12/06/2026
The terrain of Jan Mayen creates a hole in the clouds as they part around the Arctic island.
0193
Reposted by Red Blob Games
Nikita Lisitsa @lisyarus.bsky.social · 09/06/2026
New blog post! Kinda math-heavy this time, but I wanted to share about this weirdly fascinating things called quiver representations that generalize stuff from basic linear algebra to wild unsolvable problems 🤩 lisyarus.github.io/blog/posts/q...
34011
Reposted by Red Blob Games
Patrick Dubroy @dubroy.com · 02/06/2026
Another great post from @thorstenball.com: Building software is learning → registerspill.thorstenball.com/p/building-s...
registerspill.thorstenball.com
Building Software Is Learning
An internal note to the Amp team on feedback and shipping faster
172
Reposted by Red Blob Games
Julia's Reruns Bot @b0rk-reruns.jvns.ca · 01/06/2026
invest in understanding permalink: wizardzines.com/comics/invest-in-un… from our zine So you want to be a wizard: wizardzines.com/zines/wizard
0184
Reposted by Red Blob Games
Josh Renaud @kirkman.bsky.social · 02/05/2026
For the last 25 years, Barren Realms Elite (BRE) has been frozen in amber, with the same ANSI title screen. But it was preceded by lots of other designs from 1992-97. Check out my gallery of 14 of these titles from one of the best-known classic BBS door games. breakintochat.com/blog/2026/05...
breakintochat.com
The many ANSI title screens of Barren Realms Elite (BRE) - Break Into Chat
If you’ve played Barren Realms Elite at any time in the past quarter-century, you probably have seen this spiffy ANSI title screen: That’s because — like most classic BBS door games — BRE became more ...
184
Reposted by Red Blob Games
Julia's Reruns Bot @b0rk-reruns.jvns.ca · 30/05/2026
what's a branch? permalink: wizardzines.com/comics/whats-a-bran… from our zine How Git Works: wizardzines.com/zines/git
You can think about a Git branch in 3 different ways:

### 1. just the commits that "branch" off
this is how I usually think about branches:

`armadillo` branches off `main`

Illustration of a vertical black line, labelled "main". Coming of off it is a red line, labelled "armadillo" The armadillo line has two dots on it.

The two dots are labelled "I think of the armadillo branch as these 2 commits"

#### How this shows up in git:
Git DOESN'T KNOW that `armadillo` is branched off of `main`: for all it knows, main could be branched off of `armadillo`! You need to tell it when you merge or rebase, for example:
```
git checkout main
git merge armadillo
```

### 2. every previous commit
Even though git doesn't treat the `main` branch in any special way, I think of `main` differently from other branches.

Illustration of a vertical red line, labelled "main", which has four dots along it. Coming of off it is a black line, labelled "armadillo". The red dots on the red line are labelled "I thi
0111
Red Blob Games @redblobgames.com · 26/05/2026
One advantage of having web pages instead of academic papers is that I can keep improving them. Today I added drag handles to the cone/sector section of www.redblobgames.com/grids/circle... You can now adjust these visually instead of using the sliders. But the sliders still work too.
Before: adjust cone size by using slidersAfter: adjust cone size either with sliders or by moving the drag handle
1554
Red Blob Games @redblobgames.com · 24/05/2026
Those of you who like to learn algorithms from videos might be interested in: www.youtube.com/watch?v=4_Ac... → about a recent result showing better graph search when some edge weights are negative www.youtube.com/@LowerBoundYT → a whole channel about pathfinding algorithms
youtube.com
Lower Bound
Learn Pathfinding & Heuristic Search (with Thomas, PhD) I teach for the Masters of AI at the University of Melbourne (QS #19 in the world) and at Monash University (QS #36) in Australia. I hope to al...
0212
Reposted by Red Blob Games
Björn Ottosson - making Island Architect @bottosson.bsky.social · 18/05/2026
I'm working on a stylized shader for flowing water. Here are some results combining phasor noise with advection along the flow direction. Some more details in 🧵. The code is on shadertoy: www.shadertoy.com/view/N3sGD2 #gamedev #procedural #indiegamedev #techart
725934
Reposted by Red Blob Games
Julia's Reruns Bot @b0rk-reruns.jvns.ca · 30/04/2026
bash debugging permalink: wizardzines.com/comics/bash-debuggi… from our zine Bite Size Bash!: wizardzines.com/zines/bite-size-bash
### our hero: `set -x`

`set -x` prints out every line of a script as it executes, with all the variables
expanded!

`#!/bin/bash
set -x`
(I usually put `set -x` at the top)

### or `bash -X`
`$ bash -x script.sh` does the same thing as putting `set -x` at the top of `script.sh`

### you can stop before every line
`trap read DEBUG`\
the `DEBUG` "signal" is triggered before every line of code

### a fancy step debugger trick
put this at the start of your script to confirm every line before it runs:

`trap '(read -p "\[$BASH_SOURCE: $LINENO] $BASH_COMMAND")' DEBUG`

- `read -p` prints a message, press enter to continue   
- `$BASH_SOURCE` is the script filename    
- `$LINENO` is the line number
- `$BASH_COMMAND` is the next command that will run

### how to print better error messages
this die function:
`die() { echo $1 >&2; exit 1; }` lets you exit the program and print a message if a command fails, like this:
`some_command || die "oh no!"`
0153
Reposted by Red Blob Games
Nik Gadermann @nik.digital · 27/04/2026
New blog post: Compositing & Blending! 🥳 I spent the last few months reading all about blend modes so you don't have to: You'll learn what compositing and blending are, and what is actually going on under the hood when you apply blend modes in CSS 🎨 nik.digital/posts/compos...
nik.digital
Compositing & Blending • Niklas Gadermann
Exploring the math and intuition behind blend modes in the browser
37419
Reposted by Red Blob Games
Simone Conradi @sconradi.bsky.social · 26/04/2026
The complex plane colored by the argument of a polynomial. Each root drifts along a tiny orbit and the color vortices follow: every swirl is a zero. Made with #python #numpy #matplotlib in a @marimo.io notebook.
510324
Red Blob Games @redblobgames.com · 25/04/2026
Trying to show a flow field and also an object following a path in that flow field. Too many arrows? It's growing on me.
Screenshot of a pathfinding flow field and a specific path in that field
4424
Reposted by Red Blob Games
shri @shrikhalpada.dev · 20/04/2026
I built an interactive guide on how Shazam (the music identification app) works! This is the next installment in my newly coined "How The Heck?" series, where we explore everyday tech that can feel like magic (QR Codes, GPS, and now this one). Hope you enjoy it! perthirtysix.com/how-the-heck...
1022359
Red Blob Games @redblobgames.com · 18/04/2026
The pseudocode on my A* and hexagon pages doesn't have types. I'm considering it, but it feels less like pseudocode…
Sample code that uses dynamic typingSample code that uses static typing
3200
Red Blob Games @redblobgames.com · 18/04/2026
New blog post: highlighting the interactive code samples on my hexagons page www.redblobgames.com/blog/2026-04... (and why it was harder on the hexagons page than on the A* page)
Screenshot of code that's highlighted with colors that match the diagrams
1345
Red Blob Games @redblobgames.com · 14/04/2026
The new code highlighting is now LIVE — I hope it works for everyone! www.redblobgames.com/grids/hexago...
redblobgames.com
Red Blob Games: Hexagonal Grids
Amit's guide to math, algorithms, and code for hexagonal grids
1464
Reposted by Red Blob Games
Nikita Lisitsa @lisyarus.bsky.social · 14/04/2026
New blog post! I really hope I'll get a decent amount of people mad with this one 😈😈😈 #programming #computing #floatingpoint #geometry lisyarus.github.io/blog/posts/i...
lisyarus.github.io
It's OK to compare floating-points for equality
1010421
Red Blob Games @redblobgames.com · 14/04/2026
What I'm working on: adding highlighting to code samples on my hexagon page. Standard syntax highlighter packages go from text to html, but I have html input, and it can be interactive, so I had to implement highlighting differently. Might be too much color though! Not sure.
Screenshot of my hexagon page without code highlightingScreenshot of my hexagon page with code highlighting added
4314