Viability of Java For Video Games

Started by
17 comments, last by NewBreed117 10 years, 4 months ago

Java can be compiled to native machine code with GCJ, so then as long as you use the right libraries it would have the same performance as C++.

SAMULIKO: My blog

[twitter]samurliko[/twitter]

BitBucket

GitHub

Itch.io

YouTube

Advertisement

Java can be compiled to native machine code with GCJ, so then as long as you use the right libraries it would have the same performance as C++.


I don't think I have ever seen a game written in Java and compiled using GCJ. Probably because GCJ is not very actively developed and still only supports ~Java 1.4.

Either way, since standard Java will very likely need to be using native libraries to create a game (OpenGL, OpenAL, ODE, Bullet, etc..), the speed is very unlikely to be an issue since much of the processing is done by native code (in the .dll or .so) anyway.
http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

Is Java viable for graphic intensive video games. More specifically could I recreate a game like Halo or Call of Duty where you need to have quick

input and output? Thanks in advance to your answers smile.png

Hi,

World class games and simulations continue to be made based on Java, but often in conjunction with another language for specialized development needs such as gameplay scripting language (sometimes invented in house), hardware cross-platform, operating system cross platform (actually targeting a major Runtime such as .NET, Java, or Mono), or as an excellent development environment for mobile device games. Java is also used sometimes for scripting gameplay or for GUIs and UIs over another language for lower level coding.

Java has multi-threading and multi-core capabilities via libraries, can go high or low level coding, and is often preferred for server heavy software development. It plugs well into OpenGL (better than some languages) and has mature libraries to support any level of software development. Some developers find it more efficient in cost and labor to develop in Java than C or C++, for example. Java just in time (JIT) and post processing libraries combined with the previous mentioned cause the performance gap between Java and C++ or C to be more a matter of skills than the language.

Preference can trump every other consideration for any language, so keep that in mind.

" Good code written in Java performs better than bad code written in C++ "

Military and corporate developers in the many thousands settle on Java for the above reasons. They create some simulators in Java which are more complex than the biggest entertainment games written in C++, but with competitive performance with the C++ games.

Some libraries of code, such as C++ game engine components, can be ported to Java or work inter-operatively in a virtual machine such JVM or a game engine.

The jMonkey game engine is a good one, so have a look.

Many thousands of games per year are developed based in Java.

The main languages to handle low level graphics with excellent performance are C, C++, and Java, in my opinion. Since skill and preference weigh heavy in the quality of the end product, these are more important than the language itself.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

World class games and simulations continue to be made based on Java, but often in conjunction with another language for specialized development needs such as gameplay scripting language (sometimes invented in house), hardware cross-platform, operating system cross platform (actually targeting a major Runtime such as .NET, Java, or Mono), or as an excellent development environment for mobile device games. Java is also used sometimes for scripting gameplay or for GUIs and UIs over another language for lower level coding.

To me this sounds like a lot of really superfluous "Here's why Java is shiny."

Java has multi-threading and multi-core capabilities via libraries, can go high or low level coding, and is often preferred for server heavy software development. It plugs well into OpenGL (better than some languages) and has mature libraries to support any level of software development. Some developers find it more efficient in cost and labor to develop in Java than C or C++, for example. Java just in time (JIT) and post processing libraries combined with the previous mentioned cause the performance gap between Java and C++ or C to be more a matter of skills than the language.

Do you have any actual proof of these claims? So far I'm just reading a lot of "Java is super amazing and better than every other language!"

" Good code written in Java performs better than bad code written in C++ "

What is "good" and "bad" code? This is extremely vague and could be taken as true in any language, I could pretty easily write a generic looping function in C++ that performs terribly and probably do the same thing correctly in Python and get better results. You might as well be saying that "remember our gun is still a gun if you're terrible with other guns!" When comparing languages you should be assuming competency.

Military and corporate developers in the many thousands settle on Java for the above reasons. They create some simulators in Java which are more complex than the biggest entertainment games written in C++, but with competitive performance with the C++ games.

I'm starting to feel like I'm reading an advertisement for the language instead of discussing actual merit of i.

Some libraries of code, such as C++ game engine components, can be ported to Java or work inter-operatively in a virtual machine such JVM or a game engine.

More vagueness that honestly doesn't even make much sense.

Many thousands of games per year are developed based in Java.

I have to say this is probably one of the more hillarious and totally baseless lines I'm reading. In terms of serious games developed for Java I could name three off the top of my head: Wurm Online, Minecraft, and Runescape(which I believe isn't even Java anymore client wise, and their server likely hasn't been Java for awhile.

Even in terms of small web games made by individuals Java is almost completely extinct and the market is completely dominated by Flash or even html 5, I've found it unusual to even find anything on the internet that requires Java anymore.

The main languages to handle low level graphics with excellent performance are C, C++, and Java, in my opinion. Since skill and preference weigh heavy in the quality of the end product, these are more important than the language itself.

If you're looking for graphical performance using Java is like hooking a ball and chain to your ankle to run a marathon, sure you can optimize quite a bit with it, I'm not saying its an impossibility but the effort involved is definitely not a time saver. You don't use a friendly language when you need speed you use a friendly language when you need quick development.

EDIT: Pardon if I'm coming off as rude or anything but I really think you're being a bit overzealous on Java's merits here, especially in the realm of game development. It simply really annoyed me to read a huge paragraph of "Java does everything" without even giving any actual base to the claims.

[EDIT: Pardon if I'm coming off as rude or anything but I really think you're being a bit overzealous on Java's merits here, especially in the realm of game development. It simply really annoyed me to read a huge paragraph of "Java does everything" without even giving any actual base to the claims.

Overall he is quite correct.

For his server side comments, Java for servers is very common in the business world, and I have seen it used in backends of several games. Look on job search boards like Dice or Monster for JSP developers, and thousands of jobs looking for Java+SQL experience.

As for games, well, he is right.

There really are thousands of games written in Java. Most of the 'dumb' cell phones starting in the late 1990s through today, aka feature phones, have the apps developed in Java, and there were LOTS of them. They still have a market and games are being made for them. Today, in addition to the feature phones, the Android environment is Java-centric. Many games do provide minimal Java code preferring to develop in C++, but quite a large number are written entirely inJava. Then there are still Java applets on the web (visit sites like Pogo for many active examples), and Java-built PC games like the ever-popular Minecraft.

So with Android being out for five years and recently hitting the one million app mark, saying many thousands of games per year are written in Java seems like a small number. I would say that the current rate is several tens of thousands of games per year use it. (Again, yes, many do jump quickly to C++, but I believe they are in the minority.)

While it is true that you won't be able to completely optimize everything at the lowest level with a Java code base, the number of games that need to do that are vanishingly small. Java is more than adequate for just about any game an individual developer or even a small team of developers is able to create.

So yes, Java can realistically do everything you need for a game. It is safe to estimate that hundreds of thousands of games already use it successfully.

For his server side comments, Java for servers is very common in the business world, and I have seen it used in backends of several games. Look on job search boards like Dice or Monster for JSP developers, and thousands of jobs looking for Java+SQL experience.

Yes I'm well aware the business world is still pretty steeped in Java but that is a different sort of ballpark realistically, industry tends to be very slow to change to new languages and Java has been kind of the "awkward mainstay" fora very long time. It's the same reason extremely dated languages like fortran are still used in quite a few areas.

There really are thousands of games written in Java. Most of the 'dumb' cell phones starting in the late 1990s through today, aka feature phones, have the apps developed in Java, and there were LOTS of them. They still have a market and games are being made for them. Today, in addition to the feature phones, the Android environment is Java-centric. Many games do provide minimal Java code preferring to develop in C++, but quite a large number are written entirely inJava. Then there are still Java applets on the web (visit sites like Pogo for many active examples), and Java-built PC games like the ever-popular Minecraft.

To be honest I would consider phones to be a unique variant, for a lot of phones Java may have been the ONLY choice available, for Android, Google has pushed the language far above others and so most people default to it, even then C# through mono has a rather devoted following. I wouldn't really compare languages when you flat out get more out of using one on a certain platform, that's a bit silly.

So with Android being out for five years and recently hitting the one million app mark, saying many thousands of games per year are written in Java seems like a small number. I would say that the current rate is several tens of thousands of games per year use it. (Again, yes, many do jump quickly to C++, but I believe they are in the minority.)

Yes and mobile is a gigantic industry now, that said cell phone games are rarely performance centric and even simple 3d is pretty rare in a market dominated by 2d puzzle games and other 99 cent distractions. My personal opinion is that I really don't see how something being a used a lot means it has much merit as a language, keeping in mind the entire discussion here is viability for games(in which the OP specifically mentioned feature sized games like AAA industry.)

Again, I'm not saying Java "can't do this or that" I'm saying "there's no real reason to do this or that with Java." Of course that argument changes based on platform, on Android there actually is merit to considering Java as your language because its so often used.

While it is true that you won't be able to completely optimize everything at the lowest level with a Java code base, the number of games that need to do that are vanishingly small. Java is more than adequate for just about any game an individual developer or even a small team of developers is able to create.

I wouldn't say they're vanishingly small, in my opinion the same number of big games are coming out as before, if not more. If anything the game industry is just expanding because things like mobile games have started to capture all the "normal" people out there. But we're talking about things that are galaxies apart here really, a game like Battlefield 4 does not even entail remotely the same decisions as a bejeweled clone on a cellphone. The bigger you get, performance tends to become more of an issue as well.

So yes, Java can realistically do everything you need for a game. It is safe to estimate that hundreds of thousands of games already use it successfully.

My main issue was that was he says is superfluous, he makes the language sound like its amazing and used for everything and a direct competitor to languages like C++ or even C# while in reality, as a language, I still don't see much merit to it being used on PC in particular, or even on consoles unless its the preferred language.

My opinion is that C# is very similar to Java but it makes a lot more design decisions that are intuitive, and as a language it just feels better developed. Obviously mileage may vary there. On the flipside I would say a language like Java or even C# is going to have an extremely hard time being able to optimize down to the metal. If you do make those optimizations they will likely take longer, and for less payoff. Java is just kind of the ugly duck in the room when it comes to games, but then again why shouldn't it be! Java was designed to be totally generic.

The libraries whch Java can access lead the industry in many categories.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

The libraries whch Java can access lead the industry in many categories.

Okay?.. Whats your point? What kind of libraries are we talking about?

If we're talking about native libraries, Java would be, if anything, just adding overhead to their performance. If we're talking about Java specific libraries like the standard library then.. what advantage do they have over other standard libraries?

You're being really vague.

Thank you for all the responses I am starting to get a good picture of what I am looking at :) Thanks again everyone!

This topic is closed to new replies.

Advertisement