Closed feiyuhuahuo closed 3 months ago
Your method would occupy roughly 4.5 GiB of RAM at 24 bits-per-pixel RGB. There is no single fool-proof way around this. You could try using run-length encoding (RLEACCEL), but I don't think it could fix your issue, unless your image is already so sparse that another approach would work even better. There are many ways to represent a large level in memory, but this bug tracker is not the place to discuss spatial data structures or game design.
I want to develop the following function: The game window just show part of the whole world map, and the window can be dragged to anywhere as the player want.
The world map is quite large, thus I was thinking use a super large image, e.g. 40000*40000 pixel. I tried
pygame.image.load()
but it takes too long time to finish loading and occupies too large memory. How to deal with this? Is my method right that use a super large image as the entire scene map?