Author Topic: De-spam bricks by combining them.  (Read 1955 times)

If this script hasn't been made them I'm looking for something that can combine every small same colored brick next to each other and morph it into the biggest possible brick possible to shorten the brickcount significantly.

It's a pretty good idea, and it's been suggested before, but this isn't easy at all

I know the old creeper gamemode use to combine extra creeper bricks to reduce brickcount.

I know the old creeper gamemode use to combine extra creeper bricks to reduce brickcount.
it didnt have to check for brick sizes or brick color, just if the brick is a creeper brick. It could assume it was stuck to a certain grid like in trench wars, and not check for alignment or color.

what if you have three 1x1f stacked next to a 1x1? what about 3 16x baseplates stacked? what if switching the bricks causes some to float? its hard to define what conditions to swap bricks that is optimal/works, without taking an ass long time to do it and complicated code

it didnt have to check for brick sizes or brick color, just if the brick is a creeper brick. It could assume it was stuck to a certain grid like in trench wars, and not check for alignment or color.

what if you have three 1x1f stacked next to a 1x1? what about 3 16x baseplates stacked? what if switching the bricks causes some to float? its hard to define what conditions to swap bricks that is optimal/works, without taking an ass long time to do it and complicated code
In the first scenario, the script would first swap the 3*1f with a 1x1, then on the next cycle would combine them into a 2x1. In the second, I guess it depends on if the server has a 16x16x1 brick.

what if you have three 1x1f stacked next to a 1x1?


Simple it would combine smaller bricks first then bigger bricks.

So 3 1x1f will morph in 1 x1 normal and then it will morph into a 1x2 with the other 1x1.

In the first scenario, the script would first swap the 3*1f with a 1x1, then on the next cycle would combine them into a 2x1. In the second, I guess it depends on if the server has a 16x16x1 brick.

Try writing this and see how well it works in practice

If it was simple, it would of already been done

In the second, I guess it depends on if the server has a 16x16x1 brick.
But what about 8x16x1? what if the baseplate is supported by only one brick, in the corner?


Simple it would combine smaller bricks first then bigger bricks.

So 3 1x1f will morph in 1 x1 normal and then it will morph into a 1x2 with the other 1x1.
well, obviously. but what if the 1x1 stack next to it is offset by a plate?
that is one of the most basic of edge cases. here, lets try a few more:

1x2 next to stack of 1x10f plates next to a 1x6, all in a line. Which to replace? If 1x6, to form a 1x16, what happens if you encounter the 1x2 next to the 1x10f stack first, when iterating through the bricks to replace? How could you tell if there's a better replacement later? Is a bigger brick necessarily better?

1x2 in line with a 1x6, but next to a 1x3

(top down)
bbcccccc
aa
aa
aa

Which to replace? They're the same size, if you go by volume.

What if you have a 1x1f, on top is a 1x1. This is next to a 1x2. Do you detect that you can shift the brick on top down, replace it with a 1x3, and put a 1x1f on top?

these should be more than enough to illustrate how difficult this is.

If it was simple, it would of already been done

Creeper and digmod both do it.

Creeper and digmod both do it.
because they can make assumptions about the bricks they're merging

e.g. they will always be a brick, not a plate. or a cube, not a brick.
the bricks are also locked to a grid - you won't have any situations like the last one in my last post where you have a plate offset that may forget with the combiner code.

Somebody over at ScatteredSpace made one that actually worked with any type of brick. Can't remember who, though.

Creeper and digmod both do it.
How come one isn't released yet? They're using a grid so it's actually easier to convert bricks

Somebody over at ScatteredSpace made one that actually worked with any type of brick. Can't remember who, though.
I can believe that, but I wonder who

I was thinking of this idea yesterday, but I also had the idea that if you placed a brick within the other brick, the brick already placed would break into separate pieces to fit in that brick you placed

I was thinking of this idea yesterday, but I also had the idea that if you placed a brick within the other brick, the brick already placed would break into separate pieces to fit in that brick you placed
much easier but also generally less practical

anything of this sort really is hard to do cause of the various custom brickpacks that exist. the only reason mirroring on the new dup works is cause zeblote went full legit and did BLB/DTS brown townysis to detect the shape of the brick in question - it easily is more complicated than the actual dup code itself.