Hacker News new | comments | show | ask | jobs | submit login
A Minecraft-like Block Based Game Engine Using Three.js, WebGL and Node (badassjs.com)
98 points by mariuz 1788 days ago | hide | past | web | favorite | 42 comments



A friend of mine made something similar, plus multiplayer support (and minus gravity): http://benvanik.github.com/blk-game/


To my knowledge Firefox has had support for IndexedDB for a long time without a vendor-prefix. Why does the page claim that it doesn't? Is there a bug in the implementation? A missing feature?


I just looked into the code and found this: https://github.com/benvanik/blk-game/blob/cacacb4952554e77f3... I don't know if it's still accurate; feel free to file a github issue or pull request if not.


Firefox doesn't support IndexedDB in web workers yet, unfortunately. See: https://bugzilla.mozilla.org/show_bug.cgi?id=701634


Thank you for info and bug number.


are there any public servers that we could connect to?


just mine: ws://107.21.150.140:1338


this is incredible: I created the server and seconds ago, people were already building. The power of Minecraft: http://www.youtube.com/watch?v=OIwUoT4hOcs



Haha, it's a nice place! I finished someones house and then made a lake beside it :) Now I want to live there ;)


+1 and like! :-)


(BLK author here) Whoops - the public server I had running must have died. I'll get it running again tonight. If anyone wants their server listed just let me know! I have some directions on the site for how to get it in the listing on the page.


I filled in the form twice, just for info... ?


now I need to go set it up - on it now!


Wow.


wow indeed.


I'm always curious how much optimisation is required for these big voxel engines.

I assume since all voxels are the same size you can just batch draw them but even so there is going to be a lot within viewing distance that may be invisible.

Are they all just assigned to an octtree and then culled against the view frustum or do you really need some clever occlusion culling?


Every "voxel engine" I've ever seen just draws polygons. One of my co-conspirators on a side project[1] used surface nets over voxels with density bits to create slope-friendly meshes that are also used for physics calculations. Each mesh is pretty large and there are some economies of scale for drawing larger meshes like these.

Minecraft for a long time just batched each visible side, I think even ignoring occlusion, and drew it; I don't know if they precompute larger meshes now.

[1] - http://static.largerussiangames.com/voxels/videos/rigidbodie... (Each 'companion cube' is really attached to a spherical physics body, the physics aren't mapped to the mesh.)


this and the follow-up post were most useful when developing the voxel.js components http://0fps.wordpress.com/2012/06/30/meshing-in-a-minecraft-...


Nobody draws voxels, graphics cards aren't good at them. I don't know about these engines in particular, but in minecraft everything is converted to polygon meshes.


Nobody these days, but one of my all-time favorite games is Outcast[1], which used voxels for the terrain and polygons for smaller details. All it needed was a good CPU.

[1] https://en.wikipedia.org/wiki/Outcast_%28video_game%29


Haha, i had that too.. fun game.. i think the characters were polygons, though :)

Also there was https://en.wikipedia.org/wiki/Comanche_series even before Outcast. I don't think it used polygons. It was launched years before 3D graphics cards, too..


Ogden and Halliday are both names from the book Ready Player One (http://goo.gl/f3OUa). Is this just a coincidence?


I'm really looking forward to seeing more gaming in the browser and hope it catches on. Imagine writing a game and it works on all platforms, PC, Mac, Tablet Android, iOS, etc. Also, TV manufacturers keep putting more powerful chips in their TV's for HD decoding. Couple with this a good browser, could we eventually see an end to console gaming because everyone's TV can play 3D games? Not to mention a lot of the TV's already have network capability. There's plenty of progress to make no doubt but it seems like a serious possibility to me.


This is exactly the reason we started PlayCanvas [http://playcanvas.com]. I don't think it will be long before there is a modern browser in every TV, phone and tablet, in addition to every desktop machine.


I've seen you guys before, I'm gonna have to play around with this sometime. I like how you've decided to also be the publisher/CDN for the games. Right now it seems like everyone who launches some demo has to build and manage their own web presence. Something a native game developer doesn't necessarily have to do. This could help take that extra load off their back. I imagine you'll eventually offer internal APIs of sorts like Steam does, achievements, cloud storage for saved games, etc.


Please do get in touch.

We love how easy it is to get a sample/demo/game published using PlayCanvas, we use it _all_ the time. We offer the option to download your game export and host it yourself but it's one button to publish to PlayCanvas so we're sure most people will want to do that.


If you can deal with downloading a Java plugin there's some pretty advanced games that run in a browser.

Example: http://www.drakensang.com


not really, its just a native code wrapper and most games still require Windows


Agreed. Someone please make an AOE2 clone for the browser. It's the perfect environment for multiplayer RTS.


I think the big barrier for building a multiplayer RTS in the browser would be the lack of UDP sockets.

You could certainly do something with websockets but it may involve making substantial compromises.

With TVs you have the added issue that people probably don't want to replace their whole TV every couple of years just to upgrade the graphics or whatever.


Hopefully WebRTC data channels will enable UDP-like comms from the browser.


My understanding is that WebRTC includes udp-like connections between browsers directly. P2P, rather than client-server.


> I think the big barrier for building a multiplayer RTS in the browser would be the lack of UDP sockets.

This is brought up often but it appears some basic multiplayer is possible over websockets (I've written a very simple game using them). If UDP is that necessary, people will push for it and we'll eventually see it (or something equivalent) in the browser.

> With TVs you have the added issue that people probably don't want to replace their whole TV every couple of years just to upgrade the graphics or whatever.

This is turning out to be less of the case though as older PC hardware can still run newer games. The need for graphics is no longer growing faster than the resources to power them. This is especially noticable in the indie game market where rather simple graphics games have become very popular. Even high-end games don't "need" new power as much as they once did, the PS3 is what, 7 years old now?


I've built a few prototype multiplayer games that use web sockets (Socket.io actually) and the performance has been encouraging. One game I posted on HN had over 30 concurrent users without noticeable lag. It was also terribly inefficient. Each client had 5 msgs/sec outgoing and 150 msgs/sec incoming. The incoming messages could definitely have been optimized.


Manic Digger, a C# open source clone of Minecraft and Ace of Spades, is also getting a WebGL version.

http://manicdigger.sourceforge.net/ - click "development news"

I make it with Script# (C# to JS converter), WebGL, and WebSockets. Both desktop OpenTK version and WebGL version can be compiled from common source.

But it's missing 2 weeks of work to finish the port.



I'm confused. How does one simply play in the world? I see lots of docs for components and such, but no simple "Play here" button or link.


If only someone could turn this into a useful UI for dwarf fortress!


Can it handle rendering the star ship enterprise all at once?


Is there a playable form of this somewhere? I spent a few minutes looking around...


Click on any of these demos: http://voxeljs.com/#gallery




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: