Game Development Reference
In-Depth Information
In some cases interfaces will be defined via data loaded into the aspect. In
this way the engine can request access to arbitrary attributes, usually after as-
certaining that the node represents the desired object using a separate predefined
interface. This allows the engine to map attributes of a node to the inputs of
a script or shader automatically without needing to understand the contents of
either the node or the intended target.
It is usually preferable for the aspect to use the interface to synchronize its
own internal objects with the scene graph rather than perform operations directly
on the shared data. In the case of aspects that wrap APIs, these objects will likely
already be provided and indeed be required to use the desired functionality. This
allows aspects to perform operations in parallel; they are only required to lock
the core of the engine at set points to synchronize their internal data with the
central simulation.
1.5 Common Aspects
1.5.1 Render Aspect
The article “Designing a Data-Driven Renderer” in GPU Pro 3 [Revie 12] de-
scribes in detail the key elements of a render aspect. The design illustrates the
flexibility of the core scene representation in defining objects with a wide range of
concepts, from concrete entities such as cameras or lights to the abstract elements
of the frame graph, used to control the order of rendering. It also describes the
process of interrogating objects to retrieve arbitrary input for shaders.
1.5.2 Logic Aspect
The logic aspect is where any game-specific functionality should be added. This
is the aspect that will interpret objects in the scene graph as the entities they
represent in the game, such as players, enemies, weapons, and power-ups. It will
update the scene using the rules of the game provided.
The way in which the logic aspect is implemented can vary greatly and should
be subject to the needs of the project and the makeup of the team. A programmer-
centric team might want to handle a lot of the logic through code, hiding the
interface to the engine core behind their own entity classes and structures. Al-
ternatively the logic aspect can be completely data-driven, executing script files
attached to the individual nodes and exposing the contents of the attached nodes
as parameters or objects within the script language.
1.5.3 Data Instrumentation Aspect
By implementing an aspect that simply exposes the components of the core
through a simple GUI, users of the engine can directly observe the internal state
of the engine and even edit the values of individual node attributes. Depending
Search Nedrilad ::

Custom Search