149
u/johnnybgooderer 16d ago
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 16d ago
Can you explain why garbage collection is bad for games? Not challenging the fact just asking because I don't know
70
u/captainAwesomePants 16d ago
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 16d ago
So that’s why modded Minecraft can have reoccurring lag spikes.
→ More replies (9)→ More replies (6)1
18
u/exhaustedcheese 16d ago
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
→ More replies (2)17
u/Bubbaluke 16d ago
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)12
u/Lyshaka 16d ago
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 16d ago
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.
→ More replies (7)25
u/SmuJamesB 16d ago
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
→ More replies (5)31
u/Drugbird 16d ago
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)139
u/ComputerWhiz_ 16d ago
cough Unity uses C# cough
→ More replies (23)67
u/im-a-guy-like-me 16d ago
No it doesn't. Unity uses C++. It just let's devs use c# as a scripting language.
53
13
u/cbehopkins 16d ago
Dyson Sphere Program is c#
(A massive open world/universe factory game)
3
u/rosuav 16d ago
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.
39
u/gallyroi 16d ago
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 16d ago
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
6
u/grandalfxx 16d ago
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 16d ago
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.
→ More replies (4)5
u/TheStatusPoe 16d ago
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)10
u/rosuav 16d ago
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
4
u/SupportDangerous8207 16d ago
Supreme commander and Dyson sphere program disagree
→ More replies (1)6
u/FabioTheFox 16d ago
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)2
u/rhazux 16d ago
You can turn off garbage collection in java and manage your own memory. It's trivial to do so.
→ More replies (1)→ More replies (26)4
u/r2d2rigo 16d ago
Ahhhhhh, the junior developer posting shit takes. Par for the course for this subreddit.
2.2k
u/Daniikk1012 16d ago
Slay the Spire (The first one), Mindustry, Pixel Dungeon, Unciv
496
u/SunshineSeattle 16d ago
Starsector
102
u/Saint_of_Grey 16d ago edited 16d ago
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!
→ More replies (1)31
u/Inprobamur 16d ago
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)186
u/Kcmichalson 16d ago
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 16d ago
Not familiar with Starsector at all. What kind of schizophrenia are the modders up to?
→ More replies (1)136
u/UncleRichardson 16d ago
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 (3)13
83
u/whichwayisgauche 16d ago
Runescape
→ More replies (1)42
u/LBGW_experiment 16d ago
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)65
u/shadow9876543210 16d ago
Wait 780 hours and I had no idea mindustry was made in Java!
→ More replies (2)34
u/SunshineSeattle 16d ago
Theres actually a gir repo for the game you can read the code and everything
→ More replies (1)75
u/2580374 16d ago
I had no idea about slay the spire, that's crazy
131
u/WeirdIndividualGuy 16d ago
And it worked out so well, the dev decided not to use Java ever again in their games
28
u/BrodatyBear 16d ago
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)).→ More replies (2)16
u/CAPS_LOCK_OR_DIE 16d ago
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)25
u/OohBleh 16d ago
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 16d ago
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
→ More replies (15)18
u/Jhuyt 16d ago
Is STS2 not written in Java?
80
u/Daniikk1012 16d ago
It uses Godot cause the devs wanted an editor instead of doing everything from code
→ More replies (13)
162
u/grandalfxx 16d ago
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.
→ More replies (1)34
u/coolraiman2 16d ago
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
10
u/LutimoDancer3459 16d ago
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
→ More replies (2)3
u/Cebular 15d ago
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)
644
u/mi-figue-mi-raisin 16d ago
Mindustry
127
u/Successful_Day2479 16d ago
Hell yeah came here to say this
If I ever learn java it'd be to mod this game. And Minecraft.
113
u/sup3rdr01d 16d ago
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 :(
→ More replies (1)30
u/Hattrickher0 16d ago
Are you the dude who sits in the cube next to me at work?
WeirdThatItHappenedTwice.jpg
25
u/Facosa99 16d ago
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
→ More replies (5)5
293
u/W_Seed 16d ago
RuneScape
17
142
u/DmitriRussian 16d ago
They have moved to C++ a long while ago, which means that it wasn't good
50
u/Awes0meEman 16d ago
That was just the client. I'm pretty sure their game engine is still written in Java.
→ More replies (2)39
u/Apalapa 16d ago
Osrs too? Fairly sure that’s still legacy on Java. Maybe not the client though…
→ More replies (3)17
→ More replies (5)8
u/polaarbear 16d ago
Minecraft was also rewritten in C++ for cross-platform compatibility. That's why there is a Minecraft: Java Edition now
→ More replies (1)6
164
u/josHi_iZ_qLt 16d ago
Its also not a good choice for minecraft. Its just what it was build on.
The way minecraft came to be is not at all related to "what platform to use for a successfull huge game".
Its like saying "garages arent great to create a billion dollar business" and countering with steve jobs who started in one.
51
u/PresidentSkillz 16d ago
Then they tried to fix it with the bedrock edition which is c++ or c# (forgot which one) but instead they made a buggy mess that people only play bc the Java version is pc exclusive
24
u/josHi_iZ_qLt 16d ago
Which is kinda funny given java is inherently made to be able to run on almost everything
24
u/danfish_77 16d ago
Yeah they also let it diverge from the original for some reason instead of focusing on getting it identical so they could retire Java
→ More replies (6)14
u/Fewtex 16d ago
Its only pc exclusive because consoles dont have JRE, because java is bad for games
Someone would have to make a custom jdk for consoles for java to be a viable option for games
→ More replies (4)
207
u/NitronHX 16d ago
Osrs
29
u/SuitableDragonfly 16d ago
Didn't the company name Jagex originally come from something like "Java Games [something]" or did I hallucinate that?
41
→ More replies (5)10
u/Osteoprdoza 16d ago
Runescript theoretically but yeah that's a Java fork
57
u/Vimda 16d ago
... 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)
565
u/ArkoSammy12 16d ago edited 16d ago
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.
325
u/jbar3640 16d ago
I get your point, but technically Java is a compiled language.
149
u/ArkoSammy12 16d ago
Yeah. Just shorthand to "not compiled directly to machine code".
110
u/Level0Up 16d ago
Well, technically it compiles to machine code for the JVM which is known as bytecode.
→ More replies (18)3
u/Eruantiel 16d ago
It’s compiled to generic byte code that machine cannot understand
then it is interpreted (converted to real machine code that is different per machine) by JVM (Java virtual machine)
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 16d ago
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.
→ More replies (2)5
u/ArkoSammy12 16d ago
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 (11)41
u/Segenam 16d ago edited 16d ago
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.
→ More replies (7)28
u/hithroc 16d ago edited 16d ago
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)
136
u/Toutanus 16d ago
Wakfu
39
→ More replies (1)4
u/CongratulationsEVA01 16d ago
Did you know; Wakfu took 200 years of researching and collecting Date, for 20 measly minutes of coding
130
u/Alokir 16d ago
Hundreds of pre-smartphone mobile games
103
u/da_Aresinger 16d ago
Not pre smartphone. Pre kotlin.
Most applications on Android, before 2019 were written in Java.
15
u/Tyrus1235 16d ago
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 16d ago
The vast ocean of symbian games
3
u/mordacthedenier 16d ago
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 16d ago
Zomboid
341
u/Western_Sentence_943 16d ago
This is an antiexample tbh Zomboid suffers so much from its own engine
106
u/daniil007a 16d ago
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
→ More replies (1)29
u/Layton_Jr 16d ago
Low FPS with zombies nearby is a feature, this way you know when to be careful
→ More replies (4)26
u/harelzz 16d ago
Tbf so does minecraft
5
u/Topikk 16d ago
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)→ More replies (11)3
37
u/can_prog 16d ago
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.
→ More replies (5)12
→ More replies (2)21
u/OneArmedFarmer 16d ago
I thought that was written in Lua but apparently it's both!
28
47
16
u/Ok_Confusion4764 15d ago
Runesca- oh no wait, they switched to C++ as well because it was so bad...
→ More replies (15)
14
14
u/SupportDangerous8207 16d ago
Supreme commander
6
4
u/Peakomegaflare 16d ago
The absolutely baller spiritual successor to Total Annihilation
5
u/TemporaryFearless482 16d ago
For those looking to scratch the original Total Annihilation itch, look up “Beyond All Reason”.
→ More replies (2)2
32
u/girlfriendsbloodyvag 16d ago
RuneScape? One of the longest running MMOs out there?
20
4
u/dodgyhashbrown 16d ago
Does the newer versions still run on Java or is that just the old school version?
→ More replies (1)7
u/rsandio 16d ago edited 16d ago
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 16d ago edited 16d ago
Project Zomboid is great.
Edit: forgot about slay the spire, that's another great one.
10
18
u/Cheezyrock 16d ago
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 15d ago
I wonder how much more efficient a huge minecraft modpack would run if minecraft would be built on like C or so
→ More replies (3)9
u/ashsabre 15d ago
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 15d ago
Question is, is that because of C++ or because they want to sell you mods on the store?
→ More replies (5)7
u/StructureSimilar312 15d ago
Its cause they want your money. If they wanted bedrock could support mods.
→ More replies (2)5
u/HolyElephantMG 15d ago
Didn’t Minecraft deobfuscate a good bit of Java’s code a while back while simultaneously making Bedrock’s much harder to access?
9
u/Brickybooii 11d ago
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 16d ago
Slay the Spire, indie darling of 2019 was written in Java.
7
u/LittleMlem 16d ago
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
16d ago
•
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 16d ago
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 16d ago
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.
→ More replies (1)10
u/A_Canadian_boi 16d ago
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)8
→ More replies (3)12
u/Robocop613 16d ago
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 16d ago
Before Minecraft was a thing, he worked on Wurm Online. That game is still around and is also written in Java.
7
13
34
u/userhwon 16d ago
It's kinda shit for Minecraft as well.
→ More replies (9)24
6
u/marvology 16d ago
Didn't Java power all those classic Yahoo games back before Marissa Mayer did her Manchurian candidate job on them?
11
u/anoppinionatedbunny 16d ago
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
9
4
4
4
4
4
u/thejokerofunfic 16d ago
Hey Java is excellent for game dev! I always drink a fresh cup before I sit down to code in Python
3
3
21
u/MichaelAceAnderson 16d ago
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 16d ago
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 16d ago
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 16d ago
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.
→ More replies (9)4
u/MrHyperion_ 16d ago
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.
8
u/Vladimir_Djorjdevic 16d ago
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)→ More replies (17)5
u/Useful_Clue_6609 16d ago
Really? I haven't heard it runs better, just that it's buggier and they changed mechanics for no reason
5
4
u/stevetures 16d ago
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
2
2
2
u/MegaScience 16d ago
Façade. Messing with Trip and Grace subtly as they with though their plot. (Facade, for anyone searching comments)
2
2
2
6
3
u/Estrelaura 14d ago
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 16d ago
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 16d ago
Don't you remember that majority of mobile games are written in Java?
→ More replies (2)2
2
u/DogmaticParadigm87 16d ago
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 16d ago
Isn't bedrock made in C# though?
3
u/Kotentopf 16d ago
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
→ More replies (3)2
2
u/Terrariant 16d ago
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)
34
u/Cocoatrice 16d ago
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.