r/ProgrammerHumor • • Oct 07 '26

Meme minecraftException

Post image
9.3k Upvotes

830 comments sorted by

35

u/Cocoatrice Oct 07 '26

I mean, Minecraft is enough to prove that. It's the best selling game in the world. And a lot of people play Java Edition, not Bedrock Edition. If game works great in Java, it means it's possible to make games in Java. It has its limitations, though.

40

u/ShakeForProtein Oct 07 '26

You can pry the Java edition from my cold dead hands. I will never use Bedrock edition.

→ More replies (9)

20

u/Ma4r Oct 08 '26

Here's the thing tho, Minecraft java notoriously does not run well at all, especially when you want to build more complex contraptions, the you need a LOT of mods optimizing how minecraft runs. Sure it runs well enough for most people, but you can't say that minecraft written in a more suitable language would be capable of so much more

16

u/mrderp1212 Oct 08 '26

Yea but these mods are written in Java, so it's a Mojang issue not java. The JVM and javac have gotten much better in the last few years, it's no longer as slow as it used to be. Tbf idk what version Minecraft runs, but assuming it's somewhat recent there wouldn't be that much of a difference between a java or C/cpp/c# implementation 

→ More replies (1)
→ More replies (4)
→ More replies (8)

149

u/johnnybgooderer Oct 07 '26

Garbage collection is bad for games. Minecraft was playable because Java garbage collectors were fast enough to make it playable.

But don’t use any garbage collected language for games.

51

u/lastog9 Oct 07 '26

Can you explain why garbage collection is bad for games? Not challenging the fact just asking because I don't know

70

u/captainAwesomePants Oct 07 '26

Most programs need to grab memory to do stuff. A hundred enemy robots just spawned in? We need a spot in memory for each of those robots to remember stuff like where it is, which way it's facing, and what it should be doing. If we could use the same spot each time, that'd be great, but we might get lots and lots of robots, so instead we grab space as we need it. The trick to that is that we also need to let that space go when we don't need it anymore. Otherwise, our program will just use up more and more space each time a robot appears until eventually there's no more space and the game breaks.

In most languages without garbage collection, the program decides when and how to free up space. The robot's been destroyed? Great, tell the system that we're done with that particular bit of memory so it can be reused later. The problem is that we are human, and there are a lot of ways to get this wrong. It's easy to forget to free the memory when it's no longer being used (called a "memory leak"), and it's also easy to accidentally free memory that you're still using.

Java provides automatic "garbage collection," which will automatically frees memory once your program no longer has any references to it. After all, if I don't have a way to reference the robot, we can know that I'm done with it. This is fantastic!

However, to do garbage collection, the system needs to figure out which bits of memory don't have references anywhere. Ancient versions of Java did this by simply pausing the entire program, looking at every reference to anything, and then freeing anything with no reference. This was pretty terrible, and you can imagine how a game pausing for maybe a whole second every so often would suck.

It also sucked for businesses, though, and more than 3 billion devices run Java, and so the Java folks worked hard on better ways to do garbage collection. Modern garbage collection is far, far better. However, ultimately, it still needs to briefly pause things. This is tunable, but there are still occasional hiccups when Minecraft's garbage collection runs. Most garbage collection cycles are < 1ms, but if a whole lot is going on, it can become quite noticeable.

14

u/Jim_skywalker Oct 07 '26

So that’s why modded Minecraft can have reoccurring lag spikes.

→ More replies (9)

1

u/pinkvelvetkissyx Oct 08 '26

wow that makes a lot of sense. thank for going so in depth

→ More replies (6)

18

u/exhaustedcheese Oct 07 '26

my educated guess: garbage collections keeps track of unused/lost data and removes it. However the amount of processing power used to keep track of is enough for developers to do manual garbage collecting. But that can lead to memory leaks? some correct me please

17

u/Bubbaluke Oct 07 '26

Pretty much nailed it. Garbage collection runs periodically, often without being told to, which could cause hitches.
It can also be turned off and run manually, or not run at all. At least in python.

→ More replies (4)
→ More replies (2)

12

u/Lyshaka Oct 07 '26

Because GC is unpredictable and runs at random times and can causes frame hitches which can hinder the experience. Also you should clean after yourself.

7

u/DuploJamaal Oct 07 '26

Without any configuration they are unpredictable and stop the world.

But in time-critical applications you would use a low-pause GC like ZGC or Shenandoah.

You can regularly call them manually and they'll do their work in another thread without causing any noticeable drops on performance.

25

u/SmuJamesB Oct 07 '26

performance overhead, mainly

games need to run a lot of complex logic many times a second. the fewer the bottlenecks on the speed at which that logic can run, the better

31

u/Drugbird Oct 07 '26

It's not even the net performance issues that's the issue with garbage collectors. It's the irregular timing of it.

Basically, the garbage collectors runs when it wants to.

So you can easily get into situations where your program starts stuttering (dropping frames) whenever the garbage collectors decides to run.

In non garbage collected languages, the programmer and/or the language itself controls explicitly when memory is cleaned (deallocated), so it's much easier to make sure that doesn't cause excessive stuttering.

That said, there are ways to control the garbage collector too in garbage collected languages so it doesn't interfere too much. But this is generally a lot more finicky than explicitly controlling the memory yourself.

→ More replies (4)
→ More replies (5)
→ More replies (7)

139

u/ComputerWhiz_ Oct 07 '26

cough Unity uses C# cough

67

u/im-a-guy-like-me Oct 07 '26

No it doesn't. Unity uses C++. It just let's devs use c# as a scripting language.

53

u/ComputerWhiz_ Oct 07 '26

Still uses garbage collection though

→ More replies (6)
→ More replies (23)

13

u/cbehopkins Oct 07 '26

Dyson Sphere Program is c#

(A massive open world/universe factory game)

3

u/rosuav Oct 07 '26

DSP suffers from a bit of a weird problem whereby the game makes itself more frustrating long before performance truly becomes an issue. You basically have to build out large blueprinted sections of factory, except that the way the grid works, you have to micromanage and microadjust to fit things onto the spherical surfaces of celestial bodies. I suspect that, if the grid issues could be solved (which is unlikely since that's kinda core to the game's whole schtick), slowdowns from extremely large factories would become more relevant.

But look at Kerbal Space Program and its spiritual successor Kitten Space Agency. They're both also written in C#. KSP definitely does suffer from issues when you get bajillion part vehicles going, though I suspect that's more of a physics question than garbage collection. KSA is rock solid. As long as you can load up the universe (on an older graphics card, going max graphics quality might run you out of VRAM), nothing else is ever an issue. Vehicle part counts haven't come close to causing issues.

40

u/gallyroi Oct 07 '26

This is... straight up not true, and bad advice.

Almost every game engine has a garbage collector, optimized specifically for games, with various controls on how they work and how your code interacts with them.

Unreal Engine, Unity, GameMaker, and more all have garbage collection.

A lot of the non-engine library frameworks for langs like C++, C#, Rust etc. also make use of garbage collection, whether by natural language features or as part of a framework.

There wouldnt be garbage collection in all major game engines and libraries if it wasn't useful for games and game developers.

Modern GC is designed to help optimize your game in real time, not hinder it. It only becomes a hinderance if your game is poorly made and you're otherwise trying to fight the GC rather than work with or around it.

→ More replies (3)

9

u/mrianj Oct 07 '26

I mean, if you really don't like garbage collection, nothing stopping you from defining a 4GB byte array and managing your memory yourself. Like a psychopath.

→ More replies (6)

8

u/Teanut Oct 07 '26

Isn't C# used in a lot of games?

→ More replies (8)

6

u/grandalfxx Oct 07 '26

Garbage collection is not bad for games, Java 6 gc was bad for games. Modern Java garbage collection is state of the art and most game engines copy it for memory management systems

Its shocking reading essays in these comments from people that have clearly not done any serious work with Java in seemingly 20 plus years

3

u/johnnybgooderer Oct 07 '26

If you’re going for 60fps, then you have 16ms to update state and produce a frame. 16ms is less than the 20+ms gc pauses that frequently occur in g1gc.

It works well for web servers, but for games where you want 60 or even 30fps, it’s a problem.

5

u/TheStatusPoe Oct 08 '26

Using g1gc when trying to minimize pause times goes to the point of u/grandalfxx is making that people aren't familiar with modern Java. The ZGC garbage collector has sub millisecond max pause times.  https://inside.java/2023/11/28/gen-zgc-explainer/

→ More replies (2)
→ More replies (4)

10

u/rosuav Oct 07 '26

That's a bit of an overgeneralization. "Games" includes a vast number of things of all different types. JavaScript is a garbage collected language, and it's actually a very *good* choice for a lot of games, because it means they can be run directly in a web browser. (And I love being able to make a nostalgic reference to Sleuth, look for it, and find that someone's ported the entire game to JS so that it can run on modern systems.) "Bad for games" is a terrible overgeneralization.

→ More replies (9)

1

u/pinkvelvetkissyx Oct 08 '26

that is a good point

4

u/SupportDangerous8207 Oct 07 '26

Supreme commander and Dyson sphere program disagree

→ More replies (1)

6

u/FabioTheFox Oct 07 '26

GC isn't inherently bad for performance ngl

The performance modern .NET cranks out is insane, still gets beaten by C++ but this bit of extra performance isn't necessary for most games I'd argue (especially if you program with composition and entities in mind rather than classes and inheritance chains)

→ More replies (11)

5

u/r2d2rigo Oct 07 '26

Ahhhhhh, the junior developer posting shit takes. Par for the course for this subreddit.

2

u/rhazux Oct 07 '26

You can turn off garbage collection in java and manage your own memory. It's trivial to do so.

→ More replies (1)
→ More replies (25)

2.2k

u/Daniikk1012 Oct 07 '26

Slay the Spire (The first one), Mindustry, Pixel Dungeon, Unciv

497

u/SunshineSeattle Oct 07 '26

Starsector

102

u/Saint_of_Grey Oct 07 '26 edited Oct 08 '26

Starsector running on an ancient version of java is an active liability for it at this point.

You can see how much memory it requests in process explorer. A solid block of 4 gigs, which windows will instantly virtualize, an OS workaround implemented during the clinton administration.

Edit: I've gotten multiple comments it was updated, guess they finally did something about that!

31

u/Inprobamur Oct 07 '26

Alex did bump it up like 10 Java versions last patch.

There is a mod that switches it out for Temurin jdk-27+22 and runs a script to set flags and additional optimizations based on processor architecture. Great for running larger sector sizes with a bunch of extra factions in Nexerelin with smooth 240fps.

→ More replies (5)

6

u/hgwaz Oct 07 '26

It also runs a lot better if you update its java

→ More replies (1)

186

u/Kcmichalson Oct 07 '26

Starsector modding is one of the most schizophrenic modding scenes in terms of doing things the game was never intended to do I've seen in a while and I love it.

57

u/PegasusPizza Oct 07 '26

Not familiar with Starsector at all. What kind of schizophrenia are the modders up to?

136

u/UncleRichardson Oct 07 '26

One that immediately comes to mind is Arma Armatura.

The game's combat takes place on a flat plane where the two fleets of star ships meet roughly in the middle. Top down tactical, pretty simple in basic concepts.

Arma Armatura somehow managed to create missions where you are actually entering a planet's atmosphere, with your reinforcements coming from above and enemy reinforcements coming from below, and enemy defense cannons blasting the entire time. The game was straight up not made with any form of vertical movement, so AA basically created an entirely new system to make these missions work.

→ More replies (3)
→ More replies (1)

13

u/Mepharias Oct 07 '26

God I love Starsector

→ More replies (1)
→ More replies (3)

84

u/whichwayisgauche Oct 07 '26

Runescape

42

u/LBGW_experiment Oct 07 '26

Surprised you only said this 12 min ago. I almost left a comment saying it.

Company name Jagex -> JaGeX -> Java Gaming Experts

→ More replies (2)
→ More replies (1)

65

u/shadow9876543210 Oct 07 '26

Wait 780 hours and I had no idea mindustry was made in Java!

34

u/SunshineSeattle Oct 07 '26

Theres actually a gir repo for the game  you can read the code and everything 

→ More replies (1)
→ More replies (2)

75

u/2580374 Oct 07 '26

I had no idea about slay the spire, that's crazy

131

u/WeirdIndividualGuy Oct 07 '26

And it worked out so well, the dev decided not to use Java ever again in their games

28

u/BrodatyBear Oct 08 '26

To be fair, for those types of games, devs switch from languages like Java and C#/MonoGame (example: Hades switched to custom C++ engine before release), at least before MS introduced solid, native AOT. Not because the language is problematic (it's fine for this type of game) but because porting them is painful or impossible without rewrite or strange hacks.
There's no official JVM for consoles, and moreover, platforms themselves just disallow JIT compilation due to security reasons. That's one of the reasons why Unity created IL2CPP (their AOT compiler)).

16

u/CAPS_LOCK_OR_DIE Oct 07 '26

Its actually very cool to poke around in if you have the opportunity. There's some spaghetti, but overall its a pretty clever codebase.

→ More replies (2)
→ More replies (2)

25

u/OohBleh Oct 07 '26

StS1 has so many amazing bugs that make speedrunning it so cool. On the code side, AbstractDungeon is basically One Big Class That Does Everything. It's common in single player games when you don't have to think about networking and such and can just store everything in the big pile of lists and flags and RNG states. Not sure if the language is to blame, but Java is an inheritance-heavy OOP language and I'm an inheritance-hater.

I'm kinda sad StS2 is so much better coded for speedrun reasons but really glad they made multiplayer such a well-polished treat right out of the box.

4

u/ArtOfWarfare Oct 08 '26

Eh, I think inheritance is hated by most developers in most languages.

It seems like people who design languages and frameworks love inheritance, but then regular developers use the language and tend to avoid it like the plague.

→ More replies (1)

7

u/Suvtropics Oct 07 '26

Pixel dungeon mentioned! Watabou and Evan 👑

18

u/Jhuyt Oct 07 '26

Is STS2 not written in Java?

80

u/Daniikk1012 Oct 07 '26

It uses Godot cause the devs wanted an editor instead of doing everything from code

→ More replies (13)
→ More replies (15)

162

u/grandalfxx Oct 07 '26

Runescape, project zomboid.

The only reason Java isnt for games is because you'd have to build a custom jdk to run on the consoles and no one wants to do that.

34

u/coolraiman2 Oct 08 '26

Another issue for 3d rendering performance is that java does not have struct, everything is a class.

On the surface level ot does seems minor but a struct and a class are widely different on how its memory is allocated. Without a struct, calls to 3d rendering api are much less efficient

33

u/Lithl Oct 08 '26

JDK 28 adds inline classes, which give you the kind of memory allocation you'd expect from a struct.

It's not released yet, but the early access build is available. Build 18 came out last week.

27

u/coolraiman2 Oct 08 '26

20 years later but nice

10

u/LutimoDancer3459 Oct 08 '26

May i introduce you to project Valhallas value classes? Java is going stronger every release. Not long and the missing struct wont be an issue anymore

5

u/warpspeedSCP Oct 08 '26

If they can get the damn thing released maybe, its been what, a decade?

3

u/Cebular Oct 08 '26

I'm a C++ dev so struct/class really only differ in that class is private by default. What do you mean that java does not have struct?

→ More replies (2)
→ More replies (2)
→ More replies (1)

645

u/mi-figue-mi-raisin Oct 07 '26

Mindustry

127

u/Successful_Day2479 Oct 07 '26

Hell yeah came here to say this

If I ever learn java it'd be to mod this game. And Minecraft.

113

u/sup3rdr01d Oct 07 '26

I learned Java as a kid to mod Minecraft. Which got me to do CS in college

Which has now ended up in me writing AI slop bullshit every day :(

30

u/Hattrickher0 Oct 07 '26

Are you the dude who sits in the cube next to me at work?

WeirdThatItHappenedTwice.jpg

→ More replies (1)

25

u/Facosa99 Oct 07 '26

Beat me to it

Only problem Mindustry has is, you probably need the 'tism to enjoy it. But when you do.... Oh does it feel good to have the most efficient production line

5

u/mi-figue-mi-raisin Oct 07 '26

I have hundred of hours on those games

→ More replies (1)
→ More replies (5)

294

u/W_Seed Oct 07 '26

RuneScape

17

u/_PM_ME_PANGOLINS_ Oct 07 '26

JAva Gaming EXperts

142

u/DmitriRussian Oct 07 '26

They have moved to C++ a long while ago, which means that it wasn't good

50

u/Awes0meEman Oct 07 '26

That was just the client. I'm pretty sure their game engine is still written in Java.

→ More replies (2)

39

u/Apalapa Oct 07 '26

Osrs too? Fairly sure that’s still legacy on Java. Maybe not the client though…

→ More replies (3)

17

u/TohveliDev Oct 07 '26

That's just the client. The game and the engine is still written in Java.

8

u/polaarbear Oct 07 '26

Minecraft was also rewritten in C++ for cross-platform compatibility. That's why there is a Minecraft: Java Edition now

6

u/Bomberlt Oct 07 '26

Ironically Java was created to be cross platform

→ More replies (1)

11

u/W_Seed Oct 07 '26

Fuck I didn't know that

→ More replies (5)

208

u/NitronHX Oct 07 '26

Osrs

29

u/SuitableDragonfly Oct 07 '26

Didn't the company name Jagex originally come from something like "Java Games [something]" or did I hallucinate that?

41

u/TohveliDev Oct 07 '26

Java Gaming Experts yeah

→ More replies (1)

10

u/Osteoprdoza Oct 07 '26

Runescript theoretically but yeah that's a Java fork

58

u/Vimda Oct 07 '26

... What? No, the game engine is Java, with a runescript interpreter for game logic. RuneScript is it's own bonkers programming language that is in no way related to Java

→ More replies (2)
→ More replies (5)

565

u/ArkoSammy12 Oct 07 '26 edited Oct 07 '26

For once I'm glad that Minecraft is written in Java because it makes modding it have such a low barrier of entry compared to games written in compiled languages.

326

u/jbar3640 Oct 07 '26

I get your point, but technically Java is a compiled language.

149

u/ArkoSammy12 Oct 07 '26

Yeah. Just shorthand to "not compiled directly to machine code".

110

u/Level0Up Oct 07 '26

Well, technically it compiles to machine code for the JVM which is known as bytecode.

→ More replies (18)

3

u/Eruantiel Oct 08 '26
  1. It’s compiled to generic byte code that machine cannot understand
  2. then it is interpreted (converted to real machine code that is different per machine) by JVM (Java virtual machine)
  3. then small snipers of code that are frequently repeated such as loops can be compiled as actual machine code and stored in ram for even faster usage until they are not used anymore.
→ More replies (2)

23

u/DrStalker Oct 07 '26

C# compiled to ILCode is just as good for modding.  Easy to view the code, and easy to modify existing functions  using Harmony patching.

This is why Unity games are great for modders, unless the devs compile using IL2cpp.  

5

u/ArkoSammy12 Oct 07 '26

That's alright. Even if C# exists, Java is still a nice option for modding. Wasn't trying to make a comparison between Java and other languages that compile to some sort of bytecode.

→ More replies (2)

41

u/Segenam Oct 07 '26 edited Oct 07 '26

Yes and no. While java made it a bit easier, it caused all sorts of other problems with the modding community.

Compare Minecraft to games which actually have good mod support:

Vintage Story, Rimworld, Starbound, Factorio (Edit: guess people have issues with this one in perticular)

The trick is to not have to have your mod creators program at all by default. Use a data format that is easily able to be learned and have a patch system so that multiple mods don't clash.

28

u/hithroc Oct 07 '26 edited Oct 07 '26

I haven't played these other games, but I don't think Factorio is a good comparison.

The domain of what is possible in modded Factorio vs modded Minecraft is extremely different, majority of Factorio mods just extend on what the game already does: here are machines, they convert things to other things. Majority of mods fall into this bucket, including many overhauls. Even when mods do something unusual, it's usually very hacky and sometimes half broken. Looking at you Space Exploration spaceships, nav view, space elevators. For another non-gameplay example graphtorio comes to mind (there are actually several different ways to implement graphtorio-like functionality within limits of what you can do with Factorio API, but all of them are kind of terrible).

A lot (majority?) of mods in Minecraft go so beyond what the game fundamentally does. From game optimizations, shaders, to more big stuff. Thinking IC, BC, AE, or for a more modern example Sable/Create: Simulated (or Create: Aeronautics which uses it).

→ More replies (6)
→ More replies (7)
→ More replies (11)

136

u/Toutanus Oct 07 '26

Wakfu

39

u/ajnozari Oct 07 '26

unexpected Wakfu reference

12

u/Aelrift Oct 07 '26

I legit did a double take

8

u/Toutanus Oct 07 '26

I worked a few years in the same town as Wakfu studio

4

u/CongratulationsEVA01 Oct 07 '26

Did you know; Wakfu took 200 years of researching and collecting Date, for 20 measly minutes of coding

→ More replies (1)

131

u/Alokir Oct 07 '26

Hundreds of pre-smartphone mobile games

104

u/da_Aresinger Oct 07 '26

Not pre smartphone. Pre kotlin.

Most applications on Android, before 2019 were written in Java.

16

u/Tyrus1235 Oct 07 '26

Well, technically you could spin up something in Unity using C# and it’d somehow run on Android and iOS (if you were on a Mac).

14

u/r3dm0nk Oct 07 '26

The vast ocean of symbian games

3

u/mordacthedenier Oct 08 '26

Symbian supported java through J2ME, which is the same format every non-smartphones ran. There were lots of native Symbian games though, which would've been written in C++.

371

u/daniil007a Oct 07 '26

Zomboid

341

u/Western_Sentence_943 Oct 07 '26

This is an antiexample tbh Zomboid suffers so much from its own engine

107

u/daniil007a Oct 07 '26

Still a banger game. But I get it, performance is shit. Can't drive car fast cuz when I do I hit an invisible wall while next chunk is loading. And many zombies tank fps.

From dev standpoint idk if it gives guys any problems

30

u/Layton_Jr Oct 07 '26

Low FPS with zombies nearby is a feature, this way you know when to be careful

→ More replies (4)
→ More replies (1)

26

u/harelzz Oct 07 '26

Tbf so does minecraft

5

u/Topikk Oct 07 '26

Yep, the mobile version was written from scratch in c++ so it would run on phones, then ported back to PC later where it runs laps around Java to this day. If the versions didn't have so many key differences affecting gameplay, Java likely would have been abandoned long ago.

→ More replies (2)

3

u/ForgedIronMadeIt Oct 07 '26

They're actively rewriting parts in C++ last I checked.

→ More replies (11)

37

u/can_prog Oct 07 '26

Project Zomboid is the worst game I love. I hate it. The devs are bad, the engine is clunky and it is missing so many features after 14 years of development. Yet it fascinates me and I can't stop playing it.

12

u/loufurman Oct 07 '26

The classic Ark: Survival Evolved problem

→ More replies (1)
→ More replies (5)

21

u/OneArmedFarmer Oct 07 '26

I thought that was written in Lua but apparently it's both!

17

u/jojos38 Oct 07 '26

Lua it's just a scripting langage in itself

20

u/Abcdefgdude Oct 07 '26

Balatro is written fully in Lua

→ More replies (4)
→ More replies (2)

29

u/zacyzacy Oct 07 '26

Slay the spire 1

48

u/Conman636 Oct 07 '26

Songs of Syx.

6

u/LittleMlem Oct 07 '26

That's java? Man's insane

2

u/Time-Result-767 Oct 07 '26

came here to say this, seconding, it's amazing

→ More replies (1)

16

u/Ok_Confusion4764 Oct 08 '26

Runesca- oh no wait, they switched to C++ as well because it was so bad...

→ More replies (15)

14

u/SupportDangerous8207 Oct 07 '26

Supreme commander

6

u/Metallkiller Oct 07 '26

Oh damn really? That's a hell of a game to build in Java.

4

u/Peakomegaflare Oct 07 '26

The absolutely baller spiritual successor to Total Annihilation

5

u/TemporaryFearless482 Oct 07 '26

For those looking to scratch the original Total Annihilation itch, look up “Beyond All Reason”.

2

u/HuntKey2603 Oct 08 '26

and project zomboid 

→ More replies (2)

32

u/girlfriendsbloodyvag Oct 07 '26

RuneScape? One of the longest running MMOs out there?

20

u/facie97 Oct 07 '26

So much spaghetti it might as well have been written in italian instead of java. I love it though

4

u/dodgyhashbrown Oct 07 '26

Does the newer versions still run on Java or is that just the old school version?

7

u/rsandio Oct 07 '26 edited Oct 07 '26

RS3 client is written in C++. OSRS is also transitioning to C++.

Backends are still Java.

→ More replies (2)
→ More replies (1)

4

u/Sol33t303 Oct 07 '26 edited Oct 08 '26

Project Zomboid is great.

Edit: forgot about slay the spire, that's another great one.

→ More replies (1)

10

u/Banalian Oct 07 '26

Spiral Knights

18

u/Cheezyrock Oct 07 '26

Architecture and algorithms matters way more than language. A skilled coder knows the limitations of a language they are working with and designs around hiding the rough edges.

9

u/Rework_Aramusha Oct 08 '26

I wonder how much more efficient a huge minecraft modpack would run if minecraft would be built on like C or so

9

u/ashsabre Oct 08 '26

minecraft bedrock (consoles, pc, ios and android) is built in c++ though it's modding capabilities isn't as good as java..

6

u/GrampaSwood Oct 08 '26

Question is, is that because of C++ or because they want to sell you mods on the store?

7

u/StructureSimilar312 Oct 08 '26

Its cause they want your money. If they wanted bedrock could support mods.

→ More replies (2)
→ More replies (5)

5

u/HolyElephantMG Oct 08 '26

Didn’t Minecraft deobfuscate a good bit of Java’s code a while back while simultaneously making Bedrock’s much harder to access?

→ More replies (3)

9

u/Brickybooii Oct 12 '26

If Bedrock was a 1:1 of java just programmed in C++, I'll bet everyone would like it better. The issue is bedrock was built to monetize what modding had made free

7

u/F3mshep Oct 07 '26

Slay the Spire, indie darling of 2019 was written in Java.

7

u/LittleMlem Oct 07 '26

While it's a fantastic game, it doesn't exactly require much performance. They could have written it in python and it still would have ran smoothly

→ More replies (1)

7

u/Negitive545 Oct 07 '26 • This

Minecraft, Zomboid, Starsector

All three of which are bangers. All three of which suffer heavily from the fact that they run on Java.

7

u/randomlemon9192 Oct 07 '26

I thought I was in r/Minecraft for a minute lol.

Anyone know the backstory as to why they chose Java to develop the game in? Odd choice given its non use in industry games.

20

u/Cebular Oct 07 '26

Notch was a Java dev and Minecraft was supposed to be a small project that would take couple weeks, Mojang should've switched to C++ a long time ago but Bedrock is a mess so here we are with game worth literal billions that you need to install basic optimization mods for it to work properly.

10

u/A_Canadian_boi Oct 07 '26

Mojang should have switched to C# honestly. It's very similar in principle and style to Java, it's used by probably a solid 1/3 of video games out there, it works on console, it doesn't require much installation, and guess what? It's literally developed by Microsoft

edit: It also is extremely moddable, just like Java

→ More replies (14)
→ More replies (1)

8

u/atzedanjo Oct 07 '26

It was the language that Notch was most proficient in.

12

u/Robocop613 Oct 07 '26

Notch worked with Java at his day job. Java also at the time had web-applets which allowed people to run the game in their browser which helped people play it right away when he posted on TigSource forums.

7

u/LatvianCake Oct 07 '26

Before Minecraft was a thing, he worked on Wurm Online. That game is still around and is also written in Java.

→ More replies (3)

7

u/c1e0c72c69e5406abf55 Oct 07 '26

Puzzle Pirates, written in Java

13

u/not_some_username Oct 07 '26

You’re clearly too young to know the great Java games era

34

u/userhwon Oct 07 '26

It's kinda shit for Minecraft as well.

24

u/Revolutionary_Crew80 Oct 07 '26

Not like the version they made in c++ is better

15

u/sarcb Oct 07 '26

It is in many ways, and worse in others. They did not make it in c++ for parity that much is clear..

→ More replies (9)

6

u/marvology Oct 07 '26

Didn't Java power all those classic Yahoo games back before Marissa Mayer did her Manchurian candidate job on them?

11

u/anoppinionatedbunny Oct 07 '26

online games using the Java browser runtime were a dime a dozen back in the day. nowadays, with all these new engines, WASM and WebGL, Java went back to being almost exclusively a backend language. It's fine for most games. If we're honest, most programming languages are fine for most games. the biggest difference is developer skill.

→ More replies (1)

5

u/Heavy-Ad6017 Oct 07 '26

Hey dont forget my Snake game I wrote in Java with Swing UI

5

u/Feuzme Oct 07 '26

Binding of Isaac

9

u/LordOmbro Oct 07 '26

Project Zomboid is written in Java :)

→ More replies (6)

4

u/MentalFS Oct 07 '26

At least we got a more secure Log4J now

→ More replies (1)

4

u/thejokerofunfic Oct 07 '26

Hey Java is excellent for game dev! I always drink a fresh cup before I sit down to code in Python

3

u/BI00dSh0t Oct 07 '26

runescape my guy. one of the ogs

3

u/WaffleWalk Oct 07 '26

Protect Zomboid

3

u/SidNYC Oct 07 '26

Slay the spire was also written in Java 

21

u/MichaelAceAnderson Oct 07 '26

If we're being honest, Java isn't optimized for games like C or C++ is for example

Minecraft was rewritten in C by Microsoft and, if we forget the marketplace and the overall useless cluttering with things that weren't there in the first place, it runs much better

40

u/Gelid_Cryotheum Oct 07 '26

While yes it is less hardware-intensive, I would hesitate to say it runs better. It's been overexaggerated, but there's a reason we call it Bugrock.

Quick point of clarification, it was written in C++, not C.

Back on point, I started out on Bedrock, and while yes, it runs on much less powerful devices, when your computer can run Java Edition, stability is not a concern, with Bedrock Edition I became well acquainted with how to break the game, crash, or corrupt my world. It's not a pleasant experience to be performing normal gameplay and crashing. Not even my modded gameplay (outside of Minecolonies, but that mod is a nightmare in its own right and should be taken with a fat grain of salt) is that unstable.

16

u/MCplayer590 Oct 07 '26

I would argue bedrock is buggy because of a lack of willingness to spend time fixing the bugs on Microsoft's part, not necessarily due to the programming language used. Microsoft treats bedrock as the cash cow and java as the lure that kids watch on YouTube, who are then expected to play bedrock

8

u/Gelid_Cryotheum Oct 07 '26

I agree that that is the core of the issue, I was just arguing that it's not really a fair comparison to say it "runs better" because it's on C++ when bad bug management is still present. Java, for all it's faults, is known and well-kept, and despite being on paper the worse language for game development, still handily beats a mid-tier at best recreation in C++. If Bedrock were a faithful recreation with the same level of care and polish, it would probably be better, but it just isn't at its current state.

4

u/MrHyperion_ Oct 07 '26

The problem with bedrock is that it is asynchronous. What the server sees (that is still run separately on local world too) and what the player see are desynced far too easily which leads to you randomly dying because the server thought you took damage.

→ More replies (9)

8

u/Vladimir_Djorjdevic Oct 07 '26

It doesn't really run better though, at least not anymore. Java edition now has better performance than bedrock, especially if you install mods.

→ More replies (2)

5

u/Useful_Clue_6609 Oct 07 '26

Really? I haven't heard it runs better, just that it's buggier and they changed mechanics for no reason

→ More replies (17)

5

u/KookyDig4769 Oct 07 '26

Every Android game ever?

4

u/ilnarildarovuch Oct 07 '26

Nope, it's mostly pre-compiled C++

4

u/stevetures Oct 07 '26

Fwiw the newer Minecraft (bedrock) is written in C++ though ofc all the java mods etc don't natively, ofc you need to use their marketplace etc

4

u/Tarc_Axiiom Oct 07 '26

It's no good for Minecraft either lol.

It's just too late.

2

u/Understanding-Fair Oct 07 '26

RuneScape, apparently

2

u/Rawullf Oct 07 '26

Tibia started on Java iirc

2

u/WillDonJay Oct 07 '26

Runescape!

2

u/MegaScience Oct 07 '26

Façade. Messing with Trip and Grace subtly as they with though their plot. (Facade, for anyone searching comments)

2

u/Onoulade Oct 07 '26

Mindustry !

2

u/Thiccboi2 Oct 11 '26

project zomboid

6

u/New_Salamander_4592 Oct 07 '26

and the worst part about minecraft is its in Java

→ More replies (1)

3

u/Estrelaura Oct 09 '26

People are talking about memory accesses and GC, but that only shows half of the picture. Java is HEAVILY object oriented. I'm not someone who thinks OOP is complete garbage with zero applications, but our silicon is data and procedure oriented. There's a natural overhead in reorganizing code that is structured in objects and the magical compilers that make this cost zero never became true. In a world where CPUs are OOP, this might be more justified (and even more efficient once someone cracks the design of such a CPU), but in a world of procedural CPUs, problems with translating the approaches grow exponentialy. A game as complex and with systems as detailed as Minecraft should be considered a miracle in Java. Same with parallelism, Minecraft is to this day still very sequential (although much more parallel than before) because just making stuff parallel without careful engineering just make these problems pop at a steeper curve.

2

u/Einkar_E Oct 07 '26

the fact that minecraft exist doesn't prove that java is good for games, minecraft has history of being not exactly well optimized, and a bit buggy

2

u/devilxnux Oct 07 '26

Don't you remember that majority of mobile games are written in Java?

2

u/Rewhen77 Oct 09 '26

Mobile games are the worst gaming has to offer

→ More replies (1)
→ More replies (2)

2

u/DogmaticParadigm87 Oct 07 '26

Java is no good for games. It only made the best-selling one ever, and then they rewrote it in C++ just to be sure.

2

u/Due-Ad-2144 Oct 07 '26

Isn't bedrock made in C# though?

3

u/Kotentopf Oct 07 '26

No, it was rewritten in C++. The primary reason was, to make the best possible portability to export it to as many platforms as possible.

→ More replies (3)

2

u/sonicpoweryay Oct 07 '26

Yeah they literally had to rewrite the entire game in a different language

2

u/user_of_shoes Oct 07 '26

Tetris was made with Pascal, and it has outsold Minecraft.

→ More replies (3)

2

u/Terrariant Oct 07 '26

Well…just because it was made in Java does not mean it’s good. Minecraft runs like a POS if we’re being honest here, and that is mostly because of Java quirks with garbage collection afaik

→ More replies (19)

1

u/TheBigGambling Oct 07 '26

Risk

2

u/FirexJkxFire Oct 07 '26

If your language choice to run a turn based board game is able to have any kind of impact on performance that is meaningful, that is 100% a skill issue.

1

u/Tree_Dude Oct 07 '26

Sonic 4 Ep1.... Maybe not the best example....

1

u/STINEPUNCAKE Oct 07 '26

There are quite a few small games made in Java but at scale it sucks and that’s Minecraft moved to C

1

u/RotCrab Oct 07 '26

Most of Nokia games made on Java.

1

u/SeaNational3797 Oct 07 '26

TerraFirmaCraft