Java allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. Java software for your computer, or the Java Runtime Environment, is also referred to as the Java Runtime, Runtime Environment, Runtime, JRE, Java Virtual Machine, Virtual Machine, Java VM, JVM. Upgrading to the latest Java version improves the security of your system, as older versions do not include the latest security updates. Java allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. Welcome to Freepcdownload.net,the source of the best download free games.This is one of the best places on the Web to play new PC/Laptop games for free in 2019!Our games are licensed Full Version PC Games. Download and play racing games,3d action games, car games, bike games, 3d games,shooting games,fighting games,adventure games,hidden object.
Active5 years ago
I'm not a game developer or anything, but I know that Java is not very widely used for game development. Java should be fast enough for most games, so where's the catch? I can think of some reasons:
- Lack of game developers with expertice in Java
- Lack of good game development frameworks
- Programmers don't want to accept Java as a games programming language. Most only accept C++ as that?
- No support for game consoles (though the PC market still exists)
It could of course be something else. Could someone who knows the business better than me explain why Java isn't getting momentum when it comes to game development?
We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.
closed as primarily opinion-based by gbjbaanb, user53019, enderland, user40980, durron597Jul 1 '15 at 13:59
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
13 Answers
Several reasons:
- In the old days, you needed 'direct access' for performance and UI. This predates VM languages like Java and C#.
- Most consoles (e.g., 360, PS3) do not have a JVM, so you cannot reuse code from the PC version. It is much easier to compile C++ code to support various devices.
- Most mainstream game engines (e.g., Unreal) have C++ bindings. There are some Java connectors (e.g., for OpenGL) but nothing like it.
- For PC gaming, DirectX doesn't really have strong Java support (if at all).
- Web based games run in JavaScript or Flash. You could write them in Java though using things like GWT.
- The iPhone runs an Objective-C variant.
Java is primarily used in Android games these days, simply because it's the primary language for that platform.
Technical reasons:
- Most of the best 3D game engines are written in C/C++. This is a big deal, since most game developers don't want to compromise on their 3D engine, but nor do they want to write one from scratch. Java has jMonkeyEngine which is open source and actually really good but it still can't yet compete with the Unreal Engine.
- For some very rare situation, there are advantages in getting 'close to the metal' in C or assembly language, specifically for access to special hardware features. This is not so important nowadays, but professional game developers still like to have the option.....
- Java has a garbage collected, managed runtime. 99% of the time this is a huge advantage, it certainly makes coding easier and less error-prone and is one of the big reasons why Java is so popular. However it does cause an occasional latency issue for games as garbage collection cycles can cause noticeable pauses. This is getting to be less of an issue with the newer low-latency JVMs, but is still an issue for graphically intensive games where maintaining high FPS is critical.
Non-technical reasons:
- Professional game development houses are heaviliy invested in C/C++ skills and technologies. This creates a huge amount of inertia.
- The largely irrational perception that Java is slow. Possibly true in the 90s, definitely not true now - you can certainly write a profitable, commercial 3D game with Java (Runescape anyone? Or how about Minecraft? )
- A pretty fair perception that Java is more focused on business applications and the web rather than gaming. This might change with the growth of Mobile and the need for more cross-platform development, but is certainly true at present.
Interestingly there are also some good reasons why game developers should consider Java:
- Portability - as the number of target platforms proliferate, Java becomes more and more attractive with it's pretty much unparalleled ability to create genuinely cross-platform binaries
- Library ecosystem - with the very important exception of 3D game engines, Java has the best range of libraries overall of any platform. Networking, sound, AI, image processing, key/value data stores, you name the topic and there's probably an open-source Java library for it.
- Server side development - Java is a great langauge/platform for the server, and as more games incorporate massively multi-player elements the server side will become more and more important. Java on Linux looks pretty compelling here as a platform.
- The JVM - is probably the best engineered VM execution environment in the World, with fantastic garbage collection, JIT compiler, concurrency support etc. It's only going to get better, and as game developers increaingly start to use dynamic languages within their games they will want the best possible runtime environment.
- Other JVM languages - Java is a solid od workhorse, but the real innovation is happening with the new JVM langauges (Scala, Clojure in particular). These languages get all the advantages of the Java/JVM platform, plus they are extremely powerful modern languages.
Okay, theres a lot of misinformation in this thread.
I know the game business extremely well, having been in it for 25 years. I also know Java in games extremely well having been Sun's Java Game technical evangelist and lecturing Java performance programming expert.
In terms of computational speed, Java beats C++ in many scientific computing benchmarks today. You can write pathological code in either language that performs badly if you want to, but over-all, they are at par and have been for a long time.
3d Java Pc Games Download
In terms of memory usage, Java does have some over-head. HelloWorld is a 4K program in java. But that overhead is pretty meaningless in todays multi GB systems. Finally, Java does have more of a startup time. I would not recommend using Java for short run-time utilities like Unix command line commands. In those cases startup will dominate your performance. In a game however, its fairly insiginficant.
Properly written Java game code does not suffer GC pauses. Just like C/C++ code, it does require some active memory management but not to the level C/C++ does. As long as you keep your memory usage to either long lived objects (persist for an entire level or game) and very short lived objects (vectors and such, passed around and quickly destroyed after calculation) gc should not be a visible issue.
In terms of direct memory access, Java has had that for a LONG time; since Java 1.4 in the form of Native Direct Byte Buffers. Bit twiddling in Java can be slightly annoying due to the lack of unsigned integer types but the work rounds are all well known and not terribly onerous.
While its true Java has never had a Direct3D binding, thats because Java technologies strive for portability. It has TWO OpenGL bindings (JOGL and LWJGL) and OpenAL binding (JOAL) and a portable input binding (JInput) that binds under the hood to DirectInput on Windows, HID Manager on OSX, and a Linux binding (I forget which).
Its true that no complete game engines have featured Java the way, say Unity, has featured C# and that is a weakness in the independent space. On the other hand, there were two good Scenegraph level APIS that were totally platform portable across Windows, OSX and Linux. Both written by Josh Slack, the first was called JMonkey engine and the second Ardor3D.
The top poster is correct that the two biggest things that held Java back in game development were prejudice and portability. The latter was the biggest issue. Although you could write a Java game and ship it on Windows, OSX and Linux, there was never a console VM. This was due to total ineptitude in Sun middle management. The few of us working on Java in games actually had deals with Sony no less then 3 times to get a VM on a Playstation and all 3 times Sun middle management killed it.
While Sun flirted with client technologies, the fact of the matter is that Sun management never got consumer products. Thats why Java as a client language from Sun never succeeded in any form, and why it took Google and Dalvik (the Android java-like VM) to make Java a platform success anywhere.
And thats why I code games in C# today. Because Mono went where Sun management refused to.
Java is great for business logic, servers, and platform independent code that has to run reliably. There are several factors why Java isn't often used in games:
- bounds checking & other safety mechanisms (marginal performance difference these days)
- having to convert between C++ data structures and Java data structures (can't just copy memory between buffers)
- many of the books and tutorials follow the crowd so it is hard to find non-C++ game dev information
- the core graphics libraries (DirectX and OpenGL) and many off-the-shelf engines are C/C++ based
- many games try to run as fast as possible so they can add more visually appealing features
It is not easy to work with C++ libraries from bytecode languages like Java (writing a JNI layer) and .net (lots of marshalling/unmarshalling, api/structure attributes). So it adds quite a bit of work for little benefit.
A side note: some game servers use Java.
Similar post here: https://stackoverflow.com/questions/1034458/why-arent-video-games-written-in-java
Java isn't fast enough for most game development. It's far slower than using C++/Assembly, which is the standard. It's the same reason more game development isn't done using C# or VB. Game developers need and plan every last clock cycle that they can get their hands on for things like physics calculations, AI logic, and environment interactions.
For simpler games, Java could be used quite effectively. If you want to create a Tetris clone or Bejeweled, or something else of that level of detail, then Java would work fine. But Java can't possibly create games like Halo, Medal of Honor, Command & Conquer, and so forth and make it playable. At least as it exists nowadays.
And the reasons you list in your question are valid as well. Except, I think, for the lack of game developers with Java expertise. Many games on phones and other portable devices are written in Java (including most Android games), and some of the games are quite excellent. So I think there is a decent, and growing, base of game developers with Java knowledge.
The thought is changing on the ability to use these higher level languages for some of the more advanced games. For instance, one of my favorite games, Auran's Train Simulator, is written with large portions in C#, and it works quite well. So the base is growing and will continue to evolve.
Modern games are all about 3D graphics happening in special purpose hardware.
Even back in 2002, Jacob Marner found in his report 'Evaluating Java for Game Development' that Java was quite usable for games, except for the most performance dependent parts, and due to the robustness of the language and the underlying JVM that it was cheaper to do it this way.
It is my personal opinion that with the progress that has happened since, especially in 3D-graphics, and with the excellent bindings to OpenGL et al, that this disadvantage is much less pronounced these days.
Hence the problem must be elsewhere. A likely reason is the size of the Java runtime (which is much less an issue these days with multi-DVD games), and another the inertia of existing code. It is notoriously brittle to start working with native code in Java. A third reason is what the star developers doing the games are familiar with. A fourth is whether Java is at all available on the platform.
One thing is certain though - most games are moving into being scriptable instead of having it all burned in C code from the start, and you want the best runtime underneath your scripting language. These days this essentially means either the CLR or the JVM.
Game developers like to be close to the metal and often will write their tight inner loops in assembly. Java doesn't offer the same level of possible performance, both in terms of consistent speed or memory use (running a JIT takes its toll).
I think the limiting factor for most people is the (lack of) availability of good game engines. To get very far, we need to look at why those aren't available.
I would look at that from the other direction for a moment. Developing a game engine (for example) is a lot of work. Who would benefit enough from developing one to invest the time and effort to do so?
Most of the obvious candidates for framework-like development in/for Java (e.g., IBM, Oracle) seem to have zero interest in games. The obvious candidates for game development (e.g., Id, EA) seem to have almost equally little interest in Java.
Nearly the only candidate I can think of that seems at all reasonable would be Google. The primary development language for the Android is Java, and encouraging game development for Android could provide a real advantage for the platform.
As far as I know, they haven't done so (yet?) though, which leaves some pretty severe limits for almost anybody else. Without little in the way of modern, high-performance game engines to use development on Java means quite a bit of extra work, with (what looks to me like) little prospect for producing a lot of benefit in return for that extra work.
The question is on par to asking something in the lines of:
What is better to power your car, a boat engine or jet engine.
It comes down to scalability, bug avoidance, speed, memory signature, modularity and a whole host of things. The question should not be be about what is better as an industry standard, the question should be 'what is better for me' as in what you know or how well you know it. If it does the job then it does the job, if you can actually sell the idea then it works and who knows you might even bend a few spoons.
Java wasn't made with game development in mind, Java was made to be a language 'for the web'.
As for game development, Sun didn't really support Java as a game development language as Microsoft backed C#.
I think the lack of compelling game development frameworks is what really killed Java in this aspect.
It's easier to glue C more directly to brand new unconventional hardware and drivers. The sooner and closer a game programmer can get to the hardware, the better they can outspec competing games. Later game programmers just stick with the same methodology and tools as those prior proven games.
For games where optimizing to the latest hardware is less important, such as casual cell phone games, using C in this way is less important than is Java's greater portability.
For some people reason has nothing to do with speed, libraries, or availability. It is simply because of the language itself. Some people simply do not like Java the language. Other people would rather use their favorite programming language instead of using Java to make games.
It could of course be something else. Could someone who knows the business better than me explain why Java isn't getting momentum when it comes to game development?
It's an interpret language, ie slow. You're dealing with graphic and graphic card which is hardware. What's a good language to deal with hardware? Well C++, it's pretty low, and you deal with pointers and whatever.
If you want to pump out crazy graphic like crysis and whatever you're not going to do Java for it.
Not only that, Oracle owns Java, the thought that a company can sue you doesn't bold well. Especially when you want to build your own interpretor for JAVA to target gaming without getting sue due to fragmentation FUD.
Not the answer you're looking for? Browse other questions tagged javagame-development or ask your own question.
Active3 years, 9 months ago
Why aren't many commercial, 3D video games (not random open source 2D ones) written in Java? In theory, it makes a lot of sense: you get a productivity boost and a cross-platform application almost for free, among other things, such as the vast amount of Java libraries, and built-in garbage collection (although I admit I'm not sure if the latter is a good thing). So why is it rarely used? I can only think of a couple popular commercial games written for the Java platform.
3d Java Pc Games Windows 7
Is it because of performance? If so, wouldn't most of the heavy lifting be done by the GPU anyway?
Sasha Chedygov
Sasha ChedygovSasha Chedygov95.2k2424 gold badges9494 silver badges105105 bronze badges
closed as not constructive by KevMay 23 '12 at 9:00
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.
22 Answers
The game development world is a funny one: On one hand, they're often quick to accept new ideas, on the other hand, they're still in the stone age.
The truth is, there's rarely that much incentive in switching to .NET/Java/anything other than C/C++.
Most game companies license parts of the game engine from other companies. These parts are written in C++, and although you might have access to the source so you could port it, that takes a lot of effort (and of course, the license needs to allow it).
Also, a lot of legacy code already exists in C++. If code from previous projects can be reused (say, if you're writing a sequel), that counts even more in favor of sticking with the same language, instead of rewriting it in a new language (more so since you'll likely reintroduce a ton of bugs which you'll need to spend time ironing out.
Finally, it's rare for games to be written in 100% C++ anyway - a lot is done using scripting languages, whether they're custom or just integrating an existing languages (Lua being one of the more popular ones these days).
As far as garbage collection is concerned, that can be a bit of a problem. The problem is not so much that it exists, it's more how it works - the garbage collector MUST be non-blocking (or at least be guaranteed to only block very briefly), since it's simply unacceptable to have the game freeze for 10 seconds while it scans all the allocated memory to see what can be freed. I know Java tends to choke quite a bit in GC'ing when it's close to running out of memory (and for some games out there, it will).
You're also a bit more restricted in what you can do: you can't fully exploit the hardware due to the overhead of the runtime. Imagine Crysis being written in Java... even if that's the only visible difference, it just wouldn't be the same (I'm also pretty sure you'd need a Core i7 to run it.).
This doesn't mean these languages don't have their place in game development - and no, I'm not just referring to tool programming. For most games, you don't need that extra bit of performance you get from C++, including 3D games, and if you're writing it all from scratch, it can make perfect sense to use something like XNA - in fact, there's a good chance it will.
As far as commercial games are concerned - does RuneScape count? That may well be the most succesful Java game out there.
Michael MadsenMichael Madsen48.3k66 gold badges6464 silver badges7777 bronze badges
I think John Carmack said it best with:
The biggest problem is that Java is really slow. On a pure cpu / memory / display / communications level, most modern cell phones should be considerably better gaming platforms than a Game Boy Advanced. With Java, on most phones you are left with about the CPU power of an original 4.77 mhz IBM PC, and lousy control over everything. [...snip...] Write-once-run-anywhere. Ha. Hahahahaha. We are only testing on four platforms right now, and not a single pair has the exact same quirks. All the commercial games are tweaked and compiled individually for each (often 100+) platform. Portability is not a justification for the awful performance.
(source)
Granted, he was talking about mobile platforms, but I've found similar problems with Java as a whole coming from a C++ background.I miss being able to allocate memory on the Stack/Heap on my own terms.
Sasha Chedygov95.2k2424 gold badges9494 silver badges105105 bronze badges
MarcMarc2,41822 gold badges1616 silver badges2121 bronze badges
For one thing, Java's lack of operator overloading makes all of the math you have to deal with to get a working graphics pipeline very, very annoying and hard to read.
All of the matrix multiplication and affine vectors you need to deal with are a lot easier to follow if they're in well-formed mathematical expressions rather than object-oriented expressions like
That's just terrible. Math shouldn't look like that.
WelbogWelbog51.5k88 gold badges9898 silver badges116116 bronze badges
I think .NET had (has) a lot of the same perceived issues that Java has. Microsoft has just done a better job at marketing to developers with XNA :-)
Joel MartinezJoel Martinez33.7k2424 gold badges118118 silver badges178178 bronze badges
Minor points first:
- any productivity boost from Java ishypothetical. The syntax is almostidentical to C++ so you're reallyjust banking on savings from memorymanagement and standard libraries.The libraries have little to offergames developers and memorymanagement is a contentious issue dueto garbage collection.
- cross-platform 'for free' is not asgood as you think because fewdevelopers want to use OpenGL andseveral key platforms probably lack agood Java implementation or wrappersfor their native libraries, whetherfor graphics, audio, networking, etc.
But mainly, the issue is backwards compatibility. Games developers moved to C++ from C and to C from assembly purely because the migration route was smooth. Each interoperates closely with the previous, and all their previous code was usable in the new language, often via a single compiler. Therefore migration was as slow or as fast as you liked. For example, some of our old headers in use today still have #ifdef WATCOMC in, and I don't think anybody has used the Watcom compiler here in a decade or more. There is a massive investment in old code and each bit is only replaced as needed. That process of replacing and upgrading bits and pieces from one game to the next is nowhere near as practical if you changed to a language that doesn't natively interoperate with your existing code. Yes, C++/Java interoperability is possible, but very impractical by comparison to simply writing 'C with a bit of C++' or embedding asm blocks in C.
To properly supercede C++ as the game developers' language of choice, it must do one of two things:
- Be easily interoperable withexisting legacy code, thuspreserving investment andmaintaining access to existinglibraries and tools, OR
- Demonstrablyshow up-front enough of aproductivity boost that the cost ofrewriting all your own code (orreworking the interfaces intoreusable components that can be usedfrom that language) is more thancovered.
Subjectively, I don't think Java meets either of those. A higher-level language might meet the 2nd, if someone is brave enough to be the pioneer. (EVE Online is probably the best example we have of Python being usable, but which uses a fork of the main Python language, many C++ components for performance, and even that is for a fairly undemanding game in modern terms.)
KylotanKylotan16.6k66 gold badges3838 silver badges7070 bronze badges
![Games Games](/uploads/1/2/6/2/126256535/199358763.jpg)
I'm playing the Sims 3, and I did some poking around.The graphics engine is C++, while the scripting and behavior engine is C#/Mono.So while C++ is there for time critical bits, other stuff like .interaction, game logic, AI is in an object oriented managed language.
John SimonJohn Simon
- Are there any good ports of gaming engines/libraries?
- Many C/C++ developers, particularly the ones on Windows (where most commercial games are written) are familiar with Visual Studio. There is no comparison in IDEs.
- In general, Java has been sold to businesses because of it's solid typing and it has a perception of not having memory management issues.
- And yes, Java still suffers from a perception that it is slow, and it's memory management is poor, and for games, it probably is ill-suited to the task. As stated in some of the other answers, garbage collection just isn't going to cut it when you are dealing with real-time high-performance requirements. Video games push CPUs and GPUs to their limits.
35.5k1010 gold badges9292 silver badges129129 bronze badges
One of the biggest reasons Java and other Virtual Machine languages are not used for games is due to Garbage Collection. The same thing goes for .NET. Garbage collection has come a long ways and works great in most types of applications. In order to do garbage collection though, you do need to pause and interrupt the application to collect the trash. This can cause periodic lag when collection happens.
Java has the same problem for realtime applications. When tasks must run at a specific time, it is hard to have an automated task such as garbage collection respect that.
It is not that Java is slow. It is that Java is not good at handling realtime tasks.
Chris DailChris Dail21.3k99 gold badges5858 silver badges7272 bronze badges
A large reason is that video games require direct knowledge of the hardware underneath, often times, and there really is no great implementation for many architectures. It's the knowledge of the underlying hardware architecture that allows developers to squeeze every ounce of performance out of a gaming system. Why would you take the time to port Java to a gaming platform, and then write a game on top of that port when you could just write the game?
edit: this is to say that it's more than a 'speed' or 'don't have the right libraries' issue. Those two things go hand-in-hand with this, but it's more a matter of 'how do I make a system like the cell b.e. run my java code? there aren't really any good java compilers that can manage the pipelines and vectors like i need..'
San JacintoSan Jacinto7,43433 gold badges3434 silver badges5757 bronze badges
Performance issue is the first reason. When you see the kind of hyper optimized C++ code that are in the Quake engines ( http://www.codemaestro.com/reviews/9 ), you know they're not gonna waste their time with a virtual machine.
Sure there may be some .NET games (which ones ? I'm interested. Are there some really CPU/GPU-intensive ones ?), but I guess it's more because lot of people are experts in MS technologies and followed Microsoft when they launched their new technology.
Oh and cross-platform just isn't in the mind of video games companies. Linux is just around 1% of market, Mac OS a few % more. They definitely think it's not worth dumping Windows-only technologies and librairies such as DirectX.
KsempacKsempac1,69722 gold badges1616 silver badges2323 bronze badges
You can ask why web applications aren't written in C or C++, too. The power of Java lies in its network stack and object oriented design. Of course C and C++ have that, too. But on a lower abstraction. Thats nothing negative, but you don't want to reinvent the wheel every time, do you?
Java also has no direct hardware access, which means you are stuck with the API of any frameworks.
Markus LuxMarkus Lux1,25711 gold badge99 silver badges1919 bronze badges
Misconceptions about performance and poor JVM optimizations would be my guess. I say misconceptions about performance because there are some Java ports of C++ games that perform faster than their C++ counterparts (see Jake 2). The real problem, IMHO, is that many Java programmers aren't focused so much on bleeding edge performance as they are with ease of use and understandability/maintainability of code. On the C/C++ side of things you're essentially coding in a slightly higher level assembly language and its about as close to the hardware as you can get without writing in assembly or straight machine code.
illvmillvm
List of game engines on Wikipedia lists many game engines along with the programming language that they are written in.
There are several Java game engines listed.
Clicking some of the links will lead you to examples of games and demos written in Java. Here's a couple:
For certain games and situations, Java's trade-offs might be acceptable.
JohnBJohnB12.2k1414 gold badges7979 silver badges9797 bronze badges
.NET definitely has some of the same issues that Java has when it comes to intense 3D performance. Microsoft has also invested a lot more time and money in the development of the libraries when it comes to working with 3D heavy operations.
(...personally, I also think they had a leg up when it comes to the magic between DirectX and .NET)
Justin NiessnerJustin Niessner216k3131 gold badges371371 silver badges504504 bronze badges
- Java is slow, most of the heavy lifting is not handled by the GPU. There's still animation, physics, and AI hitting the CPU, all of which are very time-consuming.
- Java doesn't exist on consoles, and consoles are a major target for commercial games. If you use Java on PC, you're eliminating your ability to port to consoles within reasonable time and budget.
- Many of the more experienced coders in the game industry have been using C and C++ long before Java became popular. The two points above may contribute to this, but I expect that many professional game coders just don't really know Java all that well.
- Someone else's point about middleware above was a good one, so I'm adding it to my answer. There's a lot of legacy code and middleware written specifically to link with C/C++, and last I checked Java doesn't have good interoperability. Using Java for most companies would involve throwing out a lot of code, much of which has been paid for in one way or another.
19.4k44 gold badges3535 silver badges5151 bronze badges
Actually, it is very possible for managed code to do 3d games, the problem is the back engines. With .Net, for a brief period, there was a Managed DirectX wrapper to DirectX 9 by Microsoft. This was before the abstraction that is now XNA.
Being given total access to DirectX api's, .Net games work a treat. The best example I know of is www.entombed.co.uk, which is written in VB.Net.
Unfortunately, on the Java side, it is seriously lacking - mainly for the reason that DirectX isn't available for Java, and games programmers know and understand the DirectX api - why learn yet another api when you will be returning to DirectX?
FozFoz
Game marketing is a commercial process; publishers want quantifiable low-risk returns on their investment.As a consequence, the focus is usually on technology gimmicks (with exceptions) that consumers will buy to produce reliable return - these tend to be superficial visual effects such as lens glare or higher resolution.These effects are reliable because they simply use increases in processing power - they exploit the hardware/Moore's law increases.this implies using C/C++ - java is usually too abstracted from the hardware to exploit these benefits.
Daniel CollicottDaniel Collicott
I'd guess that speed is still the issue. Cross platform is going to be an issue isn't it since you don't know what 3d card is available when you write the code? Does java have anything to support auto discovery of 3d capabilities? And I'd guess that there are tools to ease porting a game between the wii, xbox, and ps3, but expensive I'll bet.
![Java Java](/uploads/1/2/6/2/126256535/510423200.jpg)
The ps3 has java, via the blue ray support. Check the bd-j site.
lumpynoselumpynose
Even games written on the .Net platform are often highly optimized for speed like direct access to memory and bus. .Net allows to use C / C++ and mix it with higher level languages such as C#.
Game development studios often work close together with hardware vendors, which do provide access to low level interfaces of their products. This is a world, where you have to use ASM and C for device communication. A virtual environment would slow down these program parts.
Anyway, modern 3D games in fact do use higher level languages. Often, you'll find the game logic written in languages like Lua or Python. But the core (I/O, threads, task scheduling) of the typical 3D game will be written in low level languages for the next 25 years or as long devices do not allow abstraction and virtualization by themself (which will come).
cafebabecafebabe
I agree with the other posts about leveraging elements of a preexisting/licensed codebase, performance, etc.
One thing I'd like to add is it's hard to pull nasty DRM tricks through a virtual machine.
Also I think there's a hubris component where project managers think they can make stable/reliable code with C++ with all the perks like having absolute control over their tools and resources, BUT without all the negatives that complicate and bog down their competition because 'we're smarter than they are'.
JP772JP772
Runescape by Jagex is written in Java, the 'video game' tag might not specifically apply it being an on-line game, but it does have a decent following.
Mark SchultheissMark Schultheiss25.8k88 gold badges5757 silver badges8585 bronze badges
It was talked about it a lot already, u can find even on Wiki the reasons...
- C/C++ for the game engine and all intensive stuff.
- Lua or Python for scripting in the game.
- Java - very-very bad performance, big memory usage + it's not available on Game Consoles(It is used for some very simple games(Yes, Runescape counts in here, it's not Battlefield or Crysis or what else is there) just because there are a lot of programmers that know this programming language).
- C# - big memory usage(It is used for some very simple games just because there are pretty much programmers that know this programming language).
And I hear more and more Java programmers that try to convince people that Java is not slow, it is not slow for drawing a widget on the screen and drawing some ASCII characters on the widget, to receive and send data through network(And it is recommended to use it in this cases(network data manipulation) instead of C/C++)... But it is damn slow when it comes to serious stuff like math calculations, memory allocation/manipulation and a lot of this good stuff.
I remember an article on MIT site where they show what C/C++ can do if u use the language and compiler features: A matrix multiplier(2 matrices), 1 implementation in Java and 1 implementation in C/C++, with C/C++ features and appropriate compiler optimisations activated, the C/C++ implementation was ~296 260 times faster than the Java implementation.
I hope you understand now why people use C/C++ instead of Java in games, imagine Crysis in Java, there would not be any computer in this world which could handle that... + Garbage collection works ok for Widgets which just destroyed an image but it's still cached in there and needs to be cleaned but not for games, for sure, u will have even more lags on every garbage collection activation.
Edit: Because somebody asked for the article, here, I searched in the web archive to get that, I hope you are satisfied...MIT Case Study
And to add, no, Java for gaming is still an awful idea. Just a few days ago a big company that I will not name started rewriting their game client from Java to C++ because a very simple game(In terms of Graphics) was lagging and heating i7 Laptops with powerful nVidia GT 5xx and 6xx generation video cards(not only nVidia, the point here is that this powerful cards that can handle on Max settings most of the new games and can't handle this game) and the memory consumption was ~2.5 - 2.6 GB Ram. For such simple graphics it needs a beast of a machine.
ΞΆ--31.5k44 gold badges6666 silver badges9191 bronze badges
Lilian A. MoraruLilian A. Moraru