Tuesday, 2 February 2016

What is a game engine?

Developers use game engines to develop games for consoles, PC computers, and mobile devices. A game engine is a commonly used term in the industry - it refers to a software framework that handles common game related features that combine when running to keep all the graphic elements and code working as they should. Common tasks that the game engine handles include:
  • rendering
  • physics
  • input
  • collision detection
  • sound
  • scripting
  • animation
  • artificial intelligence
  • networking (for example multiplayer games across a number of devices)

This leaves the other members of a development team such as artists, script writers, designers and other programmers able to focus on the other elements of the game that make it unique.

Game engines are usually defined as what makes the game run or much like a car’s, go.
Sometimes however it is difficult to define where a game’s engine ends and the actual content of the game begins. To continue the analogy of a car, imagine it is as if there were a fuzzy line defining whether the air conditioner is part of the engine or a feature in it’s own right. Our first task is possibly to understand the difference between the two terms ‘engine components’ and ‘game content’.

In layman’s terms a game engine offers a set of reusable components that can be manipulated to bring a game to life. Components of a game engine could include loading, displaying, and animating models, collision detection between objects, physics, input, graphical user interfaces, and even portions of a game's artificial intelligence. These can all be components that make up the engine.

To define the content of a game, we should think in terms of specific models and textures, the meaning behind object collisions and input, and the way objects interact with the world.

These are all content components that make up the actual game. To once again use the car analogy, the body, CD player, in-dash navigation system, and leather seats combine to make the actual car. That is the content coming together to make up the elements that we can interact with.

It is at this point that we need to consider two other important elements that work within a game engine - API’s (Application Programming Interfaces) and SDK’s (Software Development Kits). An API is an interface that allows an operating system to ‘talk’ with the game engine and take advantage of it’s features, libraries and services. They are necessary for a programmer to have complete control of what a game engine does and when it does it within the context of a video game. An SDK refers to a collection of libraries, API’s and tools that can be referenced by the API when programming.
Most game engines provide APIs in their SDKs. The Unreal Engine, for example, provides an Application Programming interface for programmers to create their games, both through a scripting language called UnrealScript, and through libraries. These libraries are provided to anyone who licenses the engine and come in the same package as their other tools, like the editor UnrealEd.

The birth of and reasoning behind game engines
For a long time in the early days of video game development, companies made their own game engines and kept that technology in house. They built on it and developed it as and when required, such as when computers improved and more advanced versions were needed. Some of the most famous early instances of game engines include SCUMM by LucasArts and SCI by Sierra. These two engines powered most of the games that these companies released in the late 1980’s through to the mid 1990’s.

More recently, engines like id Tech (the engine that powers the Quake series of games) and the Unreal Engine started as in-house technologies, though they have recently evolved into middleware technologies as well. But what exactly is a middleware technology?

To understand this we need to consider the cost of making an in-house engine. Due to advancements in computer and console technology this has grown more and more expensive. Because of this increasing cost, many developers specialise in making full game engines or game engine components to sell to other companies, rather than making games. These companies are termed as middleware providers, bridging the gap between costs and a game developer’s project aspirations. Middleware providers can offer these products at very reasonable prices. For most game development studios, this creates a very clear "build it ourselves” versus “buy from others" decision.

The maths behind this decision are pretty simple. Why should a development studio pay six programmers for a year to build an engine when they can buy most of the features they want from a proven technology for less money? Almost all components of a game engine are purchasable at a variety of prices, or downloadable in the form of open source projects.

Types of Game Engines
Game engines vary greatly and come aimed at different levels of programming expertise. It is a vast field and can probably be best broken down into 3 different kinds of engine.

  • The roll-your-own version
  • The mostly-ready version
  • The point-and-click engine

Roll your own version (lowest level)
The roll-your-own version refers to a mainstream company creating their own engine from publicly available application interfaces. Examples of these include These XNA, Direct-X, OpenGL, the Windows and Linux APIs and SDL. These publicly available APIs will often be used in conjunction with commercial and open source libraries. These libraries might include physics libraries like Havok and ODE, scene graph libraries like OpenSceneGraph, and GUI libraries like AntTweakBar. Physics, Scenes and Graphics User Interfaces.

XNA and SDL are of particular use because they make creating a game engine easier by solving some of the cross platform issues. However,  they do still require a lot of programming to get a game off the ground. With this taken into account they are perhaps more jumping off points for creating engines rather than engines in their own right.

The advantage of these home rolled engines is of course that they give programmers all the flexibility they may require. They can pick and choose the components they want and integrate them in the ways that they best see fit. The disadvantage of home rolled engines is that they unfortunately take the longest amount of time to build. From a more complex technical standpoint, programmers will have to build the tool chain to perform programming tasks completely from scratch. This is a tall, arduous task and necessary as most APIs and SDKs tools will not work in conjunction with one another straight out of the box.

Mostly-ready game engines (mid level)
These engines are widely considered to be ‘mostly ready’. These engines are ready right out of the box with rendering, input, GUI, physics complete and ready to work. Unlike the roll your own versions, tool chains are complete and ready to go. Low priced, open source engines in this category include OGRE and Genesis3D, which are both open source, low priced engines. Higher priced ones include Unreal, id Tech, and Gamebryo, three engines that have produced some outstanding games over the last 15 years.

These game engines do still require user knowledge and interaction to get them up and running and turned into a complete game. They may require the user to input some coding or scripting to get the engine running a game correctly.

A second disadvantage is that mostly ready engines are often a little more limiting than roll your own versions. This is because they are often optimised for the most common cases and problems. However, most of these mostly complete engines are the result of hundreds of hours of collective man hours to create. This means they will run well and be highly optimised even if they do not do everything the developer requires

Point-and-click engines (highest level)
Point-and-click engines are becoming more and more popular and often feature highly adaptable tools and features. The name point and click is fairly self explanatory - allowing the user to create a game from clicking options, toolbars and menus.

Examples include GameMaker, Torque Game Builder, and Unity3D, and are built to be as friendly as possible. I have found from experience that to get the best from these engines, a knowledge of coding is very helpful. That's not to say that not knowing code will not allow you to create a decent playable game, as it isn't really a necessity. Point and click engines allow you to create perfectly good games regardless of the developers ability level.

The disadvantage with many point-and-click engines is that they can be extremely limiting in terms of the genres they create.. Many do one or two types or genres of game well, or one or two types of graphics modes. However, even faced with the restrictions of these tools, it's possible to make highly creative games or even find creative ways around those restrictions.

Perhaps the major advantage of these engines is that they allow the developer to work quickly, and play games quickly, without too much work..

The larger most commonly used engines
Three of the most prolific and commonly used engines are:
  • Unreal
  • Unity
  • CryEngine

They all fall under the category of ‘mostly ready game engine’ as they offer a tool chain, features and services that can create highly sophisticated games right out of the box.

 Unreal 3
The main features of Unreal 3 are:

Fully programmable shader hardware. All lighting calculations are done per-pixel, as opposed to per-vertex (polygonal shape). This means a much greater degree of lighting effects are available per object creating realistic environments.

With regard to rendering, Unreal Engine 3 also provides support for a gamma-correct high-dynamic range renderer. This means a much greater range of surfaces, graphics and colours per object

UE3 expected that content was authored in both high- and low-resolution version; a major difference to previous generations where the game content was modeled directly (since normal mapping is a per-pixel operation and almost all the dynamic lighting in UE1 and 2 was calculated per-vertex using a Gouraud Shading technique).

Initially, Unreal Engine 3 only supported Windows, Xbox 360, and PlayStation 3 platforms. Android and iOS were added later in 2010. Followingly OS X support was added in 2011. Its renderer supports many advanced techniques including HDRR, per-pixel lighting, and dynamic shadows. It also builds on the tools available in previous versions. In October 2011, the engine was ported to support Adobe Flash Player 11 through the Stage 3D hardware-accelerated APIs.

The developer Epic Games  has used this version of the engine for their in-house games. Epic has announced that Unreal Engine 3 runs on both Windows 8 and Windows RT with the first Unreal Engine 3 game on consoles being Gears of War and the first PC game being RoboBlitz.

Unreal 4
The third version of Unreal has now given way to the fourth. With the addition of HD and C++ support, the engine was originally planned to include real-time global illumination of objects to eliminate pre computed lighting. This feature has since been replaced with a similar but less expensive algorithm. This was introduced just prior to release across all platforms due to performance concerns on next gen consoles.

UE4 also includes new developer features to reduce iteration time, and allows updating of C++code while the engine is running. The new "Blueprint" visual scripting system (a successor to UE3's "Kismet") allows for rapid development of game logic without using C++, and includes live debugging.The result is reduced iteration time, and less of a divide between technical artists, designers, and programmers.

The main benefits of Unreal are:

  • photorealistic graphics;
  • advanced dynamic lighting;
  • innovative particle system (handles up to a million particles in a scene at once).
  • UnrealScript is completely replaced by C++;
  • Kismet is replaced by the more intuitive Blueprint.

Originally announced as an Apple exclusive game engine, Unity has been expanded to target more than fifteen platforms. It is now the default software development kit for the Wii U. A free copy of Unity is included by Nintendo with each Wii U developer license. Unity Technologies calls this bundling of a third-party SDK an "industry first".

It's emphasis on portability, the game engine targets Direct3D on Windows and Xbox 360; OpenGL on Mac and Windows. Unity has the advantage of offering texture compression and resolution settings to make the most of the specs of any platform that it is being run on.  Unity users can also take advantage of support for bump mapping, reflection mapping, parallax mapping, screen space ambient occlusion (SSAO), dynamic shadows using shadow maps, render-to-texture and full-screen post-processing effects. Unity is clever and able enough to detect the optimum setting for the current video hardware. If nothing is compatible with the current video hardware, Unity can revert to an alternative shader that may sacrifice features for performance.

Unity is perhaps most notable for its ability to target games to multiple platforms. Widely regarded as the easiest to get to grips with and most accessible game engine, Unity has won prestigious awards for making game design universally accesible.

The latest version of Unity 5 has been met with similar praise, with sources stating that "Unity started with the goal of making game development universally accessible ... Unity 5 is a long-awaited step towards that future."
The main benefits of Unreal are:

  • global lightning;
  • render-to-texture;
  • custom splash screen;
  • IK Rigs, etc.

Developed by Crytek, this engine is about much more than just the famous 'Crysis' series of games. Crytek licenses the CryEngine to other developers who use it to make games. With CryEngine 3.8.1, developers can compile their games to run on Linux. Linux compatibility in major gaming engines means the developer's cost of porting big new AAA games to Linux is vastly reduced. A company that is developing its own game engine from scratch might not want to invest the extra resources to get that in-house game engine working on Linux, but porting a game to Linux when the core engine already supports that platform requires much less effort. Crytek and the companies that support and develop the game engine have already done most of the work. For those who have played 'Crysis', they will already have a very good idea of what the CryEngine can do: highly advanced physics and lighting effects, particle physics such as fire, water and smoke, the capacity to produce realistic computer AI...the list goes on.  According to their website, Crytek has a simple goal: "to create the most powerful royalty-free game engine in the industry, and to give creators all across the globe the tools to harness this power to create world-class gaming experiences, no matter their budget or team size".  

The engine boasts smarter content creation via an all-encompassing development suite. Through the seamless integration of third-party software and an array of efficient in-engine tools, developing a profitable game has never been quicker or easier. On the subject of profits, developers can opt into a scheme to pay a monthly subscription of $9.90 per month for use of the engine so that when their game achieves success they will not have to pay royalties to Crytek.

The main benefits of the CryEngine are:
  • state-of-the-art lightning;
  • realistic physics;
  • advanced animation, etc.

No comments:

Post a comment