#multiplayer

1 messages ยท Page 10 of 1

glad otter
#
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = NetDriverListenFailure, ErrorString = , Driver = GameNetDriver IpNe
Warning: SteamSockets: Cannot get information on an invalid socket handle, returning null
Warning: Could not create socket for bind address 76561198394590028, got error SteamSockets: setsockopt SO_BROADCAST failed```
#

it's my first time trying to setup this and have no clue what to do

graceful flame
#

What have you added to your DefaultEngine.ini ?

glad otter
#

I just had a progress, I removed ?listen from the url of ServerTravel and now I can host just fine, but FindSessions doesn't find the hosted session

#
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

; If using Sessions
; bInitServerOnClient=true

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"```
#

this is what I have added to it

#

I'm following a tutorial and I've done as instructed in it

graceful flame
#

seems correct

#

Are you running in standalone to find the sessions? Are you getting the steam overlay working?

glad otter
#
    if (m_SearchSettings)
    {
        m_SearchSettings->bIsLanQuery = true;
        m_SearchSettings->QuerySettings.Set(SEARCH_PRESENCE, true, EOnlineComparisonOp::Equals);
        m_SearchSettings->MaxSearchResults = 1000;
        m_SessionInterface->FindSessions(0, m_SearchSettings.ToSharedRef());
    }``` this is my Find Session functionality btw
glad otter
#

but I dunno what u mean by steam overlay

graceful flame
#

Do you get the popup in the bottom right when you connect to steam? can you shift + tab to get the steam window?

#

I'm not sure about your session search, I use the advanced sessions plugin so it takes care of that part

glad otter
#

what about SpaceWar

#

did you also build and run that first as well ?

#

I wasn't able

#

to build it

#

isn't that the problem ?

#

maybe because of the headers that I couldn't include in that spacewar

#

maybe it's using the same one, like dx3d9

#

sth like that

graceful flame
glad otter
#

no it doesn't seem like to be part of it

#

when I run the project through cmd, my steam overlays shows that I'm in spacewar

#

wtf

graceful flame
#

yea because you are using the default 480 id

#

It only changes once you spend the $100 to list your game on steam and they provide you with a real app ID

glad otter
#

I've heard of that

#

I dunno this whole multiplayer thing is so confusing

keen surge
#

Are you using lobbies to host?

glad otter
#

yes

#

is there any other simpler way to do it

#

?

keen surge
glad otter
#

I don't need to make a big system just one that works for ppl over wan

keen surge
#

What do you get now?

glad otter
#

friends and folks

keen surge
#

Well there is no easier way than this :P

#

Except using blueprints is less set up, download plugin and drag some nodes

#

If you find this a lot of setup, wait until you have to actually network your gameplay

#

Show your log when trying to find session, does it show the steam sessions?

modern cipher
#

I'm using Hamachi, when I host a session on my laptop I can find it but I cannot join
using the advanced session plugin. I get this error when trying to join with the JoinSession function

LogNet: Warning: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.00, Real: 20.00, Good: 20.00, DriverTime: 20.03, Threshold: 20.00, 
[UNetConnection] RemoteAddr: X92.X68.X.XXX:7777, Name: IpConnection_0, Driver: PendingNetDriver IpNetDriver_0, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID

but if i type in console open X92.X68.X.XXX:7777 it works...
any idea why that is happening?

keen surge
#

Or does it not find anything at all

glad otter
#

World->ServerTravel("/Game/Maps/LobbyMap?listen"); is this how I should servertravel when hosting ?

#

if I remove ?listen I can host

#

like this I cannot do it

keen surge
#

That ?listen marks the host as a listen server

#

Meaning they will act as the server when other people join

#

But your hosting is fine you said

glad otter
#

no if I remove ?listen, it's fine

#

with ?listen I get errors

lusty sky
#

you can simply open level with listen option

keen surge
#

What errors do you get?

#

Or still the same as above

glad otter
#

too bad you can't see the colors..

glad otter
keen surge
#

Are you running this in standalone?

#

The one where you got this log

glad otter
#

not the standalone you play using the editor, I use CMD

#

to play the game

#

... -game -log

keen surge
#

As long as you have steam overlay

glad otter
#

when the game is running I get the overlay, if you mean the one coming under my name saying im playing spacefar

#

spaceWar*

#

and can inv friends and stuff..

keen surge
#

Yeah I'm not sure where these socket errors come from ๐Ÿค”

glad otter
#

I think I gotta post on Gamedevtv

#

thats where the course is from I guess

#

Sam Pettuzi if I spell his name correctly is the tutor

keen surge
#

It's same no matter who made the tutorial however

#
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
#

engine.ini

#
    FOnlineSessionSettings sessionSettings{};

    sessionSettings.bIsLANMatch = IOnlineSubsystem::Get()->GetSubsystemName() == "NULL";
    sessionSettings.bIsDedicated = false;
    sessionSettings.bAntiCheatProtected = false;
    sessionSettings.bAllowInvites = true;
    sessionSettings.bAllowJoinInProgress = true;
    sessionSettings.bUsesPresence = true;
    sessionSettings.bAllowJoinViaPresence = true;
    sessionSettings.bShouldAdvertise = true;
    sessionSettings.NumPublicConnections = 4;
    sessionSettings.bUseLobbiesIfAvailable = true;

    UE_LOG(LogTemp, Warning, TEXT("Creating session..."));
    SessionInterface->CreateSession(0, SessionName, sessionSettings);

creating session

#

No matter who made the tutorial it will always be the exact same :P

glad otter
#

ye..

#

is there any other plugins I need to activate other than Steam Socket and Steam Online Subsystem ?

keen surge
#
"OnlineSubsystem", "OnlineSubsystemSteam"
#

And includes would be:

#include "Engine/World.h"
#include "Kismet/Gameplaystatics.h"
#include "OnlineSubsystem.h"
#include "OnlineSessionSettings.h"
keen surge
#

OnlineSubsystemSteam, SteamSharedModule, OnlineBase, OnlineServices, OnlineSubsystem, OnlineSubsystemNULL, OnlineSubsystemUtils

#

I have those on

#

But only the steam ones might not be enabled by default

glad otter
#

yea mine was also not enabled so I thought maybe enabling it would solve it

#

the rest are the same for me too

#

it seems like I will not be able to sleep at ease tonight xd

peak sentinel
pallid mesa
#

To be fair, is yet one of the unique courses that covers movement prediction decently. Don't be so harsh with Sam ๐Ÿ™‚

#

there is a series of videos in YouTube that I believe uses the FRepMovement pattern for their vehicle replication
https://www.youtube.com/watch?v=RQbLUko5mSU

Take a closer look at one of the most important behind-the-scenes systems in online games: The Network Prediction Interface.

In this video, you are gonna take an introduction to the system, you will be able to understand how does this works, and get ready to implement it yourself in the following class.

Video mentioned:
PBS Space Time - The S...

โ–ถ Play video
#

haven't checked myself, just skimmed, so take with a grain of salt ๐Ÿ˜„

dim trail
#

in general should I RPC functions in BP or c++? pros/cons of each?

torn geode
#

Is there a way to store variables with steam? Or do I need to make a sql database for it. Should also mention im using bp

fathom aspen
iron crest
#

Hello, I have a problem, im trying to apply damage in multiplayer, I have it so that whenever it gets to a certain notify in the animation it plays the "Do Damage" custom events and spawn a circle in front of the charaacter which decides if we do damage or not, ive tried many different thing like switch has authority, run on owning client, etc and it will just not work, it will either spawn the circle on both players, damaging both of them, or make it so that only Client 1/authority can do damage, does anyone know a fix to this, it would be greatly appreciated.

#

also the server is being ran in a different process dont know if that info is relevent or not'

sleek kraken
#

(FYI im a complete beginner to multiplayer and replication) im trying to get a particle system to show up for everyone, i cant seem to get it working any help is appreciated.

#

here is what i have

fathom aspen
#

Particle system is an object thus not replicable

#

And it shouldn't be

#

Multicast it instead

sleek kraken
#

so just switch it to multicast, anything else need to be done

fathom aspen
#

I can't spot anything else

#

Doesn't hurt to try

sleek kraken
#

shows up on client side, not on the other side

fathom aspen
#

That's because you are firing it from client

#

You fire multicasts from server

#

So you should do another Server event

#

That calls it

sleek kraken
#

so a custom event run on server

fathom aspen
#

And the server event is the one called from client

sleek kraken
#

that calls the event thats multicast

fathom aspen
#

Correct

sleek kraken
#

should the multicast be in the actor or should i put it in something else

fathom aspen
#

RPCs are always called from actors

#

Replicated actors to be specific

sleek kraken
#

i just mean should both events be in the actor

#

or is it better practice to put one in another blueprint

fathom aspen
#

Nope

#

Same BP

sleek kraken
#

ok thank you, replication is a bit confusing

#

i need a replication for dummies

fathom aspen
#

Hopefully Iris will make your life easier

#

Let's wait and see

sleek kraken
#

ill try real quick

#

not working unfortunately

#

see anything wrong

fathom aspen
#

What class is this whole logic in?

sleek kraken
#

actor blueprint

fathom aspen
#

What actor

#

Is it Character?

sleek kraken
#

no

#

its a weapon

#

just a regular actor

fathom aspen
#

Ok then that's the reason

sleek kraken
#

oop

#

what have i done now xD

fathom aspen
#

It has to be from an actor that is client owned

#

I mean isn't your weapon owned by the character when spawned?

sleek kraken
#

it is

fathom aspen
#

When you spawn your weapon you can specify an owner

sleek kraken
#

i have this script running as "run on owning client"

#

because otherwise the other players weapons wouldnt spawn in

fathom aspen
#

Why though?

#

The weapon won't be replicated

sleek kraken
fathom aspen
#

You are spawning the weapon on client

#

Why?

sleek kraken
#

this script is in the character

fathom aspen
#

I know

sleek kraken
#

where should it be

fathom aspen
#

It should stay in character

#

But you are spawning the weapon on client

#

That way other clients won't see it

#

Also the server won't know about it

sleek kraken
#

that was the problem the other players couldnt see me holding a weapon

fathom aspen
#

Unless you have a valid reason, you are doing stuff the wrong way

sleek kraken
#

so i shouldnt replicate the weapon spawn at all?

fathom aspen
fathom aspen
#

You don't use a multicast either

#

You spawn it on server and make sure the weapon is set to replicate

sleek kraken
#

how do i do that

fathom aspen
#

You can't call RPCs on actors that are not replicated and spawned by the server

#

You can even set the owner the client

#

Won't have an effect

fathom aspen
sleek kraken
#

so i made the event to spawn the weapon non replicated

sleek kraken
fathom aspen
sleek kraken
#

ive survived so far by youtube tutorials and willpower

fathom aspen
#

Also found in this channel pinned messages

fathom aspen
#

Use them with a grain of salt

sleek kraken
#

i know lmfao

#

most of them are awfulll

fathom aspen
#

Not all of them are reliable

sleek kraken
#

and shortcuts that will hurt you later

fathom aspen
#

Correct

#

They teach you bad practices

sleek kraken
#

like i said willpower lol

#

ive had to basically remake my game 4 times now

fathom aspen
#

That's why you should take the time to read the compendium and ask here for any vague points and then resume working on your game

#

Worth the read

sleek kraken
#

i will try

#

depends how dummed down the explination is

graceful flame
#

Multiplayer isn't easy, there's a lot of new concepts and terminology all at once. It just takes some reading, trial & error and a few ah-ha moments until everything clicks.

sleek kraken
#

as ive learned with most things game related, its super hard at first and once you understand it a bit everything seems to click

#

atleast thats been my experience

#

on page 7 it says to basically says to avoid cheating run ammo checks on the server and things like that

#

hopefully its just as simple to make the event run on server

fathom aspen
#

You are still at the very beginning. Take the time

dark edge
#

Then you go down the prediction rabbit hole

#

multiplayer is HARD

sleek kraken
#

itd be nice to just download a finished game to use as reference, that way i could see good examples

graceful flame
#

We should talk about prediction more

fathom aspen
#

We should have #prediciton

graceful flame
#

It's like an ever evolving thing I have to keep chasing, I don't have a solid reuseable format because I'm having to predict different things

sleek kraken
#

wouldnt it be better to just leave ammo and anything that is constantly being referneced stay client side and implement an anticheat instead

#

easier said than done ofc

#

but itd remove the ping issues

graceful flame
#

For example the way I'm handling prediction for some of my stuff is that I'm using a combination of custom events (so things change visually on the client for instant feedback), server events to set replicated values (with repnotify so that other stuff happens securely) and then a multicast for some visual stuff that other players see.

#

For my projectile prediction I'm basically spawning two. The first runs using a custom event but doesn't deal damage and is only visible for the owner and then another projectile is spawned server side that does deal damage and is visible for everyone except for the owner who fired the shot.

#

This is probably going to result in a scenario where a client thinks it was a hit but the real projectile on the server misses, but meh I don't know how else to make it seem to shoot instantly without a delay when testing with simulated network lag.

quartz iris
#

Is this the correct way to display steam online players?

fresh chasm
#

You could correct the projectile path from server to client, but idk it's worth the effort

quartz iris
#

Because the player's steam name doesnt show when i test it

fathom aspen
quartz iris
fathom aspen
#

This is in UMG widget right?

quartz iris
#

yea

fathom aspen
#

Ok how's that related?

quartz iris
#

its just some text on a widget

#

it should show the steam name of a player in the slot 1

fathom aspen
#

Ok, you don't use this node with index 1

#

UMG are local

#

GetOwningPlayer

fresh chasm
#

index 1 is unknown to the client

fathom aspen
#

That's the node you use instead

quartz iris
#

but why?

#

get controller should work right?

fathom aspen
#

If you used it with index 0 then yes

#

Though that's a bad practice

#

It's in the compendium btw

#

Which I pointed you towards but you keep ignoring

quartz iris
#

But dude I don't get the idea of how referencing the player controller of said slot doesnt work

fathom aspen
#

Widgets are local

quartz iris
#

get owning player would only get the local player?

fathom aspen
#

Only player knows of his own widgets only

#

Would get the controller associated with this widget

quartz iris
#

so i need to cast to the player then get the controller ?

fathom aspen
#

Saying index 1 means you don't know that widgets are local

fathom aspen
quartz iris
#

i just want to get the second player in the lobby

#

but via the widget

fathom aspen
#

I can only repeat

#

Widgets are local, thus they can reference only the player that owns them

quartz iris
#

so whats the workaround of referencing other players for a leaderboard of some sort

fathom aspen
#

You have a leaderboard, that is most probably a vertical box that you add to it widgets that represent players. Each widget has a property of player name and it set the player that owns it

#

You have GameState.PlayerArray

#

Which is on both server and clients

#

You can traverse it and fill that leaderboards widget accordingly

#

That's why you already have a PlayerName property in PlayerState

dim trail
#

so, im trying to implement a rotate character on click but it looks like its only working on the first client

#

heres rotate character

fathom aspen
#

Start applying concepts you learn here

#

This isn't the channel of help me make my own game. It's literally concpets

quartz iris
#

I can't get my head around it

#

In my brain referencing the player controller n.2 should work

fathom aspen
#

Again this is my last tip

quartz iris
#

Like this?

fresh chasm
fathom aspen
# quartz iris

I don't get why PlayerName is part of PlayerController

#

That way clients won't know the name of other clients

#

PlayerController exists on server and owning client

quartz iris
fathom aspen
#

Still

#

It can be what it wants

open quail
#

Doesnt player state has the name already?

fathom aspen
#

I can write you the whole compendium here

#

But that's not my job

quartz iris
#

I think we're talking at cross purposes

fresh chasm
fathom aspen
#

If it was on PlayerController then no one would know the name of the other players

#

Apart from the listen server

#

Which is ughhh

#

Read that compendium (11th time)

quartz iris
fresh chasm
fathom aspen
# quartz iris

You are setting the name multiple times to the same widget

quartz iris
#

Compendium my balls bro

fathom aspen
#

You do that for each widget

#

Not for the same widget

dim trail
#

@fresh chasm when i use this it only "works" on the second client and not the first. also, it only seems to add yaw input not move it to the location under the cursor

fathom aspen
#

It's in the pinned messages along with a hell other good resources

fresh chasm
quartz iris
open quail
fathom aspen
dim trail
quartz iris
fathom aspen
#

There is nothing like that. You don't find examples you search for. Though you learn concepts the right way which you lack

#

MP is hard. If you don't take the time to learn it right, you will find yourself lost quite easily

open quail
dim trail
#

no, just the owning client

open quail
#

Hmm your pawns use character move ent component right

dim trail
#

move to?

#

the one with navmesh?

fresh chasm
#

If you use a move to, you can just check "Orient Rotation to Movement" in character movement

#

And uncheck "Use Controller Rotation Yaw" in Character Class defaults

#

(assuming they are Characters)

dim trail
#

im not using move to

#

im using add movement input

fresh chasm
#

It would work also I think

#

Else, like @open quail said, you can try with GetPlayerController>SetControlRotation instead

dim trail
#

oh, thanks

fresh chasm
#

Idk if it can be called directly on client though

open quail
#

Set control? Yeah its what i tend to use cuz it can be used on clients

nova briar
#

I'm having some trouble understanding why the Actors i've added to a map don't get destroyed for the remote client. I marked the Actor with bReplicates = true;

#

When I destroy the actor (with GetLocalRole() == ROLE_Authority) on the server I'm expecting the propogation to happen to the clients.

#

But I wonder if it's because I added these actors to a map and so perhaps each client is getting it's own copy of the actor

#

I suppose another way to ask the question is. Have pickups (Actors) automatically get destroyed on collision in multiplayer, do the pickups need to be spawned explicitly?

fathom aspen
#

TMaps don't replicate

#

Why do you add actors to them

#

OnBeginOverlap->HasAuthority->Destroy(self)

nova briar
#

@fathom aspen Thanks for responding. I'

#

I'm trying to do a basic map with 3 pickups. I was assuming I could just do this in editor

#

however the destroy only seems to work on the local client. So I'm not sure if I'm trying to do something wrong in the map or wrong in the collision handler

fathom aspen
#

Use an array if you want some type of container that supports replication

#

Though that has nothing to do with why the actor is not being destroyed

#

I'm wondering how you spawned these actors

nova briar
#

How I spawned them: I just dragged the actor class onto the map

fathom aspen
#

As long as they are server spawned and replicated you're good

#

So they are preplaced

nova briar
#

So I don't think I'm server spawning

#

yes preplaced

fathom aspen
#

If they are replicated then yes there shouldn't be an issue

fathom aspen
nova briar
#

Ok thanks for that reassurance. I'll go look more carefully at the collision code

fathom aspen
#

See if it's executing the destroy function

nova briar
#

I figured it out, thanks. I was accidentally running with Number of Players: 2 in "Play Standalone" and meant to be in "Play as Listen Server" And so I guess that's why the replication wasn't working.

#

I realized something was up when I noticed only one pawn was present in each window.

#

A silly mistake. But thanks again.

iron crest
#

Hello, I have a problem, im trying to apply damage in multiplayer, I have it so that whenever it gets to a certain notify in the animation it plays the "Do Damage" custom events and spawn a circle in front of the charaacter which decides if we do damage or not, ive tried many different thing like switch has authority, run on owning client, etc and it will just not work, it will either spawn the circle on both players, damaging both of them, or make it so that only Client 1/authority can do damage, does anyone know a fix to this, it would be greatly appreciated.
also the server is being ran in a different process dont know if that info is relevent or not'

fresh chasm
iron crest
fresh chasm
#

Do you mean that you are calling a server and client event after the notify ?

iron crest
#

Yes

fresh chasm
#

Ok so, to call a client event, you must be on server

#

but what you need is a multicast event, it will be sent from server to everyone relevant

iron crest
#

Ok I will try that rn

fresh chasm
#

but you have to be on server to call a multicast, try to place a print right after the notify to see if you are on server or client (it should print "server: hello" or "client: hello"

iron crest
#

oh, Ive done that before im playing as client

fresh chasm
#

Ok so the unsafe method is to call a server event from the client, that will then call a multicast

#

The safe method would be to make the server also play the animation, so it will receive the notify, and directly call the multicast after a SwitchHasAuthority

#

It might be resources heavy for the server if you have a lot of players
Another method would be to use a timer on server

iron crest
#

Right, I will try the unsafe method you stated, may be a decent amount of players in future

#

so you mean call a server event from a client like this right, or should it be owning client instead of on all

fresh chasm
#

Right after the notify, you call a server event, then in the server event you ApplyDamage and you call the multicast "SpawnCircles"

#

So that ApplyDamage is only executed on server, and SpawnCircles is executed on everyone

#

So it goes like this : Client>Server>All

iron crest
#

Ok will try right now

#

hm still doesnt seem to work it continues to spawn the circle on the other players instead of only the causer/attacker

fresh chasm
#

so every players spawn a circle in front of them rn ?

iron crest
#

yes, I only want it to spawn on whoever is playing the animation/attacking

fresh chasm
#

can you post a screen of the nodes after the multicast please

iron crest
#

no problem, one second

fresh chasm
#

Hmm I don't see where the circle is spawned in the code but it's wrong

iron crest
#

its the sphere overlap actors

fresh chasm
#

DoDamageClient1 is the event called right after the notify ?

iron crest
#

yep then the apply damage one which is ran on server

fresh chasm
#

Oh I thought that the circles was UX effects

iron crest
#

oh no lol

fresh chasm
#

You only need to do the trace on the server, then apply damage on the server

iron crest
#

so everything on server?

fresh chasm
#

So remove DoDamageClient1

iron crest
#

ok

fresh chasm
#

and call DoDamage after the Notify

#

and make it Server event and not multicast

iron crest
#

and apply damage should stay on sever aswell?

fresh chasm
#

yes always

#

if you see the small computer icon at the top right of the node, it must be called on server

dim trail
#

Isnโ€™t there already a network replicated applydamage function

fresh chasm
#

But you can remove the ApplyDamageServer event, since DoDamage is now a server event

iron crest
#

Ok,

#

it still spawn on both players, here are my multiplayer setting by the way not sure if its relevant or not

fresh chasm
#

add a "is locally controlled" between the notify and the call to DoDamage

iron crest
#

ok

fresh chasm
#

So DoDamage is only called by the player that plays the animation

iron crest
#

so its saying that client 1 and client 2 are local but server is not local, did a branch with print strings

fresh chasm
#

use GetOwningPlayer or something like this

#

instead of GetPlayerCharacter

iron crest
#

owning player controller right

fresh chasm
#

yes might work

iron crest
fresh chasm
#

Np ๐Ÿ™‚ The important part is to understand why it works now lol

#

So you can reproduce if you get stuck later

iron crest
keen surge
#

Does anyone know why my animations could be running slower from client onto server but not the other way around (server -> client or client -> client is fine) framerate is fixed, and roughly the same on all instances as seen in screenshot but the rays on server are way less. I've done some additional testing and every location and amount of calls is the same as well.

#

The animations themselves are replicated montages, started and stopped using multicast on server

#

Ok even more testing shows me if client FPS is lower it becomes worse ๐Ÿค”
(I'm just drawing the rays on client for debug, server is the one actually responsible)

chrome bay
#

Well, a lower framerate means the animation is obviously going to play slower. If you're raycasts are not framerate independent then you will get fewer of them.

#

Most of the time, this stuff is not actually driven directly from animation.

#

Oh nvm, I misunderstood. Are you using the character class for pawns? The character movement component by default only updates character animations when the server receives a movement packet from clients, otherwise animation can be out of sync with actual movement. You need to disable that behaviour to prevent the FPS issue in this case.

#

In a real world connection, the effects will be much worse

#

But the original point stands, don't drive gameplay-critical collision from animations.

next kernel
#

Good Morning, I was asking in here yesterday about replicating a variable (a float seed) to a client joining. The seed is needed for a lot of procedural construction. Everything I've tried, and I've spent way too long on this, results in the seed variable not being replicated to the client. Any ideas?

#

I expect my explanation was a bit wonky

bitter oriole
#

If you need more details, you probably need to show what you've done

next kernel
#

that's exactly what I've done but the replication does not work

bitter oriole
#

Probably didn't add it to the replication property list

#

Show your code

next kernel
#

I've added ReplicationUsing but the function isn't fired

modern cipher
bitter oriole
next kernel
#

yeah, I wondered if a rpc was needed for timing reasons

bitter oriole
#

The opposite

next kernel
#

oh

bitter oriole
#

Did you add the property to the lifetime getter

modern cipher
#

why not he said its important for procudral stuff

bitter oriole
next kernel
#

yes, it's for terrain, layouts, structures.....

#

I really have been asking myself why I want to make everything procedural, it's a nightmare

#

hehe

bitter oriole
#

So did you add the property to the getter or not

#

(GetLifetimeReplicatedProps)

next kernel
#

I added bReplicates = true to the constructor and setup the GetLifetimeReplicatedProps function

bitter oriole
#

Show your code.

next kernel
#

sorry to be discord naive here - what's the best way of pasting code here?

bitter oriole
#

ctrl+v

#

using triple ` around it

#

```cpp
code go there
```

next kernel
#
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME( ATheSeedMaker,TheWorldVariables);
    DOREPLIFETIME( ATheSeedMaker,TheSeed);
    
    //DOREPLIFETIME_CONDITION( ATheSeedMaker,TheWorldVariables, COND_InitialOnly);
    //DOREPLIFETIME_CONDITION( ATheSeedMaker,TheSeed, COND_InitialOnly);
}```
#

oh god

bitter oriole
#

Show the constructor, class declaration, upropertys

next kernel
#
{
     // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;
    
    RootComp = CreateDefaultSubobject<USceneComponent>("Root");
    SetRootComponent(RootComp);
    RootComp->SetMobility(EComponentMobility::Static);

    static ConstructorHelpers::FObjectFinder<UMaterialParameterCollection> FoundMatParamColl(TEXT("MaterialParameterCollection'/Game/TheMaterials/TerrainParams.TerrainParams'"));
    if (FoundMatParamColl.Succeeded())
    {
        TheMatParams = FoundMatParamColl.Object;
    }
    
    static ConstructorHelpers::FObjectFinder<UBlueprint> TerrainBlueprint(TEXT("Blueprint'/Game/Blueprints/BP_CreateTerrain2.BP_CreateTerrain2'"));
    if (TerrainBlueprint.Object){
        CreateTerrainBP = TerrainBlueprint.Object->GeneratedClass;
    }

    //MakeWorldVariables();
    UE_LOG(LogTemp, Warning, TEXT("ATheSeedMaker::ATheSeedMaker()"));

    bReplicates = true;


}```
#

I've also tried replicating a float (the above replicates a ustruct for other variables)

bitter oriole
#

Where and when do you set the seed

chrome bay
#

Constructor helpers usage spotted (dis bad)

next kernel
#

oh

bitter oriole
#

Also ConstructorHelpers is bad and should never be used, yes

#

But that's not the issue

next kernel
#

ok, I'll check that once my nightmare is over

keen surge
# chrome bay But the original point stands, don't drive gameplay-critical collision from anim...

Yeah it's a character indeed, was already thinking that had something to do with it.
I wasn't planning on keeping the current collision in the end, it's for testing purposes currently.
How would I go about achieving similar collisions for actual shipping, letting the server start delays and doing some traces there in the animation shape (without actually using the animation/anim notifies)?

chrome bay
next kernel
#

I've tried making the seed and other variables in PreRegisterAllComponents() and PostInitializeComponents() and BeginPlay()

keen surge
chrome bay
#

You could make a utility to bake that information out too, to make it a little easier to edit when anims change etc.

bitter oriole
next kernel
#

oh, I've been using (HasAuthority())

keen surge
next kernel
#

but not in PreReg

#
    FWorldVariables TheWorldVariables;```
#
    void OnRep_WorldVarsSet();```
#

I've put a UELOG in the OnRep function but I don't see it so I guess the replication just isn't happening

#

it seems like something that should be simple and yet I can't work out what's wrong

#

I've also tried creating the variables in GameMode, grabbing them GameState and then casting from the actor to get the values

bitter oriole
#

Show FWorldVariables

next kernel
#

it's the same deal with a simple float value

#

but sure

bitter oriole
#

I mean replication is normally fairly simple so something you are doing does not work and there is no way to guess what it is without having the code

#

You keep not showing any code that actually uses the replicated var - writing it or reading it

next kernel
#

maybe it's best to go simple and just work with the seed value (float variable)

#
#include "CoreMinimal.h"
#include "WorldVariables.generated.h"

USTRUCT()
struct FWorldVariables
{
    GENERATED_BODY()

    //FVector TheMainDimensions;
    int32 GridVerts;
    int32 Levels;
    float Scale;
    float MaxHeight;
    float SeaLevel;
    float Frequency;
    int32 NumOctaves;
    float FloatSeed;
    int32 FBMType;
    float GridLength;
};```
#

that's worldvariables

bitter oriole
#

Well this is wrong

#

None of this can be replicated

#

Because they don't have UPROPERTY tags

next kernel
#

yikes, of course

bitter oriole
#

(I would also strongly suggest to rename this to FMyProjectWorldVariables to avoid conflicts with engine code)

next kernel
#

will do

#

I should have just outlined my replication problem with a float value

bitter oriole
#

Yeah, if you can reproduce the issue with a simple code where the server writes a float replicated value different from the constructor default and your client code never get the replication event after a few seconds, that would help

next kernel
#
    float TheSeed;```
bitter oriole
#

Show the constructor, setter, and event

kindred widget
#

If a property isn't replicating.
Check that the actor is replicated and arrives on client.
Check that the actor is spawned solely on Server.
Check that you have Replicated or ReplicateUsing specifiers.
Check that you have added a DOREPLIFETIME macro for the property in the class.
Check that all replicated state has a UPROPERTY and is not marked NotReplicated.
Check that you have correctly set the property on the server.
Check that the actor is relevant to the client.

#

And based on your constructor and what this is. It's probable that relevancy is your issue. Use AlwaysRelevant = True.

bitter oriole
#

Forgot "check that the value is set to anything else than the constructor value"

next kernel
#

ok, I'll just have a quick fiddle and brb

bitter oriole
#

Right, as soon as you post the code I'll be sure to look

next kernel
#

yes, trimming out some UELOGS and such like to clean it up

next kernel
#

I made a fresh actor and have managed to replicate the seed, but only in the tick

#

is this normal?

#

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "SeedMaker2.generated.h"

UCLASS()
class ROYWORLD_API ASeedMaker2 : public AActor
{
    GENERATED_BODY()
    
public:    
    // Sets default values for this actor's properties
    ASeedMaker2();

    UPROPERTY(VisibleAnywhere,BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
    USceneComponent* RootComp;
    
    UPROPERTY()
    FRandomStream RandStream;

    UPROPERTY(ReplicatedUsing=OnRep_WorldSeedSet, VisibleAnywhere)
    float TheSeed;

    
    
protected:

    virtual void PreRegisterAllComponents() override;
    
    // Called when the game starts or when spawned
    virtual void BeginPlay() override;

public:    
    // Called every frame
    virtual void Tick(float DeltaTime) override;

    UFUNCTION()
    void OnRep_WorldSeedSet();

    UFUNCTION(BlueprintCallable)
    float GetWorldSeed();
};
#


#include "SeedMaker2.h"

#include "Net/UnrealNetwork.h"

// Sets default values
ASeedMaker2::ASeedMaker2()
{
     // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = true;

    RootComp = CreateDefaultSubobject<USceneComponent>("Root");
    SetRootComponent(RootComp);
    RootComp->SetMobility(EComponentMobility::Static);

    bAlwaysRelevant = true;
    bReplicates = true;
    
}

void ASeedMaker2::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    
    DOREPLIFETIME( ASeedMaker2,TheSeed);
    
}

void ASeedMaker2::OnRep_WorldSeedSet()
{
    UE_LOG(LogTemp, Warning, TEXT("ASeedMaker2::OnRep_WorldSeedSet() --- TheSeed == %f"),TheSeed);

}

float ASeedMaker2::GetWorldSeed()
{
    return TheSeed;
}

void ASeedMaker2::PreRegisterAllComponents()
{
    Super::PreRegisterAllComponents();

    FRandomStream RandForSeed;
    RandForSeed.GenerateNewSeed();

    //FWorldVariables TempVars;

    if(GetWorld()->GetAuthGameMode())
    {
        TheSeed = RandForSeed.FRandRange(1.f,10.f);
    }
    
}

// Called when the game starts or when spawned
void ASeedMaker2::BeginPlay()
{
    Super::BeginPlay();

    UE_LOG(LogTemp, Warning, TEXT("ASeedMaker2::BeginPlay() --- TheSeed == %f"),TheSeed);
}

// Called every frame
void ASeedMaker2::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);

}


bitter oriole
#

Like I said before, your value can only replicate if the server changes the value vs the constructor one

#

Specifically the value on the server needs to be different from the client value and from the initial constructor value

next kernel
#

but not before the tick?

#

replication can't happen earlier?

bitter oriole
#

You can change the value on BeginPlay on the server

#

Then the updated (!= ctor value) value will replicate to the client eventually

#

Could be 50ms, 5 seconds

#

If that value is different fro mthe client value, the event will fire

next kernel
#

a UE_LOG on begin play replicates but again, I only see the value in the tick

bitter oriole
#

Specifically there is zero guarantee that SeedMaker2::BeginPlay on client will fire before or after the value replicates

#

That's probably what you're missing

next kernel
#

yeah, that's what I thought

#

I've done a lot of my world building before begin play so it looks like I need a major rethink

#

and also change all those construction helpers

bitter oriole
#

In my experience what most games need is something like this - keep the screen black, or the UI on top blocking the view, until a bunch of preconditions are met

next kernel
#

build everything once it's certain the client has joined- makes sense

bitter oriole
#

Like pawn replicated, and all client-side data has a valid state

bitter oriole
#

The server can and should do stuff as soon as possible

#

But then the client should wait for a valid game state before displaying the game

#

For example your seed can initialize to -1 in constructor

#

As long as it's <0 you simply don't show the level, and keep waiting for a valid state

#

Once the seed replicates five seconds later, you can initialize and then show

next kernel
#

using procedural meshes, don't I have to build on the client as well? - I've read the procedural mesh comp doesn't replicate

bitter oriole
#

Sure

#

You do that as soon as it replicates

#

But you can't use BeginPlay for anything multiplayer related on clients

next kernel
#

is PostInitializeComponents more useful?

bitter oriole
#

No idea, but that sounds too early

#

My go-to strategy is BeginPlay on server, and then have clients update themselves on tick based on state

next kernel
#

right, I understand. that's nice and clear

#

thank you very much for your help here

#

as you can tell, I'm still learning

#

and network stuff has been somewhat tricky after a year of single player stuff

keen surge
#

Where can I find info regarding network connection to be used in game (no commands)?
Or would I have to send something back and forth to calculate ping and packet loss etc?
Nvm, found out you can get ping in milliseconds through playerstate

ocean vessel
#

Hello, I placed a spline mesh that players can walk on. The problem is, when two players walk on this mesh, the Client Sees the server player as in falling state.

I'm sure it has to have something to do with replication so I checked "replicates" both on the actor and components, and it works, but it generates other problems.
The client also sees a second instance of the same spline mesh that has buggy generation and no collision. How can I solve this problem?

civic hollow
#

I need some help or advise. I try to reduce jitter when player character move on the ship. Seem fix about BasedUpdateMovement or something.
but I try to tweak many things seem not help. So any topic or tutorial ?
Seem lack about movement on base in unreal engine document.
Like this thread.
https://forums.unrealengine.com/t/multiplayer-how-to-get-smooth-character-interpolation-on-moving-platforms-without-jittering/108500/2

#

Anyone suggest for document / tutorial / or course ? , I need where to start ,I'm intermediate in C++ but need to know in-depth concept for modify CharacterMovementComponent with right way.

umbral horizon
#

Does anyone know if push model works with pointers?

woeful ferry
#

Currently thinking of a notification/message system, but can't grasp how to make it due to localization.

Player wants to open a box > interacts to server to open it > its locked > send client a message that it's locked.

#

This won't work since the server will send the server's local language, right?

marble gazelle
woeful ferry
marble gazelle
#

for example, yes

woeful ferry
#

Yea, I think I'll do that! ๐Ÿ˜›

#

Thanks

marble gazelle
#

anytime^^

civic hollow
hoary nova
#

Does it make sense to learn GAS before diving into mp stuff?

dark edge
#

You should at least know how the multiplayer basics work tho

#

To realize what GAS even gives you.

civic hollow
gilded vapor
#

Whats the best practice way from sending lobby-character customization info to the actual gameplay-level?

Current example RPCs the info to the server, writes it to disk and loads it once it loads a new map but that seems wrong? (Maybe it is the best way?)

dim trail
#

I have replicated UProperties that are within a function that does some math and returns a float(damage), which then calls ApplyDamage. Should this function be RPCd?

gilded vapor
#

if you're calculating client-side you will need to RPC it to the server

chrome quest
#

This is a bit important but does anyone know the state of multiplayer physics?

Can I drive gameplay events with it and not just cosmetic stuff like destruction rubble?

#

Also, does chaos destruction with the pre baked fracturing work in multiplayer

dim trail
barren surge
#

Has anyone come across any resources/examples of spawning an actor client side for prediction, but once the server spawns the real actor, it "binds" to the client side predicted actor?

It looks like to achieve this, would rely on "stable naming" but still have not nailed down the exact requirements. Any suggestions?

azure cape
#

hi, so apparently if I spawn a component on an actor on the server I can get it to replicate
can I spawn it on the client and call a RPC that'll also spawn it on the server and get them to sync?

zenith wyvern
#

I have an actor with a variable, an array of a custom actor. That actor has a variable string. All of these variables are set to replicate

#

When I create the actor on the server, it replicates to the client, which can see it, but the actor's replicated string is null

#

I can for loop over the first level of replicated variables, but the elements are null on the client

#

Is that level of 'recursive replication' not allowed?

gilded vapor
gilded vapor
#

(FWIW I calculate damage locally as well)

dim trail
#

Iโ€™m using c++ by the way

gilded vapor
#

RPC the params to the server -> execute damage -> have the variables replicate back to the clients

#

but sometimes it makes sense to calculate locally (IE if you want to locally predict knock-back + damage)

dim trail
#

The variables should replicate automatically if they have the โ€˜replicateโ€™ tag right?

gilded vapor
#

you could do something like just have the damage number appear on screen but than not change hp until the server actually calculates damage

gilded vapor
dim trail
#

Does โ€œApplyDamageโ€ have to be multicast so that if for example client 1 damages mob it replicates to all clients? Iโ€™m going to be using UE library for ApplyDamage and AnyDamage

#

From what Iโ€™ve seen (at least on the BP side) ApplyDamage is executed on the server

#

I guess it wouldnโ€™t matter, the only thing needed to be multicast is the actual health of the mob

#

And if the health is set to replicate(on the mob)

#

Kinda confusing differentiating โ€œreplicateโ€ with RPCs

sinful tree
dim trail
#

Could you expand further on โ€œYou do not multicast stateโ€? Iโ€™m not understanding that part fully

zenith wyvern
#

Can anyone explain nested replication? Or point me towards some reading?

#

I'm surprised my replicated objects aren't also replicating their data

graceful flame
# dim trail Could you expand further on โ€œYou do not multicast stateโ€? Iโ€™m not understanding ...

Multicasts can fail when there's too many RPCs at once. Also anything set by a multicast won't happen for players who join the game after the multicast has already happened.

Bad: A server event which calls a multicast event that changes a boolean variable from false to true.

Better: A server event that changes a replicated boolean variable from false to true.

Best: A server event that changes a replicated boolean variable from false to true which also uses repnotify to then call a follow up function which changes something else.

sinful tree
# dim trail Could you expand further on โ€œYou do not multicast stateโ€? Iโ€™m not understanding ...

If you have variables on an actor that are marked to replicate, the "state" of those variables will be replicated. If you're running a multicast and passing through a variable it's very similar, but it's not the way to handle it - multicast is like a fire and forget event but if an actor is outside of relevancy range, the client wouldn't receive the notification and they wouldn't receive the state of the variable.

As an example, lets say I was outside of relevancy range, and you damaged an enemy, and that enemy doesn't have a replicated health variable. If you multicast the change in health, you could set it up so that any clients that received that multicast would see that the health value of that enemy is decreased in a widget above the enemy's head. Now lets say I came into relevancy range, I wouldn't see that the enemy was damaged as I never received the multicast and they would still be at full health.

So your best bet to replicate state is through a replicated variable as the new variable will be received on the client. Having it set up as an OnRep variable then also gives you the functionality to execute something on the client side when that value changes, just as if you executed a multicast where you then get an event to execute something client side.

vagrant grail
#

I'm following a tutorial about how to make a replicated light switch, and was wondering if :

  1. It's safe to pass an argument from the server to the client (Like in the image)
  2. How do Interfaces behave on server ? Like does the server has its own version of the interface and the client does have its own version ?
#

"Circuit" input is just an int being a unique identifier which links a switch to a specific light if they have the same identifier

graceful flame
#

So instead of having Switch on Client event you can instead do the logic directly on the Switch on Server event so long that the variables being changed are replicated.

sinful tree
vagrant grail
sinful tree
graceful flame
#

You can press F9 on a node and run your game and step through the code to see the flow of logic. It tells you if its currently the server or client.

sinful tree
#

An interface acts like an event. Calling one can happen while running on the client or on the server, but it is not something that replicates itself.

vagrant grail
sinful tree
#

Oh sorry. Well, anything you send from the server to the client should hopefully be just fine ๐Ÿ˜›

graceful flame
#

When the server sets a replicated variable, that's the final value. Server is the authority.

sinful tree
#

Your screenshot shows the opposite.. Client -> Server.

graceful flame
#

If a client changes a replicated value the server will overwrite it with whatever it thinks the correct value should be.

vagrant grail
sinful tree
#

And yeah generally speaking, you probably wouldn't want to use RPCs to send data to clients. Replicated variables are usually best. OnRep if you need that variable change to do something on the client.

graceful flame
#

BUT if you let the client choose the value of a parameter and pass it to the server so it can apply that value you SHOULD PROBABLY also do some sort of validation on the server event depending on the significance of the value and if it affects gameplay or not.

hoary spear
#

should probably

#

๐Ÿ˜„

#

Worth some extra highlight

sinful tree
#

If I was really concerned about the client only being allowed to turn on a specific light swtich, I'd make them pass through a reference to the light switch they're interacting with, and on the server line trace from that switch to the player, making sure they're within range and then turning it on and off if they are.

graceful flame
#

Yeah because it might be some material emissive value or something that just makes stuff brighter than it normally should be or whatever.

hoary spear
#

Definetly

#

One should always consider the significance of the data recieved and validate accordingly

ripe basin
#

Sometimes it's not really the tutorial that's the issue, but the misunderstanding of the systems from the viewer and lack of concepts that need to be considered for your own project and environment. Not every tutorial is going to teach you all steps and angles, most will assume you have basic knowledge of the concepts being worked on.

Just like cooking - You can learn a new recipe from someone, but chances are they're not gonna teach you how to run your stove. So burning the meal doesn't mean the recipe is bad. ๐Ÿคฃ

short arrow
#

Physics not being replicated is proving to be a problem for me

#

How do you tell the server you want to loot a body when physics places both actors in two entirely different locations

chrome bay
#

Use a physics constraint to prevent it moving too far

#

And allow for a tolerance

short arrow
#

:O I didn't know that was a thing

#

Can I set that in the mesh component?

chrome bay
#

You can create constraints in the physics asset, or you can add a constraint component to your BP and set the constrained bones accordingly. E.g, limit the pelvis bone or whichever is the root simulated bone with a soft linear constraint

short arrow
#

Dude that's awesome thank you so much

#

Then I can just check if the player is looting the dead body within the constraints max distance

#

Ez

coral wing
#

When I search eos for a session without joining, I get a timeout error:

NetworkFailure: ConnectionTimeout, Error: 'UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.01, Real: 20.01, Good: 20.01, DriverTime: 20.02, Threshold: 20.00, [UNetConnection] RemoteAddr: 127.0.0.1:7777, Name: EOSIpNetConnection_2147482349, Driver: PendingNetDriver EOSNetDriver_2147482350, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID'

What could be causing this? The error makes my game restart to the intro screen

rough jolt
#

need help quite badly with something
I have a spaceship game, with a parent class for all spaceships, then children of that class. currently adding the 2nd spaceship to the game and the components of it (like wings, engines, and stuff) which are child actors, keep getting destroyed on startup, but only on clients, not on the server

I can't figure out what's going on and it's driving me crazy

zenith wyvern
#

Campaign stores an array of 'objectives', containing information about the state of each objective. On the client I can see the objectives, but the values inside objective data aren't replicating. Any advice please?

sinful tree
rough jolt
twin juniper
#

What is the best way to separate the FPS and and non local views of a character in a Multiplayer Shooter game?

sinful tree
# rough jolt they are marked to replicate, should they not be?

I'm not sure as I haven't really worked with child actors myself and I don't know what you may need replicated about them. The way the messages are reading, it sounds like it could be something where the clients have a separately spawned copy of the actor that is getting overridden by the server's copy.

rough jolt
#

but in that example i was using a dedicated server, so there shouldn't be a server copy? (as the server doesn't have a spaceship)

#

Unless i'm underestanding it all wrong

sinful tree
#

Server spawns the actors & replicates them.

keen pewter
#

I have a question, is there a way to tell if a character is the players character, or one of the 'multiplayer characters' I need a begin play event to trigger on your character when you join the game, but not on all the characters for the other people playing with you.

I was thinking a begin play > isthischaracterbptheplayerscharacter > if its your character bp it does the event > if its one of the character bp's representing a 'friend' on the server it won't

Is this possible?

gilded vapor
quartz iris
#

How can i get a variable within a player with a trace by channel

#

So it traces from the camera to 10 metres in front

dark edge
#

If the camera is on the pawn, just trace from Camera.Location to Camera.Location + 1000 x Camera.ForwardVector

quartz iris
#

Yeah

weak fog
#

got a strange multiplayer issue. i have a steerable charge ability, where it locks the players input forward, forcing you to move, but you can still turn with the mouse. however, i do limit the turn rate so you can't steer it too much. this works fine in the editor even with a lot of lag. but in a packaged build/standalone game, even though their turn rate is lowered, the player can still turn much more sharply than they can in the editor. i've verified that all the values (move input, yaw, etc.) are the same in both scenarios. any ideas of what else could be changing in a packaged build to cause this?

graceful flame
#

So in the standalone build are you connecting to a server and running the test while playing as a client?

#

If not, then you're playing as a listen server and not actually as a client so the code logic is most likely different than what you think should be happening.

weak fog
#

will try to get the basics for the code, it's spread across a few areas

dark edge
#

@weak fogSpecifically show how you're handling turn rate

#

I smell a framerate dependence

weak fog
#

that is my intuition too

#

well, there is more than you need here bc i have a few more things we have to account for but:

#

in the PlayerController on the input axis event, this scales the axis value and passes it to AddControllerYawInput or AddControllerPitchInput

#

but it prints the same in all cases. client/server in the editor, and client/server in the standalone/packaged game. i even went all the way down to the exact C++ function and printed it there and got the same thing too

#

basically all you care about most likely is that final false branch. GetSensitivityScalar is just reading your mouse sens setting

dark edge
weak fog
#

in PlayerController

#

LookX is the axis name

dark edge
# weak fog in PlayerController

Yeah that looks fine, so how are you changing MaxTurnRate when charging? Have you debugged that value to confirm it's correct?

Wait a second, found it. You don't want to clamp by MaxTurnRate, you want to clamp by MaxTurnRate x DeltaSeconds

#

None of this is really a rate besides MaxTurnRate

#

it's an amount per frame

#

Axis value means "turn X degrees this frame"

#

as does add controller yaw input

weak fog
#

oh snap. gonna try that

dark edge
#

so you're not "rate-ifying" it at all. Convert MaxTurnRate into a max amount per frame and it should work.

#

Rate = Amount/Time so Amount = Rate x Time

weak fog
#

totally right. i was misinterpreting it is a rate (and then printing it out and "confirming" it). but it says it right there. value

#

ty so much, this one was killing me. always good to get a second set of eyes

frank birch
#

is there an extended Has Authority node where I can tell a server from a listenserver? ๐Ÿค”
I don't want to spawn cosmetic particles on my server but if it is a listenserver then the particles must be there ๐Ÿค” ๐Ÿค” ๐Ÿค”

frank birch
#

โค๏ธ

#

owww, I can't put it into a custom blueprint macro ๐Ÿ˜ฆ

sinful tree
frank birch
#

yep, based on actor worked:

sinful tree
#

I wouldn't say your logic is entirely accurate. If a client spawns something locally, it can have authority over it.

frank birch
#

ow ๐Ÿ˜ฆ

sinful tree
#

If you change HasAuthority to IsServer, then it would be accurate.

frank birch
#

great! ๐Ÿ˜„

#

this is way more close to what I wanted ๐Ÿ˜…

latent heart
#

Why do you need is server and is dedicated server?

#

Surely just is dedicated server will do?

frank birch
#

it's been a long day and I am a dork ๐Ÿคฆโ€โ™€๏ธ

#

thanks ๐Ÿ˜…

iron crest
#

Hello I have a really quick question, with multiplayer, lets say I want to send my game to a friend and 1v1 him, can they just join off of my ip or not

quasi tide
#

Yeah. Your router has to allow outside connections though.

iron crest
#

ok

nimble parcelBOT
#

:triangular_flag_on_post: Xer0#2892 received strike 1. As a result, they were muted for 10 minutes.

dim trail
#

if i have client authority is it ok to use get player controller index function?

nimble parcelBOT
#

:triangular_flag_on_post: AmanSrivastava#0086 received strike 1. As a result, they were muted for 10 minutes.

finite goblet
#

Does NetMulticast makes the owning actor relevant forcefully?

fossil spoke
finite goblet
#

are you 100% sure ? can I read about it somewhere in the docs?

magic helm
finite goblet
#

not trying to sound smartass , but isn't it possible for server to make it relevant again just for the reliable RPC.

#

Not that I want it

#

just want to make suer

fossil spoke
#

The Server can do anything.

#

If you NEED an RPC to go through, you likely dont want an RPC.

#

You probably want a RepNotify

finite goblet
#

check this out

magic helm
# finite goblet not trying to sound smartass , but isn't it possible for server to make it relev...

You can set actors to be always relevant, also typically in that case you would use a replicated rep notify variable because the rep notify functions are called when the actor re-enter relevancy. Here's some documentation
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/ReplicationFlow/
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Actors/Relevancy/

A detailed description of low-level Actor replication.

Information about Actor relevancy and priority

finite goblet
fossil spoke
#

Statefull changes should always be a RepNotify

#

Otherwise they arent stateful

finite goblet
#

won't that consume more cycles checking the rep var on sever if it its rarely gonna change , compared to a multicast which will only be sent when things actually change?

fossil spoke
#

If you are concerned about that, then use Push Model.

magic helm
#

That's when you go into dormancy... Which is super undocumented... But it's pretty useful and they do document it in the code

fossil spoke
#

Which is fixed with Push Model.

civic hollow
#

When you need to domancy it's hard to do in blueprint.

magic helm
#

Ah yeah Facepalm wasn't thinking for a moment lol

civic hollow
#

Full of bugs so code that do things about dormancy shouldbe in C++ only.

finite goblet
fossil spoke
#

It could be ๐Ÿคท

#

But i doubt it

#

They most likely marked it off for house keeping.

#

Instead of actually because its not something they will fix.

#

Or its also likely just a misunderstanding on the person who reported it.

civic hollow
#

if actor no releveant it not call any RPC on unrelevant clients.

finite goblet
#

I'll try to test it the way that report mentions , lets see what happens

fossil spoke
#

Why are you concerned if the issue exists? It already sounds like you want a RepNotify anyway?

civic hollow
#

I rpc should use when really need such as send data from owning client to server.
most of case I use simple replicated variable and some of them use OnRep_Nofity

finite goblet
#

OCD maybe? is there a significant delay in OnRep compared to netmulticast?

swift crow
#

VR multiplayer in ur 5 tutorial suggestion please!!!๐Ÿ˜ซ

finite goblet
fossil spoke
#

But again, using Push Model avoids that

#

ForceNetUpdate() also exists

finite goblet
#

separate topic

I've seen that net frequency often doesn't translate to exact values.
If I set it to 0.5 it takes a few seconds to send the update sometimes instead of every half a second

fossil spoke
#

NetFrequency is also governed by the Actors Net Priority.

#

Lower priority Actors will replicate slower over higher priority ones in saturated circumstances

meager fable
#

is there a command or sth to disable timeouts?

#

it makes debugging pain

trim hare
#

So uhh this might sound weird, but is there a reliable-ish way to make an MMO without a central server? If not, how much would a good-enough central server cost?

sinful tree
trim hare
#

Basically "Would it be possible to make a multiplayer game (a bit of like WoT, War Thunder...) P2P?"

sinful tree
#

No.

#
  1. P2P is not something that UE supports by default, so you'd have to code an entirely different networking system to be able to properly support it, especially if you wanted it to be seamless/mostly seamless if a "hosting" player leaves.
  2. You cannot have databases exposed for public use, otherwise anyone could write whatever data wherever they wanted. If you had publicly accessible databases then you'd have cheaters and people who just want to make other player's lives hell by erasing their data. Without databases, then there's no "central" repository for data, which means no MMO, and then your player data only exists on the particular server you connect to.
trim hare
#

Ah... well my goal is mainly to not pay much for server infrastructure... would it perhaps be viable to store the player's data on a server and then have matches be P2P?

sinful tree
#

No - I just answered that. Publicly accessible databases == players will cheat and can erase other people's data.

trim hare
#

What do you mean by "Publicly accessible DBs"?

latent heart
#

Investigate how CoD did P2P MP

trim hare
#

I mean like have the database and stuff on a central server and then have matches be P2P

latent heart
#

That had a centralised "character" system as well as P2P servers.

sinful tree
#

If the matches are P2P that means a player is hosting the match.

#

That player would have to tell the databases what data to write.

#

Which means, that's a place where someone could inject erroneous data.

#

Eg. If you had an API that you call to save data, that means I could potentially just open web browser and make a request without even running your game.

trim hare
#

So that basically translates to "If you manage to solve secure comms with the server, sure"

latent heart
#

You can't.

#

Whatever system you implement, someone will hack it.

sinful tree
#

And how would you do that? You can't provide a password or a public key with the game, because that just means people will be able to figure it out and do it anyway. At that point you're getting into the realm of having a specialized hosting service that people would request a server from, in other words, dedicated server hosting.

trim hare
latent heart
#

Best you can do in this situation is provide some level of encryption so the majority of people can't do it.

#

And just keep an eye on people obviously cheating.

latent heart
#

Giving that system out to the public basically guarantees it.

sinful tree
#

I've played a game where server player data was able to be written to by players as it was a "session" based P2P FPS game where one player was the host. After several hundreds of hours of gameplay I had defeated someone who was severely lacking in skill and they sent in the chat "Say goodbye to your account". When I finished the match, I logged out. Came back in much later, and my character data was gone. Stopped playing the game after that.

trim hare
#

Yk, my mind works the way that when someone tells me something is impossible, I get more motivation to try it

oak jewel
#

hey tried run on server but wouldnt let me open doors, is MC the one i need? perhaps ROS then MC?

sinful tree
#

Though they may railroad them...

trim hare
#

I'll prob consult with my dad, since he's got some experience in handling user data

oak jewel
kindred gazelle
oak jewel
#

it opens on clientside only

#

@kindred gazelle

azure cape
#

hey, if I want to dynamically spawn a replicated component on my player character, should I just spawn it on the server side and make it replicated, or do I also have to manually spawn it on the client side?

#

if it's the former, if I despawn a component, then immediately spawn another one, will this be done in order on the client's side?

kindred gazelle
# oak jewel it opens on clientside only

Its only opening for the client?? lmao that's weird. Which one is opening the door then? Because I see you have a multicast and a server rpc earlier. Which one is actually working?

oak jewel
#

i can stream in vc

sinful tree
azure cape
#

okay, will adding/removing of said components be done in order on the client side?

kindred gazelle
oak jewel
#

ill try this

sinful tree
#

You can only run "Run on Server" events when the client is the owner of the actor. As this is a door, I don't suspect the client owns it.

frank birch
#

what would GetLocalRole() answer when run in a client but from their own pawn? ๐Ÿค”

sinful tree
#

If it's a pawn that is replicated from the server that they possess, it would be ROLE_AutonomousProxy.

kindred gazelle
azure cape
#

seems just spawning it on the server worked

sinful tree
#
  1. If you need to replicate state, then the variables should be set to "Replicated w/ Notify" you can then use the provided OnRep function to drive the Niagara visibility. No need to multicast. No need to constantly check the boolean on tick.
  2. You shouldn't need to use multiple RPCs to perform relatively repetitive tasks that are just different basic values. Example:
shadow aurora
#

Has anyone here implemented team-based "always relevant" behavior in replication graph? Have a few questions...

latent heart
#

A simple way to do it would be to keep team objects on PCs and then they're always only replicated to their owning client and thus somebody's own team.

#

Or do you mean less the team object, but more objects used by the team?

#

I think there's a NetRelevantFor or some such method

tiny valve
#

how do i change the server tick rate for testing purposes

devout edge
#

Anyone using AGR PRO Combat System for melee hit detection? How is it?

south stirrup
#

I have a problem with a multiplayer packaged game with a specific type of replication.

I have a function triggered by some actor in the client, but I want it to be called on the same actor on the server. My brain told me: Well if exists in both server and client (and it does), I can just call it from the player pawn which can call the server. So I call it from my client actor's pawn reference and use a self target.

(I think this is what might be the problem, since it is referencing a client instance on the server)

The thing is: it works on editor's PIE, in all run modes and both Listen Server and standalone net modes.

But after packaging, only those same functions don't work anymore. I did test it with some text elements and I think my theory of the empty reference is quite solid: the event flow is working but the reference, when called on server, is empty.

What do I do to amend that? I mean, how do I do this? What am I missing?

blazing spruce
#

Hi, can anyone tell me why this isn't working properly? the door opens when the server players does it and replicates to clients but when the client does it, the door plays the open/close animation but the server doesn't see it so its not actually open/closed

#

The BP is set to replicates and opening & closing doors are multicasts, then set with rep notifies for relevancy so im not sure why it isn't working properly when the client opens/closes the door

sleek kraken
blazing spruce
#

nvm i fixed it, i wasn't doing my interaction input event on the server

solar stirrup
#

What do you want to know

shadow aurora
# solar stirrup What do you want to know

I guess generally speaking, what is the "pattern" that you followed? My current train of thought was as follows:

  • Have a replication graph node for each team.
  • When the replication graph receives notice that a player has changed teams, it will check to see if a node already exists for that team, or if it needs to create a new one.
  • Once the appropriate node has been selected, the player will be added to that node's list of relevant actors for that specific team.
  • Then the node is added to the player/connection's list of nodes.

Does that sound about right? Or did you end up going a different route?

solar stirrup
#
  • Have a replication graph node for each team.
    Yep
  • When the replication graph receives notice that a player has changed teams, it will check to see if a node already exists for that team, or if it needs to create a new one.
    Nah, I created them in the init global graph nodes function. I kept them in a TMap<ETeamEnum, URepGraphTeamNode*>. Each node held their assigned team. Making them connection based could work though, but I wanted simplicity.
  • Once the appropriate node has been selected, the player will be added to that node's list of relevant actors for that specific team.
    I generally add all team based relevancy actors to the nodes. In the gather function, I just check if the connection's owner (the PC) is in that team, and if so, add all actors in the node to the replication list.
#

@shadow aurora

sterile oriole
#

When testing in editor using net mode listen server with 2 players the controlled pawn on the listen server has no owning connection, and just in general all the ownership of pawns seems off in editor. Is this known/normal that testing multiplayer in editor makes network ownership wonky?

blazing spruce
#

Hi, I have a class which is my Interaction Base class, inside it has a couple of overlaps and a couple of widgets, when the player walks into the sphere overlap it displays some circles which indicates to the player that this object can be interacted with, then inside the sphere overlap is a box overlap which hides the circles and shows the E key to indicate that the player can now interact with the object.. essentially the idea is that all of my interactable actors will inherit from this class so they all have this set up rather than having to do it for each interactable actor bp

#

However, my issue is that if any player (server or client) goes into the overlap, all other players can see the interaction indicator widgets, how can i make it so only the player who's inside the overlaps are the ones seeing the widgets?

rough jolt
#

How do I replicate a parameter in a sound cue? I have an audio cue component on a vehicle and the clients only hear the server's vehicle, but clients' vehicles aren't heard by other clients, I noticed because the RPM parameter in the sound cue that determines things like the volume is always read as zero from clients' vehicles

fossil forum
#

tryna setup a cosmetic component. finished everything besides the modular mesh functions all is replicated besides these 3 functions. i removed the replicated set skeletal mesh event i have setup because it was throwing errors on server. works fine client side until there is more than 1 player with or without replicated sk mesh event. was curious if anyone could point me in the right direction, trying to add sk mesh components to a component map, and using that map ref set skeletal mesh/set master pose/destroy component when new data is loaded. Also noticed client side the master pose component works as it should however from server pov or another clients pov it isnt being set. Heres a few screens of the functions im referring to. Any help would be greatly appreciated im kinda stumped on this one.

blazing spruce
#

Thanks, that's sorted it!

graceful flame
fossil forum
#

ill try thanks. at first i had set sk mesh replicated an was using the event for that within the functions

graceful flame
#

your boolean isn't replicated

#

It also only needs to be set to true on the server, without using a multicast

#

click the variable, then find where it says replication in the details panel and use Replicated as the value

south stirrup
#

you can replicate the variable as well, selecting it and selecting replicate

#

Then, when it's changed on the server, it will change in all clients for the same value

#

Select the "Notes 1" node there and try to find the replicate dropbopx

graceful flame
#

yea

south stirrup
#

Yes, if you choose repnotify, it will create a function that will be called on all instances everytime this value changes on the server.

#

Replicated will just update this value to all instances

graceful flame
#

They're slightly different. Replicated means this variable will be kept in sync, but RepNotify does the same PLUS comes with an event that runs whenever the value changes.

#

Say you have a dark room with a single light switch in it and a player spawns into that room. The player interacts with the light switch (linetrace, walks up to it, presses a button on their keyboard...whatever) which then triggers: Server Event --> set light_switch true (replicated). Next Player 2 spawns into the room and sees the light is on because the light_switch variable is true because its being replicated to player 2 automatically. Your light in the scene controls itself with light_switch true or false.

#

The Replication Condition stuff is useful when you've got some complex replicated situations going on and you want only some players to see the changes under certain conditions or scenarios.

#

what didn't work?

#

I think its because of your flipflop, the server comes through first and uses path A but ends early because it can't add widgets (only client can) then when it runs again (because its a multicast) the first client uses flipflop path b, which removes (nothing), then when client 2 runs the multicast it reaches the flipflop and has the correct path A which adds the UI.

barren surge
#

Has anyone seen any examples/resources on doing client side prediction of spawning actors? The only example I've come across are projectiles from the abandoned UT project from 2016. That appraoch seemed kina hacky/brittle.

graceful flame
#

@oak prawn Try using two events instead of flipflop. Event to add the widget and another to remove the widget.

keen pewter
#

Can anyone send me in the right direction?
My player character seems to be entirely server side...?
Any time I use a Switch Authority, it only executes the Authority side
For instance this is on my player character

#

Does anyone know of anything I could check or diagnose? I'm very new to network n such

graceful flame
graceful flame
keen pewter
#

Listen server if that's what you mean

barren surge
graceful flame
#

If you place the SK with animation into the level and toggle visibility, then server toggles it back off after loading the real character, would that work?

frank birch
#

hello, I want to spawn some effects only for the locally controlled pawn but the isLocallyControlled node says false on listenservers and standalones! ๐Ÿฅฒ
what node am I looking for?

barren surge
graceful flame
#

you shouldn't need a multicast, move the set bool into the server event

graceful flame
graceful flame
frank birch
graceful flame
#

You could use the owner see / no see settings.

frank birch
#

it's a material parameter set ๐Ÿ˜…

graceful flame
#

ahh okay that's also similar

frank birch
barren surge
fathom aspen
rough jolt
keen pewter
#

Ahhh, that makes sense. So the hosting player (server), this player is just the 'serverside' whereas every client joining the game as a seperate client and server version?
That will stuff harder for sure...

fathom aspen
#

Yes every other client has both sides

keen pewter
#

Hmm... so how is possible to do something clientside? Say you have a has authority switch, goes onto the remote and does it's thing, this wont work for the hoster, it will have to go down the authority route too, but this will mess things up for the clients... That's a tricky one :/

#

But thank you for clearing that up for me ๐Ÿ˜„

graceful flame
fathom aspen
#

Depending where you are

#

Pawn/Controller

barren surge
keen pewter
#

Oh that makes sense, instead of checking if it is remote or authoritive, you check if it's actually being controlled, which would only be true if it was clientside for clients, or serverside for the server. That makes alot of sense, thank you ๐Ÿ˜„

fathom aspen
#

It takes a bit of time to wrap your head around it, but once you get that stuff like HUD/widgets, input, etc. is done locally, you understand that is server-side for the listen server and client-side for every other client

sinful tree
keen pewter
#

I've read through the netcode bible, and this bit of information I was missing, that's a massive link, it really does make alot more sense now

fathom aspen
#

That's why saying widgets are client side, which keeps going over and and over again here, is misleading ๐Ÿ˜„

graceful flame
#

Spawn the mesh directly on the client, then destroy from a run on owning client event sent by the server after it spawns the real character.

rough jolt
#

I'll send footage of the issue in a second

sinful tree
#

My guess would be you're not setting the Thrust and Current max thrust while running on the server and only doing it locally?

rough jolt
#

they're both replicated, though

sinful tree
#

Marking as replicated doesn't mean that you send the value to the server.

#

Replicated variables usually go one way, from server -> client. If you set the value on a client, the server won't know about it.

rough jolt
#

Oh. I didn't know that. How would I go about fixing something like this, then?

sinful tree
#

You'd have to either let the client tell the server those values through a Run On Server event, or, you use a Run On Server event when the client is supposed to be increasing their speed and then let the server calculate and set the values.

rough jolt
#

I'm sorry- I don't think I underestand

#

replication was never my strength and it's my first time messing with sounds whatsoever

#

if i run this command on server instead of multicast the client doesn't have the parameter changed and any thrust changes on the client play through the server's ship

sinful tree
#

Player Input > Run On Server Event > Calculate what needs to be calculated on the server's side > Set replicated (w/ notify!) variables > OnRep Function Performs action

#

So if you're increasing thrust on the client, you're telling the server that you want to increase speed, the server then replicates what your new speed should be, then clients can set the parameter in the onrep.

rough jolt
#

But I'm not setting the variables here, i'm just drawing from them

sinful tree
#

Then let's keep looping back. If you set variables while running on the client, the server doesn't know about them. The only way the server can know values is if you tell the server what those values are. Ideally you don't let the client tell the server what values are (especailly for things like speed) as the server should already be calculating speed. Therefore, the server should already know about the speed variables whenever your client is asking to speed up. When you're changing the speed variables and they are set to be w/notify, the onrep can then be used to drive the parameter.

rough jolt
#

so all i gotta do is set this in w/notify and it'd work?

sinful tree
#

Well I don't know because I have no idea how you calculate speed or how you increase speed. The OnRep can be used to drive the parameter.

rough jolt
#

When you say "drive the parameter" what exactly do you mean?

sinful tree
#

To perform this:

rough jolt
#

Oh

sinful tree
#

Something along those lines anyway.

rough jolt
#

that actually got an interesting result. the sound plays on (and from) both the client and server, but only seems to replicate the parameter from server to client, not from client to server

#

is the closest to working it's been so far I think

#

I'm sorry if i'm just being very dumb but i'm still completely lost at what's going on. like i make exactly what you have there and i still get one of the two players' parameters not syncing right

graceful flame
rough jolt
#

the blueprint was posted there

#

OH! I think I fixed it

#

I passed the parameter through the events and also changed it from tick to repnotify change speed

#

and that fixed it

sinful tree
# rough jolt that actually got an interesting result. the sound plays on (and from) both the ...

Just to reiterate, replicated variables only replicate from server -> client. So unless you set it while running on the server, no one else will get the value if you set it on client.
Ideally you wouldn't have your client tell the server what your "speed" values are as the server should already know what your speed is - your client can tell the server it wants to speed up, and the server would set the replicated values appropriately for how much they should be sped up, and then the variables replicate to all other clients. It's probably harmless in this kind of set up if all you're doing is playing a sound, but if you're allowing the client to tell the server values it's a potential place where people could cheat or send invalid data, and it's also a bit of wasted bandwidth if the server would already know the value without the client directly having to tell the server just so it gets replicated to everyone else.

#

Glad you got it working ๐Ÿ™‚

rough jolt
#

Thank you for the help, even if i had a hard time underestanding it xD
And i'm sorry for being so incompetent

#

Probably i'm not doing it the best way but i struggle so much with replication that if it works, it's good enough, at least for now xD

deep shore
#

any advice on debugging something that sometimes works and sometimes doesnโ€™t? I am equipping an item to a socket and half the time it appears properly attached for other clients, and the other half it appears strangely rotated. It equips properly to the owning client 100 percent of the time.

graceful flame
dim trail
#

how do i return a value from a server tagged RPC?

#

for example, if i want something to be calculated on the server, i would create something like this?

//Calculate base damage
    UFUNCTION(BlueprintCallable, Server, Reliable, Category = "Combat")
        void SERVER_CalculateBaseDamageApplication(AEnemyCharacter* Enemy);
    float CalculateBaseDamageApplication(AEnemyCharacter* Enemy);

then in SERVER_CalculateBaseDamageApplication_Implementation I would call CalculateBaseDamageApplication?

thin stratus
#

With a ClientRPC if it's a one off thing or via an OnRep variable if it's state related

#

RPCs don't have return values

dim trail
#

well, this function is called when the PC auto attacks, so im assuming it'll be an RPC? the problem is rpcs cant return values, but im trying to calculate "damage" only on the server to prevent hacking

thin stratus
#

Calculating damage is not the problem of hacking

#

Allowing the client to set health base on damage they calculated however is

#

You can calculate it locally if you want

#

It the better approach is only to run the rpc to tell the server that you attack

#

And then let it run on the server

#

Don't tell the server what you attacked

#

At least not in a first naive Implementation

dim trail
#

why not tell the server what i attacked?

thin stratus
#

Cause then the client just tells the server that it attacked someone across the map

#

Never trust the client

#

Whatever determines the target should run on the server

#

The only things you usually replicated are the initial key presses that instigated the attack

#

As in, PressAttack -> Server_Attack -> FindTarget -> DealDamage

#

Only press attack is clientside

#

You can then think about what parts you wish to predict. E.g. animations sounds VFX etc

#

That stuff can run locally

#

Alongside the rpc

dim trail
#

my current workflow is that a character needs to be selected to attack in the first place and i send an rpc that a enemy was selected

#

then i do the rest, without FindTarget, because it was already found

frank birch
#

how can I temporarily remove player control over a pawn and force it to move in a certain direction? ๐Ÿค”
(for example a fear effect or an attraction effect ๐Ÿค” )

#

(diable input is giving me problems with network, that's why I ask here ๐Ÿ˜… )

thin stratus
#

Easiest would be with RootMotionSource

#

But the code is currently only really available through Gameplay Abilities

#

You can expose it yourself though with a normal async task if you know cpp

#

It's basically faked root motion that the CMC processes

#

Means all your animations will also work just fine

frank birch
#

I am already using GAS ๐Ÿค”

thin stratus
#

Good then use RootMotionSource :D

pure onyx
#

Which cloud service do you guys use for MMO game?

fathom aspen
#

Yes, read the compendium found in the pinned messages

versed thorn
#

I'm struggling with this mess
ListenServer and 1 Client start a Map,
Logs show that ListenServer creates Pawn and PController, at BeginPlay Pawn is not possessed, but PossessedBy called
Client creates PController and Pawn and at BeginPlay Pawn have PController and PossessedBy never called
I need to do some Pawn setup based on PController and only way I see is to have duplicate code, or am I doing it wrong?

high ibex
#

hi , anyone using aws gamelift ? i am receiving this error while i'm trying to login with email / password .. aws cognito setup

fathom aspen
#

That's why there is an event called Possessed. Use it

fathom aspen
#

I don't see any other

versed thorn
#

last line

fathom aspen
#

I still don't see any

versed thorn
#

I have to duplicate code for Pawn setup, is this the right way to do things?

fathom aspen
#

Probably not.

#

but that still doesn't tell me much

versed thorn
#

well there is no single point where I can do it

fathom aspen
#

You should start posting code so I get the context

#

Otherwise this is vodoo to me

versed thorn
#

it is not my code that the issue, the Client possesses the Pawn without calling PossessedBy

twin juniper
#

PossessedBy is only called on Server iirc

fathom aspen
#

It's called on the server. If you are looking client-side, then that's normal

versed thorn
#

so I have to "catch" Controller ether in BeginPlay or PossessedBy

twin juniper
#

You have OnRep_Pawn and AcknowledgePawn for client

fathom aspen
#

What are you trying to do?

twin juniper
#

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

versed thorn
twin juniper
#

Put your code in both functions if it needs to be executed on server and client

versed thorn
twin juniper
#

And ?

versed thorn
#

and I thought DRY is our every thing

fathom aspen
#

You did so many wrong things there, which shows you haven't read that compendium. That's why I will keep pointing you towards

fathom aspen
#

The compendium is still inevitable imo though

oak prawn
#

I watched the video but I don't understand exactly how to use it in boolean

#

Isn't there a video that uses replicated and repnotify for exactly boolean?

fathom aspen
#

That means you didn't understand correctly. You are using replication and multicasts in the same go. It's either this or that.
A golden rule about multiplayer says:

  • Use property replication for stateful events.
  • Use RPCs for transient events.
peak lintel
#

Hi guys. I'm still trying to figure out how rpcs works.
I have a Niagara which I want to show only on the client (It doesn't need for all the clients to see this) but currently only on the server is working (The server also see the client's ns) and on clients it doesn't show at all.

fathom aspen
#

Also that multicast RPC is called on the pawn that fired it. So it's called on the server, the autonomous proxy, the simulated proxies (in case they are relevant to the other connections). That means, you are still talking about the "same" pawn. You are wondering why it's not true for a pawn that isn't yours @oak prawn

#

That's why you don't check for such state on client but on server.

#

Don't rush things, enjoy the learning process. That's my tip

fathom aspen
peak lintel
#

Yes. It's a pawn so I had to replicate all the movements.

fathom aspen
#

Ok so what's that NS_FlyingLines?

#

That seems to be spawned elsewhere

peak lintel
#

It's a niagara component attached

#

Those are some speeding lines and with increasing the speed, I change the opacity, so it's only a cosmetic which I want to show only on the specific client

fathom aspen
#

Well if it's for a specific client (your owning client specifically) then consider using Client RPC instead

#

Is the niagara component attached at runtime? or compile time?

peak lintel
#

At compile

#

and I activate it once the speed is increasing

fathom aspen
#

Did you try to debug? What if the values inside the if check there are false for clients?

peak lintel
#

I've tried with Client,Reliable,WithValidation but still not working, only on server

fathom aspen
#

Well nothing work for me too. Unless I debug.

#

Nothing knows better than the debugger what's happening there

#

That is just one possibility

#

A lot of other things that I could easily miss but the debugger won't

#

That video you watched is correct. You just didn't understand it well

#

Also that's not my job.

peak lintel
#

S_StartFlyingBoost_Implementation is Server,Reliable,WithValidation

fathom aspen
#

Yeah iirc, you should activate it explicitly on the side where you want it used. You can't expect it to activate on client, if you're only activating it on server

peak lintel
#

Yes, if I change it to Client works, but not the boost doesn't work anymore on other clients/server. So I need to create a new function to activate the ns (which is for client only? )

fathom aspen
#

Because the boost is server authoritative

#

Yes the activate needs to happen client side

#

Try putting it in the multicast itself but only if you're client side

#

i.e if(!HasAuthority())

peak lintel
#

Thank you!
I'll try it now.

fathom aspen
#

What are you trying to achieve?

#

Inside the OnRep add the widget. Though it will be added to all relevant connections

#

Change the multicast to a server event

#

Correct. That's what I said

#

In the branch, check for IsLocallyControlled

#

And use the false pin

#

Well you already have it