#multiplayer

1 messages ยท Page 528 of 1

chilly mist
#

Not so mention that even the function names got different.

chrome bay
#

But the existing Epic examples have a lot of this in them

#

It's good to follow their example most of the time

chilly mist
#

For sure, guess I need to study from examples more.

#

Thanks again :) <

chrome bay
#

np's

twin juniper
#

Hey there !
Do you have any recommendations/keywords what to use when implementing save game systems for Multipayer (self hosted games) ?
We'd have to save states of actors and positions , plus spawned objects . Quite a few .

bitter oriole
#

Multiplayer doesn't change much

#

My personnal recommendation is to avoid the built-in save system

#

It works very well and is very easy to use, but changes to the data you save can break the compatibility of save files

#

Saving all the data you need to Json files with compression on top is what we're doing - not exactly fast to load, but can be done on a thread, and gets you files you can read directly for debugging

rich ridge
#

Is there a way to get server crash logs.
For example Firebase crashalytics.

bitter oriole
#

UE4 crashes should leave you with a minidump you can debug in VS

rich ridge
#

Ok I know about that, but let's say if I have a cloud instance and I have configured in such way that it should destroy itself after match is over or somy crashes

#

This is reasonable configuration to avoid extra billing

chrome bay
#

UE4 has a crash report server tool, normally you will tell the engine to send any crash reports to a special server where you can retrieve them.

rich ridge
#

Yes this is what I was looking for

rich ridge
#

Will the report in proper format or do I need to embed the template for crash reporting

chrome bay
#

The crash report will just be a minidump plus a log file usually

#

If you need anything else you'll have to modify it, e.g. to upload a users' save file or something.

#

Can't find a decent tut on it anywhere unfortunately though

rich ridge
#

Anyways this is more than enough for me , thanks bro

rich ridge
#

@chrome bay your mentioned wiki states that the latest version of UE4 doesn't have this feature

chrome bay
#

IIRC you have to build the engine from source to get it

rich ridge
#

No it says the source code have been removed completely

chrome bay
#

Could always grab it from an old engine version and update it I guess

#

I guess they don't support it anymore: We do not support the use of Crash Reporter externally, although you are welcome to take the code that exists and adapt it to your own needs.

bitter oriole
#

They never really supported it well anyway

#

Easiest is to fetch your crash dump in saved and send it somewhere

hoary lark
#

@chilly mist if you haven't read it yet, the official docs on input might help you build a bit of a road map in your head there's a couple of useful sections https://docs.unrealengine.com/en-US/Gameplay/Input/index.html

The Input object is responsible for converting input from the player into data in a form Actors can understand and make use of.

chilly mist
#

@hoary lark Right thanks, I'll take a look.

#

But side question, Unreal Engine's documentation website seems to not run CSS for me? I mean it looks like it's rendered in a really awful way. Anyone else has this problem?

hoary lark
#

you're not using internet explorer are you?

chilly mist
#

On Firefox

hoary lark
#

yep looks like ass on FF too... works OK on chrome, vivaldi, and even MS Edge for me

chilly mist
#

o_o

hoary lark
#

not sure why I'm not a web guy

chilly mist
#

That sucks. Maybe I'll learn why such things happen later.
But thanks for checking it for me.

void nest
#

Question. What is the cost of having a high net update frequency when nothing inside the replicated actor is actually replicating (no replicated variables) The only reason I want the net update frequency very high is so that the actor spawns as instantly as possible on clients when created on the server. Is the overhead cost after the actor is replicated and spawned high when the net update frequency is set to a high number? Or does Unreal have a built in optimisation for this, meaning that if there is nothing inside the actor replicating, the actor isn't costly? The only thing I'm worried about is the impact on the host's CPU? As a constant checking with the net update frequency has a CPU cost, no?

jolly siren
#

NetUpdateFrequency doesn't affect initial actor replication

winged badger
#

also the cost is the server CPU time evaluating actors for replication

#

which is also by default capped per frame iirc

#

you can easily net saturate yourself to where nothing works with wrong frequency/priority settings and enough actors

neon mango
#

Confusion about Replay and networking. I have actors that I create at runtime aka spawn in and populate with staticmeshes. It seems when I perform a replay even though my creation method is a NetMultiCast and the replay shows the creation of the actors, the movement of said actors isn't being applied. This has me thinking the recording is probably doing it for Actors that were created at that moment and when the replay happens, it creates bran new actors that I guess it doesn't see as the same? What would be a way to have it recognize the actors as the ones that were moved?

For clarity the creation happen before recording starts.

jolly siren
#

The creation happens before recording starts? ๐Ÿค”

neon mango
#

@jolly siren Empty map starts, actors spawns in.

#

Then the user may record

#

stop recording

#

hits play

#

it seems to still spawn in the actors

#

but movement isn't replicated back

#

thinking it might be because the movement it recorded was for "different" actors

#

The only thing I guess i could do is have lots of maps with the actors already in it?

#

but that would be a last resort and seems kind of silly to have to do

jolly siren
#

Have you tried starting the recording before the actors are spawned as a test?

neon mango
#

No.. even if that works it isn't how it's supposed to be used at all

#

Not sure if really insightful ethier?

#

Because either way the actors are recreated but it might prove my idea wrong or right

#

ok I'll try that

jolly siren
#

Of course the actors are recreated during replay playback

neon mango
#

But I mean to say

#

while the replay does "recreate" I literally call the creation process of the actors it "recreats"

#

@jolly siren Same results

#

making my theory sound more likely

#

but there should be away for replay to apply the movement?

#

Perhaps I need to rethink how I apply the move

#

instead of depending on the actors to replicate

#

just depend on the actions that cause the move to happen to replicate well

hoary spear
#

is it common to see some sort of "jitter" on the other players in multiplayer with just a template project ?

#

Every now and then the character sort of jitters a few uu up and down again, before continuing as normal ๐Ÿ˜›

bitter oriole
#

Depends on the network conditions (and the template)

long willow
#

Hey, so I have a bluperint widget that I want to display when someone gets killed by a projectile/bullet fired by another player, and make it display player names of the player who got killed, as well as the killer. But Idk how Im gonna get that information over to the widget :l

Do you guys have any suggestions?

#

(Please ping on reply โค๏ธ )

hoary spear
#

Everything is set to default. Seem to be related to collision and mesh edges and not the replication as i first assumed

tall saddle
#

Hey guys, trying to learn multiplayer replication, and I'm trying to do something I thought would be super simple..

#

How can I set all players to have the same camera / overhead POV?

#

Thought this would work, but nope. My server does it correctly, but client pawn does not. His view just gets snapped to his actor location

sly arch
#

@thin stratus Hey, I remember you helping a little with my dedicated server. I have a quick question, since I don't have an AppID, i'm using 480. Do I need to have steam open to act as the "master server" or without it? WIthout steam open, it will launch perfect but will only allow clients to join who don't have steam open.

#

Any suggestions?

thin stratus
#

You need steam to be open to use steam, yes

#

You can also only actively do this with 2+ pcs or a virtual one

#

Cause steam can only be open once per pc

sly arch
#

I get this though

#

You're saying I need steam open to start the server?

thin stratus
#

Steam needs to be open to use it, yes.

#

And you can start the game and the server on the same pc.

sly arch
#

So I would need another steam account if I wanted to connect to it?

thin stratus
#

DedicatedServers might also work with just the dlls of steam in the binaries folder

sly arch
#

What would fix the error then?

thin stratus
#

Most likely, yes, you can try to move the steam dlls into the dediservers binaries folder ,but it can be that if you start the normal game on the same pc that it won't let you boot into steam. Usually you need to pcs.

#

But there are steam+ dedicated server tutorials on wiki that should explain this.

#

If you later distribute the server you only need the dlls though

#

DedicatedServers don't need an actual account with steam

sly arch
#

That only applies because I'm using spacewar right?

#

which requires me to have steam open?

thin stratus
#

I'm sorry, steam has to be open for clients and listenservers

#

DedicatedServers work with the dlls in the binaries folder

sly arch
#

Meaning steam has to be closed?

thin stratus
#

Not sure you can host a dediserver on the same pc that you play on

#

But the error you posted isn't really pointing to steam being on or off

#

It just says it tries to bind to the port and fails

#

Make sure you have the netdriver setup in the config files

sly arch
#
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"
#

I've had this in there

thin stratus
#

There should be another thing about that

#

I only have my phone rn and it's 11:30pm, so I can't reall help much more.

#

Check if you have the config setup properly

sly arch
#

Oh geesh! Go to bed haha. I'll double check. Thank you

cerulean escarp
#

@sly arch did you follow a youtube tutorial for it?

sly arch
#

I have. I've build my source build 3 times already trying to copy a video as well

cerulean escarp
#

Huh

sly arch
#

lol

cerulean escarp
#

only thing I can think of is to check this documentation

#

not sure if it'll help though

sly arch
#

I tried that, but the problem is that I don't have streambridge as i'm using the default SpaceWar appid

chilly mason
#

whenever I close a TCP connection that I was listening on and restart my program to listen on it again linux keeps giving me address already in use errors for like 30 seconds - after that it's fine. what setting do I have to change to make this go away?

gritty pelican
#

hi, how to use steam function RequestInternetServerList?

twin minnow
#

how would one go about making a server kick a player out of the game? I found the AGameSession::KickPlayer function but was wondering where and how this was called?

gritty pelican
#

@twin minnow i create function in my controller

#
{
    UE_LOG(LogTemp, Warning, TEXT("FUNCTION START: KickPlayer"));

    FText KickText; // = TEXT("INITZALIZE PLAYER FAILED")
    GetWorld()->GetAuthGameMode()->GameSession->KickPlayer(this, KickText);
    
}```
twin minnow
#

thank you @gritty pelican I will try this out

bronze arch
#

Or to easy way; make execute command "disconnect" inside run on client.

#

oh jeesh i didnt looked at messagged time

#

nvm

gritty pelican
#

how i can connect to steam server use ip?

honest scarab
#

Has anyone made zone capturing over multiplayer? for example, red team stands on zone and capture points. where do you store these added points? and how do you replicate it

rich ridge
#

@honest scarab I think it is doable by using ReplicationGraph with Grids

#

Basically we split our world into grids and mark those grids when to replicate or when not to

lean river
#

hey, the official findsession node working with steam + dedicated server in 4.24 (of course after new steam things added in 4.22 is set correctly)?
i see the dedicated server in steam list, but seems find session unable to find it ๐Ÿ˜ฆ

rich ridge
#

@thin stratus I think we can host th dedicated server on same PC, because UE4 does that

lean river
#

@rich ridge you can ๐Ÿ˜„ ive tested exactly this yesterday, but runned into a small issue

rich ridge
#

Ok what is that issue

thin stratus
#

Yeah you probably can, but you have to put the dlls into the binaries folder, which is a big step some peeps forget.

lean river
#

^^

thin stratus
#

Othewise the DS won't properly use the subsystem

lean river
#

exactly

thin stratus
#

And I only did like 2 games or so with Steam Dedi Servers and that was 6+months ago so I can't recall :D

rich ridge
#

@thin stratus what is do is I run my Linux Dedicated server under Linuxsubsystem

#

Of windows

lean river
#

without steam btw it works (of course ports should set via cmd line), but with steam since dll is runtime loaded and seems it is locked, the second gameserver from same directory unable to load steam dll's

rich ridge
#

I have absolute zero experience with steam, so can't help. Sorry bro

#

I m waiting for epic online services

#

@lean river I think you can do this with Linux Subsystem if steam can cross compile

#

You can have any number of dedicated server with Linux containers

#

Just need to do some extra work to get it working locally

lean river
#

yeah actually you can have any on windows too :D
just copy the server build to different dirs and works..

rich ridge
#

@lean river but it's not smart way ๐Ÿ˜€

lean river
#

i know, but what we can do ๐Ÿ˜„

rich ridge
#

If you do set-up Linux containers it will give you fair idea exactly how your Dedicated server will scale realtime

#

I will do the exactly same what I recommended you and will share my resources to all, but not now. I m waiting for epic online services.

#

This is for local orchestration

#

This technology is maintained by Google

#

For your information this technology was developed initially for Pokemon GO

#

It has UE4 plugin

lean river
#

great thx! would read

lean river
#

btw ive figured out... why i was unable to find steam dedicated sessions
vanilla find session node still do not return dedicated server nodes.. even if every macro set correctly :D
advanced session able to find sessions \o/
so i guess i need write my own find session node

manic token
#

Hey guys, a more general question from me

#

what would you say is the modern standard approach to hit detection with bullet travel?

#

better to go with client side checking with server validation

#

or to implement rollback with bullet travel

#

I'd love it if you know of any good resources on this topic to share

lean river
solar stirrup
#

Is Begin Play called after the initial replication bunch gets sent?

chrome bay
#

@manic token I've just done it with rollback.

#

For character vs character, it's pretty easy

jolly siren
#

I would love to see a rollback implementation for fun โค๏ธ

lean river
#

projectile forwarding is easy too.. ^^
so atleast server / client would be in sync regarding the projectile position

chrome bay
#

I found rollback to be much easier than predicted projectiles having tried both now, to be clear the rollback solution uses a psuedo-projectile system - but it's less flexible so it kinda depends what you wanna do.

#

Rollback is very straightforward. I need a blog :/

#

But TL;DR store a circular buffer transform history on the server of each player, and define the maximum rewind time. When you receive a client hit, get the closest "interpolated" sample (based on current time - (clients ping * 0.5f)), and check the hit against that rewound capsule

#

A capsule can be very cheaply represented as a distance-from-line-segment check too, so you can easily define a "expansion" radius

#

The trick is you also need to "pause" bullets on the shooter if their latency is > the max rewind time.

#

Otherwise they can't hit anything ๐Ÿ˜„

#

And as it turns out.. players do not like that

jolly siren
#

Why a circular buffer?

chrome bay
#

Ah it doesn't have to be, I just found it to be easier to update. You timestamp each "sample", the continuously overwrite the oldest one

jolly siren
#

ahh okay, I'm in the process of writing rewind of sorts in order to make simulated proxies appear where the shooter thinks they are in a replay

chrome bay
#

yeah that would work well for that too

jolly siren
#

The plan is to store the history of updates from PostNetReceiveLocationAndRotation and then use historical ones in SmoothCorrection instead of the current ones

#

Lagged behind by shooter + the simulated proxies ping

chrome bay
#

yeah that would work!

jolly siren
#

I think this should be able to work for live spectating as well

harsh lintel
#
    InTarget->GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_Pawn, ECollisionResponse::ECR_Ignore);

I'm calling this in a server rpc on a replicated capsule component of a character but it doesn't seem to have effect on the cilents

jolly siren
#

Are you also calling it on the client?

harsh lintel
#

nope just on the server

jolly siren
#

Collision response isn't replicated

#

You will have to call it on both

harsh lintel
#

Alright thanks

jolly siren
#

np

ember needle
#

Is it OK to set the ownership of a character gun to the character, so that the gun can call RPC events (such as changing fire mode)? Is it dangerous in any way / not recommended?

chrome bay
#

Nah, that's quite common

ember needle
#

ok thank you

gritty pelican
#

how to check if the server is in the favorites list or not?

#

in steam

fossil veldt
#

Ah so, I wanna set player locations / rotations for every player on the server, Would the best way be to:

- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)

- MulticastRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)

- Each client set the location / rotation for the actor

or

- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)

- Set Replicated Variables

- Client OnRep Set Location + Rotation
#

Or another way perhaps?

#

Not really sure best way to go about it

cerulean escarp
#

could anyone help me with this issue? I can't call the Set Weapon and Spawn Weapon functions inside the widget blueprint because the player ref is always set to null, and I just can't figure out how to get it to work

#

nevermind I'm actually so dumb

fossil veldt
#

Can't use RPCs in a widget

winged badger
#

he isn't

fossil veldt
cerulean escarp
#

I just put the player ref setter to when the button is pressed and it works

fossil veldt
#

Isn't onclicked a widget override?

winged badger
#

you can't have RPC members in a widget, you can call them just fine

fossil veldt
#

Huh!

#

TIL

#

Sorry sir

winged badger
#

the actor that RPC event belongs to has to be an owned one

fossil veldt
#

ah

cerulean escarp
#

I can't believe it took me this long to figure out what was wrong

#

I stopped working on my game for 2 weeks cause I was just sick and tired of trying useless fixes

winged badger
#

i told you to expose the player ref on spawn last week ๐Ÿ˜›

cerulean escarp
#

lol yeah but I didn't know what to do after that xD

#

much less what you meant

winged badger
#

you connect a valid player ref when you construct the widget

#

and it just works

cerulean escarp
#

ohhhhhh

fossil veldt
#

Ah so, I wanna set player locations / rotations for every player on the server, Would the best way be to:

- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)

- MulticastRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)

- Each client set the location / rotation for the actor

or

- ServerRPC(FVector_NetQuantize100 NewPosition, FVector_NetQuantize100 NewRotation)

- Set Replicated Variables

- Client OnRep Set Location + Rotation

@winged badger You know an answer to this one?

winged badger
#

you got roll to your rotation?

fossil veldt
#

ay?

#

I'm using my own movement component so replicate movement doesn't seem to work for me

winged badger
#

its generally SetReplicatedVariable, SkipOwner

fossil veldt
#

Ah yea ok thought so

winged badger
#

local player needs to simulate it

fossil veldt
#

yah

winged badger
#

but if you have 0 roll for your rotations

fossil veldt
#

oh right you can just send a yaw yea

winged badger
#

rotation is usually sent as NetQuantize_Normal

#

as the length of the vector doesn't matter

#

and its smaller

fossil veldt
#

ah ok

winged badger
#

either way, if you try to convert a vector to rotator you lose all roll information

fossil veldt
#

O rly

#

That's confusing, Wouldn't it just take XYZ components

#

and just put them back into a rot

winged badger
#

thats different

#

if you do

FVector MyVector = SomeVector;
FRotator MyRotator = MyVector.Rotator();
#

basically replicating a rotation as a direction vector

#

then you lose roll

#

but it is a most common use-case

fossil veldt
#

ah

#

interesting

#

Would you send velocity as NetQuantize100?

winged badger
#

the NetQuantize_Normal only allows for 0-1 component values

#

but its only 16, instead of 32 bits per component

fossil veldt
#

ahh so you gotta normalize the rotation?

#

Or is it automatically normalized when you set the value

winged badger
#

turning the vector into a rotator should give normalized results i think

#

would need to check

fossil veldt
#

ah

winged badger
#

or rotator into vector

#

the length is undefined in transformation, so it makes sense for it to be 1

fossil veldt
#

Yea

#

Replicated variables only change if set by the server right?

#

and you don't have to multicast for them to update for everyone?

winged badger
#

well, its kinda confusing if you do the BP networking

fossil veldt
#

yea

winged badger
#

as OnReps fire every time the value is changed, even locally

#

in c++ its much cleaner, its only a replication callback, and only for clients

fossil veldt
#

Oh nice

#

It was so messy in BP i hated them

#

So am glad they are actually good in C++

winged badger
#

also c++ version can do

UFUNCTION() void OnRep_NyFloat(float OldValue);
#

having a pre-replication value in argument

fossil veldt
#

ahhh nice

winged badger
#

net driver uses reflection to figure out which OnRep overload to call

#

so you only need to change the OnRep function itself, rest is done for you

fossil veldt
#

๐Ÿ˜ฎ

#

That's so much better than BP

#

Ah, tysm for teaching me

vestal monolith
#

any chance someone could help me out with something regarding sprinting real quick?

#

i am trying to replicate sprinting, whenever i hit my sprint button the movement becomes super choppy and jittery. from what ive read online i have to change the movement speed on the server and on the client. everything ive tried that seems to work for other people isnt working too well for me. heres my bp if someone could let me know what im doing wrong. thanks!

winged badger
#

you should set the walk speed locally immediately

#

when the button is pressed

#

which you're not doing at all

#

so client is doing its movement at walk speed, server at run speed, and ends up being corrected constantly

vestal monolith
#

so when i hit my sprint button the first i should be doing is changing my walk speed?

winged badger
#

yes

#

if you wait for server to process and replicate it back to owning client

#

you'll have a stutter whenever you activate the sprint

#

if you set it locally right away, the SavedMovement packets using higher speed will reach the server about the same time server gets the message to increase the speed server side

#

and then everything remains smooth

vestal monolith
#

thank you so much man

#

i could not figure that out for the life of me

#

got it working now!

fossil veldt
#

in c++ its much cleaner, its only a replication callback, and only for clients
@winged badger Is the only for clients part set in stone or can you make OnRep trigger on the server also?

#

Trying to set my locations like this but the listen server isn't getting the OnRep calls like you mentioned:

void UCNetworkedMovementComponent::OnRep_NETposition()
{

    if (OwningPlayer)
    {
        OwningPlayer->SetActorLocation(NETposition);
        UE_LOG(LogTemp, Log, TEXT("OnRep_NETposition"));
    }

}
chilly mist
#

Is subobject replication made easier in UE 4.24?

winged badger
#

server can call whatever it needs to when setting the variable

#

but OnRep will not fire on server @fossil veldt

#

@chilly mist no, but its fairly straightforward on any version

fossil veldt
#

ah ok

#

What's the condition for being the server?
is it just:
if(Role == ROLE_AUTHORITY)

winged badger
#

its GetLocalRole() now, Role is private

fossil veldt
#

ah ok

#

ty

winged badger
#

and that is not server condition in every, just most cases

#

locally spawned actor will have role authority on clients

fossil veldt
#

ah :/

#

If it's a replicated component owned by the client it would have authority then?

winged badger
#

no

fossil veldt
#

ah specifically if the client spawned it

#

awesome ty

winged badger
#

there is also GetNetMode()

fossil veldt
#

Oo that's probs better actually

chilly mist
#

@winged badger It seems like a lot of stuff to cover. The outer Actor needs to implement ReplicateSubobjects. The subobject itself needs to override IsSupportedForNetworking. I copied code from some wiki for ReplicateSubobjects and frankly don't understand it at all. And it doesn't seem to be documented anywhere.

winged badger
#

there is one example

#
bool UAbilitySystemComponent::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
#

in the engine

chilly mist
#

Sure, I see. But how can I approach to understand these code?

winged badger
#

sorry, i don't get what part confuses you

chilly mist
#

Like what does ReplicateSubobjects do, what is UActorChannel, what is FOutBunch, replication flag, what does WroteSomething do...
๐Ÿ˜‚

winged badger
#

FOutBunch is the packet sent to the clients

#

WroteSomething is just a boolean for the return of ReplicateSubobjects function, it will return true if there is something to replicate

stark hull
#

@winged badger do you know of a reliable way to generate a timer across both client and listen server? Atm I have a timer that gets set on begin play for listen and client controllers, but only the client's timer gets fulfilled. Any workarounds for that?

winged badger
#

ReplicateSubobjects gathers all the objects replicated via that actor channel into a packet

#

and ActorChannel is a channel used by an actor to replicate over

#

wdym "only client's timer gets fullfilled" @stark hull ?

stark hull
#

After the initial delay of the timer the callback function fires off only on a connected client

#

as opposed to it firing off on both on listen server and client, as they both initiate the same timer on their ends

winged badger
#

there can be dozens of causes for that

#

i can't really guess which one is it like this

stark hull
#
void ATuTPlayerController::BeginPlay()
{
    Super::BeginPlay();
    if(IsLocalController()) 
    {
        ConstructPlayerOverlay();
        GetWorldTimerManager().SetTimer(UIEnableTimer, this, &ATuTPlayerController::OnShowUI, .5f, true, 1.f);
    }
}
winged badger
#

and there it is

#

IsLocalController() prevents it from firing on server for client owned controllers

#

and that timer shouldn't execute on server anyways

#

UI is strictly local

stark hull
#

To clarify, what I was looking for is if I have a client that is behaving as a listen server I also wanted to have the timer to trigger on their side

winged badger
#

it will

#

as their IsLocalController() would return true on server

stark hull
#

This code works if I put a breakpoint and step through the execution, but if I let it run in PIE it doesn't activate on the listen server

#

but it does on the client xD

winged badger
#

that would probably be because you use a reference to the pawn in ConstructPlayerOverlay()

#

controller, by default, doesn't have a pawn possessed on BeginPlay (due to how network actors are constructed, this is true only on server)

fossil veldt
#

hmm, Anybody know what the best way to handle hitboxes is? Do you just spawn em as DefaultSubObjects on the character class? Or spawn them seperately and then attach to component by bone? Not really sure

stark hull
#
void ATuTPlayerController::ConstructPlayerOverlay()
{
    if (PlayerOverlay)
    {
        if (!ActiveWidget)
        {
            ActiveWidget = CreateWidget<UUserWidget>(GetWorld(), PlayerOverlay);
        }
    }
}
winged badger
#

you should do all that in the AHUD derived class btw

stark hull
#

HUD's deprecated no?

winged badger
#

its not controller's responsibility to manage widgets

#

no

stark hull
#

yikes, ok was roaming the forums and kept seeing people mentioning that HUD is deped

fossil veldt
#

@stark hull They probs meant Canvas which is what you used to create User Interface in back in the day before UMG / Slate, Still don't even think it's deprecated there's just not that much reason to use it

chilly mist
#

@winged badger Great to know, but like, these look like in-depth knowledge of UE. How can I get to know about these myself?

winged badger
#

reading the what little docs there are, then the source code

fossil veldt
#

then years of practice ^ ;D

winged badger
#

also reading in-depth conversations on this channel doesn't hurt

chilly mist
#

So pretty much toughing it out with C++ comprehension ๐Ÿ˜ฑ

#

But yeah, I just learned something about IsLocalController from the conversations above o_o

winged badger
#

on occasion the documentation is actually in comments in the header files

#

example would be NetSerialization.h

chilly mist
#

Looks like it :) <

fossil veldt
#

There has to be a cleaner way to do this lol

winged badger
#

it is bad

fossil veldt
#

What's better way to do it?

winged badger
#

google per-bone hit detection unreal

#

and something is bound to pop up

fossil veldt
#

Ah but see the problem is none of them are actually proper hitbox systems

#

They are all litterally per bone

#

they just hitscan the mesh and get the closest bone

twin vault
#

a physics asset is literally a bunch of capsules, same thing u are doing

fossil veldt
#

Would you not have a set of colliders attached to the bones like this?

twin vault
#

yep you would

stark hull
#

@winged badger no idea why, BUT removing the initial delay solved my problem... wut

#
GetWorldTimerManager().SetTimer(UIEnableTimer, this, &ATuTPlayerController::OnShowUI, .5f, true, 0.f);
#

switched from 1.f to 0.f

fossil veldt
#

I thought Physics Assets were intended to be used for Ragdoll and Physics Based Anims

twin vault
#

it has a lots of uses

#

even for graphics etc

fossil veldt
#

o

#

But when you RayCast against a mesh aren't you having to do calculations based on what triangle was hit ect

#

That's why the RayHit in engine litterally hits against the mesh surface

twin vault
#

nope u cant trace against triangles in a skeletal mesh

fossil veldt
#

o

#

shieeet

velvet dune
#

Hi im trying to make a 3d widget that is replicated to all players can use. that updates when player click on a button on it

chilly mist
#

Cool

dreamy dove
graceful cave
#

im having an issue after updating to 4.24 where i cant connect to a dedicated server

#

just tested with a listen server (same machine) and it does the same thing

jolly siren
#

Does anyone see where the engine adds to the UNetConnection::Delayed array?

#

I can't find where they add anything to the array

#

ah I found it

#
DelayedPacket& B = *(new(Delayed)DelayedPacket(SendBuffer.GetData(), SendBuffer.GetNumBits(), Traits));
#

Kind of a strange way to add to an array

meager spade
#

quite comon

#

common*

#

someone did explain it was better this way but i forget why

bitter oriole
#

It's how you call a constructor without allocating new memory

jolly siren
#

ahh okay makes sense

graceful cave
#

still having my issue from earlier, but trying to play as a client in PIE gives me more in my log

#

the subsystem line prints every frame

#

still looping the other lines every second

#

im not using an online subsystem as far as i know, but i am using uworks

#

which shouldnt do anything in PIE anyway

meager spade
#

you using UWorks Subsystem?

#

i ended up not using it, and using the built in steam subsystem

graceful cave
#

actually i just removed the dependency for that in all the uworks build.cs files

#

and now it works in PIE

gritty pelican
#

if i use Dedicated server, i need use if(SteamAPI_Init()) or if(SteamGameServer_Init()) or if(SteamAPI_Init() || SteamGameServer_Init())? SteamAPI_Init() only for clients?

half jewel
#

@dreamy dove its how much cpu time was wasted figuring out if this property should be replicated to the client because it dint change or needed to be replicated at all.

perfect example would be something like InitialSpawnLocation its a vector that says where this actor initially spawned from... only changes once in its entire lifetime. If you replicated this properly normally it would be 100 waste all the time. It never changes!

but if that same property was replicated with COND_InitialOnly the waste will be 0, as no cpu time is spent trying to replicate the property.

most of the time you can ignore waste, but if the majority of your properties have waste with like a hundred of these kinds of actors, maybe try lowering replication update rate. Or moving its logic to RPCs, really really really depends on your game.

#

there was a video that epic made that explained other methods of handling this exact problem, it was a stream at one point. anyone remember?

steady aspen
#

Hi guys. I am looking for a way to save all the clients stats like health, money and other variables. I know how to do this locally with savegame but how would one do this with multiplayer to avoid cheating? If someone could point me in the right direction. that would be very much appreciated. Thanks in advance!

cerulean escarp
#

I'd store them in the player state

thin stratus
#

That's not really saving.

steady aspen
#

It has to be saved so its there the next time the player opens the game*

winged badger
#

and there is no way to make a save system that can't be hacked

thin stratus
#

Saving for when the games is off.

cerulean escarp
#

Ohhhh

thin stratus
#

Yop, soooo. DedicatedServer + Hosting them yourself + Backend.

cerulean escarp
#

well you could make a database for all your players and store it somewhere on the interwebs

thin stratus
#

At which point you will face $$$$ costs.

#

Sooo, think if you really want to go that far or just make a ListenServer based game that (maybe) earns you money..

steady aspen
#

At first I just want to learn how to set it up just so its not saved locally

#

Been looking at MySQL. Is that a good place to start?

thin stratus
#

This is not related to UE4 then anymore. So it might be better for you to look that stuff up in general.

#

You'll also need a way to identify your players.

#

Which means either you tie in something like Steam or your own Account System.

#

MySQL is one way to do it. You should maybe look up the diff between SQL and NoSQL and all that stuff and decide on your own.

steady aspen
#

Alright. Thanks!

dreamy dove
#

@half jewel - amazing, thank you for the information and the link to the video, this is exactly what I'm looking for! Yeah I can I imagine that if there are hundreds of these that waste could start to add up. Going to take a look at this video you linked and see if I can better understand the output of the network profiler. Looking forward to the experimental network insights in 4.25!

cerulean escarp
#

@winged badger I have another issue with weapon selection ๐Ÿ™‚

#

this is in my gamestate blueprint, and does a loop through every single player to set the weapon they chose before spawning and then spawn the actual player BP with the Chosen Weapon being passed to it and then spawned in its hands

#

for some reason though, it isn't working, and I already tried to set Chosen Weapon as a variable in the gamestate so that it is saved before the StartingPawn is destroyed, but that didn't work either

harsh lintel
fossil veldt
#

Been looking at MySQL. Is that a good place to start?
@steady aspen Depending on how much data you're saving and if you're using Steam you could use their Steam Stats api via steamworks

steady aspen
#

I will not use Steam. The plan is to have our own system @fossil veldt

fossil veldt
#

Yea fair enough then, Might be worth having a look into MongoDB, MariaDB or MySQL then with a rest API

#

Then use VA Rest or another plugin to push / pull info from the server

steady aspen
#

Are any of them free? or atleast cheap

fossil veldt
#

Depends how you mean free, You'd have to host these somewhere

#

If you host them yourself sure they'd be free kinda

#

Minus electricity bills and cost to run them yourself

#

Or you could use an online hosting company

#

which would probs cost a bit

#

If you're just opposed to using steam but don't mind using another system you could go with playfab

#

I think they also have a stats storing system

steady aspen
#

Yes I know that would cost, but I was thinking about the actual programs if they were monthly subscriptions or what kind of plan they have

fossil veldt
#

Nah they are just Database Servers

#

if you run them locally there's no cost

#

other than the system you run them on

#

You should maybe take a look at Dockerized Containers for running the Databases in, that way you can scale them nicely and move them wherever you want

#

they should in theory run the same on any system

steady aspen
#

Thanks ๐Ÿ™‚

fossil veldt
#

No worries

#

Another thing

#

You should be careful with this solution to not let the client be authoritative over putting data in the databases

#

Because then they can cheat the values locally and save them into the cloud

#

So you will want checks and to have the server do this to make sure people aren't saving cheated values

#

Don't know if you ever played Modern Warfare 2 but that's a great example of not doing that

#

People can change any of their Values locally and they save to the cloud

#

because they just take the clients word that the values aren't cheated

#

So you might want to have some kind of master server system that is responsible for setting the stats you want

steady aspen
#

Yes I will do that. Are there any places that are good for learning more about this?

fossil veldt
#

Yea there's tons of info on database and rest api

#

they might not be specifically for games but the concepts are the same

#

A good example you might wanna look at is WoW private servers

#

as they are open source and do pretty much exactly what I just said

#

Usually use a mySQL backend, so you should be able to get a good idea for how that system works

#

and that works on an MMO scale so is pretty bulletproof and should work at pretty much any scale you need

steady aspen
#

Sounds good. Thank you very much for your help, it is much appreciated

fossil veldt
#

You're welcome

#

Good luck

#

Also

#

If you wanna get some understanding of how Rest API works

steady aspen
#

One last question though. Where would I download the stuff I need for a dedicated server. I only found some links which lead to a dead gitHub with no content

fossil veldt
#

A good way I learned was to download a program called "PostMan"

#

and then tinker around with the spotify api

#

Dedicated server for a database?

#

Or for UE4?

steady aspen
#

UE4

fossil veldt
#

Afaik you have to build it from source

#

And then tinker around with some extra stuff

bronze arch
#

or

fossil veldt
#

I think it should say on the UE4 Github

bronze arch
#

make your own database system with UE4

#

ez wp

fossil veldt
#

^ Depends on what kinda scale you want really

steady aspen
#

I cant find the source on their gitHub anymore

bronze arch
#

make a bp struct like db tables

#

and make a array in game mode

#

use it like sql

#

but there only have a big disavantage

fossil veldt
#

@steady aspen I think you have to get added to the Epic Games team somehow

#

or you can't see it

bronze arch
#

when u shutdowning server. these data will loss

fossil veldt
#

Can't remember how you do it

steady aspen
#

I see

fossil veldt
#

here's how you do it

steady aspen
#

Thank you

fossil veldt
#

no woz

gritty pelican
#

Has anyone made a smooth sprint in multiplayer?

#

During a speed change, my player twitches

frank portal
#

@gritty pelican how do you handle sprinting atm?

gritty pelican
#

I change the speed on the server side when I click on the button

#

maybe i can use smooth sync?

frank portal
#

you change max speed on server or?

gritty pelican
#

yes, on server

frank portal
#

max speed isnt replicated so when you only change it on the server the client will walk with the old max speed and the server will correct the client all time when they are too far apart

gritty pelican
#

okay, with smooth sync plugin all work

frank portal
#

you could change the speed on the client instantly when you start sprinting and also on the server (so they would match most of the time, but thats just the easy solution and you will still get some corrections from the server when you have a bad connection etc) ... the right solution would be to add it to the saved moves so they both match up

gritty pelican
#

I tried testing with bad ping. Jerking will always be

#

Even if I change the speed on the client and server every tick

frank portal
#

yea you would need to extend the cmc and create a saved move ... then it would work "fine"

gritty pelican
#

Ok, i will try

native olive
#

took me a day to realize that BP "Open Level" always result in non seamless travel ๐Ÿ˜ฆ

#

in fact, it is equivalent to UEngine::Browse

fluid finch
#

Anyone managed to build dedicated server on 4.24.3?

mental geode
#

I have the LobbyPlayerController (LobbyPC) and this gives me the playersettings values I want but when I then go to my Gamemode And get it through the cast to LobbyPC and get the playersettings values there the value is empty. What am I not getting here/ doing wrong?first picture the GM second the PC

meager spade
#

BeginPlay might be too early

#

just try with a small delay of say .5

#

see if it works

native olive
#

@mental geode there are no guaranteed that BeginPlay starts earlier than OnLogin, better not assume that and tweak your logic a little bit

#

but I see you are trying to implement a character customization here. it could be done using UE4 built-in features. to persists object through level and network, better sub class PlayerState

#

to customize hero spawning process, sub class GameMode and override some function in there, your life would be much easier

rose egret
#

why voice chat doesn't work for me ๐Ÿ˜ฆ its soo weird
I am using Lan and listen server. did all the configs though

meager spade
#

how would we know?

rose egret
#

nvm solved it.

jolly siren
#

Does a shooter see the person they're shooting at back in time by (shooter ping + victim ping)? Or by (shooter ping + victim ping)*.5 ?

chrome bay
#

The latter

#
  • a fudge factor for processing time
jolly siren
#

okay cool, that's what I thought. Just wanted to make sure. Thanks James ๐Ÿ™‚

mental geode
#

@native olive Thanks I managed to fix it! I indeed was doing stuff in the wrong blueprints

#

is there a way to compile all blueprints in my project at once? I have this issue evertytime I change something in a struct I have that I have to manually go to every blueprint where its referenced
and click compile was wondering if theres a way to just compile everything again

native olive
#

just hit play button

honest scarab
#

has anyone made replicating zone capturing?

meager spade
#

replicating zone capturing?

twin juniper
#

Where did the server get hosted/how do i connect with the integrated multiplayer of ue4?

#

I cant find any guide to the concept of the networking like which function is for connecting, event on connection lost. I only found something to execute a blueprint โ€žcodeโ€œ on server and/or client side

#

Oh and pressing the play button compile automaticly everything? Sl i dont need to press compile and play button both? ๐Ÿ˜ฎ

honest scarab
#

Sorry, so has anyone made a game mode where you have to capture zones, but that variable is properly replicated? I cant get a variable to replicate to all clients from the game state.

meager spade
#

BP or c++ @honest scarab

#

how is the game mode being told the zone was captured?

honest scarab
#

BP's

meager spade
#

show what you are doing then

odd iron
#

Coming from #animation
Hi Guys i have problem with my Client Character Animation its so glitchy when player moving or running keep shaking i can't find a solution in google

dawn summit
#

^ i need to clarify, it does work on server side, but not on clients

odd iron
#

Yes its works on Server Side normal but on Client Side its Glitchy Player Keep shaking

dawn summit
odd iron
#

all replicated

#

i mean setted but same

dawn summit
#

"replicated" is not a bool only

#

you have a lot of settings there

odd iron
dawn summit
#

and?

odd iron
#

same

dawn summit
#

yes...it does not mean it will work for all the cases

odd iron
#

idk i have other projects same settings working normally

dawn summit
#

if you can AB test this character against default third person one, and see no difference - issue in networking

odd iron
#

ok i will do that good idea

dawn summit
#

ping me when you will have the results

odd iron
#

@dawn summit same here with default character

dawn summit
#

then issue in networking setup...

odd iron
#

Im using The Default Axis Move Forward and Move Right

#

i will check then What is going on

odd iron
#

@dawn summit Now i Unticked Mesh Component Replication Walk and Jump Are good but Sprinting still glitchy

#

And all Fixed Thanks Mate for support xD

proper idol
#

hi there, i have a blueprint actor which has a function to set its relative location. it simply moves 50 units along its forward vector whenever the function is called. however, when i try this in multiplayer unreal says it does not have an owning connection. i looked it up and from what i gathered there needs to be a playercontroller and an owning connection, like with a pawn. so i would need to rewrite that function now to pass the actor to (for example) my pawn and move it from there? that seems fishy to me. is there no other way to call this function and have the actor move itself?

#

or maybe its supposed to work, i just am doing something wrong. i have set everything to replicate with the actor. no clue what i must do here without rewriting alot of my blueprints just for multiplayer.

hoary lark
winged badger
#

multiplayer was never going to work out of the box

#

and yes, its worse when you make a single player mechanic first then try to make it work in MP after the fact

proper idol
#

@hoary lark @winged badger i have read through the compendium and the docs. that is why i came here to ask if i have overseen something or if that is just the way to go to have my pawn do all the controlling of the movement

winged badger
#

no owning connection means you tried to send a server or client RPC through an actor instance that doesn't have a PC as the end owner

proper idol
#

thats what i did, i have that aactor without an owning connection, but i kinda expected its movement to be replicated to my clients, so i sent an rpc from that actor to the server, and there set its location to have it replicated to all other clients. but seems that is not the way to go. any tipps on what i can do?

#

i tried to follow an object oriented principle here, where the actor moves itself

#

after its function gets called

hoary lark
winged badger
#

if the function was called server side

#

it would work fine

#

it isn't tho

hoary lark
#

simplified: either the server owns this thing or a client owns it. if the server owns it, the server moves it. if the client owns it, they can tell the server to move it. the server always owns it unless they tell the client they can own it.

proper idol
#

its basically a static mesh actor

#

just a blueprint wrapped around it

#

who owns it_

#

unreal says noone ๐Ÿค”

royal isle
#

Hey guys I am getting this crash while launching my dedicated server, any ideas?

2020.03.15-18.24.10:320][  0]LogCore: === Critical error: ===
Unhandled Exception: SIGSEGV: invalid attempt to write memory at address 0x0000000000000003
 
[2020.03.15-18.24.10:321][  0]LogCore: Assertion failed: Index.IsImport() && ImportMap.IsValidIndex(Index.ToImport()) [File:D:/Epic Games/UnrealEngineSource/UnrealEngine-4.22/Engine/Source/Runtime/CoreUObject/Public\UObject/Linker.h] [Line: 110]
hoary lark
#

if I'm understanding correct

  • you want the client to have control over this thing. therefore you need to send an RPC from the client. you can only send an RPC from the client from some actor which the client owns. the client by default owns their PlayerController. so you could either send an RPC from your PlayerController telling the server "please move this other thing" or you could set ownership of this thing to the client and call an RPC from it directly
  • when you move it, you don't use a multicast. if the actor is replicated, its position should be part of its replicated properties. on the server you just move it, and it should soon move for everyone else
#

also I am loosely mixing the terms "ownership" and "authority" and I shouldn't be. by default the server has authority over everything, it may not have any net "owner" as you are seeing

#

furthermore the server generally retains "authority" over everything even if it is "owned" by a client - but if the client "owns" it, it can at least make requests to do things to it (i.e. send RPCs from it)

proper idol
#

@hoary lark your understanding is correct. i can move the thing the by setting its location within my pawn blueprint. however, i want to call a function from the actor (on the client), and in there it does some calculations. i am missing the step that after the calculation is done, the actor can somehow inform the server and all other clients about its new location. see, its all in the actor without an owning connection. i need to find a way to have me accomplish this, because as soon as i make an rpc from the client to the server within that actor, it does not work. and i know now why it does not, because no owner. that is why i came here to ask if i can do it from within that actor, so i dont have to rewrite alot of my bps.

#

if its a static mesh actor, it should be owned by the server, right?

#

"Server and Client Replicated Functions have some restrictions, for one they can only be used on Actors that have a Net Owner. Actors have Net Owners if they are a Player Controller or owned by a Player Controller. For example, a Pawn possessed by a Player Controller can have Server or Client Replicated Functions executed upon it."

#

so i take this quote as a word now, and i have to somehow rewrite it, thanks anyway @hoary lark @winged badger

hoary lark
#

if this actor should only be controlled by one player, you should set that player's PC as its owner and then you can just do RPCs on it whenever you want. if it needs to be moved by anybody then it should remain without any owner, and you should probably route RPC requests through each PC

#

(or maybe someone more experienced than me has some other more elegant solution, I still haven't done a ton of networking and also am running on 4 hours of sleep thanks to my ๐Ÿ‘ถ )

meager spade
#

have the PlayerController send the RPCs

#

and have this "actor" as its target

proper idol
#

@meager spade yeah i think i can do it this way, i have an interface call on the client and somehow that confused me (without real reason, just my weird brain), will just make the rpc to the server from pc, and from there call the actor interface, dengit ๐Ÿ˜„ problem solved without too much overhead, thanks everyone.

#

if that static mesh actor is present on the server, it should replicate to all clients

meager spade
#

if its spawned on server and replicates yes

proper idol
#

its a level (static mesh) actor actually, but just a blueprint around it. what if its not spawned on the server?

meager spade
#

if its placed in the level

#

and replicated

#

its fine

gritty pelican
#

i have problem with Steam function GetAllItems. When I try to call it on the dedicated server to get a list of items, nothing happens. Maybe this function is only for clients?

twin juniper
#

When i test the multiplayer twinstick example, is there a way to switch the current running process? Because if i hit esc the debug stops and i cant switch from client to server for example

floral tulip
#

hm someone know why, skeletal mesh armor via master pose (or animation blueprint copy mesh animation) does lag behind or forward the charackter on clients?

#

do i have to convert the armor pieces in runtime to a single skeleton mesh?

twin juniper
#

Someone know where i can access the name of the network connection/player? So for Example Client_1 or Server_1?

#

When i print a string to debug log then there is as the prefix the name of the connection

cerulean escarp
#

I believe you can get it from the playerstate

fleet raven
#

why would there be documentation

#

it's not a standardized format

#

it's just whatever they serialized in some engine version

sand tangle
#

Does IK foot/legs and hands require a lot of replication bandwidth?

winged badger
#

you don't replicate the IK

#

have it run locally

sand tangle
#

Hm, So in multiplayer, only the player himself can see the IK changes, not other players? :(

winged badger
#

that depends on the game

#

FPS, fingers wrapping around a gun

#

makes little sense to even run detailed IK for other players, you won't be able to see it anyways

#

for other stuff, not that hard to drop a trace when doing a step and calculating IK locally

#

there isn't any need to replicate anything, generally you care that you see other players moving fluidly, not so much if one of them stepped into a shit decal ๐Ÿ˜„

meager spade
#

IK is done in the AnimBP anyway

#

using data which is already available

#

all you need to know is the gun and its all done locally. No replication is needed.

#

I replicate one thing for the IK. The weapon itself.

bronze arch
#

how i can get port with BP that listening on dedicated server?

sand tangle
#

Thanks for the explanation :) IK legs can be quite visible in some situations. If I choose to replicate (if I need to), is there a big difference in the bandwidth between players?

meager spade
#

you dont replicate IK legs

#

its all done locally in the animbp!

sand tangle
#

Copy :)

meager spade
#

i have full leg IK, hand IK, etc

#

with 0 replication

#

even Turn In Place doesnt use anything replicated

chilly mist
#

If function A is a server RPC, function B is not RPC, then when A calls B, is B only executed on server?

vague turret
#

Does anyone have any experience with releasing a dedicated server + packaged game on steam? Our client can't see any servers even though the dedicated server is online, it was all fine before we changed our product status to "pre-release" state, it also works without steam

winged badger
#

@chilly mist yes

floral tulip
#

hm does anybody know why skeletal mesh components, like custom armor.. gets clippy/lag infront of the charackter on clientside while moving? i used to copy the animation with master pose and blueprint copy variation

#

does thats means i have to merge on runtime the skeletal meshes into one on runtime, everytime a player change a armor part?

chilly mist
#

Should I generally use Rename to set an UObject's outer, when dealing with subobject replication?

winged badger
#

you should generally have actor as outer so it doesn't change when replicated

chilly mist
#

Allow me to describe my problem. I ran out of ideas.

I'm making a multiplayer inventory system ( plugin ). Characters can pick up, and drop items. If server player's character picks up an item, then drops it, then the client player's character can also pick the same item up, and dropped it.
But if client character picks up the item first, then when it drops the item, game crashes due to nullptr.

My item is structured with an "item core" UObject, and an "item" Actor. The Actor is just a wrapper of the core. When an item is picked up, its Actor wrapper, with its 3D model and stuff, got destroyed, and the item core gets added into inventory. When an item is dropped from inventory, an Actor wrapper is spawned by the item core. The core then fills itself into the wrapper.

#

It's like the game works on more complex behavior, but crashes on simpler one.

twin juniper
#

Is GetOwningPlayer the same like GetPlayer 0?

lean river
#

hey anyone played with / using replicationgraph here ?:)

thin stratus
#

@twin juniper In a widget?

twin juniper
#

for example to Create a Server Session

thin stratus
#

That's fine yeah

#

You are local at that point anyway

twin juniper
#

So is there a difference or is the owning player always at array 0?

thin stratus
#

Well again, owning player in what context?

twin juniper
#

ah so when i am connected, the array index 0 is the server or the own player?

thin stratus
#

Sort of, yeah. Depends on where you are calling iz

twin juniper
#

oh

#

i thought it is always similar

#

so in normal blueprints

#

I am still wondering why i have the option for replication in events for "Run on owning client"

#

I mean it is the same like "Not Replicated" didnt it?

thin stratus
#

Run On Owning Client means it's moved from server to the owner of the actor

#

You should read the network compendium that is pinned to this channel

twin juniper
#

Ah that makes sense, thank you ๐Ÿ™‚ Ill look into it ๐Ÿ™‚

twin juniper
#

Can i start multiple Matches in a single Server? For example in a racing game starting a own Match for 2 players while 4 players are in an other Match?

chrome bay
#

negative

#

You can host multiple servers on one box, however (which is how it normally works)

plush wave
#

The Player Controller can have replicated properties right?

#

I'd assume they only get replicated to the server?

chrome bay
#

from the server

#

But yeah they can

#

Replication is always Server -> Client.

plush wave
#

So to go from Client->Server you always have to use RPCs?

#

Makes sense

chrome bay
#

Yep

vital pecan
#

Anyone managed to build dedicated server on 4.24.3?
@fluid finch Have you been able to accomplish this? I spent all weekend trying to get a dedicated server up in 4.24.2, I was following the wiki for 4.18. When I run the Server, it never seems to load the map & open port 7777.

fluid finch
#

@fluid finch Have you been able to accomplish this? I spent all weekend trying to get a dedicated server up in 4.24.2, I was following the wiki for 4.18. When I run the Server, it never seems to load the map & open port 7777.
@vital pecan not yet, but my co-worker does. I'll let you know once he shows me

vital pecan
#

Thanks, that would be amazing ๐Ÿ‘

gritty pelican
#

Such a problem. When I connect to the server, some actors do not replicate the variables. Maybe you need to enable Always Relevant?

silent quest
#

Hey guys, first off sorry for the re-post, didn't see this chat area before i posted my question originally.
I am trying to get my demo going, been working on my project a while now and I finally think it is almost ready for a demo phase, however I am wanting it to have some co-op ability in the demo. What would the recommended way to do that be? I can't decide if it should be client hosted or setup on a rented server. I am also on version 4.24.3

vital pecan
#

Rented server is expensive. I would try hosting yourself during your demo phase. I used Gamelift for a day and it was $20 with 0 traffic.

bronze arch
#

Wtf

#

i made my own chat server with UE4

#

lmao

#

all lobbychannels connected to one chat server. so you can talk even you connected other lobbyservers

keen thorn
#

Hi all, ive been having headache over trying to integrate gamelift into ue4

#

anyone here have experience with running linux dedicated servers on GameLift?

twin juniper
#

I look for someone, who could help me in a Project with different Tasks (paid)

feel free to message me.

Things they are good to know/must to know:

  • XSolla Login & Shop
  • Multiplayer (especially in Racing & Character Movement)
  • Dynamic Player Clothes - Switching Jacket Mesh if player bought it

Hopefully its not wrong in this channel, i didn't found a better place and i cant find a rule which says that i am not allowed to ask for paid help/development ๐Ÿ™‚

bronze arch
chilly mason
twin juniper
#

Thank you! @chilly mason

gentle sail
#

Hey guys. Can someone please tell me if there is an easy way to set variables in the game sate from a blueprint widget. Right now I found a work around where I create an event in the player controller, set that to server only and then that event sets the variable in the game state, I trigger the event in the player controller from the UMG widget. That works, but it seems quite messy. Any tips? ๐Ÿ™‚

brittle slate
twin juniper
#

When i set the checkbox run Dedicated Server, what happend? So did it automaticly start the server still if i set the autoconnect to false?

#

And how do i execute command only for the server there? If i use the Has Authority while the client not connected, it doesnt work properly. Is there a ServerStartedEvent or something like that to do actions when the server started?

humble zealot
#

hey could anyone help me with a method of getting the steam username, i have this but it doesnt seem to work

graceful cave
#

anyone have an issue on 4.24 with Logout() not being called in game mode?

misty relic
#

I want to start working on a small multiplayer fps. Could I use unreal blueprints for networking logic or would I have to learn networking in cpp

graceful cave
#

blueprint works fine

#

cpp is a bit more capable but as far as learning goes, bp will make it much easier to start

misty relic
#

cool thanks

sand tangle
#

Has there been any news regarding replication of Chaos Destruction?

#

It will happen, right?

harsh lintel
#
    FRootMotionSource_ConstantForce *ConstantForce = new FRootMotionSource_ConstantForce();
    ConstantForce->InstanceName = FName("PainKillerHookProjectileRootMotionForce");
    ConstantForce->AccumulateMode = ERootMotionAccumulateMode::Override;
    ConstantForce->Priority = 1;
    ConstantForce->Force = NormalizedDirectedForce * Speed;
    ConstantForce->Duration = TimeNeededForConstantSpeed;
    ConstantForce->FinishVelocityParams.Mode = ERootMotionFinishVelocityMode::SetVelocity;
    ConstantForce->FinishVelocityParams.SetVelocity = FVector::ZeroVector;
    HitCharacter->GetCharacterMovement()->ApplyRootMotionSource(ConstantForce);

Im using a constant force on the server but it doesn't look smooth on some clients
stutterish
is there something I can do so the force on the character looks smooth

rain sandal
#

FRootMotionSource_ConstantForce is bugged

#

think you could cherry pick fix from 4.25 already if needed

harsh lintel
#

im using 4.23

#

ill just use other stuff instead of constant force I guess

#

The cilent on the right is clicking on the floor and should turn towards the location clicked, but it doesnt, the second client (left) does see the actor rotating what could I be doing wrong, Im' just calling AActor::SetActorRotation

snow cliff
#

are reliable always executed on the recipient pc in the same order, no matter in which order the packets arrive?

fossil spoke
#

No

#

They are only guaranteed to arrive at some point.

snow cliff
#

ok so I can call event KillTroll(), then ReviveTroll(), reliably, but it might very well happen that ReviveTroll() is executed first, then KillTroll()?

#

are you sure on this? I tried to find it in the documentation but didnt manage to

fossil spoke
#

Yes thats correct.

#

RPCs are fire and forget. You cannot rely on them executing in the order you sent them.

#

Probably not, you are better off reading the engine source code.

snow cliff
#

@fossil spoke ok, then I need a bit more code, but thanks
but good that I asked, because I was just about to assume that order is in fact guaranteed

#

@uncut oracle some time since I read that code, when are the packets sent?

#

have you tried reading the source code?

#

I think I actually never looked at that part of the netcode
have you looked at IPNetDriver::TickDispatch as well?

#

also there is ProcessConnectionlessPacket
But not sure what exactly that is

chilly mist
#

If I have a replicated TArray, and also a multicast RPC that modifies that array, then will they result in conflict? Will there be 2 modifications to the array, when the RPC is called?

fleet raven
#

don't ever modify replicated arrays on the client side

#

it will not go well

chilly mist
#

Basically server replication and client's own modification will conflict each other?

fleet raven
#

yes

#

and resizing the array on the client is completely taboo

#

that will straight up break the replication

chilly mist
#

Good to know let me not do that ๐Ÿ‘๐Ÿฝ

chilly mist
#

Say an actor has a UObject property. If the UObject gets added to a TArray somewhere else, and the actor then gets destroyed, should I use Rename to set a new outer for the UObject?

humble zealot
#

really need help guys, for some reason VOIP is showing that the 1 person thats speaking is someone else, this is the same code i use for my chat system, which works perfectly, but for voip not so much. How can i call a players steam username properly

hoary lark
#

@snow cliff @fossil spoke FYI I believe reliable RPCs called from the same actor are guaranteed for order

fossil spoke
#

Are you sure?

hoary lark
#

have never verified personally. going on various google results and messages mostly from zeblote and jamsh.

fleet raven
#

reliable bunches sent in the same channel are guaranteed ordered

#

each actor sends reliable rpcs in its own channel

#

so you get ordering between them, but no ordering between multiple actors

#

btw, there is a catch

hoary lark
#

I'm wondering if there's some edge case that could occur where a 2nd RPC is sent before ack for the 1st RPC is returned - like I'm guessing order would only be maintained if e.g. two RPCs are called in the same frame?

fleet raven
#

if your client is lagging for around a few seconds, the engine will clear your view target, which temporarily results in all actors being not relevant to your connection, which results in reliable rpcs being dropped (I've just commented out the seemingly pointless code that does this to fix the issue)

#

queued reliable bunches are guaranteed delivered and ordered

#

regardless of what frame they were sent in

#

it has a resend queue per channel on the server, and a reorder buffer on the client

#

if you send too many reliable rpcs at once and fill the resend queue, the client is disconnected

hoary lark
#

ah, like if the other side receives bunches tagged 1,2,3,5,6,7 it will realize "hey I never got 4 I gotta wait"

#

simple enough in laymans terms

fleet raven
#

yeah basically

#

what actually happens is it receives and acks 1-3,5-7, processes 1-3, the server receives the ack mask and notices the missing 4, resends it, client receives it, immediately processes 4-7

#

the resend queue fits something around 200 bunches if I remember right

#

btw, unreliable packets also get acked

#

so the server theoretically knows if they were received

#

but this info never leaves the low level stuff

#

it's how it knows when to resend a replicated property delta that was put in an unreliable bunch

#

(if there were no acks on replication, it would have to periodically resend all properties that were ever changed "just in case", so clearly we can't have that)

plush wave
#

If your client is lagging for around a few seconds, the engine will clear your view target, which temporarily results in all actors being not relevant to your connection, which results in reliable rpcs being dropped

#

^This is interesting to me. Does the engine do this in an attempt to reinitialize the connection?

high knoll
#

Anyone have any idea how to handle networking errors in C++? Specifically connecting and traveling errors. I haven't been able to find delegates to bind to or methods to override anywhere. I did find HandleNetworkError and HandleTravelError in C++, but they are specifically for Blueprint. I also found events in GEngine, OnNetworkFailure() and OnTravelFailure, but neither of them get called when a network error occurs, at least a connection timeout error.

chrome bay
#

The GEngine ones are the ones to use. The BP events bind to those as well.

twin juniper
#

Is there a way to hide a specified client for an other client?

shut gyro
#

@twin juniper either SetOwnerOnlySee(true) if you want to hide your own client pawn/character for all other clients or if you want a specific one, do a Server / Client call on a player state that you want to turn off and pass in your own pawn and call OtherPawn->SetVisibility(false) on the specified Client function's receiving end

twin juniper
rare cloud
#

@twin juniper its name is SetOnlyOwnerSee

twin juniper
#

Ah yea, thank you ๐Ÿ™‚

#

That is not working. I am in the Pawn of the Player. Maybe i need to manually refresh it?

#

Ive tried to other way but i can only make myself invisible, not for other clients

twin juniper
#

it looks that executing from my character pawn a RPC Event Call, it doesnt get multicast to the other clients ๐Ÿ˜ฎ But the Pawn is visible for the others? Why it doesnt work?

fleet raven
#

@plush wave I don't know. it just does, with no comment, for seemingly no reason. nothing breaks by commenting out that code and having your reliable rpcs actually work

chrome bay
#

Anyone have a solution for launching a dedicated server from visual studio? Normally I have to run the .exe then attach the debugger, but it's crashing so early I haven't got a chance to do so.

#

It's all been built and cooked

fleet raven
#

I was trying to do that aswell, configuring vs to launch it seemed super annoying so I just used that "entrian attach" extension which can instantly attach the debugger to processes being launched externally, works great

chrome bay
#

Ah awesome, I'll give that a go. Thanks!

#

Oh F, course it isn't free ๐Ÿ˜„

fleet raven
#

maybe there's other ways

chrome bay
#

10-day trial... that'll do me for now

#

Damn, that works annoyingly well. Hell I may just buy that

dark edge
#

@twin juniper Multicast can only be called from server. You need to RPC to server then Multicast to everyone. 2 calls.

twin juniper
#

Ah okay

#

so a bit weird but if it doesnt work better ok, thx ๐Ÿ™‚

dark edge
#

What is triggering this Multicast? Is it from player input or something else?

stable kindle
#

Hi so something that has me has my hair tearing out. I have a debug version of my game that i upload to steam and some unreliable rpcs that work fine. i then create a shipping and/or test build and i upload that and my rpcs don't seem to be being called

#

Any help would be great i really don't even know where to start with this.

harsh lintel
#

Im using SetActorRotation and it is reflected on all clients(left window) but not on the local client that triggers the rotation (right window) what can I do

twin juniper
#

@dark edge triggered by a Pawn

tardy orchid
#

Hey everyone I have a weird problem with getting in vehicles in multiplayer
The blueprint is pretty simpl
On begin overlap> check if occupied bool> let the controller know that it can get in

#

And when I get in the vehicle the bool Occupied is set to true

#

But other players still can get in for some reason

#

Long story short I can't make the Occupied bool change so other players would see it changed too

fluid crag
#

Can I host an online game server for free?

#

Because photon provide that ability for few ccu.

twin juniper
#

can I have someone connect to a listen server through the internet in a development build?

#

simple as going open mapname?listen

ocean geyser
#

if i recall ive done it but im not 100% sure. make sure ports are open, the other pc that connected was using a packaged version

twin juniper
#

alright, I'll give it my best shot

dark edge
#

@twin juniper No i mean is input triggering it or some other event?

#

@twin juniper Forward ports and you can do it from the editor or any other way

idle flame
#

Hello, I'm creating a dedicated project,
I would like to start the server with a command and connect client with ip, any idea on how to do this

dark edge
#

@idle flame You just..... do exactly what you just said. Fire up the server and connect from a client.

twin juniper
#

Yes but i need to forward it to server and then using multicast

weary cave
#

@uncut oracle I think if you put a breakpoint on StatelessConnectHandlerComponent::Outgoing you'll see where everything is coming from.

idle flame
#

@dark edge I've create a server with the -server flag, but it don't work

#

@dark edge It doesn't start the server with only a terminal

twin juniper
#

@idle flame just check on start if it is a dedicated server and create a server then

idle flame
#

@twin juniper how can I check if it's a dedicated server ?

#

I've compile the project, so I have a .exe and when I start the server with : game.exe -server -log, and this is not working

twin juniper
#

There is a function โ€žisDedicatedServerโ€œ

dark edge
#

@idle flame This is what works for me.

"C:\Program Files\Epic Games\UE_4.20\Engine\Binaries\Win64\UE4Editor.exe" "%CD%\ShotInTheDark.uproject" TestMap -server -log -nosteam

#

so -server -log at a minumum for you I'd think

#

That's for firing up a dedicated server for testing. For deployment you'll want to follow the cooking and building for dedicated servers guide.

weary cave
#

Hey multiplayer people, I've got dedicated UE4 servers running in AWS behind a network load balancer. The way it works at the moment, there's a service that listens for UDP traffic and when a new endpoint is discovered, it sends the player to a server that has room for another player. That service proxies the traffic between the players and the servers. What I need to do next is support matchmaking so that the right players go to the right servers. In an attempt to do this, I followed the lead of OnlineAuthHandlerSteam and wrote a packet handler that sends a player Id so that when UDP traffic lands on the load balancer, I can know which UE4 server to send it to (by parsing the data directly). The problem is that the handshake packets from the auth handler come after the StatelessConnectHandlerComponent handshake. The only thing the network load balancer has to go on is source/dest ip:port, so I need to get my identifying data sent right up front. Is there a way to send data on the connection before the StatelessConnectHandlerComponent handshake? Do I have to modify StatelessConnectHandlerComponent? I'd really rather add plugin functionality than start changing the engine code.

weary cave
#

@uncut oracle It looked to me like all the handshake data and game packets were all going out through that Outgoing function. To figure out what's sending it, you need to look at the sender rather that the receiver. Maybe I'm missing something.

ocean geyser
#

im looking through the engine code (not built from source) and im slowly putting parts together, but what im wondering is how does UE4 serialize classes/structs/variables and such to be sent over the network and rebuilt such as sent from client to server? im looking for the code that takes care of all that to try and learn from it

#

nvm partially found it in the serialization section. an explanation from someone else that knows wouldnt hurt either

winged badger
#

read NetSerialization.h

dark edge
#

In general, do you guys consider leveraging RepNotify extensively to be good practice?

#

I like designing around state and state changes so it's my natural approach.

meager spade
#

Over a multicast? sure

#

Multicasts are for One time events that happens, and never care about again

#

OnRep/RepNotifies for "states" of actor.

#

IE: Particle and effect of a Chest opening == Multicast. Chest being opened/closed == RepNotify/OnRep

fleet raven
#

once push model is ready having giant amounts of rarely changing replicated state will also be very efficient

chilly mason
fleet raven
#

network next doesn't work with player hosted servers, they require you to run dedicated in specific data centers

chilly mist
#

Getting to the last bit of making my inventory system networked, but stuck on this one. I posted on Reddit but hasn't got it resolved. Can anyone help out?

So all the internal inventory logic, like picking up and dropping items, is working with multiplayer. But when a character equips a weapon, it always appears smooth on listen-server, but jitters big time on client, regardless of who's controlling it. The video shows this: https://vimeo.com/398196936. Listen-server is on the left, client is on the right.
On client-side, character seems to keep jumping to something.
Here's the code that makes character equip a weapon item, by attaching the weapon to a socket on character's skeletal mesh. The code is in the character's class.

ItemToEquip->SetActorEnableCollision( false );
ItemToEquip->AttachToComponent( GetMesh(), FAttachmentTransformRules::SnapToTargetIncludingScale, "RightHandSocket" );

This is "Equip jitter" by Freeman Makes Games on Vimeo, the home for high quality videos and the people who love them.

โ–ถ Play video
#

General direction like what should I look at and study is also greatly appreciated..!

fleet raven
#

just seems like you accidentally got collision enabled on your weapon and it's exploding the character movement on the client

chilly mist
#

In the equip function, which is a server RPC, I have the line:

ItemToEquip->SetActorEnableCollision( false );

To explicitly disable the collision. But it looks like the collision is still active on client?

#

Maybe the disable of collision isn't replicated to client?

fleet raven
#

that's not gonna replicate by itself

#

few things do

chilly mist
#

How can I replicate this disable of collision?
It looks like SetActorEnableCollision changes the bActorEnableCollision in the Actor class. But I don't think I should set that variable to "Replicated"?

fleet raven
#

have something that runs on the client when you attach the weapon

#

could be an onrep variable or whatever

chilly mist
#

Do you mean to make an extra replicated variable, and in its RepNotify function, disable item's collision?

fleet raven
#

that would work

chilly mist
#

Let me try now!

chilly mist
#

@fleet raven Wow, that worked on first try! Amazing.Thanks for the help! You've helped solve quite some problems of this project of mine, and I believe that's the last major one.

fleet raven
#

nice

chilly mist
#

If you have the time, can you explain why a net multicast approach I tried earlier didn't work? So there's a server RPC equip function, which just calls a net multicast RPC. The multicast RPC does all the actual equip logic, including disablling the collision as well. But client still jittered.

fleet raven
#

did you make sure it actually arrive on the client?

chilly mist
#

Hmm, I didn't. Yeah, maybe I should've set a breakpoint in VS.

#

Not gonna revert to that version of code though. Scared o_o

#

But is this approach of extra replicated variable a best one? I mean, it looks like for every un-replicated variable in the engine code, if I want to replicate it, I need to add and maintain such a new replicated variable?

fleet raven
#

if they didn't replicate something, you'd have to do that yeah

#

also consider whether something is state or a one time event

#

late joining clients will receive the current state of all replicated variables, they will not receive prior rpcs

chilly mist
fleet raven
#

with push model coming up it'll be no issue to have tens of thousands of unchanging replicated variables

#

(honestly don't get why that isn't how it was designed from the beginning, but well, better late than never)

chilly mist
#

I've never heard of the push model. Even search engines don't return many results on that o_o
But I do remember push/pull being a software design thing.

oak hill
#

Hello guys, I've one question about sof references. What if I load a soft class on the server and then spawn a replicated actor? Is the class automatically resolved on clients if it's not already in memory or should I provide a system to load the references in memory on both server and client before spawn?

winged badger
#

it should load sync, but not sure, its not too hard to test

chrome bay
#

Yeah it's resolved / loaded automatically

#

When you rep an actor for the first time either the acked class GUID is sent along with it, or the full FName of the class if not.

oak hill
#

Thanks guys. I asked because I can't test at the moment on a remote machine and when testing in PIE if I'm not wrong the references are loaded one time for both server and client

winged badger
#

not if you uncheck use single process

#

in advanced play options

#

then a standalone instance gets launched and connects to the PIE one

#

and you can choose which instance you get to run in PIE, server/client

oak hill
#

cool @winged badger! I will test it, thanks

chrome bay
#

I don't suppose anybody has been able to test running a Steam dedicated Server on a machine, then connecting to it as a client on the same machine?

#

Server works fine connecting across two different PC's, but on the same PC it immediately drops the connection. My guess is Steam doesn't like it, wonder if there's a way around it.

bitter oriole
#

No, you cant do that AFAIK

#

Maybe with a VM

chrome bay
#

Damn. Thought as much. Okay third PC it is ๐Ÿ˜ฆ

fossil veldt
#

IIRC there is a way to do it, Steam doesn't like you having more than 1 open session per local ip regardless afaik

#

But I managed to find a workaround last time I was developing for steam using UWorks

#

I think it was using this

#

But it was ages ago, maybe 2-3 years ago so I can't really remember

chrome bay
#

Thanks, I've got it hooked up with three PC's now but I'll try that next time

fossil veldt
#

No woz

slate veldt
#

Hi all, for some reason my clients appear to be lazy loading Data assets rather than loading them instantly.

For context I follow a similar method to the ActionRPG example (although I now regret it a little)

My Server has weapons that are spawned on Begin Play from classes referenced by a UPrimaryDataAsset subtype.
The Data Asset is then force loaded by the Asset Manager and the weapon is spawned based on the referenced blueprint class.

The weapon appears instantly on the server, however each client then appears to load each of these weapons in it's own time (anywhere from 3 to 6 seconds).

This delay is causing some issues and I'm really not sure why it's occurring. It seems like the client's are lazy loading before then resolving a GUID.

Has anyone else come across similar issues or can help me with a solution?

mighty yoke
#

Quick question
How do you detect that everyone has finished loading/travelling after doing a server travel?
I want to make sure everyone is loaded after travelling from lobby to arena before starting the match

steep cipher
#

send an rpc to the server from every client as they finish loading

fleet raven
#

@slate veldt it doesn't seem like anything is preloading the asset on the client side. if you don't, replicating a reference to an asset will use network async loading, which can have a slight delay

#

that said, 3-6 seconds to load a simple data asset sounds ridiculous, so maybe more is happening here

pearl pollen
#

Hi everyone! I'm having some issues and I can't wrap my head around why they are happening... I have a chain of events:
Client requests data -> Server receives data and waits for other components -> All components ready, data gets processed on the server -> Server sends back some specific data to the client

#

Client receives that data around 30% of the time

#

How can an RPC to the client fail if it was the client who initialized it?

mighty yoke
#

Is there something that is triggered when loading is finished after server travel?
Does EventBeginPlay work?

slate veldt
#

@fleet raven That's what I was thinking - as there is only a small number of variants at the moment, I was considering just loading them all on begin play on the client and then the resolving GUID should happen much quicker

Also yes it sounds absolutely ridiculous, I have no idea why it's taking so long. It's literally an asset with a few simple types (float, gameplay tag etc.) and then a reference to a blueprint actor class which is literally a static mesh and collision box. Really routine simple stuff!
I'll see if I can pre-load them in anticipation

half jewel
#

@fleet raven push model ? where can i read up on this upcoming change?

tardy orchid
#

Hey guys, I'm making a mobile fps shooter and I was wondering what is the best way to host servers. I've already managed to make my own pc a dedicated server but I can't find any documentation to for example make a server browser. Would Amazon Game lyft be a good option?

barren warren
#

@tardy orchid If I understand you correctly you're looking for a way to host authorative servers yourself? Generally you have two ways of going forwards, if you want to keep costs low, you can have a small 'matchmaking' server to handle communications between clients, and have one player be selected to host for the game. Or you can use your own servers, (like AWS gamelift). Though you will want to keep an eye on pricing on those, as they can get quite expensive quite quickly.

tardy orchid
#

Ok and if I also want to keep track of which account is what level and has how much coins, what would be the best way to take care of that

barren warren
#

If you go with AWS there's managed solutions there for most common types of db

tardy orchid
#

Oh yeah that's the keyword I was looking for Database, thanks I'll look into it

barren warren
#

It might take a little bit of learning to get up to speed so I'd recommend looking at a tutorial on the db to get a little more context as to whats going on.

sand tangle
#

I trying to do some replication and I have a general question. I have a weapon class with a Fire-function, which is triggered with a InputFire-function in the character class. Do I only need a server fire-function in my Character class, that triggers the Fire-function on the weapon? Or do I need to set up server functions on both character and weapon?

eternal briar
#

For single player games, the default ENetRole of an actor is ROLE_None or ROLE_Authority?

sand tangle
#

Why do I get: Unrecognized type 'void' - type must be a UCLASS, USTRUCT or UENUM

UPROPERTY(Server, Reliable, WithValidation)
void ServerFire();
cerulean escarp
#

this is my code for spawning the player's HUD when they're spawned into the game, and is called on beginplay for the character. For some reason the first client in spot 0 always has more than one HUD attached to them. I tried making sure that the player controller was the correct number but it still duplicated it on player 0. Any ideas?

meager spade
#

@sand tangle UPROPERTY ??

#

@cerulean escarp dont use PlayerController 0, unless you understand what i means. And this is on the local lcient only right?

sand tangle
#

@meager spade omg, thanks.

cerulean escarp
#

@meager spade yes it should only be on the local client

sand tangle
#

Is there a book / course / tutorial that explains everything within UE4 replication?

oak hill
#

@cerulean escarp I would put all UMG related code in a AHUD class. It's only present on the local client so when the widgets are spawned you don't have to filter the controller, you can just use player controller 0

jolly siren
#

Does anyone know why Ping * 4.f would be different on Client B than ExactPing is on Client A? The replicated ping looks to be around 18ms higher than ExactPing.

#
    // Calculate the average, and divide it by 4 to optimize replication
    ExactPing = (Count > 0 ? ((float)Sum / (float)Count) : 0.f);

    if (bShouldUpdateReplicatedPing || !HasAuthority())
    {
        Ping = FMath::Min(255, (int32)(ExactPing * 0.25f));
    }
#

I only see an error of < 4ms here

cerulean escarp
#

thank you! @oak hill

floral umbra
#

I had a question Im almost finished implamenting the muliplayer the max players that can join is 4 however I atn 1 player controlled Enemey to also have the potential of joining the game so would I need to set the max players to 5 or set the PCE as a seperate join value?

native axle
#

How do I edit the predictive movement on the client-side for non-local characters? When I have a unit moving on the server and it suddenly stops, you can see that it sometimes jerks back. Like in the screenshot I'm moving left on the server and when I stop it moves back one move?

steep cipher
winged badger
#

@jolly siren no guarantee those are sent in the same frame i think

twin juniper
#

Hi, for don't replicate specify variable in the struct is with the NotReplicated ?

jolly siren
#

Thanks Zlo, that's what I was thinking too

#

@twin juniper Yes, you mark it was NotReplicated if you need it to be a uproperty

twin juniper
#

ok, and the ReplicatedUsingwork in struct?

unique kelp
#

Is there any build in console command to display the IP of the server i'm connected to as a client?

#

once the build is done, that is

#

kind of like a version of "stat net" that shows additional info

jolly siren
#

ReplicatedUsing works for the struct as a whole

twin juniper
#

ok thanks

jolly siren
#

np

twin juniper
#

and other thing, any way to GetWorld in a Struct?

#

i try with UWorld::GetWorld()

meager spade
#

Really should not be getting a world in a struct

#

If you need world access maybe consider making it a uobject

winged badger
#

its fine for member structs that have a weak pointer to owner

meager spade
#

in odd cases, sure, but general rule, should not really access world from a struct

fluid finch
#

Why are level blueprints replicating by default?

chrome bay
#

Normally you would want level-wide events or properties to be replicated no?

woeful ferry
rotund sapphire
#

server also execute multicast, maybe thats why it run twice to spawn 2 guys

woeful ferry
#

So the server proxy on client-side spawns the cable?

meager spade
#

should not use Multicast to spawn an actor unless it only client side

#

Server should spawn it replicated

woeful ferry
#

@meager spade Thank you! Makes more sense now, it works now ๐Ÿ˜„

next fable
#

Hello everybody. I was hoping someone could point me in a general direction. I am creating a multiplayer game.
I wanted to have a player HUD that changed depending on what the player has done. For example if the player had Hosted or Joined a game, etc.
I created a variable in a custom PlayerState, but this state seems to reset each time the player loads a new level.
Is there a best practice regarding maintaining a custom player state (enum) that persists with the player between levels?
TIA.

glass plaza
#

Still trying to get the hang of map travel, is there a reason why a Server travelling to a new map with players in the game would not call any of OnPostLogin or OnSwapPlayerControllers when the players reach the server?

#

@next fable GameInstance is one of the only thing that doesn't get destroyed when you travel to a new map. Try putting it in there or otherwise, you have to flag the PlayerState as persistant

next fable
#

@glass plaza Thanks

tardy orchid
#

Hey everyone, quick problem, I'm making a multiplayer fps with tanks and when someone gets in a tank other players can still get in it, I have a bool IsOccupied and I've set it to replicated but other players always see it as false ( the player that gets in can see that the bool changed )

twin juniper
#

Hi, i want to replicate ActorComponent only to the owner of this Component. I mean, i only want to replicate the inventory to the client who owned of this character, not other clients

tardy orchid
#

Even this approach is not working

bitter oriole
#

@tardy orchid Was the value changed on the server ?

tardy orchid
#

yes I tried a custom event to run on server but it still didn't work

#

to change the value

#

but far as I know I don't have to change replicated variables on the server

#

and still this photo example above should work

bitter oriole
#

Yes, you do have to change it on the server

#

Replication is strictly server - to - clients

#

Player Controllers are also not replicated to other clients

#

Hard to say more without more code

viscid escarp
#

Anyone who makes a successful dedicated server with steam that can answer some questions please?

unique kelp
#

just ask and if someone knows the answer they will respond

rotund sapphire
#

@viscid escarp you can also try shootergame or generic shooter i think both has basic setup for working with oss/steam. there are many tutorials as well you can follow along.

viscid escarp
#

@unique kelp is not an easy problem. I followed dozens tutorials and pages, already contacted the Steam Support, asked for help here and nothing works. But, here we go again: when i start the server, the steam INTERNET tab is not showing my server in the list. Seems like is a steam master server issue. Also, i can't "find sessions".

#

@rotund sapphire i'll try that thanks

rotund sapphire
#

i think you can run server at home but you cant connect. Instead, you must upload and run the server in cloud (or another pc from other network)

viscid escarp
#

Already tried. Didn't work.

twin juniper
#

Hi, i want replicate ActorComponent (Inventory) of my Character only to the Client owner of the character.
I mean... if we have 5 clients, with 5 differents clients, if 1 character add item to his character, only replicate the inventory component to the client of the character

tardy orchid
#

@twin juniper have you tried checking the Component replicates box?

#

Or unchecking

twin juniper
#

what?

#

for now my actor component replicate for all clients

#

and this is what i don't want

#

only want replicate the component to the client of the character

meager spade
#

if your character replicates, all components will replicate with it

#

if you need it specific to that player, why not shove it on the PlayerController?

#

its server and local player only

#

or make a Inventory Actor and set it to Replicates owner only.

sly arch
#

Am I able to put a MySQL database on a VM or VPS so i'm not limited to the amount of queries i can do?

half jewel
#

why not set inventory properties in the component to cond_ownerOnly ??

tardy orchid
#

@bitter oriole well I tried changing the variable on server but it didn't change at all and if I set the RPC to not be replicated or multicast or run on owning client, the (SomeoneIn) changed variable is only visible to the player that got in

#

Problem stays the same, if I get in a tank, other players can still get in which messes up everything

gaunt cliff
#

A fellow who spent three days trying to get character selection working with no avail

#

I've followed the Blueprint Multiplayer tutorials on Youtube from Epic

#

Up until this episode

#

I don't like how he's hardcoding character selection, so I opted to create my own dynamic version, however the characters only appear on the server, not reflected on the client

#

This is a widget blueprint called CharacterSelect, what it does is it loops through an array of characters class and creates a button for each character inside the said Widget

#

however, this code only shows the characters on the server (Host), on the client it displays and empty window

#

I have played around with the code, moved it to LobbyPC (which is the player controller assigned to users who connect to the game), moved it to LobbyGM (which is the lobby Game Mode)

#

played with variables, made them replicated, made the functions replicated to no avail

#

any hints, tips, or resources i can use would be much appreciated

meager spade
#

well, the stuff has to be replicated