danShumway / python_math

A puzzle game designed to teach early math concepts about addition, subtraction, and order of operation.
MIT License
6 stars 2 forks source link

performance on XO #21

Closed danShumway closed 10 years ago

danShumway commented 10 years ago

Possible causes we've thought of so far.

-- Using wildcards for measuring input?

-- Are our sprites updating too much for some stupid reason?

-- After doing some tests, it does not look like this is an issue with the snake. making the snake super long does not actually decrease the speed in any meaningful way.

danShumway commented 10 years ago

Confirmed - something to do with our level size - must be sprites or arrays or some kind of crap.

mstubinis commented 10 years ago

i just check spyral's image class. They are calling pygame.Surface.convert_alpha() so it is not that.

Im going to fool around with different image sizes and tile amounts, as well as use solid images instead of image files for testing

mstubinis commented 10 years ago

using solid images vs image files had no effect, it still ran slow.

mstubinis commented 10 years ago

i dont believe it i think i fixed the problem.

so I had the level tiles being loaded in and positioned based on their row and column times the image size. But when i ran it on my pc it kept scaling to fit my screen resolution so some tiles were offset by 1 pixel some were not. I decided to multiply their final positions by 0.98 or something so these tiles wouldn't be a pixel to far apart and thus make the screen look ugly. Apparently pygame/spyral doesn't like these positions so when i got rid of the 0.98 the level seemed much faster.

mstubinis commented 10 years ago

when running the game on a windows pc at a resolution of 1200 x 900 there are no wierd artifacts so its safe to keep the sprites positioned normally. Commit to follow shortly...

danShumway commented 10 years ago

Is this something that we should tell the Spyral team about? Converting pixels from decimal to int theoretically should be something Spyral can handle.

mstubinis commented 10 years ago

Yea we should tell them. At least clear our issue about our performance problems with them.

danShumway commented 10 years ago

Sent them a quick explanation, here's the thread for posterity's sake: https://github.com/platipy/spyral/issues/60

This is still a little weird to me - I'm not sure how that works into performance increasing over time, unless maybe Spyral was moving the sprites around by fractions of a percent over time or something weird.