Monday 8 May 2017

OO design

Object-Orientated Design
Assignment 2

For my game I have used various assets created using Maya, these vary from the character to buildings and intractable's. Using these assets I created a realistic world environment for my game, in order to quicken up the process i reused some of the assets that i created in order to fill out the world more, and in some cases edited them in subtle ways such as size or colour. This can be seen here with my trees which range from various sizes much like the real world, and the difference in colour of the trucks in my game.





In my game there is enemy AI which have different functions. Some will patrol areas and make sure the player is not in them, others will pursue the player upon sight of them. This is done through blueprinting, which enables for the function to work.



The top segment of blueprints tells the AI to move to random locations within a certain radius, this makes the AI appear to be moving around randomly as if he was patrolling an area. In the blueprint is a delay function that means once he has stopped moving he waits for 2 seconds (delay) and then repeats this blueprint. As for the bottom segment that is the follow me blueprint which enables the AI to follow the player character upon sight, this can be seen by the 'self' green code that means the target for the AI to follow if within the radius of the AI's view is the player (self).

This is very different to another game engine such as game maker, which uses written code to give functionality to its objects.


Here you can see a piece of code that enables the enemy AI in my gamemaker game to follow the player. In some ways the code is familiar, both engines code/blueprint involve the target both being the player object/character, however gamemaker works out the position and uses that to target the player whereas unreal engine does it purely on sight.

Another piece of blueprinting in my game is within the player, which allows him to move when you have pressed the W,A,S,D keys. 



This again in some ways is similar to gamemaker which uses the target of the player in order to know what to move (first person camera), both also work on a physics axis. This blueprint however finds out the variables it needs in order to do this however, whereas gamemaker you have to manually code the variables for it to work as seen in this screenshot.



This screenshot shows not only the code that is needed to make the player move, but also the collidable objects that the player can interact with. This is not shown in the unreal blueprint, as collision is a different function altogether, however it can also be manually placed into a piece of blueprints for special cases such as spawnable bullets.

In conclusion i believe the process of physically typing in line after line of code to be tedious and sometimes hard when you aren't certain of what code to use, however it is easier when you don't understand the various options for blueprinting, and the various sub features that may be needed in order to make the blueprints work. for exambple i attempted to create a blueprint which allowed for the enemy AI to be killed/destroyed upon collision with the projectile object from the gun. This didnt work throughout various attempts for various reasons, some of which are still not known partially down to the vast features of my game and the lack of full understanding of blueprints. This wasnt a problem in gamemaker however, where i personally found it easier to write the code for this function.