Java gaming discussion

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Java gaming discussion

Postby Spacebeans on Sun Jun 15, 2014 12:55 am

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.
Code: Select all
//XXX: This is an actual tag in eclipse SDK, google it.
User avatar
Spacebeans
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 2
Joined: Sun Jun 15, 2014 12:15 am
Location: Ontario, Canada

Re: Java gaming discussion

Postby dandymcgee on Sun Jun 15, 2014 12:10 pm

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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Java gaming discussion

Postby jmcintyretech on Sun Jun 15, 2014 2:37 pm

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.
Last edited by jmcintyretech on Fri Mar 18, 2016 12:22 pm, edited 1 time in total.
jmcintyretech
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 34
Joined: Thu Mar 28, 2013 2:02 pm

Re: Java gaming discussion

Postby dandymcgee on Tue Jun 17, 2014 9:13 am

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:
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
 
Posts: 4911
Joined: Tue Apr 29, 2008 4:24 pm
Location: New Hampshire

Re: Java gaming discussion

Postby bbguimaraes on Tue Jun 17, 2014 9:32 am

Just forget that and write it in emacs lisp.
User avatar
bbguimaraes
Chaos Rift Junior
Chaos Rift Junior
 
Posts: 324
Joined: Wed Apr 11, 2012 5:34 pm
Location: Brazil

Re: Java gaming discussion

Postby jmcintyretech on Tue Jun 17, 2014 4:05 pm

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:
jmcintyretech
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 34
Joined: Thu Mar 28, 2013 2:02 pm

Re: Java gaming discussion

Postby X Abstract X on Fri Jun 27, 2014 10:45 pm

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?
X Abstract X
Chaos Rift Regular
Chaos Rift Regular
 
Posts: 178
Joined: Thu Feb 11, 2010 11:46 pm
Location: Ottawa, Canada

Re: Java gaming discussion

Postby Spacebeans on Sat Jun 28, 2014 7:37 pm

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.
Code: Select all
//XXX: This is an actual tag in eclipse SDK, google it.
User avatar
Spacebeans
Chaos Rift Newbie
Chaos Rift Newbie
 
Posts: 2
Joined: Sun Jun 15, 2014 12:15 am
Location: Ontario, Canada


Return to Programming Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron