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

Simple. Don't include custom bricks. We shouldn't rely so heavily on custom bricks anyways

It's still too difficult of a task to do even with default bricks.
Also it'd be slow as hell to do this in torque.
While it's a great idea, it's just too much for this engine.

Simple. Don't include custom bricks. We shouldn't rely so heavily on custom bricks anyways

You're definitely oversimplifying this. For example, consider a wall like this:



The optimal solution would be:



Even for just one corner, it's already close to impossible to figure out unless you want to brute force all possible bricks.

Simple. Don't include custom bricks. We shouldn't rely so heavily on custom bricks anyways
I personally don't think this is a valid assumption to make when designing a mod like this. The default set of bricks is missing a ton of obvious sizes that really should be included, but aren't. On top of that, like Pah said, Torquescript is an agonizingly slow language. With modern computing, it's still an extremely quick way of getting things done; but it's speed simply can't compare to better developed languages like C++ (Lua could also potentially be fast enough). Either way there isn't actually a very good way to go about this. The only way it could really be done is by looping through each brick, and for each brick to compare each available larger brick and to move that brick to each different unit in it's bounds to check if it perfectly encapsulates the surrounding bricks; this will take far too long.
« Last Edit: April 21, 2016, 12:17:06 PM by Pecon »

This is an NP problem, which means there's no way to solve it in polynomial time.  What that means in layman's terms is that as the scale of the problem you want to solve increases linearly, the computational complexity to solve it increases exponentially or even superexponentially.  There's no way to "prune" bad paths, because the optimal solution could actually be on a path that appears bad at first.

As I've said before, the Trench Digging gamemode doesn't actually solve this.  It attempts to, but falls short as soon as you move outside of its operational assumptions.  Once you do, its optimization method actually decays rapidly as it recombines bricks in nonoptimal ways.  Anyone who's played Trench Warfare will have seen this happen; trying to fill in an enemy tunnel will result in a disjointed mess of blocks almost every single time.

plus isn't trench wars almost basically an octree system which makes it that much easier