Original Plattformer Template has poor performance in HTML

Hey :slight_smile:

iam new to Defold, and try the “Platformer-game” Template to work with it.

Unfortunately, I find that the HTML performance is not good. I’ve tried different browsers and computers.

I thought it was because of my changed code, and uploaded the original project unedited, with the same problems (laggs or shaking…)

Here the uploaded original Html Bundle: https://test.vezept.de/
The Original Lua Code and Project: https://github.com/aallnneess/Original-Defold-Plattformer-Template

I used the Release Variant, Texture Compression Enabled, Everything else unchecked.

Is it possible that the template is badly programmed or what can be the problem?

thanks
matze

I can confirm it is very janky. Will need to look at the project later.

1 Like

I downloaded your project and tried a local build and it works fine. So I tried an HTML build, strange behaviour occurred.
I think the key input’s repeat delay, repeat interval, and the fixed_update used in player.script are not compatible with the browser.
(And handle_obstacle_contact seems odd too.)

In my opinion, Platformer Defold tutorial is the best for a platformer tutorial.

2 Likes

Thanks for the help.

It’s nice that it’s not up to me/my hardware/software.

Of course, such a template can also be demotivating.

@slotet: I’ll work through the tutorial you post including all the links, thanks.

1 Like

What do you mean by “HTML performance is not good”? I ran your demo, it works great. Only sometimes I see camera and hero out of sync due to fixed update (probably related to this issue, I’m not sure).

Here is a video example (slowed down 10 times), i.e. the hero is 1 frame ahead of the camera in the middle of the video.

5 Likes

Hm, i changed fixed_update to update…

for me, know it works very good ?!

https://test.vezept.de/

Then you also need to disable use fixed timestep for physics in game.project.

I would like to note that if you want to work with physics in this mode, you should take care of pausing the game world. Otherwise the main character will fall through the floor into the void as soon as you switch the tab in the browser.

Hey,

yes, thats true.

Now that I understand 100% what update and what fixed_update does exactly…

I had time again today and tried to get the game to run under Html with fixed_update & update (interpolation with larp and so on) without flickering. But no change.

The " Platformer Defold tutorial " is nice, but its also without fixed_update.

Is there any working Html Game (Demo) with Code that i can look on with fixed_update ?

Or is the fixed_update solution simply not usable, at least for HTML & platformers?

thanks,
matze