Hacker News new | past | comments | ask | show | jobs | submit login

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.



Actually, 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.


> 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 ;-)


Should rewrite it in rust




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: