Live data from Hacker News

Custom Minecraft Classic client written from scratch in C

github.com

21–30 of 80 posts

Re: Custom Minecraft Classic client written from scratch in C

#22
post #6

I feel like this is one of those projects missing missing an important "Why" section. It's an interesting project, but from the outside, I don't immediately understand why someone has done all this effort. Huge Minecraft classic fans? Programming exercises? Is it about porting to as many platforms as possible? This is the version they are forced to make to not get their pants sued off?

Microsoft’s made account management annoying and shitty and unreliable—like, they make it weirdly hard just to buy the damn game —for MC Classic. I’d love a way to sidestep them. It’d make my life easier. We already own four or five copies of the game, so I’m not even talking about piracy. Plus their fucking launcher phones home to any of a whole bunch of IP addresses, refusing to launch the game if those requests fa…

Minecraft Java can be run fully offline without their launcher, and servers can be run with authentication disabled. There's no need to rewrite the whole game ...

Re: Custom Minecraft Classic client written from scratch in C

#23
post #22

Earlier quoted context omitted.

Microsoft’s made account management annoying and shitty and unreliable—like, they make it weirdly hard just to buy the damn game —for MC Classic. I’d love a way to sidestep them. It’d make my life easier. We already own four or five copies of the game, so I’m not even talking about piracy. Plus their fucking launcher phones home to any of a whole bunch of IP addresses, refusing to launch the game if those requests fa…

Minecraft Java can be run fully offline without their launcher, and servers can be run with authentication disabled. There's no need to rewrite the whole game ...

For real? Ok yeah I need to do that. Shit’s obnoxious and just another way for things to go wrong if all you’re trying to do is local games and local-network multiplayer. I assumed they’d made it impossible to run without the launcher—if you can, it seems to kinda defeat the whole purpose of all the phoning-home (though I think a lot of that’s after it starts, too, so am not sure if this approach will end up helping)

Re: Custom Minecraft Classic client written from scratch in C

#24

I’m a bit short on time and can’t dig into the code, but maybe somebody can answer this for this or the original version: In what data structure are the blocks in Minecraft actually stored? And by which mechanism are they quickly retrieved to check which block the player was hitting? I would think the model partitions the space with an octree and their position jumps from parent node to parent node. Then at each bit…

Why would you need a tree?

You always know the location of the player in x,y,z. The world is extremely regular, first you figure out the co-ordinates of what you are hitting, then you do a direct lookup of that from the world, with like a single top-level hashtable that links to large fixed-size segments. This will be dramatically faster than any tree.

Re: Custom Minecraft Classic client written from scratch in C

#25

This is great. It would be cool to do this in Rust and run on WASM.

Literally on the README: https://github.com/UnknownShadow200/ClassiCube#web

NO it is NOT.

I said RUST to WASM.

That link is just for compiling C with JavaScript interropts.

I was simply commenting that:

'hey that is cool you did this with C'

'wow, this seems like it would also be a cool exercise to do with Rust'.

Re: Custom Minecraft Classic client written from scratch in C

#26
post #22

Earlier quoted context omitted.

Microsoft’s made account management annoying and shitty and unreliable—like, they make it weirdly hard just to buy the damn game —for MC Classic. I’d love a way to sidestep them. It’d make my life easier. We already own four or five copies of the game, so I’m not even talking about piracy. Plus their fucking launcher phones home to any of a whole bunch of IP addresses, refusing to launch the game if those requests fa…

Minecraft Java can be run fully offline without their launcher, and servers can be run with authentication disabled. There's no need to rewrite the whole game ...

Can't run it without their launcher last I tried. How? (I own the game since beta but I can't be bothered to deal with MS anymore)

Re: Custom Minecraft Classic client written from scratch in C

#28
post #22

Earlier quoted context omitted.

Minecraft Java can be run fully offline without their launcher, and servers can be run with authentication disabled. There's no need to rewrite the whole game ...

Can't run it without their launcher last I tried. How? (I own the game since beta but I can't be bothered to deal with MS anymore)

via third party launchers. some of them can also handle modpacks, shaders, optifine, LAN multiplayer, etc:

https://github.com/huanghongxun/HMCL

https://github.com/PojavLauncherTeam/PojavLauncher

https://github.com/PrismLauncher/PrismLauncher

Re: Custom Minecraft Classic client written from scratch in C

#29

Great project, why though the insistence on no survival mode? > It does not have a survival mode (nor will such a mode be added) https://github.com/UnknownShadow200/ClassiCube#what-classicu...

Because it is a recreation of classic 0.30 that used to be on the minecraft website, which did not have survival

Re: Custom Minecraft Classic client written from scratch in C

#30

I’m a bit short on time and can’t dig into the code, but maybe somebody can answer this for this or the original version: In what data structure are the blocks in Minecraft actually stored? And by which mechanism are they quickly retrieved to check which block the player was hitting? I would think the model partitions the space with an octree and their position jumps from parent node to parent node. Then at each bit…

https://minecraft.fandom.com/wiki/Anvil_file_format

https://minecraft.fandom.com/wiki/Chunk_format

The main unit of minecraft storage is the chunk, which is a 16x16xWorld height area of the map. Chunks are bundled into groups of 32x32 chunks for storage on disk. Minecraft keeps a map of chunks for an area of (configured render distance + 3) chunks in memory, and pages these in and out as you move around (including generating new chunks if you reach a chunk that's never been generated before).

Chunks themselves are subdivided into 16x16x16 sections of blocks by vertical height.

So the process is:

1. Find chunk containing co-ordinate (maths + dict lookup) 2. Find array containing data based on y co-ordinate (basically an array lookup) 3. Find block in array (another array lookup)

There's also various data of more variable size (e.g. lists of entities, structures, etc.) tacked onto the chunk format. These tend to be much smaller in number for any given chunk, so my understanding is these are basically just linearly searched or iterated on a per chunk basis when required.

Post reply on HN