• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Why don't more game dev's use Java?

digdug2k

Member
The only real upside to java is its portability.
Java has a lot of advantages other than portability. Its safer and easier to write code thats less likely to crash in it. But yeah, like people here have said 1.) Its not close enough to the metal for game devs 2.) garbage collection can happen at random times and cause jank. The second is a little bit bunk IMO. App developers deal with it. You profile. You avoid generating large amounts of garbage when you don't need to. Same optimizations game devs do now. But I've heard devs cite it.

Games do use high level languages occasionally. At least, I remember some dev from EA claiming the SimCity menus (and the PS4's menus for that matter) were written in Javascript (not Java) and WebGL.
 

cRIPticon

Member
Java has a lot of advantages other than portability. Its safer and easier to write code thats less likely to crash in it. But yeah, like people here have said 1.) Its not close enough to the metal for game devs 2.) garbage collection can happen at random times and cause jank. The second is a little bit bunk IMO. App developers deal with it. You profile. You avoid generating large amounts of garbage when you don't need to. Same optimizations game devs do now. But I've heard devs cite it.

Games do use high level languages occasionally. At least, I remember some dev from EA claiming the SimCity menus (and the PS4's menus for that matter) were written in Javascript (not Java) and WebGL.

Not for nothing but all of the interactivity/menus/fiddly bits on BluRays are (or were, have not kept up) written in Java. In fact, check out the logos on the PS4 box...Java Powered logo still there.
 
Java has a lot of advantages other than portability. Its safer and easier to write code thats less likely to crash in it. But yeah, like people here have said 1.) Its not close enough to the metal for game devs 2.) garbage collection can happen at random times and cause jank. The second is a little bit bunk IMO. App developers deal with it. You profile. You avoid generating large amounts of garbage when you don't need to. Same optimizations game devs do now. But I've heard devs cite it.

Games do use high level languages occasionally. At least, I remember some dev from EA claiming the SimCity menus (and the PS4's menus for that matter) were written in Javascript (not Java) and WebGL.


Oh good point, Java runs in its own runtime environment, which means it is less likely to crash the whole system.
 
Java along with few other alternatives is THE language when you consider enterprise web application..
Everything else? Java is never an option..
Inconsistent memory management, jvm overhead are just the two main offender..
 

Durante

Member
In case the OP isn't aware StackOverflow and StackExchange have much better answers to this question and questions related to programming in general.
Those answers aren't any better than those in this thread. Pretty much every valid technical reason mentioned there has also been mentioned here, and some of the reasons to use Java they propose (like portability) have been debunked.

The truth is that C++ is far more portable across all devices relevant for games than Java is.
 

mjontrix

Member
By the way, you guys bitching about C or Java should get involved in a project that involves mission critical legacy systems written in COBOL. :)

In the end you have to work with what you get. That's why, ultimately, good knowledge of sound software engineering methods is way more valuable than the programming language.

Damn, even ElTorro is up in here!

COBOL - I'm assuming a financial based organisation likle a bank - in particular the mainframe? I've heard many a story about those...

My uni recently switched to a new teaching method for the intro-level class where students don't even know what a string is until halfway through the semester and don't even know how to manipulate it until a week or two later.

For Christ's sake.

star-trek-black-guy-freak-out.gif


As the guy who founded javagaming.org back in 2001, which was turned over to the community when Sun was purchased by Oracle, I have to say that I find this thread quite interesting...

And, yes, the JOGL, JInput and JOAL drivers all originated with us there. LWJGL, a competing API that did not rely on Swing/AWT, also had its start in that community.

And now we've gone full circle!

I will say this much - Java is great to learn first - at Uni you wouldn't be as put off than if you dumped Matlab onto them. For reference UNSW - http://webapps.cse.unsw.edu.au/webcms2/course/index.php?cid=2372 this is Engineering btw.

Plus there's plenty of Java education based IDEs to use - BlueJ for a start.
 

beril

Member
I'm waiting to hear why it's bad first. It's a modern programming language that is platform independant.

I've never understood the argument that it's platform independent. It's its own shitty platform and certainly doesn't run on everything. That's basically like saying 6502 assembly is platform independent, since there are NES emulators available for pretty much everything.
 
I'm waiting to hear why it's bad first.

Because people really want somebody to pay them to write code in that trendy language they just picked up.
It never really happens, but you can't blame people for trying.

At the end of the day. people just want you to write shit in something that will work and be supported. In the games industry? That isn't Java.
Maybe if Microsoft had killed it properly, DirectX could have integrated their own version. That never happened and they moved in a different direction after. Meanwhile all the engines game developers will use have hooks into scripting languages or C.

So there it is.
 

cRIPticon

Member
Because people really want somebody to pay them to write code in that trendy language they just picked up.
It never really happens, but you can't blame people for trying.

At the end of the day. people just want you to write shit in something that will work and be supported. In the games industry? That isn't Java.
Maybe if Microsoft had killed it properly, DirectX could have integrated their own version. That never happened and they moved in a different direction after.

You have that backwards. If Microsoft never decided to try and kill Java form the start, they would have just built APIs that made DirectX calls. However, they tried to break the platform, went to court, were forced to stop and forever fractured the platform.

Want to see what we were doing to try and unify the APIs for game development:

https://www.jcp.org/en/jsr/detail?id=134

The proposed specification is of a J2ME Profile that covers nine areas of game development:

1. 3D Modeling and Rendering for Games
2. 3D Physics Modeling for Games
3. 3D Character Animation for Games
4. 2D Rendering and Video Buffer Flipping for Games
5. Game Marshalling and Networked Communication
6. Streaming Media for Games
7. Sound for Games
8. Game Controllers
9. Hardware Access for Games


We see the Java Games Profile as potentially using existing technologies in the following areas:

1. General Programming Functionality

We see the general programming environment as a JVM with support for access to memory outside of the Java heap. The new IO package addresses two key areas: efficient I/O for loading game data into memory quickly and access to the memory space outside the Java heap from within Java. This is a critical facility for some kinds of game coding.

2. 2D Graphics

Support is desirable for video buffer management and page flipping, hardware accelerated BLT, line draw, and rectangular fill where provided by host hardware. Java2D's new VolatileImage and updated Graphics2D classes, combined with AWT's new fullscreen mode and BufferStrategy classes already provide a well-defined interface to such functionality.

3. 3D Graphics

Full support for advanced hardware-assisted 3D rendering with a high degree of flexibility and control over the render process is desirable, as is access to render primitives to build fancy effects (i.e. reflection mapping, stencil buffer based shadow volumes). Java3D has much of this already.

4. Controller Input

Discovery of and access to game controllers such as joysticks and steering wheels is necessary. Java3D provides basic controller access. While it may be desirable to put a simpler, non-3D oriented interface on game controllers, we suspect that this can be done through a small amount of glue- ode that wraps the existing Java3D input functionality.

5. Advanced Audio

MP3 and Midi playback, streaming audio, and voice codec for low-bandwidth transmission across the net are required. Much of this is provided by JMF2.0. Java3D supports 3D spatial sound positioning. There are still some open questions about how this interfaces to JMF 2.0 but we expect to work those issues, if any, out in the expert group.

6. Streaming Video

High quality video playback is required for 'cut scenes'. This is provided in JMF 2.0.

7. Game Marshalling

We expect to be able to use components of the GameSpy Java APIs as the core functionality of a reference implementation of a general game marshalling API. All that would need writing is the glue code to convert the visible proprietary GameSpy API to the agreed-upon standard API.

8. Physics Engine

Math Engine already has a highly respected physics modeler in C/C++ and has expressed interest in working on the reference implementation of a Java physics modeling API.

After Microsoft was ordered to use the standard JVM and cease with their proprietary one, I had several meetings at GDC that following year asking if exceptions could be granted. When I explained that they could not, I asked why they used the MS JVM instead of the standard one. The response?

"Well, it's Microsoft, right? I mean, who would have ever though you guys would have won in court?"

Meanwhile all the engines game developers will use have hooks into scripting languages or C.

So there it is.

And Java has been used in a bunch of video games from AAA developers for everything from scripting to full development. Vampire: The Masquerade was actually the first consumer product to carry the Java Powered logo.
 

emiliano

Member
I have to thank OP and all the people involved in this thread, it's really a good read. It's helping me to reinvigorate my passion for programming and to get over my convinctions on the need of a strong OO structuring over everything, the primary aspect of java that always fascinated me.
 

cRIPticon

Member
I have to thank OP and all the people involved in this thread, it's really a good read. It's helping me to reinvigorate my passion for programming and to get over my convinctions on the need of a strong OO structuring over everything, the primary aspect of java that always fascinated me.

Awesome! Now, head over to javagaming.org and get coding!
 

whome0

Member
I started Java career with Java1.0beta, first implementing few of my Delphi(Object Pascal) Windows games run on Applet plugin. Imagine I was able to provide games directly on a web page before you were born. It was a magic. Java is an excellent if not one of the best platform+libraries+ecosystems+appservers for server-side services. It's something write-once-run-everywhere is a reality. Heavy UI client side not so much, its write-once-debug-everywhere.

Current Java virtual machines are extremely fast, but again client side with heavy graphics have an extra bridge to go through(JNI). It's having a change for better alternative in JDK9. And no, modern Java is not interpreted at runtime after few rounds of app time. Google even more changed that part in Android ART runtime(Lollipot Android 5). Nothing is stopping a same grand idea install/first run bytecode2native step to arrive on desktops.

Java as a programming language is fine. It gets the job done if you know your tools. Bad programmer is bad in c#, c or python. Even more bad in haskel or clojure, without a massive community to ask around would be a waste of time. See Stackoverflow for Java or Android question+answer volume. It is a great asset. Java may not suit every project goals, that's why we know multiple languages.
 

Melter

Member
Java (and C# as well) run on top of a sort of virtual machine layer, unlike C++, this causes additional overhead and makes it unfavorable to write games with.

Although Runescape was pretty cool back in the day.
 

parski

Member
Code I wrote few years ago was in C# and it dealt with pretty crazy explosions, dealing with that when it would occur would cause a "hitch" for a frame or so when the garbage collector did its work when things were destroyed in the game from the explosion such as destructibles. No amount of perf passes would solve it, it was solely due to the garbage collector not being efficient enough to deal with it. Nothing a programmer could have control over unless they were using a language like C/C++ that required the programmer to do all the memory management that could make this go away.
Objective-C uses different reference types to prevent these issues. It has a very clever reference count system called ARC and it hadles object deallocation like a charm.

Speaking of Objective-C: I really like developing in Sprite Kit. I'm making a game right now for OS X and Sprite Kit really provides great tools to start you off with whatever degree of boilerplate you desire. I have been using the frame updating libraries but I'm still free to create my own physics engine and all that other jazz. It's more fun to make it from scratch and this really just feels like an SDL-replacement for me.

Objective-C is a fantastic language to code games with for both iOS and OS X. Fantastic ecosystems and yummy BSD/UNIX.
 
My story .. Twice during my students days they try to teach me Java ... i just couldn't do it.. at that time i was so happy with C at the time..

Now i just don't get why java is so popular , i guess it's because people always try to teach it in goddam every school across the world...i just don't get it .. i guess it's part of that propanganda that is shown every time java Updater pop-up telling me that it's the most popular language in the world.

In my personnal experience , i understand the logic behind Java when i program , but for some reason it never feels right when i try to do something ..i never have those hurdles when i'm using another language.

So i kinda understand every complains about java in the first 3 pages.
 

CamHostage

Member
Not for nothing but all of the interactivity/menus/fiddly bits on BluRays are (or were, have not kept up) written in Java. In fact, check out the logos on the PS4 box...Java Powered logo still there.

Oh, and as I understand it from manufacturing houses, it's a nightmare to work with. This is probably a failure of the BD consortium more than it is a fault of JAVA, (the poor choices they made with this format are widespread, thus menus you see from even major publishers are either repurposed generic brand labels or old-school DVD menus because nobody wants to go back to the lab for every disc release... for example, as I understand it, perfectly acceptable DVD audio formats are just not compatible to transfer to BD because of an oversight, and the reason why BDs don't carry on where you left off after powering down is because nobody thought to put a jump-to-timecode-from-memory-file in the JAVA command set,) but the JAVA format probably isn't helping.

Just throwing that out there. I am learning a bit from this thread, and I am finding it interesting the appreciators of JAVA in their project, so good on you for those who find it to be the right environment for them.
 

emiliano

Member
Awesome! Now, head over to javagaming.org and get coding!

Thanks for the suggestion.
I would like to try it, but right now I'm just trying to learn some basic code again, it's been years since I've put serious commitment to programming (last time was some year ago, I used PHP to do a web application and really hate it for his inconsistencies). Now I'm trying to change my perspective and see languages for what they can do, not just at how difficult is to use them.
 

diaspora

Member
Java (and C# as well) run on top of a sort of virtual machine layer, unlike C++, this causes additional overhead and makes it unfavorable to write games with.

Although Runescape was pretty cool back in the day.

Even then, there's no reason to use Java over C#.
 

Somnid

Member
Objective-C uses different reference types to prevent these issues. It has a very clever reference count system called ARC and it hadles object deallocation like a charm.

Speaking of Objective-C: I really like developing in Sprite Kit. I'm making a game right now for OS X and Sprite Kit really provides great tools to start you off with whatever degree of boilerplate you desire. I have been using the frame updating libraries but I'm still free to create my own physics engine and all that other jazz. It's more fun to make it from scratch and this really just feels like an SDL-replacement for me.

Objective-C is a fantastic language to code games with for both iOS and OS X. Fantastic ecosystems and yummy BSD/UNIX.

This is literally the first time I've heard anyone say anything good about objective-c. It's a PHP-tier monstrosity, so glad they're killing it, Swift is actually quite nice.
 

blu

Wants the largest console games publisher to avoid Nintendo's platforms.
This is literally the first time I've heard anyone say anything good about objective-c. It's a PHP-tier monstrosity, so glad they're killing it, Swift is actually quite nice.
One could argue that for a very long time objC was the better object-oriented C extension. At the very least it was absolutely orthogonal to the C features, unlike C++.
 

mjontrix

Member
If you're not really into programming stuff here's a by the numbers comparison between Java and C in performance as an example - http://youtu.be/JzpkXLH9zLQ?t=27m51s Yes there's some programming stuff but you can just focus on the numbers he gives - the actual comparison is later on but I want to give you an example of the scale by providing the optimizing the Java code part first.

And yes, you'll be absolutely shocked at the end result :) And this should hopefully answer the question once and for all!

In fact, I'm half tempted to just download the entire course, get it burned into a few DVDs and sent to Ubisoft Montreal (addressed to the Assassin Creed and AnvilNext teams) - heck it might solve their performance issues xD

And then chuck in http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio/ and https://developer.nvidia.com/nvidia-perfkit for good measure.

Thinking about it it's likely that they barely have enough time to do things like this - probably just rushing to push games out and then patch it after - sad thing in AAA games nowadays :(
 
Those answers aren't any better than those in this thread. Pretty much every valid technical reason mentioned there has also been mentioned here, and some of the reasons to use Java they propose (like portability) have been debunked.

The truth is that C++ is far more portable across all devices relevant for games than Java is.
Do you think Java is useful for ANYTHING?
 

VNZ

Member
This thread still going?

Answer: For the guts of a game even standard C++ memory management has too much overhead (custom allocators is standard practice). Java's memory management is just off the table in a high performance environment where you also care about resource management.

For higher level scripting Java sucks proper too. Basically it's a rigid and strongly typed language without the performance that you'd like to get from such terseness.
 

Durante

Member
Java as a programming language is fine.
Damning with faint praise.

Do you think Java is useful for ANYTHING?
As I said earlier in the thread, it's a useful skill to have for (i) maintaining Java codebases, (ii) writing stuff that needs to interact with Java applications, and (iii) using Java libraries.
In any other use case there's probably a better alternative.

Oh, and there are lots of programmers on the market who know (or think they know) Java. Which makes it cheaper and makes project managers happy.
 

blu

Wants the largest console games publisher to avoid Nintendo's platforms.
If you're not really into programming stuff here's a by the numbers comparison between Java and C in performance as an example - http://youtu.be/JzpkXLH9zLQ?t=27m51s Yes there's some programming stuff but you can just focus on the numbers he gives - the actual comparison is later on but I want to give you an example of the scale by providing the optimizing the Java code part first.

And yes, you'll be absolutely shocked at the end result :) And this should hopefully answer the question once and for all!

In fact, I'm half tempted to just download the entire course, get it burned into a few DVDs and sent to Ubisoft Montreal (addressed to the Assassin Creed and AnvilNext teams) - heck it might solve their performance issues xD

And then chuck in http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio/ and https://developer.nvidia.com/nvidia-perfkit for good measure.

Thinking about it it's likely that they barely have enough time to do things like this - probably just rushing to push games out and then patch it after - sad thing in AAA games nowadays :(
You do realize that's an introductory course in software optimisations, right? It can hardly teach a seasoned game developer anything.
 
Top Bottom