Live data from Hacker News

Minecraft: Java Edition now uses SDL3

minecraft.net

191–200 of 285 posts

Re: Minecraft: Java Edition now uses SDL3

#191
post #159

SDL3 switch makes sense given how much SDL2 was showing its age around GPU API abstraction (Vulkan/Metal support especially). Curious if this fixes any of the longstanding input lag / alt-tab issues that Java Edition has had on Linux, since that's usually where the windowing/input layer causes the most pain.

They actually switched from GLFW. In that case you would naturally pick SDL3 and not SDL2.

Re: Minecraft: Java Edition now uses SDL3

#192
post #181

Earlier quoted context omitted.

Minecraft started on Java, a massive mod and server community created around it. Consoles won't run JIT/JVM/Java, so the Bedrock C++ version was created. People don't want to give up the massive mod community, so OG pc players stay on Java, while console players and newer PC players go to bedrock (with some of those PC players jumping over to Java after servers or mods are discovered). They almost have feature parity…

It's absolutely crazy that a game so popular - let alone any game - was originally written in Java. Why did notch do that? There were next to no libraries, ecosystem, or support for Java at the time. It was such a bizarre choice. Not to mention the JVM, GC, and all the other oddities. It was super off the beaten path to have done this. Might as well have been Ruby or Perl.

At the time, Java ran on the web so he could easily share demos.

He used LWJGL, which probably covered a lot of his library needs.

Java has a JIT, so it's not comparable to Ruby and Perl.

Re: Minecraft: Java Edition now uses SDL3

#193
post #181

Earlier quoted context omitted.

Minecraft started on Java, a massive mod and server community created around it. Consoles won't run JIT/JVM/Java, so the Bedrock C++ version was created. People don't want to give up the massive mod community, so OG pc players stay on Java, while console players and newer PC players go to bedrock (with some of those PC players jumping over to Java after servers or mods are discovered). They almost have feature parity…

It's absolutely crazy that a game so popular - let alone any game - was originally written in Java. Why did notch do that? There were next to no libraries, ecosystem, or support for Java at the time. It was such a bizarre choice. Not to mention the JVM, GC, and all the other oddities. It was super off the beaten path to have done this. Might as well have been Ruby or Perl.

There were plenty of low level libraries available then, less in the way of frameworks. It was an environment that he was used to coding in and cross-platform (in the PC world anyway).

Given what it was in the very beginning versus what it very rapidly grew into, I guess it was just something that made sense at the time.

Re: Minecraft: Java Edition now uses SDL3

#195
post #48

Earlier quoted context omitted.

Does macOS even have exclusive fullscreen anymore? I haven’t looked into it, but my impression is that it fakes it with borderless windowed even when the app explicitly asks for it.

Yes. On Apple Silicon Macs (w/ macOS Sonoma or later), native fullscreen automatically triggers Game Mode. This feature slashes input lag by prioritizing CPU/GPU resources and doubling the Bluetooth polling rate to 240 Hz for wireless accessories. Gaming works very well in this mode, even with PC titles played thru crossover. Conversely, using borderless windowed mode instead of native fullscreen on macOS adds render…

I didn't know that part about the bluetooth polling rate. That's clever.

Re: Minecraft: Java Edition now uses SDL3

#196

The lwjgl bindings for this were written by a member of the GTNH modpack team, thereby completing the chain of vanilla->modded->vanilla once more https://github.com/LWJGL/lwjgl3/pull/1033

How many people working on Minecraft now were modders ? And how many current persons working on Minecraft are also Modders ?

The impressive part is how big modding is in minecraft despite Mojang never providing a mod interface, I don't know it may be different now but the general route for a long time was decompile the java byte code make your mod and recompile. There were a number of heroic teams that made mod interfaces out of this but a whole lot of nothing from the actual devs. I came off the quake modding scene and was a bit horrified by the whole situation, with quake they gave you the game code, map compilers and later the source to the engine.

Re: Minecraft: Java Edition now uses SDL3

#197
post #78
post #38

Earlier quoted context omitted.

SDL2 and SDL3 both have hardware accelerated 2D renderers, appropriately called SDL_Renderer. You can tell SDL to upload pixel buffers to GPU textures and tell SDL to draw those textures on the screen with various transformations and color effects. SDL3 added a way to tell SDL to render vertex-based geometry as well: https://wiki.libsdl.org/SDL3/SDL_RenderGeometry . Those vertexes can have 3D positions, so that count…

SDL_RenderGeometry(Raw) are only capable of 2D rendering and the vertexes do not even have a z-coordinate. Genuine 3D support is available in SDL3 via the GPU types and functions: https://wiki.libsdl.org/SDL3/CategoryGPU

If you want to get pedantic the hardware rasterizer in your GPU doesn't rasterize "3D triangles" either. Any notion of '3D' comes from how you project your vertices when transforming them through your coordinate spaces. Though the perspective divide needed to make perspective projection work is baked in, but otherwise NDC is a 2D space. Z only exists for the depth buffer/depth test and perspective correct interpolation. The "shape" of the triangle on screen isn't affected by it.

As long as you can draw 2D triangles there's nothing stopping you from drawing a "3D" scene with a software transform pipeline. Depth sorting gets fun without a z-buffer though.

Re: Minecraft: Java Edition now uses SDL3

#198
I recently converted a game, Tribal Trouble (https://github.com/bondolo/tribaltrouble) from GLFW to SDL3. It was mostly a painless refactor though I did have some issues with full screen exclusive modes and desktop full screen but was eventually able to resolve those.

I ended writing a demo for screen mode handling to test and document the fiddly bits.

https://github.com/bondolo/SDL3-Fullscreen-Demo

The game is Java, like Minecraft, the demo is C because I wanted to keep it as simple as possible.

Re: Minecraft: Java Edition now uses SDL3

#199

I recently converted a game, Tribal Trouble ( https://github.com/bondolo/tribaltrouble ) from GLFW to SDL3. It was mostly a painless refactor though I did have some issues with full screen exclusive modes and desktop full screen but was eventually able to resolve those. I ended writing a demo for screen mode handling to test and document the fiddly bits. https://github.com/bondolo/SDL3-Fullscreen-Demo The game is Jav…

Out of curiosity, what was the reason you chose to do this rewrite? Was there some issue with GLFW?

Re: Minecraft: Java Edition now uses SDL3

#200

The lwjgl bindings for this were written by a member of the GTNH modpack team, thereby completing the chain of vanilla->modded->vanilla once more https://github.com/LWJGL/lwjgl3/pull/1033

GTNH has done more for Minecraft than Microsoft has, arguably. The level of care and work there is incredible- and that’s not just because I’ve contributed a bit here and there.

They've made it easy to fix things too. Just yesterday I ran into a bug in one of the mods they manage, I dreaded setting up deobfuscation and all the stuff necessary to get modding for an ancient forge version going, but nah - they've automated and standardized all that. It was just download, fix and build.
Post reply on HN