To this end, I've been toying around a bit with an open source Minecraft clone called Minetest lately [1][2]. It's surprisingly complete, and could also have great uses in (programming) education.
It has a C++ core based on the Irrlicht 3D engine, but many of the game mechanics are implemented in Lua. Modifications like the examples in Teachcraft can also be built in Lua. For example, this [3] is a mod to spread flowers and mushrooms around the map.
The Lua language isn't used much currently in the education environment, which is mostly focused around Scratch, Python and sometimes Javascript. Then again, seeing different languages and noticing their similarities can be educational in itself.
Finally, I've been wondering how hard it would be to port something like Minetest to Emscripten. Irrlicht seems to be compatible already [4]. The non-JIT version of Lua is compatible as well [5]. Obstacles in Minetest that I can identify would be the heavy use of the filesystem, the use of UDP sockets and memory sharing between threads.
Would anyone know more about how hard porting something like this would be?
[1] https://github.com/minetest
[3] https://github.com/minetest/minetest_game/blob/master/mods/f...
[4] http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=51...
https://github.com/cjdell/Craft/commit/c0162acb36ed8f538c6bf...
See it working here: http://wb.buz.co/craft/main.html
In the end I ended up making this instead from scratch: http://webblocks.uk/
I might return to it though because my version isn't as functional!
I
For those curious, https://github.com/satoshinm/NetCraft is my first project with WebAssembly/emscripten. It was surprisingly easy to port from Michael Fogleman's Craft (https://github.com/fogleman/Craft/). I briefly tried porting a few other open source block-style engines without success, but Craft being written in plain C with only a few libraries is relatively straightforward.
The initial requirement is to refactor the main loop, from while(1) to emscripten_set_main_loop, a common step for most all emscripten ports. Then update the cmake build file to build with the Emscripten.cmake module, and you're almost done. Emscripten's GLFW3 wrapper covers nearly all of Craft's usage. I posted a fairly minimal pull request showing the basic changes needed: https://github.com/fogleman/Craft/pull/175
After that, the other major change is networking. Craft used a separate thread to listen for network data using blocking sockets and parse message boundaries. But on the web platform with WebSockets, networking is even easier, I use emscripten_set_socket_message_callback() to get called when a new, complete message arrives. Easy as pie.
The harder part is the remaining long tail of minor bugs. At this point, the web port of Craft was functional, but difficult to play, a death by a thousand cuts. Emscripten's GLFW implementation had a few bugs related to cursor focus and keyboard handling, but I developed test cases and submitted fixes (https://github.com/satoshinm/emglfwbugs), which were all merged into emscripten's incoming branch. Until they were merged I built against a patched emscripten.
If anyone wants to get their hands dirty with emscripten, I highly recommend it. You can write the game in C, but the APIs are bridged to JavaScript, and it was fun to extend it and add new API for HTML5 platform features. I implemented the glfw joystick API (https://github.com/kripken/emscripten/pull/5175) on top of the HTML5 Gamepad API, and drop callbacks on top of the HTML5 File Drop API (https://github.com/kripken/emscripten/pull/5206), and started but have yet to finish the glfw monitor API on top of the HTML5 Screen API (which reminds me I ought to finish https://github.com/kripken/emscripten/pull/5205...). This means existing games written using GLFW (a popular multi-platform library for OpenGL, see http://www.glfw.org) with these features should port to the web using emscripten automatically.
After the web port, I continued to enhance https://github.com/satoshinm/NetCraft merging open pull requests from https://github.com/fogleman/Craft and developing new features and fixes. Blocks no longer break instantly, but instead are mined by holding down the mouse button, drawing a growing block break indicator until it breaks, and so on. Up until last month, recently taking a break (to investigate a few other, semi-related projects). However, it is still very playable in the current state.
A live demo can be found at https://satoshinm.github.io/NetCraft/, but the more interesting possibility in my opinion is multiplayer. Craft's original Python server backend can be connected to over the web (/server servername), using a websocket proxy, but I also wrote a Bukkit plugin to bridge a small chunk of the Minecraft world: https://github.com/satoshinm/WebSandboxMC. Last month I ran a server on a VPS (for 1 month), backed by a variant of the open source Glowstone server (https://github.com/GlowstoneMC/Glowstone), with this custom plugin and it peaked at a couple dozen users, running decently smooth. I also experimented with hosting on Heroku, it is less stable and deletes when the dyno shuts down, but works (for a smaller number of users): http://netcraft.herokuapp.com
I don't know if Craft is the answer, but I definitely agree, a web-based block style game is extremely appealing. The next major missing piece I see is extensibility, allowing outside developers to conveniently and cleanly create and distribute new content. Minetest is way further in this regard, I have not looked into it, but at least the filesystem and networking should be feasible to port to emscripten (emscripten has its own virtual filesystems), and shared memory may benefit from the upcoming SharedArrayBuffer technology: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Also recently managed to get it running with @edu_blocks https://twitter.com/damianmooney/status/881158457671524353
So in general you can do anything with Minetest that you can with the raspberryPi version of minecraft.
That game (and others) was developed by the Minnesota Educational Computing Consortium (MECC), an organization founded by Minnesota legislature. They developed educational software and distributed it on computers across the state of Minnesota.
Later, due to the huge success of the game, they sold the game (bundled with others) across the US.
tl;dr: made possible by government funding
https://medium.com/@stevepepple/why-did-all-children-of-a-ce... https://en.wikipedia.org/wiki/MECC
In this case, the other issue is that Minecraft is pure entertainment software. It may have educational value, but the origin of the game makes it a hard sell. (Civilization and SimCity faced similar problems.)
Can you expand on this? Did you use 'static' for VBOs that were only used for one or two frames?
And also in my opinion really important, is that Minetest is a real thing. What you're writing isn't some elusive Scratch project that you're gonna find several years later collecting dust on your hard drive, nor is it some Python thingamabob that you've glued onto Minecraft. Your mod is something that you can use as long as you're using Minetest (which itself is something that you will always be able to use, as it's out there for free) and your mod is something that you can post on the Minetest forum to share with others. That, at least to me, makes a huge motivational difference.
It was also great when he realized he didn’t need a superman command to fly because the combo of hulkjumping while flash was active made flying unnecessary.
http://www.ocsmag.com/2016/04/04/mining-for-education/
My 5yo son has been playing Minetest for a number of months now and loves it. He has asked for certain features---e.g. having fire truck be able to shoot water to put out fires rather than having to get out and use buckets of water---and I intend to walk him through adding that feature and others as he gets older. He's asked for things in the game that there are no mods for---I intend to show him how to create them using Blender, which I also think he'll have fun doing (granted, I'll have to remember how to use Blender!).
You may be able to do this in Minecraft, but I want him to see that _any_ aspect of the game can be modified and studied and shared, even outside its scripting language. I want him to see that it's encouraged, and normal. I don't want him to ever think that at some point, he'll be told "no, you can't do that", or "no, you can't see the source code---you can't study that".
Education isn't a short-term goal: it evolves over time. Free Software is well suited for education[0] not only for its practical benefits of study, but for its social benefits that are in line with the inquisition encouraged by other fields.
At this past year's LibrePlanet lightning talks, a speaker involved in gaming in free software provided his opinions on getting people involved with free gaming. Donald Robertson of the FSF provided his opinions on the matter and stated that people he spoke to wanted something more: they wanted to be involved in the community that they're already involved in with proprietary games. They don't want to explore new communities---so they'll mod games they're already involved in, proprietary or not. And this seems to be the source of a lot of resistance I get when talking about kids playing Minetest instead of Minecraft here on HN.
The webpage posted in this thread states, "Learn to program Python within a multiplayer world we all know and love, Minecraft!" And when getting children interested in certain topics, catering to interests is a powerful tool. But I still encourage trying to give Minetest a try: there are many similarities that children might be interested in. Ultimately, it's a judgment call, and if Minecraft is the only way to get your child interested in programming and they're already playing the game, less is lost. But if you're introducing your child _to_ Minecraft for the sake of modding and teaching programming, please consider Minetest instead.
Thanks! This is the type of actionable anecdata that I can use. I wasn't sure if it was too early to introduce my children to Mine[craft|test] at such an early age, but glad to hear that it's encouraging discourse and inquiry.
That depends. It can be, if your class sizes.
However, last two schools I worked with simply bought a lab-worth of Raspberry Pis, and used that limited version of Minecraft.
All the schools I know of have an iPad per child these days. I doubt it's an issue [Edit: Ok roger that, not all schools. Consider me told]
There's also this https://education.minecraft.net/
If you think most schools have an Ipad per child, you live in a bubble.
For reference I was also talking from within a UK only bubble too.
This might shock you, but that's not exactly common. Also, an iPad has a lot more potential uses than a Minecraft license.
The way how mcpi works is by creating a network bridge between the RaspberryJuice plugin and Python. Commands in Python are send to the Minecraft plugin over the wire and handled there (using the Bukkit API), with output send back to the Python client. This is safer in the sense that you don't have the full Python environment running on the server and that (in theory) you can use both Python 2 and 3 (Jython support for Python 3 is not there yet). The drawback is that you can only utilize commands that are manually implemented and that the full Bukkit API is not directly exposed.
At one point, I also had a plan to expand this into a tutorial series but didn't really follow up on this due to a lack of time. I'd really like to do this some day, though.
[1]: https://github.com/Macuyiko/minecraft-python and video: https://www.youtube.com/watch?v=j4JfwS5hNlw
One of my goals is to get my son, who is really into Minecraft, also interested in programming.
The github project seems to be receiving updates too.
If I end up making some reasonable progress on this, I might just contact you later on, if that's ok with you!
At one point, I plan to experiment with ZipPy (https://github.com/securesystemslab/zippy) to see if that would be a viable option to get Python 3 support underway.
Maybe certain object/data types could have a physical presence like a database could be a shelf, and hooking them up physically would create a real database will multiple tables that could be interacted with in the game. I was thinking about this more in the sense of actually helping me model applications instead of teaching, as it would just be more fun to work with. Does anyone else have interest?
Another way of thinking about this could be like a library with bookshelves in game that you can actually walk though, and program an in game robot to get certain books when you want certain things (querying), and it could help visualize how a database and application were set up and working together.
Seeing stuff like this is really cool. Adding more to the community and growing opportunity.
I've been looking for a solution for teaching the more advanced students who want to start using a 'real' language. I was initially looking at using Scriptcraft, but TeachCraft looks like another great option!
It's been more of a challenge than I thought it would be to design the blocks such that the end set isn't near enough a 1:1 mapping to Java - showing it to a non-technical friend of mine made it clear that my intuition was way off. Would be interested to hear how you approached this (if you don't mind).
Also interesting that I didn't find your website when I was initially researching, though I did come across https://www.learntomod.com/ (and even that was hard to find). I suspect my base search term of "minecraft blockly" isn't the most common one used by the target market to find something for their kids though.
Here's a shameless link to a thing I created a while back when I was running workshops. Minecraft-like world that runs in pure browser aimed at teaching JavaScript:
Would these Python customized servers work with tablet Minecraft now?
"Step 1 - Install Minecraft"
I can't get Minecraft to work on my Windows laptop. Minecraft crashes after a few seconds with a Java error:
"Java (tm) Platform Binary SE has stopped working"
Tried searching for a cause and tried everything I could find. Perhaps someone here has some suggestions?
EDIT: Re downvotes: that will teach me to post a half finished piece while I went to check on actual Java error! Not complaining - my fault entirely for posting half-assed reply which sounded aggressive.
https://developers.facebook.com/tools/debug/sharing/?q=https...
minecraft education is $5/year, with 'opportunities for volume licensing' which sounds affordable, but then it feels really misguided for microsoft not to give it away for free. Getting future developers to have some contact with the microsoft ecosystem is worth more than $5 i would think.
FYI, Minecraft Pi has this facility too. My daughter loves playing with it.
https://www.raspberrypi.org/learning/getting-started-with-mi...
Not a stellar example of coding.