1
DF Dwarf Mode Discussion / Re: Hypothetic Budget Increase for Toady
« on: June 09, 2009, 05:06:03 pm »
Toady could buy a compile farm.
Vroom vroom.
Vroom vroom.
March 6, 2024: Dwarf Fortress 50.12 has been released.
News: February 3, 2024: The February '24 Report is up.
News: February 4, 2021: Dwarf Fortress Talk #28 has been posted.
News: November 21, 2018: A new Threetoe story has been posted.
Forum Guidelines

Trying to multithread DF's pathfinding isn't going to work without almost a complete rewrite of how DF works, I'm afraid. That's something for T1 to attempt in DF 2.0, what we need now is route caching. Not only is it easier to implement, but it will provide a greater performance increase for all but a few trivial cases.Multithreading isn't as hard as you think. In many cases, making an algorithm run parallel is as simple as a few function calls to the appropriate library.


So we only can assume you just plan on putting down framework to have the pathing system multi-threaded, and not any improvements other than more paths calculated at once?Right now, yes. Like I said, I don't know exactly how Toady has the map and creatures represented and handled internally, so any optimizations beyond more crunching may or may not be helpful. I'm trying to develop my framework so that it is a little similar to KQ as DF uses a modified KQ engine. Toady is a little busy with other matters and can't create a Battle Champs type example, so right now we'll just have to make do.
Are you manually setting the number of worker threads or is it dynamic? I ask because I know the windows APIs will report WAY more threads than the processor can actually handle.Manually right now. I'm concerned with keeping the game cross-platform, so I'm not doing any Windows API magic so that Mac dwarfers can take advantage of any optimizations, too.
Wait, what?I think he means building a real-life fort in Lego and simulating a game of DF.
...Do you even know what Lego is?
As much as I love credit, I think you mean "Baughn and Kardos." I have been absolutely worthless in this thread. Though that is mostly because that while I understand the basic concepts involved in what coders like yourself are talking about, the implementation makes my head spin in five different directions. But keep on keeping on!Whoops, yeah. Stupid confusing topic summary box!
) It will allow you to place tons of cats and have them path to random points or points you select. You will be able to manipulate the walls, floors, and stairs of various z-levels... basically a really, really, really, really, really, really, REALLY primitive DF. The map will be adjustable and size, and will pretty much present the basic problem of pathing in DF minus flows, enemies, etc. The hope is that I will be able to implement multi-threaded CPU pathfinding and CUDA pathfinding, which would pretty much eliminate the problem of pathfinding lag for GeForce 8, 9, and 200 card owners.
Does KQ have the same time system as DF, where there's numerous 'ticks' between when one critter moves and another one moves? It's a very minor complication to parallelizing your pathfinding but it's an important one, because it means unless you play with the time a little, you might not have as many things to run in parallel as you would like.I don't think that would be a problem. The main issue is computing the actual path, which would be sped up by threading. Every creature that needs a path recalculation would put a request in a "queue" saying "I want to get here, please tell me how." The pathfinding handler would wait for every creature to put their request into the queue, crunch the numbers, and then tell each creature the appropriate path after it finishes.
Things to keep in mind about the Dwarf Fortress pathfinding:
-It should be able to handle multiple z-levels
-It is dynamic, not static (because building walls and locking doors messes things up).
-It should know when an job is innaccessable
Also, the title doesn't seem too helpfull.