Game Development Reference
In-Depth Information
But generally, it's good practice to plan ahead and even draw a scene map or blueprint from which
you can work. Doing this allows you to foresee and correct for structural or logistical problems that
could arise from specific scene arrangements, such as: Won't this level be too large and tedious for
the player to navigate back and forth? Will that enemy be able to fit through that walkway? Wouldn't
a longer hallway add some dramatic tension as the player approaches the final room? And so on.
Once you've completed your scene arrangement (as shown in Figure 2-24 ), consider grouping all
environment pieces under a single GameObject, even if that object is an Empty. This allows you to
move the entire scene by transforming one object, should you want or need to. In addition, it allows
you to apply static batching to the environment in one operation, as we'll see. Before doing so, let's
consider batching in more detail as it pertains to level design.
Figure 2-24. My completed CMOD scene, ready for lighting and NavMeshes
Unity, and most game engines, draw a sharp technical distinction between objects that have the
potential to move during gameplay ( dynamic objects ) and those which will never move or change at
all ( static objects ). Dynamic objects include those such as the player character, enemies, weapons,
vehicles, doors, particle systems, and many more. Static objects include walls, floors, ceilings, tables,
chairs, stairs, windows, mountains, hills, rocks, and more. Typically static objects account for the
majority of scene objects and dynamic objects for the minority (this is not true of every game, but
probably true for most games, and certainly most FPS games). This distinction is an important one for
games and for performance. It influences processes as diverse as lightmapping and navigation meshes.
In short, if an object is static and never moves, then we can mark it as such directly from the Unity
Editor by using the Static check box available for meshes in the Object Inspector. Enabling this for static
objects achieves a range of performance benefits. For example, only static objects can be lightmapped
and only static objects can be baked into navigation meshes. So make sure you enable this for all static
objects; just select the static object and tick the box (see Figure 2-25 )!
 
Search WWH ::




Custom Search