Game Development Reference
In-Depth Information
9 Scripts
10 User control
11 Texture objects
12 Sounds
13 Collision boxes
14 Interactive behaviours
The design of the data needs to be as flexible as possible. Let's consider
the main data members.
Meshes and morph targets
A mesh must know about its own topology. The simplest way to store a
mesh is as a vertex list and a polygon list. The polygon list defines a
polygon using indices into the point list, together with a surface ID, which
is an index into the surface list. But a surface list could be global, scene
level or mesh level. If the surface ID is a 32-bit integer, then we could use
the top 2 bits to flag to which surface list the ID refers; a surface that uses
a bitmap texture is quite demanding of resources so should be shared
wherever possible. When dealing with character animation, complex and
repeated animations can be handled easily with morph targets. In the
accompanying software Toon3D Creator the morph targets are saved and
loaded by the mesh object. In a complex and involved game, the central
characters may require many morph targets for a face. Different targets
may be required as the player moves through the game. The scene class
needs the ability to use some targets and not others. A simple way to
provide this facility is to check the animation that has been created and
test for any targets that have zero level throughout the animations within
a scene. If this is the case then these targets are unnecessary within that
scene. But if the scene is then saved excluding these morph targets, it will
be more complicated for a developer to change the animations to use
them again. This leads to an interesting conclusion. The scene file that a
developer needs to save is different from the scene file that an end-user
needs to load. A developer needs the ability to change tack and revise the
animation and interactivity, while the end-user just needs the minimum
necessary to display the appropriate meshes, at the right time, with the
correct deformation. Toon3D Creator uses project files and published
files. In the next and final chapter we will look at how we can compress the
final end-user files using simple compression techniques. For now, we will
be more concerned with creating a structure to store everything and less
concerned with keeping the data size small.
Search Nedrilad ::

Custom Search