How bad is it?
20ms or so could be considered normal for lan, depending on how your replicating things this could have a large volume of traffic that is trying to get through… in the case of two machines on the same lan there both going through the same router/switch so theres at least one potential bottleneck, say you have gigabit ethernet thats “only” 500mb per machine, likely not the probelm but something to consider
None of the laggy network testing features of the editor will get packed into a packaged game… theyll always run at the best they can
So the problem likely comes down to replication, is your player movement just fine but other things seem to lag?
Are there too many RPCs marked as reliable that may not be necessary?
First thing id do, to narrow it down that is, is make another project add some basic multiplayer stuff and see if that lags in any way, that would tell you its the network and not the game
2nd thing id do is make a copy of your project and see what happens when you disable loads of stuff to see if its just too much traffic type of deal
3rd thing id do is come back here and show some kinda video of you playing a segment of the game beacuse depending on how its lagging we may be able to identify alot of stuff to help out
Unreals server model is such that the server is the authority ( it has the one true copy of the world ) the clients join and create the world from their local copy of the world then get any changes from replication
Then clients may send changes to the server that can then be replicated from the server to other clients
These are just some general statments to help you out as i cant tell you anything specific at least myself without seeing more