Video Game Engines: A Research Report

By Ryan Strawn

Monday, April 14th, 2014

Table of Contents

Section 1 - What is a ? (page 2)

Section 2 - What Does a Game Engine do? (page 3)

Section 3 - Types of Game Engines (page 7)

Section 4 - Conclusion (page 9)

Bibliography - (page 10) What is a Game Engine?

! A game engine is a tricky thing to define, the term is often thrown around in the gaming community but not everyone really knows what one is. The reason for the confusion is because engines come in many forms, and the actual implementation of one would be lost on someone unfamiliar with software development. Let’s preface a more in depth description by talking about how a computer works. A computer at the ground floor is a series of physical circuits either on or off, on top of that the values string together into commands eventually forming an operating system, the operating system can then create applications based on higher level programming languages, these languages can then be used to operate game engines and web browsers. As we can see “computers work on a principle which can be described as layers of abstracted complexity”(Michaelenger).

!Game engines lie on top of the stack of complexity I described, so the wikipedia definition seems somewhat appropriate; “...a software framework designed for the creation and development of making video games”. A game engine takes common tasks of coding that are generally involved in game development and provides them in an accessible library, this allows developers to create their games without having to everything from the ground up.

!With all I’ve said, the idea of a game engine still seems a bit muddy and abstract, so I will try to provide an analogy. All cars need an engine to function and drive the vehicle forward, and if you were to develop a new type of car it could be advantageous to buy a prebuilt engine rather than putting the pistons, cylinders, and other part together from scratch, then the team could spend more time on the body, paint, stereo system, etc. All games use components that would compare to a car engine; animations, loading, displaying, user input, collisions, physics, etc. With an an engine in place, developers can spend more time on the parts of the game that make it unique like graphics, gameplay, characters, levels, and more.

What Does a Game Engine Do? - Components/Terminology

✦ Graphics

!Let’s say that we want to add a character, item or icon (referred to in game development as a sprite) onto the screen in our game. If we were to do this without a game engine, the seemingly simple function of displaying an image in a certain location could take 100 lines of code or more, but with an engine like Cocos2D (used for making iPhone games) it only takes this:

CCSprite *sprite=[CCSpritespriteWithFile:@"sprite.png"]; sprite.position = cpp(100, 100); [game addChild: sprite];

!This is a great example of how a game engine performs actions behind the scenes, actions that have already been hashed out and implemented many times before by other .

!A game engine can contain many graphic features, most include functions for animations, lighting systems, fades, layers, scaling, resolution. All of these would typically take a lot of complex code, the language of the engine can access and utilize more quickly. ✦ Physics

!Many modern games utilize some form of physics to simulate real world interactions between the world and the player. Most of us are familiar with Angry Birds, it uses physics to operate it’s entire gameplay theory with falling, teetering, and destructible blocks. Physics can simulate gravity, friction, velocity, bounciness, mass, and other properties. Some popular physics engines are , , and PhysX, and they are typically packaged into other game engines. These physics code sets are extremely useful to developers because they contain complex mathematic equations that are anything but simple to program from scratch.

✦ User Input

!This is the essential part of a game, the interactivity of a game happens when the user enters a command and things start happening. Inputs can vary greatly depending on the type of game that is made and that platform it is for; mobile games use touch commands, pc run games likely use the keyboard and or the mouse, and console systems like Playstation or Xbox use their own unique controller. A game engine can streamline the process of preparing a game for one or many of the platforms in a feature called input handling. The engine will “listen” for inputs, meaning that it is ready for a certain key to be pressed, and when a press and/or release is recognized it will trigger an “event”. The event could be anything from moving the player, character action, or opening a menu. ✦ Scripts/Behaviors

! A script within a game engine is a piece of code that can dictate when a reaction or event is supposed to occur, they are also referred to as behaviors in some engines because they determine when and how things should act within the game. A script could trigger an event like a scene or level change, a manipulation of the lighting or camera, or a character, enemy or item being added or removed from the scene. These scripts, like many other features of a game engine, are prebuilt sections of code that would otherwise be very long and time consuming to write.

!

✦ GUI

! GUI is an acronym that stands for graphical user interface, it refers to on screen text and menus, informational and instructional text. Drawing text with certain fonts and colors on screen with interactive buttons is not highly complex to code, nevertheless if a game engine provides a customizable gui system it can save a huge amount of time.

Every game’s user interface is going to be unique and custom, designing one that matches the game’s visual style and caters to it’s gameplay is very important.

!Below is an example of how to add an interactive button with text within the game engine which uses as it’s main language.

// JavaScript function OnGUI () { if (GUI.Button (Rect (10,10,150,100), "I am a button")) { print ("You clicked the button!");

// # using UnityEngine; using System.Collections; public class GUITest : MonoBehaviour { void OnGUI () { if (GUI.Button (new Rect (10,10,150,100), "I am a button")) { print ("You clicked the button!");

✦ Sound

! Engines can handle sound and music. Game engines can assist developers by triggering sounds and music during specific events, they can also place the audio in a

3d field which will make the sounds come from a specific area within the games environment. The sound features in an engine can affect volume, panning, distance and also add pitch modulation depending on the characteristics of the environment. All of these ways of affecting and handling audio give a game depth and create an immersive experience. Often times audio goes under-appreciated in games, but if the audio is of low quality everyone will notice and it could sink a game’s success.

✦ Porting

! A huge advantage of using a game engine, and one of the reasons that most developers will opt to use one rather than building from the ground up, is that engines typically provide a means to publish/port to multiple platforms (android, ios, web, ps, xbox, pc, steam, etc.).

✦Networking

! Many modern games use some form of online play component, and it can be a huge selling point or even a key element the gameplay revolves around. The scripts that engines provide can help solve the connectivity issues between servers and devices that arise when making giving a game online features. Types of Game Engines

! Game engines come in many varieties that cater to different game genres, developer preferences, team and project sizes, and programming skill levels. The differences between engines, how they are classified and used is vast and even daunting, there are literally thousands of game engines.

✦Mobile, 2d, and 3d

! Certain game engines cater specifically to mobile gaming, they have scripts that allow porting to android, html5, ios and are optimized for touchscreen controls and displays. Many of the 2d game engines allow you to publish to mobile, and some allow you to port to consoles as well. 3d game engines are much more complex and multifaceted than 2d. 3d worlds in engines like Unreal and Unity involve massive terrains, models, lighting, and other aspects that place them in a whole different category.

✦API’s, SDK’s, and Visual Interfaces

! API stands for application programing interface, it utilizes a certain type of programming language to create a library of coding functions. An SDK is a software development kit, it combines multiple API’s together and a variety of development tools like modeling, animation, environments, physics. Some examples are the Adobe

Gaming SDK, the Corona SDK, and Valve’s SDK. Most SDK’s are supported in online communities with coding/scripting examples and definitions of the functions and features it contains. Most of these API’s or SDK’s are non visual, there are no buttons or menus to navigate and they require the user to start from script/code to get a game up and running, a lot of programming knowledge is required for these.

!Lately there is a trend to provide a visual interface for the engine, it turns the coding of the engine into a full blown software tool, one that could potentially be used by someone who is not a . Some of the visual editors like the 2d engines

GameSalad, , and Gamemaker and the 3d engine Unity are excellent for high speed creative development, and appeal to indie developers or small teams. Another great development in these visual editors is their visualization of the game scripts. An instance of visual code is in the Stencyl engine, it provides the code creation in color coordinated blocks of logic that snap together as well as a tab directly next to it where the actual text can be viewed. While the visual editor engines are very sleek and streamlined, they are said to be quite limiting at times; the more the engine assists in creation by reducing necessary coding the less control is usually available to the developer to do exactly what they envision for the game.

✦Monetization!

!One category pertains to how an engine is made available for use, an engine is either considered open source and freeware, commercial/proprietary, and sometimes not available outside for use the company that created it.

!Open source engines are available for any use by the general public, with source code that can be altered by anyone. Open source engines are often a collaborative effort. Freeware engines are openly distributed through the internet for anyone to use, but the source code is not necessarily available to all. !Commercial game engines are marketed either towards either large companies or small teams who will purchase different kinds of coding libraries/engines and cater it to their project. Commercial engines are monetized in a variety of ways, this is where the definitions blur a bit. An engine can be sold for a flat price for any use (like

TorqueGameBuilder or Gamemaker), it can also be subscription based license (like the

Unreal Engine), and other times the sale of the engine is royalty based, meaning that the developers will owe the engine creators a certain percentage of their profits once a game starts to make money (like Unity3d).!

✦ Conclusion

! In the past game development required teams and companies to have programmers build everything from the ground up, as time progressed the gaming industry evolved and their cumulative knowledge started to surmount. Game makers no longer have wade through time consuming complexities because many of the technicalities have been solved by those that came before them. Game programming is in a collaborative state, it grows upon itself exponentially, and the product of this effort has been engines.

!Developers no longer have to reinvent the wheel; this is why gaming, a relatively young industry, has been able to progress so rapidly. Game engines have paved the way for more creativity, diversity, ingenuity, and pure awesomeness in gaming. Engines speed development, put game making tools into the hands of indie teams and hobbyists, encourage education, and are helping the industry flourish into new and exciting forms. Bibliography/Works Cited

Web Sources:

Bensmiley. “What is a Game Engine?”. Deluge.co. Friday the 5th, April, 2012.

! http://www.deluge.co/?q=what-is-a-game-engine

Coleman, Jahmel. “Game Engines (Types and Purposes)”. Wordpress.com. no date

! http://jahmelcoleman.wordpress.com/games-development/game-engines/

Michaelenger. “Game Engines: How do they Work?” Giantbomb.com. June 20,2013. ! ! http://www.giantbomb.com/profile/michaelenger/blog/

Ward, Jeff. “What is a Game Engine?” Gamecareerguide.com. April 29th, 2008. ! ! http://www.gamecareerguide.com/features/529/what_is_a_game.php?page=1

No author. Game Engine - Wikipedia Entry.

! http://en.wikipedia.org/wiki/Game_engine\

Print Sources:

Harbour, Jonathon S. “Beginning Game Programming.” Cengage Learning. 2007