Re: developing audiogames in java

2014-11-20 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: developing audiogames in java

Thats not as easy as you think. Every single programming language ever has an equivalent of it; Javas is the worst I have seen anywhere. Java is a case study in how *not* to do it though, in fairness, this may have a lot to do with javas age.The native keyword is an indication to the compiler of Java that a specific method or type is implemented in C, using JNI. This simply causes the java compilers to go look for it in C/C++. To actually do it, you need to implement a C++ library with the type, and then implement a second C++ library that uses the special Java C API to re-wrap it up into a nice Java class. You can maybe do them as one, but then youve wasted a bunch of effort because your C library is now Java-only forever. This involves a bunch of hand-coded lookups against the Java VM and has a lot of pain points--its the responsibility of the C/C+ side to make sure that Java objects stay alive, for one.
 p; As soon as you do this, your compile once is gone for good. Youre now either distributing platform-specific jars or compiling the library on multiple machines and doing a frankensteinish combination that loads the appropriate library version at runtime and packages them all. LWJGL does the latter, I think. Theres JNA, if you must, but you still lose the compile once thing and JNA says its an order of magnitude slower. Ive been looking into how to do this for Libaudioverse. Ctypes and similar do not frighten me. JNI gives me a headache every time I see the word, and JNA is out of the question because I want Android.In most languages, you convert the types in the language doing the bindings. In java, you have to do all the conversions and whatever else in C, so have fun.By the time you know C/C++ well enough to do this, you might as well just use C/C++. Its also not the specific problem 
 under discussion here: Java is too slow to do graphics in without using something like LWJGL, but the real killer is that java fails to deliver any good audio libraries.

URL: http://forum.audiogames.net/viewtopic.php?pid=195227#p195227




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: developing audiogames in java

2014-11-19 Thread AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector


  


Re: developing audiogames in java

I think that you guys are forgetting something: You can use the native keyword to define a native type. So yes, you can develop an audiogame in Java. Youll need to know a little C/C++, though, as Java doesnt have all of the... er... proper librariesfor it.

URL: http://forum.audiogames.net/viewtopic.php?pid=195201#p195201




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: developing audiogames in java

2014-11-16 Thread AudioGames . net Forum — Developers room : Aminiel via Audiogames-reflector


  


Re: developing audiogames in java

If still interested, you might have a look at my audio library based on JavaSoundhttp://quentinc.net/quentincsoundapibut as already said, its quite limited, and really not as fast as other libraries (the minimum buffer size I was able to work with was 75ms, which is quite a lot compared to the more usual 20-30ms)

URL: http://forum.audiogames.net/viewtopic.php?pid=194951#p194951




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: developing audiogames in java

2014-11-14 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: developing audiogames in java

Well, everything being said here is true. To provide a little bit of hope, though, lwjgl provides OpenAL bindings. Mind you, depending on how that communicates errors, youre either running up against checked exceptions (huge boilerplate blocks) or youre writing it as C (checking return values everywhere)... Lwjgl does give everything needed, its just not exactly fun and its really, really monolithic. Also, compile once run anywhere is never, ever true except for really small toy examples--in the real world you end up with a lot of platform specific code anyway.For a lot of processing-intensive stuff, Java provides accelerated libraries--Im specifically thinking of nio and some of the very very new parallel collections libraries. But this doesnt impact on an audiogame one way or another, and if youre doing this kind of stuff you should be looking into OpenGL anyway.

URL: http://forum.audiogames.net/viewtopic.php?pid=194817#p194817




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: developing audiogames in java

2014-11-13 Thread AudioGames . net Forum — Developers room : Aminiel via Audiogames-reflector


  


Re: developing audiogames in java

Unless you are really programming an high-demanding resource game, the slight speed difference wont play an huge role. The legend of java being very slow is no longer much true nowadays. Now the ratio is near 1.1 or 1.2 compared to C. The more real truth today is that python is now getting slower than java, and as you know there are a few big games developped in python, SoundRTS for example. So from this point of view, java is perfectly viable to run a game.The biggest problem is to find libraries for audio, speech and such specialized things. For speech, my library UniversalSpeech is normally compatible with java.For audio however, you have the choice between two quite bad options: use a library based on JavaSound and its quite a pain to have something really good sounding, or use a java port of a well known library e.g. joal, BASS native, FMOD, and there the problem is performances because the JVM make frequent calls to C backends.If interested, a
  few years ago, I developped a small audio library based on JavaSound. As already said, its quite limited because JavaSound is itself quite limited, but if you dont need advanced effects or full 3D, it can suffice. It was sufficient for my game MagicBlocks, and more generally I think that for a simple arcade or side scroller game, it would be perfectly OK.

URL: http://forum.audiogames.net/viewtopic.php?pid=194735#p194735




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: developing audiogames in java

2014-11-13 Thread AudioGames . net Forum — Developers room : Aminiel via Audiogames-reflector


  


Re: developing audiogames in java

Unless you are really programming an high-demanding resource game, the slight speed difference wont play an huge role. The legend of java being very slow is no longer much true nowadays. Now the ratio is near 1.1 or 1.2 compared to C. The more real truth today is that python is now getting slower than java, and as you know there are a few big games developped in python, SoundRTS for example. So from this point of view, java is perfectly viable to run a game.The biggest problem is to find libraries for audio, speech and such specialized things. For speech, my library UniversalSpeech is normally compatible with java.For audio however, you have the choice between two quite bad options: use a library based on JavaSound and its quite a pain to have something really good sounding, or use a java port of a well known library e.g. joal, BASS native, FMOD, and there the problem is performances because the JVM make frequent calls to C backends.If interested, a
  few years ago, I developped a small audio library based on JavaSound. As already said, its quite limited because JavaSound is itself quite limited, but if you dont need advanced effects or full 3D, it can suffice. It was sufficient for my game MagicBlocks, and more generally I think that for a simple arcade or side scroller game, it would be perfectly OK.Another important point against java not to be neglected is its JVM, which has necessarily to be installed separately. Java isnt always installed everywhere and many people have issues installing it, even if they juste have to do I accept next next next finish. So it might, wheither or not you want it, limit a little your audience or you will perhaps have to make more support on how to install the JVM and its dependencies. The size of the JVM make also quite impractical for you to bind it together with your application at the end, opposited to other VM-based languages like python, where it is much easier to
  do it because the size of the interpreter is more reasonnable.

URL: http://forum.audiogames.net/viewtopic.php?pid=194735#p194735




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: developing audiogames in java

2014-11-13 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: developing audiogames in java

1) compile once, run everywhere will sound great, until you actually try to distribute something and discover that its pretty much completely false. (But if you find a way around this, please let me know!)2) Java sound is, as Aminiel said, kinda problematic. It was weak-but-workable 10 years ago, though emphasis on weak. With the rise of 64bit, the available mixers are getting less and less maintenance. If you read the history of Java sound backward, you get basic stationary single-sound playing, then support for pan and volume, then support for pitch-bending and reverb. (You know, Im noticing a trend, here.)2.3) If you can error-proof these, go ahead and play with them. I took an example sound player and modified it until I had something I could use. SoundPlayer (The original came with a swing application for controlling the sounds, but I removed it fo
 r the sake of games.)SoundBuffer (vaguely like BGTs sound_pool, but it has no concept of a listener.)sound2player (basically the same as SoundPlayer, but it tries harder to make adjusting pitch available.)3) I cant comment on JOAL or FMOD, other than to say there exist games in Java that use them, and Ive never had the patience to get them working.Still, its worth trying. The emphasis on object-oriented programming and events is helpful most everywhere, and if you try to develop a game youll inevitably learn something useful that might generalize to other platforms.(An example of slow processes in java: gradient paints with alpha values. Not relevant if you arent doing graphics.)

URL: http://forum.audiogames.net/viewtopic.php?pid=194748#p194748




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: developing audiogames in java

2014-11-13 Thread AudioGames . net Forum — Developers room : Victorious via Audiogames-reflector


  


Re: developing audiogames in java

Yeah, i would definitely want to use 3d and such in sounds, so it looks like java for now might not be the best choice. Maybe if the compile once, run everywhere isnt that true in practice, i would be better off just using c++, c# or something closer to c, as ive grown pretty comfortable with it.

URL: http://forum.audiogames.net/viewtopic.php?pid=194758#p194758




___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector