Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LibGDX HTML runs slowly

I've been writing a game with LibGDX and it's been running smoothly on both desktop and Android for months now, although I recently tried to deploy it to HTML. Unfortunately, it runs at <1 fps in Chrome. Even when I take out some effects, it's very slow. I get about 5fps with ~5 images on the screen and 320x240 resolution.

I just installed GWT for this and am not familiar with web stuff, so I'm probably missing something crucial. I compile and run, select "Web Application", then click on the link Eclipse gives me in the "Development Mode" panel. I get a cool loading bar, and then my game shows up and plays like it's on the ENIAC. What steps do I take to make this run normally? Sorry if this is vague, this is my first web game so I don't know what I don't know, and the Google was coming up dry.

like image 382
GraphicsMuncher Avatar asked Jul 03 '13 16:07

GraphicsMuncher


1 Answers

You are running it in "hosted" mode, with the debugger attached. This is generally the case when running from Eclipse by choosing "Debug as Web Application" or "Run as Web Application". Unfortunately, this makes it incredibly slow. If you detach the debugger (by removing the query string from the launch url), the speed will increase substantially. Also, you might try Super Dev mode.

Note that doing a full GWT Compile of the project and running it from an external web server will also run at full speed.

like image 157
nEx.Software Avatar answered Oct 04 '22 07:10

nEx.Software