Hi. If you have 14996 sprites that are not visible, and do not need to
be processed every frame, the greatest performance improvement you will
get is by using a spatial hash instead of a flat container such as a
sprite group, list, or dict.
Even if off-screen sprites need some processing near the edges of the
screen a spatial hash will give you a big boost.
On 6/14/2017 4:39 PM, babaliaris wrote:
Hello.
I'm trying to create a game engine with the maximum possible game
objects per scene.
These days, i'm trying to understand how much the blit method costs,
so for this purpose i created a mini
game engine and impremented it to create a game which all it does is
blitting 15000 images
on the screen (Actually six, because as you will see below, the other
14996 are off the screen).
So this is how my engine works:
Download the source code: Github Repository
<https://github.com/babaliaris/Pygame-Engine-For-Forum>
Engine Structure <https://s3.postimg.org/a1pe1d0ab/structure.png>
Game Result <https://s3.postimg.org/o6v7369bn/Capture.png>
As you can see, the game runs in 50-60 fps.
My processor is: AMD FX™ - 6350 Six Core 3.90 GHz. Can i do better?
------------------------------------------------------------------------
View this message in context: How much blit costs?
<http://pygame-users.25799.x6.nabble.com/How-much-blit-costs-tp3071.html>
Sent from the pygame-users mailing list archive
<http://pygame-users.25799.x6.nabble.com/> at Nabble.com.