We are now in Sprint 1 full-time! If I do say so myself, the AI is looking great. It encircles the player, the enemies in the front row will attack you, and they will chase after you in a derpy way if you try to run away. I'll have to work on making it a more fluid chase in the future, but now I'm working on getting the AI to use a navmesh (my main goal of Sprint 1). It's difficult, as the way I currently have the AI set up in Unity is using its built in 2D settings. This puts everything on the X-Y plane, with the Z-axis being the axis you are looking through (the "height" axis, which isn't used in 2D).
The reason this is difficult to set a navmesh up in is well, navmeshs can only be setup on the X-Z plane. So this means I will be spending the next bit of time setting up my AI test scene so that I will no longer be using the default 2D settings. I'll have to rotate everything in the scene to be on the X-Z plane, change every variable that uses an X-Y coordinate, and remove every 2D component and change them to 3D (colliders, rigidbodies, etc). Yeah. It's gonna be a pain in the ass, but it will be oh so worth it in the long run. Using a navmesh is going to let us navigate the squads/troops through the levels with ease.
Like you can see in the picture above, making the navmesh is easy. It's getting the troops to do the right thing at the right times that's difficult. It's coming along though, I've got the navmesh set up and I am just modifying my scripts to have the enemies actually use it. I'm adding NavMeshAgents to every squad member. I've been debating between putting it on the squad vs each squad member, but I think putting it on each member will make things look more fluid, and a little more chaotic (which is what we are going for, while still maintaining control of the enemies).

No comments:
Post a Comment