Thursday 4 May 2017

Outside the Box Project Beta Work - Damaged Enemy Appearances In-Game

One major thing we want to add for definite given more time to work on this project are damaged versions of The Monsters that will appear contextual to the numerical value of their Health bars. For example at MaxHealth (3) The Hunter will look fine, then at 2 HP (Health Points) The Hunter shall appear dirty (as seen in Figure 0.5), and at 1 HP The Hunter will nearly be toppling over from exhaustion.

Figure 0.5
I modelled The first damaged Hunter and tried to implement him before hand-in, however it didn't quite work out in time.

Figure 1.
I had to create a new Prefab for this to work, like how the Tower, Cannon and Magic Defence appear when they are upgraded the same principle applied here. The visualisations of The Hunter would be contained within an Empty GameObject and their SetActive Boolean would be made true or false based on The Hunter's current Health value, like how the Defences are upgrade, and with each defence having their own scripts governing their behaviour, as soon as they're turned on in scene, they run as they should. The Hunter, meanwhile, simply needs to look more beaten up, so the visualisations don't have scripts governing behaviour as their behaviour doesn't change just because they got hit by a Defence. All of this can be seen in Figure 1.


Figure 2.
So in the if statement as seen in Figure 2. I just checked the value of currentEnemyHealth in the referenced Manager Script and turned off and on the appropriate referenced visualisations.

Because I created a Enemy Damage Manager Script, it saved me from having to separate the health values for The Grunt and The Hunter and I could just reference the Enemy Health Manager on the gameObject the Damage Manager was attached to, which was now the empty GameObject that contained The Hunter visualisations, as I had also moved all the scripts from the one Hunter model to this Hunter Container so that all changes would happen to all versions of The Hunter.

Such as when The Hunter's health reached 0 the container and all the visualisations would be destroyed, rather than the one version.

However the problems I faced were time related. By moving The Hunter models into a container I had to spend time to reposition the models so that they would appear correct when spawned and follow the waypoints correctly. I would have also needed to model the other damaged Hunter and the damaged versions of The Grunt, and texture them, then implement them in game, and I just didn't have the time to sort this out.

So, I know I can do it, I've shown that here, but I didn't have time to complete it and fully implement this, hence why the damaged appearances won't be seen in our hand-in game build.

No comments:

Post a Comment