I’m somewhat stumped at the moment when it comes to adding AI to my project. I’ve created a custom Hovertank Pawn that does nothing more other than manipulate the Angular and Linear velocity of the craft, based on input. There’s some more complex math behind that of course, but that’s all working just fine. It has a custom movement component, but to be honest it doesn’t do anything fancy like prediction or non-physics based movement, it’s a barebones PawnMovementComponent with my code that updates the physics state of the craft. This is all done in C++ of course, and I rely on ReplicatedMovement and replication of the Input given to the craft for smooth network play, which has been sufficient so far.
The problem now is that I’m trying to set up AI for the vehicles, even something like simple movement (Move from point A to B etc). I’ve looked in as much detail as I can regarding the behaviour tree system and the default behaviours such as ‘Move To Actor’ etc, but they all interface somewhat VERY directly with Character Movement Component, just by giving it a vector direction to move in from what I can tell. There doesn’t seem to be any code that provides real ‘input’ to the pawn, which seems kind of hacked IMO and it limits how useable the navmesh system really is. Great for building a game based on humanoids where you can use all the existing code for that, but what about for different kinds of pawns like vehicles etc? Even the WheeledVehicles provided with the engine don’t seem to have any AI system at all - and I can’t get any vehicles to respond to Behaviour Trees at all.
I want to be able to use the NavMesh system (since, why bother writing my own pathing system right?), but it seems like the only way to do that is use this method of just giving the object velocity. That’s not going to work in my case since a lot of things depend on the input to the craft, like the material on the engines, the aiming of the craft etc. It also explains why AI characters don’t seem to pay any attention to the properties you give them when they are tweaked, according to this post.
In short, it feels like the Nav-mesh system is pretty much bound to characters that use CharacterMovementComponent, and that it has very limited use-ability in anything outside of that. Maybe I’m mistaken and need to go a bit deeper, but I’ve looked almost everywhere I can think of in Engine source and can’t find any pointers or clues as to where to start creating behaviours that interface with my pawn. If there ARE ways to do this, I would really like to hear them!