voxel.js brings Minecraft-style games to the open web
You’ve likely heard of Minecraft. If not, it’s this game about placing blocks to build anything you can imagine. It can also be about adventuring with friends or watching the sun rise over a blocky ocean (still neat). Needless to say it has a cult-like following.
After purchasing 2 copies of Minecraft for his nephews to play, Max Ogden started looking into the modding community of Minecraft to see how feasible it would be to do things like hook Minecraft up to OpenStreetMap.
Sadly, Max had this say about his findings.
I was disappointed to find out that not only is Minecraft closed-source but it also hasn't shipped an official API (these are used to extend a programs functionality). Instead, if you want to change the way Minecraft works, you have to decompile the Java program that Mojang distributes and then reverse engineer it to make it do what you want. Despite these technical hurdles, due to the success of Minecraft there is still a huge modding community.
And this.
I have grown accustomed to the automated installation of modules that NPM provides and wondered if anyone had tried to make a package manager for Minecraft plugins. There are a few out there, but quite frankly they all reeked of Java (too many abstract interfaces, lots of boilerplate and hard to use build tools. Java was the first language I learned so I may very well be scarred from the experience) and were limited by the nature of decompiling as a workaround to Minecrafts lack of an API.
And this.
At this point I had decided that decompiling Java wasn't in my future, so as any JavaScript programmer would do I decided to rewrite the entire thing in JavaScript. The fun part is that at the time (3.5 weeks ago) I had zero experience programming games. But I had google search and free time.
With that free time, Google, GitHub, an obscure subreddit called voxelgamedev, James Halliday (@substack) and his girlfiend Jessica Lord - voxel.js was born.
Instead of making a giant game framework, voxel.js is split into a bunch of small building blocks called modules. Modules can be installed with npm, which is much easier than the Java way Max mentioned earlier in his findings with Minecraft.
Here are some modules they’ve started working on:
- voxel-engine - this is the main module for building voxel games - you can plug any voxel module into the engine.
- voxel - the logic that generates voxel world data and compresses voxel data so that it can be efficiently rendered in 3D. voxel-engine uses this.
- voxel-mesh - takes voxel data from the voxel module and turns it into a three.js 3D Mesh that can be displayed in a game. voxel-engine also uses this.
There’s a ton of addons, tools and utilities listed on the voxel.js homepage as well as details on making your first game.
For the full story, read Max’s intro post on voxel.js, check out the voxel.js homepage, follow @voxeljs on twitter, and also hop into #voxel.js on freenode and say hi!
Discussion
Sign in or Join to comment or subscribe