惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
J
Java Code Geeks
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
Blog — PlanetScale
Blog — PlanetScale
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
月光博客
月光博客
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
A
About on SuperTechFans
L
LangChain Blog
腾讯CDC
Y
Y Combinator Blog
MongoDB | Blog
MongoDB | Blog
Vercel News
Vercel News
MyScale Blog
MyScale Blog
博客园 - Franky
IT之家
IT之家
博客园_首页

Red Blob Games: latest blog posts

Red Blob Games: English: a vs an Red Blob Games: Differential heuristics Red Blob Games: Responsive design calculator Red Blob Games: Academic citations Red Blob Games: Highlighting interactive code blocks Red Blob Games: Optimizing page size Red Blob Games: Writing a guide to SDF fonts Red Blob Games: URLs with trailing punctuation Red Blob Games: What I did in 2025 Red Blob Games: Goodbye Sass Goodbye Sass Red Blob Games: RotMG map seeds Red Blob Games: Mapgen4 Mapgen4's use of WebGL2 Red Blob Games: Mapgen4 river shader Red Blob Games: Mapgen4 renderer Red Blob Games: Harnessing ChatGPT hallucinations Red Blob Games: Let Let's write a search engine, part 2 of 2 Red Blob Games: Let Let's write a search engine, part 1 of 2 Red Blob Games: Hexagon conversions Red Blob Games: Mapgen4 trade routes Red Blob Games: De-optimizing mapgen4 Red Blob Games: Hexagon spiral coordinates Red Blob Games: Thoughts on Flash Red Blob Games: What I did in 2024 Red Blob Games: Hexagon page animations Red Blob Games: SDF Halos SDF Halos
Red Blob Games: Flow field pathfinding
2024-04-28 · via Red Blob Games: latest blog posts
Blog post: 27 Apr 2024

You may know me for my interactive tutorials. But before that, I was writing visual but non-interactive tutorials. In particular, there wasn’t a lot of information about A* on the web, so I decided to collect all my notes about pathfinding[1] together in one place in the 1990s. But then in the 2010s I started making interactive pages. The newer pages are narrower in scope; I covered a broader set of topics on the older pages. I maintain both sets now.

Over the years people have asked me about “flow field pathfinding”. I felt like the early papers about it conflated the flow fields with hierarchical pathfinding, but I wasn’t sure, and I didn’t want to write about it until I was sure.

Flow field

But it’s been many years now and I would like to write something even if it’s not complete. My understanding so far is:

  1. flow fields are a vector field that tells agents from any location what direction to move to find a single destination
  2. optionally, agents that are in between locations on the pathfinding graph can interpolate between the vectors in the flow field
  3. optionally, a hierarchy of coarse and fine stepped fields can speed up pathfinding

In addition, there are distance fields which are themselves interesting for things like “Dijkstra maps[2]” in roguelike games and “influence maps[3]” in strategy games. Distance fields can also be used for 3D modeling[4] and font rendering. The flow fields and distance fields are related: in vector calculus, the gradient (∇) of the distance field produces the flow field.

Distance field

The graph-based pathfinding algorithms I cover on my A* page[5] output both distance fields and flow fields, in the cost_so_far and came_from outputs. I updated my pages to mention both flow and distance fields:

Although I mention hierarchical pathfinding[8] in these notes, I don’t cover it in detail. Maybe I will do so one day, but I don’t have to wait until then before publish the pages. That’s one of the advantages of web pages over textbooks or academic papers. I can update my pages as I learn more. I still update my pathfinding pages that I started in 1997, and I still update my interactive pathfinding pages that I started in 2014.