Thursday, 27 August 2009

Game Engine Survey

A game engine is a software that helps game creator build games faster and easier. A game engine holds different kind of systems together to make them work in a more unified manner to ease the burden of programmers to start building games. The term itself is not clearly defined. A sophisticated game that allows the players to modify certain parts of the game (for example, character models, maps, difficulty, scenarios) can be considered as a game engine. On the other hand, some software provide only specific functionalities, such as simulating physics or outputting sounds. These software may also be called game engines.

In the past, developers made games from scratch. The number of people involved in production could be one or two persons only, and they are those who are determined to create new games with almost no help from other parties. They needed to research on interfacing with different systems of graphic displays, supporting different kinds of inputs, making sure that certain popular sound cards are supported, and so on. When all of that has been taken care of, developers of other games needed to do the same thing, again and again. Later it came onto the surface that they needed to share some code and information to prevent this redundant work.

This comes to one of the most important purposes of a game engine: abstracting the hardware so that programmers can concentrate more on the programming of the gameplay, rather than dealing with specific intrinsic difficulties that they need to keep up with the rapid progress of hardware enhancements (this means changes).

With a game engine, basic functionalities will be provided out-of-the-box. The most obvious one is the graphics output. It is expected that developers only need to call a simple function to make the game display fullscreen, to put a single pixel, or to fill the screen with certain color, without worrying about what display adapters the player uses or in some cases, whether the user runs e.g. Windows or DOS. Players control the game flow by using most commonly the mouse, keyboard, or a joystick (or a specialized controller for consoles). This will also be handled by game engines so that programmer will only need to decide what to do when a key is pressed, the mouse is moved, without knowing the connector type, keyboard model, and so on.

These game engines generally have a combination of these functionalities:
  • Graphics output (OpenGL, DirectX, SDL, etc)
  • Sound output
  • Input (mouse, joystick, etc)
  • Networking for multiplayer capabilities
  • Scene graph
  • Parsing and loading of image file formats
  • Parsing and loading of (3D) model file formats
  • User interface
  • Some kind of basic AI system (pathfinding, etc.)
  • Map editor or world editor
  • Physics engine

In modern games, developers are not limited to a few persons. Because processing capabilities has increased so many manifolds recently, graphics has virtually no limitations on colors; sounds can be interleaved and played at the same time; and graphic cards providing the huge power for 3D scenes; more and more artists are required to produce satisfying games - in the game industry that has become very competitive. Programmers too, are not only limited to a single person maintaining the code base, but they too have become much more specialized (AI, shader, graphics, tools, etc.). The works of artists and programmers are united - and limited - by the game engine, which provides the framework on which they can determine the part of the game they should work on.

In that situation, it is more noticeable that the commercial success of a game is not largely determined by the skill of the developers, but the timing and the marketing strategy. Without the use of a game engine, games may take 3~5 years to complete, after which the consumer market may have significantly change, or the technology has advanced further, making the game developed not as attractive as it had been expected before. On the other hand, the use of game engines reduced the number of innovative games, since more or less the developers are thinking in the limitations of the game engines.

Game engines can be full-featured, to be used for developing new games from the beginning (this is the most common definition). Examples of full-featured game engines are:
  • Unreal Engine - used in many mainstream games such as Unreal itself, Turok, Gears of War, Mass Effect, Mirror's Edge. This has many features for advanced developers.
  • Java Monkey Engine - provides Java developers to build games using Java. This is not used in mainstream but provides a good help for beginners.
  • Torque Game Engine - written in C++, it provides a world editor, model editor, and a scripting language called TorqueScript. One of the unique features is the networking feature which is highly optimized.
  • 3D Gamestudio - similar to Torque, this provides an IDE to help developers build the game world. The scripting language uses a modified version of C, Lite-C, which is compiled.
  • RPG Maker (RPG ツクール) - a popular 2D game engine in Japan which indie developers can easily make role playing games by defining events, switches, items, stats of enemy and players, story, graphics and sound.
  • Game Maker - also used for 2D games, has many functions common to games such as wall tracing, collision detection, high score list, and simple graphic effects. The logic are built by combining actions during events.

Some other game engines are not fully featured, instead they cater a specific part of a bigger game engine. Examples include:
  • Havoc - a physics engine. It simulates interaction between objects according to physics rules. It is used to simulate ragdolls, clothes, water, etc.
  • OGRE - a graphics engine. After constructing scene graphs, this engine will handle the culling, depth testing, painting and so on. It is multiplatform, supporting OpenGL and DirectX, and handles shaders as well.
  • FMOD - a sound engine. Audio in different file formats may be played simultaneously in precise timing. This engine is widely used in PC and consoles.

Torque Game Engine (TGE)

Torque Game Engine is a full-featured 3D game engine that lets the developer start from an empty world, add imported objects and assign IDs to them, play the created world in the seamless manner as the modeling itself. So, there is no differentiation between designing the world and "playing" the world. The editor is the game itself, the game itself has the editor to manipulate world objects (but of course it can be removed in the release version).

The concept of client-server networking is emphasized here. Single player games are still considered multiplayer games technically - only the server and the client resides on the same machine. Developers are expected to write scripts in TorqueScript which is processed and run. The functions written are divided into client functions and server functions. Client functions work without contacting the server, e.g. display the health on screen. Server functions work by sending commands to the server, e.g. move the player forward.

The engine itself is a static executable that works by executing the content produced. If advanced customization is needed, the C++ source is available to developers to rebuild the engine. Out of the box, TGE provides FMOD sound engine, IDE and script editor, terrain generator, model viewer, integration with PhysX (physics engine), level of details (LOD) and so on.

Adobe Flash Player

Flash has been a very popular platform for developing games that can be played inside a web browser. Flash is also used to build multimedia content for the web, such as advertisement banners, video player, and an easy way to play audio effects on web pages. For the users to run Flash content, they need a browser plugin called Flash Player. Fortunately this plugin is installed almost everywhere, so developing for Flash is a good decision for larger user base.

Flash content is usually contained in a single file (.swf), that is executed by the Flash Player on different platforms (Windows, Mac OS, Linux, PSP, PS3, mobile phones, etc.). The content is developed using a IDE called "Flash" (yes, it may be confusing). The IDE provides drawing tools for 2D vector-based graphics, using timelines. So, if you only wanted to make a non-interactive animation, you can draw images on the different frames, tween it (interpolate between key frames), and Flash will make a very small output file that you can put on the web.

To build programs, it provides a scripting language ActionScript. In recent releases, the language became much less like scripting language, but more similar to OOP language like Java but without enforced type system, so casual programmers can still do well.

Comparison

The following table lists the advantages and disadvantages of the engines.

FeatureTorque Game EngineAdobe Flash Player
GraphicsCross-platform 3D graphics engine for Windows, Linux, Mac, Xbox 360, Wii, iPhone.2D scene-graph based graphics with software-rendered 3D when necessary. Works on mobile phones, PS3, and PSP too.
SoundComplete control of sound using FMOD library.Limited control of sound playback (MP3, Speex, Nellymoser, AAC, ADPCM).
InputAny possible input in a platform.One-button pointing device and keyboards.
NetworkingSuitable for both single player and multiplayer games.No internal support for multiplayer games.
ScriptingSlow interpreted TorqueScript that has limited scoping.Compiled ActionScript that has more encapsulation options.
CustomizingC++ source available for unlimited customization.The Player is closed-source, only the development tools are opened.
Target mediaStand alone executable that needs to be installed.For playing in a web browser, hence features are limited.
Additional featuresShaders
Custom materials
Terrain generation
Collision detection
Advanced text layout engine
Vector based drawing

In the future, game engines will still be used, but the advancement of different technologies, for example specific advanced shader features for DirectX and OpenGL, means that developers need to write specific codes to fully utilize those. Game engines makes game development faster, but it can also limit possibilities. So, consider using game engine before starting a new game!

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete