Components of Game Engines assignment PDF

Title Components of Game Engines assignment
Course Games Programming
Institution Nottingham Trent University
Pages 18
File Size 812.3 KB
File Type PDF
Total Downloads 24
Total Views 151

Summary

In this essay, I talk about the different components within a game engine such as;
Culling methods,
Rendering techniques,
Miscellaneous Graphic Techniques etc....


Description

COMPONENTS OF GAME ENGINES Unit 70: Computer Game Engines

Contents Task 1 – Culling Methods.......................................................................................................................3 Overview........................................................................................................................................3 Portal Based...................................................................................................................................3 Back-face........................................................................................................................................3 Occlusion.......................................................................................................................................3 Contribution..................................................................................................................................4 View Frustum.................................................................................................................................4 Binary Space Partitioning (BSP)......................................................................................................4 Task 2 – Rendering Techniques..............................................................................................................5 Overview........................................................................................................................................5 Ray Tracing.....................................................................................................................................5 Radiosity........................................................................................................................................6 Task 3 – Miscellaneous Graphic Techniques..........................................................................................7 Lighting..............................................................................................................................................7 Spot lights......................................................................................................................................7 Ambient Lights (Infinite lighting)....................................................................................................7 Point Lights....................................................................................................................................7 Textures.............................................................................................................................................7 Bump Maps and Displacement Maps............................................................................................8 Anti-aliasing Technique......................................................................................................................8 Level of Detail....................................................................................................................................9 Process of Shadows...........................................................................................................................9 Fogging and Depth testing.................................................................................................................9 Fogging..........................................................................................................................................9 Pixel and Vertex Shaders..................................................................................................................10 Pixel Shader.................................................................................................................................10 Vertex Shaders.............................................................................................................................10 Task 4 – Animation Systems.................................................................................................................11 Path Based Animation..................................................................................................................11 Particle Systems...........................................................................................................................11 Inverse and forward Kinematics...................................................................................................12 Inverse Kinematics.......................................................................................................................12 Forward Kinematics.....................................................................................................................12 Task 5 – Artificial Intelligence...............................................................................................................13

Role of AI agents in games...............................................................................................................13 Bots..............................................................................................................................................13 Non-player Characters (NPC).......................................................................................................13 AI Agents Navigation........................................................................................................................13 Path finding and obstacle avoidance...........................................................................................13 Behaviours...................................................................................................................................13 AI Based...........................................................................................................................................14 Neural networks..........................................................................................................................14 Fuzzy Logic...................................................................................................................................15 Task 6 – Middleware/ Off the shelf Components.................................................................................16 Bibliography.........................................................................................................................................17

Game Engines Components Part 1: Graphics Rendering

Task 1 – Culling Methods Overview The purpose of a culling method is the process of not rendering something that is not needed (Something that will not be shown in the final render). This helps with performance rates and optimization. A lot of the culling methods are done within the CPU (Processor) and GPU (Graphics Card). There are many different types of culling methods. When a system is rendering, it usually renders from the objects furthest away first and then the closer objects are then drawn on top of them because they are in front.

Portal Based A portal in portal based culling is something such as a window or a door. Portal Based Culling is the process of rendering the image that is seen through a portal or by not rendering something when the portal is closed. For example, if the game level has a door. The door is open, the player is able to see what is on the other side of the door in which the game will render the view so that the player can see into the next room whereas if the portal is closed (closed door), the game will not render the level which is behind the door because it isn’t necessary.

Back-face Back-face culling is the process which is used to reduce the polygon count in a scene through the polygons that are not facing the viewport because they are not as important as what is facing the viewer. By removing the back facing polygons, this process will help with the performance on the system.

Occlusion Occlusion culling is a method in which it disables rendering the objects/image that is not seen from the viewpoint because they are blocked by other objects.

Contribution When a final view is rendered, there are some times objects that aren’t as visible by the viewer and because they don’t contribute to the final image enough, they are usually just disregarded because they are not needed.

View Frustum A view frustum in a video game is the region in which will appear as the final image displayed on the viewer’s screen (Image below shows a view frustum).

View frustum culling is the process in which, when the game is being rendered, the culling method removes the objects that are outside of the viewing frustum because they do not need to be rendered because they won’t be shown on the screen.

Binary Space Partitioning (BSP) A BSP is the method in which it divides/splits parts of the scene into different regions and then arranges them individually. By doing this, the chunks (split section) that aren’t visible on the screen are removed because they are not needed and by doing this, it allows the game to archive the sections which then can be redrawn again if need be. Some video game engines use this feature such as the Doom engine. It is used to generate the level date before the need of rendering so that when the game needs to render that scene, it can be done so quickly and easily. Each Level is broken up into sections and made as nodes and sub nodes so that when they are needed, they can be used.

Task 2 – Rendering Techniques Overview Rendering within a video game is the process in which the game will display the image through the screen whether it being a 2D or 3D display.

Ray Tracing Ray tracing is a rendering technique that creates the image by tracing the path of light through pixels in an image. A lot of the time, rendering is usually done by a technique called “rasterization” which is basically the process of rendering a 3D environment/scene to a 2D display such as a monitor or television. By using ray tracing, it allows objects to react to light and atmosphere giving a more photorealistic feeling to the game. Ray tracing can affect objects by; absorbing and reflection etc.

The image above shows a 3D scene that is rendered with Ray Tracing giving it a more realistic feeling through the lighting effects on the objects. The images below show how the process of ray tracing works.

Radiosity Radiosity is a rendering technique that is used with physical materials to react such as reflection. “As an example, let’s consider the intersections of two walls in a corner (i.e. orthogonal to each other), one painted white and the other red. From real experience we know that when this scene is illuminated by some light source, we won’t get a simple red wall and white wall. In fact depending on the paint (Matt or gloss) some of the light hitting the red wall will bounce off it and hit the white wall, producing a slightly reddish tint to certain sections of the white wall. And the exact same thing happens with the white wall; it will impinge upon the red wall. This will happen for all real materials and for all light sources. Of course theoretically you can conjure up materials and light sources with such properties as not to omit secondary illumination, but they DO NOT exist in reality. No matter how subtle the light or dull the object, radiosity is occurring even if you can’t see it”.

The image above shows some shapes that are rendered using the radiosity technique.

Task 3 – Miscellaneous Graphic Techniques Lighting Lighting in video games can be used in many different ways to which it can enhance the gameplay experience. For example, static lighting is just lighting that doesn’t really change in video games so it wouldn’t really give off much of an effect because nothing is changing. On the other hand, having dynamic lighting in a video game can change the atmosphere and the feel of a game. For example, with dynamic lighting, it could make the game have a realistic feel because the lighting can change depending on the scene (Daylight, Flickering torchlight, and lamps etc.). Just lighting also has a part to play with ray tracing rendering techniques because the light is used to replicate real life lighting to give the game a realistic feeling to it.

Spot lights Spot lights can replicate a real life spot life but in a video game which proves a direct beam of light and is something that could be found in different software packages. With dynamic lighting on a spotlight, the objects in which are close to the spot light will appear as light whereas objects that are farther away will be a bit dimmer.

Ambient Lights (Infinite lighting) Ambient lights are light rays which are pointed in every direction. They are also a form of infinite lighting as it provides the whole area with the same illumination. It is not set in a certain area or direction and because of this, the whole scene will be the same brightness without having any shadows appearing from objects and assets. This type of lighting could be used in an area in which it does not need to have a certain lighting section. For example, ambient lighting could be used when the player is in a cave and does not have a torch, the developer could implement a very dim light in which it will still allow the player to see the game but without the brightness of the light bouncing off the walls in the cave which will still give off the effect that the player is actually in a place without any light source.

Point Lights Point light are often found in various software’s and are commonly used by developers in video games by attaching these lights to objects such as light bulbs. They can be used to light up a certain area of the scene which it will give light in all directions of a length/strength set by the developer to get the desired lighting. Just like spot lights, objects that are closer to the light will be brighter whereas objects that are farther away from the light source will be dimmer.

Textures In video games, a texture is a surface material that is added to a 3D model or asset to give it some visual art. Textures are also used to add details which can add realism to a video game. There are many different texturing types when thinking about adding them to a model/asset and some of these are;    

Colour Maps Transparency Maps Bump Maps Specular Maps

  

Environment Maps UV Maps Displacement Maps

Bump Maps and Displacement Maps Bump maps in games are usually used to create an illusion of depth on the surface of the texture by using lighting which will give of the effect that there is density on the surface of the model when there is not. A problem with bump maps is that they can look very unrealistic if the camera pans on them in a certain angle which will ruin the illusion. Bump maps do not change the mesh of the model whereas displacement Maps do. Displacement maps manipulate the vertices on the model to give the model real bumps where bump maps are just made to look like bumps but the model hasn’t actually changed.

The image above shows a comparison of a model where bump mapping and displacement mapping has been added. As you can see from the bump map, the shape of the model hasn’t really changed but you can see bumps in the map which is just an illusion whereas you can see on the displacement map that the model itself has adapted to the model by changing the shape and adding actual bumps.

Anti-aliasing Technique In video games, Anti-aliasing is a method that removes jagged lines on objects which are meant to have smooth lines but do not because of the output device or resolution. The image below shows an example of a comparison of text without anti-aliasing added and with it added. In most video games, the player can actually turn this feature on and off depending on how powerful their system is because it can cause frame rate lag by using this technique.

Level of Detail Level of detail in video games is where the detail of an object is increased and decreased depending on how close the player (camera) is to the object. If the player is close to the object then the level of detail will be much higher as it will be using more of the pixels in resolution whereas if the player is further away from the object the level of detail decreases.

Process of Shadows Shadows can be added into video games using many different techniques. A couple of them being; 





Shadow Volume – Shadows using this technique is created by the beam of the light source through the model. This will create a projection and will create a volume in which is a shadow if the outside of the object is illuminated by the light source. Shadow Mapping – Used on pre-rendered and real-time scenes. It is calculated by testing if an object/pixel is visible from the light source by comparing the source view. This technique was founded by ‘Lance Williams’ in 1978. Etc.

Fogging and Depth testing Fogging and depth testing both help to speed up the rendering process. They can also help to lift some of the heavy load that the machine will have to go through whilst having to render a scene.

Fogging When adding fog to a scene, the fog blends the colour of objects with the fog and the developer can choose the strength and distance of the fog in the scene. When a user applies fog to their scene, the

fog is used to reduce the amount of polygons needed to render within the scene. For example, if the developer has an outdoor scene in which the area is really foggy, the player’s view wouldn’t be able to see very far due to fog and because they cannot see much with the fog, these areas and polygons won’t be rendered because they are not seen.

The image above shows the same object repeated but each one further back than the one before it which shows fogging that makes the objects further away harder to see.

Pixel and Vertex Shaders Pixel Shader A pixel shader is the process in which the machine will render per-pixel and is commonly used for lighting and bump maps. The pixel shader is a component for a GPU. Pixel shaders are not able to render out a full scene because it only operates by one pixel at a time.

Vertex Shaders Like the pixel shader, It is a component in a GPU. The purpose of a vertex shader is to render in vertex’s from the 3D scene and then be put it on a 2D display such as a monitor/television. They can also be used to change current vertex’s (position, colour and texture) but it cannot create new ones.

Part 2: Animation

Task 4 – Animation Systems Path Based Animation A path based animation is an animation which is a movement of an object which is set onto a fixed background in a set sequence/path.

Particle Systems In video games, particle systems is the process in which it gathers a big number of graphics (such as 3D assets and sprites) and then uses them to create motion, physics and graphics. Some uses in which particle systems are useful are;      

Fog Rain Fire Smoke Water Etc.

It’s also common in video games that player is able to disable some of the particles within the video game which can help with gameplay performance.

Inverse and forward Kinematics Inverse and forward kinematics is very important to animators.

Inverse Kinematics Inverse Kinematics is a technique that is used when the animator has a rig with joints such as arms or legs so that the animator can animate the movement more efficiently. For example, if the animator has a rig for a human character and they wanted the animation to have the character raise their hand up, the animator could then raise the forearm of the rig and because they are using inverse kinematics, the whole arm would move as well to keep the joints in place.

Forward Kinematics Unlike inverse, forward kinematics work differently in the fact that instead of the rig moving with the joint that the animator moves, the rest of the connected rig ...


Similar Free PDFs