Friday, November 9, 2018

architecture - What is Java missing that might make it difficult to develop fully-featured 2D games?


Without using any external libraries, does Java, including all officially supported APIs give you enough to develop fully-featured 2D games? The reason I ask is that I hear a lot of "bad-mouthing" about Java and game development, but I'm wondering if that is only in regard to intensive 3D games. Also reading up on some Java games there often appears to be external graphics or sound libraries involved that simply have a Java port. This makes me think it isn't possible.



Answer



In 2011 any language with bindings to OpenGL is more than capable of a "2D game" in the style of Nintendo from the 1990s or so, when running on a desktop PC made in this millennium.


For TV game consoles, the only language available for development across all platforms is C++, so that's what people use for the most complex 3D games and the simplest 2D games. Java would work for simpler games, but C++ is the compromise we live with to avoid the cost of supporting more than one language.


For handheld devices (and to a lesser extent TV game consoles) performance is critical often enough that the overhead imposed by Java et al. can't be tolerated for games with medium or high complexity.


Android phones do run games in Java, but there is a clear trend recently toward "native" C++ games on Android, not primarily for performance, but because ironically Java isn't as "platform-independent" as C++. All non-Android platforms use some kind of C/OpenGL, and porting a game among them is fairly cheap. Porting from any of them to Android/Java is relatively expensive.



No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...