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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
M
MIT News - Artificial intelligence
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
IT之家
IT之家
F
Fortinet All Blogs
博客园 - 聂微东
U
Unit 42
Martin Fowler
Martin Fowler
腾讯CDC
博客园_首页
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
量子位
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky

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.