#multiplayer

1 messages Β· Page 716 of 1

chrome quest
#

But it works

pallid mesa
#

hahaha, yes, but it's our bread and butter, gotta deal with it

#

Dave Ratti wanted to rewrite it for a long time

#

but that got on hold unfortunately

limber gyro
#

whos dave ratti?

chrome quest
#

Then he leftπŸ₯²

limber gyro
#

and why did he leave?

chrome quest
pallid mesa
#

Dave Ratti was one of the main networking guys in Epic πŸ˜„

#

quite beloved around here, and he liked to approach the community from time to time

chrome quest
#

A new networking solution for the engine

#

He was quite helpful. Even had a few videos on his channel.

limber gyro
#

that wouldve been awesome tbh, i asked for some info on that in some UE4 stream and only got the silent treatment

#

imo its very very needed

chrome quest
#

Ah.. don't take it personally.

limber gyro
#

u cant have the best renderingengine in the industry and have a class that needs rewriting badly

chrome quest
chrome quest
limber gyro
#

well it works fine, why do u think it needs a new networkign solution all together?

chrome quest
#

It's designed for small maps with low player count. And takes a lot of hackery to support a larger player count

chrome quest
#

See above

limber gyro
#

oh ye, i heard they had to work quite a bit on it because of fortnite

pallid mesa
#

Fortnite says otherwise πŸ˜„

#

but yeah you can see the amount of engineering on top

chrome quest
limber gyro
#

tbh i wish they had proper suport for MMO's or at least make the code base more manageable to the point where u dont need to write third party solutions

pallid mesa
#

rep graph, adaptative net update freq, push based networking, skipping things for replication, batched RPC's etc etc

chrome quest
#

Trust me

limber gyro
#

i did manage to make a overwatch style shooter with matchmaker using playfab

chrome quest
#

Although.....

#

Things may eventually change

#

With the way the engine is evolving

pallid mesa
#

whispers mass

limber gyro
#

well, if i did something liek a 100 to 200 player server

chrome quest
#

Mass

limber gyro
#

maybe it wouldnt be so hard haha

#

it would be a fun chalenge at least

chrome quest
pallid mesa
#

but yeah... mass is supposed to be used for specific problems

#

actors are there to stay

chrome quest
limber gyro
chrome quest
chrome quest
pallid mesa
#

you can make it run better clicking a pair of buttons

limber gyro
#

well, there was a guy in the forums a few years ago making a mmo dev kit for unreal

pallid mesa
#

ie: linear interpolation... etc

limber gyro
#

and he tested with like 150 players and he said it ran fine

chrome quest
#

Custom server I think

limber gyro
#

not sure what he did tbh

#

but the movement was quite simple

#

it was just ur regular walk around thing

eternal canyon
limber gyro
#

no flashy moves

chrome quest
pallid mesa
#

well im profiling recently and scalability is still not so great

#

no optimizations what so ever

#

just 50 cmc's in a blank level

chrome quest
#

You'd have to do some custom stuff. Like slowing tick rate for distant characters. Removing some redundant checks.

pallid mesa
#

it's, what you could call, playable... but the game time goes up quite a bit... considering you are supposed to have more things than just characters in a game

limber gyro
chrome quest
eternal canyon
#

actors have that already

#

if ur talking about relevance

chrome quest
#

Do don't want to slow player movement. Since the server runs it's own calculations

chrome quest
eternal canyon
#

oh wait

#

ur saying ai

chrome quest
#

The server also simulates character movement and servers generally aren't the highest end computers so it's taxing on them.

chrome quest
#

You'd need a manager actor for ai characters to slow their tick rate and other stuff when they're far from the player characters.

This way you can have 3x maybe 5x more characters in the world

#

If most of them are ai though

pallid mesa
#

It's not hard to steal this code from the LOD processor from Mass entities

chrome quest
#

Actually. I would love to explore this.

pallid mesa
#

pinned comments

chrome quest
#

Yeah. I've gone through the project. Awesome work you did. I hope to contribute also.

pallid mesa
#

open to it, now we are collecting community feedback for Mass for Mieszko

magic yoke
#

I'm stumped why I can't use that struct as a variable type

chrome quest
#

And it's all bp?

chrome quest
pallid mesa
#

We are now taking a mini break, quite exhausted from life as of rn x'D

chrome quest
stone niche
#

Hi, I wonder if anyone in this thread can help with a replicated move problem.
I am working on a fast paced FPS with a fairly robust movement system, heavily customised from the base UE code.
The reason, under high ping / high loss conditions, server corrections become excessive, and the limiting factor in resolving this, is the megre three moves that can be (re)sent per packet (New, Pending, Old).
I have done a lot of work on coding custom CharacterNetworkMoveData structures, FillNetworkMoveData and Serialization functions.
I can serialize and send an array of SavedMoves to cover +500ms ping and +10% packet loss. (next step will be to send only deltas to save space).
The issue, to de-serialize the data container at the server, I need to cast my custom structure to be able to replace the three moves with my array, but ServerMovePacked_ServerReceive is not virtual, so cannot be overridden, and the function that calls it, ACharacter::ServerMovePacked_Implementation, is also not virtual. Any ideas welcome?

limber gyro
#

sounds like ur working on a farily complicated project that would warrant engine source changes

#

would love to help further but im just getting started with the CMC myself

stone niche
#

It is a big project, a small team of us are updating a 20 year old game from the IDTech engine to UE, but so far we have managed everything without touching the engine directly, which makes keeping up with the latest engine releases easier, so for the sake of this one function, it is frustrating.

limber gyro
#

I implemented my CMC custom movement thing but im still getting a bunch of net corrections?

#

any ideas what could be going wrong?

stone niche
#

Do you have a very long piece of paper, I have spent the last six months chasing down and fixing many causes of corrections, half of them issues with the UE code.
I used lots of "PrintDebugString" messages to track down issues and patch them one at a time.
The first thing you need to do is start identifying under what conditions they are better or worse, so when you run in editor with low ping and low loss simulation, do you still get lots of corrections.

limber gyro
#

im just using the editors default settings i assume

stone niche
#

If you have implemented any custom code that affects position or velocity, then that must be replicated to the server too, and past back in corrections, otherwise the Prediction system goes out of sync.

limber gyro
#

this is my code

#

i override calcVelocity

#

and just pass a bool to the CMC

#

some one told me that was my best bet on how to implement a dash

#

do i need to send back my velocity or something like that?

stone niche
#

There are a few ways, best thing is to follow a tutorial on youtube, it would be too much to type here. The problem is, once you get all that implemented, you still have to go in an fix the correction problems caused by the base engine code too πŸ€¦β€β™‚οΈ

limber gyro
#

well i followed a tut, but the tuts dont do things exactly how i did so i am a bit lost

#

how do i go about finding where the bug is?

#

what would be a good place to start?

stone niche
#

Disable your new function, do you still get corrections?

limber gyro
#

will test

#

gimme a sec

#

can confirm that corrections only occur when calling the dash

stone niche
#

under the Play dropdown, Advanced..

#

Turn OFF the Enable Emulation

#

Or, just set the latency and packet loss to zero.

#

The existing move replication only sends three moves at at time, so anything over a ping of 40 you will start to see corrections whenever anything gows a bit out of sync.

limber gyro
#

mine is turned off by default

#

i added the following line to the function "updateFromCompressedFlags" and now the dash doesnt work

#

bRequestDash = (Flags & FSavedMove_Character::FLAG_Custom_1) != 0;

stone niche
#

If you get corrections with that off, then the server is not executing the same code as the client, or is running the same code but in a different order.

fathom aspen
#

Prolly that event is running on client, that's why the value isn't being updated\replicated

limber gyro
#

im gonna print velocity to see if its the same in the server and in the client

#

LogNetPlayerMovement: Warning: *** Server: Error for Shadow_C_0 at Time=4.594 is 27.308 LocDiff(X=17.001 Y=21.370 Z=-0.001) ClientLoc(X=2925.690 Y=-960.900 Z=207.860) ServerLoc(X=2942.691 Y=-939.530 Z=207.859) Base: None Bone: None Accel(X=0.000 Y=0.000 Z=0.000) Velocity(X=-815.878 Y=-1025.886 Z=-555.644)

#

is this locDiff a variable that can be changed somehow?

stone niche
#

I had one issue when we implemented Limping, it was using something like GetWorldTime, to vary the walking speed, the problem was that the limp was executed part way through the code execution, so by the time it was executed on the server, it was the next tick time, I resolved that by using CurrentServerMoveTime instead, as that is syncronised, so if you use time for thinks like how long to dash, it needs to be suncronised time.

limber gyro
#

so i cant use deltaTime then

#

i cant find that variable inside "calcVelocity"

stone niche
#

Delta time is ok, that is the "Change in time" so should be ok.

#

This is the type of thing I use to debug, and sometimes use a screen recorder to then go back and read the output frame by frame if there is something complex or intermittent I want to capture.

if (GEngine)
{
    if (CharacterOwner->GetLocalRole() == ROLE_Authority)
    {
        GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Silver, FString::Printf(TEXT("Server: %f  %s"), GetWorld()->TimeSeconds, *Velocity.ToString()));
    }
    else
    {
        GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Cyan, FString::Printf(TEXT("Client: %f  %s"), GetWorld()->TimeSeconds, *Velocity.ToString()));    
    }
}
#

You can make messages specifically for values that you want to observe.

limber gyro
stone niche
#

You can use Location rather than Velocity, or both, then see if the location changes when you press dash at different world times.

limber gyro
#

because the local CMC needs to update itself

#

correct?

magic yoke
#

is there a way to mark an exec chain to wait for server code to finish running?

Request tiles event > (Server) Request tiles > (Client) Update Tiles

stone niche
#

You should not have to ask something to wait if the code is running correctly, the same on both server and client.

magic yoke
#

I'm looking at options

#

I can definitely move my update tiles into a repnotify function

#

but I'm wondering if there's an option like that

#

tbh, putting it into repnotify is probably what I'm looking for thinking about it

#

I want something to happen client side when the server code is done running

stone niche
#

If it was very frequent, maybe set a bool and check on tick, but notify sounds best (im no expert though)

magic yoke
#

not exactly frequent no

#

making a 2d tile system

#

visuals client side

#

structs representing data side

#

but since it's tiles specifically, they're probably not changing a ton

#

it can probably be a bit inefficient in updating it because of the type of game I'm working on

#

thanks for being a sounding board :)\

stone niche
limber gyro
#

thanks for the help anyways

#

i will keep looking at this to see if i have any ideas

stone niche
halcyon totem
#

I have imported an old map and it has about 4000 meshes, these meshes are mostly small. and make up the map. I imported them from cd4 with datasmith and it let me add simple collision to my meshes, since these are one sided meshes would it be a problem? it came from an old 20 year old game and I was thinking it shouldnt be a problem, but will it lag my game because there is so many?

abstract aspen
fathom aspen
#

Though mountains aren't usually actors, and then they are always relevant? thinkblush

limber gyro
#

also this is probably not the best place to post that question

sleek flicker
#

Just spent 2 days suffering cus I forgot auto posess was on from testing

abstract aspen
#

@fathom aspen the problem does not persist on same map with out world partician

fathom aspen
#

Oh yeah world partition. That has been introduced in ue5 and it could be it really, so idk :(

halcyon totem
#

@limber gyro sorry I thought this was mobile!

twin juniper
#

how can i replicate a function that generate a procedural level?

#

if i run that function on server then only the server can see the generated map

chrome bay
#

generated from a seed deterministically, replicate the seed. That's only half the problem though

#

You also need to generate the objects in the level with deterministic names from that seed

#

And mark them as net addressable

#

This can ofc only be done from C++

timid breach
#

Guys, did I understand correctly?

Even I spawned AI Controller on server, save it to the variable and replicate, this AI controller will be never replicated to the client?

twin juniper
chrome bay
#

no chance

twin juniper
#

so i can't make a maze game multiplayer with blueprints

chrome bay
#

You can't do 90% of multiplayer in Blueprints

#

The problem you have is you need to spawn the procedural parts client-side, but they need to be net addressable and stably named which AFAIK you can't do in BP

bitter oriole
#

You only need that if you want to be able to RPC references to those components

chrome bay
#

Or if you want to walk on them

#

Otherwise character movement will break

bitter oriole
#

Ah, shit

#

Didn't think of that

chrome bay
#

But ye just means none of that stuff will be usable for network at all, which could be a problem in other ways too

twin juniper
#

why the seed doesn't get replicated by the client?Am I doing it the wrong way?

thin stratus
#

Because the BeginPlay calls aren't timed with Replication

#

The Int just hasn't replicated yet

#

Use an OnRep for the Int Variable

twin juniper
limber gyro
#

hey guys, i have been trying to implement a dash in the CMC and im still getting corrections, ive overriden the velocity first on the "calcVelocity" function and then on "OnMovementUpdated", they both generate corrections and im completly out of ideas on why the corrections are happening

#

maybe some one can take a look at my class and check what i am missing

#

because tbh i have absolutely no idea

twin juniper
#

i tried like this but it is not working

dark edge
#

10x10 maze might be easy, but a 100x100 might be a bit much

wary wyvern
#

Has anyone used VOIPTalker component to make a voice chat?

I'm not able to make it work.. I've added to a player controller, registered a player state and sets voice attach component to a capsule, but it does not work in a package game..

mild urchin
#

hey eveeryone, i'm trying to multicast a niagara but it doesnt work for some reason wheareas it works for particules any idea why ?

limber gyro
#

are u trying to spawn an effect on all clients?

mild urchin
#

yes exactly

limber gyro
#

well it should work in theory

mild urchin
#

yeah ! it works for particles

#

just doesnt work on a dedicated server

limber gyro
#

what else are u doing with niagara?

mild urchin
#

just this

#

code is pretty basic

#

spawn emitter at location works perfectly

limber gyro
#

did u check which line is not being triggered?

#

are u properly passing that hit result from the client to the multicast?

mild urchin
#

not yet i gotta send a build to steam

#

i guess that yes because it works for the particle

#

at the right location and everything

limber gyro
#

im a bit confused here, ur saying its working with particles

#

niagara is used for particles

#

is not working with all particles?

mild urchin
limber gyro
#

what are u trying to spawn that is not spawning?

mild urchin
#

this works

#

this doesnt

limber gyro
#

ok so, is that line of code being hit at all?

mild urchin
#

i have to check this

#

on dedicated server

limber gyro
#

u can simulate on the editor

mild urchin
#

in editor everything works

#

the niagara is spawned

limber gyro
#

ur probably running the editor with the wrong option

#

u gotta run as client

mild urchin
#

yeah

#

thats what i do

#

it could be smthn eelse

#

i have added a pack from the markeeetplace

#

and marked for add eeveery file

limber gyro
#

is ur game gonna have a dedicated server or is one of your players going to be the server?

mild urchin
#

but sometimes it misses some

#

no we already have dedicated seervers

limber gyro
#

so why would u want to spawn particles on the server? why would that be a problem?

#

the server doesnt need to see particles

mild urchin
#

yeah

#

i dont want them to spawn on server

#

all clients

#

so multicast should work

#

so yeah i agreee

limber gyro
#

yes, so whats the issue?

mild urchin
#

shouldn't beee any different than eeditor

#

well the niagara doesnt show

#

when i play on dedicated seeerver

limber gyro
#

ok so when u connect to a server it doesnt show

mild urchin
#

i was not very clear sorry

#

yes

limber gyro
#

lets go back to the line trigger thing

#

check if its triggering that line

#

if its not u gotta check that PSC variable that u have

mild urchin
#

the problem is with bloodfx

#

but yeah i'm gonna check

#

gotta finish the build

mild urchin
#

okay so

#

everything works locally

#

my friend told me that the build to steam doesnt include niagara for some reason but doeesnt know much more

#

can't find anything on internet about it

outer trail
#

Hello. New to UE networking here. I've got a question about loading objects at runtime and then replicating them. Here's the scenario:

  1. server loads an object (it's an asset, but has no hard references to it)
  2. server assigns said object to a replicated hard reference property (i.e. UPROPERTY(Replicated) UObject* SomeProp)
  3. client gets the reference replicated
  4. ????

I've tried looking but found no answer - what happens on client? does it cause a blocking load of the asset? does it set the reference to null (thus causing a mismatch between server and client)?

compact talon
#

If I cast to the player controller on the gamemode and branch if the player controller is local, then true means its the servers controller as the gamemode only runs on the server right?

deep geode
#

Qhat do you want to achie from this?

outer trail
#

the "problem" in my case is that when replication happens, the asset is loaded on server but not on client

twin juniper
elder spindle
#

does anyone know if there's a difference between playing your game in net mode client vs. as a client in net mode listen server?

#

i'm seeing some discrepancies

pallid mesa
#

yes

#

These are two different networking models:

  • Play as Server: The server is a player, and recurring clients join to the server session.
  • Play as Client: The server is headless, meaning that it has no controller, subsequent clients join to the server.
#

In the listen server model if the server pleyer quits playing, the session will be destroyed

#

the dedicated server is not a player so it is not supposed to play vfx or sfx or even animations

#

so there are lots of implications surrounding this concept @elder spindle

deep geode
deep geode
elder spindle
# pallid mesa These are two different networking models: - Play as Server: The server is a pla...

yeah this makes sense, but my question is: if you play in net mode listen server, if you specify more than 1 player. and if you do, then every other player will be connected to the listen server as a client. in that case is there (or is there supposed to be) any different between playing as one of those connected clients, vs simply playing in net mode client connect to a headless server?

pallid mesa
#

in listen server if you want 2 clients u need 3 viewports

#

got it?

#

cause one will be the server

elder spindle
#

yup i understand, but it doesnt really help sorry

twin juniper
elder spindle
#

im trying to understand why i see a difference when i play on net mode client vs. when i play as a client connected to a listen server (not as the listen server) on net mode listen server

deep geode
#

Yes, lyra devs made comments about how annoying listen server can be. Dedicated server is easily separated by has authority but listen server isnt quite so. Use case would be for UI/sound situations. If you were listen server and called play ui sound, speending on the impl, theres a chance that could get fowarded to clients as well

limber gyro
#

that u set to true

#

so u spawn it on the server and it will spawn on the clients aswell

elder spindle
deep geode
#

Yes. Before you spawn, do an autbority check, also the spawned actor ahould be set to replicate in cdo

deep geode
limber gyro
#

so i cant tell

pallid mesa
limber gyro
#

is ur BP room Generator replicated?

twin juniper
pallid mesa
#

so there will be differences based on where you execution your code @elder spindle

limber gyro
#

is it not showing in the client?

twin juniper
# limber gyro i have no idea whats inside that function

i just followed this tutorial https://www.youtube.com/watch?v=Q4aAGLBqnsc

This is a video tutorial showing how you can implement a backtrack algorithm inside unreal. This is currently how I'll be generating the maze data for my current project Salvos.

Part 2 shows you how to spawn in the walls using static mesh instances and can be found at the link below.

Part 2: https://youtu.be/lzpnrjCBVQM

β–Ά Play video
limber gyro
#

u have to check the variables of that blueprint

twin juniper
limber gyro
#

go inside the bp, on the right side check your variables

#

and search for "replicated"

#

see what u find

twin juniper
limber gyro
#

im not exatly sure about that

#

is ur BP spawning objects?

#

if so ur probably gonna need to replicate them all

elder spindle
twin juniper
pallid mesa
limber gyro
#

i dont remember if a "mesh" can be set to be replicated at all

pallid mesa
#

you can get an equivalent view of a dc server using 3 clients in a listen server setup and see actions between both clients

limber gyro
#

but if it can, when its set to replicated it should show up in the client

deep geode
#

Exact maze*

twin juniper
#

oh wait

#

on the clients if i use multicast then its the same maze

#

on the server its completely different

deep geode
#

Then the tut you used is broken. Seed is supposed to make the same exact randomness, if it uses the same seed with the same exact parameters the maze should always be the same

elder spindle
twin juniper
#

is it wrong?

deep geode
#

You dont replicate the seed. You pass it inside the multicast parameters

pallid mesa
pallid mesa
#

YOU REPLICATE THE SEED.

twin juniper
#

...

pallid mesa
#

You absolutely replicate the seed. Otherwise late joiners will never get the state change

deep geode
#

Mb mb, yeah keep the repnotify

twin juniper
pallid mesa
#

like that Michele like what you did.

twin juniper
#

then why its different

deep geode
#

Whats inside the rep notify?

twin juniper
pallid mesa
#

how are you calling that function?

deep geode
#

What replication conditions are on seed?

twin juniper
elder spindle
twin juniper
deep geode
#

Ao you have a race condition

elder spindle
#

it seems like clients in net mode client are executing a server rpc, while clients in net mode listen server are working correctly (not executing the server rpc)

deep geode
#

You spawn the maze inside the repnotify

pallid mesa
#

that code is wrong, I encourage you to go to the basics

#

begin play executes in both server and client

#

so you are server rpc-ing in server, which doesn't make sense

#

and which class is this?

pallid mesa
twin juniper
pallid mesa
#

you say there are inconsistencies, ofc there are I'm telling you the why

#

now, what is your issue

pallid mesa
twin juniper
pallid mesa
#

so a random actor not owner by anyone

twin juniper
#

exactly

pallid mesa
#

you are not supposed to server rpc there

twin juniper
pallid mesa
#

because it's not owned by a controller

deep geode
#

The print string still has the race condition issue. But the maze is fixed when tou spanw inside the repnotify. Try printing the seed inside rep notify

pallid mesa
#

you don't need a server RPC

#

because the begin play will execute only in server here

#

I'm going to setup a simple experiment for you to see the equivalences @twin juniper

pallid mesa
pallid mesa
#

also Michele, I strooooongly encourage you to re-read the cedrix exi compendium if you didn't yet

#

and if you did, re-read it, there are some core concepts here that still need to be clarified

pallid mesa
#

@twin juniper mind jump vc?

glossy kettle
#

rep graph is too slow for prod right

pallid mesa
#

depending your use case

#

if you have co-op game with a low quantity of replicated actors, not for you

#

now... if you surpass the barrier of a little game probably looking at it as a good idea

#

it distresses the server charge by linearizing the culling in one single place

#

also useful to define "replication gates"

twin juniper
pallid mesa
#

I'm spanish, don't worry @twin juniper x'D

#

ole ole paella flamenco

twin juniper
#

nice im from italy xd

pallid mesa
#

right I'm waiting you now in the vc feedback and support

elder spindle
# pallid mesa you say there are inconsistencies, ofc there are I'm telling you the why

im under nda so i cant get too specific. basically, we have a server rpc function and implementation for looking at interactable objects in the player character cpp (CheckInteractObject, CheckInteractObject_Implementation). CheckInteractObject is called on a timer at 10 times/sec. CheckInteractObejct_Implementation draws the line trace and sets a replicated variable based on the results. thats about it

deep geode
elder spindle
limber gyro
#

does any 1 know how to check if i am sending all the necessary information to the CMC for a custom movement?

elder spindle
#

its basically a "what am i looking at right now" function

deep geode
#

Do the line trace locally. When you need to interact, only do the rpc then

compact talon
#

When players join my lobby gamemode they give their default player information (username, cosmetics) to the host. The host then stores this. When the player changes cosmetics in game it tells the host it has changed and the host updates the array storing it and replicates the changes to all players on the server.

My issue is my game changes levels and the only thing to persist through levels is the game instance.

So I can store all server information on the hosts game instance, and when the level starts pull the information from the game instance. The issue is, when the players all connect and are given their controller and characters I need to tell them their information from the host (like their cosmetics etc).

I don't know how to tell the right players what their name and cosmetics should be. I was thinking of checking if their steam (using steam subsystem with advanced sessions) names match up but that allows them to change name and break my system.

Any advice?

deep geode
#

Seamless travel can persist certain actors, you can store it in one then persist when traveling. Youcan the. Store it as a map with keys as their user id and values as cosmetic

compact talon
#

ah, very nice. tyvm

elder spindle
pallid mesa
#

welcome to it πŸ˜„

#

and yes what uPnP suggested is basically a client side action that derives in a server side action

#

and it's dangerous!

#

Because clients could be teleporting objects so they are at their reach so they can grab them

#

that's why when you rpc the request for grabbing the object you need to issue a validation phase

#

ie: checking how far your server character is from the server object

#

@elder spindle

elder spindle
#

yeah ive seen that is an option as well

#

i appreciate the advice, but do you guys have an idea about my original issue?

#

also, any idea why Only Owner See isnt working?

deep geode
#

What issue? listen server vs dedicated server thing?

elder spindle
#

yeah

deep geode
#

You could always try it out first on packaged debug game. Pie editor has its own can of worms so lets rule that one out first

#

For rpc. Listen server will trigger on all Server,Client, Multicast

#

Its basically a player thats a server

#

It sounds so simple but you have to approach it differently on a case to case basis.

elder spindle
#

ok how would i do this

#

do i have to do a debug game build in vs?

deep geode
#

You can package it then play as if you released them to testers. That is if you have a interface or ui setup to join matches already

elder spindle
#

we dont lol

#

there is some logic being run on begin play though

deep geode
#

We really cant help you if your nda is in the way. Its bullish if you cant even do your job because of it. Kinda paradoxical

#

Do tou you have any other analogy?

elder spindle
#

i mean i dont think some throwaway screenshot will be a big deal

deep geode
#

If im deving a game thats is open to listen servers, i 100% always test on 3 players with 1 as listen servers. With bad network emulation on top, if the game doesnt break then you did a very good job. Only thing left is to make sure the game is secure

elder spindle
#

im trying to figure out why i have a debug line in one and not the other

deep geode
#

Wdym headless server?

elder spindle
deep geode
#

So youre saying the line trace isnt being fired when playing from listen server? Can i see the rpc call all the way to the line trace?

elder spindle
#

when i play on a client connected to a listen server yes

#

this is in the player bp

#

oh hold on

#

thats all of it

#

i just noticed the check for GetNetMode() < NM_Client but again shouldn't that make them the same?

deep geode
#

Have you tried with a usual has authority check? I feel like netmode is stratified between dedicated and listen server

compact talon
#

using get game instance within the gamemode gets the game instance of the host exclusively right? As the gamemode only exists on the server?

chrome quest
#

Yep

elder spindle
#

installing editor symbols for debugging atm

deep geode
#

im actually at a loss. what i expect is that you shouldnt see any debug line at all. since if youre saying that those pictures are on clients, then they shouldnt see it since the trace is being done by the server. if you say one is on the main viewport. i suggest you select New Editor Window (Pie) inside the play options. I believe you have it mixed up since the main viewport inside the editor has always been the server if it was either dedicated or listen

elder spindle
#

in net mode client every viewport/window/client gives the same result. it has a line trace

deep geode
elder spindle
#

in listen server mode only the viewport(listen server) has a line trace, and all client windows dont have it (desired)

elder spindle
deep geode
#

have you tried toggling 'Run Under One process' inside project settings?

#

Should be inside editor settings, not project settings; should rule out some editor side effects as well

elder spindle
#

that fixed it lol

#

so i imagine running under one process causes clients in dedicated mode to evaluate as servers for some goddamn reason

deep geode
#

sometimes it works, sometimes it makes a whole load of problems. I personally keep it on to keep it light, then if I have bugs I cant seem to figure, I just build and run outside editor. Good to know its fixed

elder spindle
#

i mean it feels like a bug for that to happen, and it doesn't really explain whats going on. cant build the game in debug config so cant check how the HasAuthority() check resolves but im guessing thats where the problem is. listen server works correctly so ill probably just stick with that

#

looks like running as standalone game works as well

#

probably does the same thing

elder spindle
#

right under run under one process theres a "Show Server Debug Drawing by Default" flag

#

what a fucking adventure

glossy kettle
elder spindle
#

next question: "Only Owner See" doesnt seem to work on my widget component

deep geode
#

read that as well. went over my head that it was part of your problem hahaha. I believe that's new?

elder spindle
#

yeah idk its such a niche flag but ofc theres a flag for it

fathom aspen
# compact talon If I cast to the player controller on the gamemode and branch if the player cont...

It does return true right, but the reason isn't fully correct. For example, the GameState runs on both, and you can still get true there too, but that's right for server side game state. So the correct answer is: it returns true because the local authority is in control. Also controllers on GameMode are always server side, as GameMode is server only, so there's no point in checking that, if that is what you're doing!

compact talon
chrome bay
#

A GameMode is not a PlayerController, so that cast will always fail

#

Cast basically means "give me this object, if it's what I think it is"

dark edge
#

You get the thing, then you cast it to the type you want IF NECESSARY, then you can get its variables.
Casting is not the getting

compact talon
#

I see, tyvm

limber pebble
#

Hi all, how would you go about telling the server and client a door is unlocked once a player with a key has unlocked it.

dark edge
limber pebble
dark edge
elder spindle
#

anyone have an idea why "Only Owner See" isn't working

limber gyro
#

probably something silly that ur missing

#

like spawning stuff twice

chrome bay
#

Is a Player Controller the owner of the actor it's attached to?

limber gyro
#

at least thats my issue 90% of the time lol

chrome bay
#

It's not the owned of the widget, it's the owner of the actor which contains the component

#

The root of that ownership chain needs to be the player controller

elder spindle
#

yup it looks the like player bp doesn't return anything for its owner

magic yoke
#

I have an object that I create client side currently, and I want the server to "know about it" so I can reference 1 replicated variable inside. As far as I can tell, I can't replicate objects easily?

How do I do this? Multicast the original object creation from the server so everything gets a copy of it?

limber pebble
dark edge
#

I'm at work but first confirm that the variable is replicated and being set on the server, NOT set on the client

limber pebble
dark edge
#

And how do you know it's not replicating? Print string on tick of teh bool shows server and clients disagreeing?

limber pebble
south otter
#

I also had it showing client and server, with the same results

dark edge
#

So to confirm, server says Unlocked, clients say Locked

south otter
#

Basically, I can either let client and server open door with key individually, then if they shut the door, its locked for the other player, or I can set it to where server can open, and its open for everyone, but not vice versa

#

Client and server both say locked, sometimes only server says locked depending what im trying

dark edge
#

Server says if door is locked or not. Server is the truth.

#

Client unlocking door should involve a run on server event. Client never sets the bool itself

south otter
#

the server sets the bool

#

So i have a basic key channel system, player, key and door all have key channels, if key and door match, door is unlocked.

dark edge
#

Just show your setup. How you're setting the bool and how you're printing it or otherwise testing it.

south otter
#

I dont know how to tell the server the door is unlocked for all when any player opens it

#

ok, i have photos before any changes, just the original single player set up with the interacted replicated, and teh doors replicated

#

ill show those first

#

and obbiosuly, the door, key, and player and variables, replicated

#

i also, ahve a set up inside the player, but this was my first try in the door bp

dark edge
south otter
#

third person character

#

so yea

dark edge
# south otter

Nah bruh, don't do the flip flop stuff. Just set a bool

#
  1. Clientside input
  2. Run on Server Event
  3. If(condition), set bool (replicated, repnotify probably)

OnRep_MyBool
Do stuff

#

IDK if your doors have 1 state variable or two (are unlocked and open seperate?)

south otter
#

so after key set bool, right?

#

this particular door is alwasy locked unless a key is used

dark edge
#

but does unlocking open it? Or just make it capable of being opened.

south otter
#

yes

#

the player with the key has to open it

#

so its not actaully unlocked

deep geode
#

how big is your world with the door? ideally 2 players?

south otter
#

2-4

#

and there are tons of doors

#

but its just a master door, or will be

deep geode
#

and am i right to suspect that there are many doors that wont be relevant to certain players?

south otter
#

they will be relevant to everyone at some point

#

and most relevant to the key finder

deep geode
#

but not always?

limber pebble
#

its a constant state

deep geode
#

because here's the thing. what if you opened the door. then another player joins the game. or has been in a very far area then recently went to the door

#

the door doesnt have a state that its opened.

south otter
#

wont happen, they join together

winged badger
#

you can't multicast stateful changes and expect it to work

south otter
#

and relevance distance if the whole map

winged badger
#

that is what replicated variables are for

deep geode
#

whole map would be analogous to a map of what game?

limber pebble
#

can any one of you join a voice chat so we can share screen and you can see?

#

tell us how you'd do it?

magic yoke
#

on your opening player controller > call event that is cast to server that updates the door's open/shut/locked value

#

and you repnotify the variable to cast that information back to the clients

#

notify letting you make a function out of it if you need to do any other changes

deep geode
#

repnotify could just set the transform to the finished rotation (closed or open)

magic yoke
#

overall, for anything visual repnotify is kinda mandatory far as I've seen

#

just because you can't set actor base variables (like location/mesh/material) to replicate

deep geode
#

for anything with 'state' that needs to be triggered upon relevance

magic yoke
#

repnotify > replicate

#

I think you could do everything repnotify and be fine

#

but everything replicate won't work a lot

winged badger
#

you multicast stuff like explosion sounds, for example, if player wasn't close enough to hear it, they don't need to hear it later either

#

fire and forget

magic yoke
#

fair, but you could have code that deals with that somehow

#

just replication though you can't fix everything

#

because it doesn't cause any function calls

winged badger
#

there are nuances to even opening doors via RepNotify

#

as the solution where non relevant player suddenly appears near bunch of open, previously non relevant doors and those doors start opening with creaking noises

#

is hardly production level code

#

equivalent to dead enemies getting up on their feet to play their death montage

solar stirrup
#

I keep a timestamp for doors

#

sec

winged badger
#

and synced network clock

solar stirrup
#

^

#

allows me to keep door movement in sync just via time

pallid mesa
#

synced network clock as an ntp clock or using the built in stuff? @solar stirrup

magic yoke
#

any thoughts on my earlier question about object replication? I mean specifically objects

solar stirrup
#

built in, honestly close enough that you don't care, add half rtt if you feel like it, helps get it a tad bit closer on bad connections

south otter
#

I just need to know how to tell the server to tell all clients to unlock the door for everyone once it has been opened by a player with a key

magic yoke
#

I have an object that I create client side currently, and I want the server to "know about it" so I can reference 1 replicated variable inside. As far as I can tell, I can't replicate objects easily?

How do I do this? Multicast the original object creation from the server so everything gets a copy of it?

south otter
#

door animations are working on both sides already

pallid mesa
winged badger
#
void ARTS_PlayerController::RequestWorldTime_Internal()
{
    ServerRequestWorldTime(GetWorld()->GetTimeSeconds());
}

void ARTS_PlayerController::ServerRequestWorldTime_Implementation(float ClientTimestamp)
{
    const float Timestamp = GetWorld()->GetTimeSeconds();
    ClientUpdateWorldTime(ClientTimestamp, Timestamp);
}

void ARTS_PlayerController::ClientUpdateWorldTime_Implementation(float ClientTimestamp, float ServerTimestamp)
{
    const float RoundTripTime = GetWorld()->GetTimeSeconds() - ClientTimestamp;
    if (RoundTripTime < ShortestRoundTripTime)
    {
        ShortestRoundTripTime = RoundTripTime;
        ServerWorldTimeDelta = ServerTimestamp - ClientTimestamp - ShortestRoundTripTime / 2.f;
    }
}

float ARTS_PlayerController::GetServerWorldTimeDelta() const
{
    return ServerWorldTimeDelta;
}

float ARTS_PlayerController::GetServerWorldTime() const
{
    return GetWorld()->GetTimeSeconds() + ServerWorldTimeDelta;
}``` @pallid mesa
south otter
#

well, the bool works, just not for everyone

solar stirrup
south otter
#

and its replicated,, and tried rep notify

winged badger
#

very

pallid mesa
#

much better

magic yoke
#

sounds to me like you're calling the replication from the wrong context

solar stirrup
#

Because I use built in + RTT / 2 for my elevators (timestamp based movement) and I get no issue whatsoever lel

magic yoke
#

what class changes the bool?

#

what is the context of the event

solar stirrup
#

I think the CMC handles discrepancies in movement fine when you're on an actor

#

Never had any rubberbanding on a moving platform

#

Doors? maybe

winged badger
#

as it re-runs every 10 sec, so calculates delta from lowest ping time

pallid mesa
#

cmc has an ntp clock algo built in lol

solar stirrup
#

huh, probs why then mmLul

south otter
magic yoke
#

character is owned by the server

pallid mesa
magic yoke
#

you can't do client>server calls from character I thought

#

hold on, pawn is*

#

hm

winged badger
magic yoke
#

if you do client>server in player controller

#

I can guarantee that will work

#

I forget who owns character off the top of my head

pallid mesa
#

I have engine changes for ntp around the net driver, but its annoying

winged badger
#

i also have static functions that wrap around those

magic yoke
winged badger
#

so i can just do USolsticeUtilitylibrary::GetServerWorldTime(this)

south otter
magic yoke
#

@south otter looks to me like character should be a server owned object

#

if it's kinda quick ye

#

unreal hangout

pallid mesa
#

ah hehe that's nice and blueprintable

elder spindle
#

so im getting some weird results when i check the owner of the player character

#

not sure how to interpret this

#

this is for 2 clients. it looks like it prints for both characters on each client

#

but on both clients only one of the bps returns an owns, and its not even the same both times

tiny jungle
#

does anyone know of any resources that talk in detail about implementing rollback based peer to peer multiplayer in UE4/5?

dark edge
tiny jungle
#

true peer to peer, I'd ideally like 2-6 players to connect without one being the sole authority on the game state, but if that's more trouble than it's worth and I could make it invisible to the players anyway I might not bother

dark edge
#

Yeah good luck, that's far beyond a tutorial. That's completely contrary to the Unreal(tm) networking model.

solar stirrup
#

That'd require an unholy amount of engine modifications

tiny jungle
#

I mean I don't expect anyone do have done the work for me

dark edge
#

Yeah that's gonna be one of those "if you have to ask" type problems, I sure wouldn't want to have to do it.

#

Now if you had some black box library that your game talked to and every machine thought it was running in standalone it might be doable, but you'd have to do all networking yourself and toss all the replication stuff really.

#

Although peer to peer and "listen server that trusts clients sorta" are effectively the same thing

tiny jungle
#

where does the difficulty come in specifically? like I think I must be misunderstanding the problem. because I only need a handful of deterministic entities predicted on the client side and I'm doing their physics by hand anyway

#

in my mind it's just, share everyone's inputs, keep the illusion of real time gameplay if they match, resimulate the timeline if they don't

dark edge
#

Unreal is client/server at its core. If you have to ask what the problem is, it's too big. But you could probably do it as listen server, lots of fighting games have done it I'd guess.

tiny jungle
#

yes, mk11 has excellent fighting game netcode

dark edge
#

It's like web vs Bittorrent.

tiny jungle
#

right, well a listen server that trusts the clients then

dark edge
#

I'm guessing for MK11 they have a dedicated server that acts as referee but yeah, that'd be much more doable.

elder spindle
#

anyone have an idea why my "Only Owner See" flag isn't working properly?

tiny jungle
#

it's the predictive simulation that's the important part anyway and 2 players is the most common use case

dark edge
low helm
#

If you just want simple client authoritative movement there are some set ups you can use with the smooth sync plug-in

deep geode
tiny jungle
# dark edge So have you made the simulation up yet? Does it run in its own scene that can r...

this is a project that's just design docs right now, I just wanted to make sure I wasn't missing something obvious, I'm more of a vfx person right now and was hoping to avoid beginner mistakes by asking. it's going to be a fighting game framework where every action an entity can take is in discrete time slices and where all the physics are stylized and deterministic. was planning to have rewind and replay functionality regardless of the networking but I haven't built the implementation yet

tiny jungle
# deep geode Is there a gdc talk or breakdown? It would be very interesting to see how they h...

https://www.youtube.com/watch?v=7jb0FOcImdg there is in fact! haven't watched it since it was new and I should again

GDC

In this 2018 GDC talk, Netherrealm Games' Michael Stallone describes the drastic engine changes, optimizations, and tools that are involved in rolling back and simulating up to 8 game frames in 16ms in games like Mortal Kombat and Injustice 2.

Register for GDC: https://ubm.io/2yWXW38

Join the GDC mailing list: http://www.gdconf.com/subscribe
...

β–Ά Play video
tiny jungle
low helm
#

Any attempts to establish peer to peer connections within unreal would require massive rewriting of the engines networking. If you have to ask how to do that, I think it’s safe to say there is no hope, unless you start down that long road with the intent to learn how to do all of it by yourself which could take years

#

Unless you are a wizard, you are stuck with server Client Connections, which means that you will never have real control over the ping of the players

thin stratus
#

I found out the hard way how this all works when I had a camera actor that was the view target instead of the controlled pawn

solar stirrup
#

Quick question - an actor with an update frequency of 0 will still process RPCs and spawn on clients right?

low helm
#

I believe so yes, it should be easy to test that yourself

elder spindle
#

do you know how to check what the view target is?

elder spindle
fathom aspen
#

Or GetViewTarget(there are bunch of them)

fresh chasm
#

Hello, i'm about to create an inventory for a multiplayer game. I would like to have your thoughts before I start it!
So I was wondering, for chests, should I :
1- Simply replicate the content (array of id+quantity)
2- Send the content of the chest to the player that opens it?
There can be up to 20 players near a chest, and there can be a lot of chests (lets say up to 100)

I can already see cheat with 1- because a player can read the content of a chest without opening it

What would you choose in this scenario ? Or do you have another suggestion ?

plain spade
#

Is there any way I can make a hosting system where you would create a server with a name, and other players would join you by entering the name of the server?

kindred widget
ionic arch
#

Hey can anyone help with the UE5 Server. I've build a Server but after running it gives this error after some time

young kestrel
#

Hi everyone. I'm doing a networked project with lots of custom movements. I added a sprint, dash and WallRunning, however, I still need 5 (double jump, wall jump, climbing, sliding and swinging). more and my limit are the compressed flags. My C++ knowledge is okay, but I didn't find resources on expanding the flags.

I read here about that 4.26 changed how that works and allows to get around the limitations, but I didn't find example codes to look at.

Currently I'm using UE5, so you know.

Can somebody link me to some example code or explain it more in details? I already looked at Unreal Engines documentation, but I didn't see where to expand on those flags at all.

I'm confident in Blueprint and made those custom movements all in blueprints a year ago, but that project wasn't networked.

Thanks for your help.

pallid mesa
#

Hi friends

#

does the Net Insights provide data per second?

#

So far I could only obtain data per net event instance

#

and compute average per net event instance

#

but this doesn't give an insight on how data behaves over time

chrome bay
#

If not the network profiler does

pallid mesa
#

The old one, right

#

ayy I will have to record more traces

#

thank you james :)

brazen briar
#

Hey! I am using the default character movement. This is replicating very well, but I have noticed that in high speeds, the client starts to become choppy.

When I jump, I can clearly see choppiness in the movement. The server runs well without chopping.

Do you know of any parameters I could look at to fix this?

regal solar
#

hello, Does ***clientTravel *** keep previuos player transform after traveling into new game session?

frosty remnant
#

Is there an easy way to find whether an error in my error log triggered server-side or client-side?

#

It would save me a lot of effort debugging in general

winged badger
#

you can also see them with i think p.ShowNetCorrections or something similar in console

#

default tolerance is 3 UU iirc, which is okay for speeds of 500ish

#

(human at running pace)

brazen briar
pallid mesa
#

the net profiler provides Outgoing bandwidth

#

but i can't see ingoing bandwidth

#

anyone here tried to extend the net profiler to provide such info?

#

I can see it in insights but it isn't very insightful

solar stirrup
#

Is there an easy way to check if an actor can send Server RPCs locally?

bitter oriole
#

"Is it owned by a locally controlled player controller"

#

Pawn has IsLocallyControlled and PC has IsLocalPlayerController

#

Normally any RPC user will be owned by either

pallid mesa
#

non owned actors can send multicasts

#

and that's also a rpc πŸ™ˆ

bitter oriole
#

"can I multicast" is just HasAuthority, anyway

pallid mesa
#

AH hahaha okay reading comprehension sorry

#

πŸ˜‚

#

and yes, + sending a server rpc will give out a warning when the thing is not owned

fathom aspen
solar stirrup
#

Yeah I'll just do that

#

was wondering if there was a more specific field set on stuff like a net connection

elder spindle
#

Hi guys so im trying to figure out why Only Owner See isn't working

#

can anyone point me to the implementation in the engine source?

split zealot
#

Hey all. I've been stuck on a networking issue for a while. I have a game that has set puzzles that use RepNotify functions to set how the puzzle is generated. It seemed to work in UE4 pretty well, but after moving to UE5 it only seems to work about 2/3 of the time. The other 1/3, the RepNotify literally just won't get called for clients, like it gets dropped. So this is obviously a major issue for the players, or late joiners.

#

I've seemingly tried all the different kinds of combinations in the replication settings menu, but the update just gets dropped for clients sometimes and won't get called. Even if the net priority is high

magic yoke
#

If I create an object with the same set of code both server/client side (in controller beginplay lets say)

#

do references to that object work between the client/server?

latent heart
#

If the object is replicated from the server to the client, yes.

magic yoke
#

objects can't be replicated

latent heart
#

If the object is created by you on the client then no.

magic yoke
#

I mean the object class specifically

latent heart
#

Yes the can.

magic yoke
#

how...

#

I've looked everywhere :D

latent heart
#

Good question.

#

πŸ˜„

magic yoke
#

if you try to replicate references to them, you get dummy pointers to objects that don't exist

latent heart
#

If it's an object on an actor, just make it an actor component?

magic yoke
#

nope

#

this is an object class

latent heart
#

You want to replicate the object class?

magic yoke
#

I'm not attaching it to actors

latent heart
#

Everything has to be attached to an actor to replicate, somewhere...

magic yoke
#

well, you can make things replicate through the player controller or player state

#

and those replicate

latent heart
#

Those are both actors.

magic yoke
#

hm

#

there was a reason I didn't want actor component

#

I forget why

latent heart
#

So, yes, you can add actor components to them.

#
magic yoke
#

(fun fact once you refactor an object > something else in blueprints you can't turn it back into a generic object)

latent heart
#

Source control / backup!

magic yoke
#

mhm, I have backups but they're too old for that little change lol

#

source control is a massive pain for UE though...

#

I tried and failed to set it up so said screw it at least I can do something

latent heart
#

It's really not.

magic yoke
#

do enlighten me

#

the internet failed utterly

latent heart
#

I admit, perforce is shit. But you can use something else.

magic yoke
#

I couldn't get perforce set up

#

that was the issue

latent heart
#

That is, perforce is shit for a single person, it's an enterprise solution.

magic yoke
#

yeah for sure

#

the power of server for source control kinda nutty

#

for single person

latent heart
#

Use SVN or plastic SCM (I don't know much about plastic)

#

SVN is super simple really.

magic yoke
#

thing is though

#

I'm only using blueprints

#

no C++ at all

#

does SVN work for that?

#

the alternatives all seemed pretty bad for blueprints

solar stirrup
#

SVN is fine

magic yoke
#

alright thanks for advice I'll have to set that up this week

#

want to finish my first task, and it's too late to save that mistake lol

#

I really wish I could remember why I had trouble with actor component

latent heart
#

If you want to convert it back to an object instead of an actor component and it isn't too complex.

magic yoke
#

atm it's fairly simple

latent heart
#

You can make a new bp, re-create the variables and then just copy+paste the entire graph.

magic yoke
#

couple functions

#

mhm

latent heart
#

Have to recreate the functions too ofc

magic yoke
#

honestly though what I really need to do is test what you said about objects

#

for knowledge's sake

#

make sure I can get it working

latent heart
#

Don't bother trying to replicate objects from BP.

#

Just use actor components.

magic yoke
#

hm?

#

ok well

#

I wanna try first :D

#

cat, curiosity, y'know

latent heart
#

You literally can't without c++ I think.

magic yoke
#

mmm, that would make sense tbh

#

it's kinda what I thought

#

but then I realized I created my objects client side not server side

#

and replication dun like that

glossy kettle
magic yoke
#

lemme rephrase

#

perforce*

#

is a massive pain

glossy kettle
#

it is tbh

magic yoke
#

I spent a solid 3-4 hours and couldn't get it installed

#

let alone working lol

glossy kettle
#

roll ur own git repo

#

on a NAS or some shit

#

no need to fck bout with LFS then

magic yoke
#

honestly might as well

latent heart
#

Or use SVN

magic yoke
#

it's a solo project so I don't really need checkout/etc

#

I just need the ability to roll back

glossy kettle
#

if its solo i think git is more comfy

#

p4ssforce

magic yoke
#

I might try SVN to see

#

I know git absolutely hates blueprints

#

and due to reasons I gotta use em these days

#

:/

#

better for my carpal tunnel

glossy kettle
#

πŸ«‚

magic yoke
#

<3

magic yoke
#

alright guess I'm going component

#

t minus 37 minutes until I found out why I couldn't use components

latent heart
#

Reasons.

#

The hardest thing of all to overcome.

elder spindle
#

has anyone had any luck getting Only Owner See to work? seems not to do anything for me

ember dagger
#

Works fine for me

#

What do you mean by not work? As in everyone's can still see it? No one can see it?

latent heart
#

Or only the server can see it?

elder spindle
#

all the clients can see it

#

server cant but thats expected

latent heart
#

Are you spawning it on the client?

#

Or spawning it on the server (just the once) and letting it replicate.

#

It sounds like you're spawning unique instances on every client... actually on the client.

elder spindle
#

its a default component in the c++ class, it gets created in the class constructor

latent heart
elder spindle
latent heart
#

How do you spawn the actor that contains the component?

elder spindle
#

actually i seem to have found the problem

#

apparently screen space widget components dont respect the Only Owner See flag

latent heart
#

This might be one of the few places where spawning it locally is the correct option then. πŸ˜›

elder spindle
#

so now the question is how to work around this

#

yeah sounds like it

#

how could i do that?

latent heart
#

BeginPlay -> check for authority -> add widget component

#

Something like that

young kestrel
#

Is there a way to use more than the 4 custom movement flags? I'm trying to get multiple movement modes replicated, but I reached the limit already and still need a few more flags.

I heard something about using enums but not sure how to set that up.

elder spindle
#

can i move that logic into begin play?

latent heart
#

Go for it.

#

Just remmeber to remove the default component, you don't need it and it'll probably actually just get in the way.

elder spindle
#

yeah in this case i might just do it in blueprint cause i dont have the component by default anymore and i need to reference a widget on the file system

latent heart
#

You can add a widget component variable and assign somethign to it on begin play.

elder spindle
#

yup thats how ill do it

#

how do you create a component variable in c++?

latent heart
#
UWidgetComponent* WidgetComponent```
#

If you want to assign it with blueprints, Add BlueprintReadWrite to the UPROPERTY

elder spindle
#

oh i see what you mean by the default component thing

latent heart
elder spindle
winged badger
#

that would probably be because their owner is by default GameInstance

latent heart
#

You also need to make sure that the created component isn't replicated.

winged badger
#

if you were to instantiate the widget manually, then set it as a UserWidgetObject on the WidgetComponent, it should work just fine

#

but yeah, if IsLocallyControlled() CreateWidget works better

elder spindle
#

in the header

#

authority check off begin play

#

only owner see is checked

#

each client can see the other's widget

#

component is not replicated

winged badger
#

just put a branch with IsLocallyControlled check

#

and create the widget component only if true

#

and it will work just fine

#

from BeginPlay is also fine

elder spindle
#

im using an OnRep function to hide/unhide the widget

winged badger
#

if only the player needs to see his own

#

there is no need for any replication there

#

should be all handled locally

#

you just send a server RPC when you Start Interaction, server does some sanity checks that its possible, and runs the interaction code

elder spindle
winged badger
#

no widget is ever replicating

#

and server doesn't need to know or validate if client should see an interaction prompt

#

interactable object should replicate its own state, from which client can figure our if it can be interacted with and just show the widget locally

elder spindle
#

ok ill try doing the hide/unhide locally

winged badger
#

you generally don't want to put yourself in a position where you need to constantly network sync several different objects together

#

and everything that can run locally, should run locally

#

our minimap and fog or war systems, for example, don't replicate anything at all

#

but they work just fine

elder spindle
#

but it looks like this works

elder spindle
magic yoke
#

So I've been hit with a bit of a mind bender that I can't quite figure out

#

I'm trying to create an actor component that will spawn actors client side, but in dedicated servers doesn't spawn any actors to reduce load on the server

#

namely using it to contain code about handling how those batches of actors change when the server changes an array of structs inside it

#

so here's the weird thing

#

nothing at all is set to replicate

#

server side I spawn the actor component and attach it to the controller (I forgot an execution pin, I thought I'd have to create it both server/client side originally)

#

the component doesn't replicate, none of the variables replicate, none of the actors are set to replicate

#

only server side is this code running

#

but the actors spawned by the component on the server side version of the controller still appear client side

#

almost like "add component" is set to autoreplicate somehow on replicated actors like the controller?

#

I managed to blindly unit test my way into something that works moving my context detection into the begin play event of the component, meaning that it is actually replicating despite everything being set to not replicate

#

but why does it work that way

short arrow
#

Hey I'm asking this here because it is more the multiplayer part that I need know. I imagine that the reason Root motion isn't recommended on all animations is because it's moving your characters absolute location and rotation thus increasing the amount of network traffic, and clients would probably be misplacing the final location. However this shouldn't be the case if AI are running and playing root motion animations from the server right? Or am I totally wrong?

solar stirrup
#

Assuming bReplicates on that actor is set to true

#

So it replicates it down to clients as well

magic yoke
#

well it's blueprints here

#

can I even see that property?

solar stirrup
#

Yep

#

Check your actor's defaults

magic yoke
#

"component replicates" = false

solar stirrup
#

I mean the actor you're spawning

magic yoke
solar stirrup
#

Doesn't matter if the component replicates or not

magic yoke
#

the spawned actor also doesn't replicate

solar stirrup
#

Huh

magic yoke
# short arrow shoot

hard setting movement makes lag super obvious since everything is teleporting, if a client falls behind there's lag smoothing that can be applied

magic yoke
# solar stirrup Huh

I deleted something in an unrelated class and it stopped working, so I'm re-sorting my code. Possible it was using code from that other class that I thought wasn't used anymore

#

which is really strange that it would work at all given that

solar stirrup
#

Yeah if an actor isn't set to replicate it shouldn't spawn on clients

#

So either you're somehow manually spawning them on clients, or your actor actually does replicate

magic yoke
#

what I'm guessing happened

#

was the other class was spawning them client side

#

while the new class was only spawning them server side

#

so when I switched the server side code > client side

#

it got spawned x2 on the client side and the actors overlapped

#

so I didn't notice lol

#

I'm migrating code and I thought I'd finished migrating it all

#

guess I missed something

magic yoke
# short arrow shoot

to kinda finish that thought: unreal has some inbuilt latency correction, but hard setting locations doesn't let it do anything

short arrow
#

which would cause teleporting and jitters to resync the location

magic yoke
#

what happens when you get that is "vibrations"

#

the client/server disagreeing on a location really looks bad

#

I was doing some super basic UI stuff in a test and just coded it that way because it wasn't the primary importance

#

and man oh man does it look bad lol

young kestrel
#

Is there any sample code for "FCharacterNetworkMoveData"? I have no clue how to use it. I read the documentation but didn't understand how I use that in combination with FSavedMove

#

I'm using UE5, btw.

graceful flame
#

They use it in shooter game.

plain spade
pseudo merlin
#

Is it possible for actors to spawn independenlly on client and server, but have a shared network guid and be replicated. Kind of like how I assume replicated actors that are placed in a level work? I ask because I'm working on an in game level editor, so some multiplayer levels wont be .umaps but will instead be actors I read from a .sav and spawn in game

#

I could just spawn on server and replicate them that way

#

but it might save bandwidth if players and servers can spawn their own actors and somehow sync the network uids after

latent heart
#

You're going to have to send them to every client anyway, so you're not really saving anything.

#

In the end, the data sent over the network is equivalent

#

Other than, I suppose, the data sent from the server back to the person who submitted the .sav

#

In the end it's probably less of a headache to just get the server to do it.

low helm
#

so some added cost isn't important

#

in other words, you're overthinking it

#

and trying to make some weird backwards wraparound replication just sounds like a mess

pseudo merlin
#

ill be streaming levels in and out w/ this method

low helm
#

you could, however, have them be totally not replicated

pseudo merlin
#

but yeah I see the point that stuff will get sent anyways

low helm
#

it doesn't sound like you're streaming in and out

pseudo merlin
#

its zones in an open world kind of setting

#

but I think you are right to let UE4's default networking handle it

#

no need to overcomplicate

#

if it lags Ill solve it then

#

but not worry for now

pseudo merlin
#

Forgot to say thanks!

sly kernel
nova wasp
#

Lyra is designed to be more modular

#

And uses the latest fancy epic backend stuff

#

It's also heavily GAS based and doesn't have any first person stuff out of the box

kindred widget
plain spade
#

Oh sick, I was wondering if people still used that plugin

#

I'm on the right track then, thank you.

young kestrel
marble fox
#

Why doesnt it go through the if (PC->IsLocalController())

latent heart
#

The immediate response would be - it's not a local controller?

sly kernel
lime ledge
#

You can add your own flags to the custom move data you create, so you are not limited by the 4 flags that are spare in the compressed engine flags bitfield

thorny saddle
#

hey folks
what is No owning connection for actor issue for?

chrome bay
#

Means something doesn't own it, you're probably trying to call an RPC on something where it doesn't make sense

young kestrel
young kestrel
gritty flume
#

asking here instead, would somebody be able to point me to what is failing here? Im trying to spawn a vehicle for a selected building BP via a UI button:

#

its running fine on the first picture but it doesnt fire on the building BP (second picture)

hoary spear
#

I believe this is an rpc failing due to being called from a widget, which is client only ..

#

Also not sure the spawn would need to be multicasted if its spawned on the server (and replicates)

glossy kettle
#

@ server

gritty flume
#

@hoary spear how do i make the widget call that event on the server then?

#

(i removed the multicast, thanks for that)

hoary spear
#

I believe you should go via the playercontroller , someone correct me if there's a better class

#

So widget -> pc -> rpc to server pc -> spawn units?

#

Havnt done this in ages so i might be wrong

sinful tree
# gritty flume asking here instead, would somebody be able to point me to what is failing here?...

Is BP_WarFactory a replicated actor that is owned by the player? Only then can you call a Client->Server RPC on it. Seeing as you're doing a Get all actors of Class, I'm guessing it may not be something the client owns if multiple players could theoretically be selecting it.
Otherwise, Squize is right, you probably would want to go through the local PlayerController to perform the RPC as you know for certain the player owns it.

gritty flume
#

so if its in the widget i can just get the playercontroller like this?

solar stirrup
#

Yep

gritty flume
#

this is my first try at replicated events from UI, so im quite unsure about certain stuff

#

thanks Erlite πŸ™‚

solar stirrup
#

πŸ‘Œ

fathom aspen
#

I would think so cool_think

dark edge
#

It'll return the local playercontroller

fathom aspen
#

I see, regardless of whether it's owning or not

#

This could lead to potential bugs if he's not owning that widget then, and he's intending to do something player related with it. That's why I would just do GetOwningPlayer in that case

dark edge
solar stirrup
#

Which is always your own if you have a widget

hollow python
gritty flume
#

ok, so i was able to pass it to the PC, but now it stops there

fathom aspen
#

Well what you want to do is call a server RPC instead

#

Like really why not just call a server RPC?

#

My answer was right. You are trying to call a client RPC from client

#

And that's a no no

latent heart
#

It'll work... just not as you expect πŸ˜„

fathom aspen
#

It's like calling a normal function I guess

latent heart
#

Yeah.

latent heart
# gritty flume

Change this from replicated to owning client to replicated to server

#

And it should just work.

fathom aspen