00-Evan / shattered-pixel-dungeon

Shattered Pixel Dungeon is an open-source traditional roguelike dungeon crawler with randomized levels and enemies, and hundreds of items to collect and use. It's based on the source code of Pixel Dungeon, by Watabou.
https://shatteredpixel.com/shatteredpd/
GNU General Public License v3.0
4.68k stars 1.09k forks source link

Multithreading support #1738

Closed CORRUPTEDUSER404 closed 3 months ago

CORRUPTEDUSER404 commented 3 months ago

I have noticed with my CPU watch widget that this seems to not have multithreading support.

Perhaps this could be added to an upcoming version because many devices have more than 1 thread

00-Evan commented 3 months ago

The game actually does make use of two CPU cores already. The game's rendering loop occurs on one, and game logic occurs on another. This is mainly so that infrequent but more intensive game logic (e.g. when certain items are used or certain enemies act) wouldn't result in framerate hitching, especially at 120+ fps.

Parallelizing the game more than this would be a massive undertaking with little to not benefit, as the game's rendering is already more than lightweight enough to run on one CPU core.