Second week, a new base and completion
|
So, much to talk about and a lot to take in! So this week I redesigned the A.I behavioral tree from the ground up accordingly to my lead programmer and lead designer, and added the attack action! So lets start, my enemy A.I needed to be faster in reactions, better in its rotations and have more actions. The A.I had to patrol, guard an area, look for enemies and listen for disturbances. Whenever it found an enemy by seeing it, it would move to the player and when it was within attack range, shoot spells at him. I found a great, tutorial that helped me achieve these designs.
So now The behavior tree looks like this. Here you can see that I have a script that checks the distance to object, this specific blueprint finds a specific target point in a and gets the two dimensional space between them (as I don’t want my A.I to jump) and goes there. From there, the A.I will collide with a trigger box and be told to move to another target point (somewhere else) to always keep patrolling when idle. So the first action he makes is moving to the target point of my choice then to the other. I also added a variable here which the A.I always checks to see if he ever moves beyond the first target point. If this happens, he resets and moves back to the target point, effectively enabling a guard area which is top priority in all the actions. The second action is if he ever sees an enemy (the player), the A.I’s perspective is 180 degrees at the moment but can be changed depending if we want to implement some sneaking into the gameplay design. When he sees an enemy, he moves until a specific attack range and starts attacking. The attacking blueprint is made by a tutorial from an asset bought on the store. A very cool spell casting asset where you can create spells and some more as you can see from this blueprint. Third action, has the enemy A.I heard something (public variable for hearing range), he will move to that place to look around, wait one second then move back. Something not told since the second action is that the guard area is the highest priority, if the enemy A.I ever moves beyond that point, he will move back. The interesting part with this behavior tree is that the public variables available are so great that we will be able to generate some interesting enemy A.I’s from them. Conjure speed = and that’s about it. It looks very fun to sneak behind the enemy A.I at the moment, just making him run around looking for me or just dodging his spells. Next week, I will start working on the boss A.I! Stay tuned. |