Hacker News new | ask | show | jobs
by Rohansi 1 day ago
Are you referring to Minecraft Pi Edition that came with Raspberry Pi OS back in the day? The one made in C++ instead of the original Java edition?

> run both server and client when in singleplayer - doubles memory use

When did this change? It's been like that for as long as I can remember. It's actually a very common thing for games to do because it requires less code. Also it doesn't actually double memory use - game content can be shared, textures/meshes/audio is only on the client, etc. The chunk and entity data would need to be duplicated but they should be smaller.

1 comments

1.3, not beta 1.3. Chunk data was traditionally the biggest part of Minecraft's memory use until they added a bunch more garbage.
Interesting they switched after a couple years!

> Chunk data was traditionally the biggest part of Minecraft's memory use until they added a bunch more garbage.

But that's only really because it is extremely light on assets that are typically large in other games.

I'm a bit indifferent about this. Obviously they made a lot of decisions that aren't good for performance but it's a tradeoff. Notch was most productive working in Java so he could pump out updates quicker, and it helped with modding even though builds were obfuscated. NBT helped maintain backwards compatibility of worlds and probably helped with modding too. If they had done things differently then Minecraft may not have been the huge success that it is.

Yes, Minecraft doesn't have a ton of assets and it does have a lot of block data, so they should have optimized the block data and not worried about the rest. Instead they pessimized the block data.

They even managed to pessimize the assets. They did this by, during startup, pre-converting every possible rendering state of every block in the game into a static 3D model made out of Java objects (Vertex, Face, etc). This wastes about a GB of RAM.

Before Minecraft 1.8, blocks were rendered by running block-specific code for each block to render it in the needed state. One function would append a ladder to a vertex buffer, another function would append a cube to a vertex buffer, another one for stairs, etc. Since the same code block would render any material variant and direction variant of stairs, this didn't use excessive memory.

I know that in 1.8, the biggest single waste of models was redstone dust, because it comes in 16 power levels and approximately 3^4 side connection states (connected, not connected, and connected up the side of a block, but not all combinations are possible) which is over 1000 unique models. Not sure if this is still the case.

> Yes, Minecraft doesn't have a ton of assets and it does have a lot of block data, so they should have optimized the block data and not worried about the rest. Instead they pessimized the block data.

Inefficient but surely beneficial to modding.

> pre-converting every possible rendering state of every block in the game into a static 3D model made out of Java objects (Vertex, Face, etc). This wastes about a GB of RAM.

Alternatively, these are the game's assets, so it isn't a waste. Running the code to generate blocks all the time wouldn't be ideal so caching makes sense but I don't know why they wouldn't lazily populate it.