Unit 70: 2D & 3D Game engines.


Unit 70: 2D & 3D 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 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 Guiness 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.


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 (non-playable characters), 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 it’s 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.
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)


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