Robs game engine

Page 1

GAME ENGINES

WHAT MAKES UP GAMES?


THE PURPOSE OF GAME ENGINES-PAGE1

THE PURPOSE OF GAME ENGINES A computer game engine builds the game world. It is prewritten software that allows for game developers to create and edit games in either 2d or 3d without actually having to make a game from scratch. With game engines you can use the different parts of the engine such as renderers, animation and scripting. Computer game engines use a variety of programming languages, such as Java and C++. They usually fall under four categories 2D (Game Maker, Game Salad etc.), 3D (Unreal Engine, Quake & ID Tech 4 etc.), Mobile (Battery Tech, Cinder etc.) and Game Mods (Garrys Mod & Geck). One of the main abilitys of a game engine is being able to render 2D or 3D graphics. A game engine is software that is intended to make it easy to develop a game without needing to invest in a great deal of additional technology. In other words, it implements all the basic technologies of games like graphics, physics, networking, input, AI, etc. in a way that they are easy to tie together with game-specific logic.

2D AND 3D 2D in mathematical and in gaming terms is a flat image that has only two dimensions. When talking about 2D games people are often confused to find out that it isn’t just perspective, when looking at popular side scrollers such as Mario and Sonic. However some use 3D graphics to portray more depth to the game, therefore this was created in a 3D engine but using a side scroller view. 3D and 2D engines are very similar in terms of there functionality, apart from the obvious difference that 2D engines can only render 2D graphics. However you can create objects that look 3D but are actually 2D and this is what call perspective. 2d games are faster to make than 3d such as with rendering as 3d sprites are made up of pologons with a 2d sprite there is no rendering required.

are many factors for just one product. 3d engines are difficult as with a 3d space you have to create your assets from all views. The assets require a lot more skill to make as there is so much that goes into making assets such as modelling, texturing, rigging and then animating .A lot more time is also spent creating a 3D game, due to all the factors and assets a game needs in a 3D game. Unreal Development Kit, developed by Unreal Games, is a games engine that has the tools to create a FPS game but can be adapted to create other games, such as RPGs. In 3D engines they render three dimensional representation of the geometrical data from the engine, which is primarily used for calculations and also rendering 2d images. Ultimately 3D engines will have there own physics engine built in, however there is an option to hire out ‘middle ware’ to help aid a section of your game that you would like to improve through the use of another engine. 3d games are also harder to code becaues of this extra demenison the code has to be able to play the animations when buttons are pressed and also what happens when for example character runs up a wall such as physics and collison. So this makes game engines very helpful as they aid the programmers.

THE HISTORY OF GAME ENGNES The first game engine came about in the mid-1990s, especially when talking about 3D games such as first-person shooters (FPS). Due to the popularity of Id Software’s Doom and Quake games, rather than work from scratch, other developers licensed the core of the software and designed their own graphics, characters, weapons and levels—the “game content” or “game assets.” So due to the lengthy and complex creation of a 3d game engine game develops strating to sell their engine to other game companies. Later games, such as id Software’s Quake III Arena and Epic Games’s 1998 Unreal were designed with this approach in mind, with the engine and content developed separately.

3d game engine 3D game engines are the most advanced engines currently. 3d engines are hard to use, as there

However their are fees and laws to using other engines.


THE PURPOSE OF GAME ENGINES-PAGE2

Licensing game engines has proved to be succuessfull and increase a companies revenue for game developers, as a one license for a high-end commercial game engine can range from 10,000 to millions , and the number of licensees can reach several dozen companies, as seen with the Unreal Engine. At the very least, reusable engines make developing game sequels faster and easier, which is a valuable advantage in the competitive video game industry. While there was a strong rivalry between Epic and id around 2000, since then Epic’s Unreal Engine has been far more popular than id Tech 4. Modern game engines are some of the most complex applications written, often featuring dozens of finely tuned systems interacting to ensure a precisely controlled user experience. The continued evolution of game engines has created a strong separation between rendering, scripting, artwork, and level design. It is now common, for example, for a typical game development team to have several times as many artists as actual programmers.

key components of a game engines - Rending 3D sprites get a new Z axis that stores depth, scaling size and movements in the X/Y plane. A sprite that is farther away has a bigger Z value. Now, divide sprite’s size and X/Y axis movements by the Z axis. This is a 3D perspective projection. 3D rendering is a creative process that is similar to photography or cinematography, because you are lighting and staging scenes and producing images. Unlike regular photography, however, the scenes being photographed are imaginary, and everything appearing in a 3D rendering needs to be created (or re-created) in the computer before it can be rendered.

The 3D rendering process depicts this three-dimensional scene as a picture, taken from a specified location and perspective. The rendering could add the simulation of realistic lighting, shadows, atmosphere, colour, texture, and optical effects such as the refraction of light or motion-blur seen on moving objects - or the rendering might not be realistic at all, and could be designed to appear as a painting or abstract image. Portal rendering Portal rendering is an algorithm for visibility determination. For example, consider a 3D computer game environment, which may contain many polygons, only a few of which may be visible on screen at a given time. By determining which polygons are currently not visible, and not rendering those objects, significant performance improvements can be achieved. A portal system is based on using the partitioning of space to form generalizations about the visibility of objects within those spaces. Regions of map space are divided into polygonal, generally convex, areas called zones, or sometimes sectors. Adjacent zones are linked to one another via shared dividing polygons termed portals. Approaches that precompute visibility for zones are referred to as potentially visible set or PVS methods.


THE PURPOSE OF GAME ENGINES-PAGE 3

Cycles rendering GPU rendering makes it possible to use your graphics card for rendering, instead of the CPU. This can speed up rendering, because modern GPU’s are designed to do a lot of number crunching. On the other hand, they also have some limitations for rendering complex scenes, due to more limited memory, and interactivity issue when using the same graphics card for display and rendering. Cycles is an unbiased, physically based, path tracing engine designed for animations, which means that it produces an image by tracing the paths of “rays” through the scene. Specifically, cycles is a “backwards” path tracer, which means that it traces light rays by sending them from the camera instead of sending them from light source(s). Features of rendering Shading – how the colour and brightness of a surface varies with lighting Texture-mapping – a method of applying detail to surfaces Bump-mapping – a method of simulating small-scale bumpiness on surfaces Fogging/participating medium – how light dims when passing through non-clear atmosphere or air Shadows – the effect of obstructing light Soft shadows – varying darkness caused by partially obscured light sources Reflection – mirror-like or highly glossy reflection Transparency (optics), transparency (graphic) or opacity – sharp transmission of light through solid objects Translucency – highly scattered transmission of light through solid objects Refraction – bending of light associated with transparency Diffraction – bending, spreading and interference of light passing by an object or aperture that disrupts the ray.

is programmed into non-playable characters in a game. Also known as ‘bots’, artificial intelligence defines what a bot can do in a game for example the timing of its attacks. It may change its attack pattern should it need to according to the situation and moment in time. Such as a feature where in I am alive if the player brings out a gun the enemies become scared. Developers and programmers can change the behaviour by simply changing a few lines of code or by using an AI component. Over the years AI has adapted. From space invades to the latest alien game AI has adapted such as in aliens the enemy actually learns your attack patterns and adapts to beat you. Probably the most often implemented form of AI, combat oriented AI can be seen in almost every shooter since the mid nineties. The evolution of combat AI was slow for many years. Most AI opponents were relegated to shambling forward, often right into the player’s gunfire. It wasn’t until Valve released Half-Life that combat AI took a major turn for the better. The Marines showed different reactions for getting shot, spotting grenades and even a realistic awareness of the player, AI comrades and enemies, Half-Life quickly asserted itself as having the best AI in any game. After Half-Life, more and more games started to focus on the AI aspect of game design instead of just graphics. Today, combat AI’s can be seen ducking around corners or behind boxes, tossing the player’s grenades back, and even standing in for real players in multiplayer games. Still, combat AI’s have plenty of room for improvement before they even get closed to replacing human opponents.

Rendering for game engines tend to fall under the real-time rendering category as it’s done for video games, which rely on the hardware of the device, the GPU, to create the graphics for them. Even though combat AI’s can dodge incoming fire and shoot, there are four major things that human combatants offer over AI: knowledge of their environment, efficient use of teamwork, the ability to “hunt”, and survival instincts. To finalize, the purpose of this component is to help developers integrate the illusion of intelligence into their characters to let them respond to in-game situations or by giving them commands to tell them how often they should be attacking or when to attack. The possibilities are endless with AI and you can theoretically create a human-like AI character.

Artificial Intelligence Artificial intelligence is a written intelligence that

Sound Sound has developed immensely over the years due


THE PURPOSE OF GAME ENGINES-PAGE 4

to the technological advancements that have taken place over the decades. Back in the 90s, it was only possible to select both low quality and few sound tracks to a game. Now we can compress them to small sizes so we can include a mass amount of sounds as well as being of a great quality. Sound is also a vital part of any game. It can set the mood of a cut scene or enhance the atmosphere of a battlefield. Without it, you wouldn’t be able to connect to a game and you would eventually get bored of them. Sounds have a variety of purposes in games and require a component to help developers implement it into their games. What you can do with this component is to attach a sound to a mesh if required, or compliment it with an animation. Early on game music components were expensive and prone to break under heavy use making them less than ideal for use in an arcade cabinet, though in rare cases, they were used . A more affordable method of having music in a video game was to use digital means, where a specific computer chip would change electrical impulses from computer code into analog sound waves on the fly for output on a speaker. Sound effects for the games were also generated in this fashion. An early example of such an approach to video game music was the opening chiptune in Tomohiro Nishikado’s Gun Fight.

Physics Physics relates to real life. A physics component deals with all the factors that can make games realistic and not so. You can alter wind resistances; friction and gravity physics greatly affect a game such as the recently released watchdogs. The game has had widespread critical responses due to its unrealistic physics such as the cars crashing and the handling of the car. Altering the physics of a game really depends on the genre and style of game. For realistic games, you would have to create as close to real life as possible in terms of physics, which the Frostbite game engine is very capable of doing when it comes to destruction damage to buildings for example. A physics engine had the sole purpose of moving objects around in a simulated world. They take the physics properties of objects, such as mass, shape, material, current trajectory, etc. and then calculate a new position and state for all those objects. There are generally two classes of physics engines:

real-time and high-precision. High-precision physics engines require more processing power to calculate very precise physics and are usually used by scientists and computer animated movies. Real-time physics engines—as used in video games and other forms of interactive computing—use simplified calculations and decreased accuracy to compute in time for the game to respond at an appropriate rate for gameplay. Game physics adds the laws of physics into a game engine to make the effects more realistic for the user. In a game engine, the physics are a much simpler and basic version of real physics. A physics engine is a program code that is used to simulate the laws of physics into the game environment. Physics engines such as Havok and PhysX are often used by developers side by side with a game engine because the separate physics engines are more specialised for programming physics than a regular game engine. Collision detection is used in game physics to solve the problem of determining when any two or more objects cross each other’s path. For example, when a car collides with a barrier, the physics part of the collision detection will need to calculate things such as the speed the car collided with the barrier in order to create an appropriate response. A game such as Garry’s Mod uses ragdoll physics which simulates the movement of a character when killed. Sports game such as Fifa 13 uses more advanced physics, and usually put a lot of effort into improving the physics engine in each sequel. The physics are needed, for example, when a player jumps in the air and heads the ball. The physics engine needs to calculate how high that player can jump and where the ball with go after they have collided.


THE PURPOSE OF GAME ENGINES-PAGE 5

such a way that they are easy to tie together. Some game engines are very specific to a certain genre or otherwise impose a lot of assumptions on the games being made with them. In exchange, they are almost complete out of the box solutions for those target games. Other game engines are much more generic, but require engineers to spend more time implementing genre-specific code.

Collision Detection To ensure that people can’t walk through buildings or get stuck in trees, there’s a component that’s known as collision detection. This allows the game engine to detect a range of different collision modes that you can select from to use around your model or mesh. Once applied to your specifications, it can do a wide range of different actions. They generally fall under detection and response. Collision detection is when someone comes into contact with an object. Some developers may want players to run through a barrier so they wouldn’t apply any collision detection but you wouldn’t want that for a building. Collision response is the result of said detection. Remember the game you used to play in your young days where you would have to get from A to B without touching the metal bar and it buzzed if you did? That’s a collision response. You could get a character to touch an orb and it would light up and flash multiple colours. That would be the response. Objects in games interact with the player, the environment, and each other. Typically, most 3D objects in games are represented by two separate meshes or shapes. One of these meshes is the highly complex and detailed shape visible to the player in the game, such as a vase with elegant curved and looping handles.

HOW GAME ENGINES WORK We’ve come a very long way since the days of Doom. But that groundbreaking title wasn’t just a great game, it also brought forth and popularized a new game-programming model: the game “engine.” This modular, extensible and oh-so-tweakable design concept allowed gamers and programmers alike to hack into the game’s core to create new games with new models, scenery, and sounds, or put a different twist on the existing game material. CounterStrike, Team Fortress, TacOps, Strike Force, and the wonderfully macabre Quake Soccer are among numerous new games created from existing game engines, with most using one of iD’s Quake engines as their basis. A game engine is software that is intended to make it easy to develop a game without needing to invest in a great deal of additional technology. In other words, it implements all the basic technologies of games like graphics, physics, networking, input, AI, etc. in

A physics engine had the sole purpose of moving objects around in a simulated world. They take the physics properties of objects, such as mass, shape, material, current trajectory, etc. and then calculate a new position and state for all those objects. The line between game engine and physics engine is relatively clear. In many cases, they are completely separate libraries, such as an Unreal Engine game using the PhysX physics library. In general, the game engine feeds initial state data to the physics engine, and the respones to physics engine responses. For example, the game engine loads a level and tells the physics engine that there are 10 objects in the scene at given positions. The physics engine then process updates to those obects’ states, as the game engine asks the physics engine to update the objects and report on their changes. Graphics data is often synced up to changes from physics, so that changes made by physics show up on the player’s screen. The game engine may respond to events from the physics engine. The physics engine might raise an event when two objects collide, or when two objects that were touching separate. The game engine will forward these events on to game logic code, which might respond by applying health damage to objects or adding points or so on.


THE PURPOSE OF GAME ENGINES-PAGE 6

Game logic may also influence the physics simulation. Game logics may decide that gravity is suddenly inverted because of a power up, or that the player’s character gets a vertical force applied because the player hit the jump key, or so on. This is often accomplished by creating a new object as defined by the physics API in use, where the objects represents a force or such. Game engines will typically try to unify all their systems behind a common API and object model. For example, a component-based game engine will typically have a ColliderComponent and a BodyComponent. The former will register a shape with the physics library (which also handles detection of colliding shapes without any physical response), and the later provides information to the physics library about how to handle collisions, forces, etc. An object in such an engine may only have a Collider if it is just looking to find out if objects collided (like a trigger).

Many games do not have a “game engine” per se. Smaller games typically have their game logic and their supporting code all merged together. Which is just fine: enforcing a strict separation increases complexity and wastes time if the code is not going to be reused for multiple titles in different genres. Likewise, many “physics engines” are not generic and are integrated directly with the game engine. This is especially common in platformers, and many 2D games in general. Some games require such specific physics requirements that a general purpose physics engine simply makes little sense to use. Mario games, for instance, don’t model anything in a physically accurate way, and the game behavior is almost entirely based on very specific physics behavior quite different than what a general physics simulator handles, so a general 2D physics library like Box2D is entirely illfitted to the game.


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.