Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (109)
games submitted by our members
Games in WIP (536)
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 1378 times)
0 Members and 1 Guest are viewing this topic.
Online philfrei
« Posted 2013-08-05 06:55:45 »

I was able to get the Libgdx tutorial game "Drop" working as a desktop application.
Here's the url for the tutorial:
http://code.google.com/p/libgdx/wiki/SimpleApp

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:

1  
2  
[WARN] [com.badlogic.drop.GwtDefinition] - Something other than an int was returned from JSNI method
'@com.google.gwt.dom.client.DOMImplStandardBase$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?

"Greetings my friends! We are all interested in the future, for that is where you and I are going to spend the rest of our lives!" -- The Amazing Criswell
Offline nexsoftware

Junior Member


Medals: 9



« Reply #1 - Posted 2013-08-07 05: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.

http://www.badlogicgames.com/wordpress/?p=3073

Hope it helps.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (12 views)
2014-08-01 22:53:16

CogWheelz (14 views)
2014-08-01 22:51:43

CopyableCougar4 (15 views)
2014-08-01 19:37:19

CogWheelz (19 views)
2014-07-30 21:08:39

Riven (27 views)
2014-07-29 18:09:19

Riven (16 views)
2014-07-29 18:08:52

Dwinin (14 views)
2014-07-29 10:59:34

E.R. Fleming (35 views)
2014-07-29 03:07:13

E.R. Fleming (13 views)
2014-07-29 03:06:25

pw (44 views)
2014-07-24 01:59:36
Resources for WIP games
by CogWheelz
2014-08-01 18:20:17

Resources for WIP games
by CogWheelz
2014-08-01 18:19:50

List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22
java-gaming.org 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‑gaming.org
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!