Re: [pygame] Drawing efficiency question

2022-03-01 Thread Rick van der Meiden
As your world gets bigger and has more objects, your game will slow down even more. (Even if you directly use openGL, I suspect, although I haven't used it myself). You will need a spatial index. I have some code that i'm willing to share, if you're interested (or anyone else here, drop me a line).

Re: [pygame] Drawing efficiency question

2022-03-01 Thread Jasper Phillips
I've dealt with this in my own game, handling thousands of such drawn elements. Based on that I have two general suggestions: 1) If you've got performance bottlenecks, very often they aren't where one first suspects! Better to break out a profiler and measure. That said, I don't have any experienc

Re: [pygame] Drawing efficiency question

2022-03-01 Thread Greg Ewing
On 2/03/22 12:02 pm, Irv Kalb wrote:> I'm wondering if my code to check if an element is within the viewable area, is actually doing more work than not bothering to check at all. If the drawing of each object is just a blit call, then your checks are probably just duplicating what pygame is alr

Re: [pygame] Drawing efficiency question

2022-03-01 Thread Andrew Baker
Typically, entities outside of the viewable area may not be updates or may update at a much reduced frequency. This is true of even C++ games. On Tue, Mar 1, 2022, 3:10 PM Irv Kalb wrote: > I am developing a game but I'm running into some cases where the game > slows down too much. A few detai

[pygame] Drawing efficiency question

2022-03-01 Thread Irv Kalb
I am developing a game but I'm running into some cases where the game slows down too much. A few details ... The game lives in a world whose size is much larger than what the user can see in the window. (For now, the world is 3000 x 3000, but the window is 640 x 640 - I could decide to change