Hi everybody,
First of all I’m quite new to the engine and I’m trying to transition from Source Engine to UE4 and there are lots of things that don’t quite sum up for me. I’m trying to get some basic multiplayer game together which would be first person so it includes weapons and all the basic things a shooter would have except its not going to be a shooter but that is a trivial detail I suppose.
So when I tried to extend the pawn to be able to shoot bullets I stumbled upon a few basic road blocks. First thing I noticed is that the server and client have only the Tick function which passes a variable delta time, so for rendering that is probably fine but when it comes to syncing things that seems to be awful to me, if I’m not mistaken server and client don’t tick synchronized, so I went further down to see how the movement component does the prediction and stumbled upon a wall of code which I don’t quite understand.
The source engine works by using Tick numbers to calculate the time for client and server which helps in deterministic logic as both realms Tick with the same delay. The time is a simple calculation based on where it is used.
Server = TickCount * TickDelay
Client = TickCount * TickDelay + Interpolation
This provides a simple way to keep track of things in the past by simply indexing the Tick number and since the TickDelay is constant we can easily interpolate between Ticks for the smooth experience.
UE4 works more or less in the same way except it uses the WorldServerTime to find the prediction record, this seems like it can be easily avoided if we would use fixed ticks again, we could use TickCount - FirstWindowTick as our offset to correct everything forward without the need to search for it first by the timestamp.
Now I’m not quite sure where I should head to, I could for one try to mimic the Source Engine mechanics in replication or try to adapt to UE4 somehow. In case I would adapt to UE4 maybe someone could try to explain me how shared logic would be established in UE4 due the nature of the variable Ticks? Also are there any plans for the engine to support this kind of network design?
Sorry for the long post, I’m just trying to understand the nature of UE4 in that way.