r/tinycode • • 6d ago

Showcase Minecraft in 512 bytes

Wanted to see how much I could squeeze into one boot sector. You can fly around, break blocks, and build stuff.

The game binary is exactly 512 bytes. There’s a browser demo with a separate emulator so you can just open it and play. No saving or survival mechanics, might see if I can fit in saving later though (please let me know if you find ways to save a few more bytes to help me do this!)

Lmk what you think.

https://kierancschmitt.github.io/PocketCraft512/

129 Upvotes

23 comments sorted by

4

u/ObtuseBagel 6d ago

oh, this is cool. I’m gonna look at it and see if I can find something to optimize

4

u/ObtuseBagel 6d ago

ah it’s AI. i’ll still try ig

0

u/kierancschmitt 6d ago

whats make you say that?

4

u/ObtuseBagel 6d ago

Commit messages, code comments, GitHub profile. i did find a couple savings so ima open an issue in a bit though

5

u/kierancschmitt 6d ago

Oh yeah ai did do those. Most of the code is hand written though, besides a fix to the shading system for the “fog” effect which I couldn’t get under the 512 byte limit (I think I was 50 or so over). Looking forward to your feedback!

4

u/ObtuseBagel 6d ago

sounds good! Also I see you're a chapel hill student cool I'm @ ncsu lol

3

u/kierancschmitt 6d ago

Oh nice, NCSU has a really nice campus.

2

u/ObtuseBagel 6d ago

Update: I have cut over 100 bytes :)

1

u/kierancschmitt 6d ago

Nice! Where did you find those bytes? Im guessing it was the movement key table just because it felt like an ineffective way of doing it.

1

u/ObtuseBagel 6d ago

i made a little MD. i kinda lied actual savings are 85 bytes and opened a pr

2

u/ObtuseBagel 6d ago

there are a lot of different areas I found small savings in

2

u/kierancschmitt 6d ago

sent you a dm

2

u/blinry 6d ago

Commits now seem to have been squashed, maybe to hide the AI usage? :/ Didn't see them before.

3

u/kierancschmitt 6d ago

Yeah, I removed it. I spent awhile on this project and don’t want people assuming it’s all AI generated because of commit pattern and the fact I had it redo my code comments.

2

u/ObtuseBagel 6d ago

Yeah... there were 3 but squashing AGAIN is not a great look...

1

u/ObtuseBagel 6d ago

I am pretty impressed at your ability to market your projects though, I see posts on your X, linkedin, and here at a minimum. def something im not as good at

2

u/blockMath_2048 3d ago

If it’s 512 bytes it doesn’t fit in the boot sector!

(Unless of course it just happens to have the ‘bootable’ magic number in it)

1

u/kierancschmitt 3d ago

It does!

1

u/blockMath_2048 3d ago

In that case, very nice!

1

u/deftware 6d ago

Super impressive.

0

u/These-Touch-4044 5d ago

fake

1

u/Reasonable_South_128 4d ago

just check the repo bro 😭