JavaScript Comes To Minecraft 149
mikejuk writes "JavaScript is the language of the client and it is becoming the language of the server. Now it seems set to be the language of Minecraft. ScriptCraft is a Minecraft mod that can be added to the game to allow the player to use JavaScript commands. Walter Higgins ported the Rhino JVM implementation of JavaScript in a few spare weeks over Xmas. Some additional JavaScript classes allow the construction of blocks making it possible to automate construction. It also provides a 'turtle like' drone class that makes it easier to move in 3D. It makes use of a fluent API to create a domain specific language for movement. As its creator says: 'Ultimately I think the ScriptCraft mod could be used to take building in Minecraft to a whole new level. With a full-blown language at the Player's disposal, it should be possible to create not just castles and forts but entire road networks and cities.' Most importantly of all, it not only pushes the boundary of Minecraft, it also provides a way to get kids who are already hooked on Minecraft to start learning JavaScript."
Nerd antennae went up (Score:5, Funny)
Re: (Score:1)
Same, I was so excited to see a JavaScript version of MineCraft. Thought it would be HTML5, and wonder how the memory and graphic would support it. However, it is more for automation or command line usage, using script command to create blocks.
Re: (Score:3)
Re:Nerd antennae went up (Score:5, Funny)
I'd much rather see a java implementation using lots and lots of redstone. Then you could theoretically run minecraft on minecraft in infinite regression. This could cause the end of the world so I'd be careful.
Re: (Score:3)
Re: (Score:2)
Re: (Score:2)
I'd much rather see a java implementation using lots and lots of redstone. Then you could theoretically run minecraft on minecraft in infinite regression. This could cause the end of the world so I'd be careful.
Oh No! Don't Tell the GCC developers! We're all be DOOMED!
Re: (Score:1)
We'll be fine.
It'll be so slow, the Sun would envelope the Earth before this would cause the end of the world.
Re:Nerd antennae went up (Score:5, Funny)
Javascript running via a 3D world written in Java would have a Lovecraftian madness-inducing quality. You'd take one look at it and start bleeding from the eyes while producing an inhuman scream, before vomiting up most of your internal organs.
I mean, either of those things (Javascript, or a 3D world written in Java) are capable of getting you half way there all on their own. Both cannot exist, yet they do. Even thinking of the two being combined is enough to PH'NGLUI MGLW'NAFH CTHULHU R'LYEH WGAH'NAGL FHTAGN **carrier lost**
Re:Nerd antennae went up (Score:5, Funny)
"How did he type **carrier lost**"
"Perhaps he was dictating it."
"Shut-up"
[John]
Re:Nerd antennae went up (Score:5, Insightful)
I didn't intend it that way but it kind of works, since Lovecraft did that kind of shit all the time.
"The end is near. I hear a noise at the door, as of some immense slippery body lumbering against it. It shall not find me. God, that hand! The window! The window!"
Maybe if he weren't taking the time to write "The window! The window!" his odds of escaping would improve.
Re: (Score:2)
No, that kind of thing only works in Dwarf Fortress.
The problem is that those damn Elephants keep stepping on the infinite strip of tape and ruining my Turing Megaproject.
You can do this in Java already? (Score:5, Interesting)
You can already do all this in Java. What is the benefit of exposing players to the wonder of javascript via minecraft vs exposing them to the wonders of java via minecraft? Either one is a POS.
I wish someone would do a C rewrite. People make excuses about the fully manipulable world and such but the reality is that there is nothing going on in minecraft that would make it tax a Pentium 3 without no gpu offloading had it been authored well in a decent language.
Don't get me wrong it's a great game and fun to play. The implementation just leaves a lot to be desired. Buggy as hell too but you can't blame that on the language!
Re: (Score:1)
I don't like Java either, but don't hate on the JavaScript, please. It's running my MSN client on a Pentium II smoothly!
Re:You can do this in Java already? (Score:5, Interesting)
OK, I realize there has been some variety of games over the years which were released for Linux like quake 3. But as for games on Linux that are actually currently popular, and which people playing on different OS can link up and talk to each other, there are extremely few.
Re: (Score:3, Informative)
Re: (Score:2)
Re:You can do this in Java already? (Score:5, Interesting)
There's nothing inherently special about Java that makes it able to run games on Windows/Linux any more than C/C++.
Holy fucking Jesus Christ, you haven't learned much in all that time have you? There is a hell of a lot more in Java. I once saw a (server-side) project of about 100k classes go from Java 1.3 32bit on Windows to Java 1.4 64bit on Solaris without even needing a recompilation. The stuff just worked.
This is miles and miles away from what it would have meant in C or C++, and you know it. Of course, C and/or C++ done properly can achieve something that is portable, but at least your most common data type doesn't change whenever you change the number of fucking bits in your CPU. Not mentioning the stability of the APIs whenever you want to do anything vaguely more complex than fopen.
Re: (Score:3)
This.
It's not that it's impossible to write nonportable java, it's just that what's interesting about Java, particularly when you compare it to C or C++, is that you get that portability with practically zero extra effort.
Java is not unique in this regard... although to the best of my knowledge, most of the other languages that achieve the goal are script-based.
Re: (Score:2)
Java is script based too. It just saves the script in an intermediate compilation phase to save on loading performance. You can output byte code with the Perl interpreter as well to the same end.
Re: (Score:2)
C and C++ can both be compiled for the JVM.
Yes, but I hear it makes you go blind.
Re: (Score:2)
That level of portability and cross-platform compatibility is nothing special; C/C++ is the rare exception because it exposes so many unportable features and is so completely lacking in runtime error checking.
C99 has
Re: (Score:2)
I'm not going to argue with that. Although I don't think there is any excuse for not doing your C/C++ properly so the benefit is mitigated somewhat.
This is a bit different though. This is a 3D game and performance is at least as important here as portability. A properly done and portable C/C++ is a better choice in this case than an easily portable but poorly performing Java implementation.
Every tool has its place.
Re: (Score:2)
In C/C++ you would have used an implementation of OpenGL which is only vaguely compatible with the Linux one. Of course, everything is supposed to work the same way, but really, it doesn''t. Yes, it is the fault of the shitty drivers on linux, but still, it's at best going to be a hit and miss operation.
Java3D might not be the cutting edge when it comes to 3D acceleration, but it really works all the same on all platforms where Java runs.
Re: (Score:2)
Re:You can do this in Java already? (Score:4, Informative)
No, not in this case. You must not be very familiar with java and its runtime. Java is DESIGNED to be extremely portable and is in fact one of the biggest reasons it was able to rise up and compete with C++ originally. I have ported many programs in java from a Windows Eclipse environment to a Linux native compiler and both of them produce virtually the same files, the compiled files actually ran on both environments without a recompile pretty much every time that I remember.
C++ on the other had can be a BEAST to try and port even trivial programs between Windows and Linux, and in my early college days proved to be a pain in the ass because we standardized all of our programs compilations to the gcc and g++ Linux compilers while I was used to doing a lot of my coding using either Borland or Visual Studios on a Windows machine (Visual Studios has its own weird flavors as it is, but even more generic compilers had nasty results).
Re: (Score:2)
"Java is DESIGNED to be extremely portable"
C was DESIGNED for the same reason. If you are doing a lot of platform specific specific stuff it is either poor design or an intentional tradeoff somewhere for performance and those bits should be abstracted so you can do the same thing for new platform. With java you lack the option to make that tradeoff. The Linux kernel is written in C. It runs on more platforms than anything I've ever written in any language and there are underlying bits written in ASM!
I would
Re: (Score:2)
To a degree I agree with that, but I was mostly letting the other poster know that just because a Java application was written for Windows originally does not mean it won't run on Linux, and in many cases will run without much additional work (if any). C you run into a lot of compiler/assembler issues because of it being a much lower level imperative language, and while implementations can be very abstracted with a lot of work, in the case of games and many application that are not necessarily just trying
Re: (Score:2)
This is true to a degree, but not all compilers were created equal in the case of C/C++. Java occasionally has that same come up but it is much more rare and usually isn't a big deal on the large platforms. I mean I can go write a simple 100 line program in Visual Studios right now, but it isn't going to run very well on Linux without some cajoling and a recompile on the gcc/g++ compiler. Hell, technically it won't even run on a Windows machine without the Visual Studios Runtime installed.
Depending on th
Re: (Score:3)
Get Play On Linux http://www.playonlinux.com/en/ [playonlinux.com], (your distro might distribute it). It comes with user contributed install scripts for a variety of games (from CD/DVDs, GoG, Steam, etc), which will download the version of wine with the best compatibility / least regressions for a particular title, install needed runtimes, do all the winetricks magic needed and install the games. I've installed a few old GoG games and some newer ones. I'm playing Skyrim through PoL now and it runs (with DLC, high rest t
Re: (Score:1)
The problem is that Notch is an absolutely terrible programmer. It's not Java, it's the actual code, and you can find out as much by analyzing it.
Re: (Score:1)
I'm sure Notch is but crap C is faster (and more efficient) than crap Java just like good C is faster than good Java, though crap C isn't necessarily faster than good Java (but sometimes is, Java is that bad).
Re: (Score:1)
C is also much more prone to fucked up pointer arithmetic and memory leaks. It is honestly probably better that it is written in Java if Notch is a bad programmer because at least you have a managed language so that the game doesn't constantly crash from some memory issue.
I will agree with you that normal performance yes, C absolutely wrecks Java, but good Java is at least decent considering it is a managed language. Hell, if someone were so inclined they can try to force some mock memory management by fo
Re: (Score:2)
The clear answer is for someone who isn't as shitty a programmer (maybe a student learning games programming in C or C++) to write a minecraft clone and open source it. Should be a fun project for someone with the time. Replicate the login interface so you still need to own the game to use it. Someone will write a bypass but you can do that already.
Re: (Score:1)
http://minetest.net/ [minetest.net]
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
Yea, if he has managed to run out of memory in Java, the game would have been UNPLAYABLE if he wrote it in C.
Re: (Score:2)
Re: (Score:2)
I haven't honestly seen any of the code for the game so I don't know exactly what you are talking about in regards to his implementation. That said though, an OO implementation can be somewhat replicated in imperative languages like C, though obviously not the exact same since there are fundamental differences in the way things are handled. Hell, technically Java is not a true OO language even since it still heavily uses primitive types.
What I am saying is if he didn't even manage memory correctly in Java
Re: (Score:2)
"a whole team hasn't been able in a couple of years to fix this points more at a deficient design than at a poor implementation"
I'd contend that the design is just the first step of implementation (and the second, and the third, and the fourth). Maybe that is just semantics but I find that you aren't going to end up with a very efficient design if you don't stop and spend some time considering how you are going to implement it before you step back to the drawing board.
Re: (Score:2)
There is some truth to that but just like the moves on the chessboard what is bad or not bad changes with the state of the board. If you live by experienced based mantras like the queen being a critical piece who must be protected at all costs, you might miss an opportunity to win the game by sacrificing the queen.
That's the curse of experience. What experience tells you is right 99% of the time so more and more you tend to rely on memory rather than analysis to find your answers. If you don't follow up exp
Re: (Score:2)
I wish someone would do a C rewrite. People make excuses about the fully manipulable world and such but the reality is that there is nothing going on in minecraft that would make it tax a Pentium 3 without no gpu offloading had it been authored well in a decent language.
Even though it looks like just a blocky retro game, remember it's a completely dynamic world. There's a good amount of surfaces to draw and each block's state must be checked and maintained as they can be freely manipulated. Possibly a P3/1000MHz could just cut it though... I completely agree though that a C or, more likely C++ rewrite would be much appreciated.
Re: (Score:2)
If a CPU is idle, the server should not be getting bogged down.
Re: (Score:2)
That just means the CPU isn't the bottleneck. I don't know the details of how "real" minecraft servers are set up, but in general minecraft writes a lot of stuff to disk (since worlds get so big, and Java needs that memory for other things as well, it more or less has to).
Re: (Score:1)
Could be a number of things. Improper threading springs to mind immediately as many applications in the vein of how minecraft was developed do not use multi-thread expansion correctly. Over-use of memory is another considering how vast the spaces in minecraft are there may be some required disk writes server side and even if the implementation uses B-Trees and proper spanning those kinds of operations are extremely costly moving it from disk to active RAM and vice-versa. Without looking at the code or ob
Re: (Score:1)
They HAVE done a C rewrite. The mobile version definitively, and I think the XBox version as well. Go ahead and join their superiority - and perhaps reflect on the fact that there are tradeoffs to the potential efficiency gains of a rewrite.
Re: (Score:2)
take Dwarf Fotress and try to play it on a P3. You might think it's running normally because it's hard to gauge speed in a text-based interface but... it's running really slowly. World
Re: (Score:2)
Re: (Score:2)
I wish someone would do a C rewrite too. Just look at what this http://minetest.net/ [minetest.net] does: "limited to +-31000 blocks in all directions" Hell, that's one big difference to 256 blocks...
Re: (Score:2)
MC-Server.org [mc-server.org]
Re: (Score:2)
I wish someone would do a C rewrite. People make excuses about the fully manipulable world and such but the reality is that there is nothing going on in minecraft that would make it tax a Pentium 3 without no gpu offloading had it been authored well in a decent language.
Don't get me wrong it's a great game and fun to play. The implementation just leaves a lot to be desired. Buggy as hell too but you can't blame that on the language!
It is not a rewrite, as I have added a lot of things like quests, skill points, colored light, infinite up and down, teleporting, torches you can carry and 88 mobs while avoiding many of minecraft features. I did take inspiration from minecraft [blockstory.net] just like Notch took inspiration from Infiniminer. My game runs very fast in older machines (about 10x the framerate) and it even works in android and iphone. I wrote it in C# using Unity, you are more than welcome to try the free demo for each platform and ch
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)
In this case you are probably talking about a 400% performance boost. I realize that in most applications performance isn't a critical factor but if you are writing non-trivial 3D games in Java you are either extremely ignorant or a moron.
Re: (Score:2)
Cool. It doesn't seem to have redstone elements and creatures yet but definitely performs a lot better than minecraft. It really is a great start. I like the way it does blocks better, having them just pop in your inventory instead of falling to the ground. The 6 square crafting window instead of requiring a crafting table is also cool.
They have it backwards... (Score:3)
Most importantly of all, it not only pushes the boundary of Minecraft it also provides a way to get kids who are already hooked on Minecraft to start learning JavaScript
No, most importantly for my kid, it has the potential to get a highly JS-capable dad interested in Minecraft (a diversion he has hitherto managed to avoid).
However, whether this be a good thing or a bad one is a matter that's entirely up for debate. :)
Why wont JS just go away (Score:1)
Re: (Score:2)
Lua support... (Score:2)
I don't think there's much hope of that considering the huge similarities with python and considerable disparity in library availability and popularity. I'm not sure there's much awareness of it outside the gaming development community.
Re: (Score:2)
Apropos Lua... this isn't the first pl-in-a-block mod. Lua was first.
(It also isn't an acronym, and we are past the day when all programming languages were named in ALL CAPS).
Re: (Score:3)
Re:Why wont JS just go away (Score:4, Informative)
Does python still use whitespace as part of control flow structures? Ugh. I don't want to be the guy who posts the equivalent of "mysql doesn't have transactions" over and over in 2013, but I can't be bothered to keep up with a language I don't use, either.
It is however a fact that Python at least USED TO BE in a really bad neighborhood, sandwiched in between COBOL and FORTRAN in the "compiler really cares a lot about whitespace" ghetto, even if they've fixed it since then. I'd rather write a million parenthesis in LISP.
Re:Why wont JS just go away (Score:4, Funny)
Haven't fixed it, won't fix it.
>>> from __future__ import braces
File "", line 1
SyntaxError: not a chance
Re: (Score:2)
It's a feature, not a bug.
I'm sure the parent poster will hate Go as well but I feel this language design decisions ultimately do much more good than harm.
Re: (Score:2)
Yes, python does still use the "whitespace thing" and no it's not that big a deal, and until I learned Python 12 years ago, I felt as you did. There are good reasons why as programmers we have almost genetic revulsion at syntactically or semantically significant whitespace, but python enforces with whitespace pretty much what as a good programmer you're doing anyway, which is consistently indenting your code. Most people don't even notice it after an hour, your editor will do it for you, and in my case, a
Re: (Score:2)
Re: (Score:2)
Ha well you can keep lisp then. Python I'm a white space ghetto? To funny.
I found Eric s Raymond's take on python very interesting. He started out with your attitude but very quickly changed his mind once he actually started using it. Look it up. It's worth a read.
I've used both lisp and python. There's no comparison. Python is easy nicer. But it has a lot of lisp like features that make it a real pleasure to use. I'd prefer python over JavaScript any day. I was very sad the epiphany browser abandoned pytho
Re: (Score:3)
Re: (Score:2)
If that's the only thing you can find wrong with Python, then I think that speaks much more good about the language than bad.
Agreed, the whitespace thing is pretty much my only complaint about Python.
I don't script everyday, but when I do script and I can choose the language, I script in Python.
Re: (Score:2)
Unity has JS like language too and people are dead set on using it.
In my experience, everyone who's serious about game programming in Unity3D uses C# anyways.
Re: (Score:1)
Don't worry. You're not alone. I wish JavaScript would either mature or be replaced by another language: i.e. Google's DART.
The problem is that there is a huge crowd of developers who know JavaScript and like anyone in the human race, they don't like change and would like to see the status quo.
Re: (Score:2)
Re: (Score:1)
I wouldn't be able to convince my manager to such intermediate languages. No, not until such things get more popular with JavaScript developers and managers.
Re: (Score:2)
Re: (Score:2)
It's not just that a JS engine is easy to implement: it's that it comes as standard as part of Java (since Java 6).
Re: (Score:1)
xbox360 port (Score:3)
I would imagine this will primarily serve to ostracize the xbox port even further away from mainstream minecrafting.
Re: (Score:2)
I am amused (Score:5, Interesting)
I find it amusing that this is news but what about LuaForge [github.com]? It allows you to do Minecraft stuff in Lua, a language that can't be easier to learn, and is also pretty fast out of the box.
sounds like an earlier thread... (Score:2)
kids who are already hooked
Sounds like the earlier thread about a guy who wanted to get his wife hooked on (a.k.a., addicted to) video games just as he was....
Re: (Score:2)
New Version of JavaScript Needed! (Score:2)
I feel sorry for the Minecraft developers. Have fun with a language that doesn't have a class object system like every other modern mature computer language which makes working in a team environment so much easier.
While we're at it, why don't we introduce PERL to minecraft?
HTML was upgraded to HTML5 and CSS was upgraded to CSS3. Why can't JavaScript be upgraded so it is more in line with modern languages? If that could happen then Google could give up on developing their new DART language which is designed
Re: (Score:2)
This is old hat (Score:1)
Please no! (Score:2)
provides a way to get kids who are already hooked on Minecraft to start learning JavaScript
Won't somebody PLEASE think of the children and stop this madness?!
Hardly revolutionary (Score:5, Informative)
Re: (Score:1)
This isn't 1962! We don't write programming languages in all caps just because they're programming languages.
Re: (Score:2)
Lua isn't an acronym, nor is Forth. Fortran and Lisp have officially decided to not be written in all caps any longer.
Even when they were written in all caps, it wasn't because they were acronyms (then Fortran would be ForTran and Lisp would be LisP, I guess). It was because the computers of their era didn't support mixed case well. That's the reason they, along with COBOL (note: no one has bothered renaming it Cobol) are case insensitive languages to this day.
Re: (Score:2)
Right, and there are also multiple Bukkit plugins which allow scripting in various languages - JRuby & Jython, for example. And WorldEdit already allows a degree of Javascript. I'm sure this particular mod is cool, but it's absolutely nothing new. People have been extending Minecraft with scripting tools for well over a year now.
Slashdot... 2011's news in 2013!
I like me some Python (Score:2)
I wish he had chosen Jython. But then again, if he implemented it "the right way" using the Java scripting engine, Jython should be pluggable in no time.
Or use the source (Score:1)
It's cool! (Score:2)
So many times some kid has come up to me and said they wanted to learn to make video games. The trouble is that there's this giant gulf between the multimillion dollar games they play, and what they can actually do with newbie knowledge. When I was a teenager, (80's) I could see a game I loved like say... Ultima or Zork... and understand the steps leading up to me making that game. A little harder to find that maker's connection with Halo, Bioshock, Borderlands, etc. So maybe Minecraft can be a good bridg
Re:Java IS NOT JavaScript, you morons! (Score:5, Informative)
Re: (Score:2)
RTFS. Just because Java and JavaScript appear in the same paragraph doesn't mean someone is equating the two. This is a JavaScript engine coded in Java, hooked up to Minecraft.
Couldn't have said it better myself. It boggles the mind how many don't realize languages can target different run time instances and that *gasp* compilers sometimes are just layered language implementations. One of my college professors wrote a prolog compiler entirely in Java that was a very good compiler actually. Hell if one were so inclined, they could write a C# application that targets a JVM instead of the .NET framework.
Re: (Score:2)
I believe they were referring to the fact that JavaScript is executed on the client and this usage of it is moving it to the server-side... not that the client is written in JavaScript. Go drink some coffee and turn your brain on.
Re: (Score:2, Informative)
"JavaScript is the language of the client and it is becoming the language of the server. Now it seems set to be the language of Minecraft."
translated : "Javascript is a language that is often used in client side programs, and increasingly is used in server side applications. And soon it may also be usable within minecraft." Hell the second sentence makes it pretty clear that the first sentence isn't even talking about minecraft.
Re: (Score:2)
Re: (Score:2)
Re: (Score:2)