EDIT: The problem must’ve been something temporary with my machine. The game runs fine now without any code changes.
Hi
I have a small top down 2d game I’m working on, and when I make a HTML build it runs really slow.
The player character moves really slowly, both animation and x,y movement. I have some fade-out-fade-in transitions when I switch map, and they also seem to be really slow. It seems to run at half speed. If this had been an old c++ game I’d have thought my game loop was running too slowly.
My game is really bare bones:
One animated spritesheet sprite. Slow animation of maybe 10 fps.
One tilemap on screen, with four layers with 16x16 sprite tiles. Roughly one screen in total size.
Generated tilemaps (this does not seem to slow down much, but it’s a little slower than on desktop)
No sound, no effects, no special renderers.
Without having to post all my code, I was wondering if anyone had any idea what the problem could be?
I Haven’t tried the web profiler. How do I start that?
The game is just something I do to test out Defold, so there are no other players. I tried it in IE and it was slow, so I was just wondering if the HTML 5-engine has known limitations. Like I said, it looks like the game loop is slow.
There is not much to remove. Only the sprite and the tilemap are loaded at the start.
I have tinkered back and forth with different aspects of the game, so it’s possible I have some problem somewhere. Maybe something fires too many events.
OK, thanks!
The profiler shows my engine frame taking up 167 ms or thereabouts. Nothing else seems to take much time. All frames are red, which I assume is bad. What should I look for in the profiler?
Haha, I uploaded it to Itch.io and now it works properly. Now slow down!
So then I tried a local build and it works fine as well. Just to double check I tried my slow build from yesterday, and THAT works fine too!
So it must’ve been something going on with my computer. Maybe anti virus or something? Pretty weird. I have not even restarted my computer since yesterday, only hibernated it.
Well, it works as it should now, sorry for wasting everyone’s time
Here is the demo link if you want to check it out anyway. It’ not a game yet, just a test project to learn defold.