Tuesday, 2 May 2017

Unit 52: Ideas Generation for Computer Games

This unit was mainly focused on character implementation and character control based gameplay mechanics.

This involved creating both a player character and AI based enemies.

Due to time constraints, we used pre-rigged and animated characters from the Mixamo web service.



This is a good way to get started in a project, as we can get gameplay mechanics in place before having to worry about creating and rigging models.

I also created some basic placeholder weapons to go with the character.



These were all imported into Unreal Engine ready for the next stage.



To set the weapons up, I added sockets to the character skeleton and attached the weapons. There are two attach points for each weapon, an equipped and a sheathed, which are hidden and shown depending on the weapon stance.



For damage, I added collision capsules to the weapons, which will be tuned on and off with the attack animations.



For animations, we first set up a thing called a Blendspace, which will blend between two or more animations based on parameters. This one is for the Sword and Shield idle into run animation, there is another for the broadsword.



To switch between our weapon stances, I used AnimNotify points coupled with some code to show and hide the correct weapons. The AnimNotify is a sort of signal or event on the animation timeline which can be captured by other parts of the program to cause other events.



AnimNotify events are also used to control the weapon damage, turning the collision on the sword on or off as the attack plays.





To create an AI enemy, it was initially quite similar to how a player was made, adding the character model and animation control, etc.

The main difference is that the AI needs to be able to locate the player, which for a very sinple AI is relatively easy.



This code gets the player location then moves the AI towards it.

The enemy attacks are also set up in a similar way to the Player, with collision capsules on the enemies hands and AnimNotify events on the attack animations to trigger the collisions on and off.

The main additional thing required here is the enemy needs to know how far they are away from the player, to decide which attack to do. This is controlled by a distance check and branches which will filter out what attacks are valid for the AI to perform at each distance.




For the Health, Energy, etc. set up, the HUD had Progress Bars added to it, then the bars were linked to variables. These variables would change based on the health, etc. and thus would update the progress bar level on the HUD.



To add some additional gameplay, I created some Ultimate Attacks, in the form of damage causing blueprint objects that the player spawns when they have enough energy to perform the attack.

One such attack was spinning flaming swords, with damage causing collision capsules attached.



One major feature I wanted to achieve with my project was Controller Support.

I used the input mapping option in the project settings, then swapped all of my blueprint inputs over to this system, which worked well.

No comments:

Post a Comment