4 ms·
Multithread never. You know in your heart of hearts that DF wasn't built with modularity in mind and that the code is a horrific mess of dependencies everywher
by jandrese 8y ago
Multithread never. You know in your heart of hearts that DF wasn't built with modularity in mind and that the code is a horrific mess of dependencies everywhere and making it multithreaded would require a near complete rewrite of the system.
- a1369209993 8y agoActually, one of DF's biggest CPU-sinks is AI pathfinding, which is a: embarrassingly parallel and b: highly speculatable[0], so the only hard part would be keeping map walkablity data in-sync or read-lockable (depending on whether you want a separate copy or not). 0: ie, you can fire off a pathfind from your current position, keep walking for several steps (many game ticks) before getting the result back, and just do some minor fixups to make it work.
- mikekchar 8y ago> the only hard part would be keeping map walkablity data in-sync or read-lockable I suspect that this is entirely the problem. For quite a while not I've gotten the impression that all of the game state in in a single data structure. Also I'm pretty sure that there are update anomalies galore even now. It's almost certain to be a herculean task. I might be wrong, but the fact that Tarn has never even attempted it makes me suspect that I'm right ;-)
- baroffoos 8y agoShould rewrite it in rust