You are on page 1of 4

Source Code: https://bitbucket.

org/gsp4202015/gameengine/src
Graphics
The game engine uses the DirectX 11 API to create 3D and 2D graphics.
Managers
Texture Manager:
The texture manager is used to manage the texture assets that are loaded into
memory at any given time. Loading only the relevant texture allows the clearing up
of memory for other processes. The textures are cleared or loaded at the beginning
of each level or game state. For instance, the textures used for the main menu are
the only textures that are loaded at that time and are cleared afterwards because
they are no longer used in the application.
Shader Manager:
The shader manager manages the shader assets that are used in the
application. The only shaders that are loaded are the ones that are being used in
certain areas or levels. When they are no longer needed they are erased to clear
memory for other processes. For instance, a level that takes place inside of a
building and does not require a skybox will not load the skybox specific shader
because it will not be used.
Mesh Manager:
The mesh manager operates the same as the other managers by only loading
the necessary assets for a given area or level. Each entity has a mesh component
and those that share the same mesh share an instance of the single mesh object.

Shadow Mapping
Shadow mapping is a fairly easy way to create dynamic shadowing in a
graphics application. The shadow mapping algorithm works in two passes through
the pipeline. First, the scene is rendered from the point of view of the light source
and the distances are rendered to a texture. Then, the scene is rendered with the
cameras point of view and a test is done to check if the current pixel is further from

the light source than the distance stored in the texture. An orthographic matrix is
used in the case of a directional light because the light source is considered far
enough away that the light rays are parallel to each other.

Skybox
The skybox is used to create a background for a graphics application. It is a
simple cubic skybox that surrounds and follows the camera and is always rendered
behind all of the other objects in the scene. This is how the effect of never getting
closer or further to the sky is created. In advanced skyboxes, the skybox moves
with the camera but at a different speed to give off the illusion that the skybox is
not infinitely far away. This was not included into the project because a simple
skybox would work fine considering there is no night/day cycle and no distant
objects.
Frustum Culling
The three dimensional area on the screen where objects are rendered is
referred to as the viewing frustum. Everything that is inside the viewing frustum is
rendered to the screen by the graphics card and everything outside of the frustum is
examined by the graphics card and then discarded during rendering. Depending on
the graphics card, the process of culling done by the graphics card can be
computationally expensive when there is a large scene with multiple polys. This is
because the graphics card must examine every single poly to remove the polys that
are not in the viewing frustum even if there are only a few polys in view. This is
avoided by using frustum culling to determine if an object is in the viewing
frustum before it is sent to the graphics card so that we can cut down on the
number of polys sent to the graphics card. The way this optimizing feature is
utilized in my DirectX 11 application is by breaking the large terrain up into
different quadrants so that the quadrants can be culled when they are not in the
viewing frustum.

Physics
The game engine utilizes a 3D physics engine built from scratch in C++. Its
main features are 3D collision detection and response between convex shapes. It
accomplishes this by utilizing custom implementations of the Gilbert-Johnson-

Keerthi distance and Expanding Polytope algorithms. The physics engine also
includes an implementation of the quickhull algorithm which generates a convex
hull from a set of points. This is used to generate the collision volumes for arbitrary
shapes

A.I.
Messaging System
The messaging system helps maintain the flow of events that occur during
simulation by comparing the delay times and inserting each message into a priority
queue accordingly.
Finite State Machine
Essentially a finite state machine (FSM) consists of a finite number of states
for each type of entity. The FSM class updates each entity's current state and
controls the switches between states.
Steering Algorithms
Individual steering behaviors such as seek, flee, pursue, collision avoidance,
and arrive.
A* Pathfinding
A* (A-Star) is an upgraded Dijkstra algorithm. The only difference is the
addition of a Heuristic value (H) to the distance value (D) giving use a value (F). F
=G+H
Logic System
Influence Map:
Influence maps ultimately help the AI make better decisions based on the useful
information it collects about the world. Influence maps provide three different
types of information that are particularly useful for decision making.
Current Situation - Influence maps do a great job of summarizing all the
current details in the world and making them easy to understand. Who's in

control of what area? Where are the front lines of conflict? How many
enemies are in a certain area?
Historical Statistics - Not only can it store information about the current
situation, but influence maps can also be used to remember the outcome of
past events. Was this area under attack? How well did attacks on this area
go?
Future Predictions - Influence maps can also help predict the future by using
the map to understand where enemies influence will extend at a later time.
Fuzzy Logic:
Fuzzy Logic is an AI logic system that handles approximate reasoning rather than
traditional binary sets (true or false). Fuzzy logic variables may have a truth
variable that varies in degree from 0 to 1. 1 being completely true and 0 being
completely false leaving a gray area where the variable can be defined as both true
and false to a certain degree. Fuzzy logic systems can be thought of as more
similar to how a human brain operates by forming a number of partial truths which
we assign to higher truths which the brain weighs and makes certain decisions.

Multi-threading
The multi-threading model that was used in the game engine at the top level
is a task parallel model. We divided the tasks in the game loop into tasks that could
be completed in parallel and could operate independent of each other. Some of the
systems, like the collision detection and resolution, use a data parallel model where
the functions are called on different portions of data at the same time.

You might also like