frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Right click to copy any file as Markdown on Mac

https://iddogino.com/right-click-to-copy-any-file-as-markdown-on-mac
1•iddogino•3m ago•0 comments

Show HN: Pixelagent – Build your Stateful Agent Framework in 200 lines of code

https://github.com/pixeltable/pixelagent
1•pierrebrunelle•3m ago•1 comments

Workers are saying 'no' to toxic environments

https://apnews.com/article/what-to-do-toxic-workplace-job-7c96353516e7b3968e21b0d7099fd877
1•mooreds•4m ago•0 comments

Virginia Woolf? Snob Richard Wright? Sexist Dostoyevsky? Anti-Semite (2019)

https://www.nytimes.com/2019/01/08/books/review/edith-wharton-house-of-mirth-anti-semitism.html
1•Tomte•6m ago•0 comments

Get ready to see a lot more mini-trucks on Colorado's roads

https://www.cpr.org/2025/05/13/law-allows-japanese-mini-trucks-colorado-roads/
1•mooreds•6m ago•0 comments

Unicode in Five Minutes ⌚ (2013)

https://richardjharris.github.io/unicode-in-five-minutes/
1•Tomte•6m ago•0 comments

Show HN: Wavesly – Check Sea and Ocean Temperature

https://www.wavesly.io
1•coolpool•7m ago•0 comments

Show HN: Smol vsc*de plugin to find in all open files via native search

https://github.com/f-person/vscode-search-in-open-files
1•fperson•7m ago•0 comments

Scott Forstall on the Future of Siri and AI (2017) [video]

https://www.youtube.com/watch?v=IiuVggWNqSA
1•bangonkeyboard•11m ago•1 comments

October the First Is Too Late

https://gwern.net/fiction/october
6•adiabatty•11m ago•0 comments

Catalogue of Novel Operating Systems

https://github.com/prathyvsh/os-catalog
1•lioeters•12m ago•0 comments

Keyboard Sounds – Add sound effects to your typing experience

https://keyboardsounds.net/
3•nfiscaletti•15m ago•0 comments

Rafale maker Dassault shares plummet, Avic Chengdu maker of J-10 stock soar

https://www.hindustantimes.com/business/rafale-maker-dassault-aviation-shares-plummet-amid-india-pakistan-tension-chinas-cac-stock-soars-101747108446631.html
2•teleforce•16m ago•0 comments

My full statement regarding DOOM Eternal (2022)

https://medium.com/@mickgordon/my-full-statement-regarding-doom-eternal-5f98266b27ce
6•microsoftedging•19m ago•0 comments

LLM functions in TypeScript: a composable pattern for prompt/LLM/parse/execute

https://medium.com/llm-exe
2•llm-exe•21m ago•1 comments

The Dumbest Move in Tech: Laying Off Developers Because of AI

https://ppaolo.substack.com/p/the-dumbest-move-in-tech-right-now
2•paolop•24m ago•4 comments

Gitlab 18.0 Released with Gitlab Duo for Premium and Ultimate

https://about.gitlab.com/releases/2025/05/15/gitlab-18-0-released/
2•bmaupin•25m ago•0 comments

Keep calm (but delete your nudes): the new rules for travelling to America

https://www.theguardian.com/us-news/2025/may/15/travel-trump-america-us-border-detentions
3•n1b0m•26m ago•0 comments

Has Grok lost its mind and mind-melded with its owner?

https://garymarcus.substack.com/p/has-grok-lost-its-mind-and-mind-melded
5•NotInOurNames•26m ago•0 comments

The current state of TLA⁺ development

https://ahelwer.ca/post/2025-05-15-tla-dev-status/
7•todsacerdoti•26m ago•0 comments

OpenAI to Z Challenge

https://openai.com/openai-to-z-challenge/
1•Develra•28m ago•0 comments

Why untested AI-generated code is a crisis waiting to happen

https://leaddev.com/software-quality/why-untested-ai-generated-code-is-a-crisis-waiting-to-happen
1•mooreds•28m ago•0 comments

Ask HN: Is Substack the New Medium?

6•behnamoh•30m ago•1 comments

What's New in the Oracle Solaris 11.4.81 CBE Release

https://blogs.oracle.com/solaris/post/whats-new-in-the-oracle-solaris-11481-cbe-release
1•naves•30m ago•0 comments

About Asteroids, Atari's biggest arcade hit

https://www.goto10retro.com/p/about-asteroids-ataris-biggest-arcade
2•rbanffy•30m ago•0 comments

China launches satellites to build the first supercomputer in orbit

https://www.scmp.com/news/china/science/article/3310506/china-launches-satellites-start-building-worlds-first-supercomputer-orbit
4•giuliomagnifico•31m ago•0 comments

Open-sourcing Pyrefly: A faster Python type checker written in Rust

https://engineering.fb.com/2025/05/15/developer-tools/open-sourcing-pyrefly-a-faster-python-type-checker-written-in-rust/
1•vquemener•31m ago•0 comments

Smart Money Loses to Retail Crowd That Bet on Epic Stock Rebound

https://www.bloomberg.com/news/articles/2025-05-15/smart-money-loses-to-retail-crowd-that-bet-on-epic-stock-rebound
2•littlexsparkee•32m ago•1 comments

Windsurf SWE-1: Our First Frontier Models

https://windsurf.com/blog/windsurf-wave-9-swe-1
10•arittr•32m ago•0 comments

Show HN: Full LLM fine-tuning and evaluation guide

https://ubiai.gitbook.io/llm-guide
1•Mesterniz•33m ago•0 comments
Open in hackernews

Pathfinding

https://juhrjuhr.itch.io/deep-space-exploitation/devlog/945428/9-pathfinding
78•sebg•6h ago

Comments

ninetyninenine•5h ago
One efficiency update you can make is that if background objects don’t move, then you don’t need to recalculate the path. So check if anything moved before recalculating.
inetknght•5h ago
That's true until the map itself changes, eg other objects moving around in the calculated path
ninetyninenine•5h ago
Yeah I said that. If nothing moves. No need to change.
blt•3h ago
Sure, but in games sometimes improving the average case is less important than the worst case.
ninetyninenine•2h ago
So you're saying everything always moves all the time so it's more efficient to just never check and have the algorithm assume something moved always.
Maxatar•2h ago
For most real time systems, including many games, it doesn't matter if one is more efficient than another because what matters is the predictability that comes from always rendering a complete frame in 1/60th of a second.

In many cases checking if absolutely nothing changed in a system isn't trivial either. You either have very fine grained tracking which involves a great deal of complexity and increased memory cost, or very broad tracking which results in a lot of false positives.

stonemetal12•1h ago
No, if it takes 1 ms to check if things have moved, and 5 ms to do the pathfinding then the worst case is 6ms when something moves. A guarantied 5 makes for a more stable frame rate than a sometimes 1ms, sometimes 6ms calculation. Often times 60 FPS average with high variability feels worse than 30 FPS with low variability.
chrisdalke•4h ago
Writing path planning code is one of the most enjoyable programming tasks. Love the visualizations.

The path following code is also interesting because I bet you'll run into some corner cases where the A* path thinks a path is feasible, but the vehicle overshoots and hits something. Although in a game I guess that adds to the fun & chaos.

wduquette•4h ago
Re: visualizations, yeah, it’s really easy to caught up in playing with the algorithm just to watch it run rather than using it in your project. Been there, did that. For two distinct projects.
juhrjuhr•1h ago
This definitely happens! Mostly it's from the NPC taking a corner a little too quickly when there's obstacles around. I've added data to the resulting path so that the NPC can know how far each path step is from an obstacle so that it can slow itself down first.

Like you said, it adds a lot to the fun so I'm only trying to smooth out those cases that look stupid.

johnh-hn•9m ago
Indeed. There is something satisfying about building these and watching them in full flow.

A couple of years ago, I completed a pathfinding assignment designed by David Churchill (https://www.cs.mun.ca/~dchurchill/) for his Algorithmic Techniques for AI course. I'm not a student, and only his students have access to the actual assignment files, so I made a faithful recreation of it by looking at slides he had on a video at the time. The assignment is about pathfinding on a 2D grid. That's fun enough, but I've wanted to put my own spin on it.

Over the past few weeks, I revisited this and applied it to real-world mapping data from OpenStreetMap instead. It uses OverPass API (https://dev.overpass-api.de/) to fetch the data, which is free to use. The data loading times can be a little unpredictable, especially for larger search areas, but I'm happy with it how it turned out. You can find it here if you're interested: https://johnh.co/projects/openstreetmap-pathfinding/

andrewmcwatters•3h ago
I remember fondly messing around with some pathfinding with some friends in my 20s and adding random amounts of cost to nearby nodes. This has the distinct effect of making NPCs meander around, or follow a "drunken path."
dgb23•3h ago
I like this idea. One could imagine certain types to skew the costs for interesting reasons. Small animals might want to move in a sort of scanning, zig-zag way for example.
andrewmcwatters•2h ago
Yes! Very creative thought. I hadn't tried abstracting the idea to other types of "effort."
90s_dev•3h ago
See also https://www.redblobgames.com/pathfinding/a-star/introduction...

One of the first games I ever played was Warcraft I, and it was one of the games I always wanted to make but never could. One of the missing pieces of the puzzle was path finding. I still don't understand it, but at least now I have two resources that I can read when I'm done building my game maker and ready to make my game!

dgb23•3h ago
WC1 has fairly blocky movement and is grid based. It seems like units literally move from tile to tile so to speak.

If this is actually the case, you could try the Lee algorithm: https://en.wikipedia.org/wiki/Lee_algorithm. It's extremely simple and effective.

You might want to try adjusting it for diagonal movement and you probably don't want to store obsolete path sections, but only turns.

dgb23•3h ago
Neat article!

This will depend on the type of game or application, but one thing I've been doing is to do the more rigorous pathfinding when the environment (collision map) changes in order to generate a sort of precomputed pathfinding map (grid, or graph). When I search a path, or route for an entity, then it's on that pathfinding map.

Again, it depends on how that simulation fundamentally works. Some have natural POIs, crossroads and corners that one can work with. Others might need some heuristics to determine those or merge together paths. It might also be worth trying to use a very coarse logic for gross movement but adjust the actual path moment to moment, but that's just an idea that I never tried.

The approach in the article is of course very dynamic, which has the advantage of being excellent at trying stuff out and visualizing it.

I personally never tried out the space partitioning mentioned in the article and don't understand it fully. But there might be strong similarities to what I described above.

Sharlin•2h ago
What you refer to is commonly called a navigation mesh: https://en.wikipedia.org/wiki/Navigation_mesh
Sohcahtoa82•2h ago
I'm surprised it takes several milliseconds to find a path.

We've been using A* to find paths in games for over 20 years now. We did it on CPUs with speeds measured in Mhz. Higher clocks and architecture improvements mean we're a couple orders of magnitude faster. How is it that it takes so long to operate on modern hardware?

paulddraper•2h ago
I'm guessing it might be multiple paths for multiple NPCs. But not sure.

And if you were performance conscious, you certainly would not do lots of pathfinding from scratch on every frame.

munificent•1h ago
Games typically precomputed much of the pathfinding information and assumed a non-destructible world. The whole thing in the article about recomputing the blocked/non-blocked state is a thing many games with pathfinding simply didn't do at runtime at all.

They usually pathfinding on a larger granularity with more of the world aligned to a larger grid. Since asteroids are so organically shaped and freely movable in this case, it necessitates a finer pathfinding grid. It looks like they're roughly 6-8 pixels here. In an older game, it could easily be 16 or more. Pathfinding cost scales quadratically as the grid gets finer.

Also, while CPU speeds have increased, RAM access rates have not kept up. It's quite hard to actually keep the CPU busy and not have it stalled waiting for memory very often. "Data-oriented design" is a whole little subfield dedicated to dealing with this problem.

juhrjuhr•1h ago
Hey, I'm the developer of the game in the blog post. What takes several milliseconds is the number of world queries that need to be made to detect blocking objects and also object proximity. This is why I went with a quad tree to try to speed that part of things up.

Once those queries have been made the actual search is very fast. The problem then is that those queries need to be made again due to the dynamic nature of the game world.

stefan_•38m ago
You probably realized its absurd to have 50000 square nodes in your pathfinding graph and instead divided the area into 50 convex polygons (if that). Convex polygons being the basic shape because you can go directly from every point within to every other point within.
munificent•1h ago
"This kind of efficiency problem is something that looks ripe for multi-threading, but the main problem I had here is that all the world state of the game is held on the main thread and in complicated structures"

Crazy idea but I wonder if it would be worth it to have the pathfinding thread simply have its entire own copy of the mutable world state. Then when anything changes the world, both copies are updated roughly in parallel.

It would be a ton of duplicate work, but if you're on a machine with cores sitting there doing nothing... why not?

juhrjuhr•1h ago
Hello!

I'm the developer of this game. Thanks very much for your interest and discussion here :)

I'm starting to feel like I didn't go into enough detail with my post, since there's a lot I could talk about and also a lot I could benchmark to give you some actual numbers on performance. But maybe I'll leave that for a different post in the future.

The game I'm developing is a commercial project, so it would be silly to be on the front page of HN and not try to direct people towards the commercial side of things. Here is the link to the game's steam page, you can wishlist and maybe buy the game when it's released so I can afford living expenses and expensive coffee beans: https://store.steampowered.com/app/3656660/Deep_Space_Exploi...

Thank you! :)

malux85•37m ago
Great particle effects! Wishlisted and waiting!
tavianator•28m ago
You may want to look into improvements to A* for grids, like Rectangular Symmetry Reduction.
johnh-hn•2m ago
This is a cool concept. How long have you been working on it? And do you have a rough idea of when you'll release it?