Billy Keyes – Project 3 – Box Fort
Introduction
I took the long route to get to this project. If you look at my proposal, you’ll see that I initially wanted to grow buildings in response to light. I still want to do that at some point. But as I started to explore the field of procedural generation and computational architecture, I soon ended up well beyond what I could accomplish in two weeks. After spending several days trying to figure out what I meant by “grow a building in response to light” and how I might actually do that, I decided it was time to re-evaluate.
There were three parts to my initial idea, and any one of them could have been the basis for a project. I decided that I was really interested in some combination of form generation and experience/emotion generation (the original seed of the building idea was the emotional response of being in a room that makes excellent use of natural light). Around the same time, I had also been reading about alternative playgrounds, and thought that some kind of algorithmic playground would be a fun thing to build.
But with time running short, playground equipment and landscapes had many of the same problems as generating buildings. So I started where I imagine many architects start: in their basement with a lot of cardboard boxes.
Box Fort
[vimeo https://vimeo.com/37590932 w=600&h=340]
Box Fort generates 2D layouts for cardboard box forts with the help of a genetic algorithm. The generated forts are tree-like, with long tubes branching into smaller passages. Every fort has a dedicated entrance box, and some have one or more additional entrances or exits. While the layouts are only drawn in two dimensions, care was taken to ensure optimal fort-itude if the layout was realized with actual boxes; gaps in the layouts should be covered by box flaps.
I admit up front that this is probably not the best use of genetic algorithms. In many ways, the problem is under-constrained and the algorithm has too much freedom. But I think the results are fun and interesting and surprising. And perhaps more importantly, it was a good place to experiment; complicated enough to be interesting, but simple enough to be achievable.
In the 2D layouts, the green dot is the starting box, the black dot is the desired start locations, any purple dots are additional entrances, and the blue lines overlaid on the boxed show orientation.
Technical Details
The most important technical aspect is probably how the genotype is designed. I ultimately decided on a mash-up the the directed graph Karl Sims used in Evolving Virtual Creatures and the “array-of-values” approach which Daniel Shiffman describes in The Nature of Code. There are actually four different representations of the fort in the program. First, is the Genome
, which is an array of floating point values. The genome determines how to build the Tree
form. This has the same topology as the actual fort, but without any geometric constraints. Finally, the tree form is parsed into FortGeometry
, which is where fitness and validity are measured. It’s straightforward to draw the geometric form on the screen, giving the fourth representation.
The genome is designed so that early sections describe the parts of the fort near the entrance and later sections describe deeper branches. Forts are bred by crossing sections of the genome, although ten to twenty percent of each generation is produced asexually with mutation. Most of the images were produces with a population of 600 to 800 running for 250 to 400 generations. The fittest fort on the last generation is displayed.
As mentioned earlier, there are probably too few constraints to really take advantage of a genetic algorithm. Fitness is increased by total length and number of dead ends (good for hiding!) and decreased by number of boxes, distance from the desired starting point, and number of boxes outside the bounds. Because there are no geometric constraints on the genome, forts which self-intersect are common. These are automatically given zeros as a fitness score. As an aside, intersections are calculated using the Separable Axis Theorem, helpfully described here.
Future Work
As always, many things were not achieved within the deadline. These are some things I’d like to do later:
- Add a GUI for altering parameters in the system
- Spend more time tuning the genetic algorithm
- Add additional constrains, like desired exit locations or furniture to avoid
- Automatically turn the 2D layouts into 3D models
- Actually build on of the forts
Regardless of whether I work more with box forts, I really enjoyed working with genetic algorithms and generative form. I suspect that my final project will be a deeper exploration of these areas, perhaps with some interaction.
————————–
I agree with you that this visually is enough for the generative maps, from a systems point of view. But it would be nice to have a 3D renderer to show the boxes in form. I like the idea of a 3D render that is beautifully shaded versions of shitty old cardboard boxes.
it’s hard to see the connections without showing the overlaps, at least in the small images, some alpha rectangles would help nicely here
“kids like loops” is a good point
^I can see how that would make the generative algorithm harder though
video is a little too fast for me to really see the designs
As a hypothetical next step, it would be fun to let people create several of their own forts and use those as the first generation. I’m not sure I agree that constraing construction to 90º angles is the way to go, but maybe constrain it so that the all corners of any non-endpoint must be touching the corners of another box; that would create really cooly polygonal hollow spaces.
————————-
Interesting that you tried to base a fitness score on”fun”. That really intrigues me as as far as design does. Might have been interesting(given more time) to do a survey as to what others believe a “fun” box fort is.
Thinking of kid’s imaginations as genetic algorithms is interesting.
Did you explore any other forms than a box? I know it’s a ‘box’ fort, but it’s hard to understand what exactly people are looking at or how people would interact with such a structure. Ohh, it’s a tunnel. I think that is the hardest part to understand.
^ I agree, it would be really cool to see the tunnels (without the box gaps) and without knowing what it is, i probably wouldnt guess that this was a box fort.
I think this is a cool idea and it looks like you really worked out the algorithm. Your visual representation could be better. Maybe using a 3D library or representing the boxes as a section instead of the top-down view. Put some kids in for scale.
Great introduction to computational architecture. Your visual representation could really use some more attention I think, if only to help the viewer quickly grasp what’s going on. You could pretty easily convert this to 3D, add 2D flaps, or show little computational kids (blobs) navigating the space. Overall a cool exploration of the territory. I really like how you gradually reduced the scale of your idea to find something achievable within your desired domain.
i think the visualization could be more clear but the actual algorithm and application is pretty interesting. i wonder if pipes would have been a better visual with parts sectioned off for the actual boxes.
This reminds me of Keita Takahashi, the creator of the video game Katamari Damacy, going on to design playground equipment. I know that when I was in architecture school I always wished we could do this stuff. WOuld be great to actually conduct some tests with kids to see if the generations are actually improving!
NEXT STEP: SHEET+CHAIR tent forts
————————-
Cardboard Box Fort Generator!
…. who doesn’t love box forts?!
it seems that there may be too many boxes in the simulation… i cant really imagine a box fort with THAT many boxes…
could i set my own requirments for fitness and iterate on that? like I only have 7 boxes or this much room?
could we have a 3d view?
are the triangle gaps open air ceilings? … like are the flaps on the top or the sides (< you just answered this) What is the black dot on the screen? Would be helpful if you could show for each generation different options and which one was the one actually selected to be most fit. That could be interesting, as now the different objects look random and we cannot see the connection between one generation to the next. It looks like a random series of images. I'm confused about how these are "box forts" -- do kids climb around the outside, or the inside? you should share your explanation about how these are combinations of cardboard boxes for crawling inside. Boxes are easiest to assemble at right angles. Kids love loops. They would be a good part of the fitness function. I think these would probably be fun for kids. I think it would have been a good idea to work a little more on the visual representaton of the boxes, especially closing the gaps that you mentioned. Without doing that it feels too much like randomly scattered boxes when actually there is much more too it. I agree that it might be a lot more satisfying to see the boxes unfolded and in a 3D tunnel view. But I like the variation in structure, and it does seem like a good intro to generative architecture. OH COULD WE EXPLORE THEM ON SCREEN... like "crawl through" the simulation **This would be awesome! ^agreed! could you choose a structure and then print out a building guide so that a parent could help a kid realize the design -------------------------