It uses AIController Pawns to move your character around and so far works quite nicely.
If anyone is interested, I will clean and upload to github for everyone. I am not planning on making any money with this. Just helping out as I have been searching like a “crazy” person and finally figured it out after about 2 days of head banging.
Click the github link below and feel free to extend / use as you see fit. GitHub Repo
I also made a basic multiplayer version of it, simply by running pathfinding stuff on server, and apparently works fine, I had only problem with character rotation replication, but it was easy to resolve. In theory ACharacter features some movement smoothing for network games, but I would be interested in what you created.
I don’t really understand why it is better than simply in PlayerController do a check on button press IsLocalController() , and if true make ray tracing and target setting locally on client, then call a server function and passing this new location, where you do the pathfinding by NavSys->SimpleMoveToLocation(this, DestLocation);
by the way, you could add hiding the decal component of the character on BeginPlay() if the controller is not IsLocalController()
Like I had said this is ONE way to do it, I didn’t say it is the ONLY way to do it. With that being said, it was mentioned multiple times WHY SimpleMoveToLocation was not intended for Multiplayer and should not be used as such. (by Epic Staff btw). However what I wanted to achieve was an architecture where the Player would never host any game but all would come from a dedicated server, and that is what I have achieved, e.g. every player gets his own Character (controlled by AI) to posess and control.
Here is a Quote from the EPIC Lead AI Programmer on this topic::
So I took what he said at face value and trust in his words. You can also take a look at the thread on answerhuib where people discuss the blueprint and play around with SimpleMoveToLocation etc and they all encounter issues.
Thanks, I think I understand now After reading your description, now I remember I had also problems with SimpleMoveToLocation and player controller controlled pawn, namely player characters are out of the Detour Crowd avoidance system, thus AI characters can get stuck at player characters (no avoidance only collision), and vica versa, what you solved by using AIContoller for the player too. Great!
I know this is a (seriously) old thread, but this approach is the same as mine (all pathfinding/movement done on the server). I’m still having trouble with rotation, however. The server works fine (as expected), and every client except the active one shows movement and rotation correctly. For the current client, however, the character moves to the target point without problem but it always faces the top of the map. I am running multiplayer from the editor with three players (server and two clients). When I select a client, its character won’t rotate to face the direction of movement, but on the server and the other client, the movement looks like it’s supposed to. There must be something in the client code that is overriding the server’s direction and not allowing the character to change facing, but I can’t find it. Can anyone help?
Thank you very much for the help. I’m curious, however, if you’ve missed a step. You calculate LastYawRotation, which is a float, but don’t do anything with it and instead use NewValue that is passed to the function. Am I missing something obvious?
I have been away for quite awhile and tbh suuper busy atm.
@Vaclav take a look at
Transform.LerpTranslationScale3D(CharTransform, MyTransform, ScalarRegister(0.01f)); in TDMPCharacterProxy and lower it so something like 0.005f maybe and see what happens then. I had this stuttering when I set the value to 0.5f etc.