#multiplayer

1 messages ยท Page 135 of 1

queen escarp
#

but ok so what your saying is

#

begin play already gets called in the client ?

pallid mesa
#

ye

queen escarp
#

i mean each client have their own component , if i wanna Reff their Pawn i have to set it and just on their owning client :/?

pallid mesa
#

and the owner will be valid in the client aswell, if this is a component that you added in your blueprint

queen escarp
#

y

pallid mesa
#

so ye, theres nothing to RPC or set :3

queen escarp
#

well

#

ok its not the problem i realize now its setting as it should..

#

im just debugging this are since i have a target actor bugg

#

the "target actor"

#

on the client is null

#

and im setting the variable replicated on server..

#

dont get it

pallid mesa
#

where is this target actor set?

twilit spruce
#

I have this code for opening and closing a door with a timeline, but it doesn't replicate for the client, what am I missing?

pallid mesa
#

in which component and where is this component at?

queen escarp
#

its being set at the "player character"

#

thats why i tried with notify

pallid mesa
#

this piece of code is run in the server?

queen escarp
#

no its run with a owning client event

#

however the set w/notify use to be a server event

#

to set the actor

pallid mesa
#

u shouldnt set replicated variables from an owning client

#

review ur logic and ensure that wherever you set this variable lies in the server

queen escarp
#

i mean this is how it was before..

#

not a rep notify tho just a replciated variable*

#

still dident work

pallid mesa
#

it depends on your logic, but setting the variable on the server is the way to go

queen escarp
#

yeah but thats what im doing

pallid mesa
#

this cast to unit base... is it being called from the client?

queen escarp
#

y

#

ohhh

#

do the server need to cast ?

#

but its getting a local reff and sending that reff to a server event

#

should be fine ?

pallid mesa
pallid mesa
queen escarp
pallid mesa
#

one more, you shouldnt send a client rpc from an input event

#

its already in the client

#

so remove that client rpc

queen escarp
#

owning ?

pallid mesa
#

that shouldnt be a client RPC

queen escarp
#

ohhh maybe that was the issue

twilit spruce
pallid mesa
#

also ensure ur actor is replicated

twilit spruce
#

this might be important

pallid mesa
#

on top of that put a has authority to ensyure this logic runs only on the server

#

no not important, u dont need to replicate movement

#

u have the replicates set to false lul

#

switch that on

pallid mesa
#

i have that all the time icarus, dont blame urself xDD its a cheeky boolean

twilit spruce
#

where should i put the has authority

queen escarp
#

hmm

pallid mesa
twilit spruce
pallid mesa
#

and the has authority, once u've removed the rpc put it wherever you preffer inside or outside the function

#

the timeline replication weill handle ur network fluff

twilit spruce
#

works but the door snaps in the client

pallid mesa
#

jumps?

twilit spruce
#

its not smooth movement

#

just auto sets to the end

#

its smooth on server tho

pallid mesa
#

ah thats probably because of the net update frequency

#

try crank that up

#

once u do that try again

#

and we'll do a follow up, on why this is a terrible idea haha

twilit spruce
#

still snapping ;-;

modest coral
#

ok i solve lots of things you guys seem know few stuff anyone know how to connect ODBC to have admin rights ?

pallid mesa
#

ow, skill issue on my side then haha, lets go to do the proper solution @twilit spruce

#

so from authority, call a multicast
and that should be it, turn down the net update frequency

queen escarp
#

when u got time / vori ๐Ÿ™‚

twilit spruce
pallid mesa
#

so icarus, i totally thought that replicated timelines would give u a smooth update rate, when u told me it snapped i though it was a frequency issue

#

now calling it from a multicast ur essentially running the replicated timeline in the server, ensuring authority has still control over it

twilit spruce
#

:O

pallid mesa
#

while allowing a smooth animation by calling it in all the clients

#

through the multicast call

twilit spruce
#

that actually makes sense

#

thank you for not pasting the Documentation link and ghosting me <3

pallid mesa
#

i just had big skill issue thinking that rep timelines would work differently hahahhaha

#

hey @queen escarp hellooo

#

ur having whats called a replication data race buddy

#

if you set a variable in the server, and then in the same frame u want to use it in the client

#

it wont have time to replicate

queen escarp
#

is it happening to fast

#

yeah thats what i thought

pallid mesa
#

ye as a quick fast fix

#

u can do this

#

pass the unit bp to spawn target vfx aswell

queen escarp
#

that dosent work

pallid mesa
#

why not? :)

queen escarp
#

its like setting self to self

#

this is not on a commonent this is on the pawn*

pallid mesa
#

?

#

its one extra pin

#

one extra parameter

#

im not suggesting you to connect unit base bp to Target

#

im suggesting you to add one extra parameter in your spawn target vfx

queen escarp
#

ohh

#

how do u do that "target" text look liek that ?

#
asdsa
#

its not this right ?

pallid mesa
#

what? xD

queen escarp
pallid mesa
#

ah lmao wrapping the word with this `

#

hello

queen escarp
#

sadd

#

ahh

#

cool

#

ok adding the pin and getting that ref like that worked like a charm!

#

thats acctually a really knowledge for me

#

ok i got that part fixed*

pallid mesa
#

gg BloodBanner! :D

queen escarp
#

ha'

#

well still got the big issue left x)

#

but one at a time

queen escarp
#

can anyone explain why each time i start the game and move up n down its not animating?

#

once i move any direction then i can up n down and all work..

sweet sage
#

How do i orient to controller rotation only if player is moving?

#

for a networked game

#

this is what i want to do

wet briar
#

is there an easy way to package game send my friend the game and use like hmachi to host a server to test my level out?

sweet sage
wet briar
#

could you explain how @sweet sage

sweet sage
#
FRotator UMmorpgCharacterMovementComponent::ComputeOrientToMovementRotation(const FRotator& CurrentRotation, float DeltaTime, FRotator& DeltaRotation) const
{
    if (Velocity.SizeSquared() > UE_KINDA_SMALL_NUMBER)
    {
        return CharacterOwner->Controller->GetDesiredRotation();
    }

    // Don't change rotation if there is no acceleration.
    return CurrentRotation;

}
#

like that

#

it works for me

#

i`m using "OrientRotationToMovement=true"

wet briar
#

my bad i thought your were responding to my message lol

latent nest
#

How would I create different game modes like a Search and Destroy mode and Team Deathmatch mode. How can I differentiate

dark edge
#

would probably want a GameState class per GameMode as well

#

or you could just add some enum to your GameMode which says which game type it is, you'd switch on that for all the important stuff like OnPlayerDied etc

sweet sage
#

On unreal is Aim rotation Yaw not replicated:

#

?

#

Is it using somehow the character pawn rotation?

#

Here i`m looking to the sides but only local player can see it

#

It looks like it is not replicated somehow

#
        FRotator Delta = UKismetMathLibrary::NormalizedDeltaRotator(Character->GetBaseAimRotation(), Character->GetActorRotation());

        Yaw = Delta.Yaw;
        Pitch = Delta.Pitch;

this is how i`m calculating it on animator

sly kernel
#

so, I am new to multiplayer stuff and I am just doing small things to start with ๐Ÿ˜Š

#

using Oculus Online Subsystem, I get user name/ID in the game instance (as per their example), set variables. Then inside player's character, OnPossession, I get values of the variables from the game instance and set text render above character's head to the name/ID.

#

After watching youtube video, where they do all this inside player's character (and I am not sure if they were even using any OSS) and use rep notify to make sure player's name gets updated even if players gets disconnected, I am scratching my head.

#

this is what I do inside game instance ^^

dusty void
#

I'm trying to make a sphere that damages the player when there's a collision, the player has a health component and all I'm doing right now is just trying to learn replication with a health variable. When I try running it, the game crashes when I try the overlap for the damage. Can anyone help? Ill provide anything else you need, thank you

#

Here are the screenshots with the number of lines sorry

fossil spoke
#

@dusty void

#

You are using a Pointer without checking its validity

#

Always check your pointers before using them.

#

if(IsValid(healthComponent))

dusty void
#

what's the difference between doing ( IsValid(healthComponent) ) and just putting (healthComponent) ?

fossil spoke
#

IsValid checks to make sure the underlying UObject isn't "pending kill".

#

Because it maybe still available as a pointer, but is about to be garbage collected

#

Pointers to non UObject types obviously wouldnt need that

dusty void
#

is there anything wrong with this statement? that's where a lot of my problems started after i put the GetLocalRole check

#

When I didn't have the GetLocalRole check, the game wasn't crashing even without the healthComponent validity check

#

Yeah after taking away the GetLocalRole() == ROLE_Authority from the DamageSphere::BeginPlay() and the UHealthComponent::SetHealth functions it's not crashing anymore but the OnRep isn't being called

soft notch
#

Can I use blueprints to add new actors to the travel list?

modest coral
soft notch
twilit spruce
#

Hi, I am creating a mechanic in my game where a player can replenish their oxygen by interacting with a device on the wall. I am trying to replicate the Oxygen amount variables on wall-mounted device but I am unsure how to do it. I've tried various combinations of server to multicast custom event setups but haven't gotten anywhere.

Right now the number on the server overwrites the number seen by the client because they are out of sync. I'd like the values to be in sync with all clients when one client uses the device.

Thanks :)

modest coral
# soft notch thanks, that helped

also i not sure exactly what your trying to achieve but sounds like your traveling to another map and actors also , there is a save pack that save all actor even moving maybe if load then you wont need that but just a hint .

burnt wadi
#

while testing in editor does client RPCs gets called in the server instance too? not multicast just client rpc

thin stratus
#

Client RPCs are called on the owning client of an Actor. If that actor is owned by the server then it's basically seen as a normal event

thin stratus
thin stratus
frozen wraith
#
SteamSharedModule.cpp.obj : error LNK2019: unresolved external symbol __imp_SteamAPI_Init referenced in function "public: __cdecl FSteamClientInstanceHandler::FSteamClientInstanceHandler(class FSteamSharedModule *)" (??0FSteamClientInstanceHandler@@QEAA@PEAVFSteamSharedModule@@@Z)
SteamSharedModule.cpp.obj : error LNK2019: unresolved external symbol __imp_SteamInternal_GameServer_Init referenced in function "public: __cdecl FSteamServerInstanceHandler::FSteamServerInstanceHandler(class FSteamSharedModule *)" (??0FSteamServerInstanceHandler@@QEAA@PEAVFSteamSharedModule@@@Z)
E:\UE\MyProject\Binaries\Win64\MyProject.exe : fatal error LNK1120: 2 unresolved externals
[36/36] WriteMetadata MyProject.target cancelled``` anyone got a clue what this error is about? ๐Ÿ˜…
frozen wraith
#

It was missing indeed however the error persists, which I'm guessing could be from the fact that the SDK downloaded didn't contain the SteamClient64.dll file needed inside 'Binaries/ThirdParty/Steamworks/Steam[Current Version]/Win64'

stoic lake
#

Hi, for our game we're going to need dedicated servers that host a group of like 20-30 players per server instance. I've been doing some research into services that automatically scale the amount of running servers up and down based on demand, but have only stumbled upon Amazon GameLift, which is meant more for session based dedicated servers. Does anyone have some resources of where I can look to get something like this up and running?

frigid silo
#

I'm having some issues with replicated root motion, the full details are on the unreal forum if anyone wants to take a stab at it https://forums.unrealengine.com/t/gas-replicated-root-motion-from-montage-struggles-with-latency-and-collisions/1522235 ๐Ÿ™

I'm using GAS but im not sure it is directly related

alpine wave
#

Hello Guys.
I would like to test disconnect cases.
as far I did read on the internet it says to use GameMode::Logout to get the callback and use Command " net.DisconnectSimulatedConnections" to disconnect the player, but using this seems to not disconnect the player or trigger the logout.
Can you guys tell me how do you approch this?

alpine wave
potent tundra
#

can somebody fact check my own notes write-up on authority vs ownership?

Authority indicates whether or not this machine has created this specific object, it is not the same as ownership, which indicates whether or not this machine can modify/ change a specific object.```
sinful tree
# potent tundra can somebody fact check my own notes write-up on authority vs ownership? ``` A...

Ownership means nothing in terms of whether or not a machine can modify or change an object - clients can technically change values locally for any actor regardless, but any changes they may make wouldn't be replicated to anyone else as replication is always from server to clients.

In a multiplayer context with a replicated actor, ownership determines who can send server RPCs to the server on the particular actor and who would receive any client RPCs run on that particular actor by the server.

toxic meteor
#

Where is the best place to trigger a save event to save the pawn's world location?

I tried using the gamemode::logout, but the pawn has already been destroyed since then and will crash the server.

sinful tree
#

This is called in Destroyed() on the playercontroller, which could also be overridden so it doesn't call PawnLeavingGame().

stoic lake
winged vault
#

I'm trying to spawn a system. It works fine on all clients but doesn't spawn on the server. (This is a listen server model)

cerulean moss
#

Hi, does anybody know how to make a communication between the Server and the Client the main idea of it being changing a variable from both ways (like if you want to transfer information from the Client to the Server)?

sinful tree
#

Must be called on an actor that is owned by that client.

cerulean moss
#

Can you resource me the some information about RPC (I am very new to multiplayer)

sinful tree
#

Check the stickies on this channel, second one is a good one.

cerulean moss
#

okay thank you very much!!!

twilit spruce
cerulean moss
#

can't you do it with has authority note?

sinful tree
# twilit spruce could you define what a client owned actor is? I'm having trouble wrapping my he...

Ownership of an actor is set by the server. When you spawn an actor you can feed in the owner.
Clients aren't an object in the game, but their Player Controllers are. So when you're dealing with the PlayerState or the player's possessed Pawn, their owner is set as the PlayerController which is then what allows a client to call RPCs to the server on these actors, and to receive client RPCs from these actors. So long as the assigned owner is a path back to the player controller (eg. If I make an actor have the PlayerState as an owner, then that can still be traced by to a PlayerController) then that client is considered the owner.

twilit spruce
sinful tree
#

You wouldn't necessarily need to do it as an RPC at all.

twilit spruce
#

even if i want the text to be replicated to all clients?

sinful tree
#

Overlap detection can happen on the server. The server can replicate a property on that actor, marked as Rep W/ Notify which can then call an OnRep function on clients, and then clients can do what is needed when that change is received.

cerulean moss
#

btw is there any way to cast to the server character?

dark edge
sinful tree
# twilit spruce this was my original post

If you wanted a client to interact with it, ie, the client needs to press an input for it to trigger, then you would need to call an RPC. In this particular case, you wouldn't want the client to be an owner of that particular actor, so you'd have to send a server RPC on a client owned actor, like thier player controller, pawn or playerstate. Once running on the server you can then do what you need to do.

dark edge
#

Do you mean "Is there any way to send some data or call some function on the server-side version of a player's character"?

twilit spruce
sinful tree
twilit spruce
#

thank you for the explanation :)

sinful tree
#

You'd have to structure it so that it'd be something like:
Client Input > Find actor to interact with > Send RPC to server w/ actor to interact with > Server validates target actor is nearby > Server calls interface > Actor does its thing on the server.

cerulean moss
# dark edge Do you mean "Is there any way to send some data or call some function on the ser...

In my project I have two players witch control two diffrent characters. One of the characters is playing an action game and the other is playing a strategic game. The idea is that the strategic player controles all the stats like healt, stamina etc. I need a way to make them have the same stats(if the action player gets hurt, the health goes down, if the stategic players heals up, the health goes up). Sorry for the english.

cerulean moss
#

Can somebody help?

thin stratus
#

You should put that stuff into the GameState then instead

#

If there is only one health value that both share

cerulean moss
#

I tried it but the game state can't be accsessed by the client

#

like I can get value from there but not set

thin stratus
#

@cerulean moss that's expected, you need to RPC in an owned actor first

#

But that's the same when using any other actor if you want a value to change and replicate that change

cerulean moss
#

so I need to make something like a custom event which have On Server when I chage the variable in the Client and after that I put it in the GameState?

thin stratus
#

Yeah. E.g. in your Character or PlayerController

cerulean moss
#

Ok I will try it , thanks for you patianse with me

thin stratus
#

No worries

oblique arrow
#

Trying to make replication and have a problem with client. When my server/host is executing function everything works well and my server is sending information to clients and shooting effects show for them. But when im trying to shoot from client i dont see anything on host or other clients

clear island
#

you're repeating the line trace on client and that is probably not hitting due to multiple possible reasons

#

but also

#

you have the FX spawning inside that if

#

you can put it outside the if

#

if its just a laser/smoke trail effect

#

then you only need start vector and end vector

#

(that is for other clients to see it)

oblique arrow
clear island
#

you can linetrace on the client too, but why do you only spawn the laser/trail if there is a hit?

#

you should always spawn it, no?

oblique arrow
clear island
#

so move it outside that if

#

also I dont know if your ProjectileSpawnPoint is at the same location in client vs server so that can also be something to look for

oblique arrow
#

I mean its not even it i tried to just spawn actor like simple cube and i didnt see it

clear island
#

to get the end vector you can just do:

FVector End = Hit.bBlockingHit ? Hit.Location : Hit.TraceEnd;

meaning if it hits something then your end location for the trail is where it hit, otherwise, its where the trace ended

oblique arrow
#

You think that the functions are done right ?

clear island
#

its hard to say, because I dont know exactly what you're going for but what I recommend you do when you dont see things visually is using DrawDebugSphere to show a sphere where a certain FVector is in the world

oblique arrow
#

@clear island

So the left side is client and right side is host same ass the spheres Host/server dont see this spheres

#

I added drawsphere to multi and server

clear island
#

seems like that green line is not matching

#

it would probably be easier to just use the gun barrel as start vector

#

and multicast the end vector

#

then just spawn the trail from those 2 vectors

#

also make sure to only apply damage on server

oblique arrow
#

But i dont think its the problem of vectors just look i added spawn in every function responsible for the replication

look on the left side i spawned this actors on client but dont see them on server

#

When host is doing it

#

everything seems to be right

clear island
#

just use MuzzleLoc as the spawn point for your niagara effect and use TraceEnd as your "LaserEnd" end vector

oblique arrow
#

Nothing Changed

clear island
#

put it outside the if

oblique arrow
#

Bruh everything is like here

#

Dont even look at damage

#

Its irrelevant now

clear island
#

you're using Hit.Location

#

in SpawnSystemAtLocation

#

use MuzzleLoc

#

aw wait my bad Im looking at the second one

#

(on that one you should also check if there a blocking hit though)

#

for the trail effect I would draw a debug line from MuzzleLoc to TraceEnd

#

and see if that is where you expect it to

oblique arrow
#

And i have some info

#

replication works on blueprint for me

clear island
#

replications rules are different in blueprint

#

in comparison to c++

oblique arrow
#

Yeah i know but at least i know its not corrupted project or anything

#

Ok and another one
This works in my character class

#

now i need to figure out how to make it work for Weapon Base class

clear island
#

I would start by checking where that TraceEnd Vector actually is

#

and drawing a line between MuzzleLoc and TraceEnd

unborn nimbus
#

I'm convinced the beacon implementation in the engine straight up doesn't work

#

Like it barely functions but doesn't do any of the the stuff it implies it should be able to do

sweet sage
#

How do i enable bAllowPhysicsRotationDuringAnimRootMotion only for the first 0,3 seconds of every root motion clips?

#

with networking and prediction

abstract prairie
#

Anyone knows why all my physical controllers are set to Player 1 for a local multiplayer

elder sable
#

hi, i'm using GetSessionInterface()->GetResolvedConnectString("GameSession", ServerURL, NAME_GamePort); but the game port is 0, any ideas how i can get the game port ?

mystic atlas
#

Iโ€™m not an expert but first of, you should sort you cables ๐Ÿ˜…

#

โœŒ๐ŸปโœŒ๐Ÿป

soft dawn
#

I'm planning on setting up something similar for dedicated servers soon. I need to determine what i'll use for service discovery since my servers will only be up for the duration of a game (20-40 minutes). Thanks for the write up

unborn nimbus
#

Is there a way to use the same NetDriver after changing levels or do you HAVE to destroy and create a new one?

fathom aspen
#

When changing levels it will be automatically recreated for you by unreal

unborn nimbus
#

Where is the code for where that happens because that doesn't seem to be happening for me. Once I travel to the actual game level from the main menu, it's gone and cannot be found again.

fathom aspen
#

In the game level are you a standalone world?

unborn nimbus
#

No, in a listen server

fathom aspen
#

So you travel with ?listen

#

Right?

unborn nimbus
#

Yes

fathom aspen
#

Then yes a NetDriver will get created, let me take a quick look

unborn nimbus
#

yes a new GameNetDriver will be created

#

That's not what I'm looking for.

#

I'm looking for the BeaconNetDriver that existed in the main menu

fathom aspen
#

Well that's something else. You will need to take care of making a new one

#

Literally like a GameNetDriver was recreated

#

That's a rule for changing worlds

#

NetDrivers are associated with UWorlds

unborn nimbus
#

Ok so the problem I'm running into is that when I finish traveling and attempt to create a new one, the old hasn't been cleaned up yet so initializing the new one fails

#

adding more "delays" for lack of better word doesn't seem like a great solution

fathom aspen
#

Before calling DestroyBeacon you might want to call a couple of other methods

#

Or basically when performing the travel etc.

#

UnregisterHost followed by PasuseBeaconRequests

#

Might help, not sure

unborn nimbus
#

It doesn't because the socket doesn't get closed until the socket subsystem ticks

#

Already dealing with delays because as soon as you call ServerTravel, the socket stops broadcasting. So I have to tell all the clients to travel, they start a timer 5 second timer. Host starts a 2 second timer, then sever travels

#

If the server doesn't set a timer, the client's don't receive the Client RPC

#

If the clients don't set a timer, the server doesn't exist yet

fathom aspen
#

So you call ServerTravel on clients that are connected to you via beacons?

unborn nimbus
#

No

#

the host calls ServerTravel

#

to open the listen server and move to the game map

#

clients call ClientTravel

fathom aspen
#

Right, why do you need delays then

unborn nimbus
#

because if you do this:

TellClientsToTravel();
ServerTravel();
#

the clients never receive the "Time to ClientTravel" message

fathom aspen
#

Well you shouldn't do it like that

#

You travel to the map with ?listen

#

You set up a beacon connection with clients there

#

They travel to you

unborn nimbus
#

ok so you have the beacon connections setup in the main menu lobby

#

Host calls ServerTravel

#

how do you reconnect the clients?

fathom aspen
#

That's the problem. The way you think about it is totally valid if you probably had a dedicated server. The dedicated server already has the map loaded, and clients just connect to it from their main menu lobby. But no matter how you think about it in a listen server scenario, that's clearly a race. Telling clients to travel to you, while you are going to host another map, that's wrong

#

The listen server has to sit there listenning for connections before setting up the beacon connection

unborn nimbus
#

The beacon connection is setup in the main menu. That's how the lobby is created

#

The only thing I can hope is that the clients will manage to reconnect once the host re-hosts

fathom aspen
#

Honestly, I would just make players travel to your lobby after the beacon connection is setup, and from there you all travel to the game map

#

Even dedicated servers games I assume do that

unborn nimbus
#

that's awful. why would you want to load a new map just to enter a lobby

#

that's the whole purpose of beacons

#

to avoid that

fathom aspen
#

Loading a lobby map is awful? ok.

#

I dunno what I would call using delays then

unborn nimbus
peak star
#

I'm looking for hosting recommendations for dirt cheap that wont have big lag issues. Does that exist?

#

The only thing I have found in the past that wouldnt cost hundreds of dollars a month was to just do listen servers on steam. But I could not build my game for android if it had any steam stuff in it. Breaks with build errors. And i wanted to make it cross platform and work on everything everywhere with everything else.

peak star
#

So i looked into hosting dedicated servers but the affordable options were laggy VMs

peak star
dusty void
#

I'm still learning about replication and with the same sphere I have that damages the player on overlap, the only issue (or misunderstanding) i have is on my debug logs, everything pops up besides the IsLocallyControlled() check in the OnRep, and here's what I have the owner as, and it is valid from the previous pointer check, any help? ill provide more if needed

sweet sage
peak star
#

Digital ocean does too but ran too laggy for my game. My game only had maybe 10 characterpawns running around max, and nothing much else going on. No shooting, nothing but occasional RPCs when interacting with various props and some timers.

I hope Contabo VMs will be more performant

sweet sage
#

Then the optimization is really bad

#

Maybe your code is slow

#

Or not multiplayer ready

#

Have you tried network emulation?

lucid viper
#

Hello,

Trying to setup a shooting projectile that aims in center of the screen ( Crosshairs ).
I got everything working using Get Player Controller -> Get Camera Manager -> Get Camera Rotation
So ffar this seems to work fine, however in a multiplayer game, the client's rotation will always return 0 as its looking for player of index 0.

#

So what's the best way of going about this?
I tought I would get my CharacterOwnerRef->GetCamera-> but I dont see any option to get rotation

#

Trying to do it from CharacterOwner->GetController->Get Control Rotation
Seems to be working getting pitch, Yaw and rotation X but seems to slightly off center,

#

Would anyone have any tips?

peak star
# sweet sage Have you tried network emulation?

I tried a few of the console commands for that to simulate packet loss and lag before building it for my droplet.
Makes me wonder if I somehow got lag and packet loss simulation turned on for my Linux build but not for my local tests.

lucid viper
#

Tried another method but not quite centered still
Seems to be aiing towards the hit but I need it to be always centered to the camera viewport

#

Got more digging to do but feel liek im getting closer

dark edge
muted pewter
#

Is there any method to make a loading screen that persists in between levels while connecting to a dedicated server map? I have searched through all docs but got no answer.

rotund sail
#

is there a way to make pass thru functions like this work? im getting a null variable on the item object

dark edge
#

what is an ItemObject?

rotund sail
#

i moved onto using a different system so dw

worthy knot
#

In my dedicated server log, this message keeps spamming after my player logs into the world partition world, is this related to multiplayer or world partition setting problem? [2023.12.14-08.21.27:362][108]LogNet: Warning: Actor WorldPartitionHLOD / WP_HLODLayer_Merged_000000001327f5d3 has no root component in AActor::IsNetRelevantFor. (Make bAlwaysRelevant=true?)
[2023.12.14-08.21.27:365][108]LogNet: Warning: Actor WorldPartitionHLOD / WP_HLODLayer_Merged_000000001abd3d2c has no root component in AActor::IsNetRelevantFor. (Make bAlwaysRelevant=true?)
[2023.12.14-08.21.27:366][108]LogNet: Warning: Actor WorldPartitionHLOD / WP_HLODLayer_Merged_000000001c4b29bf has no root component in AActor::IsNetRelevantFor. (Make bAlwaysRelevant=true?)
[2023.12.14-08.21.27:367][108]LogNet: Warning: Actor WorldPartitionHLOD / WP_HLODLayer_Merged_000000001e3619ce has no root component in AActor::IsNetRelevantFor. (Make bAlwaysRelevant=true?)
[2023.12.14-08.21.27:368][108]LogNet: Warning: Actor WorldPartitionHLOD / WP_HLODLayer_Merged_0000000021c3fdb3 has no root component in AActor::IsNetRelevantFor. (Make bAlwaysRelevant=true?)

frozen wraith
#

Would anyone know why the .exe for my project crashes whenever I try to open a world? Crashes when i try to create a lobby and if I try to just load a world "offline". CoreTest is the name of the world I tried to open but same thing happens with any other world, including ThirdPersonMap.

#

Including the log here as my eyes can't see the issue ๐Ÿคฆโ€โ™‚๏ธ

#

Oh yea, it just crashes withouot any obvious errors. Just closes to the desktop

peak star
peak star
muted pewter
peak star
dark parcel
#

got it to survive by creating the widget as a TSharedPtr, was told that it's a bad idea. No crashes happend soo far but use it with caution if you wanna do the same

peak star
# dark edge What was your cpu usage and bandwidth?

I remember starting the server with a different port multiple times on the same droplet until the CPU usage got high enough to be making good use of it but leave some elbow room for when a lot was happening in the game. It was a couple of years ago but I think it was around 60-80%

I dont remember the network bandwidth. Logically the CPU usage should be low enough when the game is not busy that it will not max out when all the servees running on the same VM are busy, so I imagine the resting CPU usage should be the % usage of one server when it is at maximum activity, divided by the total number of servers on the same VM.

For a droplet running 6 servers that would be less than 16% but I tried running just one server below 20% and still getting lag, so I dont think CPU usage was the problem.

That is, if I remember evertything accurately after 2 years.

peak star
sly kernel
#

if I make Event replicable (Run on Server), then server sees client's name tag always facing server's camera (as it should be), but client's sees server's name tag in the wrong orientation and not facing client's camera.

#

How can I make it so both server and client see name tag face camera?

dark parcel
#

that piece of code only runs on server

#

shouldn't use player controller 0 either in mp, try to read the compedium pinned in this channel if you haven;t

peak star
dark parcel
#

@peak star my latest comment was directed at motorsep

#

HUD / Widget gets destroyed on level transition unless they are "guarded" I guess

#

btw you cant keep a reference to it in Game instane

#

i've tried that

#

it still get destroyed on level transition

dark parcel
peak star
dark parcel
#

That's for server travel

#

hard travel , widget get destroyed

#

your option is to use Slate

#

or TSharedPtr the widget

upbeat basin
dark parcel
upbeat basin
#

That's weird because now I remember I even had problems when player returned to the main menu, due to the previous menu widget wasn't unbinding from events, some things were being duplicated. As we had an unintentional reference in the GameInstance

#

But that was on 4.21, so it's possible the way widgets are being handled might be changed now

dark parcel
#

Game instance presist throughout the game but afaik hard references gets detroyed during level change.

#

I tried caching the widget in game instance in Unreal Engine 5.1, still the same thing

#

didn;t survive

#

it's probably intended behaviour ๐Ÿคทโ€โ™‚๏ธ

muted pewter
#

What I have done now is I first laods an Entry Map that shows player a loading screen that do a seamless travel to Playing Map in this way loading screen remains persists

#

This Entry Map is empty so it doesnt ccreates much overhead

pallid mesa
#

Hello!! For all the CMC geeks out there, I have a little issue that maybe you guys can help me with.

Basically I have stamina in my project, it goes up and down very nicely using CMC prediction system (referencing here Vaei github post about Stamina, because its similar to his implementation). Every time stamina is consumed I halt stamina regeneration for 2 seconds (timer feature) using the CMC timers (so quite precise, i debugged it).

However I noticed error piles up... and could have different stamina values for the whole duration of the halt -

ie:
Server: 25
Client: 22

So I wanted to check if any of the CMC geeks could help me to force a Stamina value correction in the client during this 2 seconds delay (2 seconds is a lot of time with the stamina value desynced). I tried with a manual RPC and replication, but i feel is unelegant, there should be a way to do this in cmc, right? ๐Ÿค”

potent tundra
#

what is the best way to wait for a spawned actor to load in on the client?

hollow adder
#

Hello. Im working on portal mechanics like in Portal games but CMC is giving me a hard time with teleportation. Any ideas on how to predict the teleport so its as smooth as possible?

solar stirrup
#

I'm having an issue which seems to be an engine bug:

  • I have a replicated array of structs
  • Some of the struct's members are marked as NotReplicated
  • Serverside, I have one value in the array - replicates to client fine
  • I remove the value serverside and add another one at the same time
  • Clientside, the rep notify gets called
  • The NotReplicated members of the struct seem to get hit by memory corruption, on the client, as their values on new array item seem to have been overridden by the values of the previous item that was removed.

Anyone else hit by this? I'm on 5.1.1

#

The serverside values are fine.

#

Holy shit

lusty sky
#

share some code or the crash callstack

solar stirrup
#

Seems like I have the same issue as you

#

D:

solar stirrup
#

But the message I linked is basically the same thing as me and it has code

pallid mesa
#

Hey Erlite, there should be a PR fixing this same issue

#

take a look in github, i believe erebel pushed a fix for this

#

@solar stirrup

solar stirrup
#

Ayyyyyy let's see

#

Thanks

pallid mesa
#

:3 np

solar stirrup
#

What's it called?

thin stratus
thin stratus
#

OnRep of the pointer I guess

pallid mesa
thin stratus
#

Ah I read timer

pallid mesa
#

ah because its a feature... so every time I consume stamina i halt the regeneration for 2 seconds or so

thin stratus
#

Yeah but you do that via timestamps right

pallid mesa
#

yup

thin stratus
#

Then I don't see why it would desync

pallid mesa
#

and what i noticed is that sometimes... during those whole 2 seconds, the stamina value that got locked by the halt displays a different value in server and client

thin stratus
#

Iirc

thin stratus
solar stirrup
pallid mesa
#

Yes, the same method employed in UT for CMC cooldowns, essentially

solar stirrup
#

ah well

#

I might try going with a custom net serializer see if it solves the issue

thin stratus
#

Pretty sure that's what I did

#

I wrapped the array and updated it by hand

solar stirrup
thin stratus
#

Would need to check

solar stirrup
#

ay

potent tundra
# thin stratus OnRep of the pointer I guess

this isnt something thatd id store in each individual character, its a pickup that spawns on the server and then listens for an overlap, then it spawns a new item actor and gives that to the character via a netmulticast function. The problem i have is that on the server, i spawn the item actor, then imedietly give it to the player, which results in a nullptr because the item hasnt yet loaded on the client.

solar stirrup
#

Oh

#

Well the name didn't help hah

#

Ah that PR doesn't fix the underlying issue rip

thin stratus
solar stirrup
#

And what eXi said, you'd wanna spawn on the server and replicate it to the client

thin stratus
#

Sounds like the actor itself is replicated

#

Not sure why the adding of it would be a multicast

#

Sounds like a faulty setup

#

Whatever you are adding the item to should be replicated

lusty sky
#

lol that pr is for gas

thin stratus
#

I kinda doubt there is a pr to fix that

solar stirrup
#

I generally go with a replicated reference to the actor + the actor's begin play to handle race conditions.

  • If during the rep notify of the reference, the actor is null, don't do anything.
  • In the actor's begin play, notify whatever is holding the reference that it spawned on the client.
  • Tada, no more race condition.
#

Yeah, I don't even think it's been reported

thin stratus
#

I also don't think it would be fixed

#

Pretty sure the result is intentional

solar stirrup
#

I mean it's basically memory corruption

#

You get the data from the previous item that was removed

thin stratus
#

Wouldn't say so

solar stirrup
#

oooooh

#

wait no yeah

#

the client doesn't know about add/remove

#

only sees an update

#

fuck

thin stratus
#

Yeah

solar stirrup
#

fuck fuck fuck

thin stratus
#

It only serializes the data

solar stirrup
#

(โ•ฏยฐโ–กยฐ)โ•ฏ๏ธต โ”ปโ”โ”ป

thin stratus
#

And skips the parts you marked non replicated

#

So I doubt they fix something that isn't technically broken

pallid mesa
#

because RPC/Replication sounds lame

thin stratus
#

Not sure. I never had to do that

#

We had stamina based systems with all sorts of cool downs and what not

#

If you do it right it doesn't desync

lusty sky
#

maybe try fast array if you need pre remove and post add callbacks

solar stirrup
#

Don't really need the callbacks but it would solve the issue of clobbering

#

god dammit that's more work

thin stratus
#

Fast array doesn't solve it iirc

pallid mesa
#

mh... the thing is that when the stamina goes up... and i trigger a consume from a GA... the consume comes at slightly different times in server and client, and the value desyncs even if i flush moves

thin stratus
#

Not sure anymore

solar stirrup
#

doesn't every item in a fast array hold a unique id

#

that is uses for delta, so it'd know it's dealing with two diff items?

thin stratus
#

It doesn't matter iirc. The problem is the serialization iirc

#

The entries will still be wrong

#

I can't recall

#

I def had to manually update the entry

#

Cause I used this setup for cooldowns in gas

#

I don't have that code anymore though

#

Cause that was on a client project

#

On my example I had a Tag that identified the cooldown, and a Timestamp + Duration for the Cooldown. And a boolean for if the server Ack the Cooldown, but that's irrelevant here.

#

I'm relatively sure I had to search the array for the Tag and then update it accordingly with the boolean

#

Cause otherwise if a cooldown ran out, the [0] element got removed and the [1] element went one up and got the Timstamp and Duration which were marked as NonReplicated of Entry [0]

#

Cause the Client doesn't remove the entry, it just updates the array elements

#

It can totally be that I used fast array overlal for that

#

But just using it didn't solve the issue

solar stirrup
#

That's concerning because that's gonna affect some of my other systems with the fast array serializer if that's the case

pallid mesa
thin stratus
#

Getting GAS to work with the CMC is a shitshow

pallid mesa
#

yeah thats where i am at

#

my stamina lives in the cmc

#

but i do have abilities that require consuming stamina

#

๐Ÿ˜ฌ

eager jewel
#

why do you guys use gas ? is terrible imo

thin stratus
#

"imo" it's not

#

Discussion over

eager jewel
#

imo its not simple

#

extremely bulky

thin stratus
#

No the answer to that question is simple

eager jewel
#

ah

solar stirrup
#

Fast array might prevent clobbering

solar stirrup
#

I'm not seeing bugs in one of my other systems removing elements

thin stratus
#

If you have to mixmatch GAS and CMC; you have a shitty time atm

pallid mesa
#

yes

#

XD

thin stratus
#

The only time we got that working with MovementSpeed was when we basically listened to GE application and removal in the CMC and patched around the problem that GE removal can't be predicted

eager jewel
#

I coded a fairly advanced climbing system with gas

thin stratus
#

@pallid mesa Wait for 5.4 or 5.5. with the new CMC xD

pallid mesa
#

lmao akjhsndkjashdkjah

#

I have a very nasty patch

eager jewel
#

with a custom cmc

pallid mesa
#

but its very nasty

thin stratus
#

I mean it's probably still better to modify the Stamina on the CMC

#

Via GAs

#

They might not be 100% synced

#

But at least you won't get a correction until its empty

eager jewel
pallid mesa
#

yes im calling a function in the cmc directly right now

#

which is why i get the desyncs because of ability activation time discrepancies

thin stratus
#

If you do that in a predicted GA, then it should work fine to some degree

#

Yeah

pallid mesa
#

it works fine to some degree, but error piles up

#

and if you are a maniac jumping error accumulates

thin stratus
#

The CMC only ever corrects due to Location mismatch

#

Not due to any other variable

#

Stamina would only cause a correction if your movement is different due to it

#

Idk if you can inject that

#

You'd need to send the "end stamina" value to teh Server

#

And then compare that at the end of the move the same way Location is compared

#

And then trigger a correction

#

Not sure there are enough overrideable functions for that

pallid mesa
#

my nasty solution atm was to send the server stamina var to the client via a client rpc alongside a timestamp

thin stratus
#

I wouldn't do that

#

You can try to cause a correction and then have it run the normal flow

#

If you send RPCs you will get even more fd up values

pallid mesa
#

i thought that maybe the RPC could work, because at the point i send it the stamina is paused

#

not moving, so i got a buffer of whole 2 seconds for the client to correct it

thin stratus
#

Still nasty

pallid mesa
#

ye

thin stratus
#

Sounds better to just add a layer of correction for now

solar stirrup
#

I'm glad I moved to the GMC heh

#

Pretty sure I can bind stamina through it and have corrections handle it properly

#

Haven't done that yet but it's on my todo list for a side project

thin stratus
#

I very highly doubt the GMC does anything to solve the GAS part

pallid mesa
#
And then compare that at the end of the move the same way Location is compared
And then trigger a correction

Any idea on which functions i should look to do this? or r&d time? XD

solar stirrup
#

Yeah nah that's the downside

thin stratus
#

That's the same issue Vori already faces

#

The GMC won't solve that

#

Only epic can solve that by merging the prediction shit into one system

solar stirrup
#

Misread oops

thin stratus
#

I will check a sec

#

But not long

#

My wife already looks mad at me for even talking about UE during my vacation.
I want to survive the night

pallid mesa
#

๐Ÿ™ thanks exi

thin stratus
#

@pallid mesa Info dump

#

ServerMove_Implementation calls ServerMoveHandleClientError at the end.

That will ultimately call ServerCheckClientError which calls ServerExceedsAllowablePositionError.

If that chain returns true it will cause the Correction by filling in the PendingAdjustment.
Don't know where that exactly is used, but that will then call the whole "FillAdjustment" stuff, where you would (or already are) setting your custom Stamina value for the correction on the Client.

ServerCheckClientError should be virtual, so you could add to it at the end with your Stamina comparison. At least in theory.

#

Got distracted while typing xD

#

If you play Standalone, even with Editor (not Packaged), you should be able to see the Overlay

#

Just not inside the Editor itself.

pallid mesa
thin stratus
#

Yeah, I mean, not much though

#

Epic's movement error is sqrt(3) or so

#

MAXPOSITIONERRORSQUARED = 3.0f;

#

Yop

pallid mesa
#

ye in my case i can do the same ๐Ÿคฃ if the stamina differs in 3 i trigger a correction! lets goo :)

#

thanks exi, now is my turn to do some r&d, appreciate it, will try to give this back to community if it works out!

pallid mesa
#
if (FNetworkPredictionData_Server_Character* ServerData = GetPredictionData_Server_Character())
{
    ServerData->bForceClientUpdate = true;
}
#

Another way to do it

solar stirrup
#

I ended up just making a function to copy over non replicated members from the previous value

#

Easier than ripping everything out to replace with the fast array serializer when it's not needed

thin stratus
#

Without first having some sort of check against what the Client says the Stamina should be you'd not really benefit from that

wet briar
#

does anyone know how to replicate a health bar widget to work on server not just client ive watched every yt possible nothing works

pallid mesa
#

or to extend servermove and send it alongside the other vars in the RPC

#

so, instead of calling it all the time i set bForceClientUpdate just once when the stamina delay ends, since its when the issues happen

#

which is only called when the 2 seconds stamina expire

sinful tree
thin stratus
#

That you send the data via the custom Data

pallid mesa
#

aham, i have the stamina only in the GetPredictionData_Client_Character

#

so you mention to have it aswell in the GetPredictionData_Server_Character

#

perfect, first time digging in such area ๐Ÿ˜„

#

will do it!

thin stratus
#

It should just be a Non Replicated var in the CMC usually

pallid mesa
#

ay no, sorry, its part of the saved move, its not on the prediction data

thin stratus
#

:P yeah I was just going to say, that can't be true

#

You'd have it in the SavedMove

pallid mesa
#

yes correct hahahhaa

#

so you are suggesting now to send it to the server using which mean exactly?

thin stratus
#

Via the Packed data

#

Like, the ServerMove sends a uint8 package data pointer that it serializes again on the server

#

I would just follow what the Location does

pallid mesa
#

location is sent as part of the parameters of the servermove rpc

thin stratus
#

That's outdated

wet briar
#

@d... this is my setup when the server character dies the health bar doesnt reset to full but when i kill client everyhting works i know im missing something just cant figure it out

quasi tide
#

These are a lot of words being used instead of just ๐Ÿ™ for mover 2.0

#

So we have a new system to complain about ๐Ÿฅณ

pallid mesa
# thin stratus That's outdated
void UCharacterMovementComponent::ServerMove_Implementation(
    float TimeStamp,
    FVector_NetQuantize10 InAccel,
    FVector_NetQuantize100 ClientLoc,
``` 3rd param
thin stratus
#

That's outdated

pallid mesa
#

wowowewa, im in 5.3 btw

thin stratus
#

Unless you actively disable it, the CMC uses Packed Data by now

#

ENGINE_API virtual void CallServerMovePacked(const FSavedMove_Character* NewMove, const FSavedMove_Character* PendingMove, const FSavedMove_Character* OldMove);

#
void UCharacterMovementComponent::ServerMovePacked_ClientSend(const FCharacterServerMovePackedBits& PackedBits)
{
    // Pass through RPC call to character on server, there is less RPC bandwidth overhead when used on an Actor rather than a Component.
    CharacterOwner->ServerMovePacked(PackedBits);
}
#

I also just saw that they have Iris stuff in the CMC by now

#
#if UE_WITH_IRIS
    if (UPackageMap* PackageMap = UE::Private::GetIrisPackageMapToReadReferences(CharacterOwner->GetNetConnection(), &PackedBits.ObjectReferences))
    {
        ServerMoveBitReader.PackageMap = PackageMap;
    }
    else
#endif
    {
        ServerMoveBitReader.PackageMap = PackedBits.GetPackageMap();
    }
#

So much for "just turn it on and it works"

#
    // Deserialize bits to move data struct.
    // We had to wait until now and use the temp bit stream because the RPC doesn't know about the virtual overrides on the possibly custom struct that is our data container.
    FCharacterNetworkMoveDataContainer& MoveDataContainer = GetNetworkMoveDataContainer();
    if (!MoveDataContainer.Serialize(*this, ServerMoveBitReader, ServerMoveBitReader.PackageMap) || ServerMoveBitReader.IsError())
    {
        devCode(UE_LOG(LogNetPlayerMovement, Error, TEXT("ServerMovePacked_ServerReceive: Failed to serialize movement data!")));
        return;
    }

    ServerMove_HandleMoveData(MoveDataContainer);
#

This is what the Server does with the packed bits

#

That Container can be extended

#

There is also one the other way round

#

FCharacterNetworkMoveData then holds the actual Location you meant

#

It's no longer a param on the ServerRPC

#

void UCharacterMovementComponent::ServerMove_PerformMovement(const FCharacterNetworkMoveData& MoveData)

#

The current MoveData is also set "globally", so you can get it anywhere

#
    // Final standard move
    if (FCharacterNetworkMoveData* NewMove = MoveDataContainer.GetNewMoveData())
    {
        SetCurrentNetworkMoveData(NewMove);
        ServerMove_PerformMovement(*NewMove);
    }
#

That happens for Old Move, Pending Move and New Move

#

So if you make your own child container

#

You can add the Stamina to that

#

And then access it everywhere during the Server call

#

e.g. in the ServerCheckClientError part

#

void SetCurrentNetworkMoveData(FCharacterNetworkMoveData* CurrentData) { CurrentNetworkMoveData = CurrentData; }

pallid mesa
#

i was checking ServerMove_Implementation ๐Ÿค”

thin stratus
#

Yeah that's old

#
// Send move to server if this character is replicating movement
        if (bSendServerMove)
        {
            SCOPE_CYCLE_COUNTER(STAT_CharacterMovementCallServerMove);
            if (ShouldUsePackedMovementRPCs())
            {
                CallServerMovePacked(NewMove, ClientData->PendingMove.Get(), OldMove.Get());
            }
            else
            {
                CallServerMove(NewMove, OldMove.Get());
            }
        }
#

That's inside UCharacterMovementComponent::ReplicateMoveToServer

#
    // Use newer RPCs and RPC parameter serialization that allow variable length data without changing engine APIs.
    static int32 NetUsePackedMovementRPCs = 1;
    FAutoConsoleVariableRef CVarNetUsePackedMovementRPCs(
        TEXT("p.NetUsePackedMovementRPCs"),
        NetUsePackedMovementRPCs,
        TEXT("Whether to use newer movement RPC parameter packed serialization. If disabled, old deprecated movement RPCs will be used instead.\n")
        TEXT("0: Disable, 1: Enable"),
        ECVF_Default);
#

That's 1/true by default

#

So I doubt you are using the old way anyway

sinful tree
pallid mesa
#

yes, i was following ur explanation before and ServerCheckClientError led me to servermove ๐Ÿคฃ

thin stratus
#

Oh

#

They replied while I was typing

#

TADA

pallid mesa
#

so tldr - extendFCharacterNetworkMoveDataContainer with stamina, and then trigger a correction if a discrepancy is found

thin stratus
#

Yeah that was my idea

pallid mesa
#

๐Ÿคฃ

#

u helped me a ton, ima check if i can get this working :)

thin stratus
#

There we go.

pallid mesa
#

hehaha yeee lets goo

wet briar
#

@sinful tree @thin stratus this is the error and place it says the a issue and could one of you show or tell me how to fix it so i works after repawn

sinful tree
wet briar
#

@sinful tree im kinda new to unreal do you mean the BP_thirdpersoncharcter class? shwon in picture

hidden ocean
#

Hello,
I will use the game Battleship as an example. In a multiplayer game where the two players have their two grids on the screen, one with their own ships and the other trying to guess the enemy's ship placement. My question is: Can players be in different levels but still share the same session? Or is it mandatory for them to be in the same level?

sinful tree
wet briar
#

@sinful tree bro could join a call cause bro iven been trying figure this for 2 days straight

sinful tree
#

No, sorry, I don't do voice chat stuff.

wet briar
#

wdym its not created in a function

#

its jsut connect to begin play that has a sequence

dark parcel
#

unless you implement your own networking code instead using Unreal replication system

sinful tree
# hidden ocean Hello, I will use the game Battleship as an example. In a multiplayer game where...

At a very basic level, there is no strict requirement of multiplayer games to require users to be connected to an Unreal server or a host which would entail those players being on the same level, but at that point you're no longer using Unreal's native networking system. EG. I can have a small Node.js server that can handle the state of the game. I imagine maybe one could even communicate through beacons.

sinful tree
wet briar
#

oh one sec

hidden ocean
#

@dark parcel @sinful tree thank you guys ๐Ÿ‘

lucid viper
# lucid viper Tried another method but not quite centered still Seems to be aiing towards the ...

Hello trying to setup a simple shooting projectile,

I was able to get the center of the camera using the get player controller ( Index 0 )->Get Camera Manager->Get rotation->
THis works on a single player game but as soon as I start a multiplayer game the shooting rotation is off as its trying to get the player index 0's camera,
So this will never work on a client player,

So I created a character owner reference->Get compoenent class -> Camera component->
But not seeing any Get camera rotation,

So tried using a foward vector with a line trace,
It becomes more of a target aim, it will always shoot towards the hit point and it does not always shoot at the crosshairs but just slighty off,

Been searchng online and ChatGPT, cant seem to find any solutions for multiplayer.

#

Would anyone have any ideas?

grizzled stirrup
#
    FVector StartLoc = GetCameraLoc();
    FVector Dir = GetCameraDir();
    FVector EndLoc = StartLoc + (Dir * TraceDistance);
elder sable
#

Hi, is it possible to replicate uobjects with beacon connections ?

sinful tree
#

Ah collapsed graph, gotcha.

So in multplayer, "Begin Play" will fire for both clients and the server. That means for each character that exists in the game, a begin play will be called for them on the server and every client. if both you and I join into a game together, 2 characters would be spawned, and their begin plays fires for both of us, meaning we would both end up creating that healthbar widget twice for a total of 4 widgets existing (2 on my computer, 2 on yours). If there was 3 players in the game, we would each create it 3 times for a total of 9 widgets, 3 on mine, 3 on yours and 3 on the third player's. Begin Play of the character then is not a great place to handle creating this particular widget as it appears to be something that is meant to be seen only by the locally controlled player.

One way to correct this would be to use ReceiveControllerChanged on the character like in the example I provide below. This will make it so the widget is only created if the new controller possessing the character is a player controller, and is locally controlled. Promoting the return value from the widget creation to a variable then also gives us a reference we can use later. Finally, you'd want to implement OnDestroyed like in my example below which will attempt to remove the widget if it is valid. You can use a reference and convert it to validated by right clicking on it.

This way the widget is only created for the player that is controlling the character at the time their controller possesses it, and ensures the widget is destroyed when it is no longer being used.

#

@wet briar โ˜๏ธ

#

Why doesn't discord like me pasting multiple images anymore ._.

wet briar
#

@sinful tree Thanks for your time im going to try this out and let you know

#

@sinful tree okay so i did the logic but its not working after the player dies you see the bar is black not full when respawn then i go into editor shows error message then i click on and directs me to the widget blueprint dont know why its showing that error

gloomy dune
#

Hello, does anyone know how I can stop root motion anim montage? I tried this, but the animation keeps playing on the simulated proxy because GetRootMotionAnimMontageInstance() returns null on the simulated proxy.
`void UMovementPlayerComponent::UpdateCharacterStateAfterMovement(float DeltaSeconds)
{
Super::UpdateCharacterStateAfterMovement(DeltaSeconds);

if (HasAnimRootMotion() && !CheckRootMotionCondition())
{
    if (CharacterOwner->HasAuthority())
    {
        Multicast_StopAnimRootMotion();
    }
    else if (CharacterOwner->IsLocallyControlled())
    {
        FMontageBlendSettings BlendSettings;
        CharacterOwner->GetRootMotionAnimMontageInstance()->Stop(BlendSettings);
    }
}

}

void UMovementPlayerComponent::Multicast_StopAnimRootMotion_Implementation()
{
if (CharacterOwner->GetLocalRole() == ROLE_SimulatedProxy || CharacterOwner->HasAuthority())
{
if (CharacterOwner->GetRootMotionAnimMontageInstance())
{
FMontageBlendSettings BlendSettings;
CharacterOwner->GetRootMotionAnimMontageInstance()->Stop(BlendSettings);
}
}
}
`

sinful tree
#

The error being received also doesn't make sense if you are following my logic. The widget won't exist before the character exists and is ready, and its character reference should be accessible up until the point that the actor is destroyed at which point you're removing the widget anyway.

#

If you want, within the widget you could also convert your CharacterRef references to validated ones to ensure you're not trying to read from it if it is not valid.

#

This won't necessarily correct visual errors you're seeing, but it'd prevent the errors in the log from showing up.

wet briar
#

@d...

#

and after the vid i just sent i did the validate widget ref it fixed the error just not the visual like you mentioned

pallid mesa
# thin stratus Yeah that was my idea

btw - success!

but... regarding this method i was worried that triggering a full correction would also make my character to correct its position ๐Ÿค”

sinful tree
#

And doing a test on my end, it's working exactly as I would expect.
Widget is created on possession, displays on screen. Destroy the actor on the server, widget is removed. No errors displayed.

wet briar
#

could you show in vid yours working @sinful tree

sinful tree
#

@wet briar

#

What I was getting at with that frame screenshot about is that it appeared odd that the UI was appearing in that particular frame before posession, but it seems like it does that on my end as well.

#

As evidenced here.

wet briar
#

yes this is drving me insane lol @

sinful tree
#

The UI should not keep existing, and even if it did, it should only last as long as the actor is valid which you had it set to be valid for about 3 seconds after death.
And because it is persisting on your end, the only thing I can think of is that you may be creating that healthbar widget somewhere else as well. If anything a "new" copy of the healthbar should end up being placed on top of the existing one, so when you do spawn a new player, it'd create its value and display overtop of the one that's already on screen.

elder sable
#

Is it possible to replicate subobjects with beacon connections ?

thin stratus
#

Like nothing visible at least

#

If there would be a reason for a location correction, CMC would already done so

pallid mesa
#

ah so triggering a correction doesnt necessarily mean that location will get corrected, gotcha

fallow kettle
#

hey guys!! I have some queries regarding replication...

Actually, what I am trying to do is that when I interact with a flag, I want the flag in the world to set the visibility to false and a new flag actor to spawn as a child to the player... I am using a bool property bVisible that replicates and triggers an OnRep() method when the value changes...

now the flag actor contains 2 methods: Interact and Drop...
and these methods are being called from the player where I am using Server_Interact() method to do all the interaction... so basically its like: Interact() -> ServerInteract() -> Interact() (inside the flag class)

The problem is that the OnRep() method doesn't get triggered although I am changing the value in the server

#

I have the DOREPLIFETIME() statement in place, and the flag actor bReplicate is set to true

wet briar
#

@Datura so the issue is only happening when i respawn the server character everything works when you start but when he dies and respawns the health widget is messed up as we already know and also in video im sending the gun messes fireate breaks after respawning when he dies and respawns and i have to switch gun to fix it so im guessing it has to be something with the respawn logic

severe quiver
#

Does anyone know why when using timelines, the movement of an actor is completely jittery and like half-working? I was trying to use a spline and timeline to move an actor across the spline points, but this just resulted in terrible movement. I tried using a Server RPC for the movement method, tried multiple authority switches, even replicated the timeline itself but to no avail.

Actor is replicated, I've tested with and without Replicate Movement and Net Load on Client and none give me good results. The ending location is correctly replicated but the journey there is absolutely horrible.

lucid viper
#

Since my starting location is my gun barrel in a 3rd person shooter,
I dont think the forward vector and linetrace is the way to go.
Im not sure how esle to go about this

grizzled stirrup
#

This will allow you to shoot from the muzzle but still hit the center of your screen

#

So it's simply

  1. Trace from camera loc and camera dir
  2. Set new dir from impact point to the muzzle loc
  3. Trace from muzzle loc along that new dir
wet briar
#

@sinful tree i got i had to just add a delay to the beginning of your logic so it refreshed on screen after being respawned thanks for the help

grizzled stirrup
#

Yes that should be it, I'm not sure about the Find Look At Rotation node (I'd just do ImpactLoc - MuzzleLoc and get the safe normal of that, but maybe the find look at rotation node is doing similar)

final bluff
#

Does anyone know a good diagram or chart showing where things can be called from correctly in networking within unreal?

#

visual aid lol

#

or even a nice document

grizzled stirrup
#

Exi's compendium

final bluff
#

Ive read things that say a client can call an rpc via an actor if the client owns the actor.
If i use the "set Owner" node and i set the clients player controller to own the actor right before executing the rpc on that actor it should work right?

Im trying that but the rpc is not executing the function on the server

#

heres a video example of it running in game

lucid viper
#

But on the client side it seems like its slighty off center

#

Serverside it seems ok

#

Umm noticed when going full screen on the client, seems like it improved the aiming.
Maybe the screen was too small? lol
Confused, now wondering if this could be an issue in the long run, example depending on yuor screen size youll get different results

sinful tree
# wet briar <@218956378654507008> i got i had to just add a delay to the beginning of your ...

I can confirm that this issue does occur on my end as well with a listen server host and it appears that the problem may arise from using the "Get Player Character" or even "Get Owning Player Pawn" from within the widget as it may not necessarily have the correct value by the time the widget is being constructed. I was able to fix it entirely by making the "CharacterRef" variable set to expose on spawn and then feeding in the reference directly, removing the need to set the value on construct of the widget.

wet briar
#

@sinful tree so how did you make the reference in event graph widget without the get player character

sinful tree
#

It's a means of allowing you to set the value directly during the creation of the widget.

wet briar
#

i understand that but im bit confused did you not make ref node from the construct node in graph @sinful tree

#

@sinful tree this what i mean how did make the Ref

sinful tree
#

Then you're not understanding. I don't need to set the ref within the widget. I'm setting the reference during the creation of the widget. This here is setting the "PawnRef" to "Self" which in this case is there reference to the character this Create Widget node is placed in.

wet briar
#

i see now how do you make the ref variable my details panel is blank? @sinful tree

sinful tree
#

Select the variable, then you can change its values.

wet briar
#

lol i meaning i dont have no info in my details pannel to even add variable?

#

@sinful tree

#

dont mind me i feel so slow the widows where closed thatsh why lol smg

#

the only issue is when you need to add something from character like health you cant because your ref is the widget not the character blueprint @sinful tree

dark parcel
#

widget just Read, period

#

Since the pawn is fed to the widget, widget can just read the pawn health component, etc

plucky prawn
#

if i run UnrealEditor.exe MyProject -server -log on launcher binaries, what do i get? it cant be a dedicated server so is it just a headless client?

frank pecan
#

I have a character class that is Replicates=true and ReplicatedMovement=true with a simple:

UFUNCTION(Server,Reliable) 
SetLocation(FVector Loc);
SetLocation_Implementation(FVector Loc)
{
  SetActorLocation(Loc);
}

My expecation is that whenever SetLocation() is called, the character will be moved on the server and all clients, but for some reason, it's only on the server. Does SetActorLocation not work with ReplicatedMovement?

sturdy abyss
#

I am trying to do a quick playtest via the PIE with a friend who is connecting via parsec with a controller.
His controller is picked up in windows (tested in gamepad settings) and in Unreal it does come up as 'input device 1' (mine is input 0). But it won't let him actually control any of the active players (even if I increase from 2 to 3 or 4, tested that in case it was assigning that controller to a higher player number).
If I disconnect my controller and restart, so his controller via parsec gets assigned as 'input 0' then it works as player 1, but my controller (as input 1) won't control player 2....
So there's something in Unreal gating the controllers, and I can't find any kind of 'device manager' options or setups page in unreal... any advice?

twilit spruce
#

I'm trying to get a reference to a playerstate from the thirdperson character that is interacting via an Interface but it keeps saying accessed none. Any ideas?

frank pecan
#

@twilit spruce Get player controller a different way and see if it works. If you're in the character blue print, you can get the controller of that character. Look for the "Get Controller"node

#

Get player controller() doesn't work in multoplayer

twilit spruce
#

i've tried defining the value in the thirdperson bp before passing it into the interact function but its not working, whether its a player controller, player state, third person bp ref, etc.

frank pecan
#

that says "target is character" and target is set to self

#

you can get the player state from the character blueprint

#

wiuthout the controller

#

This is from my character blueprint

#

just pass that directly into interact

#

@twilit spruce

twilit spruce
#

i'm not sure i understand your solution

#

@frank pecan

twilit spruce
#

i'd still have to cast it though right?

#

this returns the same error

frank pecan
#

oh wait

#

the CAST is failing?

twilit spruce
#

lemme check

frank pecan
#

plug that print out to cast failed

twilit spruce
#

yea

frank pecan
#

if so then youe just have to set the default player state in the game mode

twilit spruce
#

not appearing in the print strings

frank pecan
#

oh okay good

#

so where is it failing?

twilit spruce
#

there isnt a cast anywhere else really

#

that get player state isn't reliant on another cast

#

its just there

frank pecan
#

that node is where player stat ref is null right?

twilit spruce
#

define null

#

sorry i'm new to this

frank pecan
#

accessed none

twilit spruce
#

yea

frank pecan
#

no worries! Null means theres nothing there

#

okay

#

take a screen shot zoomed out of this part that you are setting oxygen amount so i can see what happens befopre this

twilit spruce
#

this is the log

#

oh wait

#

is it the multicast

frank pecan
#

yea you set the player state on teh server but not on the clients

twilit spruce
#

๐Ÿคฆโ€โ™‚๏ธ

#

the multicast is the only way i'm getting my text render to replicate tho ;-;

frank pecan
#

so whats the goal here this all feels too janky

#

just describe this blueprint to me what is it

twilit spruce
#

I have an object on the wall called OxygenStation. When interacted with by the player, it should remove 25 from its own "OxygenRemaining" variable and add 25 to the "OxygenAmount" variable in the player state. and then update the text render that displays the "OxygenRemaining" variable

#

the replication of the value on the text render and actually setting a value for the specific user of the oxygen station has been a huge challenge

frank pecan
#

ah i see okay

twilit spruce
#

at first i was using variables stored in the third person bp but then I was informed that player states would be better, and i've been in limbo since then

frank pecan
#

yea this shouldnt be a big issue just move your code where you modify the the player state to the server part, and leave the text render in the multicast parat

#

so the multicast doesn't use the player state at all

sinful tree
#

You don't need to multicast the change. You have a variable that is set with notify. That means there's an OnRep function that gets called on every client when the new value is received on the client. That function can then call what you have the multicast doing.

twilit spruce
#

the repnotify exists in the player state though. isnt it weird to handle this object's logic in the player state?

#

like setting a text render for this object in the player state seems weird

sinful tree
#

No.

#

It wouldn't be weird at all

twilit spruce
#

oh

#

my single player coding brain is telling me its weird

#

guess i gotta retrain

frank pecan
#

what no that absolutely would be weird no

sinful tree
#

You're updating the "Oxygen Value" on the playerstate, so then that playerstate's value changing should change whatever needs to change when that value is changed.

frank pecan
#

no no

twilit spruce
#

i've started a war

frank pecan
#

he has a separate actor that also has its own oxygen value

sinful tree
#

The "Oxygen Remaining" value then should have its own onrep for this actor.

twilit spruce
#

okay

sinful tree
#

And that onrep can update what it needs to.

twilit spruce
#

sorry i guess this looks kinda confusing given that both the player state and the object have oxygen values

twilit spruce
#

so i can have a non replicated custom event, and then just use rep notify?

#

and fire them both on the interact event

sinful tree
#

Input from client > Run On Server > Interact interface > set values on server

#

Onrep > Update UI

twilit spruce
#

thank you for your expertise

#

@frank pecan @sinful tree you folks just solved a 3 day issue <3

#

thank you kindly

crisp root
#

**Can anyone recommend a deployment mechanism that's free, simple and appropriate for early play testing?? **

Some context: I'm cross-compiling successfully (Linux package compiled on Windows), and have deployed and connected to my dedicated server (running Ubuntu 23.10 x64). However to get the executable onto the server, I pushed the Linux package to a remote Git repo to then clone it on the server.

Unfortunately after doing this, Git damn near crashes my shell whenever I'm inside a repo directory... I had to delete/rename the .git folder in order to restore shell performance. This is obviously not tenable, as every time I need to update the Linux package, I'm going to have to restore .git and reintroduce this awkward performance issue (that presumably will only worsen as the repository grows in size).

frank pecan
#

look up betide studios tuts on you tube he shows how to set it up

thin stratus
#

Client you'd probably use Steam or EGS I guess. The 100$ fee shouldn't really be a problem or?

#

Server is more tricky. Especially asking for free and simple. PlayFab has some free tier but ultimately wants your money and I can't remember it being simple.

#

Not sure why you use a GitRepo for this though. Can't you just use an FTP Client?

crisp root
#

Yeah server deployments. I'll look into PlayFab.

crisp root
#

Thanks for sharing your perspective y'all!

crisp root
#

PlayFab looks pretty sweet sweeney_activate

thin stratus
#

Until you have to pay yeah

#

Or generally notice the garbage that third party deployment services are. But I'll leave that experience to you

upbeat basin
#

Is it logical to use a streaming level and make character replicate to owner only when the player enters that level so that I can provide a singleplayer puzzle area for each player without duplicating the area for the number of the players?

silent valley
stuck ginkgo
#

How to duplicate an actor with PhysicsConstraint

#

I didn't write any code

#

replicate movement doesn't work

gloomy dune
#

Hi, does anyone know how I can stop root motion anim montage? I tried this, but the animation keeps playing on the simulated proxy because GetRootMotionAnimMontageInstance() returns null on the simulated proxy.
`void UMovementPlayerComponent::UpdateCharacterStateAfterMovement(float DeltaSeconds)
{
Super::UpdateCharacterStateAfterMovement(DeltaSeconds);

if (HasAnimRootMotion() && !CheckRootMotionCondition())
{
    if (CharacterOwner->HasAuthority())
    {
        Multicast_StopAnimRootMotion();
    }
    else if (CharacterOwner->IsLocallyControlled())
    {
        FMontageBlendSettings BlendSettings;
        CharacterOwner->GetRootMotionAnimMontageInstance()->Stop(BlendSettings);
    }
}

}

void UMovementPlayerComponent::Multicast_StopAnimRootMotion_Implementation()
{
if (CharacterOwner->GetLocalRole() == ROLE_SimulatedProxy || CharacterOwner->HasAuthority())
{
if (CharacterOwner->GetRootMotionAnimMontageInstance())
{
FMontageBlendSettings BlendSettings;
CharacterOwner->GetRootMotionAnimMontageInstance()->Stop(BlendSettings);
}
}
}
`

bright fern
#

Hi,
I'm working on a multiplayer game and I have trouble to connect to my dedicated server when I build in Production mode.
Everything is fine with builds in Development mode .
I pass the address and port of the server via the command line.
It seams to me that the prod build didn't use the address from command line but use all the other parameters.
Do you have an idea what could be wrong?

summer zinc
thin stratus
#

Fwiw I would probably stick to dev builds for dedi servers

rich cairn
#

Hi
I'm creating a chat system where players can chat inside their guild or in a global chat

I send RPC to the server, which in turn sends RPC to certain players with FText end EnumChannel parameters, should I think about serialization before sending, if we say there are about 100 players and messages are sent approximately every 4 seconds

bright fern
#

@thin stratus I have enabled log on server but not on client in production build
I already though about using the dev builds in prod

thin stratus
#

You should def get a hand on logs

bright fern
#

I don't know how to get logs from client in prod mode

#

is there a -log params?

grizzled stirrup
bright fern
#

yes, I mean shipping

#

@grizzled stirrup I'll look at this bool

bright fern
#

As far as I understand in shipping mode, the server address can't come from the command line, so I pass it via enviromnent variable and try to ClientTravel to it

frank pecan
#

What are some reasons why setting my characters location via SetActorLocation() on Server RPC wouldnt work on clients? Since the character movement component handles replication to all clients I assumed that would work fine, no?

fallow kettle
#

hey... is it true that the OnRep() method needs to be explicitly called from the server after changing the replicated property

sinful tree
fallow kettle
sinful tree
fallow kettle
ripe ravine
#

Im using the advanced steam sessions plugin and managed to get multiplayer working in terms of connecting to eachother but whenever my character plays an animation all other people start playing it as well (at least thats what happens client side for everyone) and im not entirely sure why

I havent worked with multiplayer much so if the answer is obvious then thats why

#

It probably has to do with me not replicating properly but I did it as best as I know how to

sinful tree
#

I havent worked with multiplayer much so if the answer is obvious then thats why
That's why.

#

If you're connecting and you're seeing clients reacting, then it's more to do with how you are getting the animation to play. If everyone is doing it, it sounds like you may be doing a multicast and using a "get player character 0" node to define who is supposed to do it, or something along those lines.

ripe ravine
#

I can confirm that Im probably doing that cause I didnt change anything in regards to that, I dont remember how. The tutorial I used was taken down i believe, Ill start looking around

bright fern
#

I'm trying to do a ClientTravel in PostLogin of the GameModeBase but after the travel, my character is in spectator mode
am I wrong to try to Travel in PostLogin?

#

My bad, it was because I didn't connect to a server with the same code...

shadow hatch
#

is it possible to create / spawn a clientside only sublevel? im basically wanting to create a similar feature to Baldur's gate 3 in coop and possibly dedicated where a player can interact with a mirror or similar object and then get taken back to character creation screen which would house unique lighting settings and a copy of the player pawn to edit. or is there a better way to handle a feature like this?

dark parcel
#

I think I will just spawn my character preview area at the bottom of a level

shadow hatch
severe quiver
#

Could anyone help me in regards to how to properly replicate actor movement?

https://forums.unrealengine.com/t/replicating-actor-movement-with-a-timeline/1527240

This is my post on the forums, its better if I just link it as sending multiple pictures in a row here would clutter everything ๐Ÿ˜…

shadow hatch
#

oh i figured. i suppose i can just spawn actors in the level on just the client? like managing lights and the pawn etc.

#

so two people can be looking at the same level and seeing different actors and variables

#

nah, if its like a character editor id just throw the player chosen variables that define morphs / hair mesh or whatever over onto the server once they click some sort of a confirm button otherwise no reason why the server should know what the players doing with the sliders and all that, i think

frank pecan
#

When I call

UFUNCTION(Client, Reliable)
void MyPawn::BeginTurn()

From my GameMode class, nothing happens. Is that because the game mode is server only and cannot access the client pawns for some reason? What's the common practice for calling CLient code on the game mode? I basically have pawn controls that are locked until the game mode does stuff.

dark wing
#

So BeginTurn is in your gamemode class?

frank pecan
#

nmo its in my pawn

dark wing
#

And you are trying to call that from client or from server?

frank pecan
#

from the game mode so server only

dark wing
#

How are you calling it from gamemode?

frank pecan
#

I Get the game state from the game mode, and loop through the player state array that the game state has. I use playerState->GetPawn() and save that to a TArray<AMyPawn> PlayerArr

Then later after the game mode sets up the map, I get one of the pawns from PlayerArr and call BeginTurn(). Nothing happens

#

but if i run this in standalone, works great

dark wing
#

Can you show me how are you looping through player state array?

frank pecan
dark wing
#

So basically this array is in gamemode, then from gamemode you are trying to call beginturn on each player?

frank pecan
#

yessir

dark wing
#

Can you show me BeginTurn code?

#

UFUNCTION(Client) will execute the code on client side only

frank pecan
#

yea that's what i need

dark wing
#

So if you have something related to character component for example changing any values

#

server will revert them to default values

frank pecan
#
void ATGGamePlayerPawn::BeginTurn()
{
    // if(HasAuthority())
    // {
    //     if(!IsLocallyControlled())
    //         Client_BeginTurn();
    // }
    LastRestedLocation = BallMesh->GetComponentLocation();

    CameraBoom->CameraLagSpeed = 1;

    MyTurn = true;
    
    FRotator LookAtRot = UKismetMathLibrary::FindLookAtRotation(BallMesh->GetComponentLocation(), BallMesh->GetComponentLocation() + AimingVector * 10);

    FRotator Rot = AimingSpline->GetComponentRotation();
    Rot.Yaw = LookAtRot.Yaw;
    AimingSpline->SetWorldRotation(Rot);
    AimingSpline->SetWorldLocation(BallMesh->GetComponentLocation());
    
    OnTurnStarted();
}
dark wing
#

Because only server has the ability to change thse values

frank pecan
#

no just the MyTurn = true is just a private bool that enables Input

dark wing
#

show me header and cpp file

#

where you declare void MyPawn::BeginTurn()

#

because your class name is ATGGamePlayerPawn and you are declaring MyPawn::BeginTurn()

frank pecan
#

no i know that was just to simplify

#

wanted to show that BeginTurn was inside my pawn class and not my game mode class

dark wing
#

Do you have any other RPC that is working fine?

#

or this is the first RPC you are implementing?

opal shore
#

Do someone know how to replicate render targets/paintings? Like so

rose prawn
#

Hey everyone, how does text replication work? If one of the clients picked a different language, what happens?
Edit: nevermind, found the answer. Texts are corrected on client side.

queen mortar
#

Is there any way how I can turn player into ragdoll (set simulate physics) after the player dies so that it works on both server and client?

grizzled stirrup
queen mortar
grizzled stirrup
#

Assuming you don't want to do any more with the client character after ragdoll, calling the tear off function makes it no longer recieve net updates

#

So you can then call whatever on everyone's local machine like ragdoll without any potential server replication corrections

dark wing
#

so it depends how the code is structured

queen mortar
grizzled stirrup
#

In that function, do your ragdoll and it should be working as intended on all machines

dark edge
queen mortar
unkempt tiger
#

if i have a level actor that isn't set to replicate, but that was already spawned both on the client and server (because its a level actor) - can I at some later point during the game set it to replicate, consequence-free?

lyric yoke
#

Hi people. I have "replicate movement" and "replicates" in the character. I have enabled "allow clientside navigation" and I have the following blueprint, but the character doesn't move in the server (it does locally but then it gets back to the original position).

#

Dropping the client side "move to location" (the one on the top) makes the character move weird without any local prediction.

#

Edit, it actually moves but extremelly slow. The same code in standalone doesn't have any issue.

solid river
#

Can property replication notification callback have parameters and return non-void?

elfin creek
lyric yoke
#

It looks like the Simple move to location just doesn't work. I had to implement my own

lyric yoke
#

yeah, I had to replace it with this if anyone is interested

#

and then on every tick

dark edge
elfin creek
#

i think this makes things a bit complicated and i am not sure how it affects the performance as u r doing it on tick

dark edge
#

You'll make much more readable code by arranging things so each executable node is kinda standalone and you dont' gotta follow pins all over the place

keen thorn
#

Hi guys, according to this https://vorixo.github.io/devtricks/atomicity/ Unreal defaults to delta replication for USTRUCTS but does not guarantee that the struct will "eventually be replicated" as how I understand "Replicated" UPROPERTY is supposed to do. Does this means by default USTRUCT replication is not trustworthy unless similar implementation is done to guarantee full replication?

final bluff
#

hey could someone explain why my camera for player 2 (client) might be behaving like this?
Using default third_person_character and default camera , my player 2 spawns but has the camera orientated in a different way than player 1. Im not sure why the camera is different ?

#

If I delete the built in camera and just use a static top down camera , the 2nd player will move right instead of up, UNLIKE player 1 when moving forward

#

Its seems like player 2's forward is behaving differantly than player 1 ??

elfin creek
#

are they both coming from the same BP or u r using 2 different BPs for each character ?

elfin creek
#

how do u spawn them ? BP or u put them inside the level ?

final bluff
#

Spawned via BP

elfin creek
#

can u show me the spawn logic ? cause as far as i can see this is more of rotation issue and it's not about replication

#

what happens if u spawn 3 characters ? or go with 2 clients ?

final bluff
#

If i spawn 2 players both as clients , they both behave incorrectly . Like player 2 is currently behaving

#

if i spawn 3 players , only the server behaves correctly (at least how i think it should behave)

elfin creek
# final bluff

then in this video the server is not behaving correctly right ? only the client does ?

#

sorry i didn't see the mouse correctly xD

final bluff
#

only the server is behaving correctly , the blue player is the server

elfin creek
#

who makes the spawn call ?

final bluff
#

player controller tells the game mode to spawn player

#

and then the game mode is the BP actually spawning the character

elfin creek
#

how exactly are you controlling the character with mouse or keyboard ?

final bluff
#

Yah with mouse and keys

#

WASD

#

just the default input

elfin creek
#

so basically when u press W on client u get D action

final bluff
#

yesss but only in the static top down view

#

if i use the regular camera that follows the player . It spawns with my camera in the wprong direction but after i correct the camera with mouse , it functions normally