#multiplayer

1 messages · Page 108 of 1

whole pine
#

ya

#

just one

hoary spear
#

And remove the sequence

thin stratus
#

The Random node is PURE, which means it fires for each connection to a node with an exec pin

#

You have 4 branches, all having an exec pin

#

So this generates 4 random numbers

twilit radish
#

The pinned message with the video is only referring to specifically that video and is from you as well. Should be fine to unpin and just pin again I guess? #multiplayer message

thin stratus
#

You need to save that to a (local) variable first

#

And the ncompare that

#

That way it only generates ONE random number

whole pine
#

in range?

thin stratus
#

The first branch will cause a random number

#

The second branch will cause a new one

#

etc.

#

Save it to a variable and then use the variable

whole pine
#

oh sht ur right

#

lmao

thin stratus
#

(also replace the 4 branches with one(!) SwitchOnInt so Squize doesn't suffer)

thin stratus
#

.>

hoary spear
#

I think its ment to be a roll between 4 weather effects, triggered at specific hour(s)

whole pine
thin stratus
#

Almost

#

CLick the SwitchOnInt

#

And change it to start at 1

#

Or change your random node to go from 0 to 3

whole pine
#

oh cool

#

never used one before

thin stratus
#

(we start counting at 0 usually, so that would be better)

#

Any more reorder requests result in a strike.

whole pine
#

wat

thin stratus
#

Not you

whole pine
#

oh

#

so as long as the server stays open the proper weather will be replicated?

thin stratus
#

As long as my house stands, the lights will be on?

#

Like, i don't know

whole pine
thin stratus
#

Did you code it to replicate your weather?

whole pine
#

this is in gamestate

#

forgot to mention that

thin stratus
#

And where in the gamestate?

#

It being there doesn't mean anything by default

whole pine
#

event begin play has sets a timer

#

and checks hour every so often

thin stratus
#

What hour, local time?

#

Like actual real life time?

whole pine
#

playfab's datetime

thin stratus
#

Well, if playfab returns the same time for every player, then sure

#

This is not really replication though, but that's fine

whole pine
#

yea because i need to transfer this data to the pawn now

#

right?

#

or am i forgetting something

whole pine
thin stratus
#

I mean, not sure what your pawn has to do with it

#

The GameState exists once on every player, is owned by the server and allows Server to Client replication

#

If you start that stuff on BeginPlay, then it runs on everyone

#

Cause BeginPlay calls on every instance

#

So it's passively "replicated" by the fact that the Actor is replicated and calls BeginPlay on everyone

#

What that has to do with your pawn probably only you and one of the many gods know

whole pine
#

even tho its in game state only client 1 sees the weather

thin stratus
#

Ah, yeah, I mean

#

The random in range

#

:P calls for each client individually

#

Some might get 1, others 3

twilit radish
thin stratus
#

Guess you gotta replicate the end results manually

#

And limit the BeginPlay call to Authority with SwitchHasAuthority

#

But I still have no clue how the whole system works. In theory this is very simple.
Whatever you do at the end of your SwitchOnInt has to be replicated

#

And the code itself has to be limited to Server/Authority

whole pine
#

ok

shrewd ginkgo
#

I made a chat box. how can I skip to next line if I write till end of line

#

I dont know english much I hope you can understand what I mean

thin stratus
#

You should never Construct Widget Objects like that.

#

Your Chat Message should be a UserWidget that contains a TextBlock, which you can then create with "CreateWidget"

shrewd ginkgo
#

the guys I watched doing it like that

thin stratus
#

uff

shrewd ginkgo
#

Im new at it

thin stratus
#

Nick Darnell (who made UMG) strongly adviced against this

dark edge
thin stratus
#

Please make a new UserWidget and just call it "ChatMessage" or so.
Then spawn that with "CreateWidget" instead

#

And add the TextBlock into that via the Designer

#

If you then select the TextBlock you will find the AutoWrap feature

thin stratus
#

Cause there is more going on internally when UWidgets (not UUserWidgets) are created.

#

Tons of which you are bypassing and skipping

#

They are meant to be added via the Designer into a UserWidget

thin stratus
# whole pine or

That one, no need to call the event every time just to fail at the auth check :P

shrewd ginkgo
whole pine
#

can gamestate cast to pawn? cause its accessing none

thin stratus
thin stratus
whole pine
#

its for getting a var thats set with the proper camera actor for the niagara

thin stratus
#

So you get a reference to the Pawn and cast it?

whole pine
#

yea

thin stratus
#

And when do you do that?

whole pine
#

after the switch on int

thin stratus
#

Did you keep in mind, that the Pawn might not yet exist?

whole pine
#

yes, it does exist though

shrewd ginkgo
#

I cant find it

thin stratus
whole pine
#

i put a delay on it sitll returns null

#

still

thin stratus
thin stratus
whole pine
shrewd ginkgo
#

I want to skip next line only message or the box doesnt matter

thin stratus
# whole pine

Does the GetPlayerPawn0 node return something valid? Please actively confirm with a PrintString

#

Also GetPlayerPawn0 only returns the Server's Pawn here. Or first player I guess if DedicatedServer. But if that runs on BeginPlay of GameState on a DediServer ,then there is def no pawn

whole pine
#

yes

thin stratus
#

What does it print

whole pine
#

BP_topdowncharacter_C_0

thin stratus
#

Then it shouldn't fail the cast and work fine

#

Something else might be wrong then

#

Is the node you pull from the Cast null?

whole pine
#

chatgpt says you cant cast from gamestate to pawn

#

idk if that means anything

thin stratus
#

ChatGPT sucks hard

whole pine
#

im aware

thin stratus
#

Stop using that for stuff like this

whole pine
#

well u dont know why its fialing

thin stratus
#

Casting from GameState to Pawn isn't even a proper sentence

#

You are casting a Pawn from APawn to BP_ThirdPersonCharacter

#

GameState is absolutely irrelevant in that specific 2 node setup

#

The only thing that can cause issues is the timing

#

Or top dow ncharacter

#

w/e

whole pine
#

players have a specific camera actor that they are looking thru

#

dpeending on which room

thin stratus
#

Yeah, is that CameraActor variable valid ?

whole pine
#

so i need a way to broadcast this weather to them correctly

thin stratus
#

The Pawn is valid as you said yourself

whole pine
#

its printing i guess so ya

thin stratus
#

The CameraActor variable isn't marked as replicated

#

How does the Server know about the value?

#

Please put a print string for the CAST Result and one for the CameraActor

whole pine
#

the camera actor shud be good cuz im loading it from my save game on begin play

thin stratus
#

And see what those two do

thin stratus
# whole pine

And what if GameState BeginPlay calls before Pawn BeginPlay?

#

:P Aren't you having a problem then?

whole pine
thin stratus
#

Only TextBlock and maybe the MULTILINE version of EditableTextBox

shrewd ginkgo
#

ty

thin stratus
whole pine
#

doing it now

#

ya camera actor var is empty

#

idk why cuz i set it on save game

shrewd ginkgo
#

can I set character limit for editible text

thin stratus
# shrewd ginkgo can I set character limit for editible text

Think only by hand by using the event that calls when you enter text, checking the length of the text and if it's greater than what you allow, you just set it back to the text with 1 letter cut of (or the last confirmed text, but you'd need to save that to your own variable)

whole pine
shrewd ginkgo
#

how can I check lengt of text

thin stratus
#

Text doesn't have those fancy methods. You can put it back to Text afterwards

#

Also this is #umg stuff by now

#

You aren't asking any multiplayer questions

shrewd ginkgo
#

ok sorry

thin stratus
whole pine
#

and the camera actor var on the left is specifically set to the correct actor

thin stratus
#

And you are saving and loading both on the server I assume?

whole pine
#

just local save game

thin stratus
#

Then how would the Server have access to that info

#

Cause you are asking for the CameraActor variable on the Server in the GameState

#

That is never set

whole pine
#

but the triggerbox camera actor var still isnt being set

#

for no reason at all

#

i can manually call save func by pressing a key and i still doesnt set it

thin stratus
#

But still if you load only locally then the variable will be invalid on the server

whole pine
#

i mean in another scenario

#

where i need my save game to load the camera actor to remember which room mi in

thin stratus
#

Also you need to do the camera stuff on the clients. After you set your replicated stuff from the weather selection

#

The server doesn't call that for each client otherwise

whole pine
#

ya ur right..

thin stratus
#

I sometimes am

#

My wife doesn't believe me

whole pine
#

can i cast to game state from pawn?

#

so i can get that int var?

thin stratus
#

You can set that int variable to RepNotify

#

That gives you a rep notify function auto generated

#

That will call for everyone with the new value

#

In there you can get playerpawn 0

#

That would be the individual local pawn

#

And if your timing is fine, which I think it might, you should have access to the valid camera there

#

It's midnight here by now, so I gotta get some sleep

whole pine
#

what do u recommened i do inside the rep notify?

thin stratus
whole pine
#

so i still have the issue of camera actor then

thin stratus
#

The idea is that all info is figured out on the server and then set on a variable or struct that is marked as RepNotify

#

And then in the RepNotify function you can use the info to do the local stuff

whole pine
#

like set niagara?

thin stratus
#

Yop

thin stratus
#

If it's loaded but still invalid you can check if a delay helps to see if it's still a race condition

#

If so, you'd need to make that a bit more complex with an EventDispatcher that you call after loading. The GameState could then check in the OnRep if the actor is valid and if not bind to the EventDispatcher for a callback

#

That's a pretty standard setup in Multiplayer fyi

#

But yeah gotta head to bed now. Good luck 🤞

whole pine
#

i just realized this will be better if i just attach the weahte rto my pawn

#

thanks for the help

rough jolt
#

I am making a multiplayer game about starships, looking to start over my whole gun system

This system should have support for guns and tracking missiles both

The biggest issue that's holding me back and I can't figure out how to fix is that, since the ships move really fast, in the time it takes the client to send the fire location to the server, it is already a considerable delay, which causes shots to be super inaccurate for all clients

Any c++-free ideas / marketplace plugins that could help me deal with this issue?

strong vapor
#

[Question] My company has a game on Quest, uses listen servers.. you can paint your character in single player.. and then you're supposed to be able to bring that painted bot into a multiplayer game... how do I get a texture that's from a savegame (the custom painted texture) to another player's machine.. is there a good plugin for this kind of thing?

#

to be clear.. the texture asset will not exist on the other player's machine just from what's in the game package

#

is there a way to propogate savegame data to another player's machine?

cosmic epoch
magic furnace
#

or you replicate the texture, depending on your setup

thin stratus
#

You can't if it's not on the other person's game

#

ChunkDownloader is something else

#

They probably need to turn the texture data into bytes and send those and then recreate the texture on the other client

magic furnace
#

Depends how the texture is created, whether u can just replicate it using vector parameters

#

cuz then all u need is the parameters replicated

#

but you're right, when I hear "paint" that will probably prove impossible

ivory bear
#

In a blueprint, multiplayer, how soon after begin play can you call the first Server based node and how? I tried calling my server equip weapon during begin play and it is in the characters hands, but the data for it is empty. When I pick you the same weapon in game with the same call it works fine.

latent heart
#

The order of beginplay is effectively random for a client.

#

So you probably need to wait for all the relevant actors to have begun play.

#

There is no "time" or "order" for this, you just need to check each time something begins play whether everything is ready.

misty birch
#

So if I want to start doing something server-side throughout the whole game session where and how can I do that? Like say every 2 second I want to teleport every player in the session. Would I be in the gamemode blueprint I assume? And then how do I get that code even started?

limber gyro
#

ur gonna need a multicast function

#

that sets peoples location

misty birch
#

well im not actually teleporting people it was just for the idea

#

im doing weather systems

#

this is what i have for my loop

#

And im planning to request weather update on event begin play

limber gyro
#

the way i would doit would be with a replicated actor that is already in the map

#

that actor would be owned by the server

misty birch
#

How do i set that

limber gyro
#

and it would change the weather

#

u just make an actor with weather logic in it lol

#

and then place it on the level

misty birch
#

Are all actors owned by the server?

limber gyro
#

no, characters are owned by their respective players i think

#

they are only owned by the server if they have no connection to a player controller, but im not sure of this

#

the whole weather effect thing can be owned by the server

#

since the weather actor is replicated you should also have acess to it locally

misty birch
#

I just crashed UE5 lmao

limber gyro
#

you can just do some thing like "get all actors of class(weather actor)" then get the first one and get the info from there

#

just dont forget to properly replicate your variables

misty birch
#

I have this rn in an actor in the world but its not printing anything

sinful tree
# ivory bear In a blueprint, multiplayer, how soon after begin play can you call the first Se...

If you're calling an RPC on begin play, you're probably doing something wrong.
Begin Play on replicated actors can fire on clients and server. So if you're trying to have the client tell the server to equip something on begin play, the server should just be able to equip it anyway without the client having to tell the server to do so, assuming the server knows about all the data/what it is they're equipping and hopefully they do otherwise you've got a means for a player to cheat.

If you're trying to call an RPC to a client on Begin Play, again, you shouldn't need to - the clients run their own copy of begin play, so it should be able to do it on its own without the server though you may only want the player who controls the actor to run it, in which case you can also put a branch in to check if it's locally controlled to ensure other clients don't run it when the begin play fires on their end. It's a little different if you're trying to send them some data to the client through the RPC, but that then sounds like it's something that is either stateful to the player which could be set as a replicated variable w/ notify, possibly even with the condition of Initial Only if it only needs to happen once, or perhaps the value belongs on a different actor.

clear island
#

I have this issue sometimes when using the PIE, happens on a world partition map, what fixes it for me is unloading the map cells and loading them again

sinful tree
# misty birch

You're sure this actor is placed in the world? You should always see "Server: Hello", and because you're doing it on begin play, if that is a replicated actor you would see "Client#: Hello" any time that actor becomes relevant to a client.

misty birch
#

i got so mad i couldn't get any event begin plays to print anything on any actor or gamemode that i just gave up and closed UE5

#

I googled and everything, made sure my GameState and stuff was all correct and good but nah

#

ue5 scamming me

sinful tree
#

Since closing it, have you reopened and tried again?

misty birch
#

naw im playing rocket league 😂

sinful tree
#

It'll probably work now... Strange engine issues like that can happen from time to time and get fixed by restarting.

hoary spear
#

When a var type doesnt support replication, does that exclude them from being sent over regular rpc aswell?

sinful tree
#

So like... A UObject by default doesn't support replication. Sending a UObject from the server through an RPC wouldn't make it so the UObject then exists on the client as it's only sending a reference to the object, which unfortunately doesn't exist on the client. Same with Maps and I think Sets too?

hoary spear
#

Ill have to try

#

Specifically tmaps^^

sinful tree
twin sable
#

We're having trouble getting online beacons working with public IP's. Beacons are working fine with 127.0.01 in our tests but when we change to a public IP we can't connect. Tbh I'm a but confused how beacons work at all as I thought you needed open ports to send information between machines so I'm not sure how beacons work without nat punchthrough. Does anyone know?

chrome bay
#

You do. Usually you create a separate "party" session with beacons and advertise that session via the OSS you're using, which is what handles the connection and punchthrough etc.

#

Essentially you're still connecting to an online session, the beacons exist so you don't need to travel into an actual map to have game-level networking like RPCs/properties etc.

twin sable
#

we thought we needed to use the party to pass the IP to the clients and then connect to the beacon using the IP

#

so do we have to instead directly connect with a session?

#

we're trying to have text chat in the lobby, before the session. and most people suggest beacons should be used for lobby text chat. but yeah if it still needs a session then maybe its just not possible and we should immidiately connect party members to a session on the main menu and not use the party system?

chrome bay
#

I mean session in UE-terminology. A Steam lobby is still a "session", listen servers use lobbies for instance.

#

But you can have more than one session at once. The "party" session in UE would still be an advertised steam lobby session that players connect to, and the beacons provide the lightweight game-level communication that otherwise avoids a full map travel.

#

The only real purpose of beacons is to avoid travelling to a map (while still having game-level communication), which is usually by far the most time consuming/intensive part of joining a session.

twin sable
#

Looking at some beacon tests. beacons have NetMode=ForceP2P and NetMode=ForceIP. Should I be using p2p if players host games themselves (no dedicated servers).

chrome bay
#

RE the NetMode I'm not sure

cedar forge
#

Hello everyone, I moved my formerly running server to another location, but when I do the operations again, the client cannot enter the server. What could be the problem I am using the "Open Level" command.

cedar forge
#

ports are not working even though they are open.

untold rose
#

Does anyone have any idea what would cause an event to fire on all clients even though its not replicated. o.O

cedar forge
untold rose
# cedar forge where do you call this function

Its an event dispatcher on an actor component. It gets called from the player character. I have another BP that does the same thing and only fires on the client (as it should) but in another BP, it fires on all clients.

cedar forge
#

Did you try "Run on owning client"?

#

I know that if it is called from an actor called on the server and the actor is replicated, the function is replicated.

untold rose
cedar forge
untold rose
upbeat basin
upbeat basin
untold rose
upbeat basin
untold rose
upbeat basin
#

If you don't filter with HasAuthority or IsLocallyControlled like functions the trace will work on every machine

untold rose
warped sentinel
#

hello I need some help
I am on a listen server when player 1 is the listen server and player 2 is the client
when player 2 wanna activate an ability it first triggers rpc to its player controller on the server and that player controller activate the ability but for some reason the ability is activated on player 2 server and client and for some reason on player 1 client as well what should i do in order to solve this issue ( the picture above is the rpc in the player controller )

upbeat basin
warped sentinel
fluid flower
#

Hey all, when the engine compares whether a replicated property is changed, can I help it along? Is there some function I can override to help it figure out when something is dirty and needs to be replicated? I'm looking to reduce 'DynamicPropertyCompareTime'

thin stratus
#

Then you need to mark the property dirty on set

fluid flower
#

or should it not do any manual comparison as soon as I use th epush model, regardless of RepNotifyCondition?

thin stratus
#

Relatively sure that RepNotify is evaluated locally

fluid flower
#

I see, cheers, I will do some tests, my large 'DynamicPropertyCompareTime' might have been in an older build, I will verify, cheers

pulsar moss
#

Hi, I just joined and I need some pointers in the right direction:
What would typical "pieces" be of a setup for a Multiplayer game with "lobbies", where a player can start a new lobby/game instance, select a map, and others can join.
In my head that would take dynamically spinning up dedicated servers and managing those.
Are there typical/recommended ways/plugins/SDKs to do this?

#

Think server browser, create new game, join game, etc.

quartz iris
#

@sinful tree this is the code which detects if a player hit another player- used for the health/death system. What can I change to fix the issue with the round scoring, if this is what the problem is. The heavy attack is used as an example as they're all similar

#

This is the line trace for the saber blueprint actor

#

Maybe the problem is the multicast usage?

formal solar
#

should i call add movement input inside a 'run on client' event?

#

or add input vector

quartz iris
#

Could be wrong though

formal solar
#

I dont understand replication very well.
My understanding is that if I dont call it on client it gets simultaneously called on server and client both.

#

but cmc does some prediction stuff that overrides normal behaviour.

worthy wasp
#

Hey guys quick question... i'm trying to do a respawn logic in my GameMode ... and i'm getting a NULLPTR on my Character->Playerstate. This ONLY HAPPENS in remote clients .... HOST works fine.

Character->GetPlayerstate() later in the cycle of respawning..... Is there something I have to do OTHER than the following after spawning the character? Isnt*** PlayerController->Possess(SpawnedChar)*** enough?

    AVI_Character* SpawnedChar = GetWorld()->SpawnActor<AVI_Character>(ClassToSpawn, InPlayerStart->GetActorLocation(), InPlayerStart->GetActorRotation(), SpawnInfo);
    if(IsValid(SpawnedChar))
    {
        InPlayerController->Possess(SpawnedChar);
        InPlayerController->HandleRespawn();
    }```
formal solar
#

yes i know its replicated
im worried about server client clashing
because im getting stutter

worthy wasp
#

I've debugged stepped through the Possess() function and it looks to set the playerstate just fine... but I fail at this in my newly spawned character....

Cast<AVI_PlayerState>(GetPlayerState());

misty birch
#

How can i get the coordinates of the editor camera?

#

like if i fly around in the editor how can i get my coordinates

harsh totem
#

Hey I'm a beginner in Unreal Engine so still figuring out how everything works. How do I make it so that I can change the level once there is 1 player remaining? The total players can be between 2 and 4 players.

upbeat basin
worthy wasp
upbeat basin
#

Be careful though, during PostLogin PlayerArray will have the updated number of players (latest joined player is included) but on Logout, player that is quitting would still be on the PlayerArray, thus would return 2 if you're left with 1 player

harsh totem
upbeat basin
#

If by remaining players you mean alive (like all players are still connected but 3 of them are dead) then yes your's would be the solution, I was thinking about connected player number

#

And if so, I believe you have your solution already, you just need to check the number of players after every time you update (or just when you subtract) the number, I'm not exactly sure what the question is at this point

harsh totem
#

I'm not sure how to change the level (main menu) when there is 1 person remaining. So far when a player touches lava it destroys the player character but doesn't change the level when 1 person remains

sinful tree
# quartz iris <@218956378654507008> this is the code which detects if a player hit another pla...

The problem is probably right here. You can't reliably use "Get Player Character 0" in multiplayer and have it reference a specific player.

As for the rest of your code, you have FAR too many "Run On Server" events. Marking an event as "Run On Server" is allowing a client to call that event at any time and if the server receives that RPC, it'll try and execute it when it is received. Even if you didn't intend in your code for a client to call it, you're opening the door to allow them to, meaning that someone with a bit of know-how could end up cheating.

#

Once you've started a Run On Server event, any functions or events you call afterwards will be executing on the server, so there's no need to mark more and more events in the path as Run On Server unless you intend for a client to run them directly.

upbeat basin
# harsh totem I'm not sure how to change the level (main menu) when there is 1 person remainin...

Simplest way is OpenLevel
https://docs.unrealengine.com/4.26/en-US/BlueprintAPI/Game/OpenLevel/
https://docs.unrealengine.com/4.27/en-US/API/Runtime/Engine/Kismet/UGameplayStatics/OpenLevel/

But if you want something more advanced (like keeping everyone connected instead of just individually sending them to another level to disconnect them from server) you can check here as well
https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Travelling/

sinful tree
# quartz iris

One such example here... You're allowing a client to call that timer at any time, and you're also allowing a client to call the Sabre Line Trace any time, both skipping a lot of the earlier logic checks.

As a side note, the timer also shouldn't be set for 0.001 - timers can only run at the frame rate and are concatenated into a single frame if the timer is faster than the frame rate. For reference, at 60FPS each frame is 0.016 seconds.

upbeat basin
sinful tree
#

The trouble is with timers is that the frame rate can fluctuate and you may not always be at 60 FPS, so if you have your timer set to 0.016 and you're running at 38 FPS, then in some frames you'll get two calls of the timer. If your FPS jumps to 120, then you'll end up getting your timer calling every other frame.

#

They're great for doing something after a certain amount of time, but if you want something done every frame, then tick is still the way to go.

upbeat basin
#

Got it, thanks

quartz iris
#

as the player state is server replicated

sinful tree
# quartz iris So instead of get player I should use the player state right?

No.. You can't use any of those "Get.... Index X" variables in multiplayer. You don't know which index is what player so you can't properly reference which player. I don't know what value you want to plug in there - it probably just needs to be self if the Apply Damage node is being called from the character dealing damage.

quartz iris
#

Alright got it!

#

The round system works properly now

#

Course it makes sense, it wasn't referencing the player just the local one

nocturne quail
#

why the clients don't want to look at their faces?
everythime when I come near to the second client, the head of my posessed character rotates by itself

dark edge
#

You're going to have to show some code, we can't just guess what your code looks like.

dark edge
#

I mean show us something, we have no clue what your code is doing.

#

Presumably your characters have a variable representing where they are looking

#

If that's the case, show how that's updated

nocturne quail
nocturne quail
#

if I disconnected the Yaw, the head stops rotating at all

#
    Direction = CalculateDirection(TryGetPawnOwnerRef->GetVelocity(), TryGetPawnOwnerRef->GetActorRotation());
    
    FRotator BreakDeltaRotator = TryGetPawnOwnerRef->GetControlRotation() - TryGetPawnOwnerRef->GetActorRotation();
    BreakDeltaRotator.Normalize();
    Pitch = BreakDeltaRotator.Pitch;
    Yaw = BreakDeltaRotator.Yaw;
quartz iris
#

@sinful tree How can I show the player's cosmetics (saber beam, hilt type etc) to the other player? It currently only works with the local player only.

#

This is the code for updating the hilt type with the corosponding set variables

dark edge
quartz iris
dark edge
#

onrep_SaberHiltStyle -> do the logic

quartz iris
#

Ok

#

So what I just copy this into the onrep?

dark edge
#

yeah assuming your logic is otherwise sound

quartz iris
dark edge
#

anything driven by state should be on an onrep

quartz iris
#

Some variables are sound for the beam sound effect

dark edge
#

I would use select on that enum but you do you

quartz iris
#

Should I make a function for the saber hilt update so that I can use it twice

dark edge
# quartz iris

Why are you replicating an enum and not just the sound asset directly?

quartz iris
#

I needed to save the variables with savegame

dark edge
#

I'm asking why you have a replicated enum for the sound instead of just a replicated sound asset reference?

sinful tree
#

(And they're not being replicated because it's stored in the Game Instance which isn't a replicated actor)

dark edge
#

oh lol

quasi tide
#

It's not even an actor!

sinful tree
#

true dat

quartz iris
#

What do I do 😭

dark edge
#

Is this a part of the state of the player?

quartz iris
dark edge
#

does every player character have a saber?

quartz iris
#

Yes

#

Though in the future I willl have other game classes

dark edge
#

for gameplay the saber options should be replicated data inside the saber actor

#

for saving the game, who knows. Depends on how your stuff is set up

quartz iris
#

Like the saber beam just doesn't have a colour for the enemy, which tells me that the other player isn't having their saber updated

sinful tree
#

Which probably ties into you using the Game Instance as it is not replicated.

quartz iris
#

So because the player doesn't know the enemies save data it doesnt show it

sinful tree
#

Right

#

It's just retrieving the local game instance.

quartz iris
#

Hm

#

How can I fix this?

sinful tree
#

You have to tell the server the player's data, the server sets that data in a replicated actor that when replicated sets the value you want.

quartz iris
#

Right

#

I see

sinful tree
#

You have to send an RPC with the data.

quartz iris
#

Run on server?

sinful tree
#

Yep

#

This is assuming you're allowing players to select these colors and stuff locally first of course.

quartz iris
#

I think I tried to do something like this before but it looks badly made

sinful tree
#

You're running on server, then telling everyone to run something. When others are running it, they're reading their game instance.

quartz iris
#

Where do I put the new variables for the hilt, hum etc

#

Gamestatebase?

sinful tree
#

Well those sound like properties of the sabre more than anything.

quartz iris
sinful tree
#

Most often you should be adding properties of a thing in the thing itself, however, there's a lot of thought that has to go into where you place certain variables based on what kind of replication conditions you need and whether or not it matters if it exists until the player leaves the game, or if the value needs to be visible to other player at all times.

Example:
Player Name - It could easily be stored in the Player Controller, Player Character or Player State.
Player Controller isn't great as it is only replicated to the owning client, so no other players could see it.
Player Character can work, at least for displaying the character name when the characters are within relevancy range, but outside of that, it would fail for something like a Score Board where you may want to know all the player's names.
Player State then becomes the best place to store the name, as it's always relevant by default and replicated to all other players, and handily enough, there already exists a variable in the PlayerState to handle a player's name.

For your sabre variables, it could make sense to store it on the sabre, but it could make sense to put them on the Player State just so you don't have to replicate it every time you respawn the character if it doesn't get changed at all. For simplicities sake, you may just want to store it on the sabre itself and be done with it.

#

So then when you're ready to send the sabre data to the server, you'd run your Run On Server RPC on a client owned actor with inputs for the data you want to pass. The server gets a reference to the sabre that you're concerned with, sets a replicated variable in the sabre with that data. When your clients are then playing back whatever, all they have to do is read the variable on the sabre to know what hum or color it is that should be displayed.

obsidian kelp
#

How to do custom replication based on a variable in the controller being replicated to?
DOREPLIFETIME_ACTIVE_OVERRIDE doesn't work on a per connection basis

pallid rampart
#

can clients predict replicated variables? if i set a replicated var locally will it be overridden the next time the "true state" comes in from the server or are clients not allowed to edit these values?

sinful tree
pallid rampart
#

awesome thank you 🙂

quartz iris
#

In my brain this works, because it's doing it both for the local player and the server afterwards

sinful tree
# quartz iris In my brain this works, because it's doing it both for the local player and the ...

You need to rewire your brain (not being mean, just joking around) 🙂
When you mark any events as "Run On Owning Client" it is executing only on the client that owns that actor. So if you call a Run On Owning Client event on a Character, it'll only execute for that particular client.
When you mark any events as "Run On Server" it can only be called by the client owning that actor, no one else, as if it isn't owned by that client, it doesn't execute on the server. Once running on the server, it is only executing on the server, no where else.

So if you are calling a "Run On Client" one would assume the server is telling the client to execute that event and only that client will be executing from there. Chaining it to a "Run On Server" event means that the client is then telling the server to do something so long as the client that is actually calling it owns that actor, and then only the server is running it. I see you still probably have "Get Game Instance" in there, which still would mean the server is then getting its Game Instance, not the client's where the value you're looking for may be stored.

You'd have to be getting the Game Instance while running on the client, retrieving the value, and then passing the value in the Run On Server RPC by adding an Input to the event. At that point, the server should then have the data passed in by the client, and then it can set that value in a replicated value which will then be propegated to everyone else.

dark edge
rain condor
#

Is any way to replicate character movement with bp? Because i'm trying to sprint and it's stutter

sinful tree
# rain condor Is any way to replicate character movement with bp? Because i'm trying to sprint...

Not well. When you're using the Character Movement Component that is included with the Character class, the server is playing back a saved move list from the player, and it tries to play back those moves based on the values the server has.

If you update the max speed on the client first, and then send an RPC to the server to increase the speed, this can work ok but only at very low latencies. Introduce some latency and this quickly breaks as the client is then attempting to move faster than the server thinks they should be moving, and the server resets their position a small amount until they are both moving at the same speed and are at the expected location until you stop sprinting in which case you'll probably get the jitter again.

If you update the sprint speed on the server first and let it replicate, then you'll have the character jump forward to where the server will think the character is supposed to be, again it'll look ok after that initial jerk, until you once again stop sprinting and there'll probably be another small jitter.

The only way around this is to include a flag in the Character Movement Component that gets added to the saved move list when your player triggers the sprint which then increases their movement speed. This way when the client triggers the sprint speed they can begin moving faster, and the flag gets added to the move list, so when the server is "playing it back" it can see when the player should have been moving faster and won't have to correct the player's position. Unfortunately, this method requires you to modify the CMC in C++. Once modified in such a way, you can set it up so that sprinting can be called from blueprint, but it needs that initial setup in C++.

quartz iris
halcyon cradle
#

In other subject , i want to create a multiplayer game and im trying to find an affordable solution for the server , i think i will use EOS services for the matchmaking and voice , but still trying to find a service to scale or reduce the numbers of servers on demand , so far i've seen recomendations for playfab, aws or azure, but i also found the docker image of unreal (runtime) does anyone have experience with docker servers and will it be a better option ?

sinful tree
#

Docker servers would still require you to manage and launch the servers somewhere and somehow. Like, AWS GameLift basically makes a docker image of the files you upload, you set the executable and your options, and then it does the magic of managing the spinning up and spinning down instances based on that image as needed.

latent basin
#

Hey all, i created a multiplayer host and join system. I can host a server and load up another client and join directly through open [ip[

#

it works perfectly

#

But when i get another friend to try the same or on my end it never lets me join

#

I can tell its trying since there are packets being sent, but it says that it never recieves any packets back

#

the person im trying to connect to is really far away, so could that be an issue?

#

i.e. im in UK and they are USA

round mist
#

I've got a struct with a few maps in it. The struct is a replicated variable on a replicated actor (actor replicates just fine and works on client and server) which is spawned here in the screenshot on the server. But for some reason, my maps are empty for the client even though both server AND client should have the same UniqueLootTables variable at the time of spawning. It's set in the world as a public variable.

This was working just fine when it was a simple array. But now that I've switched them to maps, they're empty. Can you not replicate a struct with a map inside it?

hollow eagle
#

maps cannot replicate

warped sentinel
#

hello I need some help
I got an ability on a listen server with player 1 as the server and player 2 as the client when player 1 activates an ability it will activate only on player 1 pawn on both screens but when player 2 wanna activate the ability it will send an RPC to its controller on the server but then it will activate on all the pawns on the client screen ( player 1 client pawn on player 1 screen and player 2 pawns ) how can I fix it?

formal solar
#

Why might be getting stutter when I simulate ping even when I have these checked?

formal solar
#

oh it gone now i set capsule to not replicate

#

and i dont even need those checkboxes

dusky yoke
#

Hey guys. I'm trying to set three variables that the player selects in another level, which is his spell loadout.
He picks the spell, and it's being stored in the GameInstance. OnBeginPlay, I reference the GameInstance and I set the spells. However, an issue that I haven't gotten around yet is that the clients get the spells of the server. What would be the best way to approach this issue?

formal solar
#

what do you mean the spells of the server

#

show the code

#

Game instance is not replicated I just looked it up

fathom aspen
#

GI is local. You can't retrieve it on the server (usually inside GameMode) and hope you're getting the client's one. You can either send a client RPC at an appropriate point in time that then retrieves the GI to then apply w/e. Or you could wait for the first client execution path provided to you by the engine. @dusky yoke

thin stratus
#

Sounds pretty simple :D they are getting the GameInstance on the Server, which of course has the Server spells

#

I feel like some little plugin that opens up an easier path to init local stuff to the server would be cool

#

FInstancedStruct should make that easy

fathom aspen
#

Yeah indeed

thin stratus
#

Like something that is automatically send very early, earlier than what BP have access to

#

Also, on another note, I had a quick look at the Network Prediction plugin with the intend of understanding it, but man, without any slightly more guided docs, it's just too much

#

And I don't mean just "understand how to use it", but rather fully grasp the whole thing

fathom aspen
#

A plugin that also takes care of sending these data at bunches so the buffer doesn't overflow would be cool xD

#

Yeah, I would say it's a similar mission to understanding Iris

#

Well Iris at least got a doc page

thin stratus
#

Iris is even more lost

woven bramble
#

Guys, are you specifically doing the Load the Game - Save the Game parts in the PlayerController?

thin stratus
#

Yeah one that couln't be any more vague

woven bramble
#

After running save in Playercontroller, when I run the save in PlayerState, the save does not work. Or when I do the opposite, it breaks down.
I can only use 1 save system. I have never encountered such a problem before.

fathom aspen
#

Which I read last night, but it's just too theoretical

thin stratus
#

Like, which ones?

fathom aspen
#

Guess and win

thin stratus
#

That page didn't help at all

#

"New API"

#

What new API?

#

Either there is new stuff or you use the old stuff

#

It's so vague

fathom aspen
#

Language of enigmas

thin stratus
#

And I'm still largely annoyed at the Prediction stuff being so bad in UE

#

And it will never improve unless someone properly sets up the Plugin and makes it the base for any predicted code in UE

#

Including GAS

#

-.-

fathom aspen
#

They seem to have been doing some work for predicted physics in 5.3

thin stratus
fathom aspen
#

At least I've seen vori writing something about it

thin stratus
fathom aspen
#

Yeah I guess

thin stratus
#

GAS, Chaos, CMC. Gotta wonder how many half baked prediction we gonna have in the end

fathom aspen
#

So not CMC related, ignore me aPES_Sob

woven bramble
dusky yoke
#

Oh... hmm okay, thanks for the input guys @formal solar @fathom aspen. A GameState would be better than a GI, maybe? I remember struggling to transfer the selected variables from one level to another, so opted for the GI. GameState is replicated though, right, and would maybe be a better way of transfering these variables?

So to clear up, the player has a widget in the main menu level where the GI is called, and selecting various spells sets the variable for the GI.

Then, the player loads in, and I'm setting the variables like this:

WizardCell, what do you mean with this?:

thin stratus
#

GameState doesn't persist

#

You just need to go to your PlayerController, BeginPlay, Branch with IsLocalPlayerController and then GetGameInstance and ServerRPC the data to the Server. Server can then set the replicated variables.

#

Fwiw you can set the data locally when calling the RPC to skip the replication time for the local client

grizzled stirrup
thin stratus
#

The main point is a whole different one

#

The main thing is that we need a system that performs all predictions together in a way that predicting the activation of an ability happens in the same timestamp than doing movement so that everything ties together and can use everyone else's data

grizzled stirrup
#

I think it doesn't need to have as much complexity as it does (movement modes, swimming, flying etc.) all in the base CMC. It's a gigantic class that is baked into each character and is cumbersome to edit and change but yeah it's of course no simple matter to make a good CMC

thin stratus
#

E.g. if I activate an Ability in Timestamp 1000 predicted and modify Movement Speed for 5 seconds, then end the ability, again predicted.

#

I want to ensure that the server activates the ability in the same order on timestamp 1000 so that speed changes are happening exactly in line with the CMC

#

One of many things

grizzled stirrup
#

Yeah that makes sense!

#

Maybe I'm crazy but I'd be really interested to see the most barebones version of a CMC possible (location, rotation and simulated movement (handling extrapolated landing and such on clients)) with no extra bells and whistles. Though probably would be still quite large and complicated.

thin stratus
#

Right now you can't even predict movement speed removal properly if done via GEs in GAS cause client can't predict removal. Or stacking.

And since the reconcile stuff is happening in the CMC, you also don't have any way of recording and playing back applied speed buffs on a correction. Or apply a stun backwards etc

#

We solved that for a MOBA with tons of custom shit in the CMC

thin stratus
grizzled stirrup
#

Yeah it's no easy problem to solve. I wonder if UE will ever break out of the humanoid capsule design tied to characters and have a more generic approach (this is what I had expected with UE5 seing the more general prediction plugins being planned)

#

but I suppose they can't for backwards compatibility

thin stratus
#

There is a plugin by now that has a CMC with more stuff

woven bramble
#

Guys, what is the difference between Get Owning Player, Get Owning Local Players and Get Player controller?

thin stratus
#

And BP support

#

Costs a few bucks

grizzled stirrup
#

Is there one with less stuff and more barebones / performant? 😄

#

I guess I need to just use pawns and figure out a custom movement component if wanting to shave off the CMC cost over many AI characters

#

It's still perfectly playable but it could definitely be a lot faster

#

Dont' need nearly the precision of a CMC on AI

#

bottleneck on CPU is usually CMC tick

#

or at least the largest player in terms of performance

thin stratus
#

Usually GetOwningPlayer and GetPlayerController, both called in the same Widget, return the same value. But if you have local multiplayer or split screen even, it might return different players.

#

@grizzled stirrup Mass :D

woven bramble
thin stratus
#

Same game

#

Same pc

woven bramble
#

oh okay

thin stratus
#

Couch coop

grizzled stirrup
#

It's really nice to be able to share a base character class with human players and AI

thin stratus
#

Yop

grizzled stirrup
#

Oh that's cool

#

Must check it out whenever I upgrade to UE5

thin stratus
#

Might be less perfomant but yeah

#

I use it for simulations atm

#

Takes a bit to get used to and StateTree is a pain atm

#

But cool nonetheless

grizzled stirrup
#

would you use it for gameplay characters like say DOOM enemies?

#

Or is it for more ambient stuff

#

like people walking around a city

thin stratus
#

You can probably do doom enemies. Just takes a lot of coding

#

People made rts characters with it

#

You basically code tasks in the StateTree, somewhat like BehaviorTree (bit more different though) and use so called Processors to update multiple Entities at a time

#

Data is stored in Fragments. So an Entity would have a lot of fragments and processors can be used to update those and use them to do stuff

#

In theory relatively simple

grizzled stirrup
#

Interesting! Looking forward to try it at some point

real ridge
#

Guys I have dedicated server with running session and map on it and I want find solution how I can "restart" this map so everything will start from stratch like when I create this session all collectibles will be there counter goes from 0 etc and I dont know how to restart it I am trying it like this and calling this event Restart session in my game mode on that map from , my controller , on photo 2 when I tried debug it in game mode it was called but nothing happened

#

any ideas?

#

I need restart this session at the end of game and also anytime I need it

#

by click

#

now I always need turn off it by clicking and closing its cmd and then again running it....

thin stratus
#

Do you have any logs?

#

ServerTraveling to the same map again should work just fine

mellow thorn
#

Anyone have any ideas why a repnotify function would only get fired on one client?

thin stratus
rough jolt
#

That's my guess, then again, if I knew what I was doing wrong exactly, I might have been able to fix it

#

The shots do lag behind and are inaccurate for clients, but not for the host

#

And as far as I can tell, my code is just "client fire > server spawn projectile > projectile go forward"

#

so it's the only explanation I could think of

thin stratus
#

The solution to that, in theory, is simple. In praxis it's not. Especially not in BP only.

#

The idea would be that the Server takes the 1 second into account

#

But the problem is that by default you have no clue about that 1 second.

#

There is some C++ implementation examples for a better synced network clock and stuff like that

wanton bear
#

hey everyone, im replicating the pitch of the player controller, then i have a flashlight attached to the camera. the flashlight pitch follows the players pitch but its like 20 degrees too low.

does the camera not follow controller pitch?

thin stratus
#

That should already use a replicated pitch

wanton bear
#

i didn't know that was a thing. no one mentioned it to me till now froggy_chill

#

would have saved a bunch of work

#

thanks, ill look into it

wanton bear
#

still slightly off, very odd

#

must be my blueprints messing it up somewhere if this isnt a common issue

thin stratus
# thin stratus

You'd basically need to take that 1 second into account and spawn the projectile 1 second in forward direction offset.
The distance between original location and new spawn location can be double checked by the server with a quick trace (e.g. a shape trace with the same size as the projectile).

wanton bear
#

actually it looks like the flashlight itself isnt replicating its properties now that i look at it

#

it's wider in the first client

thin stratus
# thin stratus

That way when the projectile then replicates back to the Client, again 1 second later, the projectile is exactly where the Client would expect it

#

Of course that 1 second is probably gonna be 20-40ms

#

To make that even better, one could spawn a local copy of the projectile and destroy that once the server one replicates

#

But that's just a + point

rough jolt
#

And I know the solution isn't easy, thats why its being such a long running issue

#

I'm willing to pay for a plugin if there are any that might help

#

It's been a thorn on my side for months

#

(I don't know any c++)

#

Plus with highly agile ships with tight turning, that means during the RPC time delay, even if it accounts for the distance travelled, a ship will change direction, and the projectiles still won't be accurate

#

since you can not predict direction changes

#

unless its a steady turn, which doesn't tend to be the case

#

This issue is threatening to put my whole project in pause unless I find a solution

thin stratus
#

And I don't know any plugins that target this, sorry

#

Multiplayer is C++ heavy if you get to a specific point

limber gyro
#

is there any way u can set "onlyOwnerSee" of children components without having to do a loop through all of them? for example when u do "SetVisibility" u can propagate that to children

rough jolt
#

Source: we did get to the point of accounting for distance, and that was the result

#

Is there any way to make the clients have full authority over their shots rather than having to send the message to the server?

thin stratus
#

I don't quite get what you mean with "not accounted for".

#

If your player fires a gun, isn't the location and rotation at that specific point important?

#

Why does whatever happens after pressing fire matter?

#

If I shoot a rocket forward and then do a 180, the rocket still flies into the same direction or not?

limber gyro
#

well i guess it doesnt bother me enough to make a request

#

i will just do a loop

thin stratus
quartz star
#

I have a synchronization issue in my lobby.
Each client has its own Lobby UI and I want it to be updated every time a player joins or leaves.
It should display all connected clients.
But the issue is that the server is trying to update every clients UI before the joining client was able to create his UI.

I already tried to add a delay before the server updates all clients so that the joining client has time to create the widget first but it feels "dirty"
Is there something like a callback i could use so i only update all clients when the joining client completed its joining process?

limber gyro
#

its called when a player successfuly joins, but i am not sure if its late enough for your needs

rough jolt
#

Does that make any sense? I'm probably not explaining it right

limber gyro
#

u wanna take into account gun movement into the bullet trajectory?

#

if thats the case you could probably give the bullet the velocity u want it to go PLUS the velocity of whatever shot it

thin stratus
thin stratus
quartz star
thin stratus
rough jolt
#

I'm sorry, as soon as i finish dinner, I will boot up the game, and show you properly, if that's okay?

thin stratus
#

Sure. It's late in Germany though so I might be sleeping soon

rough jolt
wanton bear
#

when i set the pitch of the camera it doesnt rotate the attached stuff

dark edge
dark edge
wanton bear
#

wait, it is correct later now

#

hierarchy

#

whats weird is the pitch for the owning client doesnt seem to change no matter what direction you look

thin stratus
#

You should probably chat with the peeps in #mass if you want to know more

grizzled stirrup
#

(Unless I was to overwrite the CMC funcs and replace it with my own but don't have the knowledge for that)

#

CMC is great for high accuracy multiplayer human movement but AI could get by at a fraction of the precision. But maybe a lot of the tick cost of the CMC is just unavoidable

real ridge
#

also I found some discussions today that ue 5 has broken server travel

lost inlet
#

Why would you specify ?listen as a travel arg when it's already listening

#

Also travelling in the editor is experimental iirc, Lyra uses it though

sinful tree
#

They're listening intently.

twin juniper
magic furnace
#

hey is there any classy way of getting all other pawns?

#

so locally, as the client, get all the other pawns that other players control

#

as obviously

#

player controllers are not replicated

#

to all clients

#

but it's an illustration of what I want to achieve

#

I just have nametag widgets that you can toggle, so searching for a solution for it to be entirely clientside

fathom aspen
#

It's called PawnPrivate in BP

#

Instead of that GetPlayerController

magic furnace
#

nice thanks

fathom aspen
#

No idea why the getter is not exposed

#

Prolly since it's an inline function NM_peepoDerp

magic furnace
#

yeah I was looking for a getter for controlled pawn

#

stupid naming honestly

#

would have never found that without help

#

pawn private, like really

crisp root
#

Premise: I have two top down C++ templates running 4.27 and 5.2 that employ a APlayerController method wrapping UAIBlueprintHelperLibrary::SimpleMoveToLocation for click-to-move, but they don't work when running as a client.

Premise: I actually have another top down C++ template running on 4.27, that uses a ACharacter method wrapping UAIBlueprintHelperLibrary::SimpleMoveToLocation for click-to-move, that does work on the client and I can't figure out why it's different.

Exploration: I looked into this a bit, and it seems others have concluded that SimpleMoveToLocation doesn't work on clients (despite the fact I have contradicting evidence) and even go as far as suggesting the pawn should instead have an AAIController controlled by the server whereby a Server RPC on the APlayerController passes the mouse click/hit location and requests a move. But looking into the source for various classes, and the main difference I can see is that AAIController comes with a UPathFollowingComponent and the APlayerController doesn't — but the SimpleMoveToLocation call creates, registers and initializes one if it doesn't find one on the controller anyway ??

Problem/Ask: I'm having a hard time understanding why I have a working project that doesn't employ Server RPCs or AAIController at all, and why the method living on the ACharacter might make things different…

Can anyone offer any insight, or suggest some things to try? I'm trying to dig into my working example but the project seems to be a corrupted and crashes after too long, so I thought I'd ask here in case someone might have struggled with this already.

fathom aspen
#

Wow this is an instant scale Emily message

crisp root
#

😅

magic furnace
#

I'd check the crash

crisp root
#

Salvage the corrupted working example?

magic furnace
#

I doubt it has anything to do with "corruption"

fathom aspen
#

Okay, I would have expected the same thing. That the function only works with AIControllers but indeed if you're some other type of a controller it creates and initializes things for you

#

Now for the "replication" part, I assume you are missing that there is a checkbox that usually peeps check and client-side navigation start to work

#

It's since AI navigation is server-sided only

#

"Allow Client-side Navigation" iirc inside the project settings

crisp root
#

So you think the working example I have isn't server authoritative?

fathom aspen
#

Ofc not, when it's driven by a mouse click

crisp root
#

FWIW:

This project works:

void AOddCharacter::MoveToDestination()
{
    AOddPlayerController* PlayerController = Cast<AOddPlayerController>(GetController());
    if (PlayerController)
    {
        FHitResult Hit;
        PlayerController->GetHitResultUnderCursor(ECC_Visibility, false, Hit);
        if (Hit.bBlockingHit)
        {
            UAIBlueprintHelperLibrary::SimpleMoveToLocation(PlayerController, Hit.ImpactPoint);
        }
    }
}

This project does not work:

void AOddPlayerController::SetNewMoveDestination(const FVector DestLocation) {
  APawn *const MyPawn = GetPawn();
  if (MyPawn) {
    float const Distance =
        FVector::Dist(DestLocation, MyPawn->GetActorLocation());
    if (Distance > 120.0f) {
      MoveDestination = DestLocation;
      UAIBlueprintHelperLibrary::SimpleMoveToLocation(this, DestLocation);
    }
  }
}
#

But your hypothesis that it's not actually server authoritative is very compelling

#

And reliant upon some project setting to allow client nav…

#

I'll check for that.

#

Yup, enabled in the working project…

#

It's also enabled in my broken 4.27 project, but either way, I don't want client side navigation so I think you've basically made the case for why one would use AAIController anyway.

deep shore
#

I am confused by the behavior of the "Replicate Movement" node in UE4. If I switch "enabled" from on to off, the character's movement continues to be replicated, but at extremely high speed. Print strings show that the character movement speed is still set to the appropriate amount. Has anyone else seen this, or have I messed up a setting in my project? 😅

thin stratus
#

You would need to set the active state of the component too

echo pasture
#

Found the weirdest issue for making multiplayer work with chaos vehicles

#

This statement needs to be here in order for any multiplayer car to work. GetVehicleMovementComponent()->SetRequiresControllerForInputs(true);

#

If that flag is set to false, only the host will be able to fully control vehicles, and clients will be able to posses and steer, but they won't be able to change gears (even in an automatic)

#

I've replicated this behavior in 2 different projects. Not sure what's going on

#

took me 8 hours to figure that out, because it's such a seemingly innocent line of code

elder lynx
#

Is there any way to store data on client side during disconnection that is basically a hard travel and when we connect back client should initialize itself with the store data again. And in my case I am not destroying the pawn.

thin stratus
#

Would need to use OverrideWith as a function in the PlayerState to move the data

#

iirc

elder lynx
#

Can you explain more about this please?

thin stratus
#

PlayerStates have a build in system to go inactive if someone disconnects.
The PlayerState will not be destroyed. By default I think for 5 minutes, but that can probably be changed. When they reconnect, the Game tries to first match an inactive PlayerState to the Player and hands it back the PlayerState. You can use "OverrideWith" as an Event in the PlayerState to override the OLD PlayerState (the one the Player gets back) with any data from the NEW one (they will get a PlayerState for a short while that is freshly set up).
Can be used to, for example, ensure the reconnect doesn't place the Character onto a now full team or so.

#

That of course only works until the Server shuts down

elder lynx
#

Got it @thin stratus , thank you very much.

latent basin
#

Hey what does this check for?

magic helm
# latent basin Hey what does this check for?

It's for dedicated servers, so if that code is running on a dedicated server, it will output through the False route. Everything else will go through the True route. Because those other machines have screens

latent basin
magic helm
hoary spear
#

Or pointless sparkle

latent basin
hoary spear
#

From the perspective of a dedicated server

magic helm
#

Yeah it's great for automatically accounting for single player, listen servers, and remote clients and excluding Dedicated Servers. Then you can fine tune the filtering by checking if the actor or object has an valid Net Owner(which is a function on all actors in C++ that allows you check if it can send RPC's via an owning client) you have to make a C++ function to expose that which is kinda annoying. But you can basically do this in BP only via the owner actor pathway, if it reaches a valid player controller then it's a valid net owner

sinful tree
hoary spear
#

😆 nice

hollow bridge
#

How bad is to change a replicated float in the server every 0.1 seconds?

sinful tree
crystal palm
#

Hi guys
How can I make a physics based replicated character?

nocturne quail
deep shore
nocturne quail
#

yaw is not updating on the client

amber stone
#

What would cause a client from being able to connect to a dedicated server if both are cooked and can run, but when I open the clients console and type "open 127.0.0.1:7777" It doesnt even try to connect. I've got a <game>/Server.target.cs along with <game>Client.target.cs for my project.

#

I also have inbound firewall rules allowing port 7777 to my server host

fossil spoke
#

Have you checked the logs?

amber stone
#

the dedicated servers log doesnt even seem to react to any connection attempt

fossil spoke
#

I mean the Client log

#

The one that invokes Open 127...

amber stone
#

looks like no packets are making it to the server

fossil spoke
#

When taking screenshots of code/logs/blueprints/etc, its useful to include as much surrounding of that as possible.

amber stone
#

alright, I will run it again, and wait for it to timeout completely

#

Yeah there is nothing else of signifigance coming from this log

#

Its just caught in an endless loop with no timeout

dark edge
solar stirrup
fossil spoke
#

@amber stone Wait, how are you trying to connect?

#

Inside the Editor?

amber stone
#

I've tried both ways.

fossil spoke
#

What do you mean both ways?

amber stone
#

via a cooked client being launched from powershell

#

and via the editor

#

directly from the binary I cook from the editor

#

the one that ends up in my <project>\Binaries\Win64<project>Server.exe

fossil spoke
#

What happens if you run a PIE session as a Client?

amber stone
#

how do I run a client seperate from the server in UE5 editor, in UE4 I remember there was an option near the top to launch as a listen server or a client or both

#

but I dont see it in the new UI

fossil spoke
#

Not sure, Im not running UE5

#

Its in the Multiplayer Advanced settings

amber stone
#

wait

#

I just found it

#

Same result when running purely as client

#

trying to connect to the running dedicated

fossil spoke
#

Stop trying to connect to the external server.

#

Just run a PIE session

amber stone
#

thats the PIE log from running just the client, without trying to actually connect to the server

amber stone
#

it looks like my dedicated server isnt even showing as listening

#

This is the last bits of my logs from the dedicated.

#

Says its booting on 7777

fossil spoke
#

Your using the SteamNetDriver?

#

Have you disabled the Steam Socket Subsystem?

#

You cannot connect to a Steam Server via IP if you havent

amber stone
#

I have the steam online subsystem active

#

but the steam sockets is not

fossil spoke
#

Im not familiar with UE5, but I highly doubt thats all you need to disable.

#

Its likely just been separated from the OSS from a code perspective

#

If you want to connect via IP you need the IPNetDriver

#

Not Steam

#

On your Dedicated Server

amber stone
#

I'm really needing to get this all working through steams online subsystems so I can use their session and matchmaking systems.

fossil spoke
#

You can use Steam, you just cant connect via IP...

#

Its just not how Steam works

amber stone
#

Maybe you can shed a little clarity on how exactly I'm supposed to establish this connection. I am admidantly very novice with setting up dedicated servers, and using steams subsystems. I havent been able to find any good clear documentation on how to properly implement it from the users client to the server and everything steam does in between.

fossil spoke
#

Your Dedicated Server needs to start a Session when it boots.

#

This then makes it discoverable over the Steam network.

#

The Client then needs to find that Session in order to connect to it.

#

It does that by searching the Steam network for the Session with some search query parameters.

#

This is a basic overview of how it works.

#

This is essentially the same for any platform.

amber stone
#

Yeah that was also my basic assumption of the process as well.

#

from what I've read so far

fossil spoke
#

Start Session -> Search Session -> Connect Session.

amber stone
#

As far as actually getting the implementation running, thats where im coming up short for docs

fossil spoke
#

Yeah well unfortunately thats something everyone has to go through.

amber stone
#

I need to know what code to put where in order to get the sesssion initialized with steam for the dedicated

fossil spoke
#

You will probably want to look into more advanced plugins.

#

Like Advanced Steam Sessions

#

Or Redpoint EOS plugin.

amber stone
#

Is it possible to implement sessions without those advanced plugins? I assume it is, but would most likely be reinventing the wheel id imagine.

fossil spoke
#

🤷

#

I would think so.

#

We use EOS for Session and Party handling.

#

But we run Listen Servers.

#

Ive never had to setup Steam sessions for dedicated servers before.

#

So cant comment on that

#

In detail

#

I cant imagine it would be much different

#

The main issue as I mentioned, is the IPNetDriver and Steam Sockets

#

You cannot connect to a Steam Session via an IP.

hollow eagle
#

You also don't need to use steam sockets to use sessions/lobby/matchmaking. You can disable steam sockets and connect via ip like normal.

#

Though even with steam sockets there is an "address" you can use to connect without matchmaking - I don't remember the format though (it's not an ip address). It may also require different computers as I believe it's based on your steam id.

fossil spoke
#

That is the other limitation with steam, the need for separate machines

amber stone
#

So testing a dedicated using steam will require the use of a seperate host?

#

or can it be a VM

hollow eagle
#

a VM would be fine

#

though again, that's not necessary if you just don't use steam sockets

#

and it may not be necessary for dedicated servers regardless - it depends on how the address is derived.

amber stone
#

yeah I never intended on using steam sockets. I just needed the use of the online subsystem for matchmaking purposes/friends and querying steams master server for dedicated servers that have listed themselves through their stuff.

#

forgive my crap terminology

#

still learning a lot of it

fossil spoke
#

Honestly, you are better off using EOS. But thats just my opinion.

hollow eagle
#

specifically the "Using IPNetDriver" section

fossil spoke
#

We have Steam enabled for Clients, but only so they can reach friends and use the overlay etc

rose pollen
#

I'm having a problem with my dedicated server where fairly frequently players on clients get a series of log messages like this in their log file.

[2023.08.14-04.24.09:188][587]LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: WorldSettings /Game/Maps/TowerAreas/TowerZero/_Generated_/TowerZero_MainGrid_L0_X0_Y1.TowerZero:PersistentLevel.WorldSettings, Channel: 32 [2023.08.14-04.24.10:456][688]LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: WorldSettings /Game/Maps/TowerAreas/TowerZero/_Generated_/TowerZero_MainGrid_L0_X0_Y1.TowerZero:PersistentLevel.WorldSettings, Channel: 32 [2023.08.14-04.24.17:163][215]LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: WorldSettings

The "channel" varies it just happened to be 32 both times in the snippet above. Occassionally I see the same message with other actors but 9 times out of 10 its world settings that fails. Sometimes these errors are repeated 5 or 10 times, usually within a few seconds of each other. When that happens, game play continues without a problem until they try to disconnect from the server and return to the main menu but at that point the game crashes with this error:

[2023.08.14-04.29.18:104][551]LogWindows: Error: appError called: Assertion failed: WorldSettings != nullptr [File:C:\Users\XXX\Documents\UnrealEngine\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 3115]

If anyone has any idea how to debug this I'd be incredibly greatful for some insight, I've been banging my head against a wall on it and its really hurting the player experience :/. I'm not at all familiar with the world settings actor and how it relates to exiting a session. It seems to come near the end of the tear down process.

plucky prawn
chrome bay
quaint roost
#

Interesting find today: if you use “Always tick pose and refresh bones” to get dedicated server bone movement, it’s a huge performance gain on the client side if you just turn it off before packaging the client build

#

U leave it on for server

#

It saved me 20 FPS

#

I have around 20 AI in my level

thin stratus
#

@chrome bay @rose pollen Pretty sure that's this World Composition stuff or whatever it is called in UE5.0 Big Map.

#

Client of mine has the same. Walking around at some point will spam that message. And if you then travel it will crash on the WorldSettings assertion

#

Pretty sure that's an Engine bug, cause I read from someone else that they had that too.

#

But I also read they might have fixed it by re-generating something. Can't recall atm.

#

Found it

faint parcel
#

I'm back to considering whether or not I should use SkeletalMesh Sockets as the source location of my ranged weapon abilities.
I'm unsure if it's unreliable, relying on layered animations (aim offsets, locomotion, etc.) replicating properly between server/client or if it's fine.
It does make the most intuitive sense and since I won't have to handle rotating an hard-coded offset by the aim offset if the character's upper body rotates.

#

Feels cleaner if I can just say "Oh this character with this type of weapon? Offset by (x, y, z)"

thin stratus
#

The main issue you have with that is of course those not being in sync

faint parcel
#

Server and client animations?

thin stratus
#

Honestly everything, even the Actor Transform can be slightly out of sync

#

If Client sends an RPC in Timestamp X, it doesn't mean the RPC to fire the Weapon arrives on the Server when that is processing Timestamp X

chrome bay
#

If client is sending a socket transform you usually accept it within some tolerance

faint parcel
#

True, but I suppose that's just the cards you're delt when with non-instant networking, right?
If I press Fire on client, I want immediate response but that might be incorrect according to the server.

chrome bay
#

You send the socket transform TO the server when you make the request, you don't use the servers' socket transform

faint parcel
#

Oh, interesting...!

chrome bay
#

You just need to check it's within tolerance

#

If you use the servers' transform then 9/10 times it won't even be close to what the client sees

faint parcel
#

And maybe check if they would hit the same actors?

chrome bay
#

You always do that

faint parcel
#

e.g. do two traces?

chrome bay
#

What is this for? A hitscan gun or something?

faint parcel
#

Yeah

chrome bay
#

Yeah

#

You trace on both client and server independently

thin stratus
#

Cause I expected the GameplayAbility to call with the same Character Transform

#

Which is stupid of course

#

So we had to send the DashEndLocation to the Server

real ridge
#

its called in game mode and I Have list of players there

thin stratus
#

No

#

You only call that ONCE on the Server anyway

real ridge
#

then I have no idea why its not working I press L I see print restarting and I am still in same map and game

#

😄

#

ah

#

but maybe problem is I am trying it in editor..

#

are there any other ways maybe how to "restart" session map?

#

so it will start again

#

and new battle can begin

thin stratus
#

:D Still ServerTraveling to the same map again should do just that

real ridge
#

:DDDD

thin stratus
#

Can probably even travel with no map name and just ?Restart

real ridge
#

I will try it like this

#

I just put after on post login delay and try restart it , without pressing any key in my player

#

if this will fire

#

and I have enabled seamless travel so thi should be ok

real ridge
#

Just called it without pressing

#

Now I need to try have 2 players in if they will still be replicated

#

working

nocturne quail
# nocturne quail what can couse this issue?

found the reason of the issue,
my character is taking rotations from the second client on the second client view point
when I look at the direction of where the second client is looking, my character never snipping

anyone else conflict with this kind of issue?

#

this only happens when I right click to aim

wanton bear
#

hey can i confirm something? if i multicast setting a spotlight to visible, that means no players who join after will see it as visible, while if i repnotify a boolean and set it visibile in the notify function, it will be set visible for players who join later?

chrome bay
#

correct

#

Also for any player who that light becomes relevant too later

#

Never change state with multicasts

wanton bear
#

good info thanks

wanton bear
#

base aim rotation is replicated by default

nocturne quail
real ridge
thin stratus
#

In a more elaborated setup, like most online games have (Fortnite, Overwatch, CS, etc.), you'd actually not care about the Server restart and just kill the process and start a new one.

#

But that requires a backend that handles a lot of stuff for you

real ridge
#

Idk what is purposte of this function now maybe just to not need restart session manualy after every test which needs tester make but as you saying in future I See some orchestration which will turn on/off session o dedicated serveer when its needed

#

😄

#

I just made it to server travel after game over and its enough i think

nocturne quail
wanton bear
#

full blueprint section

nocturne quail
wanton bear
#

unless its multicast or used in an repnotify

nocturne quail
wanton bear
#

i imagine itll need to be ticked anyway for accuracy in aiming

nocturne quail
wanton bear
nocturne quail
#

I run this on tick

    if (!IsLocallyControlled())
    {
        FRotator BaseAimRotation = GetBaseAimRotation();
        MyCamera()->SetWorldRotation(BaseAimRotation);
    }
nocturne quail
#

and tried this too, since mycamera is the child of the spring arm in my setup

    
if (CanAim())
    {
        if (!IsLocallyControlled())
        {
            GetSpringArm()->SetWorldRotation(GetBaseAimRotation());
        }
    }

no success

wanton bear
#

is there a clean way to update the owner before everyone else? for example, you make something visible for the client and then have a rep notify to make it visible for server and other clients

#

rather than having to have the same logic twice or a separate function

#

or a different question, is it standard practice to update the owning client first then update everyone else to keep things feeling smooth?

thin stratus
#

Or something that is initiated by a Client?

wanton bear
#

initiated by client

tame sapphire
#

Does any one know of a reason why or a way to disable why the listen server player controller needs a double click to register either on right or mouse left button?

thin stratus
#

It's common practice to at least try to set that up.

#

But it's not so straight forward, given that you also need to handle misprediction.

thin stratus
wanton bear
#

so i would for example, turn on the clients flashlight, send a rep notify, then update everyone including the first client to correct them?

thin stratus
#

Yes and no

#

This all starts with a Key Press

#

Let's ignore ListenServers for now

#

If you press the Key, you gonna split the code

#

One part calls the ServerRPC

#

That sets e.g. bFlashlightOn to true

tame sapphire
thin stratus
#

That bFlashlightOn is RepNotify, the RepNotify function sets whatever needs to be set to make that Flashlight visibly on and that part is done

#

Part two does whatever the RepNotify does directly

#

Since you can't call the OnRep in BPs directly, you could just make a HandleFlashlightIsOn function

#

Do the boolean branch etc. there

#

And call that locally

#

You of course also have to set the boolean to true first locally

#

Now the OnRep will also call for the Local Client by default

#

There are replication conditions you can set

#

E.g. SkipOwner

#

That will stop that behavior

#

Actually, freaking BPs

#

The OnRep will call either way for local

#

So yu can ignore the Handle... function stuff

#

Cause BPs OnRep is a PropertyChanged event

#

Since the Client changes it, it will call anyway iirc

#

KeyPress -> Server_SetFlashlightOn(true) -> bFlashlightOn = true;

OnRep_bFlashlightOn -> Do stuff

Server_SetFlashlightOn(bNew) -> bFlashlightOn = bNew

rose pollen
# chrome bay The channel number doens't matter, the actor is the problem. Looks like you migh...

Hmm, I do call "teleport" on the player and teleport them within the same map but it isn't travel and it happens at a very different time. The crash happens when the player disconnects to travel to the main menu and the log definitely looks like they are not traveling to the same map they are in, and the log shows no travel occuring anywhere near the time it first fails to serialize the world settings, below is the crash at tear down

wanton bear
#

this is what i've set up already i think. i was wondering about the cleanest way to do it

#

seems like it has to be a little messy

thin stratus
#

Yeah it does

#

You gotta also think about the problem that the flashlight might be unavailable

#

And the server simply denies the request via some condition that might have worked on the client

#

Idk, e.g. Battery is empty

#

So you might need a ClientRPC to just correct the Client

wanton bear
#

yeah, that's why i was thinking checking for the locally controlled should be skipped on rep notify

#

that way if they for example hack their battery to full, then the server will correct the light to turn off

#

although im not particuarly worried about hacking for this game

#

thanks

rose pollen
# clear island I have this issue sometimes when using the PIE, happens on a world partition map...

Hi, I am getting this error outside of PIE in my live game, and it doesn't cause a problem until the player tries to exit the game and load the menu at which point it crashes the game. Did it ever happen to you outside of PIE? I'm trying to figure out how to fix it. When you say unloading the cells and loading them again was that manually in the editor or could I do that programmatically prior to them traveling to the menu?

tame sapphire
thin stratus
#

If you need GameAndUI, cause you have a game where both is needed, then I think the capture stuff can fix that

#

We had that too in our project

#

Think you just need to set it to not capture iirc

tame sapphire
#

i have a constant set of abilities on screen along with camera controls so went with game and UI so i guess its about finding the right capture response for the listen server

thin stratus
#

If I flip to ON then OFF, then ON again, the Server might only send OFF back when I'm on ON

#

And then ON again

wanton bear
#

oh yeah i didnt think about that 7739monkathink

thin stratus
#

Yeah, at that point you'd need reconciliation

#

Which makes this whole thing a lot more complex

#

That's a whole nother topic

#

For stuff like that I might be best to really just not use the OnRep for the local client

#

And just hard-correct it back to something via ClientRPC

shrewd ginkgo
#

I want to make game like amongus but I dont know how can I set random Sus, crew and color anybody can help?

nocturne quail
#

NativeUpdateAnimation runs on server and all clients?

hollow bridge
#

How should I handle player collision with moving pawns in multiplayer? the sever keep fixing the client location making it jitter

chrome bay
#

Nothing you can really do about players walking into each other. They can't both be right, server decides.

nocturne quail
#

why the CMC is not fully functional replicated?

thin stratus
nocturne quail
hollow bridge
nocturne quail
nocturne quail
#

replication don't work with custom blended aim offsets choosen by int

thin stratus
#

I mean you usually use the BaseAimRotation iirc

#

And then there is even a node in the AnimBP that calculates you the value fro the AimOffset from that

nocturne quail
thin stratus
#

BaseAimRotation handles that already

nocturne quail
clear island
rose pollen
rose turret
#

I'm trying to serialize a FFastArraySerializer subclass (FActiveGameplayEffectsContainer) to an FArchive and nothing I'm trying is working

is there any way to do this?

rain condor
#

How can i align third person gun with first person? In first person view i'm aiming on head but in third person is not on head

whole pine
#

if each client has a var that saves what items they had equipped last, how do i make it so other clients can access that var value if the player is offline

#

by connecting it to a specific name

keen hound
#

Is there any way to allow the player to open ip on a steam socket server

#

Do I need to use steam sockets to get a dedicated server to show?

rose pollen
# clear island loading and unloading cells is usually done from the editor, I dont know if it c...

haha, I take it back, I can definitely reproduce in PIE if I go stand at a corner where 4 cells intersect and run around in circles for a bit

LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: WorldSettings /Memory/UEDPIE_1_TowerZero_MainGrid_L0_X2_Y0.TowerZero:PersistentLevel.WorldSettings, Channel: 7 LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: WorldSettings /Memory/UEDPIE_1_TowerZero_MainGrid_L0_X2_Y-1.TowerZero:PersistentLevel.WorldSettings, Channel: 10 LogNet: Warning: UActorChannel::ProcessBunch: SerializeNewActor failed to find/spawn actor. Actor: WorldSettings /Memory/UEDPIE_1_TowerZero_MainGrid_L1_X1_Y0.TowerZero:PersistentLevel.WorldSettings, Channel: 17

ivory dagger
#

hi all. i have this function that makes team selection buttons visible depending on how many teams the host allows. e.g: in my game the host can choose to have a maximum of 4 teams and and if the host decides to have less than 4 teams like 3 teams, then the last 1 team button will hide. the problem is, if i try to run this code on the player controller, it gives the WB_LobbyMenu as invalid but when i run the same code on the lobby menu itself, it runs without problem. can someone pls help me understand why this is happening?

#

pls @ me if you answer

dark edge
#

When is lobbymenu set on controller?