Page 1 of 1

Java gaming discussion

Posted: Sat Jun 14, 2014 11:55 pm
by Spacebeans
I understand some people here have allot of things to say about different languages, and I also see that this thread may have already been started. (Maybe, I'm really really new here).

But I was wondering why some people don't recommend java? (Some bash it in fact). I ain't no newb, and I'm sure as hell not a fanboy. But its mainly the only programming language I've been using for the past 4 years. I've tried C++ then accidentally broke my compiler installation, and haven't touched it since. I've tried C#, that just ended up with allot of crying and lack of quality libraries.

Now, in no way did I recommend Java to be the "best" programming language. In fact, speed wise, Java kinda lacks on the calling side, because of its JVM communications. (Program talks to JVM, JVM talks to hardware) (I may be horribly wrong on how that works.))

Also, that JVM communication could be surpassed on the graphics side. Modern OpenGL uses interleaved data, so even if Java doesn't have very fast OpenGL calls, the data is interleaved anyway. There are some openGL wrappers for Java, like LWJGL, and JOGL. In fact, the LWJGL project now has OpenCL and OpenGL 4.0 versions. So that's not a problem either. Java also makes it very very portable through various devices. LWJGL handles the Native libraries through JNI (Java Native Interface) so all you have to do is include the right natives and you're good to go on Windows, Mac, and Linux. Even android (If you try hard enough)

I'm not college graduate, computer scientist, and some of you are, so please take it easy, even if I'm extremely wrong on everything.

Re: Java gaming discussion

Posted: Sun Jun 15, 2014 11:10 am
by dandymcgee
Spacebeans wrote:I've tried C#, that just ended up with allot of crying and lack of quality libraries.
I won't bother pretending I know enough about Java to give advice, since I've never actually used the language myself. I can, however, tell you that C# is probably the wrong choice of language for most game development. The exception being games that are directly targeting Windows. Yes, there are way to run C# on other platforms, but it's not even remotely close the level of cross-platform compatibility you'd find with Java.

I use C# every day at work for rapid development of Windows forms applications and Windows services it is an amazing tool. We do all sorts of data processing, reporting, and verification entirely in C#. The tools run plenty fast enough for our needs, and the code base is incredibly easy to maintain / debug / enhance. If we were to try to use C++ our development times would probably go up ten-fold for very little gain. Java is a slightly more likely candidate, but C# is specifically tailored to Windows development which is our only target platform.

In any case, Minecraft is the paragon of Java game development. It alone has proven that the game idea itself is infinitely more important to players than the language in which you develop it.

Re: Java gaming discussion

Posted: Sun Jun 15, 2014 1:37 pm
by jmcintyretech
If you're making a game with more complex grpahics needs, you can still use Java, but might choose a library like LWJGL (Lightweight Java Game Library).

If you have a need for extreme performance or distribution on platforms without a JVM, you'd want to use C/C++ and something like SDL or OpenGL.

Hell, you could write a cross-platform game in Fortran if that's what your programmers knew and there was a graphics lib to fit your needs.

Again, I think it boils down to programmer choice provided that the language/libraries of choice fit the needs of the product you are creating.

Re: Java gaming discussion

Posted: Tue Jun 17, 2014 8:13 am
by dandymcgee
jmcintyretech wrote:Hell, you could write a cross-platform game in Fortran if that's what your programmers knew and there was a graphics lib to fit your needs.
I think having a compiler would be a bit more important than a graphics lib. You'd be hard pressed to get your Fortran running natively on iOS. :roll:

Re: Java gaming discussion

Posted: Tue Jun 17, 2014 8:32 am
by bbguimaraes
Just forget that and write it in emacs lisp.

Re: Java gaming discussion

Posted: Tue Jun 17, 2014 3:05 pm
by jmcintyretech
dandymcgee wrote: I think having a compiler would be a bit more important than a graphics lib. You'd be hard pressed to get your Fortran running natively on iOS. :roll:
...didn't even think of that, that's probably a bigger concern :lol: :lol:

Re: Java gaming discussion

Posted: Fri Jun 27, 2014 9:45 pm
by X Abstract X
Java is perfectly fine for game development. In my experience the main thing you need to worry about is being careful with your allocation/deallocation strategy so the garbage collector doesn't come into play and cause large delays during gameplay. Not quite sure what you were getting at with the fact that you interleave data in OpenGL, how is this relevant to the choice of language issue?

Re: Java gaming discussion

Posted: Sat Jun 28, 2014 6:37 pm
by Spacebeans
X Abstract X wrote:Java is perfectly fine for game development. In my experience the main thing you need to worry about is being careful with your allocation/deallocation strategy so the garbage collector doesn't come into play and cause large delays during gameplay. Not quite sure what you were getting at with the fact that you interleave data in OpenGL, how is this relevant to the choice of language issue?
I meant that the biggest part in Java's bad performance is the constant JVM/JNI calls. Like Java Program > JVM > JNI > OpenGL

I may be wrong, but LWJGL/JOGL both work through the Java Native Interface. So it speaks to anouther language (C++/C#) that then calls its OpenGL methods. And on top of that, Java calls its methods from the compiled code on the JVM. So it talks to the JVM, then to the JNI then to the OpenGL libraries. But if you leave the data on the graphics card with interleaved data (Retained mode). You don't have to worry about the calls making your app slower.