pyskool
pyskool copied to clipboard
Game bits run fast on i7
Hi again,
Just a quick one really - i finally got the game running on my Macbook (hooray for OSX's lack of friendliness with python / pygame) and i'm much enjoying Back to Skool Daze, and hopefully this should help me look into controllers for the game.
However, what i have noticed is that screen scrolling and (wierdly) jumping, seem to run really fast. The scrolling practically looks like a screen 'jump' rather than a scroll. I can only assume this is due to the speed of the host machine?
So far, every other area looks to be normal.
The speed of the host CPU shouldn't affect the speed of the game (well, unless the CPU is really slow, I suppose).
Pyskool uses Pygame's Clock.tick() method in various places to keep the game running at a good speed (i.e. slow it down where necessary):
https://www.pygame.org/docs/ref/time.html#pygame.time.Clock.tick
The documentation for that method does say this:
Note that this function uses SDL_Delay function which is not accurate on every platform, but does not use much CPU. Use tick_busy_loop if you want an accurate timer, and don't mind chewing CPU.
So as an experiment, you could hunt down the Screen.scroll() method in graphics.py and change the last line from:
clock.tick(self.scroll_fps)
to:
clock.tick_busy_loop(self.scroll_fps)
If that works, then the jumping issue could probably be fixed in the same way.
That's great - thanks. I'll defintely give that a go
Let me know how it goes.
Of course, the other possibility is that the default screen scroll speed is just too high for your liking. In which case you can modify the ScrollFps
parameter in the [ScreenConfig]
section of the ini files. Change it from 20 to 10 to halve the scrolling speed.
No luck with clock.tick_busy_loop
sadly
Increasing the overall scroll FPS just means that that 'wait' during the scroll is longer, but it still effectively 'flicks' onto the next screen, meaning there is no actual 'scrolling' to be seen.
Ah, I misunderstood what the problem was. So it's not that it's scrolling quickly, it's that it's not actually scrolling (i.e. moving left or right by one tile column at a time) at all? Sounds like the display is not updating between the start of the scroll and the end. Which is weird. Right now I have no idea why that might be.
That must be it - i had assumed it was just super-fast because of the behaviour of say, jump and kiss which are both very 'fast' actions.
I'm pretty sure it ran great on my Pi though, which tbh is my 'target' machine, it's just a lot easier to test via my laptop, and i didnt think it was intended behaviour!