Author Topic: [GAME] Minecraft Java Edition (LWJGL being ported)  (Read 23077 times)

emue

  • Newbie
  • *
  • Posts: 3
  • Karma: +3/-0
    • View Profile
[GAME] Minecraft Java Edition (LWJGL being ported)
« on: May 14, 2020, 04:53:24 pm »
Minecraft is the rare example of a commercial game that can be made to run on OpenPOWER machines. Of course this is all completely unsupported. I can report success on version 1.15.2 of the Minecraft Java Edition. I'm targeting Linux ppc64le. As this is a commercial product, a Mojang account with a valid license is required.

The actual game, being written in Java, is relatively portable already. Luckily, the platform specific part, which is the LWJGL3 framework, is open source. No changes to the actual source code appear to required, but the build system, which is distributed among several repositories, needs some work.

Another issue is the game's launcher, which is a native binary only provided for x86 platforms. With its job being mainly to download game assets, manage accounts and start a Java instance, open source alternatives exist. I'll be using the MultiMC launcher, since this is relatively easy to use and can be built on Linux ppc64le.

Quick start
As a preview of the game in a working state, you can follow the following guide. This will download prebuilt binaries from a third party (me) as well as Mojang. It is a good idea to only run binaries from sources you trust.

The following will only work on Linux ppc64le. Both 4k and 64k kernel page sizes are supported. Java is also required. I used OpenJDK 11 on openSUSE 15.1 LEAP. Recent Tumbleweed should also work.


TODO/Caveats
Required changes to LWJGL are on my GitHub: https://github.com/EMue
Previous discussion is here: https://github.com/LWJGL/lwjgl3/issues/495

The following still needs to addressed:
  • Attempt to merge LWJGL changes to upstream in order to provide official binaries and to simplify the build.
  • Minecraft provides native binaries for text-to-speech on x86. I'm not certain where in the game this is used, but this feature will likely not work on other platforms.
  • I don't expect any official support for this from Mojang/Microsoft. If anyone would like to try to convince them to pick it up, please feel free.
  • The jemalloc library bundled with JWJGL is built with a fixed page size parameter and will only work on a compatible kernel. This requirement seems overkill for a game, and necessitates two separate LWJGL builds. Quite likely a more elegant solution is possible.

q66

  • Guest
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #1 on: May 14, 2020, 09:00:53 pm »
tested on voidlinux-ppc, multimc from repos, openjdk 8 or 11, default 4kB page kernel, getting >60fps easily regardless of the resolution (rx 5700 xt), works out of box.


emue

  • Newbie
  • *
  • Posts: 3
  • Karma: +3/-0
    • View Profile
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #2 on: May 15, 2020, 12:52:30 am »
tested on voidlinux-ppc, multimc from repos, openjdk 8 or 11, default 4kB page kernel, getting >60fps easily regardless of the resolution (rx 5700 xt), works out of box.

After your comment on IRC about page size, I double checked - jemalloc configured for 64k pages indeed appears to work on a 4k kernel. Thanks for pointing that out! Seems I only actually tested the reverse combination, which in fact just errors out.

Unless anyone objects, I will drop the 4k page build and will later try to merge the 64k CI config.

q66

  • Guest
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #3 on: May 15, 2020, 07:22:05 am »
well, having a 4k-native build is probably more efficient, but yeah. I also tried the 64k version, it works as well on 4k kernel.

shawnanastasio

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #4 on: July 12, 2020, 10:53:38 pm »
Are there any plans to get this merged upstream? I don't see it mentioned on the LWJGL issue you posted (https://github.com/LWJGL/lwjgl3/issues/495).

emue

  • Newbie
  • *
  • Posts: 3
  • Karma: +3/-0
    • View Profile
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #5 on: July 24, 2020, 03:13:41 pm »
I still intend to do this, but due to lack of time and motivation (right now) I don't have a fixed time plan.

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #6 on: September 17, 2020, 08:39:59 pm »
Thanks for the instruction.

Wondering if you could provide the instance patch for version 1.6.x too?
Faithful Linux enthusiast

My Raptor Blackbird

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #7 on: October 07, 2020, 07:23:13 am »
If anyone is interested in the 1.16.3, I've attached the 64kb pages version

https://github.com/runlevel5/minecraft-ppc64le
« Last Edit: June 21, 2024, 10:03:58 am by tle »
Faithful Linux enthusiast

My Raptor Blackbird

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #8 on: October 07, 2020, 07:25:47 am »
Good to know the game runs perfectly on Fedora 32, 33 and 34
« Last Edit: February 04, 2021, 08:51:50 am by tle »
Faithful Linux enthusiast

My Raptor Blackbird

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #9 on: February 04, 2021, 08:21:23 am »
« Last Edit: June 21, 2024, 10:03:39 am by tle »
Faithful Linux enthusiast

My Raptor Blackbird

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #10 on: February 04, 2021, 08:40:43 am »
« Last Edit: June 21, 2024, 10:03:47 am by tle »
Faithful Linux enthusiast

My Raptor Blackbird

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #11 on: February 04, 2021, 08:30:32 pm »
@emue Any update on merging the changes to LWJGL upstream?
Faithful Linux enthusiast

My Raptor Blackbird

tle

  • Sr. Member
  • ****
  • Posts: 463
  • Karma: +53/-0
    • View Profile
    • Trung's Personal Website
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #12 on: November 09, 2023, 06:17:18 pm »
GOOOD NEWS folks! https://github.com/LWJGL/lwjgl3/issues/495 is finally closed!

LWJGL3 has officially supported PPC64LE!

What does that even mean? That means it is MUCH MUCH easier to customise the client to run on linux ppc64le.
« Last Edit: March 26, 2024, 07:36:13 pm by tle »
Faithful Linux enthusiast

My Raptor Blackbird

lepidotos

  • Newbie
  • *
  • Posts: 36
  • Karma: +4/-0
    • View Profile
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #13 on: April 09, 2024, 07:28:27 pm »
Pretty good news indeed, we'll see how things go from here.

rrogalski

  • Newbie
  • *
  • Posts: 1
  • Karma: +1/-0
    • View Profile
    • rrogal.ski
Re: [GAME] Minecraft Java Edition (LWJGL being ported)
« Reply #14 on: May 11, 2024, 10:39:28 am »
Good news for polymc/prismlauncher users!!

https://github.com/PrismLauncher/PrismLauncher/files/15281869/1.15.2-ppc64le.zip This instance should 'just work' on multimc, polymc, or prismlauncher. (I can't test multimc but it works on a veryy old build of poly so it *should*:TM:)

The explanation for which is here: ( and more details here https://github.com/PrismLauncher/PrismLauncher/issues/2392 )
Quote
This is the same file mentioned but with a little change: the commit you mentioned added support for multiple architectures so instead of having just "linux" we check for "linux-ppc64le" so the only change was where you find "linux": "natives-linux" inside a "natives" object I added another line "linux-ppc64le": "natives-linux",
Quote
we decided to change linux to be equivalent to linux-x86_64 and linux-x86. So if you are on a CPU architecture other than x86_64/x86, it will try to use linux-<cpu-arch>

This also means that a single instance can now support many targets: amd64, x86, ppc64le, riscv, and so on.

You can also cp `~/.local/share/{PrismLauncher,PolyMC}/instances/{instancename}/patches/org.lwjgl3.json` of the instance i linked to the `patches` subdir of any instance (for any MC version that uses <= the provided version of LWJGL3) to make it run on ppc64le.

Official builds for lwjgl3 on ppc64le are now available https://www.lwjgl.org/customize right here! Completely customizable too. Lwjgl is a pain to build, so this is very very welcome.

I'm going to try getting changes in polymc/prismlauncher themselves to "just work" on ppc64le-- automatically detecting the arch, and when mojang doesn't provide the needed natives, download from lwjgl.org. No promises on that though. The other option is to pester mojang to provide natives themselves for ppc64le........ if anyone wants to take that on, feel free :p

I'm also going to try PR'ing lwjgl3ify (a 1.7.10 forge mod making it compatible with modern java and lwjgl3) to provide sections for `linux-ppc64le` in their default pack instances, to make that just work ootb. https://p.rrogal.ski/l/mc.png
I do not own any hardware from raptor-- my ppc64le machine is a power8 s824 rackmount from IBM.