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

Adding multi threading optimization #1741

Closed zay448345045 closed 3 months ago

zay448345045 commented 3 months ago

Hello developers.I would like to ask if the game has considered adding multi threading optimization. There are many monsters placed on the SPD based sandbox dungeon, but it runs very slow. Upon checking the CPU usage of the phone, it was found that only one core is in use, while the other cores are not.

zay448345045 commented 3 months ago

The tower defense dungeons is even more severe, with thousands of monsters and items falling on the interface, causing fps to drop to single digits and severe lag. For large modules, parallel optimization is required.

00-Evan commented 3 months ago

I actually replied to another issue recently that was similar to this (#1738), I'll copy-paste the reply here:

"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."

I also have nothing to do with any projects that aren't Shattered Pixel Dungeon itself, and couldn't comment as to whether there are performance issues in any other Pixel Dungeon version.