Tuesday 1 April 2014

Components of a Games Engine

Components of a Games Engine
Renderer:

This is a process which you generate an image from a model by using certain computer programs or gaming engines, some of those could be CryENGINE 3, Unity and Unreal Engine 3. The results when having done this would be called a rendering.

A renderer has a number of tasks that it need to compete in order to produce a finished product, some of these tasks include processing 3D models which you would create, this would include everything from level designs and characters you create. Another could be the camera view point and where it would be positioned within your game in scene and game-play. Another could be deciding when in the game what the player is allowed to see and what they cannot see, this would be certain parts in the game where something is blocking the view to the next part of the game, it is done to save time and effort from the renderer having to render images or game-play which the player dost necessarily need to see at that point in the game. Finally another would be the lighting effect which is a very important factor in a game especially if the games genre is something to do with horror as lighting is significantly important to producing a feel to the game.


There are three main effects that are used in games today, one of the techniques used in this is called Levels of Detail or LOD for short, this would include small details within the game such as rendering something using geometry which only really needs a lot of polys when the object is close to the cameras viewpoint, so when the object is further away using a low poly models isn't necessarily a bad thing as the player wouldn't be able to tell the different with the naked eye, most notable games that use this technique are Red Dead Redemption, Grand Theft Auto 5 and Grand Turismo 5. Another would be not allowing the player to see too much or the “To much seen at once” which basically is about hiding certain sections of the game by using buildings or objects which would obstruct the players view which aids when rendering as is would save someone a lot of time doing this. The final technique would be Culling of Geometry; this is used because computers don’t have any concept of distance or depth, so the computer would have to work out which objects are in front of others. When using Culling this is trying to make this process easier and more efficient as possible. Some of the problems of real time rendering could be the fact that some of it might not be needed; this would result in a lot of wasted rendering which could be called “overdraw” which results in no optimisations so would end up being a slow game due to the frame rate having changed, to put it simpler, if the player doesn't really need to see s part of the game then there isn't any real point in allowing it to be rendered. 

Collision Detection & Physics:

Collision detection is a contact of which one object touches another. In games today collision detection is used in almost everything, when it comes to first person shooters there are a number of ways it is used from the bullets making contact with either another character, walls, fences and other things. When it comes to different games like fighting games then the collision detection's would be programmed for when the characters land blows on each other or when then make contact with objects in the game like boxes, fences etc and also the floor. Finally another game where collision detection is used greatly is in sport games such as football, rugby and tennis, using football as an example, games like FIFA where you would have to program collision detection for when a player kicks the ball, although there are different ways a player can hit the ball may this be through the standard foot, head and ever chest. Other players would have to be taken into consideration for when the ball hits them from another player shooting or even when player collide with each other through tackling.

 Computer game physics involves the introduction of the laws of physics which is then put into a simulation or game engine; this is often seen in 3D computer graphics which has the purpose of giving the sense of effects being more real to the spectator.

There’s different ways that physics can be used in games. There are two separate types of physics simulations; they are rigid body and then soft body. When it comes to rigid simulations the objects are grouped into categories that are based on how they would or should work together and are less performance demanding. Then for soft body it is the physics involved for simulating individual segments of each object so that it would behave in a way that is deemed to be more realistic.

Another aspect of computer game physics is particle systems which is a common feature. Early games that used this feature would often repeat the same sequence like an explosion over and over again in each circumstance. Yet in when comparing this to real world situations an explosion would depend on a variety of things which would include the types of terrain that would be there, the altitude of the explosion and any kind of solid objects which may be near such as bodies that would be impacted. Particle systems allow a number of physical phenomena which could be smoke, flowing water etc. Games where this would be most common would be games like Call of Duty and Battlefield, Battlefield being more specific as it has the added feature of buildings and other objects which crumble due to blast or explosions from other objects which is something that Call of Duty lacks. 

Artificial Intelligence:

Artificial Intelligence in computer games is used to project and capture human-like intelligence, human behavior or subjects of intelligent behaviors which is primarily seen in NPC’s or non-player characters.

There are different types of Artificial Intelligence within the gaming world, one is of course Game AI, this kind of AI is all about making the game more fun and enjoyable for the player to experience, the other is Scientific AI, this type of AI is designed in an attempted to simulate real intelligence which would be human behavior. There are many different job roles in a way that Game AI needs to do, some of those could be that they would have to navigate through different levels of a game, this would be a difficult task for any game as they would need to program the AI and its behavioral patterns to adapt to this, a great example of this could be the game FIFA, as the team would have to give each individual player certain types of behavior, whether that would be to stand idle or tackle or shoot, the amount of detail that goes into creating a game like that goes unnoticed in most gamers today. Another task that the AI would have to do would be to act out strategies, again this brings be back to the game, FIFA as the player would have to decide on such things like formations and where the players would play, if the player decides during the game to change any other mentioned above then the AI’s would have to adapt to the new strategies so the programmers would have to implement each different formations and positions into each player which in fairness is a lot of work which again it goes unnoticed with majority of players today.  

One of the biggest questions that are raised when it comes to AI characters is that simple question, do they cheat? The answer to that would be yes, they do cheat. Some of the reasons that the programmers would let this happen would be because it would make the game more enjoyable in a way, it would enable the game to be different each time the player plays. An example of this is best shown in a first-person shooter, as the human controlled player would have to aim with precision and technique depending on what weapon they are using, comparing this to an AI controller character where they would always have near perfect aim, their weapons would have little to no recoil.

Next I will be using an example of AI in a NPC from a game that I have played, the game that I have chosen is the first Metal Gear Solid, the NPC that I will be explaining are the guards from the game.
The guards in the game are very simple and have a simple objective which is to patrol the area and look for you once spotted, the guards are programmed and have their own paths which they follow on each level of the game. Instead of just walking round the map aimlessly, they do have other animations which make them seem less boring in a way, this involved stretching every now and then and occasional chat with another soldier.

There are three different behavioral statuses which the first one being Alert, which means they've spotted you and will pursue you until they lose sight of you, if you are spotted then the timer which would be displayed would reset and you would have to try and evade the guards. The second is Evasion which is a state where you have evaded the guards, but they are still on alert and searching for you, again there is another timer which runs down, if you are spotted then the process from going to the first alert to Evasion mode. Finally the third status is when you have stayed hidden during the Evasion status and now the guards are back to being on patrol. The first two alert statuses cause your map to be temporarily blocked until you evade them. 

Middleware:

This is software which is used by computers which enables them to provide services to software applications that are beyond those available from their operating systems. Usually Middleware can be portrayed as “Software Glue” as it holds everything together. Using middleware makes it easy for the software developers to perform communication inputs and outputs; this will then let them focus on a specific purpose of the application.

Middleware helps develop a game as is relieves a lot of pressure for the development teams, this means that they won’t have to go through the stress or hassle of having to code specific elements of the game individually, this then means that if they did do this themselves then it may delay the development process and would take longer for the game to be released. The middleware software can be expensive, but purchasing this piece of software would prove better than hiring employees to code the game themselves in the long run, hiring more people would cost money paying them and would use up valuable time for them coding the game for endless hours each day when it could simply be done by using middleware software which has already been tested and proven to work and has a greater chance of working.  Also using middleware allows you to change the applications behaviour without having to modify the code of the application.

Middleware can have its problems; some of those being that a buggy piece of middleware would be considered as a twice as bad because instead of freeing you to focus on another piece to function on, it makes you focus your attention there on the code which was written by someone anonymous   which would prove hard for your company to follow if they don’t understand what the stranger has put. Another would be that if the engine maker goes out of business, hasn't got the financial backing or just decides they don’t want to be in the middleware business anymore then that is when you’re in trouble. The engine doesn't necessarily cease to exist and neither does your licence, but on the other hand you shouldn't expect to have their support anymore.  As everything has its bad points, there are some benefits to having middleware software, one of those being the middleware software provides you with a lot more code than you could ever write yourself, this would be a small price to pay for something that would cost a lot more for you to learn, another would be that the middleware suppliers can actually afford to keep larger and more expensive teams which can work on any given piece of functionality than any other indie game developers could ever do.

Havok AI gives the designers an easy control when it comes to required features in the game. It then focuses on the characters movements and large scale environments, so for this it uses path finding and path following and also it would use navigation meshes. These would allow them to simply pre-program paths for the characters which they would follow. All they would then need to do would be to specify to whatever kind of middleware they have to give specific information. This would be used to influence the characters behavior but that would depend on the environment or situation. The middleware intelligently specifies queries that can give non player characters or NPC’s the ability to make their own decisions about the environment. The NPC’s would also be able to predict the movements of other which are located I the environment and would be able to function accordingly to the information provided, this would be considered to be an interesting feature. So all of this indicates there wouldn't be any kind of random or accidental collisions between other none player characters, thus adding a sense of realism to the environment.