Members - Reputation: 102
Posted 07 May 2012 - 09:56 PM
This project was my first attempt at a flocking algorithm. I used the Unity wiki boids script as a starting reference and went from there. You can change the weighting of behaviors in the web build. Q and A will increase or decrease “Randomness” respectively. Likewise W and S will control “Cohesion”, E and D will control “Alignment” and R and F will control “Separation” which starts out heavily weighted as there are no colliders on the boids. The boids will also fly towards and then around three way-points.
This project was an attempt at basic AI behaviors using Unity's NavMesh component. I was given behaviors from another student that he wanted included into his game. This build is very primitive and I have moved the camera back so you can view the behaviors bettor. The enemies will change color based on there current state. Blue is idle, red is attacking, black is retreating, yellow is patrolling, and green is wandering. If you face an enemy and press Q you will “attack” them, their health will decrease and once their health gets low enough they will retreat, if far enough away their health will regenerate and they will attack once again. One enemy will start out wandering and the other will start out patrolling, if either “see” you they will attack. Be warned some walls do not have colliders and you will then fall for ever, I don't think there is a key to reset the scene and I am a little pressed for time at the moment.