Unit 71: Object-oriented design for computer games


Concepts and Principles
In the world of game design there are many concepts and principles which can be followed to improve the overall feel of the game. Simplified understanding is one of these concepts, programming and unreal blueprint are quite convoluted, it's good to simplify them, because you might confuse yourself in the future when you look back on an object you create a while ago. Its a good idea to organise the code, for example you can use the "//" to create a comment or a note which will not effect the function of the code; this can also be used to create titles to structure the code. Their a similar way of doing this in Unreal blueprint- there is a "create comment" function, this creates a transparent box around an area of your choice, at the top of the box you can describe the function or purpose of this part of the blueprint.



Re-usability is an important principle in games development, a game will reuse many different objects, it's important to create objects that can be used in many different contexts, because games will have different levels/environments, and these levels/environments will probably look completely different from other levels, but you can't really design new objects for every level because that would take up a lot of time. It also makes more sense to reuse objects, because in the real world it happens all the time, if you look at things like houses you will notice that many are similar, if not the same when it comes to their design.
Skyrim reuses a variety of different objects, one the of most common objects are the barrels. These barrels can hold loot, which the player can find by searching through them, most of the barrels look exactly the same, but it doesn't really matter as they are really just there to find a bit of loot. Also Skyrim is a game set in the past, way before refrigeration was invented(although mages can still shoot ice out of their hands), in the real world meat would be stored in barrels with salt to preserve it; and as well as some loot you often find food in these barrels.

Maintenance as a games design principle, means to correct and improve previously designed objects, there are also many bugs to fix. Finding and fixing bugs is the most important part of the maintenance process, for every new object, or concept you create in a game, there's likely to be some sort of bug which happens because of it; and this is why being able to test a game whilst designing it is very important. 



Maintenance can occur after a games release, online updates can help improve a game.


This links to the games efficiency too, an efficient game is a game that can be played without massive drops in the frame rate, and without crashing or glitching too much; in order to stop these things from happening the game must be designed efficiently, this means that the game should not use too much memory. A way of describing this is "overdeveloping" a game, what I mean by this is that you can't have the highest standard of everything- there has to be a compromise, for example elements of the game that are commonly focused on- for example the character models for main characters, and enemies- these components should have the same good standard of detail. But for something which is not often in the focus of gameplay, like a texture which is in the background.



Real World Modelling is the principle of creating real world concepts in the game, for example real world physics are in a lot of games, this does not mean all games have to abide to the real worlds laws of physics, it just needs to make sense, if the player can walk through walls and walk on water for no reason, the game will seem a bit silly; but if the game is about a ghost who can walk through walls, or a superhero who can walk on water, its okay within context. A common problem games have, is when 3D models occasionally clip into each other.
Classic example of 3D models clipping.

Collaboration and sharing refers to linking two or more objects together in someway. These objects could work in collaboration with each other, or they could just share a function. Two objects that will collaborate together are: the exit to a level, and a entrance to another level, if one of these objects was not present, the player could not move the next level. A lot of objects will share functions in a game

The concept of communication is important in game design, objects must have some form of communication between each other, this will help objects collaborate together, it also enforces physics principles such as gravity and collision. For example when you aim and shoot an enemy in a game, there needs to be a communication between you and the enemy, the shot will hit the enemy and damage or kill them, the communication of the collision of the bullet on the enemy, and the damage the enemy receives, relies on the communication of the two different objects for the event to happen.

Quality Assurance is an important concept of games design, because of all the objects communicating with each other, there is bound to be some problems every now and then. Game bugs(or glitches) won't happen all the time, and when they do it is usually a short lived problem which can be solved by reloading the game; but some glitches can ruin a game experience, these are known as "Game killing" glitches, as you might have to completely start over. Quality Assurance is an important thing to keep in mind whilst designing a game, you should test your game yourself whenever you add anything new that might create conflicts between different objects. QA testers will play the game and find any problems, but they only have so much time to do so, they cannot find all the glitches, but they can find some; some people will try and glitch the game on purpose to find any exploits, you should keep this in mind whilst creating the game.



Game Objects

A sprite is defined as "a computer graphic which may be moved on-screen and otherwise manipulated as a single entity." Basically a sprite is a 2D computer graphic, but the word sprite could also refer to a 3D model, a 3D model is a 3D computer graphic. 
A 3D model


Some 2D sprites











Characters are a needed part of most games, characters are simply objects with a set of functions, the protagonist of the game- the one the player is controlling- will most likely have the most detailed object design, as the games controls will more likely be set up within this character. Non playable characters(NPC's), are objects with AI(artificial intelligence), this means that they will carry out the actions they have been programmed to do, this could mean following set paths, or following combat AI; NPC's can be recycled quite easily, all there functions can be reused and you probably wouldn't notice. re-skinning the 3D model is a way of making all the NPC's look unique.

The majority of modern games will have some form of weapons, or item that the player uses to progress through the game. This weapon will probably have a separate 3D model/2D sprite-unless it's acted to the players body- it should also have some action animations, such as a muzzle flash for a gun, or a swing for a sword. Games don't usually just have one weapon or tool the player can use, they can switch between different items which have different purposes, and are more effected in different situations.




Room/levels are the worlds the game is set in, there are many different types of level design, some games will have an open world, this means that the play can explore at their own will- for example Fallout. But the majority of game will have a more linear level design, this means that there will be levels which the player must complete before they can go anywhere else- for example the Super Mario Bros games. The open world level design might seem like one big level, but actually games designers will program the game so it only loads the part the player is in, open world level design creates a sense of freedom whilst playing.
 A more linear level-if designed well- will challenge the player, for example a plat former such as Crash Bandicoot has levels which are designed to damage the player, there are enemies in the levels, but the biggest threat to the player, are the traps and timed platforming sections within the level itself.


Sometimes the levels will try to kill you.
Walls are more important than you think in games, a wall creates a boundary for a player, so they don't end up falling in the abyss(outside the level). The purpose of walls is to keep the player in a specific area of the game. Not all walls will be an actual wall ,some games will use objects which fit the games context to block the player from going further. For example in many first person shooters such as call of duty, a barricade or a destroyed tank will block the player from leaving the games play area. Invisible walls are also used in some games for similar reasons, but many people believe they make a game feel less immersive; however a game like Battlefield has invisible boundaries which are not physical, instead you will be given a short amount of time to return to the game area, when that time runs out you will die.

Scenery is what goes in the background of a game, the purpose of scenery is to create a world outside of the games world, in a lot of games, the scenery is there just for show; but in some open world games, scenery is also interactive, for example in Grand Theft Auto 5, there is a huge mountain visible in the distance- you can climb to the top of this mountain and do lots of crazy things such as riding a bike down the face of the mountain.


Instances are objects which are carried throughout a game, for example player stats, health, and ammo, are all instances which can change as the game is played; if you are damaged in the game, and you health points go down, the instance of your health will be different until you heal yourself- or your health regenerates.


Rewards are an essential part of game design, you need to reward the player for completing an objective, this can be done in many different ways. Usually rewards in game will work like this: the player is confronted with a challenge, the player completes the challenge, the player gains something which can help them progress through the game, like an object, or piece of information which could make them more powerful and knowledgeable. Power ups and bonuses are another type of reward, some power ups are temporary for example Mario's invisible star. Objects can add bonuses to a characters stats, for example in the Dark Souls games, adding fire or poison to your weapon will cause greater amounts of damage against enemies.




Object properties

Objects will have all sorts of different properties to them, they will have different visuals properties such as different colours. Games use textures to show colours and details of different objects. Size is a common factor in video games, there will always be an enemy which is bigger than the player, for example a lot of boss battles will use size to create a larger sense of danger. Speed is a property that is used in a lot of games, speed is an instance which can change how fast the player moves, speed can be a stat, a fast character will be more agile, and can have increased movement abilities. There are many different types of movement you can use when creating games, no game really controls the same, some games will have very slick controls, some games will have controls which aim to be realistic- so there will be no spinning around in circles when the player moves the analogue sticks 360 degrees; the problem with these controls is that they might not feel as responsive and smooth as traditional 3D game controls.




Actions and events

A game's controls are a series actions which initiate events to happen, for example if a play points a mouse at an enemy, and then click the right mouse button, this will cause an attack event to happen- if they have a gun, they will shoot, if they have a sword, they will slash. But in order for something to happen there needs to be other events- such as create events, collision events, and destroy events. The create event will be the bullet coming out the gun, the bullet will be a separate object- or it could just be a animation event. The bullet then needs to collide with the enemy, in order to do anything, there needs to be collision detection, so that the enemy knows they have been hit, and the instance of the health will lower in value. The next event is the destroy event, when the enemy has lost all their health, they will die, and the destroy event will take place. This could mean that the enemies death animation will start, or they can just "ragdoll" to the floor like a lot of games do; these are both preferred methods showing that the enemy is beaten, although a destroy event can simply be the enemy disappearing into thin air, it's up to the game designers and animators to create how it looks.
Rainbow Six Siege- Death Animation.
CS:GO- Death "Ragdoll", player model will launch to the floor when shot dead.






























Timers are a way of setting up events to happen at a certain time, this helps stop every event looking random. Timers work by players activating them, however it is not known to the player that they have started a timer; a timer could start when the player has carried out an event- like pushing a button to open a door. When the timer has run down to zero an event will take place, this event could be an enemy appearing, or an alarm going off, or some other sort of change in the game.


Scoring has been used in games since the very beginning of games- arcade games were all about the scores. Scores are still used in games, but they are commonly shown as some sort of spendable integer. For example RPG's have Experience points(XP), XP can help build a character, and make them stronger. This is not just in RPG's though, multiplayer FPS's use points to allow players to unlock new weaponry, or customisable items.

Inheritance

Inheritance in games design refers to different objects which have inherited values. A parent object will have a series of functions and properties, which it can pass on to the child objects. A child object is an object which has another object set as it's parent, the child will have exactly the same functions and properties as the parent, any changes made to the parent object will effect the child object too, however any changes made the child object, will not effect the parent object. Child objects can also override the behaviours and properties of the parent objects.


http://gameprogrammingpatterns.com/prototype.html





Comments

Post a Comment