Serious shot replication problem [video]

No, it’s not my function. It’s a function of the Character (probably inherited from the Pawn class).

Also, no. I’m not replicating anything.

Glad to hear it!

The replication is already being done for you, through replicated pitch. That GetBaseAimRotation() reads the ControlRotation() on the server, and on clients uses ActorRotation for Yaw and Roll, and RemoteViewPitch for Pitch.

Oh, well in C++ you have access to that function. That’s why you see a bunch of issues with pitch replication in Blueprints but not C++. So this means pitch/yaw is replicated but not accessible in blueprints, only in C++.

Just for completeness, I’m replicating nothing! So it’s a thing the Engine does 100% by itself (?)

Also, please will you tell me if I need to really replicate something at this point? I’m not so versed with Net in UE and I saw this guy had a similar problem First Person Camera movement replication problem - C++ - Epic Developer Community Forums

So Am I done?

C++ for president, mate :wink:

I think you’re all set with replication for that. That guy was having the same problem but no one mentioned the special GetBaseAimRotation function which would have solved his problem similar to how it solved yours.

Yeah, as I go more along in my development, I see the advantages of C++, especially now that I’ve had to code a fair amount for my dedicated server use and I’ll probably have to code more in order to implement a queue system.

GetBaseAimRotation is accessible from blueprints:



	UFUNCTION(BlueprintCallable, Category="Pawn")
	virtual FRotator GetBaseAimRotation() const;


I wouldn’t worry about that other thread, I think the confusion there was more about replication being only server->client, RPCs either direction.

Yeah I’m not sure why I didn’t mention GetBaseAimRotation() there! That was a while ago but they sounded determined to have things linked to the camera, so I think I was concerned that the camera would not necessarily match actor rotation. As I mentioned before, GetBaseAimRotation would break down there for clients.

Things would probably be nice and easy if we just replicated ControlRotation on Pawns. Also there are too many Get***Rotation functions. Pawn GetViewRotation() seems like a worse version of GetBaseAimRotation().

All’s well that ends well =)

Thanks again to everyone! Your 3-4 seconds to post a reply is always gold time for who has problems

[HR][/HR]

Good day!
Could you please explain to me the difference between client-server and **DS(Dedicated Server) **architecture?

What are the pros and cons of each one?
Does the code have any difference?
Which projects are more suitable for these architectures and maybe there’s some which are not possible to create in a specific one?
Client-Server is clear enough, but what is DS architecture about does not.
[HR][/HR]Please answer in PM if it is off-top

Best regards,

Dedicated servers don’t have to run any rendering, and all players are connected clients so everyone has some amount of latency.

A listen server has to run rendering and there is one local client, which can put more demand on the server and affect the networking of other players, as well as giving the local player a latency advantage. There is also more care necessary when writing code, to handle local clients vs remote ones when writing server code, so working with dedicated servers can make things easier in that regard too (and Play-In-Editor supports testing with a dedicated server and separate client, run behind the scenes).

However the big caveat to using dedicated servers is that you need to have a separate process running, and that’s not done on consoles where you need a cloud process to host the process.

Good day,

I have been thinking on your answer.
And here is what I am still missing

What does it mean?

How is it done and what it means for other clients?

What does the difference between clients and remote(you mean remote server)? as it is not clear. Clients(people who connect to my game) and what is the remote?
And that I would need to think if i was a server or a client, isn’t it?

By this, you mean that I would need a cloud process to host the process on consoles like PS4/xbox one and so on, right?

Is there also the most frequently used one? Listen(Client-Server) or DS(Dedicated Server)?

Thank you!

Listen servers run the server code, and also the client code for the local player all during the tick and in the single process. Since there is rendering involved, this can affect the performance of the server code, which may be limited by the client code, and thereby slow down responsiveness to other players, giving the local player an advantage.

Dedicated servers only run the server code, and don’t have to do any rendering or input handling. The would be run on a different machine for the greatest benefit (and this is the only way to have a dedicated server for console games).

Dedicated server is preferred when possible, but sometimes isn’t practical unless you have the ability to host/rent cloud servers. PIE supports testing both, if you choose 2 players by default 1 will be a listen server, unless you check the “use dedicated server” box and both will be clients (but only from the code flow perspective, it’s all still technically in one process).