Pa

Pathfind 1M agents to unique destinations in my video game

Hacker News

Pathfind 1M agents to unique destinations in my video game

Try it out here: https://yesbox.itch.io/archapolis Or video: https://www.youtube.com/watch?v=x0HCnQqF5K4 Hi HN I've been working on a city builder game for the last seven months. The first bar I wanted to pass was creating an efficient and more realistic path finding engine. Finally, version 0.1.0 of my game Archapolis is released! This is a toy/tech demo, but any and all feedback is really important to me, hence I'm releasing it now (for free). I'd also like to get an idea how well my code runs on a variety of machines, so if you feel like testing it out, I would love to hear from you and your results! I'll talk a bit about the path finding code here: - It will find all possible shortest paths between two points in nearly the same time as Dijkstra's, and store them efficiently in a (C++) vector (i.e. array) (max possible paths is the binomial coefficient formula) - An agent can access/find a path in constant time (just like a hash table) using some arithmetic (since the vector index is the "key"). - The game will generate the all pairs all possible shortest paths once you place a unit down, and update each time the road network changes. - The path finding algorithm can also utilize preference weights (e.g. beauty, tourism, commercial, cultural neighborhood...) stored in roads. An agent that has a preference will take the shortest path from all possible shortest paths that match their preference. - In the download, these are colored roads for now, so units that match the road color will prefer those roads. - Its multi-threaded. On my machine, finding / storing all pairs all shortest possible paths in a 50 x 50 grid (with 9,800 nodes) takes 17 seconds (with six cores) and needs 2.5 GB of RAM. This is an extreme stress test. If using Manhattan block sizes, this is around 13 square miles of city, or roughly nine Cities: Skylines tiles. - In game, roads will be planned first, then placed all at once so only one update is needed. - I'm really happy with the results. Not only will units utilize all shortest paths between two points, the preference weights gives personality to each unit, so part of my unit AI is already done! - One other note: the one way roads are faster roads (less "weight"), though the agents will still move the same speed over them. They just create faster/shorter paths for testing the algo.

Share card

Actual performance

3points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Indie HackersFits the IH revenue-focused audience · Strong signals: efficiently · Missing: supports, reddit linkedin, podcasting
86%86% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Product HuntOn track for Day 1 leaderboard · Strong signals: mac, agents, agent · Missing: macos, cursor, claude
75%75% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: ide, io · Missing: https docs, excited, just released
61%61% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRFits verified-revenue profile · Strong signals: personal, video, month · Missing: mobile apps, ios, entrepreneurs
50%50% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: efficient, builder · Missing: plus, platform, intuitive
44%44% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Strong signals: arr · Missing: mrr, revenue, profit
19%19% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

We
WebGL 1M particles73%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

WebGL 1M particles

Hacker News8
Dr
Dragon – $1M Kitty65%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Dragon – $1M Kitty

Hacker News1
1m
1m video visualization of Covid-19 spread50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

1m video visualization of Covid-19 spread

Hacker News3
Ma
Manuzoid – Database of More Than 1M Manuals73%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Manuzoid – Database of More Than 1M Manuals

Hacker News234
Ga
Gazétor – A unique newspage selected for you47%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Gazétor – A unique newspage selected for you

Hacker News2
Videohead
Videohead61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Generate unique video overlays with AI

Product Hunt+3
My
My Labyrinth Video Game46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

My Labyrinth Video Game

Hacker News1
La
Labyrinth Video Game46%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Labyrinth Video Game

Hacker News6
Vo
Voyager, my video game made from wool39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Voyager, my video game made from wool

Hacker News2
Cr
Cryptris, a video game on cryptography32%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Cryptris, a video game on cryptography

Hacker News48