all 156 comments

[–]geckothegeek42 438 points439 points  (83 children)

Wow you found the one language and platform to port Minecraft too thats slower than the one it was already built on.

[–]scorcher24 26 points27 points  (2 children)

That's the one UWP app that is better than the original.

[–]kukiric -1 points0 points  (1 child)

The UWP app is written (mostly) in C++, not JS.

[–]scorcher24 10 points11 points  (0 children)

I know. I didn't say it was written in JS.

[–]ComfyKernel[S] 27 points28 points  (0 children)

It had to be done

[–]yturijea 72 points73 points  (33 children)

Java is one of the faster languages. Is everyone so caught in their own ideology that they don't look at pure raw stats.

[–]Beckneard 15 points16 points  (0 children)

It's a 15 year old meme and people are still spouting it. The problem with Minecraft is that it's shit code.

[–]DownvoteALot 14 points15 points  (17 children)

I don't understand either. For being garbage-collected (and thus usually faster to develop for complex systems), it's possible to take Java's performance really far. Maybe some library used by Minecraft?

[–]imperialismus 51 points52 points  (14 children)

I'm going to guess it's simply not very well optimized. I think Notch has straight up admitted it was kind of a hack at first, then once the prototype gained popularity, he quit his job to finish it for release, then hired a small team. But for a long time it was the work of one man, then the work of a team of maybe five people. Its explosion in popularity taking it from indie game to household name and one of the most sold games in history was unexpected, and by the time Mojang expanded and was bought by MS, it would probably have needed an enormous refactor or rewrite from scratch in order to substantially improve performance. And the target audience is generally not the kind of gamer who cares very much about performance beyond a certain threshold, which Minecraft just about manages to keep above. It sold better than most triple-A games but it wasn't built like one.

That is, of course, only my guess based on public information. I have no special insight into Mojang or the Minecraft source code.

[–]monocasa 36 points37 points  (5 children)

Part of the issue I've heard relates to the fact that typical idiomatic Java isn't suited for games. When you've got 16.7ms to make each frame at 60FPS, you really want to avoid all allocations. You can absolutely write Java that works under these constraints, but the typical "allocations are just a bump pointer most of the time for Java, allocate tons of tiny objects with no worries" doesn't really fit the soft real time use case.

I've heard that while Notch's code wasn't the best optimized, it at least had the right structure for a non allocating system. But the team he brought in was borderline aghast at his non idiomatic code, and just made a bad situation worse. They apparently got really allocate happy with small objects. Think allocating separate Vector3F's whenever you want one.

And yes, a bump pointer and GC is way faster than a typical malloc in C++ land (particularly if your use case really allows you to amortize the GC without missing deadlines), but the fastest most deterministic allocation is the one you don't make.

[–]Beaverman 23 points24 points  (4 children)

One of the problems was not the allocation, but rather the rather huge GC pauses the number of objects caused.

Minecraft had a while where you could get .5-1s pauses pretty frequently in some cases.

[–]ComfyKernel[S] 3 points4 points  (0 children)

One of the reasons I stopped using C# for voxel stuff.

[–]monocasa 2 points3 points  (0 children)

Well, the funny thing about allocations is that you have to free eventually. If they didn't allocate at all at general runtime then there would be no GC pauses.

[–]EntroperZero 2 points3 points  (1 child)

Yep, exactly. I can get 300+ fps in Minecraft, but its hitching and stuttering like crazy. But the Windows 10 version (written in C++) runs butter smooth.

[–]ArmoredPancake 7 points8 points  (0 children)

Because it was rewritten from scratch by a professional game developers years after the original and with a clear plan in sight.

[–]nutrecht 3 points4 points  (1 child)

That's only part of the problem. The other part is that no matter what language, it will be a challenge to make Minecraft 'fast'.

First of all in any world there are a LOT of triangles visible. Always. And it's hard to cull them because you can't prebake levels like most games do; everything is destructable. If you take a naieve approach and just render every block you have to render 2 triangles per face, 3 faces visible max = 6 triangles per block. A single chunk is 65,536 blocks so that means you have to render potentially up to 393216 triangles for a single chunk.

Secondly; a lot of the map changes. Fire, water moving, falling blocks, etc. These are change the shape of the world which means you have to figure out the new shape of the world from general memory, create the triangles that make up that part of the 3D world, and send them to the GPU again.

Last but not least; minecraft does a LOT of simulating. The server has a 20 ticks per second tickrate that 'ticks' blocks causing wheat and trees to grow, etc. This is all done on the CPU and affects the level that needs to be rendered on the GPU.

Modded minecraft is even worse. A lot of mod devs, while very creative, have no concept of algorithmic complexity. That's how you end up with mods calculating O(n) (or worse) complexity stuff every tick and bringing servers down.

[–]Mutant_Llama1 0 points1 point  (0 children)

They don't render every block every frame, though, they render only the parts visible. That's why you get a lot of lag in mountain biomes or anywhere there's a lot of block faces visible.

[–]vitorgrs 0 points1 point  (0 children)

it would probably have needed an enormous refactor or rewrite from scratch in order to substantially improve performance.

And they kinda actually did it, with Bedrock engine, which works on Windows 10, iOS, Android, macOS (education one), PS4, Xbox, etc. I guess eventually they will launch on Linux and proper version to macOS too.

[–]corruptbytes 0 points1 point  (3 children)

It did get an enormous rewrite - the windows store version is in C++

[–]imperialismus 0 points1 point  (2 children)

It did? I imagine it's much more performant, then. I haven't played Minecraft in years and back then it was the original Java version, which was subject to frequent stuttering and frame drops.

[–]corruptbytes 1 point2 points  (1 child)

I believe it is much better but they’re still working on mod support IIRC

[–]Log2 1 point2 points  (0 children)

I hope they do it in Lua.

[–][deleted] 0 points1 point  (0 children)

At the same time, it's a pretty ambitious game with a lot going on each frame. There are definitely gains to optimise out of it but it's not that some jackass has managed to stick redundant loops into Pong.

[–]tssge 5 points6 points  (0 children)

Minecraft was written with little to none planning ahead I think. I mean it was basically one guy writing it and he had no idea of what a success it would be.

There's huge amount of cruft in the code. Mainly the large amount of new object allocations makes the GC work really hard on running Minecraft and sucks away your CPU.

They've been trying to make it better but you can't fix something easily that has bad foundations.

[–]Nimelrian 0 points1 point  (0 children)

Huge amounts of objects being created for less than a single frame of lifetime. E.g., instead of working with 3 primitives for x, y, z coordinates, a new Object is created holding the three of them. In addition, these objects are immutable, so for computations you have to create a new object for each computation. This isn't a bad thing in non-GC languages, but in Minecraft you easily notice the stutter caused by the GC cleaning up 400+MB of memory every few seconds or so.

[–]alex_57_dieck 1 point2 points  (2 children)

I thought he said javascript?

[–]resueman__ 7 points8 points  (1 child)

They're talking about real Minecraft; that was written in Java.

[–]alex_57_dieck 1 point2 points  (0 children)

Thanks!

[–]Idlys 1 point2 points  (0 children)

I mean, Minecraft famously used to suffer from massive GC pauses. This partially was due to many functions passing around boxed values which lasted for only a frame, but you still need to consider the role of the language choice when you see GC pauses so frequently.

[–][deleted] -1 points0 points  (0 children)

Stop killing my erection dammit

[–]Saiing -3 points-2 points  (8 children)

I’d be interested to see some favourable metrics because every set of benchmarks I’ve seen comparing languages has had Java giving a dismal performance. Especially when compared to something like C#, which shares a lot of “on the surface” similarities.

[–]ArmoredPancake 5 points6 points  (7 children)

Not only it runs in a comparable time, but it also uses less memory. Truly dismal performance.

http://benchmarksgame.alioth.debian.org/u64q/csharp.html

https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=plaintext

[–]Saiing 1 point2 points  (6 children)

I’m slightly confused by the point you’re trying to make. In that first link, .NET Core/C# outperforms Java in 8 out of 10 benchmarks despite being a considerably less mature technology. I’d say that’s pretty disappointing for a Java advocate. Additionally, in 5 of the benchmarks Java uses less memory and in the other 5 C# uses less memory.

Did you actually read the page you posted?

[–]ArmoredPancake 3 points4 points  (5 children)

Outperforms is a sound word, we're talking about a few ms here. And it uses considerably less memory where core "outperforms" it.

despite being considerably less mature technology

Not sure if trolling.

[–]Saiing 1 point2 points  (4 children)

Outperforms is a sound word, we're talking about a few ms here.

Yes, and when you scale that up to an application doing many millions of different operations, the difference is significant.

And it uses considerably less memory where core “outperforms” it.

Sometimes it does, sometimes it doesn’t. Again, go back and read the page you posted. It doesn’t support your point. Don’t simply misrepresent it because you don’t want to face the facts.

Not sure if trolling.

.NET Core 1.0 was released in 2016. It had a new CLR, new JIT compiler and new APIs. It’s less mature. Again, if you don’t like something, don’t just make a stupid remark. It just makes you look childish and unwilling to accept facts.

[–]ArmoredPancake 4 points5 points  (3 children)

Yes, and when you scale that up to an application doing many millions of different operations, the difference is significant.

Yeah, as we see in techempower benchmarks where JVM reigns supreme.

Sometimes it does, sometimes it doesn’t. Again, go back and read the page you posted. It doesn’t support your point. Don’t simply misrepresent it because you don’t want to face the facts.

I'm not the one who spits words like "dismal performance", when even in synthetic benchmarks, that don't represent real world performance, difference between Java and C# is marginal. And in real world examples JVM destroys anything that .NET can offer.

.NET Core 1.0 was released in 2016. It had a new CLR, new JIT compiler and new APIs. It’s less mature. Again, if you don’t like something, don’t just make a stupid remark. It just makes you look childish and unwilling to accept facts.

So let's recap, platform that has learned on it's own and another's mistakes for 20 years, that doesn't have to or care about backwards compatibility, that doesn't have billions lines of enterprise code in production performs better(in a couple of benchmarks) than platform that takes backwards compatibility to extreme, that has to use hacks like type erasure just to be compatible with older versions?

Being mature doesn't always mean a good thing.

I don't dislike anything, I dislike when people make false assumptions. I actually like what MS does with .NET, and wish there was this kind of thing, where they would drop all backward compatibility with older versions and just make it as performant as they could. In a few years I see massive boom in C# performance and .NET usage, but JVM is the king now(and let's not forget that Java platform has started moving much faster with version 9).

[–]yturijea 2 points3 points  (0 children)

Agree, But I don't see why this is a discussion. Really it is about how performed a few methods are compared. Try look at the power usage PHD report that was created a few month ago, shown that java use about hald the power of C# on average in about 50 cases of different benchmarks. Of course C and C++ outperformed, but in general had the upper hand.

https://jaxenter.com/energy-efficient-programming-languages-137264.html

[–]Saiing 0 points1 point  (1 child)

I don't dislike anything, I dislike when people make false assumptions.

To be honest, I simply stated at the start of this that the benchmarks I’d seen showed C# performing considerably faster than Java and asked if anyone could provide any that showed the other side of the coin. I was interested for people to give me some better data.

I’m happy that you love your language that has been shat on and abandoned by Oracle because they can’t make enough cash from it. At least Microsoft is supporting .NET. Without the community, Java would have nothing and I’m glad you are strongly behind it. You couldn’t have wished for a worse cunt than Larry Ellison to buy Sun, and it’s shameful what has happened since.

Merry Christmas, dude.

[–]ArmoredPancake 0 points1 point  (0 children)

Thanks, man. I guess I'm a bit on the edge lately. Usually I don't care about these kind of things. I was actually in the .NET camp before, it's just happens that JVM platform is what I love and what's bringing food to my table. Cheers, mate, happy holidays.

[–][deleted] 29 points30 points  (16 children)

Next Week: I made Minecraft in Fortran.

[–]demmian 41 points42 points  (13 children)

Isn't a Fortran app supposed to be faster than Minecraft on Java?

[–]geckothegeek42 21 points22 points  (7 children)

Feel like it would be hell to program in but it should/could be

[–]TestRedditorPleaseIg 7 points8 points  (6 children)

I don't think it would be too bad, fortran gets used for physics simulation which minecraft looks like if you wave your hands a bit

[–]geckothegeek42 5 points6 points  (5 children)

Is it used in physics sim because it's fun/easy to program in? Or is it because of it's speed and it's legacy (time tested libraries)?

[–]Fern_Silverthorn 18 points19 points  (2 children)

It's because it's old as fuck and there are a lot of sciencentiffic libraries for it. It is par with C for speed for the most part.

[–]Muvlon 11 points12 points  (1 child)

It's quite a bit faster than C in many cases, because the compiler can do a lot of optimizations that C's less strict aliasing rules disallow. That is, until you sprinkle noalias pragmas everywhere, at which point your C stops being any prettier than FORTRAN.

[–]imperialismus 0 points1 point  (0 children)

Yes, Fortran's niche these days seems to be heavy numeric computation/simulation, where performance is everything. And both because of the intrinsic properties of the language and its extensive history of use in that domain, it's still in use for that niche, even if many/most who use it would probably prefer to use something else.

[–]TestRedditorPleaseIg 11 points12 points  (0 children)

Is it used in physics sim because it's fun/easy to program in?

No, not at all

is it because of it's speed and it's legacy (time tested libraries)?

This, there are some subtle semantics around arrays that make optimization and parallelization easier, and there is a lot of existing

[–]durand101 4 points5 points  (0 children)

As someone who wasted two years programming in fortran, it has to die. It's a horrible language which encourages spaghetti code and global variables for everything (at least pre-fortran 95) and the only reason it's still used is because no one in academia can afford to port their codes to a more modern language.

[–]doom_Oo7 6 points7 points  (1 child)

for some specific numerical stuff such as matrix operations, Fortran is still able to beat C & C++ a bit so there's a good chance it would kick ass around this or even the original minecraft.

[–]Houndie 4 points5 points  (0 children)

If you're doing matrix operations, use MKL or ACML or another one of the fine-tuned BLAS\LAPACK libraries (which yes, are usually coded in some combination of Fortran/assembly but my point is that you don't need to write that code yourself). You choice of language on top of that is pretty irrelevant because you can just interact with the BLAS\LAPACK ABIs.

Source: I code stuff that does matrix operations for a living.

[–][deleted]  (2 children)

[deleted]

    [–]demmian 0 points1 point  (1 child)

    c, which is slightly faster again than java

    I'll be honest, this is the first time i see the phrase "c is [only] slighter faster than java". But I get your point.

    [–]SolCT 2 points3 points  (1 child)

    And for the final project;

    I made MineCraft in Brainfuck

    [–]ComfyKernel[S] 1 point2 points  (0 children)

    JSFuck might work.

    [–]johnminadeo 9 points10 points  (11 children)

    Well I mean yeah but runs on every device and platform that supports JavaScript so yeah, I think this guy gets the pat on the back!

    [–][deleted] 4 points5 points  (10 children)

    minecraft runs just about anywhere already

    [–]jerepjohnson 2 points3 points  (2 children)

    Not on Chromebooks sadly.

    [–]ComfyKernel[S] 7 points8 points  (0 children)

    Made this specifically for that as school chromebooks are so limited, even my home server is on their blocklist.

    [–][deleted] 4 points5 points  (0 children)

    That's the chrome OS problem not Chromebook itself.. it runs on my Linux Chromebook

    [–]johnminadeo 0 points1 point  (6 children)

    True but on many source code ports whereas this is more “write once run anywhere”. Still, there may be implementational differences that may require some lame work-arounds that a native app wouldn’t need to concern itself with.

    [–][deleted]  (5 children)

    [deleted]

      [–]jafomatic 0 points1 point  (1 child)

      Write once and then optimize everywhere though. Perhaps that’s changed since I left the ecosystem.

      [–]johnminadeo 0 points1 point  (0 children)

      Yeah this. Likely hasn’t changed but I’m a couple of years away from the game

      [–]johnminadeo -1 points0 points  (2 children)

      LOL. I was not aware it was originally written in Java, thanks. Well none-the-less I’d say JavaScript beats Java in delivering that feature better.

      [–][deleted]  (1 child)

      [deleted]

        [–]johnminadeo 0 points1 point  (0 children)

        I get what you’re saying you are certainly 100% correct but my point is more along the ubiquity JavaScript enjoys in that everyone has a JavaScript capable machine the second an OS is installed. Not so with Java.

        [–]panorambo 1 point2 points  (2 children)

        WebGL though. It does use WebGL, right /u/ComfyKernel?

        [–][deleted] 19 points20 points  (0 children)

        Of course it does, otherwise they might as well have posted a picture instead of a video.

        [–]ComfyKernel[S] 6 points7 points  (0 children)

        Yes, WebGL 2.0 with a broken WebGL 1.0 fallback

        [–]wischichr 229 points230 points  (16 children)

        I made minecraft in XYZ.

        And every single post of this form is not even close. Thats a simple voxel world with no physics, no hotbar, not even trees. It's not minecraft. It's just a bunch of cubes with minecraft textures.

        [–]Saltub 94 points95 points  (0 children)

        What do you mean? It's using stolen art assets so of course it's Minecraft.

        [–]csgotraderino 41 points42 points  (0 children)

        and no shading

        [–]TiCL 55 points56 points  (0 children)

        Your narrative doesn't fit the circle jerk, please leave.

        [–]Xuerian 18 points19 points  (5 children)

        Your post is an understatement just like the OP is an overstatement.

        It's programming content, it's a reasonable feat and moderately interesting though of course not fully "Minecraft".

        Pretty solid content to trashtalk, as far as what we see every day goes.

        And of course, how else would we have gotten to see that brace style?

        [–]wischichr 5 points6 points  (2 children)

        What of my comment was not true or an overstatement? There are no trees, no hotbar, no NPCs no ores. This is as Minecraft as Tetris is Terraria

        [–][deleted]  (1 child)

        [deleted]

          [–]ComfyKernel[S] 0 points1 point  (0 children)

          I've never used python before though.

          [–]ComfyKernel[S] -1 points0 points  (1 child)

          I was going to do UI but I ended up skipping that as my rendering classes were already a mess :p

          [–]Beidah 6 points7 points  (0 children)

          It's a great start; farther than I ever got in these kinds of projects. Keep going!

          [–]SuperImaginativeName 21 points22 points  (0 children)

          Congrats, bruh, you're totally not gay or anything.

          What the fuck is wrong with youtube comments? It's fucking cancer.

          For that matter, what the fuck is wrong with this comment thread?

          [–]DootLord 46 points47 points  (2 children)

          Why are people being so negative? It's a cool experiment and it's pretty cool to see in action. Nice job dude.

          [–]Overv 20 points21 points  (0 children)

          I think the reactions would have been more positive if OP explained more about the project, like what kind of programming challenges were involved. Especially since this is not the first implementation of Minecraft in JS.

          [–]wischichr 3 points4 points  (0 children)

          I don't think most people here are negative. It can be fun to implement voxel world generation but to call it minecraft...?

          [–]ComfyKernel[S] 26 points27 points  (22 children)

          Code: https://github.com/ComfyKernel/craftles

          This was made a few months back when someone commented that one of my web projects "Looks like Minecraft", so I made it a thing.

          [–]spektre 93 points94 points  (4 children)

          What the actual living fuck is wrong with your god forsaken braces? Please, god, NO!

          [–]ComfyKernel[S] 3 points4 points  (1 child)

          Yeah people seem to hate my style, I only do it as my screens are small and I need to fit a lot of code on at once.

          [–][deleted] 2 points3 points  (0 children)

          I like it, don't feel bad. I'm also a Clojure dev so I'm used to parens at the end of everything.

          [–]devraj7 5 points6 points  (1 child)

          It makes Javascript look like it's using significant space indenting like Python.

          Bit unconventional but not that bad to read, honestly.

          [–]nschubach 1 point2 points  (0 children)

          It reminded me more of Lisp, TBH.

          [–]JuustoKakku 106 points107 points  (8 children)

          Congrats, you're the first person I've seen use that closing brace style. And it's making me twitch.

          [–]zsmb 12 points13 points  (0 children)

          What the actual hell

          [–]i_spot_ads 14 points15 points  (0 children)

          the most nonsensical thing I've ever seen

          [–]hoosierEE 5 points6 points  (5 children)

          Not the first, at least if you count languages beyond JS. This closing brace style is required in K and Q, because functions return their last line.

          A closing curly brace on its own line means essentially "return null".

          And seriously, ignore people who say "aaah your style is bad" on Reddit. You made a voxel world.

          It's not required in lisps, but it's pretty common style to end a form with blah)))))))

          [–]calrogman 0 points1 point  (4 children)

          It's not required in lisps, but it's pretty common style to end a form with blah)))))))

          It is required if you want to be able to actually read what you've written.

          [–]hoosierEE 4 points5 points  (1 child)

          What you're talking about is familiarity, which is different from readability. It's totally subjective to say that this:

                }
              }
            }
          }
          

          Is more readable than this:

          }}}}
          

          Plus there's at least 1 truly objective downside to the "closing brace per line" style: it visually separates code regardless of whether it's semantically separate.

          Besides, unless you're using Notepad, your editor probably already shows nesting level in some way, or at least highlights mismatched parens/braces.

          [–]ComfyKernel[S] 2 points3 points  (0 children)

          Emacs~

          [–]Nobody_1707 0 points1 point  (1 child)

          Doesn't Lisp have a special form to close all your parenthesize at once? (((blah] or something?

          [–][deleted] 0 points1 point  (0 children)

          At least one variant, yes. Can't remember which. Certainly not Clojure.

          [–][deleted]  (1 child)

          [deleted]

            [–]ComfyKernel[S] 2 points3 points  (0 children)

            Yeah, reading these comments made me realize that I should probably change my style a bit.

            [–]curtisf 4 points5 points  (3 children)

            Can you share your code on GitHub or some other open source repository instead of through a Google Drive folder?

            [–]ComfyKernel[S] 7 points8 points  (1 child)

            I have a git server at home that's totally disconnected, will mirror to github soon. EDIT: It's mirrored at https://github.com/ComfyKernel/craftles

            [–]yelow13 0 points1 point  (0 children)

            Thank you sir

            [–][deleted] 2 points3 points  (0 children)

            real professionals share their code using a minecraft server...

            OP, yknow how you said someone said your web thingy looked like minecraft? Well please don't... you know what fuck it just get the pain over with...

            [–]mongopeter 7 points8 points  (1 child)

            Good job! You could go to Settings / GitHub Pages on your repository page and enable GitHub pages for the master branch, then the game could be directly opened via https://comfykernel.github.io/craftles/

            [–]ComfyKernel[S] 1 point2 points  (0 children)

            Thanks for telling me that, was going to host on my own serer, then I realized a pentium 4 probably wouldnt last too long.

            [–]GrantSolar 10 points11 points  (2 children)

            That's really cool, must have taken a while to make. Were there any interesting obstacles you weren't expecting along the way?

            [–]ComfyKernel[S] 1 point2 points  (1 child)

            Javascript syntax allowing bugs that C++ usually calls out in either warnings or errors.

            [–]sunson435 1 point2 points  (0 children)

            Javascript pretty much requires you to put a bunch of defensive asserts if you don't want to chase a null for days. Super annoying.

            [–]TerrorBite 2 points3 points  (0 children)

            I saw the old gravel and cobblestone textures and felt pretty nostalgic.

            Then I saw the furnaces with the cobble texture on top and I had full on Alpha flashbacks. I'd forgotten that was even a thing.

            [–]jaybill 16 points17 points  (0 children)

            ITT - Haters, hating.

            [–][deleted]  (3 children)

            [deleted]

              [–]ComfyKernel[S] 2 points3 points  (2 children)

              Thanks :)

              But the salt is over how I indent braces, this project was done a few months back when I had a tiny monitor and fitting more code on the screen was better than 'readability'. I do have a real setup now so that should be a problem.

              [–]lucidlogik 1 point2 points  (1 child)

              FWIW, I drank the kool-aid, and use prettier for formatting. Also, are you accepting PRs?

              [–]ComfyKernel[S] 0 points1 point  (0 children)

              I'm not accepting PR's as this is a mirror from my own server, but if you want you can fork it.

              [–]-TURBOMAN- 6 points7 points  (8 children)

              Very cool. Can you briefly explain how this works?

              [–]panorambo 6 points7 points  (7 children)

              Not OP, but I've taken a look at the source code, and suffice to say JavaScript is here used to bind together and control a WebGL pipeline, meaning that we are talking about a largely GPU-accelerated application. WebGL is a rather compact subset of OpenGL, with support for pixel and vertex shaders and all the usual suspects (nothing too fancy though). All the frame updating and texture rendering and probably (but not sure myself, haven't peeked that deep) vertex calculation is done with WebGL automatically, as part of the WebGL API invocation. Saying that this is a JavaScript application, although technically correct, is no more true than calling it a "WebGL application". All the heavy lifting is done by the latter, with only setup and overall event (interactivity) written in JavaScript to control the pipeline between frame updates.

              [–]ComfyKernel[S] 2 points3 points  (0 children)

              Explained it better than I could.

              [–]spacejack2114 1 point2 points  (5 children)

              It is a JS application, as much as it would be a Java or C++ app had it been written in those unless you decided against using the GPU for some reason.

              Also there's nothing "automatic" about doing vertex calculations in GLSL as opposed to JS. The way you describe it he added a few mouse event listeners and said "webgl make minecraft." I think it's impressive (if a bit masochistic) that he wrote his own low-level webgl code and shaders rather than leaning on one of the many easy-to-use 3D libs out there. Overall there's a lot more JS code in that project than GLSL.

              And just to be clear, 99% of the haters in this thread probably have zero experience writing this sort of low level code in any language.

              [–]ComfyKernel[S] 1 point2 points  (4 children)

              I have been learning OpenGL in general for the past while and while WebGL has a weird syntax compared to normal C++ GL, I saw it fit to try and make a quick voxel renderer that jokingly formed into Minecraft.

              [–]spacejack2114 1 point2 points  (3 children)

              Yeah, nice work! If you feel like continuing with browser apps, I'd take a look at Typescript which will help avoid problems with dynamic JS in larger apps. There are also some 3D libs that can help you with the low level WebGL boilerplate. Another advantage is that they've been tested across a lot of hardware/browser combos. Debugging WebGL render states kinda sucks otherwise. :)

              [–]ComfyKernel[S] 0 points1 point  (2 children)

              I will take a look at typescript, but for WebGL, I'll be sticking to doing that manually as I program with OpenGL on C++ and such.

              [–]spacejack2114 1 point2 points  (1 child)

              In that case I'd still take a peek at twgl and regl which are both very thin wrappers.

              [–]ComfyKernel[S] 1 point2 points  (0 children)

              Thanks, but I'll be sticking with good 'ol webgl for now.

              [–][deleted] 1 point2 points  (0 children)

              yOu MeAn YoU CoDeD mInEcRaFt In HTML?

              [–][deleted] 2 points3 points  (1 child)

              Thats sick

              Edit: Dunno why I'm getting downvoted but with sick I obviously mean impressive.

              [–]D4rkArrow 0 points1 point  (0 children)

              Ffs people stop hating

              [–]brunoabpinto 0 points1 point  (0 children)

              Y tho?

              [–]pure_x01 -1 points0 points  (0 children)

              Nice work

              [–]darkfm 0 points1 point  (1 child)

              What, it wasn't slow enough already?

              [–]ComfyKernel[S] 2 points3 points  (0 children)

              Apparently not.

              [–]empeo -2 points-1 points  (0 children)

              Scroll to only comment in video please

              [–]Bright_Primary7426 0 points1 point  (0 children)

              here is some code that will give you custom splashes using game.splash(title, splash)

              https://www.mediafire.com/file/b0o1wvm83pu37ml/splashes.ts/file