Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Libgdx "Drop" game tutorial, HTML really slow fps  (Read 3821 times)
0 Members and 1 Guest are viewing this topic.
Offline philfrei
« Posted 2013-08-05 04:55:45 »

I was able to get the Libgdx tutorial game "Drop" working as a desktop application.
Here's the url for the tutorial:

I have a couple questions about the HTML5 project.

First of all, it seems to be running at a really slow fps. It takes a good second to respond to keystrokes or mouse button clicks, and the sound effect comes considerably after the event on the screen.

Is this normal?

Also, I am getting this warning repeatedly:

[WARN] [com.badlogic.drop.GwtDefinition] - Something other than an int was returned from JSNI method
'$ClientRect::getLeft()': Rounding double (178.33334350585938) to int for int

Any thoughts or advice?

[EDIT] Just noticed, there's lots of messages being posted to the Console, and during the 'game' lots of 'keydown' lines. I could see where this might be slowing down performance. Is there a way to optionally turn off the console messaging? It seems like that might help *some* but maybe HTML5 is just going to be slower, regardless? Or I have to get out of Eclipse and try running it?

music and music apps:
Offline nexsoftware

Junior Devvie

Medals: 9

« Reply #1 - Posted 2013-08-07 03:48:52 »

When you run a GWT application from Eclipse (via Debug as Web Application or Run as Web Application) it runs in so-called hosted mode, where much of the code is still running as Java. The slowness is caused by this as everything has to marshaled between the browser and the code server. There are a couple ways to get around this.

The first is easier, but makes debugging nearly impossible. By instead compiling the GWT project and putting it on a server (local, or on the web), you'll get normal frame rates as all code will be compiled to javascript. Unfortunately, compiling can take a long time and as previously noted makes debugging very difficult.

The second way is setting up "super dev" mode. Here, the code is compiled as before but it takes less time. Debugging is possible but takes some steps to do. Mario wrote up a nice post on how to set it up so I'll just point you to that.

Hope it helps.
Pages: [1]
  ignore  |  Print  

EgonOlsen (79 views)
2018-06-10 19:43:48

EgonOlsen (59 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

DesertCoockie (261 views)
2018-05-13 18:23:11

nelsongames (159 views)
2018-04-24 18:15:36

nelsongames (158 views)
2018-04-24 18:14:32

ivj94 (901 views)
2018-03-24 14:47:39

ivj94 (162 views)
2018-03-24 14:46:31

ivj94 (813 views)
2018-03-24 14:43:53

Solater (177 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!