Immediately after switching the page, it will work with CSR.
Please reload your browser to see how it works.

Source:https://github.com/SoraKumo001/next-streaming

⬅️ Flow Field Pathfinding
amitp 16 daysReload
Author here. A surprise seeing this on HN!

The context: I'm writing my own blog software for various reasons [1], including my desire to post less to social media. As much as possible I'm trying to reuse the build system for the rest of the site, including the template. I have worked on and off on this for the past two months and I expect to keep adding features for another month or two. I'm currently adding categories not only for the blog but to the whole site. After that I'll work on archives by month. And I want to import the 21 years of old blog content [2] which is stored on blogger.com, and put it on the new blog, which is just a folder [3] on my existing site.

I'm writing some blog posts to test out the workflow (integrating into emacs, my build script, an internal status page) and also various content types (images, video, source code, figures, links). Each time I post I find some more things to tweak.

This post to HN made me realize that it's not labeled as a blog post. Oops. I guess that's one of the downsides of reusing the exact same template! So another tweak coming…

[1] https://www.redblobgames.com/blog/2024-03-08-new-blog/

[2] https://simblob.blogspot.com/

[3] https://www.redblobgames.com/blog/


kevindamm 16 daysReload
Ah, redblobgames! I remember their hexagonal coordinate system post from many years ago:

https://www.redblobgames.com/grids/hexagons/

An excellent example of their more interactive posts and great for those interested in hex-grid rendering and navigating.

edit: wow, over 10 years ago and the content has been updated but the look and feel is much as I remember it. This was before reactive systems took over the web, too, so the 'toggle selection here, see updates everywhere' was quite notable for the time.

On the actual topic of the post.. I think flow fields easily get overshadowed by waypoints and other hierarchical approaches. Or, folded into the heuristic function for A*.


adanto6840 16 daysReload
Love it. SimAirport makes extensive use of flow fields -- they're one of the numerous different pathfinding/following systems we use in the game -- but a very important one as they obviously can scale extremely well with agent count.

In SimAirport they're used in a hierarchical way, primarily & specifically for "one level" of the game's overall hierarchical pathfinding systems (longer-distance paths), and they're critical to the game's ability to handle lots of agents.

Always love seeing your content here, Amit! :)


forrestthewoods 16 daysReload
Planetary Annihilation used voxel flow fields. I spent a LOT of time helping ship that system.

I feel like by the time the Titans expansion shipped it was a pretty good system. I occasionally see comments complaining about pathfinding being bad, but I’ve never seen specifics.

Seeing a mass of tanks stream into a stargate teleporter will never not be cool.


mikhmha 15 daysReload
I'm using flow field pathing in the MMO game I'm making. It was surprisingly easy and intuitive to implement! And you can have huge gains if you cache paths to target cells and re-use them across different agents. Its kind of crazy how just a few lines of code can change your implementation from flow-field to A* to Dijkstra, or whatever. I think implementing these algorithms is a fun exercise in recursion it forces you to enter a different head space. Also some crazy overlap with other AI systems, as things like A* are used for goal planning. So its worth to learn all this stuff if you want to program game AI.

The backend of my game is written in Elixir. And the world grid used for path-finding is represented as a global shared ETS table (distributed data store) with 1 writer (world server) + multiple readers (ai unit controllers). It works so well, and I can even have sub processes that evict cached paths when dynamic "obstructions" like resources spawn into the world. The ETS table structure also can partition cells/grids/paths by "level/map" and server instance. And you can profile it in real-time and see how much memory the ETS table is using, time-to-pathfind, and other metrics.