Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualcaldiar

Posted 15 November 2012 - 02:10 PM

Take a look at quadtrees. As your level format is already a 2D grid, this would be ideal for quickly determining the largest possible box you can make out of the smaller boxes. The idea is similar to Waterlimon's.

Starting from the root node, you would drill deeper into the tree until a node has no empty children or you've met a maximum depth. If all 4 children of a node contain data (boxes) then it's safe to represent that as a single block.

Here's a visual, interactive example - http://donar.umiacs.umd.edu/quadtree/regions/regionquad.html

#2caldiar

Posted 15 November 2012 - 02:10 PM

Take a look at quadtrees. As your level format is already a 2D grid, this would be ideal for quickly determining the largest possible box you can make out of the smaller boxes. The idea is similar to Waterlimon's.

Starting from the root node, you would drill deeper into the tree until a node has no empty children or you've met a maximum depth. If all 4 children of a node contain data (boxes) then it's safe to represent that as a single block.

Here's a visual, interactive example - http://donar.umiacs.umd.edu/quadtree/regions/regionquad.html

#1caldiar

Posted 15 November 2012 - 02:09 PM

Take a look at quadtrees. As your level format is already a 2D grid, this would be ideal for quickly determining the largest possible non-concave box you can make. The idea is similar to Waterlimon's.

Starting from the root node, you would drill deeper into the tree until a node has no empty children or you've met a maximum depth. If all 4 children of a node contain data (boxes) then it's safe to represent that as a single block.

Here's a visual, interactive example - http://donar.umiacs.umd.edu/quadtree/regions/regionquad.html

PARTNERS