Thursday 12 January 2017

Ice Physics

Basics - For my first prototype I will be displaying programming concept of physics through the ice. When the player walks on the ice there movements will be slippery. For this, I need to edit the character's movement when he collides with the trigger box. 

What - To start with I need understand how I to create ice physics within my level. So I looked up methods of doing this on the internet. I was able to a forum which asked  'How can I make a character slide on ice?' (Answers.unrealengine,2015). Which showed me how to change the character's movement when on the ice. Another forum which asked 'ground friction setting not doing anything in first person template?' (Forums.unrealengine,2015). While not the question I was asking for but it did give me to important nodes within the Character blueprint called 'braking deceleration walking' and 'Ground friction'.



How-  I first needed to create a custom event which I will need to reference in the ice volume. Then I needed to cast to 'IceVolume' so this blueprint effects Ice volume's blueprint. Next, I set the deceleration walking to '0' and the ground friction to '0.4'. For Off Ice custom event I have set the deceleration walking to '2045' and the ground friction to '1'. The reason why is that I want the character movement to be different when he is on the ice to when he is off the ice. Finally, I linked all of the set variables to Character Movement so they will affect the character's movement.

After I wrote the blueprint within the 'Third person character' blueprint, I needed to reference the custom events within the 'Ice Volume' blueprint. The blueprint below shows when the character begins overlap play 'On Ice' event. When the character ends overlap play 'Off Ice' event. 



Where - I am using this Ice volume blueprint on the two platforming puzzles to make them a challenge. I have created broken pieces of ice which the player has to jump from one to the next.

Why - To add the aesthetics of the winter with the snow practices and now ice. I wanted there to be a theme of winter and use this theme as a part of the gameplay. I make the pieces of ice white as a semiotic of the ice itself so the player would understand what they were. I could of make the ice physics in a different way like make the ice volume itself create slide movement. It was faster and easier to make the ice volume activate the custom event within the character blueprint itself than the other way round. 


Industry expectations - 

 Maintainability of this blueprint is easy to restore. If there is something wrong with the custom event I can break the links within the 'Ice Volume' blueprint to check what is wrong without affecting the rest of the game. I can also edit the 'deceleration walking' and 'ground friction' rate if there is a problem with the character's movement.

 This blueprint is dependable. The set custom event connected to begin overlap mean the blueprint has to work when the character overlaps with the trigger box. The overlap triggers the event. I have also made sure that the character will return to normal when the overlap end as I have create a custom event for when the character is off the ice. 



Ready made libraries - This blueprint won't work without the use of ready-made nodes from the character class. Within the character class, I used 'deceleration walking' and 'ground friction' to change the movement of the character. This won't of worked in the other classes like actor or hub. 


Re-usability - I was able to duplicate the trigger box to use on the other side of the level. That means that within this Unreal project I could re-use this blueprint as much as I want. Whereas if I wanted to re-use this blueprint in a new project, I would only need to make to sure I use the same names for the blueprints and paste in the right place and it would work just as well. While I wouldn't use this in any game, could use this whenever there is ice in a game. What makes this great for re-use this the fact that I can edit the 'deceleration walking' and 'ground friction' rates for what I want.


Bibliography

Answers.unrealengine, (2015). How can i make a character slide on ice? - UE4 AnswerHub. [online] Answers.unrealengine.com. Available at: https://answers.unrealengine.com/questions/311998/how-can-i-make-a-character-slide-on-ice.html [Accessed 9 Jan. 2017].

Forums.unrealengine, (2015). ground friction setting not doing anything in first person template?. [online] Forums.unrealengine.com. Available at: https://forums.unrealengine.com/showthread.php?66455-ground-friction-setting-not-doing-anything-in-first-person-template [Accessed 9 Jan. 2017].


No comments:

Post a Comment