GraphCraft is available on the Unity Asset Store.
GraphCraft is probably best understood by seeing it in action, even just 30 seconds of action. Please see the GraphCraft in 30 Seconds video.
GraphCraft is a Unity asset that uses graphs—constituted by vertices and edges—to construct recursively-describable bodies. This is a hybrid approach between procedural generation and manual creation. The graphs are created manually then used to automatically construct a new procedurally generated object according to simple rules. Unity developers can design symmetric multi-segmented composable bodies using the familiar Unity Editor tools. The Graph Preview shows what effects one’s edits have in real-time. The Graph Constructor instantiates the game objects according to the graph.
There are three examples:
Example Sceneshows progressively more complex graphs and their results. a) The “Snake” shows a graph with one vertex and one edge that connects back to itself. b) The “Tree” shows a graph with one vertex and two self-edges; the vertex also is a rigid body with a hinge joint with limits enabled so it sags after construction. c) The “Quadrapus” shows a composite reusing the “Snake” to create four legs. It has a rigid body, hinge joint, and a script that causes its motors to flex sinusoidally. d) The humanoid has 3 vertices and 7 edges and shows how one complete design may be easily replicated into a “family” of different sizes.
Centipede Examplescene is the result of an introduction and tutorial video to GraphCraft made for Mockup Monday #34.
30 Seconds Examplescene is the resulting scene used in the video GraphCraft in 30 Seconds.
You can use GraphCraft to build lots of things: trees, quadrupeds, fish, snakes, broccoli, flowers, buildings—anything that has a recursive or fractal, reuse-of-parts at differing scales is admissible and many animals and plants do. My foremost interest in GraphCraft is to use it for is building interesting robot bodies, so it’s a robot construction kit for me, but it’s just as capable as a flower generator for someone else and an architecture motif explorer for yet another person.
GraphCraft exposes a set of tools under the menu
Components->GraphCraft that enables you to create graphs—that is
vertices and edges—in the Unity Editor. To create a “Snake” from the
Example Scene for example, one would do the following:
- Create a cube.
- Select the cube.
- Add a vertex by selecting the menu item
- Add an edge connected to itself by selecting the menu item
Components->GraphCraft->Connect To Self.
- Add a preview by selecting the menu item
- Select the edge and scale, rotate, or translate it to one’s liking.
- Adjust the edge’s count so that multiple segments of the snake will be created.
- Add a constructor by selecting the menu item
Components->GraphCraft->Construct Graph. Hit play to construct.
Please see Mockup Monday #34 for a video tutorial.