Minecraft Java is switching from OpenGL to Vulkan
gamingonlinux.com
gamingonlinux.com
The main thread is often the limiting factor in minecraft. Minecraft just can't go as fast as the GPU could render the scene and even with quite a lot of shaders things are CPU bottlenecked. Hopefully this changes with time as modding minecraft could certainly do with a bit more CPU time free.
Minecraft's non-world entities like players and enemies aren't voxels at any level though, those are directly authored as low poly meshes.
Though I thought a company large as Microsoft would have the resources to build a cross-platform RHI with the most stable API available for each platform (DX12 for Windows and Metal for macOS)...
The relevant measurement is the resources Mojang has as a studio. And I expect the decision here is that they don’t want to commit to the long term maintenance of three renderer implementations on the Java side.
Another concern is that modding is a major part of why Java Edition is so popular, and that includes shaders specifically. This is already going to cause chaos in the modding world as it is, no need to compound that by making shader mods that much more burdensome to maintain.
At least split screen still works for free.
I run a 6 person server on an Intel NUC, without major issue.
I bought during the beta for a lifetime of goodies, had to buy it again after the buyout, then again after an update to MS accounts wasn’t acted on, and then for the Switch. I’ve bought Minecraft 4 times, with another on the horizon if it keeps popular.
Until it's possible to convert your world to Bedrock and not have anything in your 'finished' world break, except maybe some giant Redstone machine or one or two known annoyanced, I doubt they'd do it. Mojang presumably still has some autonomy within Microsoft so long as the money keeps coming in, and Mojang presumably knows that pushing this too early is a bad idea. But Microsoft being Microslop, who knows, maybe they'll just do it anyway.
So no. It is not one time purchase.
Then again, you'll never see a group of pre-schoolers wearing GTA5 hoodies and hats and backpacks, and you can't watch the GTA film in cinemas.
The other issue with bedrock is it is far from feature parity with java. If these two things were hit then java could be reasonably retired. However we are decades too late in it being acceptable to introduce a breaking change to mod loading. So it's java forever.
Games with robust modding will almost always feature a garbage collected language which is what's primarily used for the modding.
Consider this, if the mod interface was C/C++, do you think those poorly optimized mods could be trusted to also not leak memory?
Garbage collection does not solve memory leak problems. For example
- keeping a reference too long,
- much more subtle: having a reference to some object inside some closure
will also cause memory leaks in a garbage-collected language.
The proper solution is to consider what you name "poorly optimized mods" to be highly experimental (only those who are of very high quality can be treated differently).
It solves a class of memory leak problems which are much harder to address without the GC. Memory lifetimes.
It's true that you can still create an object that legitimately lives for the duration of the application, nothing solves that.
But what you can't do is allocate something on the heap and forget to free it. Or double free it. Or free it before the actual lifetime has finished.
Those are much trickier problems to solve which experienced C/C++ programmers trip over all the time. It's hard enough to have been the genesis of languages like Java and Rust.
Of course. Because they would fail loudly and would have to be fixed in order to run. Garbage collection is a crutch which lets broken things appear not broken.
A lot of the memory problems that you can see without a GC are hard to find and diagnose. Use after free, for example, is very often safe. It only crashes or causes problems sometimes. Same for double free. And they are hard to diagnose because the problems they do create are often observed at a distance. Use after free will silently corrupt some bit of memory somewhere else, what trips up on it might be completely unrelated.
It's the opposite of failing loudly.
The nastiest leak I've ever seen in a C++ production system happened inside the allocator. We had a really hostile allocation pattern that forced the book-keeping structures inside the allocator to grow over time.
It's since gotten a lot better with JVM updates, so much so that it's not a problem in Java 21 and 25.
I suppose, if someone in future might want to create their own godot-alternative. Why not just use bgfx with the language bindings instead.
I Love Godot from my time tinkering with it but one of the reasons why Godot is so hopeful in future compared to other engines is imo the fact that they support many many platforms.
I have seen some blogposts on HN where someone used godot to prototype an android GUI application (and not a game) and how the whole process actually makes sense when you think about where they talked about it in the blog post.
Actually there were discussions about even integrating bgfx into raylib (the goat) but looks like that its not getting integrated but it was interesting to read the discussion and maybe anyone more experienced than me could even contribute to the discussion below
For me the biggest obstacle would be the weird build system the project insists on using.
Funny to contrast with Bedrock edition, for which they paid for FMOD Studio to cover the audio features of those two (and more).
But you can easily make Vulkan run on macOS. Not sure what would be the reason to use DX12 in the new project today given free choice of technology, especially when team comes from OpenGL.
I'm making a joke, but it's also true.
Of course since Proton uses Vulkan to implement DX12, it means that our Vulkan implementation is simply worse than the one that Valve created to emulate DX12.
I'm sure it's possible to improve that, but it implies that there way to get the best performance out of Vulkan is less obvious than the way to get it out of DX12.
I always appreciated that MC would run on virtually any hardware, especially as a kid without access to anything nice.
I think this means you'll be able to continue using Minecraft with OpenGL.
> Once we’re happy with the performance and stability of Vulkan across devices we will remove the OpenGL implementation.
So not for long.
and of course all the previous minecraft versions will continue working on opengl :p
I installed Chrouton which let you switch between chromeOS and a full ubuntu chroot, which was the best of both worlds as you could do the optimized browsing on ChromeOS and development tasks on the chroot.
After it fell out of ChromeOS favor, I just installed arch on it and called it a day. It's my go-to conference laptop because it's still so conveniently small, light, and 12 years on the battery still gets 6 hours.
Apple apparently got very pissed on how Khronos took care of OpenCL.
Then Sony and Nintendo couldn't care less about Khronos, people keep forgetting about game consoles when discussing the portability of Khronos APIs, or ignoring the fact that in reality they aren't really that portable due to the extension spaghetti.
I wouldn't be so sure about Nintendo. From time to time you see them pop up as contributors for some extensions.
https://github.com/search?q=repo%3AKhronosGroup%2FVulkan-Doc...
This thread is quite weird to me. People are massively overstating how important modding is and understating the strength of vanilla Java. Minecraft is not Skyrim
Speedrunning, anarchy servers, parkour, technical farming, server economy destruction videos and other primarily vanilla Java content forms are as popular as ever or more. Alongside the newer content creators, Hermitcraft is still growing somehow, as is Etho. Besides anarchy a little bit, none of this is reliant on modding
There are significant updates every year and many people, including me, install them every time they come out and play them in vanilla.
Ranked is intended to be a fun competitive thing; waiting 10 minutes for a dragon perch doing nothing is Not Fun; waiting forever at a spawner is Not Fun; simple as that, people wouldn't play it if it wasn't fun. (oh, also, I believe Ranked also just generally includes making mob drops consistent for the same seed (and consistent portal locations, and probably other things), without which the whole entire concept of competitively playing the same seed would not work whatsoever, devolving to just who got the better RNG, distinctly Not Fun; also the ability to review a replay of your game afterwards for learning). Viewership and player counts would go down because you'd just be looking at very slow gambling instead of something actually meaningfully-skill-based.
A second account might work for freecam (though it adds more editing work, aka makes you not want to actually use it much), but making pretty timelapses is not feasible that way. Granted, you could still live without it, but the quality of content would undoubtedly go down. The little things go a long, long, long way.
(for what it's worth, last I played minecraft, like 1-2 years ago, I did so lightly-modded - Do A Barrel Roll for much more fun elytra; lithium; Distant Horizons; Hydrophobic Elytra to fix a stupid extremely-annoying elytra bug (might be fixed now?), BetterF3 (kinda superceded by the more recent F3 overhaul now I suppose?))
Etho's dedication to keeping a purely vanilla singleplayer world is a unique feat. If you want to use Hermitcraft as an example of the median SMP, their modlist is actually quite large: https://github.com/henkelmax/hermitcraft-server
Minecraft simply has a lot of areas for improvement that haven't been touched by Mojang for one reason or another, and a big reason why people stick with Java is because the community has built an ecosystem to tweak the game to their liking.
You don't. Ever since 1.17 you have been able to build GL shaders directly into resource packs. Resource packs don't require any complex loaders and don't pose a malware risk. To install them you can either drag-and-drop them as .zips directly into the resource pack menu, or a server/world can be configured to prompt the installation of a resource pack. These resource pack shaders are not quite as flexible as Aperture, Iris, or Optifine shaders, but they are fairly close in functionality.
I'm curious if they will carry over this functionality for Vulkan shaders embedded into resource packs. I suspect they may not, which is understandable given how it can be used to break the game's functionality much worse than an ordinary resource pack can (not full RCE, though)
This sounds very cool, I never knew this. Could you give me an example of such pack?
This one is particularly interesting because it integrates block data in the rendered world along with some server-side augmented data to render a minimap in a vanilla client: https://github.com/JNNGL/VanillaMinimaps
This makes sense. I guess I’m a bit surprised they were still OpenGL anywhere.
I never really got into Minecraft though, so I can’t pretend I know much about its current state. I didn’t even realize there was a non-Java version for desktops.
Probably the most underappreciated great feature in recent Java releases.
IIRC Minecraft is still using entirely JNI and no FFM yet. That will probably start to change in the near future, though. Some modders have already been replacing their own natives with FFM versions.
Slightly off-topic too, but I would love for Minecraft Java Edition to have a safer and more robust modding API. For the past decade modding efforts have mostly just been patching on top of a reverse engineering mod framework which exposes some of the game to mods. Factorio is practically the Platonic Ideal in this regard with its Lua sandboxing and restricted API. This is a huge security and stability issue, but Microsoft have no real incentive to fix it.
https://learn.microsoft.com/en-us/minecraft/creator/scriptap...
For Vulkan you already ship "pre-compiled" shaders in SPIR-V form. The SPIR-V needs to be compiled to GPU ISA before it can run.
You can't, in general, pre-compile the SPIR-V to GPU ISA because you don't know the target device you're running on until the app launches. You would have to precompile ISA for every GPU you ever plan to run on, for every platform, for every driver version they've ever released that you will run on. Also you need to know when new hardware and drivers come out and have pre-compiled ISA ready for them.
Steam tries to do this. They store pre-compiled ISA tagged with the GPU+Driver+Platform, then ship it to you. Kinda works if they have the shaders for a game compiled for your GPU/Driver/Platform. In reality your cache hit rate will be spotty and plenty of people are going to stutter.
OpenGL/DirectX11 still has this problem too, but it's all hidden in the driver. Drivers would do a lot of heroics to hide compilation stutter. They'd still often fail though and developers had no way to really manage it out outside of some truly disgusting hacks.
But in reality the exhaustive pre-compile will compile way more than will be used by any given game session (on average) and waste lots of time. Also you would have to recompile every time the user upgraded their driver version or changed hardware. And you're likely to churn a lot of customers if you smack them with a 30+ minute loading screen.
Precisely which shaders get used by the game can only be correctly discovered at runtime in many games, it depends on the precise state of the game/renderer and the quality settings and often hardware vendor if there are vendor-specific code paths.
Some games will get QA to play a bunch of the game, or maybe setup automated scripts to fly through all the levels and log which shaders get used. Then that log gets replayed in a startup pre-compile loading screen so you're at least pre-compiling shaders you know will be used.
Steam could improve the experience here by having the shaders compile overnight in the background so it presents zero delay but the current way doesn't bother me much at all.
Really depends on the game.
There's no easy way around this problem. It never came up as much in the OpenGL/D3D11 era because we didn't make as many shaders back then. Shader graphs and letting artists author shaders really opened pandoras box on this problem, but OpenGL was already on its way out by the time these techniques were proliferating so Vulkan gets lumped in as the cause.
Vulkan gives all the tools to avoid any "lag spikes" from shader compiling. In fact, causing them is much more difficult than OpenGL where they could happen in surprising places (and only on certain hardware).
The issue is two fold: 1. Some engines produce a lot of shader permutations. Some AAA titles can have 60000 different shaders compiled. 2. Some GPU rasterizer states (such as color blending) are implemented as shader epilogues.
In Vulkan 1.0 almost all of the pipeline state had to be pre-baked into a pipeline state object compiled ahead of time. This lead to a "shader permutation explosion" where different states need different pipelines.
This requires the game engine to either a) compile all the pipeline combinations ahead of time (slow loading time) or b) compile them as needed (lag spikes).
The core issue for this was solved years ago and now most of the pipeline states can be added to the command buffers ("dynamic states"). This solves the permutation explosion. But at the same time it opens the door for issue 2: some states (blending in particular) can cause a state-based recompile (like ye olde OpenGL days) at runtime.
The only solution to the second problem is not to use the dynamic states that trigger recompiling. That's basically only blending as far as I know. You can't even have dynamic blend state on all GPUs.
For maximum developer flexibility there's the shader object extension that allows mixing and matching shaders and pipeline states any way you want. This will cause state based recompiles at unpredictable times but it's an opt-in feature and easy to avoid if lag spikes are not wanted.
tl;dr: shader recompilation is easy to avoid in Vulkan but porting legacy engine code or art content may take you off the happy path.
Bedrock is more performant and more portable across platforms (e.g. on consoles where you couldn't mod anyways).
As for feature parity, there are mods backporting modern features back to 1.7.10.
Java is also portable to all the consoles, its just Microsoft did use that as an argument to try to kill the Java Edition. Nobody prevented Microsoft from adding bedrock like modding to Java Edition.
The only thing that needs to happen is the one single stable mod API for Minecraft Java Edition. The incompatibility between Forge, NeoForge, Fabric, etc. is terrible, but from what I know about some of the folks involved this won't happen as they cannot constructively discuss the matters.
Microsoft logically wants to keep sales from both.
Pocket Edition was a stripped down version of the game to support the xperia play, so it was built for optimization from the start. Later it got support for broader Android devices and iOS, while Mojang outsourced console development to 4J studios. Eventually, they decided to beef up Pocket Edition to be mostly feature complete with Java, renamed it Bedrock, and made it the de facto standard for all devices, sunsetting 4J's port.
Is there a source for this? I don't remember any language to suggest Java Edition would eventually be replaced when they announced Windows 10 Edition. They've always indicated that they intend to keep maintaining the Java Edition, with parity in the core game. The messaging here has never changed, as far as I'm aware.
If anything, they might have just done the rename simply for standardization over 9 different app stores with different requirements, branding requirements, and length limits before truncation occurs.
Much of the cashflow is from kids watching a YouTuber doing something in Java Minecraft and attempting it themselves in bedrock, which is why feature parity is the only thing they’re really working on anymore.
Bedrock is aimed at kids and they've never made any real effort to supplant Java with it. It's just a very effective way of hitting different target markets
They have no need to supplant Java, nor any desire to (and all their marketing materials and screenshots are usually Java anyway).
They better make use of Zink/Angle or similar approaches.
Where does it say that? Why not use MoltenVK?
There is the non-Java version (Bedrock), but that’s not nearly as extensible.
There’s a native version called bedrock
This would be termed "Java Minecraft", not "Minecraft Java"
Minecraft Pocket Edition for Xperia Play
-> Minecraft: Pocket Edition
-> [Minecraft: Windows 10 Edition, Minecraft: Gear VR Edition,
Minecraft: Apple TV Edition, Minecraft: Fire TV Edition,
Minecraft: Pocket Edition]
-> Minecraft
(It is colloquially "Minecraft: Bedrock Edition" when Mojang is
distinguishing it from other versions. Note also that despite all
being named "Minecraft", different platforms are separate
licenses, but the Windows 10/11 license is bundled with Java Edition)
RubyDung
-> Cave Game
-> Minecraft: Order of the Stone
-> Minecraft
-> Minecraft: Java Edition
Minecraft: Xbox 360 Edition
-> [Minecraft: Xbox One Edition, Minecraft: PlayStation 3 Edition,
Minecraft: PlayStation 4 Edition, Minecraft: PlayStation Vita Edition,
Minecraft: Wii U Edition, Minecraft: Nintendo Switch Edition]
(This was the 4J Studios version, now deprecated as some platforms
are unsupported and on some platforms it is superseded by Bedrock.
It is sometimes referred to as "Console Edition" but this was
never official.)Now both exist and get roughly the same feature set now, but the Java version remains popular given the vast variety of mods and servers.
> Minecraft: Java Edition runs on Windows, Mac, and Linux; Minecraft: Bedrock Edition runs on Windows.
(From their own website. Bedrock might work with wine etc.)
For a game as popular as Minecraft, where every year a fresh cohort of young players reaches an age suitable for playing it, it would be madness to discard Linux and Mac users and possibly push the modding community to some other game.
Considering the vast majority of mods are just adding some items or creatures, they don’t need to worry. This won’t be more than the regular API changes in between versions that they’re already used to, unless it’s a more graphics heavy thing like a shader mod.
Also, even with shaders, it’s fairly straight forward to port a shader from OpenGL to Vulkan (for the most part Vulkan just gives more flexibility in that regard). The stuff around it is the hard part.
There's a whole community that plays on private servers and uses extensions for stuff like access control, new game mechanics (which doesn't mean new shaders but new behaviors in game) etc.
The native windows version is not moddable as described above. And probably will never be because MS wants you to rent "servers" from them.
So most "serious" minecraft players ignore bedrock.
https://en.wikipedia.org/wiki/Microsoft_Java_Virtual_Machine
https://cdn.graph.office.net/prod/media/java/how-microsoft-a...
The dubious Mojang account migration. Their lack of support for kids who got their accounts phished recently. Migrating to Vulkan breaking old hardware.
Sad story, but it was to be expected MS bought Mojang.
- Vulkan requirement raises the baseline to 2016-2017 hardware. 2017 was 9 years ago.
- They're not cutting off OpenGL right away, according to the announcement they will release 26.1 as OpenGL-only, and then at least one more full release where you can choose between the two options. Based on their usual schedule it will probably be at least a year from now before they cut off OpenGL support, if not longer.
- All previous versions of the game are still available to play, including the oldest versions that run on Java 6, x86-32, OpenGL 1.2, Debian 5, Windows XP. Can still do multiplayer sessions on versions released in mid 2010.
- The community can fill in the gaps in multiple ways. Translation layers are available to connect to newer servers with older clients (ViaVersion), as well as with Bedrock clients (GeyserMC). Mods will almost certainly be released to reimplement the rendering engine in OpenGL or GLES. Renewed interest may mean OpenGL 2.0 compatibility mods could come back. Also, Mojang recently liberated Minecraft from variable name obfuscation, so modding will be easier than ever before.
- As a last resort, software rendering for Vulkan has gotten relatively mature, though obviously this means single digit FPS in many scenarios
Java Edition has taken an extremely conservative path, practically nothing else in the gaming industry held on to legacy hardware this long.
And reimplementing the rendering engine for a different graphics API isn't even unprecedented, because there's a mod (VulkanMod) that reimplements the rendering engine for Vulkan already!