HTML5 video game optimization

Closed
ftiercel Posts 119 Registration date Saturday September 23, 2006 Status Member Last seen February 8, 2014 - Feb 7, 2014 at 09:41 AM
 Blocked Profile - Feb 8, 2014 at 07:41 PM
Hi,

We have created Game Cloud, a site where everybody can easily create or modify HTML5 video games:
https://gamecloud.fandom.com/wiki/Game_Cloud_Wiki:Game_Cloud_Wiki

But the games often lag so we need to improve the game engine. Have you got some advices or good practices to speed up the render of the games? We have already used canvas instead of raw images to handle the sprites but it's not enough. We have tried webGL-2d but it run too slowly.

Links to the game engine code:
https://gamecloud.fandom.com/wiki/MediaWiki:Common.js
https://gamecloud.fandom.com/wiki/MediaWiki:GameCloud.js
https://gamecloud.fandom.com/wiki/MediaWiki:GamePlayer.js
https://gamecloud.fandom.com/wiki/MediaWiki:GameEditor.js

Thank you.
Related:

1 response

Blocked Profile
Feb 7, 2014 at 07:58 PM
WOW, that is cool!

The processor on the server side, what is it at in terms of usage?? Anything over 80% and you are cooking it!

How many image servers are you pointing to? Chop the image loading up. You want a smaller train with smaller pack, then one large one with a bunch of small packages.

It may be a bandwidth issue on resources. Chop up who serves what if you have everything else in place. I understand, not what you wanted to hear.

CPU or bandwidth?
0
ftiercel Posts 119 Registration date Saturday September 23, 2006 Status Member Last seen February 8, 2014
Feb 8, 2014 at 02:39 AM
It should be only a CPU issue, not a bandwidth issue as the game starts only when all the resources are loaded and there is no other server connection then:
https://gamecloud.fandom.com/wiki/Minefield

But I take note of your advises. Any advises are welcomed.

PS: I see tags that appear below my message and I think I was supposed to remove "bandwidth".
0
Blocked Profile
Feb 8, 2014 at 11:26 AM
My understanding is that sprites are pretty cpu intensive. Make certain the sprite is no larger than nec. So, if you have a scaled item, do not use the same size sprite and make it smaller, actually produce a smaller sprite.

Have Fun!
0
ftiercel Posts 119 Registration date Saturday September 23, 2006 Status Member Last seen February 8, 2014
Feb 8, 2014 at 12:58 PM
I have uploaded images for the sprites that have exatly the same size than the size of the sprites. I think that's what you mean, isn't it? I wonder if it is better to have one image for one sprite or all the sprites on one single image but it should only impact the game loading time.

Are there tools to profile the execution to see what part of the code is too slow?
0
Blocked Profile
Feb 8, 2014 at 07:41 PM
If not, you may need a debug mode. Just a trigger, that outputs conditions to a console...Just an idea.

They do have BENCHMARK tools. But sometimes, a good ECHO of a line will suffice. How many machines has it been tested on?
0