Author Topic: Weird problem with large bricks.  (Read 940 times)

   I made a maze generator.  And it generates mazes, n stuff.  I originally made it using some 24x maze bricks I made a while back, and it worked fine.  But I wanted to scale it up to use something larger.  SO i made a converter to turn it into maze bricks of the 64x cube style.
   The converter took forever to make and probably wouldn't have been worth it if I had only used it once.  Buuut Once I got it working and in the game, and generated the maze.  It took forever to load the maze in via save file.  And lagged like a bitch the entire time.  I'm talking 3-4 seconds between frames here.  Using the 24x bricks it lags some.  But not THAT much.
   Since I have a converter it takes only a few minutes to make a brickpack of a different size(that's 23 bricks w/brick collision all written up).  So I tried a few different sizes.  54x, 32x, 18x, 12x.  Only the 12x seems to work without any problems.  And it's still affected by this weird quirk:
   If I put a tiny gap between the bricks.  It'll load 8000 bricks in .68 seconds.  No matter the brick size.

   I don't get it.  I really don't.  Is it the brick collision?  Like, when I place 1 brick next to another is it spending a bunch of time calculating how many cells on it's side are covered?  Or is it just spending a bunch of time setting the inside of the brick as a place you can build?
   Or is it just ghosting?  Are the bricks so large they span multiple chunks, so it has to do multiple table lookups or-  I don't know.

I've run into this problem before when I tried to make a terrain generator using 64x terrain bricks.  The generator worked fine, but the loading- god.  You move a few bricks over and it'd take a good 2 seconds to load the next sliver of terrain.  Teleporting around the map didn't help much because you have to sit at the next point for a good half minute for it to load, and it wasn't consistent, so you couldn't make it automatic without wasting a bunch of time. :P

My best guess is that it's calculating the coverage area on the sides.  Taking into account that leaving a gap helps a ton.  It would make sense too, since for a 64x cube, thats (64*2.5)*64=10240 for each side and then 4096 for the top and the bottom leaving us with a grand total of 49152 cells to calculate per brick.  Which would explain 3-4 seconds between frames.

btw, when I talk about brick collision I'm talking about a brick's collision with other bricks.  Like how you can't place a 1x1 in a 2x2.  But you can place a 1x1 in that empty slot in that weird L shaped brick you can find near the 2x2 in the brick menu.

checking 50k collision cells for 1 64x64 sounds like bullstuff. i heavily doubt that blockland would be able to handle that even on a really small scale, and it sounds really impractical as well

64x cubes don't use coverage for the exact reason you thought of, so that shouldn't be the problem. Placing it also doesn't have to check many cells due to the oct tree structure.

I can't tell you what the problem is, though.
« Last Edit: August 05, 2015, 08:37:24 AM by Zeblote »

64x cubes don't use coverage
I'm not using 64x cubes.  These bricks are hollow on the inside.  With brick collision written up.

But still if 64x cubes don't have the same loading problem maybe I could use that.  I should at least test it.  It might be better to get rid of the custom bricks entirely and just go for regular bricks, built in an array.
That would be Top, Top Frame, Side, Side Frame.  Wow.  Only 4 bricks. 64x64x5 62x2x5 60x2x150 2x2x150

Would definitely increase the brick count though.  Highest increase would be 1:16.

I 6  -2
L 6  -2
P 4  -4
T 5  -3
DE 7 -1

U 4  -3
D 4  -3
UD   -0
X     -6

I 1:8 1:11 1:11 1:14
L 1:8 1:11 1:11 1:14
P 1:6 1:9 1:9 1:12
T 1:7 1:10 1:10 1:13
DE 1:9 1:12 1:12 1:15
U 1:13
D 1:13
UD 1:16

Avg increase of 1-11.
Maze size 20 yields 8000 bricks normally which would turn that into 88000 bricks.

If I set the increase to 1-12 the maximum maze size goes from 101 to 44.
Which isn't, bad.  It takes so long to generate mazes past size 25 anyway...

I still have no idea what you're doing with those bricks, maybe some screenshots would help. Why are they hollow?

I still have no idea what you're doing with those bricks, maybe some screenshots would help. Why are they hollow?
I assume his maze is made with those hollow bricks. Four different bricks, one has two parallel walls (Straight), another one has two perpendicular walls and a column (corner), one has a straight wall and two columns (T), and one has four columns (X) su he uses those bricks instead of building the maze with bricks. Can't know for sure until OP posts how he's making the maze or screenshots of the maze.