| |

How to Optimize Minecraft: Simple Things Mojang Can Do

After 1.13, optimizing Minecraft: Java Edition can seem daunting. However, Mojang can do some relatively simple things to optimize Minecraft. In this article, we will be taking a lesson from developing other games and seeing how we can make things a little easier for Mojang since multithreading the game can often be a daunting and challenging with code as old as Minecraft. See how Mojang can multithread the game here (Credit: AntVenom):

AntVenom explaining how multithreading can improve the game

If you’re working for Mojang and read this article, you’re welcome to take any of these ideas for yourself. You don’t need to pay me any royalties. I will be rewarded by my server running faster.

If you’re interested in holistically improving your computer’s speed, check out zRAM: How to Greatly Improve your Computer’s Speed with only Software

Step 1: Optimize Minecraft Mob AI for client when server lag occurs

So one thing that many developers of some games will do with NPCs is when the client is not getting packets from the server, the client will calculate the trajectory of mobs on its own, and that will at least make the game feel smoother to the player and will alert them when a mob is coming towards them.

While this would do nothing to speed up server TPS (TPS stands for Ticks Per Second. Learn more here: https://apexminecrafthosting.com/what-is-minecraft-tps/), it would at least make the game seem more tolerable and improve things a lot for players on slow network connections. It’s something to think about. When the connection is restored to the server, the server sends a packet to the client telling them the actual position of the mob, and at worse, the server rubber-bands the mob.

See also  How to Install Baritone on Minecraft 1.19/1.19.2

Step 2: Optimize Minecraft Latency by Sharing the Seed

While this well wouldn’t improve server TPS that much, it may improve two things: network bandwidth for the server and the client and possibly world save files. The server shares the seed with the client when it logs in.

Optimizing Minecraft Seeds
The Seed determines every natural feature for each Minecraft world

Once the seed is shared, the client will generate the terrain client-side, and anything that was changed from other players or whatever will be sent to the client after the seed and placed in chunks loaded by the client. This should greatly improve network bandwidth. As for saving data on the world save files, this should be optional as it may cause server-side lag, as the server would have to regenerate the chunk every time it’s loaded.

Step 3: Make Redstone not Produce Light

If you watch Mumbo Jumbo, you may notice that on Hermitcraft, he uses as many Observers as possible to replace Redstone wire. He does this because Redstone produces lighting updates, and lighting can tend to be extremely slow. How to fix that? Simple. Make Redstone not produce light anymore. It does not affect the game other than making it lag. So why not just get rid of it? Mojang can also make the Redstone lighting updates client-side only. Simple but effective.

Redstone contraptions cause lighting updates which can cause a lot of lag depending on the Redstone device

Step 4: Update the Java Version

UPDATE: Kudos to Mojang for upgrading to the latest version of Java!

The Minecraft Launcher uses Java 11, and Mojang compiles Minecraft Java Edition using Java 8. While this may break some older projects, upgrading Java versions to at least Java 12 would be a good idea. Java 11 and Java 8 are both ancient versions of Java. Java 12 includes the Shenandoah GC, which significantly improves garbage collecting. While it’s impossible to say, just using the Shenandoah GC has been more effective at lag prevention than using Aikar’s complex and well-thought-out set of JVM flags for starting the server.

See also  Stop Telling Beginning Linux Users These Things
Java has vastly improved in performance over the years, and keeps improving with every new update.

Conclusion

Well, those are just some simple things Mojang can do to optimize Minecraft: Java Edition greatly. And believe me, it really does need optimization.

Similar Posts

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *