I think that I’m going against the current and I seek advice on how to achieve the following:
I want to have a client that connects to a dedicated server. On that client, I want to run AI code in order to simulate human player action in the game (Move To, shoot, jump, etc.)
The network login process uses a Player/PlayerController in its flow which prevent an AIController to establish a network connection to a server. Embracing that constraint, I’m trying to create a PlayerController that use AI component like the Blackboard, PathFollowing and BehaviorTree component. However, the BrainComponent amongst other component expect an Owner to be of type AIController. Obviously, this custom PlayerController don’t qualify and nothing is working properly.
“All” you need to do is to have a proper, regular AI setup on the server, and have player controller issue commands/requests to AI on the server via AI-controlled pawn on the client. The thing is to have client-side pawn replicate requests over to it’s server-side equivalent and have AI on the server take it from there.
Of course it’s a bit of a hassle to set this up, but one you have it up it should work flawlessly
Thanks Mieszko, can you elaborate on “have player controller issue commands/requests to AI on the server via AI-controlled pawn on the client”?
If I understand properly, this would create a different type of pawn as the one my game use when a real player is playing. If I’m right, it kind of defeats the purpose of running this type of test.
Oh, you meant doing it for testing purposes? Then that’s not the way to go! This approach would require you to implement a dedicated solution, embedded in your pawn classes, that would be a “standard” way of communicating between client and server as far as AI pawns go.
It sounds like you need a regular pawn/character class that can be “just as well” controlled by both Player and AI controllers. In general there’s nothing stopping you from doing that until you write code like if (player) { ...} else {...}.