I know it is kind of stupid to ask this on a java gaming forum but is java a good language to learn to make games? Is it the best way to go? Or at least to most supported? I ask this because I have noticed a lot of the popular game engines such as the source engine and the unreal engine are written in c++.
Java is very easy to learn but there is allways that performance handicap.
If you want to do next big game engine pick c++. But be realistic, what is your goal? If you wanna just do small game to web then java is way to go. If you wanna do something bigger java is still good choise.
See i have a question about that, eh sick and it’s hard to keep my thoughts straight so please bare(?) with me…
i was hoping to make small java games in the future, in the form of applets and maybe expand to phones after that or something well i have a rough idea, but are applets really the way to go? I keep hearing about something called webstart? if i got that right. I’d imagine people would like applets more since it doesn’t involve downloading something.
Aaggh, people keep saying these things but it’s just old information. My port of the bullet physics engine is faster than Bullet and mine is in Java while Bullet is in C++. The algorithms and structures makes so much more difference on performance than language.
Sure there’s a bit of extra JNI overhead when doing OpenGL work in Java, but the graphics card is already doing 90% of the work anyway so language choice won’t make any noticeable difference, especially when it comes down to getting 60fps.
With Java’s emphasis on multi-threading (even though it’s not perfect and hard to do in an OO language), it is much nicer than what you get in C and C++, and the JVM helps you optimize at runtime. With multiple processors being a big deal, even in desktop systems, Java is going to get better and better for game development.
Okay, there is an issue for cases when optimized MMX/SSE/SSE2 etc. is the right thing to do. Like with many signal processing algorithms. But for general code there is usually no performance issue. At my company we are moving more and more towards Java code for as much as we can - and we are in the (video) signal processing business
We just use native code where it matters. For games the core performance areas are usually handled by hardware via OpenGL, so native code isn’t needed at all, or such native code is already in a library like LWJGL. Coding the bulk of your stuff in Java will just be easier for other reasons (much better support in tools, better standard libraries, etc.)
The Java language may not always be the way to go… Scala or something may be better depending on the application, but running on the JVM, using the Java Platform is still a reasonable choice.
Well I see your guy’s points and I have been thinking about this and if I start learning now I should be pretty good in the future when java is using in even more things than they are now such as games because computers will get better.
Bear in mind that the Unreal engine and similar engines are for triple-A games. Part of the reason they use C++ is because Java is only very fast in recent years. Back when Unreal Engine 1 was created C++ was clearly the best choice. If you have a very large set of libraries and ecosystem built around one language in mind, then it makes no sense at all to switch to Java. For example John Carmack was once asked about the idea of building Quake 3 in Java and he said it would be perfectly possible, but what would be the point?
Secondly if you want to build your own low-level locking systems (which the Source engine does) then again C or C++ is the best option. The Linux kernel still advocates using C over C++ because of the extra cruft C++ compilers generate. C gives them ultimate control. So if you want to be a part of building the very extreme and low-level parts of a game engine, such as writing lock-free algorithms and advanced smoke systems using the lattest in DX11 tesselation, then yes Java is a bad choice. Otherwise it’s fine and for the web Java applets are still FAAAAAAR faster then anything else.
The main issue I have with Java is that when you compare it to Silverlight, Flash, JavaScript or XNA then there is more you need to do. The ecosystem is much smaller (less forums to join and less tutorials for you to follow). Secondly you also have to write more of the cruft yourself. An example I often give is if your user doesn’t have the runtimes you use, with Flash this is already solved for you (they are provided with an update or told that they need Flash). With Java there are solutions (Oracle provides a JavaScript script to help) but you have to research and bind this together yourself.
But ultimately it’s all about the game. An amazing game is amazing, a bad game is bad. That has nothing to do with the language.
Yeah you are right I would rather learn java because my friend knows java and we want to make a game together and minecraft inspired me which was made in java. I also think down the road that java will have an even bigger role in the gaming community.
On account of everyone’s impeccable English on this board I often forget not everyone is from England and aware of the many subtleties of our various dialects :
Use Java, always. It can be even 15% faster than C++ ;D Update your knowledge, forget your prejudices about Java, there are enough Java haters in this world.
Java performance handicap is essentially a prejudice like C++ superiority in term of performance. Memory allocation and method calls are faster in Java than in C++ (according to Brian Goetz, author of “Java Concurrency in Practice”) and dynamic optimizations allow optimizations at runtime not possible in compiled languages (according to IBM researchers on the HPC project). If you really want to do the next big game, Java can do the job, look at Poisonville.
Poisonville is known as one of the biggest browser gaming cockups ever, it was cancelled after 2 million euro’s were spent on it and it being in development for over 4 years. The developers couldn’t deliver the game and it was way to buggy. Not really a Java issue just bad project management.