News for hackers. Stuff that matters.
Re:Dwarf Fortress Creator Explains Its Complexity and Origin... by Macuyiko on Friday June 26, 2020 @02:54AM (#23649419)
Forgive my ignorance, but do you have any good references to multi-threaded cellular automata implementations? This is something I've been dabbling with myself.
Re:Dwarf Fortress Creator Explains Its Complexity and Origin... by imtringued on Friday June 26, 2020 @04:54AM (#23650021)
You have two grids. Clear grid 2. Go over grid 1, calculate the new state for the current cell, write it to the second grid. At the end of a step you swap the grids.

Just slap on a good old "#pragma omp parallel for" with OpenMP (a nice guide is here [0]).

[0] https://bisqwit.iki.fi/story/howto/openmp/

I also found this pdf if you are interested. http://www.shodor.org/media/content/petascale/materials/UPMo...

Re:Dwarf Fortress Creator Explains Its Complexity and Origin... by 0-_-0 on Friday June 26, 2020 @06:23AM (#23650445)
You could even do it on the GPU, with 1 thread per cell.