NestorTejero / ES2016A

VideoJoc Curs Enginyeria Software 2016 - grup A de pràctiques (dijous)
https://nestortejero.github.io/ES2016A/
GNU General Public License v3.0
2 stars 0 forks source link

Redefine attacking behavior #164

Closed sdiaz7 closed 7 years ago

sdiaz7 commented 7 years ago

Current behavior makes enemies charge suicidally towards the tower. Redefine such behavior so that they wait near the player's tower and keep attacking it.

Definition of DONE:

The idea is to add an attack animation that displays while enemy attacks the tower. Such feature will be implemented at issue #165 .

Branch: dev_Issue164

Time estimated: 8 hours

sdiaz7 commented 7 years ago

After the first commint, enemies have stopped dying when colliding with home. I am pondering about increasing home's box collider size, forcing enemies to attack from a small distance.

sdiaz7 commented 7 years ago

After second commit, enemies stop their navigation agent when colliding with home. I wanted change home box collider's shape into a cylider, but Unity does not support cylindrical primitive colliders. I thought about adding an invisible cylindrical object with a mesh collider arround home, but after some research it seems that it's computationally simplier to detect collisions using a capsule collider.

On subsequent commits I want to prevent enemies from pushing each other, which causes some enemies to trespass home's mesh.

sdiaz7 commented 7 years ago

I've added a NavMesh obstacle to the home prefab to prevent enemies from pushing each other. The obstacle is slightly smaller than the collider so that enemies can still collide with home.

I've observed that some enemies do not face home when attacking. Last commit includes a temporary solution to that, which forces enemies to look at target once per frame while attacking.

sdiaz7 commented 7 years ago

I've redefined the behavior so that enemies attack to towers blocking their path (rather that outright destroying them). I am still testing this feature, so it might be a bit buggy at this moment.

sdiaz7 commented 7 years ago

Bugs found:

Last commit fixes both bugs.

sdiaz7 commented 7 years ago

Work here is done, but I will be performing some tests before opening the pull request.

sdiaz7 commented 7 years ago

Branch merged into dev after approval. Issue closed.