Unit 70 Task 1: Computer Game Engines


Unit 70: Computer Game Engines.
Safa Radwan

A game engine is the software used to design or create games in 2D or 3D. Game Engines are used on computers to create different variety of games (including 2D, 3D, web games, console games, and mobile games). All games on Wii, PS4, Xbox, 3DS, Nintendo Switch, PSP, Mobile, Tablet, and PC are created with a game engine.

In this essay, I will be going into detail about the different game engines used to create games, what you can do using a games engine, and to understand the purpose, and functions of game engines in depth.
Some popular game engines include;

Unity is a game engine that can be used to create games in both 2D and 3D. This engine can be used across platforms, and create high quality games for mobile, desktop, VR and game consoles (PS4, Xbox).


Unreal Engine is a game engine, used to create professional 3D games. It is considered to be one of the best gaming engines, and according to the Guinness World Record, Unreal Engine is the ‘most successful video game engine’. Everything is written using C++, and can be used in many game platforms due to its high portability. It can also be used on TV shows to create props and backgrounds, not just games.


RPG maker is an engine specialized towards making 2D sprite based games. It’s not flexible like Unity or Unreal Engine, and is only geared towards making simple 2D role-playing games. It includes basic map editors and scripting language. All versions also contain premade characters and tile sets, making it useful for people who aren’t that good with coding or developing, but still want to create small games.
Cryengine has been used to develop AAA games such as Far Cry. Code is written in C++, and can also be used with other programs like Maya, 3DS Max and CryTif.


Duality is free game engine for people to use. It is an open source code, designed specifically for creating and developing 2D games. It is written entirely in C# and backed by OpenGL (a platform for rendering 2D and 3D vector graphics) so they can avoid graphic issues.

Collision Detection

Collision detection is very important, because without it, the player would fall through the floor, be able to move through environments and buildings. When two objects collide, they don’t move past each other because there is that collision detection, but this can also be used to trigger an action, for example if the character stands in a specific place then a special animation or action will occur.

Sound

Sound system in games, are an important aspect in games. Sound can make the player feel a certain way, or change the mood of the game. When a player reaches a certain point, the code in the system can trigger the music to play, for example, if the player wins a battle in Final Fantasy, a different soundtrack will play, stopping the battle music. This also works for sound effects too, when a player presses an object, or clicks a button, a sound effect is scripted to play.  This can make the player feel more involved, and it is also helpful to the player, as it helps them understand if the option, or object, they selected has worked.

Network

Not all games have a network, but more and more are starting to incorporate internet capabilities into the games. Having a network in a game, allows players from all over the world to connect and play with each other. One game starting to incorporate this, is Assassin’s Creed – normally their games are single player, however in 2010, their first game Assassin's Creed: Brotherhood, had a multiplayer option, and allowed players to choose their own assassin, and play mini-games with other players.


Animation system

These are used to move NPCs (non-playable characters), and can make the player feel as though the game is really thriving with different characters.

Path-based
One way, to make the NPCs move, is using a path-based animation system. This makes any objects/NPCs follow a set path, rather than creating each individual frame. Using a path-based system is faster, and more efficient than other types of animation systems, however, it lacks detail, and developers have less control over how the animation will look, since it is automated by the engine.

Inverse & forward kinematics
For this system, the model will have a skeleton, allowing animators to have a greater control of the model, and able to move/rotate and select certain joints of the model.

Particle systems
particle systems are used to render lots of small particles. For example, it would be used to animate fire, or water, as these would be too difficult for the regular animation systems, and have particles that move at different times.

Game Models and Animation

One of the most import assets in a games engine, are the models. Everything needs a model, from items you pick up, to NPCs and the environment you’re in.
3D models are made from triangles and quads. Each individual pixel displays 1 colour, this means depending on the game, it could have lots of pixels or not so many. For professional AAA video games, they will have many pixels rendered so that they can have high quality graphics, and for Indie or 2D games, they will have a lot less pixels. These rendered models are also used to create characters that can be animated for the developers to use in their game.

Animation clips are created either from an external source like Maya, or created using game engines. Once these clips are made, they are then structured into a flowchart-like system, known as an animator controller. These are used to make dialogue between characters, what actions they will do and determines how they interact with the player character. This is used to make an AI (artificial intelligence).

The Artificial Intelligence

An AI is controlled by the actions that you chose in a flowchart-like fashion (pictured below). Some are also only programmed to act one certain way, when interacting with the player character.


AI’s have become more advanced – depending on how the player plays the game the AI can combat their playstyle and counter them. One fan of Dark souls known as ‘metal-crow’ created an AI mod for the game Dark Souls 1, and programmed the AI to counter Dark Souls players, and be almost unbeatable. After 10 months of studying PVP (player versus player) for dark souls and creating the source code, the creator released the AI as a mod for players to download.

He explained how he created the source code (in C++ for coding) as so, “In order to have the AI do anything, I needed to be able to feed it data about the game state. The simplest and most direct way of doing this, would be to have it watch various variables in the game code, such as the enemy’s x and y location, and then use that with the AI logic. However, since the game’s code isn’t open source, I needed to reverse engineer anything I wanted to use.
The first step I took, was finding the basic variables I knew I needed, and where the easiest to find were. By using a second computer, I could connect to myself and have a test enemy player I could work with. Using the program Cheat Engine, which is a powerful debugging and memory scanning software, I was able to quickly find the enemy’s x and y location variables, and a few other simple values. Running a pointerscan on these values and cross referencing these scans, I was able to find the executable base address that the game always used for to point to the enemy struct, and the pointer paths to the variables.”
(The AI is the red/black knight, also known as ‘king’)
What he got was an AI that could dodge player’s swings, preform calculated attacks, and predict when the player was going to strike and parry them. Although this AI was dangerously intelligent, it was not impossible to beat, and very skilled players have downloaded the mod onto Dark Souls, and were able to take advantage of the AI’s slight imperfections and defeat it.

Mods (Modification) in Games

Mods can also be used in other ways. Most notable mods are cosmetic, and can be used to change textures, for example, the screenshot below is from the game Star Wars Battlefront. The right is vanilla (meaning no modding has been done – the game is in its purest form), and the left being a mod that aims on improving the graphics and aesthetics of the original, by using applications such as Reshade and MasterEffect. The modder (creator of the mod) also tried to replace the lack of lighting with bloom, corrected the colour, and sharpened the images.


A popular game to add mods in is Minecraft, since the vanilla version can be plain and boring after a while, mods have become increasingly used in the game;

(Image above; vanilla vs modded texture in Minecraft)

As well as texture mods, new game items and mobs have also been made by players;

(Pictured below is a Portal mod in Minecraft)

Mods can be used to edit a game, to give the game a graphical upgrade, or add new enemies/AIs so we have more to do in the game once it’s been completed, or to add a new challenge.


Rendering Graphics

Many mods are downloaded to give games better graphics and look more aesthetically pleasing. These are more commonly used in 3D games because they aim to look more realistic and immersive, while 2D games typically use pixel art and don’t count on realism to sell their games.

Rendering techniques
Some popular rendering techniques include:
Scanline/rasterization – this type of rendering is used by developers who are under time constraint, because it can be used to render graphics quickly. It does this by rendering and image on a polygon by polygon basis, instead of rendering an image pixel by pixel. Most games using this technique can achieve speeds of 60 frames per second due to the low poly count
Raytracing – this rendering technique takes a lot more time, because every pixel in the scene is rendered and traced through the camera to the nearest 3D object. Using this can create photorealistic graphics, however this takes time, and not all hardware are capable of running it in the highest quality.

Rendering software used:
Mental Ray – this software is packaged with Maya, and is arguably the most versatile – it is relatively fast, and competent for rendering most objects. This software uses raytracing and radiosity techniques.
V-Ray – this software is typically used in conjunction with 3DS Max to render environments and architecture.
 
(This image shows in simple terms how a games engine renders graphics)

Textures
With rendering also comes textures. Texturing is an extremely important part in the rendering process. Textures can make windows have a screen, reflect light, or become see-through. It can give desks or doors a wooden look. Using textures can make a game look polished. With textures, it would be difficult to distinguish between objects.

Anti-aliasing
This is used in rendering to make objects not look so sharp. It softens up the edges, smooth otherwise jagged lines, and blurs the colour on the edge of textures. Using anti-aliasing can make the overall game world look less rough and jagged.
 
(example of what anti-aliasing does to shapes)



Lighting & Shadowing
These components are important in rendering. They can tell the player what time it is (eg, morning, afternoon, night), and can give different emotions to the player. Using different lights can give diferent meanings too, directional light and spotlights can be used to emphasize something in a game, such a switch or trigger. Contrast with the use of shadows, can give a creepy atmosphere, or tell the player that area isn't important.

Fogging
Distance fog is used in games to make objects seem more realistic - as in real life, you wouldn't be able to see things far away in perfect accuracy. It is also used to indicate a certain feeling to a player, like in Silent Hill 2, fog is used to give the player a sense of fear, and mystery. However, it was mostly used so that the developers wouldn't have to render everything in perfect detail, as many game engines in that time did not have the capabilities to process objects far away.

In conclusion, a games engine can be used to create basic 2D, low resolution mobile games, to triple A, high-functioning 3D games, with hours of gameplay, music, and voice acting packed into the game code. A games engine like RPG maker would probably not be able to create fully-fledged immersive game, however a games engine like Cryengine would be able to achieve that. In this essay, I also talked about the kind of things programmers would use in a games engine, like mods, AIs, and rendering techniques.





(References/sources used;




No comments:

Post a Comment