Minecraft ridiculously laggy

Anything about the game. Maps, mods, servers, etc.
Locked
Chairman_Tiel
Rear Admiral
Rear Admiral
Posts:1890
Joined:Sat Dec 01, 2012 9:39 am
Affiliation:GLORIOUS REPUBLIC
Minecraft ridiculously laggy

Post by Chairman_Tiel » Wed Mar 06, 2013 4:45 pm

I have optifine installed, jdk 7, etc, all the fixes. Drivers are most definitely up to date.

Before, my laptop could run the game just fine without them. But I just installed millenaire and mo'creatures, and I'm getting 3 FPS. I'd expect that from my netbook, not the laptop that can run Skyrim and BFBC2. Any suggestions?
[spoiler]Image[/spoiler]

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Minecraft ridiculously laggy

Post by fr0stbyte124 » Wed Mar 06, 2013 4:50 pm

What's the memory usage look like with those mods on? You may need to allocate more memory to the JVM.

Chairman_Tiel
Rear Admiral
Rear Admiral
Posts:1890
Joined:Sat Dec 01, 2012 9:39 am
Affiliation:GLORIOUS REPUBLIC

Re: Minecraft ridiculously laggy

Post by Chairman_Tiel » Wed Mar 06, 2013 5:25 pm

Lowered to 128, then went to 512, and finally 1024.

Still some stuttering, but that seemed to do it, thanks.
[spoiler]Image[/spoiler]

CommanderKobialka
Lt. Commander
Lt. Commander
Posts:728
Joined:Sun Dec 23, 2012 5:31 pm
Affiliation:White
IGN:Nevank

Re: Minecraft ridiculously laggy

Post by CommanderKobialka » Wed Mar 06, 2013 9:58 pm

minecraft isnt smaller than any of your other games its just that it runs on java and java is crap.
Throw the commies in the drink so my country can be free!

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Minecraft ridiculously laggy

Post by fr0stbyte124 » Wed Mar 06, 2013 10:59 pm

Java's not so bad. Computation-wise it can play in the big leagues, certainly at the level Minecraft is using its capabilities at, and it's dynamic memory allocation system is one of the best in the business. The thing it can't do, and this is the same for most modern languages, is manual control over memory management. Controlling exactly when objects are allocated memory and exactly what circumstances they are removed from memory is very important for realtime performance-heavy applications, but has for the most part been handed off to an automated controller in most languages. Normally, this is a good thing. Simplifies programming and makes memory leaks and a lot of performance and stability issues caused by missing deallocations a thing of the past. However this comes at a cost, and in high end video games, there is no room for going off-script.

Though that is the reason most games are still written in C/C++, that doesn't really explain away Minecraft's performance issues, nor does blaming Notch for being a poor coder; I've seen him work before and he's actually quite amazing at it. The reasons for Minecraft's performance issues are complicated and multifaceted and can't simply be dismissed as a couple things which should have been different. Some of the reasons are certainly some poor optimization in parts, but some things are inherent to the sort of game Minecraft is, and aren't so easily fixed. The square geometry, for instance, has a well-defined, iconic shape to it, and can't simply be smoothed out to use less geometry. And at the same time, you are working in a world handling millions of virtual blocks, most of which have stuff they want to do all the time, in a world where you can make precisely zero guarantees about what the terrain is going to look like ahead of time. I've been working on just that for a year now, and I've only recently begun making serious headway into getting around this stuff. In the same amount of time, Notch built the entire game from scratch and got it to roughly the state it was in before the famed adventure update. One wouldn't expect him to find the same solution as someone who spent that entire time focused on perfecting a single facet of the game.

However, even with optimizations, minecraft is still going to take a ton of memory, even if for nothing other than the seriously massive amount of active destructable terrain. You are very limited by how you can handle this data without affecting perfomance or making the code a lot more difficult to work with. My working strategy is to prioritize multiplayer and shave down the client side to the bare minimum amount of data needed to interact with the environment, that way the machine can focus on handling much, much larger static terrain. But the servers will still be more or less business as usual. Most of the time, though, multiplayer performance isn't limited by server power or memory, but by bandwidth and latency, and we are going to be doing a ton to mitigate that.

Right now, Minecraft is inefficient online, because it is using a transport protocol called TCP, which is a full-featured protocol for reliably sending data across the internet, prioritizing correctness and order over speed and efficiency. Pretty mucn every other realtime online game uses UDP, which is a bare-bones protocol. Packets contain just about nothing but the packet data and a shipping label. Everything else you need, you have to do yourself, but you get full control over it. If you don't care if packets arrive out of order, you don't have to enforce the order of arrival or hold up the queue while everything gets sorted out. If you don't care about packets going missing (because, for instance, they are going to be obsolete in another fraction of a second), then you don't have to go out of your way to get that packet re-sent. Stuff like that makes a big difference in how traffic is handled by the server, and the responsiveness of the gameplay. The biggest thing jamming up the pipe is terrain downloading, simply because of how much data is in the chunks and the frequency at which chunks must be downloaded to keep up with a traveling player. We're doing a ton with this as well. The entire level format is divided into different channels which can be used independently to get just the parts you need at the time. For instance, we can send only the surface visible blocks in a channel and surface touching light in another and compress the empty space. Until you try to dig, you wouldn't know the difference, even though one is an order of magnitude smaller in size. We're also going to try to do more with level caching, so clients can download the surrounding area at leasure, rather than all at once, and archive it to harddrive.

That's only scratching the surface, but the point is, the things we are doing are not simple tweaks, but some pretty fundamental changes to how Minecraft works, and we've had a very long time to work out how to do it.

tl;dr It's not java.

User avatar
Laserbilly
Ensign
Ensign
Posts:299
Joined:Sun Dec 09, 2012 8:31 am

Re: Minecraft ridiculously laggy

Post by Laserbilly » Thu Mar 07, 2013 11:48 am

Holy cow, that sounds like a big project! I barely understood it, and I'm assuming you simplified everything you wrote for our benefit, too. Thanks.

Avenger_7
Ensign
Ensign
Posts:262
Joined:Sun Dec 09, 2012 11:39 pm
IGN:Avenger_7
Location:Canada

Re: Minecraft ridiculously laggy

Post by Avenger_7 » Thu Mar 07, 2013 8:23 pm

That's not the dumb version, it's the dumb version's retarded nephew.
Image

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Minecraft ridiculously laggy

Post by fr0stbyte124 » Thu Mar 07, 2013 8:47 pm

It's more of the cliff notes of the dumb version's retarded nephew.

User avatar
Laserbilly
Ensign
Ensign
Posts:299
Joined:Sun Dec 09, 2012 8:31 am

Re: Minecraft ridiculously laggy

Post by Laserbilly » Thu Mar 07, 2013 9:13 pm

fr0stbyte124 wrote:It's more of the cliff notes of the dumb version's retarded nephew.
Well, thanks again. How's it going for you?

User avatar
fr0stbyte124
Developer
Posts:727
Joined:Fri Dec 07, 2012 3:39 am
Affiliation:Aye-Aye

Re: Minecraft ridiculously laggy

Post by fr0stbyte124 » Fri Mar 08, 2013 12:59 am

Poorly. My time management skills are the stuff of legend, and not the flattering kind. I've got a demo at work I'll be up tonight finishing, and it looks like the 20th is the deadline for the final project. Until that is taken care of, I doubt I'll get to touch FC. My weekends are mostly spent sleeping.

Locked