A three-dimensional (3D) engine, often called a game engine, is a system used for virtual computer simulations. Game engines are commonly used in video games, though other non-entertainment applications also exist. A 3D engine has several area of functionality, which work together to create an immersive virtual environment. The rendering component of a game engine calculates the visual appearance of a scene, while a physics component determines how different objects should interact. Some engines also include features such as scripting and artificial intelligence to enhance the feeling of realism.
Game engines streamline several key requirements. During the initial creation of a computer simulation or video game, a 3D engine can be used to simplify the development process. Many simulations and games have the same core features and functionality. A 3D engine allows developers to access common game elements without having to "reinvent the wheel" and build every feature from scratch.
As an example, many popular games are played from a first-person perspective. Even though the story and characters of a new title may be different, the function of this viewpoint is often very similar to existing games. A pre-existing 3D engine can be used to process the visual perspective from this common vantage point. In addition to saving development time, a pre-built game engine also provides players with a consistent and familiar interactive experience.
One common task for a 3D engine is the calculation and rendering of a particular scene. Game engines use mathematical models to predict how rays of light would reflect off of physical objects in the real world. Developers can program in-game objects to emulate certain visual characteristics, and select a material such metal or plastic. When the game is played, the engine will use these variables to simulate the reflection of light, and render a scene that is visually accurate.
If a game includes objects or characters that are movable, the engine may also use math to simulate physics. The 3D engine will often contain a database of physical rules which apply. For instance, a simplified rule might tell the 3D engine that unsupported objects need to fall to simulate gravity. Modern engines contain very sophisticated physics capabilities, which enhance the game experience.
Scripting and artificial intelligence programming can also be included in a game engine. These features allow developers to create characters that seem human. Just as the physics component of an engine allows objects to behave in a realistic way, artificial intelligence can be programmed with a list of character rules. An example of game engine scripting might be a computer character that follows the player through a level, and provides clues or assistance based on the player's actions.