Minecraft is currently written in Java, which lets it run on just about every machine on the planet with enough memory. I saw a few post mentioning how they wanted a C++ port a week or two ago, but I don't remember their rationale.
Why would someone want the game ported to C++? Why would someone want it to stay on Java?
by royal decree this thread shall have a boycott placed upon it to prevent the upcoming insolence.
C++ is native, Java is not therefore C++ will always have the edge when it comes to speed. the problem with native code is that it has to be compiled for each architecture. yep, to make Minecraft as scalable as it is now you'd have to compile for x86 (and 64 although x86-64 is just an instruction set extension to x86), PowerPC, ARM (maybe not as necessary now but when smartphones get generally faster people might wanna play Minecraft on their iPhone/Droid/<insert phone name here>) and worst of all you can't applet it, downloadable clients for everybody!
truth be told, while a port to C++ may provide some nice speed optimisations, lesser occurring of the memory problems and a better basis for the graphics engine it would be time-costly, hard to maintain and a general pain to support on multiple architectures with new updates coming out left, right and centre.
@rikachu: that's lwjgl's problem, not java in general. nothing stopping notch from downloading the source and adding light sources that can be moved. (beauty of open source :biggrin.gif:)
Must agree.
Java, in it's most basic form, is simply a higher level C++, and that has its advantages as well as many disadvantages.
But the biggest problem in my opinion would be converting Minecraft to C++ (mainly because of the retarded C++ classes)
Actually, for a few years now, Java and C# have scored better than C++ in most every speed benchmark. The idea that java is slow simply is a myth. If you don't believe it, feel free to Google some speed comparisons.
Well, yeah, even a beginner's Java code can be faster then a very badly written C++ code. The idea is that Java is a (very) high level programming language while C++ is relatively low level. That means that while Java must relay on the "Java Virtual Machine" to work, and has little (read as: almost no) ways to access the system's inner core and the computer's inner working in order to make things work faster, C++ can easily do that since it was created in the 70's.
Think of it like this:
High level language (like Java) - Much more portable and easier to code, but on the other hand it's also usually slower
Low level language (like Assembly) - Gives the programmer a direct access to the computer's CPU, with absolutely nothing between the two. That mean that a good programmer can make VERY fast apps thanks to the ability to directly control the CPU. But it also means that the program relays on the hardware inside the programmer's computer, and therefor it's very not portable. It's also much harder to write a low level code.
Medium level language (that's how i call C, and to some degree C++) - Something in the middle. It combines the good and the bad from both worlds. It's portable, but requires extra work, and although it's hard to code in these languages it's still easier then low level one.
C, although officially is called a high level language actually has many many features and coding style from lower level ones, and that's why i like to call it a "medium level" one.
C++ IS a high level language but it still has many many C features in it, which mean that if a programmer want to "get closer" to the computer's hardware he can do that at any point.
He states that he will optimize MC but that would make it more difficult to program. As some may not be aware, MC is currently in alpha which means getting content and features come first . So when the big stuff is done and MC moves out of alpha we'll see these optimizations (in java).
Notch also stated he would have to switch to C++ if he wanted to bring MC to consoles.
Minecraft on consoles? Like a 360? This would be awesome. That would be really awesome.
The main point of this thread was to get a basic understanding of differences between java and C++ and how they apply to Minecraft. From reading it so far, a generalization seems to be "C++ is faster, but a pain to code and distribute to different platforms. Java uses more resources, but it's much easier to develop and everyone can use the same jar file."
As to the post concerning the actual porting: This was never about whether or not Notch would port the game. Debating about that this far into development is an entirely different topic best suited for a different thread or his blog.
Hm, that's somewhat beside the point, but more importantly high-definition graphics would probably ruin the entire Minecraft experience: The only reason that crude cubes can be assembled into something that sparks the imagination is that everything is left to the imagination. If you introduce realistic textures, you're stopping the viewer from forming her own mental image of the scene and it would just look awful.
Just compare this to the early graphical adventure games: Their resolution was pretty poor (320x200, sometimes 160x100 (early Maniac Mansion)), but they were super immersive because you recreate the scene in your mental image. My favourite example is the "door" animation: In those games, it consisted of two frames: door open and door closed. And it works. If you have high-definitions graphics, suddenly a two-frame door animation would look totally out of place. The crudeness of the animation works because the ambient resolution is already so low and the mind is heavily at work. This is the same mechanism that makes Minecraft so creatively appealing. A high-resolution Minecraft would simply not work!
That's probably the best point against HD graphics I have heard. Minecraft is Minecraft because of it's unique style of graphics, so it wouldn't look good HD (my old argument is that it looks like everything in real life is a meter block). But, then again, beauty is in the eye of the beholder. It's more of an opinion than anything.
On topic, a C++ port could be possible. After all, Notch knows C++. (I forget where I read that...here) But you would have to go through the process of Minecraft creation again, which would be horrible.
I there not some sort of program which interprets machine code and converts that to programming language code?
or
Couldn't you just download a java -> C++ converter and convert the source code into C++?
First, congratulations on the necropost.
Second: Yes. there are programs that do that, they are called decompilers, and they take machine code and try to create the desired high-level constructs from it.
And they work.
But you lose variable names, code formatting, and all comments, as well as the original file names and in many cases the files themselves, so you just end up with a shitload of source files that refuse to build because of unresolved externals (did I mention the functions will be missing their name as well?).
OK, warranted, one could compile the code to include symbol and debug information that might help on some of those issues. But the fact remains that there will be problems and the best case scenario is that you end up with completely unmaintainable code that isn't understood by anybody.
And "Converter" programs are useless. They only work on trivial applications. The thing is, the converter program can only really "know" about the different syntaxes between the "Source" and the "destination" language. For example, how is a converter supposed to "convert" the calls to a system.lang.string java object to C++ code? what string library will it support? those are questions that have nothing to do with language conversion and more to do with changing the programming paradigm of the two sources. In minecrafts case, LWJGL. You can't just wave a magic wand and have the entire code converted from using LWJGL to some C++ library, just as you cannot do the same thing and magically have it support Direct3d.
Think about it. a single tiny mistake or "miscommunication" in the translation and the entire thing could be useless since even the people who wrote the "original" code can't understand what is going on in the new code, even if they do know the language, simply because a lot of the important bits are stripped out- no comments, no symbols, etc. All programming languages except machine code are designed for humans to write and read. Compiling is the action of "converting" the source to something readable and usable by the computer, but that result has nothing relevant to people, computers don't give a **** if a variable is named strString or ****awidget47, all they care about is that it stores data. All the comments are gone by virtue of being only for humans to read, and often without specific intervention function names will be missing as well. In the specific case of Java->C++, or really any high-level language to any other, there will always be "TODO" coments strewn about the resulting source and half the time the work required to get that converted source code working at all takes longer then simply rewriting it from scratch, and rewriting programs is simply wasting time to get yourself in the same position you started.
Java has had a reputation as being slow since the start, which is bogus.
It was true in 1996. It hasn't been for quite a few years, and it stopped mattering even before that. the performance argument is the last thing diehard C/C++ advocates whip out to attack other languages, because there really aren't any other good arguments. A good programmer is going to make fast code regardless of the language, and a **** coder is going to write shitty WTF code with a good language.
The thing about Programming language debates, particular with regards to a software products use of it and especially with regards to calls to "port" to another language, is that:
1.People and companies all over the world are constantly building applications in C, C++, C#, VB.NET, Python, Perl, Java, Haskell, Ruby, PHP, all the time. None of them are failing because of the choice of programming language.
2.regardless of what you "choose" you are going to need somebody who is adept with the language to work on it. Notch is not Carmack, he can't perform miracles, he's not a super-genius.. he hasn't even released a game yet, come to think of it... I'd much prefer to see him write Java code because he is experienced with it, then C++ code while he's learning it, because he'll just end up doing things wrong (unless he has good beginners luck) and end up with messy code that will just end up being restructured later, and possibly by somebody else. And during such a rewrite there wouldn't be any progress on the game at all. The only end result would be that they might have a game that works reasonably well and happens to bear a striking resemblance to game that was released three years earlier that was written in java, by which point those infinitesimal speed improvements won't matter, assuming the new bugs don't get in the way.
Because of it's retro graphics, people assume that Minecraft should run super smooth on even older hardware, but the reality is that running a game with a virtually unlimited and destructible world with lighting can be quite demanding.
I've never understood the impression that Minecraft has "retro" graphics to begin with. I've only considered a game "retro" if it copied gameplay elements from a classic game, not because they decided they only wanted 16x16 textures, or because they use cubes. Additionally the landscape of cubes uses more polygons then a smooth landscape, and since it's randomly generated there is no way to "hand-tune" the poly count like you can with other games landscapes. I suppose I could compromise with said people and say it seems to be visually retro, but I'll still do it through clenched teeth.
Why would someone want the game ported to C++? Why would someone want it to stay on Java?
Must agree.
Java, in it's most basic form, is simply a higher level C++, and that has its advantages as well as many disadvantages.
But the biggest problem in my opinion would be converting Minecraft to C++ (mainly because of the retarded C++ classes)
C++ is more efficient.
Translating from one to the other at this stage of MC would be a brutal task.
It's easier said then done.
It doesn't matter. Notch isn't going to do it so discussing how one might go about getting started is meaningless.
There's honestly no good reason to port Minecraft at the moment. Performance is good enough for what the game needs.
Um, I have no idea where you are getting your information from but this is unequivocally not true.
Java can do anything that can be done in OpenGL.
Well, yeah, even a beginner's Java code can be faster then a very badly written C++ code. The idea is that Java is a (very) high level programming language while C++ is relatively low level. That means that while Java must relay on the "Java Virtual Machine" to work, and has little (read as: almost no) ways to access the system's inner core and the computer's inner working in order to make things work faster, C++ can easily do that since it was created in the 70's.
Think of it like this:
High level language (like Java) - Much more portable and easier to code, but on the other hand it's also usually slower
Low level language (like Assembly) - Gives the programmer a direct access to the computer's CPU, with absolutely nothing between the two. That mean that a good programmer can make VERY fast apps thanks to the ability to directly control the CPU. But it also means that the program relays on the hardware inside the programmer's computer, and therefor it's very not portable. It's also much harder to write a low level code.
Medium level language (that's how i call C, and to some degree C++) - Something in the middle. It combines the good and the bad from both worlds. It's portable, but requires extra work, and although it's hard to code in these languages it's still easier then low level one.
C, although officially is called a high level language actually has many many features and coding style from lower level ones, and that's why i like to call it a "medium level" one.
C++ IS a high level language but it still has many many C features in it, which mean that if a programmer want to "get closer" to the computer's hardware he can do that at any point.
He states that he will optimize MC but that would make it more difficult to program. As some may not be aware, MC is currently in alpha which means getting content and features come first . So when the big stuff is done and MC moves out of alpha we'll see these optimizations (in java).
Notch also stated he would have to switch to C++ if he wanted to bring MC to consoles.
The main point of this thread was to get a basic understanding of differences between java and C++ and how they apply to Minecraft. From reading it so far, a generalization seems to be "C++ is faster, but a pain to code and distribute to different platforms. Java uses more resources, but it's much easier to develop and everyone can use the same jar file."
As to the post concerning the actual porting: This was never about whether or not Notch would port the game. Debating about that this far into development is an entirely different topic best suited for a different thread or his blog.
That's probably the best point against HD graphics I have heard. Minecraft is Minecraft because of it's unique style of graphics, so it wouldn't look good HD (my old argument is that it looks like everything in real life is a meter block). But, then again, beauty is in the eye of the beholder. It's more of an opinion than anything.
On topic, a C++ port could be possible. After all, Notch knows C++. (
I forget where I read that...here) But you would have to go through the process of Minecraft creation again, which would be horrible.HAHAHAHAHAAHAHAHAHAHAHAAHA
Sorry, but that was completly needed.
On topic, Yeah it dosnt make much sence porting Minecraft to C++, because it would take a lot of time.
THAT BEGIN SAID...
I think C++ has more adventages OVERALL than Java. But it also has disventages as well. And considerating the whole time wasting issue...
Its not worth it.
or
Couldn't you just download a java -> C++ converter and convert the source code into C++?
First, congratulations on the necropost.
Second: Yes. there are programs that do that, they are called decompilers, and they take machine code and try to create the desired high-level constructs from it.
And they work.
But you lose variable names, code formatting, and all comments, as well as the original file names and in many cases the files themselves, so you just end up with a shitload of source files that refuse to build because of unresolved externals (did I mention the functions will be missing their name as well?).
OK, warranted, one could compile the code to include symbol and debug information that might help on some of those issues. But the fact remains that there will be problems and the best case scenario is that you end up with completely unmaintainable code that isn't understood by anybody.
And "Converter" programs are useless. They only work on trivial applications. The thing is, the converter program can only really "know" about the different syntaxes between the "Source" and the "destination" language. For example, how is a converter supposed to "convert" the calls to a system.lang.string java object to C++ code? what string library will it support? those are questions that have nothing to do with language conversion and more to do with changing the programming paradigm of the two sources. In minecrafts case, LWJGL. You can't just wave a magic wand and have the entire code converted from using LWJGL to some C++ library, just as you cannot do the same thing and magically have it support Direct3d.
Think about it. a single tiny mistake or "miscommunication" in the translation and the entire thing could be useless since even the people who wrote the "original" code can't understand what is going on in the new code, even if they do know the language, simply because a lot of the important bits are stripped out- no comments, no symbols, etc. All programming languages except machine code are designed for humans to write and read. Compiling is the action of "converting" the source to something readable and usable by the computer, but that result has nothing relevant to people, computers don't give a **** if a variable is named strString or ****awidget47, all they care about is that it stores data. All the comments are gone by virtue of being only for humans to read, and often without specific intervention function names will be missing as well. In the specific case of Java->C++, or really any high-level language to any other, there will always be "TODO" coments strewn about the resulting source and half the time the work required to get that converted source code working at all takes longer then simply rewriting it from scratch, and rewriting programs is simply wasting time to get yourself in the same position you started.
It was true in 1996. It hasn't been for quite a few years, and it stopped mattering even before that. the performance argument is the last thing diehard C/C++ advocates whip out to attack other languages, because there really aren't any other good arguments. A good programmer is going to make fast code regardless of the language, and a **** coder is going to write shitty WTF code with a good language.
The thing about Programming language debates, particular with regards to a software products use of it and especially with regards to calls to "port" to another language, is that:
1.People and companies all over the world are constantly building applications in C, C++, C#, VB.NET, Python, Perl, Java, Haskell, Ruby, PHP, all the time. None of them are failing because of the choice of programming language.
2.regardless of what you "choose" you are going to need somebody who is adept with the language to work on it. Notch is not Carmack, he can't perform miracles, he's not a super-genius.. he hasn't even released a game yet, come to think of it... I'd much prefer to see him write Java code because he is experienced with it, then C++ code while he's learning it, because he'll just end up doing things wrong (unless he has good beginners luck) and end up with messy code that will just end up being restructured later, and possibly by somebody else. And during such a rewrite there wouldn't be any progress on the game at all. The only end result would be that they might have a game that works reasonably well and happens to bear a striking resemblance to game that was released three years earlier that was written in java, by which point those infinitesimal speed improvements won't matter, assuming the new bugs don't get in the way.
I've never understood the impression that Minecraft has "retro" graphics to begin with. I've only considered a game "retro" if it copied gameplay elements from a classic game, not because they decided they only wanted 16x16 textures, or because they use cubes. Additionally the landscape of cubes uses more polygons then a smooth landscape, and since it's randomly generated there is no way to "hand-tune" the poly count like you can with other games landscapes. I suppose I could compromise with said people and say it seems to be visually retro, but I'll still do it through clenched teeth.