#multiplayer

1 messages · Page 527 of 1

proper ravine
#

but regardless, calling just the multicasted event that plays the sound directly also doesn't work

ocean geyser
#

well i have a few minutes if you want to get into a call and step me through it and we can figure out where the issue is

#

also try printing out a log at the end of the multicast and see if its firing

proper ravine
#

it is but only on the server

#

yeah i can hop in a channel rq if you got time

void nest
#

Anyone know of a way to force the spawning of an actor, but not have it replicate further? So ideally net update frequency should be 0, but the spawning of the actors needs to be as fast and instantanious as possible. I've tried all sorts of things, but no matter what I have tried the only way to make it work is to use net update frequency and have it set at a decently high value (10 +) but this means all these spawned actors are continuously being considered for replication and this is not needed at all, as the actors don't do anything other than existing and being destroyed. Anyone know of a way I can achieve this?

ocean geyser
#

@void nest set your actor to not replicate in the constructor or checkbox thing is using blueprint? or if that fails set it in begin play on the server to false

void nest
#

I've tried that, but what happens is that the server spawns the actor and disables the replication in it's own beginplay. But when a player connects after the actor has been set to not replicate, this client will not see the actor. It needs to work regardless of when the clients connect, not only when the clients are connected beforehand.

ocean geyser
#

does the actors do anything special? also roughly how many of these actors will be spawning? if its not a crazy amount have you thought about spawning them on the client for the join in progress players? such as creating a simple struct with the actors location/rotation and such and storing each spawned actor (that your trying to keep for the join in progress clients) into a TArray of the struct that you created and store it on the gamemode. then in a function like postlogin (on gamemode) have it call a client RPC for the player that joined and pass in that TArray as a parameter, loop through it and spawn an actor for each location/rotation shown in the TArray. that way those actors should be spawned on the client that just joined to keep that join in progress client updated with whats going on when he joined?

void nest
#

The actors are items, and they are in the thousands, tens of thousands even. The items do not do anything. They simply need to exist and not exist (open for looting and picked up) that's pretty much it. It stores of course some information as to what the item is and which item to give the player when he picks one up. This also means it needs to remain 100% serverside as we don't want players to be able to hack their items and trick the server into thinking they picked up a legendary or something.

hoary lark
#

replication graph plugin?

void nest
#

The more interesting question I have is perhaps what is the cost of having tens of thousands of items set to a net update frequency of say 10-20 ? If the actors don't have any replicated variables and don't do anythig other than existing, do they still have an impact on performance (CPU wise) I take it that bandwith wise it shouldn't really matter, as there is nothing to be replicated and thus no data to be sent. However, what I do not know and am wondering about is the cosideration for replication. If it says 10 times per second considered for replication, does that mean the CPU will check each item 10 times every second (meaning 10 000 items (f.e.) * 10 = 100 000 checks). Does this have a CPU cost? or are actors ignored if they aren't replicating anything?

#

Or does Unreal have some sort of built in optimisation for this already?

ocean geyser
#

i dont think they would be using up any bandwidth just sitting idle

void nest
#

Literally can't find a single piece of documentation on this, hence my question

ocean geyser
#

also what about bTearOff? the description is: If the Server sets this to true all clients will take authoritative control of their locally replicated versions of the actor and changes and function calls on the actor will no longer be replicated over the network. It will be as though it was a locally spawned actor

#

i wonder if this will still allow it to be replicated to JIP clients for its initial run

void nest
#

Well yes, bandwith wise there will be no cost as far as I can imagine, as there is no data to be sent over the network, thus no impact on bandwith

#

but the question is the checks, do they have a cost?

ocean geyser
#

i wouldnt think so. only spikes as a client joins the server. cant hurt to try and see

hoary lark
#

Dude

void nest
#

Yeah, interesting point. So everytime a client joins the server there will most likely be a lag spike

hoary lark
#

Replication graph plugin

void nest
#

@hoary lark What is that? 😮

ocean geyser
#

its the replication graph plugin lol

#

doesnt it tell you the info regarding how much of what is using what and such over the network

void nest
#

Wait a min, this rings a bell. Isn't that the thing they made for Fortnite?

hoary lark
#

I don't really know, I've never used it HaroldHaha but I know it is probably exactly what you need

void nest
#

I've seen a video of that a long while ago

#

But that looks complicated AF lol

#

But will check it out regardless, could provide a solution

hoary lark
#

Making a multiplayer game with tens of thousands of world items isn't not complicated af hate to break it to you lol

void nest
#

Well honestly, it's been pretty "easy" so far and we've got most of the game done. We're in the optimisation phase now and this is probably the trickiest thing to optimise thusfar.

#

And it's not really that it seems complicated, it seems more like massive overkill, for the insanely simplistic item system we have

ocean geyser
#

any idea how relevancy would work in his case? if a client joins the server after lets say 70,000 items have been spawned, wouldnt it only create/replicate the items that are relevant to that client or does it go ahead and send information about all of the items to that client?

void nest
#

Pretty sure only those within relevancy range

#

because relevancy range is calculated serverside, server will then decide which actors are relevant and should therefor be replicated

ocean geyser
#

then maybe it wont be that bad unless theres a ton of items in a cluster everywhere being sent around to each client?

zealous saffron
#

You probably should break it up into sectors, or utilize distance.

void nest
#

actually not really, as the items only spawn after opening lootcrates

zealous saffron
#

how are loot crates determined

void nest
#

so it's not like there are thousands lying around all at once, they appear, players pick them up and they are gone again, some items will be left by players, but those should go outside of the relevancy range quite fast

#

That's the thing with the lootcrates, they are spawned in advance, meaning that a lower update frequency is fine, as low as 1 works perfect. The lootcrates are spawned, they take a while to get over to the clients but that's fine as the clients will only encounter them a few mins into the game

#

but the actual items should spawn instantly after opening a crate

#

and that is where it gets tricky

zealous saffron
#

Have the server store all the LC locations and information on the items/LCs, trigger spawning of the LC with the desired items on the client and server when the first player is within a certain range.

long willow
#

Does anyone have anything to say about this (Like, how to get around it)?

#

I really dont wanna have to make a animation for the player to look up, one to look forward and one to look down to be able to create a blend space for this and get around it that way if I dont have to as I will be making my final animations myself (lol, call me lazy if you like, but seriously)

void nest
#

Yeah I've also been thinking about actually having the lootcrates be deterministic and already have the items it will spawn stored in a list which is already replicated together with the crate itself. That way I could spawn the items instantly (dummies as it were) on the clients. Just need to figure out a way so that the client can't tamper with what they picked up and trick the server into making it believe client picked up something which isn't true

zealous saffron
#

You should be using client side pickup objects if you're worried about network overhead for 1,000s of items.

ocean geyser
#

@long willow make a replicated variable for the transform on the character and get/use that variable in the animation blueprint?

zealous saffron
#

The loot crates should be owned by the server

long willow
#

Im my case were speaking vertical rotation

#

And its already bound to a variable inside the character blueprint, which is then fetched through a cast to the character in the animation blueprint, and sets the local variable for the anim graph to use from it

ocean geyser
#

is that variable replicated?

long willow
#

Lemme just show you everything

void nest
#

Yeah but, the client still picks up a local item and gives this info to the server, so the server can actually add said item to the client's inventory. The problem with this is that the client can trick the server because he can tell the server he picked up whatever he wants basically

long willow
#

(Since youre curious)

zealous saffron
#

the LC should have it's items set during initialization, as some sort of cheap pickup object.

long willow
#

There you have it

void nest
#

Unless the items are already there, but not ticking and invisible and only turned visible after smashing the crate 🤔

ocean geyser
#

would the server know your controller rotation?

void nest
#

hmmm that could work actually

zealous saffron
#

spawn said pickup objects on the client

long willow
#

Im not sure tbh Cody

#

Tell me, would it know that Im using multicast when running the code

#

Do you think that is the issue? The server is preventing other players from displaying it

#

I can just make it run on the server individually as well right away then

ocean geyser
#

why not see what it prints out on the server. you could pass in your control rotation to the server from the client and use that instead or do all the calculations on the client and simply send the final data to the server so the server can simply replicate the variable

zealous saffron
#

If the server is authorative it doesn't matter what the client says, either that weapon exists or doesn't.

ocean geyser
#

and no, remove that multicast event

#

set AimRotation to be replicated. set CustomEvent_4 to take in a Rotator. do all of the calculations you did in CustomEvent_4 on the client, then simply call the CustomEvent_4 and pass in the finished Rotator. in CustomEvent_4 just set AimRotation to equal the Rotator you passed in

long willow
#

Did you even look at the code?

#

Non of the nodes used to calculate the stuff are not even executed

#

Tho I dont get how that makes more sense

#

HOLY FUCK YOURE A GOD

#

It works somehow!!!

#

lol

#

Idk why, but it werks

ocean geyser
#

thats what i mean, i got mixed and didnt see the multicast at first. your using a multicast to set AimRotation and your using GetControlRotation in that multicast. im 99% sure other clients dont know what your control rotation is so their never going to see it. you shouldnt be using a multicast in this case anyhow. do the math on the client, pass it into the server and have the server simply set the AimRotation variable. no need for multicast, just make sure AImRotation is replicated and being set on server

long willow
#

(excuse my language, but seriously you saved my sleep tonight lol)

#

In another scenario similar to this tho I believe I got issues if I didnt have multicast (I think it was clients didnt see changes other clients did, but clients saw what the server character did or something)

#

I might remember what you said tho when my game is at a more finished state and if I need to clean stuff up for performance reasons or something tho, but for now, Im happy if it works, so yeah

ocean geyser
#

whats an example of that scenario

long willow
#

Crouch and sprint related

#

Another reason to that Im not gonna try removing it now is that its late, and I wanna spend some time with my family before bedtime ❤️

ocean geyser
#

theres crouch functions built into the character movement component that you can setup and use fairly easy btw

#

for sprinting just make a boolean. if shift is pressed set it to true, if shift is released set to false. in your moveforwards and moveright functions use that boolean. for a C++ example i did

void ASurvivalCharacter::MoveForward(float Value)
{
    if ((Controller != NULL) && (Value != 0.0f))
    {
        // find out which way is forward
        const FRotator Rotation = Controller->GetControlRotation();
        const FRotator YawRotation(0, Rotation.Yaw, 0);

        // get forward vector
        const FVector Direction = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);

        if (!bIsSprinting && !GetCharacterMovement()->IsCrouching())//if not sprinting(shift released) example. ignore crouching
            Value *= 0.5f;
        AddMovementInput(Direction, Value);
    }
}
normal garden
#

How would I get character movement to replicate to a client?

#

Movement is jittery on the client when I set the max walk speed from the movement componenet

winged badger
#

you have to set it on client and server at the same time

#

to avoid jitter

normal garden
#

So with a client event and a server event?

ocean geyser
#

set it on client and then set it on server yes

winged badger
#

basically client initiating the speed change is the only way to avoid corrections

meager spade
#

GetLobbyChatEntry in steamworks, is the MessageLength the max chars we want to recieve for that message?

normal garden
#

@winged badger Would this be the way to do it? Sorry if it's 100% incorrect, I'm not very experienced with unreal engine

meager spade
#

can hardly see it

#

tiny

#

urgh

#

no need for Switch Has Authority on a server call

#

Server is already authority

#

you could do that with 2 functions

normal garden
#

okay..

#

could you explain a little more?

meager spade
#

wait

#

could make it cleaner by wrapping into a function

#

like this

#

you get the idea tho right?

normal garden
#

Yeah I do

#

Thank you for the help

#

Okay so an even bigger ty, it's working perfectly ❤️

meager spade
#

np

#

🙂

sly arch
fringe sinew
#

Are you using the same computer to host and join? @sly arch

#

AppID says zero, I think it should be 480 if you don't have an app Id of your own 🤔

silent phoenix
#

How can I get advanced sessions working with an external dedicated server? If I launch my dedicated server on my computer it works fine but if i launch it on my ec2 sever I can't find the session with find session

#

using default subsystem

silent phoenix
#

Is this not possible? I can get it working on steam subsystem no problem but not with default

fringe sinew
#

Bruh.

#

The default subsystem only works on LAN I think. : )

silent phoenix
#

lol rip thanks

thin stratus
#

@silent phoenix Yeah you need a subsystem with a masterserver. :D where do you imagine does the serverlist come from otherwise

silent phoenix
#

lol i was wondering how the magic happened.

thin stratus
#

Steam has a master server. If you create a session it reigster it there. Finding session then asks steam for a list of them

#

Null subsystem doesn't have that. Finding sessions does a broadcast call on the lan network and waits for pcs to answer if they host a session

silent phoenix
#

Thank you for the insight eXi

fluid finch
#

@pallid mesa @chrome bay so the servermovenobase is an error in itself? How would I debug this?

pallid mesa
#

add a breakpoint and take a look at the callstack

wary wyvern
#

Guys, why server control rotation does not get affected by AddYawInput and AddPitchInput, if character's ReplicateMovement is disabled? How do I send control rotation to the server?

thin stratus
#

That's sort of like asking why the light doesn't turn on if you shutdown the power

#

Control rotation is send via the cmc.

#

If you turn of movmenet replication then it won't send it anymore.

wary wyvern
#

cmc?

#

Okay, I got it. I thought, that ReplicateMovement defines, if location and rotation send TO client, not FROM it.

royal isle
#

Hey everyone, is there a way to copy non-seamless travel player properties over after a server travel? My first guess was as a connection string parameter but how can I test if the travel is the initial client connection or the result of server travel?

winged badger
#

there is no connection string in steamless travel

#

there is no connection made

#

login functions don't get called during seamless

sly arch
#

@fringe sinew In my config build files It’s already set to 480.

grizzled stirrup
#

In the following example from ShooterGame:

void AShooterWeapon_Projectile::ServerFireProjectile_Implementation(FVector Origin, FVector_NetQuantizeNormal ShootDir)
{
    FTransform SpawnTM(ShootDir.Rotation(), Origin);
    AShooterProjectile* Projectile = Cast<AShooterProjectile>(UGameplayStatics::BeginDeferredActorSpawnFromClass(this, ProjectileConfig.ProjectileClass, SpawnTM));
    if (Projectile)
    {
        Projectile->SetInstigator(GetInstigator());
        Projectile->SetOwner(this);
        Projectile->InitVelocity(ShootDir);

        UGameplayStatics::FinishSpawningActor(Projectile, SpawnTM);
    }
}

Is there any reason you wouln't send the Origin FVector as an FVector_NetQuantize instead if you don't need perfect origin accuracy?

#

I would assume it would still spawn at roughly the same place with less bandwidth cost per shot

winged badger
#

it just loses precision past the first decimal

grizzled stirrup
#

Which is millimeters in reality right?

#

Since 1 ue unit is 1 cm

#

Shouldn't be too noticeable at all in most cases

chrome bay
#

Should be fine. Pretty sure we use NetQuantize for shots

winged badger
#

we do

royal isle
#

@winged badger I was talking about non-seamless travel. In seamless you can just use CopyProperties, I wish to do something similar in non-seamless

winged badger
#

CopyProperties is for non-seamless

#

but it works only locally

#

local hard travel can copy properties just fine

royal isle
#

oh ok

#

thanks

sly arch
#

@thin stratus I saw you said something about how null online subsystem won't work for people trying to connect outside of lan, but what do you recommend?

thin stratus
#

Using one that supports it?

sly arch
#

Right now i'm using steam online subsystem. Will that not work?

thin stratus
#

Steam has a MasterServer, so yeah that works.

sly arch
#

Oh lol

#

Sorry, I was confused. Thanks lol

#

and clearly "null"
means no masterserver i'm assumming?

thin stratus
#

No, NULL is just the placeholder one that UE4 provides so you can at least do something.

#

Not having a MasterServer is just part of that.

#

I mean, such a Server must be hosted somewhere with a DB etc.
That's not magically working.

sly arch
#

Oh, that makes more sense

thin stratus
#

Steam does that for you, but as one knows, also takes % of you

sly arch
#

Will the devappid still work externally? or would i need a steamworks account

thin stratus
#

Ultimately you need your own app id

#

the dev app id is used by sh*t ton of people and ever so often causes sessions to not show up.

  • it's for a different game afterall, so when you release you need your own
sly arch
#

Yeah, I'm planning on getting one. How quick is the process?

thin stratus
#

Let's say you want to take care of that a few weeks in advance, cause you kinda also want to get used to the admin page, setting up your store page and all that stuff.

chrome bay
#

Also have to pay the admin fee to get a new app with a valid app id.

#

Approx £70 GBP, not sure on other currencies

sly arch
#

Well i'm not nearly close to "release" but will steam allow me to use the appid without setting up a store page yet?

#

Yeah, I think it's $100 for u.s

chrome bay
#

Yeah you'll get an AppID as soon as you create the app / pay the fee

thin stratus
#

100€ here too or so

chrome bay
#

Don't need to publish or edit the store

thin stratus
#

No you can use the ID without caring about the store, but just making sure you are aware that there are some extra steps, so don't do it last week before release :D

#

If you have a prototype that is fun and you want to go further with the project, get the ID

sly arch
#

Makes sense, can also use steam as a database or do you recommend an external company?

#

Sorry to keep bugging ya, i'm full of questions lol

rocky totem
#

i know the TMap's can't be replicated but can i pass it directly via an RPC

thin stratus
#

@rocky totem No

#

@sly arch Steam has some ways of handling data, but you better read the steam documentation.

#

Depends on your needs.

sly arch
#

Yeah prob should lol

rocky totem
#

TArray of structs it is

sly arch
#

The only concern I have is having to fill out the W4 on steamworks which you'd need to put in a SSN. Not sure how I feel about that

#

I mean, it makes sense..

chrome bay
#

It's a Tax requirement

sly arch
#

Even if the game is free?

chrome bay
#

I guess so, just makes it easier if you want to change to not-free I guess

sly arch
#

Yeah..

rocky totem
#

@winged badger so how would that work with classic singletons like IFileManager. does that get overwritten too?

winged badger
#

only those made on gameinstance level

#

not engine level

fringe sinew
#

I have a pretty simple question D_D]

#

Player Controllers are not replicated so if I use the free plugin from the marketplace for input buffering would that cause any trouble? Like does a multiplayer game that has input buffering need some special replicated stuff in order to do it?

winged badger
#

not unless the plugin is really bad

wise depot
#

Has anybody here ever used network encryption with
UGameInstance::ReceivedNetworkEncryptionToken

chilly mason
#

what algorithm(s) does UE4 use for compressing network traffic?

halcyon totem
#

hey can someone help, I am ready to take my game multiplayer but I need some videos to help me learn and understand if anyone is reading this can post some good videos please do

fleet raven
#

@chilly mason unreal does not compress network traffic beyond some standard bit packing and quantizing float values

#

though they have a plugin that uses oodle network compression

chilly mason
#

I can see zlib and/or gzip being used, I guess that's all ue4 does?

tribal solstice
#

What is the proper way to load a level for all players using Open Level?

#

I'm trying to open a level from a UMG button on the server but the connected players just go to a black screen for some reason.

fleet raven
#

use servertravel not open level

tribal solstice
#

is that possible with blueprints?

#

execute console command 'servertravel /Game/Maps/Map'?

meager spade
#

yes ofc

tribal solstice
#

where should I execute that? I just tried it and it's still only opening the map for the server

#

It works for the server, but when I select 'Seamless Travel' in game mode and select a transition map it won't load the level for server or client

meager horizon
#

Just trying to come up with a respawn mechanic, I'm thinking auto respawn 10 seconds after death unless you quit, and the game should select the spawn point that has the lowest concentration of players within a sphere around it. Can anyone spot any holes with this approach?

fleet raven
#

yes, waiting 10 seconds for no reason sucks

#

why do people always want to make respawn countdowns

chilly mason
#

is there any console or pc os on earth that's not using BSD sockets?

meager horizon
#

not really

#

its pretty standard, as tcpip has grown around the library as well as the library growing around tcpip

chilly mason
#

so why the hell is FSocketBSD not public and exported...

silent phoenix
#

Anyone in chat who has got attenuation working with VOIP talker? I got the talker working with PTT on dedicated server but I can't get attenuation working. I've tried setting the default settings and the "Set Settings" of the talker.

#

you can still hear players map wide

harsh lintel
#

I have a static mesh component that is replicated attached to a character to attach particles to it but it doesn't seem to attach to the mesh

gleaming vector
#

@chilly mason Steam Net Sockets don't use BSD

#

so basically windows/steam

#

you have to do steam net driver with passthrough to use of ip sockets

#

otherwise it either uses legacy steam p2p sockets or steam net sockets

#

neither of which use bsd sockets

chilly mason
#

good to know

#

was thinking of a reason not to make FSocketBSD public but I still can't see any so I'm gonna go for it

#

steam sockets is optional, nothing's built on top of it (hardware)

#

thanks for the insight

gleaming vector
#

i would say put whatever you need into FSocket

#

and dont implement the function in steam sockets

fluid finch
#

Where do I find the Unreal Insights tab?

chrome bay
#

There's no tab, it's a separate .exe. Engine/Binaries/Win64

twin juniper
#

Hey there 👋
Do you have some links or keywords regarding advanced saving systems for self hosted multiplayer ?
I'm creating a zombie game where pretty much any object's state , position and so on has to be saved (Open world , crafting) .
Plugins seem a little "dangerous" to me 😬

sand tangle
#

Hi 🙂 I'm trying to replicate MoveForward, MoveRight, Turn and LookUp values (Animations and Bone transform) to all clients. Do I need to use RPCs or only OnRep?

#

or both? 🙂 ```
void AShooterTemplateCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);

DOREPLIFETIME(AShooterTemplateCharacter, RightAxis);
DOREPLIFETIME(AShooterTemplateCharacter, ForwardAxis);
DOREPLIFETIME(AShooterTemplateCharacter, LookUpValue);
DOREPLIFETIME(AShooterTemplateCharacter, TurnValue);

}

// Forward Axis Input Value for the character blendspace
UPROPERTY(Replicated, EditAnywhere, BlueprintReadWrite, Category = Movement)
float ForwardAxis;

//Right Axis Input Value for the character Blendspace
UPROPERTY(Replicated, EditAnywhere, BlueprintReadWrite, Category = Movement)
float RightAxis;

//Mouse Turn Input Value for the Turn In Place-animations
UPROPERTY(Replicated, EditAnywhere, BlueprintReadWrite, Category = Movement)
float TurnValue;

//Mouse LookUp Input Value for the AimOffset
UPROPERTY(Replicated, EditAnywhere, BlueprintReadWrite, Category = Movement)
float LookUpValue;
winged badger
#

this VR?

sand tangle
#

hum?

#

No Virtual Riality

#

virtual reality*

twin juniper
#

Thankyou very much @winged badger ! 👍

winged badger
#

OnRep, with SkipOwner

sand tangle
#

Thanks, I'll give it a try.

lime sorrel
#

Basic question: Does ping in UE4 mean how long it takes for the server to receive your data? Or does it mean how long it takes for the server to receive your data and to send you a response back?

#

Meaning, is it just the latency between Client and Server or is it Client to Server and back?

sand tangle
#

Client To Server and back

lime sorrel
#

thought so

#

some guy on forums says the same thing

#

thanks!

versed socket
#

Has anyone ever done a VOIP tutorial for UE4?

sand tangle
#

I've started setting up OnRep replication for ForwardAxis, RightAxis, TurnValue and LookUpValue. I'm struggling to understand what I should put into the OnRep-functions.

void AShooterTemplateCharacter::OnRep_RightAxis()
{

}

void AShooterTemplateCharacter::OnRep_ForwardAxis()
{

}

void AShooterTemplateCharacter::OnRep_LookUpValue()
{

}

void AShooterTemplateCharacter::OnRep_TurnValue()
{

}

void AShooterTemplateCharacter::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME_CONDITION(AShooterTemplateCharacter, RightAxis, COND_SkipOwner);
    DOREPLIFETIME_CONDITION(AShooterTemplateCharacter, ForwardAxis, COND_SkipOwner);
    DOREPLIFETIME_CONDITION(AShooterTemplateCharacter, LookUpValue, COND_SkipOwner);
    DOREPLIFETIME_CONDITION(AShooterTemplateCharacter, TurnValue, COND_SkipOwner);
} 
#

Could someone help me with one of the functions? 🙏 🙏 🙏

sand tangle
#

There is not a single example of how to replicate axis values to all clients. 😶 Possibly basic knowledge, but still

chrome bay
#

You're not supposed to replicate axis values usually that's why

#

Why would you want to replicate the players input?

sand tangle
#

I want to replicate animations and bone transforms

pine flint
#

I believe the players look direction is replicated by default

#

I will check my code

chrome bay
#

@sand tangle You can't, it's way too much data and it won't replicate quickly enough anyway.

#

The players aim pitch is rotated by default for pawns.

#

"RemoteViewPitch" is the var

sand tangle
#

Hmmm, I'm using MoveForward and MoveRight in my strafing Blendspace

chrome bay
#

You shouldn't be

pine flint
#

you should use the players velocity

#

then the animation will line up with the movement on the clients machine

chrome bay
#

Yep. Animation state should be derived from the characters state.

sand tangle
#

Hm

#

I have not been able to use strafing animations in addition to idle, walk and run animations in the same blendspace. Is it possible?

#

With the speed/direction way

pine flint
#

this is from the anim bp to set the direction as a vector(fwd, strafe)

#

top row are jog_rifle_direction and bottom row is all idle_rifle_hip

#

hope this helps, animation is one of my least favourite parts of game dev

sand tangle
#

Thanks! It worked so well locally and with the server client, so didn't think it would be a problem to use MoveForward and MoveRight. Guess I have to sit down to make it work the correct way.

#

Btw, I got it replicated using blueprints

#

And it worked, but still no one using that?

#

I get the message, it is a bad way to blend animations

pine flint
#

It would be fine for a local game but since you want to do multiplayer the velocity is already replicated so there is no point sending the data twice

sand tangle
#

Okey

#

but I am using Turn value when speed = 0 to play turn in place-animations. Is it safe to replicate that one or is it already replicated?

pine flint
#

The goal is to only send as much data as is required over the network as large player counts will start lagging when you start sending un-needed data or sending updates too often

#

rotation of the character is already replicated

#

so it should work over the network the same as local

sand tangle
#

I store the tuen value inside my own variable, because I'm a noob and don't know how to use the sameone used to turn the capsule

#

Turn*

#

Thanks :D one step back and one step forward in the correct direction :)

pine flint
#

by all means you can calculate your own variable for something like turn speed on your animbp if you need to, but you don't need to replicate it because you can derive it locally from other replicated properties. (hope that makes sense)

meager horizon
#

Is there a way to have the editor "run decided server" not immediately connect?

#

I want to run a separate instance like it does but not connect until an instance of the game calls the open map node

#

I'm guessing the first thing my game could do could be to open a local map if it's not the authority (I don't do listen servers), discarding anything thats default from the command line

#

The local map would just be an empty one for the menu

#

Thoughts?

rare cloud
#

@meager horizon you can run a dedicated server manually with a batch file and uncheck the run dedicated server on Editor

meager horizon
#

But then how to I keep it up to date with what I'm working on?

rare cloud
#

you need to relaunch it

meager horizon
#

That sounds like an ass to iterate

rare cloud
#

but in advanced settings there is no "auto-connect" settings ?

meager horizon
#

I suppose I don't change the c++ side much, so all I need to do is have a batch script to cook and run

rare cloud
#

you can access this menu from the "Play" dropdown and "Advanced Settings..."

meager horizon
#

Found it too

#

Thanks @rare cloud 👍

#

This means I just need an option only in a debug build that offers 127.1 as a server IP option

rare cloud
#

yup better to make this side with C++

meager horizon
#

Well I wasn't going to, I was going to use the simpler blueprint open map node. Is there some reason it works better to use c++ for that? I prefer the flexibility of c++ but dislike the slowness to iterate

rare cloud
#
#if WITH_EDITOR
FString IpAdress = "127.0.0.1";
#else
FString IpAdress = "Something";
#endif
meager horizon
#

Oh I see

#

Yeah of course 😁

rare cloud
#

you can put this inside a pure static function

meager horizon
#

I think I already have an Is In Editor node in my blueprint function library

rare cloud
meager horizon
#

Thanks I may have use for that

#

My production dedicated server is going to run on a completely separate platform, I have some build scripts I made to deploy to it with rdiff

fossil veldt
#

Has anybody attempted Dockerized UE4 Dedicated Servers? If so how did it go?

gleaming vector
#

yes, and fine

#

i've dockerized the editor and building in a container too

#

there is a set of dockerfiles that someone in the community made

fossil veldt
#

Awesome, Ty @gleaming vector

gleaming vector
#

i ran into very few issues once i got docker working

#

ran into a lot of issues outside of the scope of UE4 though

#

just, docker doing docker things

#

running out of memory, disk space, etc

fossil veldt
#

I don't suppose there would be anything stopping you from making a kubernetes cluster for UE4 dedicated servers with this?

gleaming vector
#

i've never tried, but given how smooth sailing it was once i had a container running, i don't see why not

fossil veldt
#

wicked

cerulean escarp
#

so I'm trying to make a weapon selection screen for my game, and it works great on a listen server for the host but when I try to select a weapon on a dedicated server, the server can't even find the array of weapons to choose from

#

here's the code that's in my weapon selector BP

#

also I have found out that the class doesn't even set the gamemode reference correctly, it just comes out as a null gamemode

sand tangle
#

How much difference in replication data bandwidth is it between Aim offset vs Bone Transform(3x spine)? Expect Aim Offset to use the least bandwidth, but still it requires more work.

#

Are there any smart ways to measure how efficient the game is in terms of replication and bandwidth?

jolly siren
#

The network profiler

sand tangle
#

Nice, a standalone tool. Thanks.

coral coral
#

Hey guys, quick question here. I'm working on outfitting my game for multiplayer right now and it's going mostly well, but I'm not sure where to start on a certain aspect. I have a button that should change it's color based on how many times the player has pushed it, but I don't want the color to change for a player who hasn't pressed it. I'm not sure if it's possible to change something like the anim bp/variable of an actor for each client or if I should spawn an actor on each client and change the settings for each of the player's local buttons.

winged badger
#

thats simple - do not replicate the number of presses

#

track only locally

viscid escarp
#

[Log attached] Hello guys! Do someone know what is wrong with my server? I already contacted the Steam support and searched everywhere(probably everywhere that you could send me links). Seems like everything is alright, but the steam master server just can't see my server, also i can't find the server in-game. The support told me that they can see the server, but for some reason, just they. Using AdvancedSteamSessions Plugin in 4.21 UE4.

#

i've been like 4 months trying to solve this problem and nobody can help me.

coral coral
#

@winged badger Thanks that makes sense. I figured I was overthinking it. Thanks for the help.

silent phoenix
#

Anyone in chat who has got attenuation working with VOIP talker? I got the talker working with PTT on dedicated server but I can't get attenuation working. I've tried setting the default settings and the "Set Settings" of the talker.
@silent phoenix

#

Sorry I asked this question yesterday and i'm still stuck if anyone has any insight 🙂

rotund sapphire
#

Create a new attenuation setting with default and assign it to the voip talker comp. Make sure you don't override it from code, so keep it default. I dont use voiptalker, but i made voip code before the attenuation was working, dsps and reverbs too. In 4.20 at least.

long willow
#

Hey, I got some issue with my servers widgets being displayed on all the clients as well, do you guys know how I could fix this? ❤️

#

(Please ping on reply)

rose egret
#

I am doing seamless travel. is it possible to persist PlayerState from the old map to new map ?

#

I dont want them do be reallocated

thin stratus
#

@long willow Well, only spawn it on the server.

#

Spawned it in the PlayerController on BeginPlay with SwitchHasAuthority and IsLocalPlayerController or something like that

solar stirrup
#

Is it possible to "write/read" data into a replicated struct?

#

Basically like a bit stream I can read/write to

#

I'm thinking about a system where I can do struct.WriteInt(myInt) on the write side and then read that back with myInt = struct.ReadInt()

#

Is FArchive good for that?

hoary lark
#

clients are never guaranteed to receive every change made to a struct, so no, I would say that's not possible, what are you really trying to do?

solar stirrup
#

clients are never guaranteed to receive every change made to a struct, so no, I would say that's not possible, what are you really trying to do?
In my case, I'm using a fast array serializer

#

So it should be guaranteed

#

I want to write/read data from my fast array serializer item struct

#

and have it be replicated

#

@hoary lark

hoary lark
#

I'm hoping someone more experienced than me can chime in to confirm/deny, I could be wrong, but if you make multiple changes to your array data, a 2nd change could hide a 1st change. each net tick the server will only send the delta from the time the struct was previously sent. if you make multiple changes to an array index between net ticks, i don't think the client will have any clue about the middle changes. what makes (reliable) RPCs unsuitable for whatever you're trying to do?

#

furthermore Fast TArray Replication: "...The downside is that you will need to have game code mark items in the array as dirty, and well as the *order* of the list is not guaranteed to be identical between client and server in all cases."

#

further-furthermore you can only do server->client data transfer, not sure if that's all you need or if you were hoping for something two-way

solar stirrup
#

1- I know the limitations of the fast array serializer :p and yeah most data comes server->client
2- changes to the data most likely won't happen that way anyway
I needed a system to write arbitrary data to the structs so that I can modify/read them back later

#

Fast array order isn't needed, the items have their "position" as a property

#

I just wonder if it's possible to replicate an FArchive

#

that or I'll probably have to make my own struct with custom net serialization

winged badger
#

the latter

solar stirrup
#

so make my own struct with custom net serializer and write/read functions?

#

sounds like an exciting thing to try out, it'll be my first time messing with the serialization hehehe

winged badger
#

custom netserialize is the only way you'll ever send a non uproperty over the network

solar stirrup
#

Will I be able to mark my custom data struct as a UPROPERTY() in my fast array item?

#

I assume so as long as the struct implements custom net serialization

winged badger
#

should be able to

#

strongly suggest reading fhitresult netserialize function

hoary lark
#

good luck. trying to shoehorn a bitstream feature into struct replication just sounds like an alternative to self-harm to me 😄

#

(not that I have any alternatives/solutions, that's above my head)

winged badger
#

its doable with bitflags

#

but its going to get pretty inelegant

#

it is very likely a bad design

hoary lark
#

is there some way to ensure a net tick has occurred before you (he) updates the struct again to make sure no deltas are ever missed? i guess there must be some callback somewhere

#

or maybe not needed, IDK.

solar stirrup
#

it is very likely a bad design
I mean, if there's any other alternatives, I'd take them haha
It's for my inventory component. Right now, FItemSlot (the fast array item) contains the Id, Quantity and Durability of its item. However, I want to be able to encode additional data that some different types of items could have. Unfortunately, no RTTI kinda goes in the way, so I figured I'd add additional data and create readers/writers for each additional type of items that can read and write to the data of the slot

winged badger
#

there isn't

#

i'd rather have replicated UObjects then do that @solar stirrup

solar stirrup
#

Thing is, where would I store the objects since they'd need to be tied to the FItemSlot 👀

winged badger
#

FItemSlot has a UObject*

solar stirrup
#

I'd still need to have an array for the objects somewhere else right?

winged badger
#

if its a strong pointer no, if its a weak one (the approach i prefer) then a non replicated TArray in an object your fastarray is a member of

#

to keep the items alive

#

also simplifies any syntax where you have to iterate over all of them

solar stirrup
#

hmmm

#

So my FItemSlot would only keep track of the Id/Quantity, and any other data such as Durability etc would be in an object that it points to right?

winged badger
#

id, quantity and slot, if it matters

solar stirrup
#

how would I force both the fast array and the object array to replicate at the same time?

winged badger
#

i use similar approach for my buffs

#

fastarray keeps a poitner and number of stacks, buff hold everything else

solar stirrup
#

if one replicates too late it might potentially do something weird mmLul

winged badger
#

you dno't need to

solar stirrup
#

alright

winged badger
#

if your pointer comes as null during the add callback

#

then a changed callback will fire as soon as its NetGUID is resolved

solar stirrup
#

👌

winged badger
#

fastarray handles the replication race for you

solar stirrup
#

that's perfect

#

well, definitely way better than what i had in mind

#

thanks for the help

winged badger
#

you can also kidna force it into shape by moving around the order of Super call in ReplicateSubobjscts

#

if your actor replicates subobjects before the SUper

#

they tend to arrive before the normal actor replication

solar stirrup
#

i'll try that out

royal isle
#

Hey people, I am getting an FBitReader overflow when setting a replicated property on a player's player state duringInitNewPlayer. The property itself is a USTRUCT with 4 string fields and an integer field and the strings themselves are not very long so I don't get why it overflows when trying to replicate it but the result is a network ckecksum mismatch on the player state when trying to connect

chrome bay
#

How long is not very long?

#

And have you overridden the structs NetSerialize() function, as that's what it sounds like

#

But it sounds like it hasn't been done correctly and the reading/writing isn't symmetrical.

royal isle
#

I haven't overridden it no. One string is 24 characters long the rest are 6 characters max

chrome bay
#

Hmm kk, yeah doesn't seem very long. Network Checksum Mismatch though... that's usually because the server and client are using different assets.

#

Or are running a different build

#

Which means insta-kick

royal isle
#

yeah that was my original thought but I triple checked the updating process and then I only got the log for the reader overflow after disabling the checksum test from the console

chrome bay
#

I can't see it being anything else. The reader overflow would also make sense if one build has some replicated properties that the other build doesn't

#

Is this a dedicated server build?

royal isle
#

yeah

chrome bay
#

I would recook and repackage both server and client

#

It sounds to me like they are on different builds

royal isle
#

alright I will try that then thanks

solar stirrup
#

I wanted to ask, why should I use smart pointers for what I'm trying to do? -snip wrong ping sorry Zino-

#

@winged badger

#

Never had to use them before, I'd love to understand their benefits

winged badger
#

i said i was using weak pointers

#

prefer not to have strong pointers in structs

#

as in TWeakObjectPtr

pearl fog
#

lol

winged badger
#

not smart pointers

pearl fog
#

np ^^

#

and yes always use weak pointers if you don"t want your struct to keep your UObject alive

ember needle
#

server cannot see clients moving, clients can only see self and server

meager horizon
#

What's the best way of preventing automated bot registrations for a multiplayer game? I'm thinking registration should be a web page and the game should present a web browser widget, then put recaptcha on the form

#

Is there any better way?

#

@ember needle who spawned the actor with the capsule component?

#

The server, or the client?

ember needle
#

server

#

anyway i did my own angular velocity function..

ember needle
#

Good evening everyone. Hopefully someone can give me a direction here, because I cannot grasp best practices.

I use FP animations for owner character with a FPS setup, and TP animations for other players. I also have the ability to set Aim Down sight, which uses a secondary camera placed on the gun.

I have a "bullet emittor" on the gun, and I trace from there. One issue is that if not in Aim Down Sight, I don't necessary shoot at the center of the screen.

As in standard multiplayers, I compute all effects locally (firing SFX and also bullet impacts), and multicast only damage (if any).

The issue is: the position of the gun is different on my FP and TP animations, so clients do not see similar local results of fire effects.

What is the correct approach I should be taking?

steady cape
#

I think it kinda depends on how exactly you did whole this system. But first solution I can think of - just adding another SFX runner at end of TP's gun, and handle visibility of it with "IsLocallyControlled"

ember needle
#

?

#

the question is how do you match FP and TP ray tracing results

steady cape
#

Match? Why though?

#

Just do one, that's enough

#

You probably should do it on clients. This makes easier for player to shoot

#

I didn't understand you otherwise

twin juniper
#

For dedicated server, If I dont use single process and play in editor

#

would I come up to different results when I build it ?

#

I am asking this because game is over 20gbs

sweet atlas
#

hi. im trying to make a top down shooter with WASD + mouse controls. i want the players to rotate toward their "target position", which is set to the position under the mouse. so that's only on the clients. how would i get that onto the server and the other clients? do i have to use RPCs? im new to multiplayer in UE4. it seems replication is only for data going from the server to the clients. is that right?

sweet atlas
#

im now setting a targetposition on the owning client, then using an rpc to send it to the server. the targetposition property is set to replicate, though. meaning that the owning client will get that data back from the server. kinda weird... but it works.

rotund sapphire
#

Dividual check pinned messages, look for exi's network comp

sweet atlas
#

ok, thanks, @rotund sapphire

meager horizon
#

Has anyone got clear documented list of how play in editor "run dedicated server" differs from an actual dedicated server build target?

#

Someone said there are differences, but not what they are

rotund sapphire
#

cooked server usually set to run at 30fps, but in editor it may tick in sync with editor. it probably better to run editor tests in 'standalone' mode once in a while. you can untick the single thread mode in advanced settings, it will allow you to run 2 player test with dedicated server from editor that kinda feels like a cooked game (except it load slow until you cook)

meager horizon
#

Ah, I've seen that setting

rotund sapphire
#

navmesh in cooked dedicated server may not recast, i think they didnt fix it yet

meager horizon
#

I was tempted to tick it, but I'm concerned I may not have enough ram to run 3 instances of the game, plus editor, visual studio and all the other stuff I run at the same time

#

Usually for a real world test I cook and build and rsync it to my Linux server then get a friend to test with me

rotund sapphire
#

you can do standalone play mode from windows commandline by running the editor with either -game or -server params and specify the uproject

meager horizon
#

I need to learn how to do unit tests with inputs, like a repay of input to multiple pawns

proper idol
#

@rotund sapphire can you elaborate a bit more on the navmesh recast on dedicated server? cause that is exactly what i came here for to ask. my navmesh does not work at all on a dedicated server, however, the same map on single player works.

rotund sapphire
#

that should bring up a runing game for you, either server or client

#

@proper idol there are many type of issues, the one i mention is happening when you make changes to an instanced mesh component, it won't trigger navmesh to rebuild and fill the holes. Instead it will keep the holes as it was. I think you also need invoker for this issue to occure. Tho it may never recast the mesh actually didnt test without invoker.

#

been report this issue a year ago probably unresolved lost track of it

#

as a quick fix i decided to spawn static mesh components in stead of hism (on dedicated server only) those will trigger recast. had to modify character to not freak out when standing on differet type of components.

proper idol
#

ok, well that issue seems to be somehow related to mine, but not quite. i am using the vr template and on a dedicated server, my locomotion does not work. maybe i need to modify the locomotion blueprint, no clue, but it does not seem to find a nav mesh at all when it is dedicated. listen server and single player works.

rotund sapphire
#

its possible a setting is disable navmesh generation on server, worth looking around

#

tho in my case i had a navmesh, it just never rebuild when changes occured to it

proper idol
#

ok, thanks for the hint, i will be looking for settings it in the details panel.

rotund sapphire
#

also check project/editor settings

proper idol
#

another issue is i have this blueprint here: this does not trigger the second print string node, only 1st and 3rd. its on the motioncontroller blueprint from the vr template. these motioncontrollers are spawned in at mapstart and get attached as component to the vrpawn blueprint instance. on vrpawn all 3 nodes are reached. but why. something is wrong with the replication it seems.

#

oh, and again, this only happens when its a dedicated server, listen server works fine.

rotund sapphire
#

you maybe have issues with authority, /o actor not spawn on server

proper idol
#

ah true, that could be a route to success, will try it tomorrow and give feedback, much thanks 😘

sly arch
#

So to start a steam dedicated server I have to have steam on? I get an error in the console if I don't. Is this normal?

solar stirrup
#

@winged badger hey, just a quick question linked to our discussion earlier, do you replicate the TArray<UMyObject> too?

#

Because apparently UE4 doesn't like UPROPERTY(Replicated) on an array of non-pointer objects

#

actually, NewObject returns a pointer, so I actually need to have it be an array of pointers, right?

#

👀

hoary lark
#

that's right, as you started to touch on over in cpp, unreal convention is that storage/variables for any UCLASS classes have to be by pointer and storage/variables for any USTRUCT types have to be... not by pointer

solar stirrup
#

feels weird but i'm just being stupid

#

I forgot NewObject returns a pointer anyway

winged badger
#

i have a TWeakObjectPtr in my FFastArraySerializerItems

#

and a non replicated TArray in the same object the fastarray is a member of

#

i keep the TArray in sync with fastarray with callbacks

#

the TArray is not a member of FFastArraySerializer or the Items

#

ultimately making the sole and only purpose of the fastarray to keep the clients in sync

normal garden
#

Why does destroy actor not work on the client? How would I go about making it destroy the actor when called from a client?

#

Already asked in blueprints lol

ocean geyser
#

@normal garden are you trying to destroy the actor for everyone or just the one client?

normal garden
#

everyone

ocean geyser
#

make a call to the server passing in a reference to the actor your trying to destroy, then have the server execute a multicast that destroys that actor

normal garden
#

Alright, I'll try that

ocean geyser
#

or maybe you dont need to perform a multicast and destroying it on the server will be enough

normal garden
#

I tried destroying it on the server, it doesn't seem to work

ocean geyser
#

then might need to be multicasted

normal garden
#

@ocean geyser Something like this?

#

Hold on do I even need the Switch has authority node?

ocean geyser
#

are you on the server when your trying to destroy the actor? why are you using the authority check node?

normal garden
#

I do think I am on the server, yes, and I just deleted that node as I realized I don't need it

rain sandal
#

if you were on the server the destroy would work

ocean geyser
#

if your on the server, keep the authority check node and call the destroy actor, no need to call a server rpc from the server

normal garden
#

Doesn't seem to work

#

So does that mean I'm not on the server when calling this?

ocean geyser
#

do an authority check and print out a string to see if you are

normal garden
#

From the server the string prints

ocean geyser
#

then your on the server. if destroying an actor on the server doesnt work for other clients you may have to multicast that destroy (not 100% sure if you do or not)

normal garden
#

Okay, well multicasting doesnt work

rain sandal
#

you don't need to MC destroyactor

ocean geyser
#

well that answers that

rain sandal
#

something more fundamental is wrong

solar stirrup
#

@winged badger by callbacks you mean the fast array add/changed ones right?

winged badger
#

and remove, yes

solar stirrup
#

awesome

#

only issue I see is listen server hosts since they dont trigger those callbacks

#

I'll work around that

meager horizon
#

so i decided to make my registration use the experimental web browser widget so i can use recaptcha v2 on it

#

seems to work ok, is there anything i should be aware of doing my registration this way? (not technically related to ue4's multiplayer, but multiplayer games with registration in general in ue4)

ocean geyser
#

send the information to a server to interact with the DB, dont have the client access your DB directly. other than that thats about it

jolly siren
#

Anyone know how I can artificially add latency to one characters movement? I want one character to move behind reality a bit during replay playback

sly arch
#

To start a steam dedicated server I have to have steam on? I get an error in the console if I don't. Is this normal?

normal garden
#

@ocean geyser @rain sandal Thanks for trying to help, I figured it out, seems to be working.

polar wing
#

Ok I have confirmed that there seems to be something horribly wrong with network performance in PIE going from 4.21 to 4.24. Been seeing some complaints around the net about it. I was wondering why the number of corrections grew exponentially since the upgrade. Plus, started getting the "move queue of 96 moves is full" output warning in 4.24 that does not occur in 4.21. I checked to see what changed in the backend between 4.21 and 4.24 with regards to move acking, corrections, and whatnot, but can't see any significant changes. Anyone have more luck identifying the issue?

#

Something that works completely fine in 4.21 is inexplicably unplayable in 4.24. I haven't tried a packaged project yet, but having to package the project every time you want to test something isn't very appealing hahaha.

rare gyro
#

Try upping the network bandwidth settings, plus cap your servers max tick rate

#

@solar stirrup Have you taken a look at FVariant? In our item system I use it for a basic replicated key value system, you can store any value with an FName key. Replicated, serialized the whole shebang

winged badger
#

we got network saturated after the 4.22->4.24, our designed team played with network settings and got them all messed up, but somehow it didn't affect the 4.22 as much

rare gyro
#

Example: Item.GetProperty<float>(TEXT("SomeFloat"), OutFloat)

winged badger
#

one of our trash mobs was always relevant with net priority 100, after the game spawned 40-50 of them took ages for normal priority actors to panic enough to get replicated

solar stirrup
#

I'll check it out

solar stirrup
#

Do all replicated properties of a same object replicate at the same time?

chrome bay
#

yeah

solar stirrup
#

I was getting scared of getting race conditions by having two replicated properties with one that points to the contents of the other lol

#

Is it possible to change the Outer of a replicated UObject in order to "transfer" ownership so that the new component that handles it can replicate it as its own subobject?

chrome bay
#

There's no guarantee they'll arrive at the same time.

#

If you want them to arrive at the same time, put them in a USTRUCT()

solar stirrup
#

Can I replicate an array of uobjects inside that struct from within my component?

#

Component -> Struct -> Array of UObject

chrome bay
#

the uobjects themselves should use the actor as the outer

#

The objects will be created with the actor as the outer on the client side when they are received anyway

solar stirrup
#

so not the component but the owning actor?

chrome bay
#

yeah

solar stirrup
#

aight

#

is it possible to transfer objects though? if I drop an item, I need the "item container" actor to handle replicating its uobject

#

simple solution would be creating a new uobject with the container as the outer and copying data, but that doesn't sound very optimal

chrome bay
#

You have to use UObject::Rename() to change the outer

#

But to be honest

#

You would then have to change the component outer as well

#

And I wouldn't expect that to work easily

solar stirrup
#

So I guess new object + copying data is the easiest way

chrome bay
#

Easiest definitely, but most efficient probably not. You'll have to try it with Rename() - but I wouldn't expect it work out of the box tbh

solar stirrup
#

Alrighty

chrome bay
#

But changing component outers is kinda weird anyway

#

I'd just make the item container an actor in that case

solar stirrup
#

the item container is an actor

#

it acts like you'd think for items dropped on the ground

chrome bay
#

Oh I see, yeah then to be honest I would just create a new object unless Rename() works

#

It might be okay, but I can immediately see potential issues with the actor channel data buffer overflowing on read/write and causing a crash. hard to say

solar stirrup
#

I'll try it out

#

If it's too unstable I'll just go with newobject

chrome bay
#

NewObject and a generic CopyProperties() function

solar stirrup
#

NewObject would be a bit more annoying though since I'd have to add a way to copy data, and things like timers must be quite the hassle to copy

chrome bay
#

well timers you would have to clear and setup again

solar stirrup
#

yeaaah

#

more time consuming than hard

chrome bay
#

idk, rename might work, it might take care of the reflection issues for you - but I really don't know

solar stirrup
#

guess i'll try it and see™️

rocky totem
#

stupid question but is this legal?

int AMyClass::GetServerStuff(){
  if(Role < ROLE_AUTHORITY){
    return Server_GetServerStuff();
  }
  return GetServerStuff_Internal();
}

int AMyClass::Server_GetServerStuff(){
  return GetServerStuff_Internal();
}

int AMyClass::GetServerStuff_Internal(){
  return 0;
}

if I call GetServerStuff() from the client will I actually return 0?

chrome bay
#

no

#

Won't compile

#

RPCs can't have return values, since they take time to execute

#

and ofc you can't block the whole gamethread while you wait

bitter oriole
#

Yup, you'd have to block for the entire ping time, which is multiple game frames.

#

Instead, the server should simply replicate Stuff

#

No RPC even needed !

#

Server-to-client communication is always much easier and safer through replication.

rocky totem
#

ok fair enough it's just that this is one time call

#

that isn't relavent to everyone

chrome bay
#

You can always send a client RPC back if you must, but given the latent nature, instant returns from them aren't possible

rocky totem
#

ok makes sense

bitter oriole
#

Not relevant to everyone => replication allows filtering

chrome bay
#

But tbh, even then you could use COND_OwnerOnly with a replicated property

bitter oriole
#

Just one time => same

chrome bay
#

^ yeah

#

Since a ClientRPC will only execute on a client-owned object anyways

bitter oriole
#

If the value only changes once - the replication will only occur once. Make it Owner Only, and you got yourself a very easy, always reliable server-to-owning-client channel

#

I try to avoid using client RPCs because you need to handle things like what if you join after the RPC was called etc

rocky totem
#

ok so if the class had a variable called int ServerInt and was DOREPLIFETIME_CONDITION(AMyClass, ServerInt, COND_OwnerOnly) then whenever that variable is changed by the server it will replicate down?

bitter oriole
#

Yes, only to the owning player

rocky totem
#

ok so the use case is allowing players to get a list of saves on the server in order to load them

#

i know HOW to get the list locally but i'm stuck trying to send the data to the clients that are looking for it

bitter oriole
#

Simply replicate an array of save data structures

#

You'd use a boolean in the structure to mark it as non empty

#

So the clients can wait until at least one save is non empty

#

And you know the data is there

rocky totem
#

so on the player controller I have

UPROPERTY(Replicated)
TArray<FString> ServerSaves
bitter oriole
#

If you save data is a string, sure why not.

rocky totem
#

and then I have just a single rpc to the server called something like refresh saves

#

Honestly i just need the file names since the server will be in charge of loading them anywya

bitter oriole
#

You don't even need the RPC.

#

Just update the save list on the server, and you can use ReplicatedUsing to know on the client that the saves were updated to re-draw the interface, for example.

#

Or keep a previous list and compare them

rocky totem
#

so

APC::RefreshSaves(){
  if(Role == ROLE_AUTHORITY){
    ServerSaves = //do stuff here
  }
}
#

like that?

bitter oriole
#

Or just

  Super::beginPlay();
  if(Role == ROLE_AUTHORITY){
    ServerSaves = //do stuff here
  }
}```
#

Seriously, no need for RPC

rocky totem
#

ok but then how would i refresh the server's view of it's saves if another one is made

#

do i need an rpc to tell the server it's time to update?

bitter oriole
#

The server is always going to be the one changing its save data

#

So, like, just write ServerSaves at that point

#

I mean, put it in the GameState if it's public data, no need to even be PC-specific

#

You could even list the save data every single Tick on the server - as long as the data itself stays the same, no replication will occur

rocky totem
#

and then if, for example, I make a new save the new tick, the server would update the gamestate and then it would be replicated to all of the clients

  Super::Tick(DeltaTime);
  if(Role == ROLE_AUTHORITY){
    ServerSaves = //do stuff
  }
}```
#

like that?

bitter oriole
#

Yeah, sure

#

Basically try to avoid event-based code because it's very easy to miss events, or have the timing of events change based on performance or engine versions or latency

#

Instead, try to work from the data directly

rocky totem
#

ok instead just have replicated variables?

#

and just constantly be sharing data everytime it updates so you can work as if the data were already there

bitter oriole
#

Yup @rocky totem

rocky totem
#

ok i think I have identified the real question i should have been asking. If i have a variable that is COND_OwnerOnly, How does the server know who the owner is. I'm jumping through source files trying to comprhend it and i haven't found the piece that makes sense

#

and how would i as a the client say I would like to change this (like ammo in a gun)

bitter oriole
#

The owner is the PlayerController ultimately owning the object

#

Basically you call GetOwner() on something, then GetOwner() on that something, until you get either nullptr, or a player

#

If it's a player, congratulations, this player can RPC, and will get COND_OwnerOnly updates

#

This is true of player controllers, player states, possessed pawns, actors spawned with a PC or PS as owner, anything you did SetOwner() on with a PC or PS

#

A weapon owned by a pawn owned by a PC will be 'owned' by the PC as far as multiplayer is concerned

rocky totem
#

ok so then if i call fire on that weapon. then the server handles the actual process of firing and says decriment the ammo. And since the weapon is owned by the player only that player's ammo will decrease

#

right track?

chrome bay
#

correct

#

If another player becomes the owner of the weapon, the variable will replicate to them.

jolly siren
#

Does anyone know if there is a way to add artificial latency to one character's movement? For example, if I wanted that character to move according to a different ping than it really has? Or am I going to have to store an array of transforms and hack CMC apart to have it use historical transforms instead?

steady cape
#

Cam and spring arm config is the same as in "Third Person Character"

stable kindle
#

So i have movment component that is basically a stripped down version of the character movement component. what would cause my server to be spamming time stamp expired messages ?

#

conversely im also not getting corrections on the clietn

#

client *

rocky totem
#

@bitter oriole you mentioned that i should just put the server saves directly on the gamestate so it automatically replicated. That means i don't have to mark it as replicated correct?

bitter oriole
#

No, it's not automatic, you need to mark it still

#

It's just an easy to use class that everyone can access

rocky totem
#

ok makes sense

#

and the replicated using are fired AFTER the replication has happened correct?

grizzled stirrup
#

Should DetachFromControllerPendingDestroy(); be called on both client and server, or only the server?

#

In the case where you are cleaning up a pawn that will soon be destroyed

polar wing
#

Does anyone know if there is a way to add artificial latency to one character's movement? For example, if I wanted that character to move according to a different ping than it really has? Or am I going to have to store an array of transforms and hack CMC apart to have it use historical transforms instead?
@jolly siren Hmmm, not sure if it'll work super well, but you can give it a go. There's a built-in command you probably know already (net PktLag = XXX). You can try run that command as a command line execution from within your c++ code/BP for a specific actor. I'm just not sure how it'll behave in a packaged game. Just the most simple way I can think of, beyond adding in a general movement/action delay with timers.

jolly siren
#

I don't want to add lag to the entire game. Just one character's movement. The local character's movement during replay playback

#

I have a local replay that I playback from the point of view of the killer (simulated proxy). So the victim (autonomous proxy) is ahead of where the simulated proxy thought they were in it.

polar wing
#

Ohh, I get you, so like a pretty normal killcam type situation. You can maybe check out how ShooterGame or Unreal Tournament does it.

jolly siren
#

yeah, theoretically I should be able to just lag the local player (victim) movement behind by the killers ping

rich ridge
#

Any ideas why in editor game runs t 30 FPS when dedicated server option is ticked.

#

Else game runs at 60 FPS.

#

My PC is really highend, intel i7-8900k, 48GB RAM.

#

1TB Samsung 970 Evo SSD

#

Hardware shouldn't be constraint here.

grizzled stirrup
#

I notice a large drop in performance with that checkbox too @rich ridge

#

It may just be the editor with hidden windows (often have the same sluggish performance if I have the material editor open on another screen for example)

rare gyro
#

@stable kindle mismatches between client and server can cause expiry messages. We've tried exploting the Character Movement Component with cheat engine speed hacks, and I noticed that our dedicated servers get spammed with expiry messages.

rich ridge
#

@grizzled stirrup Does is work smooth with actual dedicated server.

grizzled stirrup
#

Yes the actual server is on a remote machine anyway

#

So there'd be 0 performance cost there

#

Not on that machine but on your local client

rich ridge
#

ok cool

rocky totem
#

@bitter oriole is my logic of program flow right assume the boxes are buttons

gleaming vector
#

is there a function that is called when an actor becomes relevant on the client?

winged badger
#

depends if its loaded from the package or not

#

you could stash the last update timestamp during prenetreceive

#

and then decide it became relevant if the time from last update was suspiciously long

#

non-relevant actors that aren't loaded from the package get spawned in

#

those loaded from the package just get a full update afaik

gleaming vector
#

That seems like the long way around

#

But ok

rocky totem
#

can you have a static RPC?

solar stirrup
#

Nope

#

How does one replicate a struct with two properties that need to be replicated

#
USTRUCT()
struct FInventorySerializedPair
{
    GENERATED_BODY()

public:

    UPROPERTY()
    FFastInventoryArray FastSerializer;

    UPROPERTY()
    TArray<class UFunctionifyObject*> Objects;
};

Made a struct since I need the component to replicate both of these properties at the same time

#

oh wait, it only needs to be UPROPERTY() right?

fleet raven
#

grouping these in a struct will not ensure atomic updates

solar stirrup
#

is there a way to ensure that then?

fleet raven
#

the only way would be to have a custom net serializer on your struct and always write the values together

solar stirrup
#

is there documentation on the way I could achieve this?

#

I'd need to write custom serialization for object pointers which would probably be a pain in the arse

gleaming vector
#

@fleet raven from experience that is not true

#

structs are serialized together by default

fleet raven
#

it can skip serializing the latter property when the bunch is full

gleaming vector
#

oh, that's what you mean

#

yeah

#

that can happen

#

but if any value in the struct changes, the struct is marked dirty

#

and the whole thing is marked for rep

fleet raven
#

so, it probably works, most of the time, but it's not guaranteed to work, and you'll likely never find the issue when it doesn't

solar stirrup
#

dangit

gleaming vector
#

but zeblote is right, override netserialize

solar stirrup
#

How would that work?

#

FastSerializer is a fast array serializer which implements NetDeltaSerialize, wouldn't overriding netserialize screw that up?

fleet raven
#

it probably doesn't work when you have the array serializer aswell

solar stirrup
#

this is annoying (╯°□°)╯︵ ┻━┻

#

hmm ┬─┬ ノ( ゜-゜ノ)

fleet raven
#

why not just replace it with one array

solar stirrup
#

How would that work though

fleet raven
#

dunno, it depends on what this is actually representing

solar stirrup
#

I guess I could keep hard references to the UObject pointers in the fast array serializer items

#

Having it work would be something else thinkingHD

#

I'm certain I'm missing something because I would probably have tried that before if there wasn't a reason I'd go for an array alongside the serializer

#

Would having a TSharedPtr of the object in the fast array serializer item cause any issue?

fleet raven
#

you can't replicate that at all

solar stirrup
#

oh right

#

I didn't put the uobject in the fast array serializer because you can't replicate uobjects without custom replication can you

#

you have to use ReplicateSubobjects

rocky totem
#

my current understanding tells me that if i ever want the server to execute a function at a specific time and I am not currently the server I use an RPC exactly as i otherwise would

#

so instead of calling save I would call the server rpc Server_Save correct?

#

if i want that function to be modular where should it be located? I feel like it's kind of a rules thing which makes me think game mode but it's called from the player so the call will get dropped since the server owns the game mode. At the end of the day it getting initally executed via a button on a widget which would be owned by a player but that then would make it useable only by that widget. I feel like my player controller class is getting really clogged up with just server rpc's but that may be normal I've never done a multi user thing before. So my question is where should i put Save() and Server_Save(). and if the answer is a savemanager object where do i put that save manager such that it can be called from a client

ocean geyser
#

@rocky totem depends on what you want to save. have you looked into the player controller?

rocky totem
#

i'm generating a savegame based on the objects in the level

#

and like i said i just feel like the pc is getting bloated with all the rpcs but maybe that's normal

elfin tartan
#

I suppose this is the right channel for this. Got an issue I've been trying to solve. Decided to test out some multiplayer (clients) level streaming during runtime, and it doesn't seem to work at all. I found this thread (old) which has some nice BP features that were added to Rama's Victory Plugin. So using Victory Plugin 4.23 it seems to not be working. If anyone has any information on this, please let me know (or let me know in the thread.)

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/102757-dynamic-level-streaming-with-multiplayer-support?p=1730107#post1730107

drifting plank
#

Hello Slackers!
I'm wondering about how to setup my controller and pawn input management.

Is that better to put the input bindings inside the pawn or inside the controller ?
I should have multiple pawns in my game with different type of controls (character, vehicle, ...) and I should prefer to keep only one controller (to have common input like menus or stuff like that)

I know that there is the InputComponent which could help. So the good choice seems to put the specific input bindings inside each pawn even if that's the same input like "MoveForward" or "Turn" for instance.

#

What did you think about that?
Thanks for your help

solar stirrup
#

Up to your preference but I usually have the input in the controller @drifting plank

#

Got a quick thereotical question

#

Lets say I have Array A and Array B both replicated

#

Array B has a new pointer added to it

#

Array A has an item that contains a pointer to the new item that was just added to Array B

#

Array A is replicated first

#

Will the pointer in array A on the client be invalid until Array B is replicated to the client as well?

terse forum
#

Can someone please help me figure out the solution to this problem with Updating Max Walk Speed based on Widget Button Click Event.
Things seem to work fine on for the Server Player (speed change seems to be applied to the Server Player Character and thus reflected in Server Window and in Client Window)
Things don't work though for the Client Player (speed changes don't seem to be applied when viewing the Client Player Character via the Server window, but there is stuttering of the Client Player Character via the Client Window)
The best I can deduce is that this is an Authority Issue in my Blueprint

#

So I guess my question is how do I properly pass the request from client to server so the actual max walk speed of the client is actually updated?

#

This is the testing of the Speed Skill in question ...Working for Server Player in both window, but not working for Client Player
(Note: the speed change is exaggerated to show application)

clear valve
#

oookay guys, you are going to have to help me out for a bit.

If I have a USTRUCT where UPROPERTIES are not marked as Replicated, and the user uses that struct in his blueprints and checks 'replicated' there, does it work?

#

or generally, how much of a C++ plugin's runtime module will be networking-compatible if networking was never considered (no replicated properties etc.)

#

given that I have done exactly 0 with networking in Unreal I have no clue at all

solar stirrup
#

it'll replicate them

#

@clear valve

clear valve
#

thanks, good to know. What is the replication property for then, if it's unnecessary to specify them?

hoary lark
#

classes

#

structs "invert everything", there's a NotReplicated specifier for struct UPROPs

clear valve
#

lmao good to know, thank you. Function calls have to be marked explicitly then I take it?

#

(or is only data replicated? 🤔 )

hoary lark
#

yes, there is a special set of UFUNCTION Specifiers for RPC functions in classes (obviously none for structs because you're not supposed to put functions in structs)

#

read eXi's doc in pinned links if you haven't yet 😉

clear valve
#

okay, thank you. This is probably enough for now. Have to submit an entry to marketplace on behalf of my company and with about 150 cpp classes and no experience in that matter it's hard to gauge for me 😂

#

I actually didn't. Shame upon my head. Will take a look

rocky totem
#

when the ReplicatedUsing function is called is the variable already changed?

jolly siren
#

yes

rocky totem
#

thanks

#

if i reserialize an actors data from a savegame on the server will all of the data replicate to the clients ASSUMING the actor was set to replicate if (A->GetName().Compare(ActorRecord.ActorName.ToString(), ESearchCase::CaseSensitive) && A->GetClass()->GetName() == ActorRecord.ActorClass) { FMemoryReader MemoryReader(ActorRecord.ActorData, true); FNeoSaveGameArchive Ar(MemoryReader); A->Serialize(Ar); A->SetActorTransform(ActorRecord.ActorTransform); break; }

rocky totem
#

can i call and RPC to the server from a widget?

jolly siren
#

Route through the playercontroller

solar stirrup
#

To replicate an array of UObject I need to iterate through it in ReplicateSubobjects right?

rocky totem
#

@jolly siren so it it normal for my playercontroller class to just beblock after block of RPC's

jolly siren
#

yes, you can break it out into uobjects/actorcomps if you want. But it's normal to have a lot of rpcs in your PC

rocky totem
#

ok just looking at it i'm thinking MAN comments are saving my life to navigate this wall of calls

winged badger
#

if you do a discord search here, im fairly sure you could find the exact code samples

bronze arch
#

Btw there is no way to access a game session runtime with BP?

#

Just saying, if not then its fine.

#

otherwise it would be easy to make my function

grizzled ether
#

Has anyone had success getting the UnrealInsights 4.25 network profiler working? How does one go about enabling it?

thin stratus
#

@bronze arch Correct

bronze arch
unique kelp
#

Sort of unrelated to unreal specifically, but is there a reliable way of generating unique order IDs for steam microtransactions?

winged badger
#

FGUID

unique kelp
#

How is that different from just generating a random int? and I will only use 64 bits anyway so going the random way seems like collisions waiting to happen

#

Not that I think this game will even have a single micro transaction actually happen, but I need to plan just in case

winged badger
#
What are the odds of a GUID repeating?
How unique is a GUID? 128-bits is big enough and the generation algorithm is unique enough that if 1,000,000,000 GUIDs per second were generated for 1 year the probability of a duplicate would be only 50%.
unique kelp
#

but I can only use 64 bits, since that is what the steam order IDs are

#

Still, I will probably go that route, and just have users wait for a new one if there is a collision

winged badger
#

within a scope of the application something like

#
struct FUniqueID
{
   GENERATED_BODY()
public:
  static uint64 ID;
  static uint64 GetNextID()
  {
    ID++;
    return ID;
  }
}; 
#

would work, problem is you have nowhere to put it globally

unique kelp
#

yeah, if I had a single server that could initiate the orders, that would work

#

but that's not the case, and using a database would just introduce a race condition

#

i'll just go the random way and retry on collisions

#

thanks

winged badger
#

you could probably encode a MAC address into the ID

#

then only chance for collision would be with oneself

unique kelp
#

and each machine would be able to make around 2^16 purchases

#

not bad

frigid bluff
#

if I construct a component on the player controller via ConstructSubobject(), would the server also have a copy of that component since the PC exists on both owning client and server?

green cedar
#

How can I replicate a spring arm component that follows pawn control location?

winged badger
#

@frigid bluff generally yes, i assume you're doing it in a constructor, in which case its just yes

potent cradle
#

I feel silly, but I'm running into an issue where running the logic below gets all of my clients to look through the same camera:

#

I was under the impression that player controller 0 is always the local player in multiplayer? This BP is run from the client.

#

Strange. This logic is called on BeginPlay. I noticed that if I call the same logic again after the issue occured, it works fine. So I added a delay of 1 frame before the logic is called on BeginPlay, and now it works fine.

#

Not quite sure what's going on under the hood 🤔

narrow prairie
#

@potent cradle use get controller

green cedar
#

get controller/get player controller seems to act weirdly on listen server vs. dedicated

narrow prairie
#

get player controller = used for local multiplayer

green cedar
#

Unless I am doing something wrong on possess, my 'get controller' did not work on the listen server.

#

listen server client, that is

#

had to do some weird wiring to fall back. 'get player controller 0' on the listen server client pawn worked the way that 'get controller' worked on the client pawns. but again, that may just be something wrong

narrow prairie
#

hmm,. what i use myself is get controller

#

cast to ur player controller

#

in widgets i use get owning player controller or get owning player pawn

green cedar
#

I also may just be somewhat confused with the PC server/client instances and using the wrong one to possess on the listern server

narrow prairie
#

i dont know,. game mode should handle spawning

#

event postlogin

#

this is a old tutorial

#

but explains a lot of good information

thin stratus
#

sigh this is still the worst resource you can use.

#

@narrow prairie

#

They do sooooooo much stuff totally wrong

#

@potent cradle BeginPlay of what?

#

BeginPlay of a pawn that you are possessing?

#

That would be too early. Cause BeginPlay calls before you possess. you need to use OnPossessed or whatever the event is called. Also viewtarget should be handled automatically if you didn't turn that off.

narrow prairie
#

@thin stratus i know it might not be the best resource, but i was more about onpossed part

#

if u have a better resource, pls enlighten us

thin stratus
#

For starters my network compendium

#

After that you can dive a bit into that tutorial series but I'm still afraid replicated playercontroller arrays in the gamemode might confuse peeps.

unique kelp
#

what would that even replicate to?

chrome bay
#

nobody 😄

potent cradle
#

@thin stratus BeginPlay of my character, indeed. Which is the same blueprint that is used by the two other actors that are spawning.

#

Oh, actually, that only seems to be called on the server?

#

If I put a print after possessed, there is no output visible from the client, only the server

thin stratus
#

Yes that's server only. Client RPC helps here

#

If you have a access to C++, then you could use/expose the OnRep_Controller function, which would call on the client.

#

@potent cradle

#

@unique kelp Yeah, nobody, it's complete nonsense. They also have RPCs in widgets in that tutorial.

potent cradle
#

Server possesses -> Server calls an RPC OnOwningClient -> Client does camera magic?

#

If you have a access to C++, then you could use/expose the OnRep_Controller function, which would call on the client.
BPs for now 😄

twin juniper
#

What is the best way to start with multiplayer, what tech should i use? I see there are different ways to reach a multiplayer game goal. Photon Networking, Unreal Multiplayer, Steam multiplayer etc

chrome bay
#

UE4's built-in networking is all you need

#

Steam etc. are just backend services that work behind the scenes

twin juniper
#

Okay, could you send me a url where i can learn it? So maybe you would recommend a specific video or something else for learning the concept and Usage of it 🙂

potent cradle
#

That worked Cedric, merci 🙂

chrome bay
#

@twin juniper to be honest, usually if you're asking that question it means you should probably start with something simpler. Multiplayer is a minefield and not really not easy, starting with it straight away usually ends with getting nowhere.

#

There are example MP projects on the UE4 launcher you can look at, Cedric has a network compendium which covers the basics and then some

#

Most online tutorials are out of date as soon as they come out, including Epic's own ones to be honest.

twin juniper
#

Ive already did a lot of networking Projects. but not in Unreal Engine. Ive learned the basics of blueprints and other stuff in UE4 so i think i can start learning networking in ue4

chrome bay
#

follow UE4's starter tutorials to start with. I don't have a link though, there's a lot of content out there

#

Maybe look at the "multiplayer shootout" sample project in the launcher

twin juniper
#

i am not a beginner in the Development of Games. Just a newbie in UE4 but my knowledge is "enough" i guess

solar stirrup
#

How does one use ReplicateSubobjects to replicate an array of subobjects? Just iterate through the objects?

#

Like this?

for (UObject* Obj : MyObjects)
{
  bWroteSomething |= ActorChannel->ReplicateSubobject(Obj, Bunch, RepFlags);
}
chrome bay
#

Channel->ReplicateSubobjectList(Array, *Bunch, *RepFlags);

#

e.g:

{
    bool bWroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
    
    bWroteSomething |= Channel->ReplicateSubobjectList(Slots, *Bunch, *RepFlags);
    return bWroteSomething;
}```
solar stirrup
#

ayy

#

thanks

#

Does it work for replicate a property of a replicated struct?

#

The array is located within a struct of my component I marked as UPROPERTY(Replicated), so would doing bWroteSomething |= Channel->ReplicateSubobjectList(MyStruct.Objects, *Bunch, *RepFlags); cause any issue?

meager spade
#

i wouldn't do that

#

i would iterate ever object, not sure how well it handles Array of Objects

solar stirrup
#

I checked the source, that function is basically a templated iterator that calls ReplicateSubobject

quartz anvil
#

can anyone explain how dedicated server works in unreal, does dedicated server works outside of network (not local?). so for example i want to create a simple game like online multiplayer, i want to play and join any user from worldwide, what is the initial steps to create multiplayer game?

#

i want to create a real online multiplayer game (not local). what is the steps to start?

#

should i need to host a server?

#

@meager spade any guide? please help

wise depot
#

if anybody here has done work with xbox sessions with ue4 please pm me, i have an issue that i'm not sure how to resolve

spring pasture
#

Hey guys , so I'm having an issue with seemless travel and getting players from a lobby into a match.

Currently if i load into the match with just one player (that being the server) everything works fine.

if i try load into the match with two players ( the server and connected client) the UI doesn't get loaded and no inputs are registerd on both players. Resulting
in the pawn not being able to move.

Everything else concerning the game mode works as intended, the players load in and spawn in the correct places to.

Didn't know if anyone had any ideas, run into something similar or could point me in the right direction? i can provide screenshots of the blueprints if needed.

barren warren
#

Are you by any chance using 'get controller (0)' or 'get player (0)' @spring pasture? I know we've run into a couple of issues similar to that where that was the root cause

spring pasture
#

when i use seemless travel to load the map i believe i am yes

#

ill try it without , thanks 🙂

velvet dune
#

can anyone help me get it so it show the map name and server name correctly plz

quartz anvil
#

does anyone know how to create a simple online multiplayer game (not local multiplayer), like user can play and join game via session at anywhere

#

so my question is does steam multiplayer works local or worldwide anywhere?

rain sandal
#

Anyone tried to get UnrealInsights to work, I'm running 4.25 from launcher, loaded the UI.exe. When I load a project I don't even see anything appear as a live trace target. I'm running the exe on the same machine as well.

thorny saddle
#

hi guys i want build server like rust or Conan games for my game and can't find any tutorial anybody can help me ?
i want to create dedicated server
please tag me if u answer my question TY.

thorny saddle
#

thanks i will check it later if i will have problem can i ask you my issue ?
@ocean geyser

#

srry for my eng if i write wrong words 😑

ocean geyser
#

im not super familiar with making a dedicated server as ive never done it before

mystic pilot
#

Anyone had issues with SteamSockets and non-seamless map changes?

winged badger
#

everyone who tried iirc

#

just isn't meant to work that way

mystic pilot
#

Oh, good, so I'm not alone 🙂

#

If only I wasn't having trouble with seamless travel at the moment :|
sigh

winged badger
#

seamless travel works fine

#

its non-seamless thats problematic combined with steam sockets

mystic pilot
#

Seamless travel works fine, except in our case, after a 2 or more map changes, UE4 complains about netguid and other such stuff and weird things start to happen.
Started in UE4.23.
Before that, fine.
Not sure what changed 😐

#

I actually worked around the non-seamless issue, but then the packaged server would crashing if 2 or more people were online and you changed the map.
Very confusing.

#

On map change, SteamSocketsNetDriver changes from looking for SteamSocketsP2P to SteamSocketsIP when looking for an address to bind to.
If you log off Steam before the map changes, then log back on after the new map loads, it finds the correct address.
Kinda silly, but it works 😐

cerulean escarp
#

heyo, I've been trying to figure out an issue for a few weeks now but I can't for the life of me figure it out. I'm trying to make a weapon selection menu and it works as intended up until you try to actually select a weapon. I can't figure out how to get my player reference to not be null whenever I play on a dedicated server. Here's an image of the widget BP that has the selection code:

#

I know that event construct is a client only event, but how do I get my player ref to set properly?

mystic pilot
#

Get Playercontroller [0] > Get Controller Pawn > <do stuff>
Unless you have multiple local players, that should be fine.

winged badger
#

NetGUID errors usually come in 2 flavors

#

well, 3

#

mismatched version

#

managing to send a server RPC via a component destroyed on server that client didn't get an update about yet

#

and when you override IsNameSupportedForNetworking and don't keep the names in sync

cerulean escarp
#

didn't work @mystic pilot

#

still comes out as null

#

it works fine when on a listen server but once I switch to dedicated it says nope

mystic pilot
#

Not sure what is going on then.
Player controller will have a controlled pawn in most cases, even if just spawns one client side (for spectating).

winged badger
#

getowningplayer->getcontrolledpawn

#

provided you plugged in the owner when constructing the widget

#

or better yet

#

just expose on spawn the player and plug it in when constructed

mystic pilot
#

@cerulean escarp Was suggesting you don't have a player ref, but instead just get the controlled pawn as you need it.
I don't know when your widget is created.
It may be created when the player controller is spawned, but is yet to have a valid pawn or has a different pawn.

cerulean escarp
#

widget is created when the player presses the escape key

#

while spawned in

next fable
#

Hey ... I was wondering if anyone could help me figure out how I did this. Everything was fine and then suddenly I fire up 2 players.... and the animation is only playing on one network client and not the other. No difference if I am client or server. I just have no idea what I did.

cerulean escarp
#

variables that drive the animation BP probably aren't being updated from the server to the other clients

#

like current velocity is being read by the server but not passed on to the other clients, so only the host sees the movement

winged badger
#

dedicated server doesn't run animations by default

cerulean escarp
#

^^^

next fable
#

why would it play on both clients?

#

sorry both players

cerulean escarp
#

would or wouldn't?

next fable
#

What I mean is ... I am locally controlling one player... but somehow variables are being replicated to the other player but not across the net.

winged badger
#

its because you're using statics improperly

#

GetPlayerController/Character/Pawn[0]

next fable
#

I am not using (aware of) using statics

winged badger
#

and there it is

#

GetPlayerPawn[0] is the local player on clients, or listen server

#

or whoever logged in first's pawn on dedicated server

#

use relative paths for references, always

#

in this case replace that GetPlayerPawn[0] with TryGetPawnOwner

#

and it will work just fine (provided there is only one error)

#

basically

#

when owning client interprets that GetPlayerPawn[0] locally, its his pawn, its fine

next fable
#

oh man ... following unreal tuts ... said getplayerpawn [0] will always return the correct player, except in the case of couch multiplayer

winged badger
#

when another client does the same, it gets his locally owned pawn, instead of the one that should be playing the animation

#

there is only one good use for GetPlayerController/Character/Pawn[index] in BP imo

#

GetGameMode->GetNumPlayers-> for (0 to NumPlayers - 1) GetPlayerWhatever[index]

#

that is iterating over all players, server only

next fable
#

well... obviously you are right... but I swear this stuff was working until yesterday and then blammo.... thanks ... I will work on it.

winged badger
#

it worked when there was only one player

next fable
#

Thanks man it's working now. I know I sound crazy but I've been using GetPlayerPawn[0] all over and it's been working. I'll go through and fix them... Thanks for the lesson

meager spade
#

there is a node

#

TryGetPawn

#

specifically for BP Anim Blueprints

#

which you should use

next fable
#

So you're saying that TryGetPawn is for BP Anim...
and GetOwningPlayer is for Widgets...
and GetPlayerPawn is just there to F you up... ha ha ... got it.

plush wave
#

UdpSocketBuilder: Failed to subscribe UdpMessageMulticastSocket to multicast group 230.0.0.1 on interface 0.0.0.0 FUdpSocketBuilder: Failed to create and initialize socket UdpMessageMulticastSocket (last error: 0) LogUdpMessaging: Warning: StartTransport failed to create multicast socket on 0.0.0.0:0, joined to 230.0.0.1:6666 with TTL 1 LogUdpMessaging: Warning: UDP messaging encountered an error. Auto repair routine started for reinitialization

#

Getting these 4 errors every second and it hitches UE4. Don't think this is normal?

fossil veldt
#

How do Multicast functions work, Do they run on every single client locally?

hoary lark
#

basically yes

fossil veldt
#

So on a multicast implementation if I get FirstPlayerController it will get the local client that it's running on?

winged badger
#

unless you have dedicated server

fossil veldt
#

For example if there's 3 players in the game, 1 Server, 2 Clients. On the Multicast everyone would get their own controller?

winged badger
#

in which case you're fucked

fossil veldt
#

oh

#

why is it diff for dedicated?

winged badger
#

if you get first controller via GI, it will return a null

#

since there is no LocalPlayer around

fossil veldt
#

ah right yea that's fine

winged badger
#

if you get it via GamePlayStatics [0]

#

then it will get whoever logged in first

hoary lark
#

the crashes you will get will force you to get into the habit of running any appropriate "checks and balances" in all of your RPCs thinkaboutit

fossil veldt
#

Mmkay, So another question. Does BeginPlay() run for each client when a replicated actor spawns if they are in relevancy range?

winged badger
#

BeginPlay runs on each actor. period

fossil veldt
#

awesome

winged badger
#

net relevancy range doesn't affect it

fossil veldt
#

o ok

winged badger
#

if actor is not loaded from the package it doesn't exist

#

on clients

#

in which case it gets spawned and calls beingplay when it becomes net relevant

#

and by the time it does, all its replicated variables will already have replicated, and replication callbacks would have executed

fossil veldt
#

ah awesome

chilly mist
#

I bound an input action "OpenInventory" to a function, in player controller. It works fine on singleplayer, and when I hit Tab, inventory can be opened.
But why does this InputComponent goes null, when I run multiplayer? It crashes on start.

plush wave
#

Can you replicate an actor component?

chrome bay
#

yep

#

Just mark it as such

#

@chilly mist input bindings should be setup in the virtual SetupPlayerInputComponent() function. The component is routinely created and removed, and it's never created for a non-local player.

stable kindle
#

@rare gyro is this a time stamp mismatch ? what might the a good way to mitigate this ?

chilly mist
#

@chrome bay Got it thank you! I moved it into Character's SetupPlayerInputComponent and it works. I need to check if PlayerController has such a function.

chrome bay
#

I think it's called something slightly different there

#

SetupInputComponent() or something

chilly mist
#

Oh yeah, you are right.

#

But this looks very tricky. How can I figure this out by myself, about the rule of input component binding?

chrome bay
#

Well you can't really.. just one of those things