r/adventofcode • • Dec 17 '20

Visualization 2020 Day 17 (Part 1) 3d Game Of Life in Minecraft

Post image
407 Upvotes

29 comments sorted by

37

u/Iain_M_Norman Dec 17 '20

Cool. And part 2? *grins*

22

u/andre-js Dec 17 '20

Ha ha, need to find that 4d Minecraft. I'm sure there's a mod somewhere

11

u/Iain_M_Norman Dec 17 '20

Use the next chunks left and right for z=1 and z=-1 ? Or something along those lines.

Of course that's if each 3d thing stay inside 1 chunk.

6

u/andre-js Dec 17 '20

One option is multiple 3d structures. Each representing one layer of 4th dimension.

8

u/DJDavio Dec 17 '20

Just use the colors / materials as a hidden 4th index!

So, given a 'line' of cubes from w = -N to w =+N, you essentially have a bitmap where each active cube along the line counts as 1 and each inactive cube counts as 0. Then just convert it to the hex value and you have a color.

Example:

There are 5 cubes, x = 0, y = 0, z = 0, w = -2 to x = 0, y = 0, z = 0, w = 2. In order they are inactive, active, inactive, inactive, active. This translates to binary 01001. You can convert this to a color any way you like. :)

Then just give the cube at x = 0, y = 0, z = 0 the color / material you want.

1

u/andre-js Dec 17 '20

That would be cool. Unfortunately I'm still a noob at this and don't know how to set cube colors

3

u/Nicolasv2 Dec 17 '20

Use time as the 4th dimension :D

6

u/Meowth52 Dec 17 '20

Haha, when I read it my first thought was: will someone visualize it in minecraft?

3

u/andre-js Dec 17 '20

Lucky coincidence. Started playing with Minecraft plugins this week

1

u/AntiCheap Dec 17 '20

Done same but I don't know any java, took the occasion to revise my command blocks knowledge.

1

u/andre-js Dec 17 '20

Interesting. How do you run a batch of commands? Never used this approach before

→ More replies (2)

5

u/lukewarm1997 Dec 17 '20

Best visualization yet. I love it!

1

u/andre-js Dec 17 '20

Thank you! Had fun creating it

2

u/zxywx Dec 17 '20

That's pretty awesome!

Your idea of what the Z axis is differs from mine though ;-)

2

u/andre-js Dec 17 '20

Really? How so?

0

u/zxywx Dec 17 '20

Z is usually analogous to height?

3

u/andre-js Dec 17 '20

Oh yeah, it usually is. In Minecraft it is depth

4

u/game_dev_dude Dec 17 '20

In computer graphics space, especially game-dev, it's usually used for depth (given X and Y are used for the two monitor axis in 2D, Z then extends into or out of the monitor).

3

u/Justinwa Dec 17 '20

Username checks out

1

u/DFreiberg Dec 17 '20

I'm guessing you used Carpet Mod to load in the aoc_d17 account?

2

u/andre-js Dec 17 '20

I used https://www.spongepowered.org to create a plugin on the server. Renamed my account to aoc_d17 just before the recording

1

u/DFreiberg Dec 17 '20

Ahh, gotcha. It's a nice little touch.

1

u/Autom3 Dec 17 '20

Hah, I just did this with WorldEdit and the generate command :P

0

u/[deleted] Dec 17 '20

[deleted] — view deleted comment

2

u/andre-js Dec 17 '20

That's a great optimisation! I've been mining the blocks this whole time