• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 Game does not run smoothly in HTML5, any ideas?

F

Frycandle

Guest
Hey everyone,

I've been testing builds for my game to see if I can export it in the Web format and so far I have not encountered any major bugs, I do however notice some sort of a stutter or lag when my objects move across the screen. About 9/10 times when testing it on GameJolt I get this issue, but I have noticed it occasionally runs smooth and the way it was meant to work. Tested with Google Chrome.

I'm quite inexperienced with HTML5 and might not be used to the quirks of working with this export, but I am hoping you guys have some clues or pointers of things to avoid or possible causes for this problem?

The objects are moving at integer speeds, so I assume it has nothing to do with floating points math.

Thanks in advance!

- Frycandle
 

The-any-Key

Member
What I understand is the html5 target a bad candidate when it comes to floats. If you however increase the resolution and use whole pixels. It should work better.
 

gnysek

Member
What I understand is the html5 target a bad candidate when it comes to floats. If you however increase the resolution and use whole pixels. It should work better.
I think that "smooth" in this case means "without lags", not "graphic is blurred" ;)
 
F

Frycandle

Guest
No idea if this would work but I would try using lerp so it predicts where it should actually be.
Thanks for thinking with me on this, everything is moving at round numbered speeds though. Haven't found a fix yet.

What I understand is the html5 target a bad candidate when it comes to floats. If you however increase the resolution and use whole pixels. It should work better.
But shouldn't things run without lag because I already made the moving speed a round number in the first place? Everything should therefore move at whole pixels, I'm guessing the lag is caused by some other performance related mistake I might have made in HTML5.

I think that "smooth" in this case means "without lags", not "graphic is blurred" ;)
That is correct, the graphics are not blurred, they do however jump / lag when moving across the screen, despite them moving at integer speeds.

Perhaps it has something to do with large sprites or the textures loading. I'm using quite a lot of large sprites 200x200 and some of them up to 960x540 filling the game screen. (game is built at 960x540) I'm a hobbyist developer so wouldn't know where to look for a solution on this.
 
Last edited by a moderator:
L

Lucia

Guest
I made a game in html5 using GM, it's not the best way to make a html5 game. terrible. It's sad. I used construct2 to make it. but I dunno if now the problems are solved. I hope.
 

chmod777

Member
Is WebGL on or off (in the HTML5 options)? Things are always smoother with WebGL, but in some cases this is particularly noticeable.
 

gnysek

Member
Ensure hardware acceleration is enabled in options (however this would affect all other HTML5 games too).
 
Top