Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (121)
games submitted by our members
Games in WIP (577)
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  
  is okay dev path: first write -desktop with lwjgl, then convert to android?  (Read 945 times)
0 Members and 1 Guest are viewing this topic.
Offline philfrei
« Posted 2013-08-07 06:19:14 »

Converting my game to Libgdx is clearly a big task, and I'm disappointed that my custom-generated sounds would have to go through an audio device that only plays mono and has a large latency (via "AudioDevice" -- Playing PCM Audio http://code.google.com/p/libgdx/wiki/AudioDevice).

Am I misreading this, or does sound.play and music.play suffer from the same latency issues cited above? I'm pretty sure at least with sound.play and music.play one has control of volume and panning settings, so stereo must be possible, unlike with AudioDevice.

The coding of AudioDevice and sound.play and music.play all seem to rely directly on LWJGL implementation of OpenAL. I'm downloading source now to poke around and see if I can't rig up a way to play audio from the functional equivalent of a TargetDataLine and get stereo and decent latencies.

Whatever.

The main question is this: is it reasonable to go about rewriting my game's graphics via LWJGL's implementation of OpenGL, and include whatever I can conjure up to my satisfaction for the audio, as a first step, and then, once that is working, go about doing whatever is needed to make an Android-playable version of the game?

I can see that if Libgdx becomes necessary at the second stage, will I at least be able to keep any working LWJGL/OpenGL graphics already coded, and mostly only have to deal with the headache of rewriting the input interface and dealing with screens? Will there be other paths to recoding my MouseMotionListeners and etc without using Libgdx? How much pain are we looking at?

"It's after the end of the world! Don't you know that yet?"
Offline badlogicgames
« Reply #1 - Posted 2013-08-07 08:00:46 »

AudioDevice allows stereo playback. The latency is as good as it gets on Android (read horrible). The only other API on Android you can use is OpenSL, which has the exact same latency as AudioDevice.

Regarding GL: if you stick to OpenGL ES functionality on the desktop you'll be fine. But it's extremely easy to mes up.

There's a reason why gdx exists Smiley

http://www.badlogicgames.com - musings on Android and Java game development
Offline philfrei
« Reply #2 - Posted 2013-08-07 21:26:23 »

@badlogicgames
Thanks for clarifying about the latencies.

Is the latency equally bad for sound.play() effects playback? Bullets/explosions/utility clicks lag over a 1/10th of a second, routinely?

Or does this just apply to generated PCM data playback?

Do we get better latencies with pads as opposed to phones? Do you know generally how much better?

"It's after the end of the world! Don't you know that yet?"
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline davedes
« Reply #3 - Posted 2013-08-08 03:02:02 »

Android audio support has always been pretty awful. Sad

As to LWJGL vs LibGDX... I don't see much of a point in using LWJGL unless you just want to feel like a rebel. LibGDX exposes GL ES, so you can call glXXX functions directly. More likely, though, you will want to use LibGDX's utilities to increase your productivity and make your time as a developer less painful. Further; if you ever plan to support more than desktop, then LWJGL isn't really a great option.

That pretty much sums up my stance every time this subject comes up. Wink

Offline philfrei
« Reply #4 - Posted 2013-08-08 06:45:37 »

Thanks Davedes, I have a lot of respect for your opinion. (As well as many others here!)

Am feeling stymied though. As far as personal satisfaction, a big part is sound design and composing, or else I start asking myself wtf am I doing here when I could be investing more time just writing music and selling that.

OK, get a grip...

"It's after the end of the world! Don't you know that yet?"
Offline philfrei
« Reply #5 - Posted 2013-08-09 19:07:55 »

So far, I am really pleased with LWJGL. It is a thing of beauty, an implementation that fully expresses what I love about Java and rekindled my passion for programming a couple years ago.

Two weeks ago I passed a kidney stone. I know, TMI. But the relief I experienced then doesn't match the relief I am feeling now, letting go of GWT/Android plugins, Libgdx, et al., and discovering that LWJGL is so well written.

On to learning OpenGL!
Smiley

"It's after the end of the world! Don't you know that yet?"
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.

theagentd (20 views)
2014-10-25 15:46:29

Longarmx (53 views)
2014-10-17 03:59:02

Norakomi (47 views)
2014-10-16 15:22:06

Norakomi (35 views)
2014-10-16 15:20:20

lcass (39 views)
2014-10-15 16:18:58

TehJavaDev (69 views)
2014-10-14 00:39:48

TehJavaDev (69 views)
2014-10-14 00:35:47

TehJavaDev (61 views)
2014-10-14 00:32:37

BurntPizza (74 views)
2014-10-11 23:24:42

BurntPizza (46 views)
2014-10-11 23:10:45
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

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

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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!