Game Development Reference
In-Depth Information
the next stage of development is to create abstracted assets. That is, to use the raw and imported
assets (the asset files) to create any further or more complex assets inside the Unity Editor. One such
asset is the Prefab . In short, the Prefab allows us to drop a collection of assets, like meshes and
scripts, into the scene to compose a more complex entity or thing. Based on that, we may create
an asset, which can thereafter be treated as a complete and separate whole. Prefabs are especially
useful for building modular environments, which is how they'll be used here for CMOD. But they're
not limited to simply environment assets: any time we have a collection of objects that work together
as a complete entity, we can use a Prefab. They save us from building and rebuilding similar objects
across different scenes, and even within the same scene.
Note More information on working with Prefabs can be found in the online Unity documentation at
http://docs.unity3d.com/Documentation/Manual/Prefabs.html .
The meshes imported into the Project at steps 3 and 4 consist almost entirely of environment pieces ,
and not complete environments (see Figure 2-4 ). Specifically, these pieces include individual items of
furniture, such as file cabinets and desks, and architecture and props like corner sections, crossroad
sections, T-junctions, and door sections. These pieces are designed to be instantiated in the scene,
where they may be combined and recombined into unique arrangements to form more complete and
seamless environments. To form an analogy, we'll build our game environment from mesh pieces
directly in the Unity Editor, just as physical statues and models are made from Lego bricks—or other
kinds of interlocking blocks that are fitted together. This building-block method of level creation is
often called the modular method because each environment piece is seen as a module in a larger set.
Of course, you can alternatively build a single and huge environment inside your modeling software
of choice, and then import that into Unity as a final and unchangeable mesh. There's nothing
“wrong” or “incorrect” in doing that per se—it can work. But doing that comes at the cost of
flexibility and versatility, as well as performance. By importing separate and reusable environment
pieces instead, you can recombine them together into a potentially infinite number of environment
combinations. This allows you to assemble many different levels from the same, basic mesh
ingredients. Plus, it works better with Occlusion Culling.
Tip If you need to make large and complex levels (and maybe many of them), then be sure to make the
modular building method your friend. It can save you lots of time. Plus, it's a really fun and easy way to build
levels, assuming you enjoyed playing with building blocks!
Note More comprehensive information on the modular method of level design can be found in my book
Practical Game Development with Unity and Blender (Cengage Learning, 2014), and also in my 3DMotive
online video course, “Creating Unity-Ready Modular Environments with Blender.”
 
Search WWH ::




Custom Search