Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-game timer is unaffected by lag in scrolling levels #3

Open
friedev opened this issue May 4, 2019 · 1 comment
Open

In-game timer is unaffected by lag in scrolling levels #3

friedev opened this issue May 4, 2019 · 1 comment

Comments

@friedev
Copy link

friedev commented May 4, 2019

Issue

Levels that scroll horizontally or vertically (level 11 and 18 in normal mode) tend to play at a noticeably lower FPS on lower end hardware, but from what I can tell, the timer is unaffected by this lag. So even though the game becomes impossible to play at full speed, the timer counts as if you were. You can see an example of this on my speedrun. This problem, of course, makes it much harder to speedrun the game on slower computers or while recording.

Solution

The ideal fix would be some form of optimization for scrolling levels. As far as I can tell, the bottleneck seems to be CPU. An easier fix would probably be making the timer dependent on FPS by incrementing an internal timer for each frame and dividing by the target framerate to get the actual time to display.

EDIT: Another option would be to make the game skip frames instead of slowing down, if that's somehow possible. It wouldn't appear to run as well, but it would fix the issue in the context of speedrunning.

I've never used phaser.js so I'm not sure how easy this is to fix, but I would be very grateful if you could implement either of these solutions.

@ramorris3
Copy link
Owner

Hey, thanks so much for reaching out! Sorry it's taken so long for me to respond.

I didn't realize this game has any kind of following, and didn't discover the speed-run leaderboard until last week, even. I'd love to add more support for speed-runners, starting with this issue you mentioned.

The collision detection in this game needs optimization in general. It was one of my first projects, and I've learned a lot since then. I'd love to tackle optimization as a first priority, so I think i'll go with that, and keep updates here. If that doesn't work out, I can work on the timer code to make it more accurate when frames are skipped.

Are there any other ways I could improve the speed-running experience? Other small features that would reduce friction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants