Submissions from 2017-11-09 to 2017-11-10 (1 total)

Tonight started with a bit more cleanup work on the weapon/reload side of things. Though, I still see some much needed refactoring in my future, for now, the system is at least working reliably. That meant it was time to start investigating adding a bit of movement AI...

Currently, my enemies simply lumber slowly down the Z-axis toward the player in what's basically a straight line. Ideally, I want holes and obstacles and such in my levels and I want the enemies to navigate around those items. Unity's NavMesh agent *almost* gives me what I want. It's great at path finding and will even move along that path. However, it doesn't really allow for interaction with the physics system. But, I'll be damned if I'm going to let that stop me.

What I'm showing off tonight is the simple start to my movement solution. The Yellow Ball is the enemy I want to control with physics (yes, the stuttering in his movement is intentional). The White Box is the agent traversing my NavMesh and the Green Box that I'm moving around manually is the agent's destination. The goals are simple: The enemy attempts to 'physics' its way toward the agent. The agent will wait around for the enemy to get 'close enough' to it an then it'll start moving toward the destination. If the enemy falls too far behind the agent, the agent will stop and wait for him.

In my simple testing, this idea seems like it'll work nicely for my basic needs. That said, I'm going to have to add logic like warping the agent back close to the enemy if the enemy gets blasted waaaay far away from the enemy. And, I'm sure I'm going to have to do some additional tweaking once I actually have obstacles to account for, but, thus far, I think this idea has some promise.