Not mush to show visually for this post.
I’ve been busy moving the inventory system over to C++.
I’ve also been tackling some hurdles with the AI sight. I didn’t get on well with the AI perception. So I’ve coded AI sight from scratch.
Perception can be used later on for other reactions such as hearing etc.
I originally just a ray cast from the players eyes, to the enemy characters. This was working if they were both stood up, but caused issues if they were crouched or prone behind cover. So the AI now shoots a ray to the actor origin as before, but if that fails, it cast’s a ray to the other actors head. This seems to be working pretty flawless. The caveat being that they wont see if only the legs are showing under cover, but I can live with that. Even then, the way I have structured the sight function, it would be easy to add this in. The sight function does all the filtering at the start then only line traces if for example, the enemy is within a certain distance. If the first line trace fails, it tries the line trace to head. It would just be a case of doing that again to a lower point of the enemy body. Like I say though, I’m not fussed about that really.
Getting the location for the head location was actually easy in the end. At first, I was trying to think of some crazy mathematical solution for an adjusted location from the actor location. In the end, sockets came to my rescue again. Just put a socket on the enemy skeleton in the head, just cast a ray to the socket location. Easy