i have problem with replication of Relative Location and rotation

so when i join as a client some Actors location and rotation are out of sync
version of engine : 5.0.3-20979098+++UE5+Release-5.0
the issue



project
FromTheDepthsofSpaceSample.zip (22.1 MB)
steps to reproduce
open project
open test map
set netMode to not standalone
play

so anyone have some idea what can be wrong ?

It’s unlikely someone on the forums will download your project, and open it, and debug it for you, for free. I mean, it’s possible, if you’re lucky, but I wouldn’t bet on it.

But you’re missing a few of the first checklist items for replication:

Are the actors set to replicate?
Are the actors spawned on the server? (Client-spawned actors won’t replicate)
Are there any messages about replication or networking in the log file from the server, and from the client?

Are the actors set to replicate

yes root compoent and actor

Are the actors spawned on the server

only 1 (the actor with is a root) rest is placed in world

Are there any messages about replication or networking in the log file from the server, and from the client?

i cant see any Warning abaut it so :neutral_face:


LogDerivedDataCache: C:/Users/BlackBack/AppData/Local/UnrealEngine/Common/DerivedDataCache: Maintenance finished in +00:00:07.429 and deleted 5 file(s) with total size 0 MiB.
LogDebuggerCommands: Repeating last play command: Selected Viewport
LogPlayLevel: PlayLevel: No blueprints needed recompiling
PIE: New page: PIE session: test (8 sty 2023, 05:32:34)
LogPlayLevel: Creating play world package: /Game/Maps/UEDPIE_0_test
LogPlayLevel: PIE: StaticDuplicateObject took: (0.005434s)
LogPlayLevel: PIE: Created PIE world by copying editor world from /Game/Maps/test.test to /Game/Maps/UEDPIE_0_test.test (0.005528s)
LogSubsystemCollection: Failed to initialize subsystem dependency (WorldPartitionSubsystem)
LogChaos: FPhysicsSolverBase::AsyncDt:-1.000000
LogAIModule: Creating AISystem for world test
LogPlayLevel: PIE: World Init took: (0.000906s)
LogUObjectHash: Compacting FUObjectHashTables data took   0.49ms
LogAudio: Display: Creating Audio Device:                 Id: 5, Scope: Unique, Realtime: True
LogAudioMixer: Display: Audio Mixer Platform Settings:
LogAudioMixer: Display:     Sample Rate:                          48000
LogAudioMixer: Display:     Callback Buffer Frame Size Requested: 1024
LogAudioMixer: Display:     Callback Buffer Frame Size To Use:    1024
LogAudioMixer: Display:     Number of buffers to queue:           2
LogAudioMixer: Display:     Max Channels (voices):                0
LogAudioMixer: Display:     Number of Async Source Workers:       0
LogAudio: Display: AudioDevice MaxSources: 32
LogAudio: Display: Audio Spatialization Plugin: None (built-in).
LogAudio: Display: Audio Reverb Plugin: None (built-in).
LogAudio: Display: Audio Occlusion Plugin: None (built-in).
LogAudioMixer: Display: Initializing audio mixer using platform API: 'XAudio2'
LogAudioMixer: Display: Using Audio Hardware Device Headphones (High Definition Audio Device)
LogAudioMixer: Display: Initializing Sound Submixes...
LogAudioMixer: Display: Creating Master Submix 'MasterSubmixDefault'
LogAudioMixer: Display: Creating Master Submix 'MasterReverbSubmixDefault'
LogAudioMixer: FMixerPlatformXAudio2::StartAudioStream() called. InstanceID=5
LogAudioMixer: Display: Output buffers initialized: Frames=1024, Channels=2, Samples=2048, InstanceID=5
LogAudioMixer: Display: Starting AudioMixerPlatformInterface::RunInternal(), InstanceID=5
LogAudioMixer: Display: FMixerPlatformXAudio2::SubmitBuffer() called for the first time. InstanceID=5
LogInit: FAudioDevice initialized.
LogAudio: Display: Audio Device (ID: 5) registered with world 'test'.
LogLoad: Game class is 'Starsystem_C'
LogWorld: Bringing World /Game/Maps/UEDPIE_0_test.test up for play (max tick rate 0) at 2023.01.08-04.32.34
LogWorld: Bringing up level for play took: 0.002391
LogOnline: OSS: Created online subsystem instance for: :Context_4
LogNet: ReplicationDriverClass is null! Not using ReplicationDriver.
LogNetCore: DDoS detection status: detection enabled: 0 analytics enabled: 0
LogInit: WinSock: Socket queue. Rx: 131072 (config 131072) Tx: 131072 (config 131072)
LogNet: Created socket for bind address: 0.0.0.0 on port 17777
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogNet: GameNetDriver IpNetDriver_2 IpNetDriver listening on port 17777
PIE: Server logged in
PIE: Play in editor total start time 0,084 seconds.
LogSubsystemCollection: Failed to initialize subsystem dependency (WorldPartitionSubsystem)
LogChaos: FPhysicsSolverBase::AsyncDt:-1.000000
LogPlayLevel: PIE: World Init took: (0.000824s)
LogAudio: Display: Creating Audio Device:                 Id: 6, Scope: Unique, Realtime: True
LogAudioMixer: Display: Audio Mixer Platform Settings:
LogAudioMixer: Display:     Sample Rate:                          48000
LogAudioMixer: Display:     Callback Buffer Frame Size Requested: 1024
LogAudioMixer: Display:     Callback Buffer Frame Size To Use:    1024
LogAudioMixer: Display:     Number of buffers to queue:           2
LogAudioMixer: Display:     Max Channels (voices):                0
LogAudioMixer: Display:     Number of Async Source Workers:       0
LogAudio: Display: AudioDevice MaxSources: 32
LogAudio: Display: Audio Spatialization Plugin: None (built-in).
LogAudio: Display: Audio Reverb Plugin: None (built-in).
LogAudio: Display: Audio Occlusion Plugin: None (built-in).
LogAudioMixer: Display: Initializing audio mixer using platform API: 'XAudio2'
LogAudioMixer: Display: Using Audio Hardware Device Headphones (High Definition Audio Device)
LogAudioMixer: Display: Initializing Sound Submixes...
LogAudioMixer: Display: Creating Master Submix 'MasterSubmixDefault'
LogAudioMixer: Display: Creating Master Submix 'MasterReverbSubmixDefault'
LogAudioMixer: FMixerPlatformXAudio2::StartAudioStream() called. InstanceID=6
LogAudioMixer: Display: Output buffers initialized: Frames=1024, Channels=2, Samples=2048, InstanceID=6
LogAudioMixer: Display: Starting AudioMixerPlatformInterface::RunInternal(), InstanceID=6
LogAudioMixer: Display: FMixerPlatformXAudio2::SubmitBuffer() called for the first time. InstanceID=6
LogInit: FAudioDevice initialized.
LogAudio: Display: Audio Device (ID: 6) registered with world 'Untitled'.
LogSlate: Updating window title bar state: overlay mode, drag disabled, window buttons hidden, title bar hidden
LogNet: Browse: 127.0.0.1:17777/Engine/Maps/Templates/OpenWorld
LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768)
LogNet: Created socket for bind address: 0.0.0.0 on port 0
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogNet: Game client on port 17777, rate 100000
PIE: Client logged in
PIE: Play in editor total start time 0,171 seconds.
LogBlueprintUserMessages: [test] Server: Parts List Dump
LogBlueprintUserMessages: [test] Server: Extrusion_C_0
LogBlueprintUserMessages: [test] Server: Extrusion_C_1
LogBlueprintUserMessages: [test] Server: Extrusion_C_2
LogBlueprintUserMessages: [test] Server: Extrusion_C_3
LogBlueprintUserMessages: [test] Server: Extrusion_C_4
LogBlueprintUserMessages: [test] Server: Extrusion_C_5
LogBlueprintUserMessages: [test] Server: Extrusion_C_6
LogBlueprintUserMessages: [test] Server: Extrusion_C_7
LogBlueprintUserMessages: [test] Server: Extrusion_C_8
LogBlueprintUserMessages: [test] Server: Extrusion_C_9
LogBlueprintUserMessages: [test] Server: Extrusion_C_10
LogBlueprintUserMessages: [test] Server: Extrusion_C_11
LogBlueprintUserMessages: [test] Server: Extrusion_C_12
LogBlueprintUserMessages: [test] Server: Extrusion_C_13
LogBlueprintUserMessages: [test] Server: Extrusion_C_14
LogBlueprintUserMessages: [test] Server: Extrusion_C_15
LogBlueprintUserMessages: [test] Server: Extrusion_C_16
LogBlueprintUserMessages: [test] Server: Extrusion_C_17
LogBlueprintUserMessages: [test] Server: Extrusion_C_18
LogBlueprintUserMessages: [test] Server: Extrusion_C_19
LogBlueprintUserMessages: [test] Server: BuildPartGrupes Log: Attach loop started | parts count in Groupe =21 |
LogViewport: Scene viewport resized to 640x480, mode Windowed.
LogNet: NotifyAcceptingConnection accepted from: 127.0.0.1:61556
LogHandshake: SendConnectChallenge. Timestamp: 1.203373, Cookie: 011003060116062149008016179127205237135102218121100182229239
LogHandshake: SendChallengeResponse. Timestamp: 1.203373, Cookie: 011003060116062149008016179127205237135102218121100182229239
LogNet: NotifyAcceptingConnection accepted from: 127.0.0.1:61556
LogHandshake: SendChallengeAck. InCookie: 011003060116062149008016179127205237135102218121100182229239
LogNet: Server accepting post-challenge connection from: 127.0.0.1:61556
PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
LogNet: NotifyAcceptedConnection: Name: test, TimeStamp: 01/08/23 04:32:35, [UNetConnection] RemoteAddr: 127.0.0.1:61556, Name: IpConnection_3, Driver: GameNetDriver IpNetDriver_2, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
LogNet: AddClientConnection: Added client connection: [UNetConnection] RemoteAddr: 127.0.0.1:61556, Name: IpConnection_3, Driver: GameNetDriver IpNetDriver_2, IsServer: YES, PC: NULL, Owner: NULL, UniqueId: INVALID
LogNet: UPendingNetGame::SendInitialJoin: Sending hello. [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_2, Driver: PendingNetDriver IpNetDriver_3, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID
LogNet: NotifyAcceptingChannel Control 0 server World /Game/Maps/UEDPIE_0_test.test: Accepted
LogNet: Remote platform little endian=1
LogNet: This platform little endian=1
LogOnline: OSS: Created online subsystem instance for: :Context_5
LogNet: Login request: ?Name=DESKTOP-KSKEH25-8DA7806E4FFFCB81D59D2A8BFF529099 userId: NULL:DESKTOP-KSKEH25-8DA7806E4FFFCB81D59D2A8BFF529099 platform: NULL
LogNet: Welcomed by server (Level: /Game/Maps/UEDPIE_0_test, Game: /Game/Starsystem.Starsystem_C)
LogLoad: LoadMap: 127.0.0.1:17777/Game/Maps/UEDPIE_0_test?game=/Game/Starsystem.Starsystem_C
LogWorld: BeginTearingDown for /Temp/Untitled_2
LogWorld: UWorld::CleanupWorld for Untitled, bSessionEnded=true, bCleanupResources=true
LogSlate: InvalidateAllWidgets triggered.  All widgets were invalidated
LogAudio: Display: Audio Device unregistered from world 'None'.
LogUObjectHash: Compacting FUObjectHashTables data took   0.57ms
LogAudio: Display: Audio Device (ID: 6) registered with world 'test'.
LogSubsystemCollection: Failed to initialize subsystem dependency (WorldPartitionSubsystem)
LogChaos: FPhysicsSolverBase::AsyncDt:-1.000000
LogPlayLevel: PIE: World Init took: (0.000732s)
LogWorld: Bringing World /Game/Maps/UEDPIE_1_test.test up for play (max tick rate 0) at 2023.01.08-04.32.35
LogWorld: Bringing up level for play took: 0.001668
LogLoad: Took 0.027680 seconds to LoadMap(/Game/Maps/UEDPIE_0_test)
LogNet: Client netspeed is 100000
LogNet: Join request: /Engine/Maps/Templates/OpenWorld?Name=DESKTOP-KSKEH25-8DA7806E4FFFCB81D59D2A8BFF529099?SplitscreenCount=1
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
LogNet: Join succeeded: DESKTOP-KSKEH25-8DA7
LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: StaticMeshComponent /Game/Maps/UEDPIE_0_test.test:PersistentLevel.Player_C_1.StaticMeshComponent_0 NOT Supported.
LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: DrawFrustumComponent /Game/Maps/UEDPIE_0_test.test:PersistentLevel.Player_C_1.DrawFrustumComponent_0 NOT Supported.
LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: StaticMeshComponent /Game/Maps/UEDPIE_0_test.test:PersistentLevel.Player_C_0.StaticMeshComponent_0 NOT Supported.
LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: DrawFrustumComponent /Game/Maps/UEDPIE_0_test.test:PersistentLevel.Player_C_0.DrawFrustumComponent_0 NOT Supported.
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)
LogOnlineSession: Warning: OSS: No game present to join for session (GameSession)

Level loaded actors count as locally spawned, and will not replicate from the server (or from other clients) unless you make special arrangements for doing so.

One option is to make a “instance spawner” blueprint, which takes another blueprint (actor class) as argument, and spawns the actor, only on the server, in event begin play. This instance spawner will need some kind of preview functionality, too, to make it easier to work with in the editor – perhaps a component that is “editor only” and clones whatever mesh is used by the target placed blueprint.

Level loaded actors count as locally spawned, and will not replicate from the server

what do u mean by this, looks like there are replicated ?

i done the same in blueprints as a test
i just made a array of actors added actors to the array in editor and press play
event begin play->HasAuthority->forloop->AttatchActorToActor
works fine with actors was placed in world even if i join 1min later on client
and i’m doing close to the same thing in c++
but im spawning the actor with becomes the root and its breaks
ps.
just an overview of code for every actor: event begin play:
->HasAuthority
->Link call to check if can connect handled by blueprint
->AddPartForBuilding add actor to be attached if has a links
->BuildPartGrupes call with content logic described below
->static bool IsBuilding is set to true, with is singlyfaing the path for single execution
->SetTimerForNextTick with is weting for begin play to end to execute BuildPartGrupes only once
->SpawnActor with is spawning the root contener
->for loop throw array with stuff to be attatched to root contener and ForceNetUpdate call on children of root contener
->end

i can try instance spawner but what if the end result will be the same ? i’m trying to fix it for past this for past 2 days i send the relative location and rotation in property defined by me and relative location and relative rotation was correct on client
unless GetWorld()->GetTimerManager().SetTimerForNextTick(…) is doing something weird :thinking: the values should be correct

Hmm, then I don’t have any good ideas. Other than “log more. No, even more than that! Also, include the object path of each object that logs, in the log.”
It is a pain, indeed.

so i done more debugging so local transform is not replicated correctly i will need to do a hacky fix for it i spend too much time trying to figure out what is wrong with my code
i hate the idea of using ~36 bytes of ram and bandwidth for it (per object with will be extrimly bad with 10k or more objects) but better then poking in code for many months
OnRep_AttachmentReplication is never triggered for me when client joins maybe this is a clue why my stuff is broken

ok i found a problem finaly. so just see if “instance spawner” blueprint will work
got this result
(yes there is less object but it is because of my code)
in game:


in editor:

with make it very intersting for me because looks like world transform is send to attached actor some times
with is extremely weird
unless it is correct or i’m just seeing a network packet racing or something like this
(edit) just a info: it is semi random :neutral_face: every time i restart the engine is changing affected actors + some times location or rotation or both, is wrong

ok i managed to do a get it working after I noticed the offset but because is semi random with wittch object is efected
idk if is correct
but for u @jwatte i have small task (if u have some free time) look if AttachToActor (or anny sub funcion modyfaing packet) marks is attached flag correctly and sets the relative transform to be send
because this is a problem when client joins if transform and attachment packed is separeted it can create de sync.
because is small randomnes involved do to packet registracion if world transform is registered to be sent last (probably). override’s the relative transform packet i can’t think about something else with can affect end result and remember this is for loading on client when server is already running

im will just wait for new UE versions maybe this gets fixed

(sorry for any typos) :slightly_smiling_face: