Tuesday 20 March 2018

Year 2 - Unit 71: Object Oriented design for computer games - Task 2


Unit 71: Object Orientated design for computer games - Task 2


Concepts and principles: simplified understanding; reusability; maintenance; efficiency; real-world modelling; collaboration and sharing; communication; quality assurance


Game objects: sprites; characters; weapons; rooms; walls; scenery; instances; rewards, eg bonuses, power-ups


Object properties: colour; size; speed; movement; sounds; health; lives

Actions and events: mouse and keyboard events; create; destroy; collision; timers; scoring

Inheritance: parent; child; inherited behaviours and properties; overriding events



Concepts and principles:

In Game Maker its a lot easier to understand the whole game engine rather than just small singular features. Anything from character art to coding is pretty simple to navigate around, this is possibly because of how clear and easy the whole engine is just at a look. Everything is right in front of you whereas with Unreal you have to literally search for all the different possible features. Unreal has so many features that to be able to learn everything you would have to put so many months of exploring the engine in. Although its not a bad thing, it definitely makes it harder to find what you need but then again maybe Game Maker doesn't have enough or as many good features.

Unreal Engine Layout
Generally you can use both of these engines over and over again and still come up with a whole new idea or concept every single time. With Game Maker though you can get a little tired of not having so much freedom as you do in Unreal. Reusing Unreal is such an easy and exciting thing to do simply because of how many possibilities it has to offer, I would much rather spend my time reusing Unreal than GameMaker.

Game Maker Engine Layout
The maintenance that these two engines have is pretty different, with GameMaker if the code has an error the system comes up with a window that says what part or line of the code is failing drastically. With Unreal they have a thing called Map Check Errors which alerts you of potential problems, this informs you of any Errors (critical problems that have a possibility of causing some sort of execution failure) which should be fixed before carrying on, Lighting issues (any problems with how the lighting performs), Warnings (these aren't as important as errors but can cause your game to under perform) these should be addressed but aren't the end of the world, Actor issues (there are many different types of these but they are based upon the character/player), Camera issues (if the camera is not up to spec and should be changed to actually be able to see whats going on efficiently), Foliage issues (if any trees or bushes etc. have something wrong with how look or work), Landscape issues (shows what may be wrong with the landscape e.g. overlapping) and Sound issues (any sound may be affected by issues and should be fixed if you want a fully immersive game). The two engines are different simply because of how specific they are about the errors they encounter, Unreal tells you what type of issue it is but Game Maker tells you exactly where it is.

The efficiency of these engines is pretty different as one is a lot quicker, I think personally, and the other definitely takes more time. Game Maker is quite an efficient because it does what it says and quickly whereas Unreal does do what it says it can, but because it has so many more aspects that can be changed to will it takes longer to complete.

The real-world modelling for both of these engines varies largely because of how many features they have, Game Maker is pretty simple to code, especially things like collision. unreal is a little more difficult because each part of the game has different codes that all need to be edited apposed to how with Game Maker most of the time you just have to drag and drop code or check a box.

Collaborating and sharing projects is pretty difficult with both engines but it is only directly possible with Unreal, although you can obviously copy and transfer your game file in both you can only do it without that effort of updating every time you want to by such a long winded way. Unreal comes with to integrated ways that make it possible for people to work together using a thing called Version control. It allows multiple people to share different assets and code with each other, it also has backup and any history of the changes made so the file can be reverted if needs be.

The communication between the different parts and aspects of the engines are pretty similar, however Unreal has a few more steps because of how it has more routines to go through. Game Maker pretty much just relays information between two main scripts and a few smaller checks, whereas Unreal relays information between so many codes and checks that its constantly busy.

Using quality assurance with these two engines is pretty easy but Unreal can be a little more challenging simply because fixing any problem isn't quite as easy as Game Maker but making a game in Unreal does give the game a higher quality feel. Finding any issues within Game Maker is a lot easier than Unreal because there's a lot less to go wrong on/with.


Game Objects:

Sprites and characters are pretty similar to create as are weapons, rooms, walls and scenery within Game Maker They all follow the same creation with pixel art or imported images. Characters, walls and weapons are all created as sprites and then added as objects which are then later coded into the game as they should be. Rewards and instances are more code than anything else and often need collision detection to work fully in the game. Creating rooms in Game Maker is a bit different, you create rooms not as a sprite like the others but as a room, you can do this from scratch with pixel art or just import an image. Just because Game Maker is all 2D doesn't necessarily mean it can't be animated, this is in the same sprite creation and you just add fresh frames and bend the image to your will. In Unreal characters, sprites, weapons, rooms, walls, instances and rewards are created as a 3D model mainly in Maya and are then transferred to Unreal for coding. The Scenery is the same and like the others it can be imported from the communities library. So Game Maker has a sprite and object builder built in whereas Unreal does not. Rewards in both engines are created as objects and then coded to give a bonus, power-up or some other sort of advantage. When creating a wall sprite in Game Maker you need to add it as an object and make sure you then tick the solid and uses physics box, this makes the wall collision proof so you can't go through it. For Unreal its a similar idea but instead of ticking boxes you program it in a way.

Object Properties:

The colour of objects within Game Maker is not that changeable as the colours can only be solid and on a basic colour wheel, if something wants to change colour halfway through a game it has to be part of a new frame animation. In Unreal there are so many different ideas for colour, it can just be a singular and generic colour or could be a whole number of textures like wood or concrete, all of these can be added only within the modelling software like Maya.

Changing position and size of object in
Unreal
To change the size of something within Game Maker you need to scale the image in the sprite creator from the transform tab and up the scale percentage up or down depending on what you wish it to look like. In Unreal to change the size of something you can do it in the engine rather than having to go into the 3D modelling software using the scale tool.

Speed in Unreal
In Game Maker if you wish to change the speed anything is going at you just have to go into the proper events and make a direction combine with a key and then add the move action and change the move speed from the pop up menu. In Unreal if you go to the character movement code you can change the max walk speed and then increase or decrease to your hearts content.

Sound in Unreal
Adding sound in GameMaker is pretty simple as all you have to do is link a sound action to a event, if its background music then it can be added just as a level starts or if its a shooting sound it can be added to that. In Unreal you can set sound as an event starts as well and change the volume as well. The coding for sound in Game Maker is definitely 100 times easier as its all available to build on rather than starting from scratch.

In the following link from the last assignment you can see how to create a health bar and lives in Unreal and Game Maker in the 2nd Example and the movement in the 3rd Example :
Image result for create object in unreal
Creating an object in Unreal
https://sarahsgamesdesign.blogspot.co.uk/2018/03/year-2-unit-71-object-oriented-design.html


Actions and Events:

Mouse and keyboard events in Game Maker and Unreal are both pretty similar and simple, for Game Maker you add whatever button or key pressed as an event and then add an action to that. For Unreal you do the same within the characters code. (Similar to the above movement. Creating something in Game Maker is really easy as you just use an event and then the create instance action, once that's done you can then add the new objects events. In Unreal you use the create new object action in a certain objects event when something happens. again these two engines have a very similar method of doing this.
Destroying an actor in Unreal
Cool-down timer in Unreal
To destroy something in Game Maker you link the destroy action to an event like a collision and in Unreal you also do the same within a certain model/objects event and select the destroy ___ action. Collision is explained further in the Game Objects paragraph above, in both of them there's an event called collision that you can use to make an action tagged to.
Setting a score in Unreal
Timers in Game Maker can be added within the games controller object as an events action as they are in Unreal, you can change how long they are on for and how doing certain things may affect the time limit, maybe collecting a timer increases how long you have and maybe getting hit decreases. These would be under a new event but would still relate to that original timer at some point. Scoring in Game Maker is done by yet again another event action it is explained further in this video: https://youtu.be/jkblYOI_Dqc?t=5m27s
In the whole video I explain how to do almost everything I've spoken about above in Game Maker so that video includes all my examples for Game Maker rather than just screenshots.


Inheritance:

Parent setting in Game Maker
Unreal parent setting for a gun
The parent object has the coding that is used for the child, it works the same in Game Maker and Unreal as one object is the parent, if you change this object in any way the child/children are also changed once they are recognised as its child. This just makes the whole enemy copying easier with just using inherited behaviours and properties.








References:
https://docs.unrealengine.com/en-us/Shared/Editor/MapErrors
https://docs.unrealengine.com/en-us/Engine/Basics/SourceControl




Tuesday 6 March 2018

Year 2 - Unit 71: Object Oriented design for computer games - Task 1


Unit 71: Object Orientated design for computer games - Task 1

Screenshots of how I created the gml
  •           How is it used
  •       Compared to this year
Attack, health bar, move
How is oo design used
More examples plus detail
How do we move in gamemaker vs unreal
3 examples
Paragraph of making a game in unreal vs gamemaker

Opinion paragraph at end

Example 1 - How to attack:

Code to create the ammo
Code to make the ammo move 
Code to make the enemy die if it
is hit by the ammo
Code to destroy the ammo if it
misses
In GameMaker to code a character to attack it's pretty simple as all you need to do is group a certain keyboard key to the creation of another object, this specific code is added to the object that releases the ammo as it were (the playable character in this case). Now once I press the space bar it just creates the ammo so I needed to make it move straight up towards the enemies that you are shooting at. From a pop up menu you can choose which way it moves and at what speed, this part of the coding will be within the ammo's events. After that is done we need to make it so that the enemy either disappears or loses health when it is hit by the ammo, this part would be located within the enemies events and actions and would be classed as collision detection.  However, I also needed to code it so that when the ammo missed the enemy it would destroy the ammo rather than letting them all gather. This small bit of coding is located within the ammo's events.


Attack Animation: https://youtu.be/GQlqwFiIiu0
In Unreal to make a character attack something its much of a longer process as you not only need to animate the action but also make it so that the action (for melee attacks) does damage to the enemy. Although I haven't included this in my game just yet I do plan to and this is how I will do it in this specific game engine.
Attack Damage: https://youtu.be/LjDsPr4ujDE
All of the coding for the attack animation will be found within the animation blueprints, Unreal has many animations that you can use so this part of the coding shouldn't be too difficult. Using a collision based overlap system we can code the character and the enemies so that when the melee weapon overlaps the enemy it does some damage. To make this accurate you will need to tell the engine the points in which it would actually overlap. (Shown at around the 2 minute mark of the video linked to the left). To make so that you only do damage to the enemy when you swing the weapon you will need to make sure that the weapons variable is used when swung to check if it actually is in contact/overlapping with the enemy.


Example 2 - How to create a working health bar:

Having the characters health full
Drawing the health bar
In GameMaker to create a health bar that is actually functioning we first need to make sure that the enemy/characters health starts on full, this will need to be in an invisible object's code and will start as soon as the game itself does. The second part of the health bar creation is to actually draw the health bar under the character. In the enemies code when it gets hit its life will reduce.


Creating the Healthbar
Health bar coding
In Unreal the creation of the health bar comes before the actual coding of the decrease or increase of the health. This piece of code basically just states when or not the character should regenerate  health or lose it. This code is found within the third person character under a health bar function.


Example 3 - Moving the Characters:

Move right
Move left
In GameMaker to make the character move you assign a movement to a certain key on the keyboard. Once that is set you can then change the speed to however high or low you wish just like when I did it for the ammo going towards the enemies.



In Unreal to program the character to do simple movements you don't actually have to do anything because it already programmed for you inside of the characters movement input. This makes it a lot easier to get straight into the other aspects. However, if you wish to do so you could go deeper into the specifics as it can be edited.



Conclusion:

In conclusion I feel as though there are so many differences between these two engines that I love them both for their own separate reasons. The reasons I love GameMaker are many, the first being how easy it is to code as a beginner and how you can expand from doing a more visual programming skill to an actual language whilst still using the same engine. I also love how simplistic it is and how you can create the sprites within the engine. But on the other hand I like Unreal for its endless possibilities of the graphics and how you can model such a complex and detailed model and use it within a game. Also the programming is slightly more complex than GameMaker's which is harder to get to grips with but gives you so many more possibilities of what you can do now and in the future of the game you create.



Screenshots used in higher quality are located within this folder:
https://drive.google.com/open?id=1C-bb9A6uXc8Czb2MtYJ1FnHMPyeiIgen