#multiplayer

1 messages ยท Page 722 of 1

quartz iris
#

I'm still trying to get a flashbang to effect both players but right now it only effects server and the clients don't even see the flashbang let alone the effect of the flash

uncut schooner
#

Multicast

quartz iris
quartz iris
uncut schooner
#

Open BP

#

Go do defaults

#

Click Replicates

quartz iris
#

Oh for fuck sake was that really the issue

#

lmao

#

Thanks

uncut schooner
#

Most likely yes

#

Np

quartz iris
#

I was so confused to why it was only working on the server lol

uncut schooner
#

Lol, been there a long time ago

raw thunder
#

Your custom event is put on "Execute on Server"

quartz iris
raw thunder
#

It is, if you want to replicate the object like this

uncut schooner
#

That is right, if your gonna replicate

quartz iris
#

oh kk

raw thunder
#

I was answering why it was only on the server ๐Ÿ™‚

quartz iris
#

Yeah

#

And if the whole bp doesnt replicate im assuming it does nothing

raw thunder
#

If it's just a 1time event you could also have a "Execute On Server" -> "Multicast" it will spawn it on all clients

quartz iris
raw thunder
#

(Your first solution works, there is just multiple ways to do it)

uncut schooner
#

And if you go that way, spawn one locally

#

Then on the server in the server rpc

#

then on the multicast, ignore the server and locally controlled character

#

And then you have it spawning on everyone

raw thunder
#

Yes ๐Ÿ™‚

uncut schooner
#

Locally, including yourself

quartz iris
#

oh I see what you mean so if i only need to replicate once in the entire bp I can just call server and clients rather than just server with replication enabled on the bp

uncut schooner
#

So if there is ping/net latency, your character won't notice it

raw thunder
#

Exactly

quartz iris
#

Got it

#

Im assuming that when replication is enabled whatever the server event is doing it does it on every other client

uncut schooner
#

Yes but it takes time to send the req to the server and then time to send it back to you (And to others)

#

Doing from you to the server and then to others is right

#

But you should spawn one locally so it seems like there is no lag, then remove the one the server spawns on your machine

sinful tree
#

Bad assumption. Some nodes do replicate their effects, others don't. Eg. A "spawn actor" node doesn't itself replicate. If the actor that is spawning on the server is marked to replicate, then that actor would replicate after it was spawned on the server.

quartz iris
#

But ideally to stop hackers you'd want the server to know about it

uncut schooner
#

Its a long road

#

Wishing you luck

quartz iris
#

Haha

quartz iris
#

Does replicate movement need to be enabled for the flashbang?

uncut schooner
#

Depends

#

Its got a bit of network overhead

#

I sometimes leave it off, if your proxy projectiles are going to be for show, and they follow one arc, Then if there is a flashbang explosion, you could just let that happen on the flashbang bp, if your on the server (Has Authority node)

#

And multicast after that node

quartz iris
#

Huh so the actual flash effect doesnt work on the client everything else works

twilit radish
uncut schooner
#

Lets see your BP

quartz iris
#

The flashbang effect is an interface

uncut schooner
#

Lmao

twilit radish
#

Yes, but no ๐Ÿ˜‚

quartz iris
#

This was to start the flash

uncut schooner
#

Then call that

quartz iris
uncut schooner
#

Whats it for

quartz iris
#

Applying the flash to the player

uncut schooner
#

I don't see the need for it, do it in the flash bang

#

Unless you have a specific workflow

quartz iris
#

Interfaces aren't on the server are they?

#

I guess thats the problem

uncut schooner
#

Yeah probs

quartz iris
#

This alright?

uncut schooner
#

You should apply the flashbang effect in the Flashbang BP (Or call it from there) using a multicast, If your the server

quartz iris
#

Can the server not apply widgets from a actor?

uncut schooner
#

Only on a multicast

quartz iris
#

Oh

uncut schooner
#

Or a client rpc

twilit radish
#

Widgets/UI are client side, they don't exist on the server.

#

Or well rather, they aren't networked.

uncut schooner
#

Sending data through a "Instance editable" and "Show on spawn" doesn't replicate to clients?

quartz iris
#

Oh right I see because if it's a custom server event and you're creating a widget you're creating the widget on the servers view

#

So I just flashbanged a client player and the effect hit the server lmao

uncut schooner
#

The var was not set to replicate, Trying that now

quartz iris
#

Does multicast effect the server player too in the same way?

twilit radish
#

Well assuming you use a Listen Server, I guess. But you can't call RPCs etc. from a widget. They don't have any netcode. So you need to call something else that is replicated and call for example a RPC on that to then create a new widget or whatever you want.

quartz iris
#

Got it

uncut schooner
#

But remember time to send data to server then to send back to everyone

twilit radish
#

With some exceptions though, but generally yes.

quartz iris
#

would it be better then to create a custom event multicast with the create widget on the player and call that from the flashbang bp?

magic yoke
#

I've triple checked

twilit radish
#

I'm not an expert, but considering this isn't a 'state' issue because it only is relevant at the moment it happens I would just call an RPC on all player controllers and have that activate the flashbang effect.

magic yoke
#

everything is default, but I'm 100% certain "play as client" launches a listen server, even though my settings claim it's launching as a dedicated server

uncut schooner
#

Create a function on the character called apply flashbang effect

#

Then make it a client RPC, reliable

quartz iris
twilit radish
#

Reliable is not needed IMO, for the reason that it should be at that moment in time.

uncut schooner
#

Then on the flashbang explosion, make sure you use an "Switch has authority)

uncut schooner
#

Then do the lintrace if you have authority

#

Cast the hit actor to your character

#

And call that function

#

You'd want the flash to definitely get applied so reliable is necessary

quartz iris
uncut schooner
#

Hmm

twilit radish
#

It's not essential to the state of your game though. It doesn't matter too much if a laggy client will get it or not because at that point they will likely experience way more issues already. But I guess it's a difference in opinions. Feel free to choose whatever you think fits for the game ๐Ÿ™‚

uncut schooner
#

That won't work

uncut schooner
#

You gotta break the hit result

#

Then cast the actor to the character

quartz iris
#

oh wait yea

uncut schooner
#

Then have the function in the character using a client rpc

magic yoke
uncut schooner
#

so you'd generally use Reliable

magic yoke
#

the game is launching a dedicated server, but the client is launching as a listening server

uncut schooner
#

If your going that route

twilit radish
#

Prediction does not magically make packets arrive and tell me I should apply a flashbang or even tell me that flashbang existed in the first place. If I lag in an AAA game they have the exact same issues.

uncut schooner
#

For things like FX

#

You wouldn't use reliable

#

And in this case the FX is for doing something important like blocking view, so its reliable

#

Well think of it in the case of, Is this an FX or is it a Gameplay important function,
Is it weapon tracer FX, or is it Weapon damage>

twilit radish
#

It's not essential to your game state though, the game can run completely fine without that RPC ever arriving. So that makes it a choice to whoever designs the system if they want it reliable or unreliable ๐Ÿ˜›

uncut schooner
#

You definitely wouldn't make your damage RPC not reliable?

quartz iris
#

I can't understand why doing it this way wouldn't work

raw thunder
uncut schooner
#

But you its up to you

twilit radish
#

I'm talking about the flashbang effect.

magic yoke
uncut schooner
#

The function

#

Is it a client RPC?

quartz iris
#

Erm

uncut schooner
#

Get Flashed

raw thunder
quartz iris
#

Not totally sure

uncut schooner
#

Double click it

#

And click on the function

quartz iris
uncut schooner
#

Make it an event

#

Then Mark it as

raw thunder
uncut schooner
#

And imo, mark it as reliable

quartz iris
raw thunder
#

@magic yoke The server is dedicated and the client is client

uncut schooner
#

No need for a multicast

magic yoke
# raw thunder I just run this

I was running it in game mode: "print is server, print is dedicated server"

I'd see 2 sets of print. Truetrue, and truefalse

uncut schooner
#

Would be a waste

magic yoke
#

so something's wrong with my install I guess?

magic yoke
#

exactly like that yeah

#

in game mode

#

lemme triple check

raw thunder
#

I have True True for the server and False False for the client

uncut schooner
quartz iris
#

Alright finally it works

#

lol

uncut schooner
#

Without going through the server?

quartz iris
#

Yeah

raw thunder
#

I don't think so

quartz iris
#

Well I made the flash server sided

raw thunder
#

the server will just respawn it no?

quartz iris
#

But the effects client

uncut schooner
#

Idk

magic yoke
#

you can, but it'll be respawned I believe

uncut schooner
#

Ok

magic yoke
#

@raw thunder

raw thunder
#

wtf

magic yoke
#

you're telling me lol

#

no wonder I'm having weird ass bugs

raw thunder
#

Oh GameMode

#

Hum

magic yoke
#

game mode only runs once, server side

raw thunder
#

Let me try on gamemode

uncut schooner
quartz iris
magic yoke
uncut schooner
#

Thats the best way in this case

quartz iris
#

Saves on bandwidth im guessing?

raw thunder
#

no but why is it firing two times? Mine only once

uncut schooner
#

Kinda

#

Also is less complicated lol

magic yoke
#

the client it's launching is acting as a listen server

#

at least, that's the only explanation I can think of

#

it also explains why a lot of my text stops having "client" vs "server"

#

my friend noticed that a couple days ago

dark edge
#

Or rather, just launch, not PIE. See if it's different there.

magic yoke
#

err

#

pie?

#

oh

#

play in editor

#

this is pretty early on

#

I don't have the ability to specifically connect to a serve ryet

dark edge
magic yoke
#

launch looks like you need to launch dedicated server separately and then connect>?

dark edge
magic yoke
#

@dark edge attemption to launch the server gave a cook failed

#

choosing the variant "windowsserver"

#

launching it normally gave me a listen server

dark edge
#

You got a bunch of unknown structures so I'd settle taht problem before moving on lol

#
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/CartController.CartController_C:Refactor Display Chunks to New Center:CallFunc_Get_Chunk_Chunk_Structs.CallFunc_Get_Chunk_Chunk_Structs'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/CartGameState.CartGameState_C:World Array.World Array'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/CartGameState.CartGameState_C:Get Chunk:Chunk Structs.Chunk Structs'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/CartGameState.CartGameState_C:Get Chunk:Tile Struct Array.Tile Struct Array'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/CartGameState.CartGameState_C:Get Chunk:K2Node_MakeStruct_CartTileStruct'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/CartGameState.CartGameState_C:Load World:Loaded World Array.Loaded World Array'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/CartGameState.CartGameState_C:ExecuteUbergraph_CartGameState:K2Node_CustomEvent_Loaded_World_Array.K2Node_CustomEvent_Loaded_World_Array'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/World/CartTile.CartTile_C:Tile Struct'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/World/CartTile.CartTile_C:Change Representing Tile:New Tile Struct'. Unknown structure.
LogInit: Display: LogProperty: Error: FStructProperty::Serialize Loading: Property 'StructProperty /Game/World/CartTile.CartTile_C:ExecuteUbergraph_CartTile:K2Node_CustomEvent_New_Tile_Struct'. Unknown structure.
LogInit: Display: LogClass: Warning: Property Tile Struct of Tile Struct has a struct type mismatch (tag STRUCT_REINST_CartTileStruct_29 != prop FallbackStruct) in package:  /Game/World/CartTile. If that struct got renamed, add an entry to ActiveStructRedirects.
LogInit: Display: LogClass: Warning: Property Tile Struct of Tile Struct has a struct type mismatch (tag FallbackStruct != prop CartTileStruct) in package:  FObjectReader. If that struct got renamed, add an entry to ActiveStructRedirects.
LogInit: Display: LogClass: Warning: Array Property World Array of World Array contains a struct type mismatch (tag FallbackStruct != prop CartTileStruct) in package:  FObjectReader. If that struct got renamed, add an entry to ActiveStructRedirects.
LogInit: Display: 
LogInit: Display: Failure - 10 error(s), 3 warning(s)
magic yoke
#

they're all my custom fiels

#

files*

#

but the weird thing is that only happens if I run "by the book" mode

#

"cook on the fly" doesn't seem to care?

dark edge
#

Yeah idk, I don't even cook for quick testing. Just fire up through those batch files and get on with it.

magic yoke
#

well I can try the batch files

#

that's being run through the project launcher

magic yoke
#

client launched in listen server again

#

the mismatches are apparently because it's angry I renamed structs

#

which I'm assuming is a bug, since the editor claims it'll handle that

#

but there's some C++ redirect code it wants that the editor didn't properly handle?

thin stratus
#

If you are printing "IsServer"

#

And that returns true

#

Then that doesn't mean you are a ListenServer

dark edge
magic yoke
magic yoke
thin stratus
#

Wrong

#

It prints if you are not a client

#

And a freshly started game is Standalone

#

Which is not Client

dark edge
uncut schooner
#

Hmm something weird is happening

magic yoke
uncut schooner
#

I am passing in a vector, on a instance editable, show on spawn

#

But in the construction script of the BP it reads 0,0,0\

magic yoke
thin stratus
#

Are you actually starting a Client that is connected to the Server?

#

Because if not, then IsServer returns true cause you are standalone

magic yoke
#

I was using PIE

thin stratus
#

And Standalone also has a GameMode

magic yoke
#

set to Client Mode

#

where this first showed up

uncut schooner
#

Now its working after a restart...

#

Weird

dark edge
thin stratus
magic yoke
thin stratus
#

What Mode do you start in?

magic yoke
#

server:true dedicated:true
server:true dedicated:false

#

in client mode

uncut schooner
#

Doesn't it print twice because you start as a local player

thin stratus
#

No, what like PIE mode

magic yoke
#

I see those two prints lol

uncut schooner
#

So server

#

Then you connect to the dedicated

magic yoke
#

play as client?

#

that's what you mean?

thin stratus
#

Selected Viewport, New editor Window, Standalone Game

#

That stuff

dark edge
#

@magic yokeYou sure you don't have auto-connect to server turned off? Show your advanced PIE settings

magic yoke
#

gotta finish the instal verify

#

then will do

thin stratus
#

I'm not sure UE5 still has teh Auto Connect to Server thing or?

magic yoke
#

that's what I remember it being

#

no it doesn't have a checkbox for it

#

not that I could find

#

since someone suggested

#

ok I gotta do something and this verify is gonna take 15 more minutes

#

will be back to bug once it's done, thanks for all the help <3

quartz iris
#

So im trying to make a thrown c4 land correctly upwards when it hits a surface

#

How can I do this?

#

I need it so it lands correctly on walls too

thin stratus
#

Is the C4 correctly rotated upwards in its BP?

quartz iris
#

Yes

dark edge
thin stratus
#

Then you need the Surface Normal

uncut schooner
#

If I get 2 output pins from a single node

thin stratus
#

The Hit usually give you that

uncut schooner
#

Does it fire 2 times?

thin stratus
#

You can make a Rotation from that

thin stratus
quartz iris
#

Is it look rotation?

uncut schooner
#

As an example

dark edge
#

@quartz iris

Event Hit -> Self.rotation = MakeRotationFromUpVector(Hit.normal)

#

assuming the c4 is oriented such that up is away from the surface

thin stratus
dark edge
uncut schooner
#

Damn, I've been using pure everywhere because it feels convienent

#

Thanks

dark edge
#

Pure functions ONLY depend on their inputs

#

I mean, idk if it'll error out or not if you push the pureness of a BP pure function to its limits, but in C++ that wouldn't be a pure function.

dark edge
#

I'm assuming BP makes the Camera an implicit parameter.

dark edge
quartz iris
dark edge
thin stratus
#

Also this isn't reeeeeaally multiplayer related :D

dark edge
quartz iris
#

Would this work for all players?

quasi tide
dark edge
quartz iris
dark edge
#

Anyway

#

Assuming the rest of your setup works, that should take care of orientation.

quartz iris
#

It feels to satisfying lol

#

To detonate a c4

quartz iris
dark edge
# quartz iris Would this work though for multiplayer?

How tf would we know, we don't know anything about the rest of your setup. We don't know if you're processing hits everywhere or only on server, if you're replicating movement or handling it some other way, none of that. I don't see anything that'd obviously make it NOT work.

magic yoke
#

@dark edge fix up redirectors did nothing to solve those red/yellow errors asking for redirects

#

@thin stratus

#

"C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\Win64\UnrealEditor.exe" "%CD%\Cart_and_Coin_Deluxe.uproject" Cart_and_Coin -game -log -nosteam

#

running this still causes me to run a GameMode

#

launching multiple clients causes multiple "listen server" clients to appear

#

I swear I was told that GameMode only runs server side

#

which explains some other bugs I've been having

thin stratus
#

GameMode runs Server and Standalone

#

Not client

glossy plover
#

Is it possible to have both local and online multiplayer together? So for example 2 PCs connected, but 2 controllers on each PC?

#

(so 4 total players in that example)

chrome bay
#

Yes, quite difficult to support though

#

Split-Screen multiplayer works in ShooterGame AFAIK

magic yoke
#

but either way, I'm not launching dedicated+client

#

or listen+clients

#

because launching listen mode puts up a bunch of standalones or something

chrome bay
#

Or they're being instantly kicked from the server

magic yoke
#

if they're insta kicked

#

would they run game mode at that point?

chrome bay
#

they would travel to the "default" map for your project, and run that world as if it was standalone

magic yoke
#

ok

#

so that's most likely what's happening

chrome bay
#

Should see the kick messages in logs

magic yoke
#

message longs?

#

logs*

#

I'm not seeing any errors along those lines

#

mind, when trying to launch a standalone server I'm getting bizarre errors

#

maybe the server's crashing due to this and the clients are left hanging?

chrome bay
#

Fixing errors should indeed be the first prio

magic yoke
#

no idea where to start with these

chrome bay
#

Realistically I don't think those Blueprints should even compile

magic yoke
#

they don't if you "compile by the book"

#

but if you "compile on the fly" they do

chrome bay
#

Not sure what you mean

#

If the BP's don't compile properly, it stands to reason you'll get errors at game time

magic yoke
#

in the project launcher

#

by the book errors

#

on the fly doesn't

chrome bay
#

Oh ignore that, I'm just talking about in-editor

magic yoke
#

in editor I see zero erros

#

errors anywhere

chrome bay
#

That's the cooker params, so irrelevant to in-editor testing

magic yoke
#

only place I find that is buried deep in cook logs

#

there aren't any errors in the blueprints named

chrome bay
#

Try resaving those BP's also to see if it goes away

magic yoke
#

that I can see

#

they're fine though?

#

Property 'StructProperty /Game/CartGameState.CartGameState_C:World Array.World Array'. Unknown structure.

#

LogInit: Display: LogClass: Warning: Property Tile Struct of Tile Struct has a struct type mismatch (tag STRUCT_REINST_CartTileStruct_29 != prop FallbackStruct) in package: /Game/World/CartTile. If that struct got renamed, add an entry to ActiveStructRedirects.
LogInit: Display: LogClass: Warning: Property Tile Struct of Tile Struct has a struct type mismatch (tag FallbackStruct != prop CartTileStruct) in package: FObjectReader. If that struct got renamed, add an entry to ActiveStructRedirects.
LogInit: Display: LogClass: Warning: Array Property World Array of World Array contains a struct type mismatch (tag FallbackStruct != prop CartTileStruct) in package: FObjectReader. If that struct got renamed, add an entry to ActiveStructRedirects.
LogInit: Display:

#

I think this is the issue

#

but I don't do any C++ coding

#

and if I did rename it's only through the editor

#

I guess maybe bug in renaming for the editor?

chrome bay
#

Hard to know exactly what's happened, but my guess is something was renamed and left a redirector behind, and now that redirector is gone and past refs to it are broken

magic yoke
#

clean up redirects does nothing

#

sadly

chrome bay
#

Did you delete them in explorer or anything?

magic yoke
#

no, I've not done anything outside the editor since starting this project

#

my last project corrupted probably because I did something like that

#

so I've been strict about it

chrome bay
#

Accidental hot-reload or something?

proud galleon
#

Do you think it makes sense to use sql for inventory? Because I need to separate all the rows one by one and check if they are full or empty and add them to the inventory. I personally think that these processes will tire the computer and it will be very tiring in the blueprint. What should I use?

magic yoke
#

only work in blueprints? I did do a reversion via SVN

#

could that cause it?

chrome bay
#

Ah yeah, probably then

kindred widget
#

What are the required modules/includes for creating a FastArraySerializer?

chrome bay
#

NetCore module I think

magic yoke
#

:| how do you avoid breaking things with reversions then lol

chrome bay
#

Well ideally, all the files affected by changes in a given revision are part of that changelist

magic yoke
#

SVN was supposed to save me, not hurt me T-T

chrome bay
#

But I expect some files that were dependant on changes to others did not get reverted in that process, or something.

magic yoke
#

ok

#

well whatever happened

#

do you know how to fix this?

#

would the best idea be to make new structs and replace references?

chrome bay
#

Probably re-create those properties that are causing the issues

magic yoke
#

is replace references safe?

chrome bay
#

Theoretically yeah

#

But probably not for Structs

magic yoke
#

well I can revert

#

but reversions don't seem to WORK for everything

chrome bay
#

You just need to make sure all files affected by changes are submitted in the same changelist, and the same when reverting

kindred widget
#

Hmm.. NetCore didn't work. :/ I have the following two includes already. And zero error highlights. Just a ton of unresolved external stuff.

#include "Net/UnrealNetwork.h"
#include "Net/Serialization/FastArraySerializer.h"
magic yoke
#

as far as I'm aware, I submit everything all at once

chrome bay
#

BP does tend to crap itself if you rename BP structs anyway, definitely seen that before but don't really know all the causes

magic yoke
#

sighs

#

shame, don't like working with "dangerous" things

#

but I need structs lol

#

well I did learn a lot here

#

I'll try to refactor away from the broken BPs

pearl fog
#

Hello, we have a big problem with our multiplayer, players host theirs own listen servers and for some reasons some servers have big replication issues (like things get very long to replicate, UI don't show up etc), we've tried everything we could, we've done profiling but we just don't understand what's going on..
(we use steam sockets for our netdriver)
oh and all players that report the issue have a low ping

quasi tide
#

Oh - you're asking about an inventory itself and not a database.

#

Uhh - I'd find it to be weird to have your inventory as sql personally. Can just be an array of structs.

dark edge
#

If you were making an EVE or a WoW? Sure you need a DB. If it's a basic game without millions of items, nah.

wide sable
#

I started off by making my game singleplayer and now im going through the trouble of going through and changing it to multiplayer. I made a GameInstance class and I am trying to setup the widget system that has countdowns and displays. GameWidgets is a TMAP that contains the PC and a pointer to a the widget class.

Apart from that, my main guess is that for DisplayCountdown() I should keep the iterating through PCs in the GameModeBase and then to use the GameInstance to send a signal to the GameModeBase whenever necessary.

This is my first time trying to understand GameInstances and it's a little confusing for me currently so sorry in advance if everything is sloppy

fluid summit
#

Hi everybody!
I'm trying to make a healthbar for each party members (every player state on the game, it doesn't need to differentiate for anything else)
I want something like this

#

i'm thinking on add a new widget to every player locally when a new controller gets in and for each player state add a widget.
My problem is that i'm not sure on how to update the specific widget on each remote whenever some player state changes (let's say hp)

#

Do i make an array of Widgets on each PlayerState and when variable changes OnRep, i change the value of the widget?

#

how would you go about doing something like this?

graceful flame
#

Should a retriggerable delay's length be a replicated variable? I'm thinking it needs to be replicated for anti-cheat because its used to control fire rate of a weapon even though it never changes. Is that correct?

nova wasp
#

Least insane event/function that fires once on each actor on the server?

#

Beginplay is not it

fluid summit
#

Beginplay -> has authority (yes)

#

that will only fire once per actor spawn on the server

#

if you go the "No" route, you get the remote version

dark edge
nova wasp
#

Just seems like it will get triggered multiple times

dark edge
#

Why would it? How many times does an actor begin play on the server?

nova wasp
#

Fuck it, yolo

#

I'm gonna reread the compendium

#

You are probably right

dark edge
#

I mean you could hook into event on destroyed if that's more your style

kindred widget
fluid summit
fluid summit
# nova wasp Just seems like it will get triggered multiple times

You are getting multipler triggers because you get one Actor on Server and one OnClient.
So if you put a "print" OnBeginPlay, you will get 2 prints. One for the client version and one for the server version.

You can filter by checking "Has Authority" and deciding where specifically you want to let that flow go

nova wasp
#

I know, it's just the preexisting code here sets a bool to ensure it only does this once

#

Hence my suspicion

kindred widget
# fluid summit So the idea would be to subscribe the widget to a event dispatch? that was my fi...

I strongly recommend learning to separate UI from gameplay in a way that Gameplay doesn't enforce UI. The UI should be able to be be created at any time independent of whether the playerstate exists. The playerstate shouldn't do anything but exist in this context. GameState should have delegates that get called when a playerstate arrives and is removed from a client. The container holding your widgets can update and add or remove a widget from the list at that time. But the container should also have the ability to fully update itself for all current playerstates, etc. All the container should need to do is pass the playerstate associated with the newly created widget in it's CreateWidget call. The widget can then either tick to poll and update UI, or bind to whatever runs the health. If the Health is in a component in the pawn for example. The widget needs to be able to GetPawnPrivate->GetComponent->Bind. And that's assuming it's valid. If the pawn isn't valid yet, you also need the ability to wait until that Playerstate's pawn is valid, etc. It's a complex setup that can quickly get annoying with engineering changes to the project. Which is why I strongly recommend just ticking it in the widget that gets the playerstate passed to it. Eight widgets ticking a few checks isn't going to really be noticed in a profile since you're not invalidating very often, it'll work well and you can move on to other things. If the time comes to make it event driven, go for it. But in my personal opinion it's a waste of time to bother.

fluid summit
# kindred widget I strongly recommend learning to separate UI from gameplay in a way that Gamepla...

This makes more sense, UI doesn't have anything to do with the player state.

This setup works ->
PlayerState -(BeginPlay)-> Create Widget variable -> Tell Pc to update UI
PC -(update UI)-> Get all player states, fill wrap box with variable "UI" from the player states.

And on playerState health change (OnRep) just update the variable UI.

It's a mess already and it's only one widget.

I'm gonna go with something similar to your suggestion and let the PlayerState tell the PC to update the ui and there generate one widget for each playerstate and bind them to the PlayerStateEvent.

fluid summit
kindred widget
#

There isn't anything like that by default. Anything like that would need to be your own implementation.

fluid summit
#

The event dispatcher is working fine on the server but not on the client, oh god don't tell me that you can't replicate Event Calls to clients

spark stag
#

i'm trying to talk about some data assets over the network with server RPCs. data assets that derive directly from a C++ class work, but i have some that derive from a blueprint class that is derived from the C++ base class. those ones don't have RF_Loaded, so unreal doesn't think they have a stable name

#

any idea why that is?

fluid summit
spark stag
fluid summit
#

Does it make any sense that i'm geetting a delay of about 1 sec on the event dispatch call? the UI on the clients takes 1 sec to update. I don't have a delay node anywhere and the ping should be 0 since it's local

#

(I'm using steam session for matching the session)

dark edge
kindred widget
lime iris
#

I need help!

All of my gameplay logic is inside a widget, and everything needs to be โ€œreliableโ€ (execution order is important) or else it will break the game.

Hereโ€™s my setup:

Whenever a player executes [Mouse Button Double Click] (as one of many example) from a widget, I do Widget (perception only) > PlayerController (run on server, reliable #1) > GameState (multicast, reliable #2) > Widget (for the widget to execute the rest of the logic, all clients).

(Btw, do I need to check reliable 2 times up there?)

The problem is, when thereโ€™s a latency (randomly simulated) on the network, itโ€™s slow/lagging too much (other players need to wait for the commands to execute in order). Probably because of over-using โ€œreliableโ€.

isโ€™t better to use variable repliction (not sure, but I think some people call this property replication)? Are they โ€œreliableโ€ (and do they also execute in order, same as RPCs)? Should I pull all my blueprints & variables outside of the widget, and somehow put it on GameState or perhaps PlayerController?

kindred widget
# lime iris I need help! All of my gameplay logic is inside a widget, and everything needs ...

This likely doesn't have anything to do with being Reliable. That won't really slow anything down unless you're spamming it thousands of times on tick. The issue is simple lag.

Not going to go into depth on reasoning unless you ask, but generally speaking I would strongly advise using other class types for gameplay logic. Widgets should do nothing but display the game class's state and allow input to them. The only complex logic in widgets should be their own functionality for layouts, visuals and such.

Replication is not promised in order. If you require perfect order, you have no choice but to wait for client to sent to server, and server to send back though RPCs. Replication is usually reliable in a sense that it will definitely arrive on client, but there are a lot of considerations for timing. Having said that, your logic does seem like a typical use case for property replication with an OnRep that runs a delegate. Widget click RPCs through controller. GameState does whatever, sets new state and the new state replicates to all clients. All clients run their delegate in their OnRep function. Widget has that delegate bound and does whatever you were doing in the multicast maybe. Though this shouldn't change anything with the latency. It still has to travel to server, and be sent to each client.

fluid summit
kindred widget
fluid summit
#

You mentioned this "Eight widgets ticking a few checks isn't going to really be noticed in a profile since you're not invalidating very often"
does that mean that there's some sort of resource saver once the pointer to the object is set and the validation does not run anymore?

kindred widget
#

Mostly in UI, you just want to avoid constantly invalidating large sets of widgets all the time. Setting widgets attributes to the same value they're already at fails in their SetAttribute code. It won't invalidate if it's nearly equal the already set attribute.

#

If you set a ProgressBar's Percent to 0.5 percent in tick. It invalidates once. It won't invalidate again until you set it to something other than 0.5. Even 0.5001 would invalidate it, but feeding it the identical 0.5 will not. So the tick function basically ends at your code trying to set the 0.5 value over and over until health changes. No extra visual update code runs at all beyond that until the health changes.

fluid summit
#

oh that's nice

lime iris
kindred widget
#

There is no reliable order for OnReps. They just run when the value arrives on client, and you can't really always promise whether that value will arrive before or after another one.

mint nymph
#

hi i am having desyncing issues, with multiplayer when players are sprinting. When I press space and jumps player jumps back into sync any fixes that people can suggest

fathom aspen
fluid summit
#

Okey so the 1 seg delay with the UI updated with the event dispatcher had nothing to do with the Event Setup.
I'm getting the same 1 seg delay when updating on "Tick" from UI.

It seems i'm having 1 seg lag on the variable replication even when running on the same pc, weird.

chrome bay
#

What's the update frequency of the actor performing replication?

weak aurora
#

Hi, anyone know why my code fires twice on the server in the first case but not the second?

Case 1: Character inputs key F to spawn an actor with "Run On Server". This spawned actor then takes the instigators' character movement component and with a custom event with "Run On Server" increases the Max Walk Speed by 2x, runs a delay for 3s and then halves it. This fires twice On the increase movspeed, but only fires once on the halven-movspeed.

Case 2: Character inputs key F to "Run On Server" set Max Walk Speed by 2x, runs a delay for 3s, and then halves it, in the character blueprint itself. This works as intended.

EDIT:
Solved it by Running Switch Has Authority on the first Case before Run On Server set Max Walk Speed

forest flint
#

hello. I am making 4 coop game with listen server on Steam. I started to thinking about dedicated server on one of player's pc for better performance. one map will be open world 3x3 km and second map will be inside bigger building with many floors inside. it will contain level streaming somehow. is it worth to move to dedicated server or it will be no much gain from moving from listen server to dedicated server on player's pc

shell haven
#

Hey so I am having an issue where my client players are becoming gradually desynced over time from the server and other players. This effect is quickened when running into a wall. The players report seeing that person in a different location than the actual player is. I assume there is some predictive thing going on that is moving the players on the server incorrectly, but the actual player position/state isnt being updated fully

#

Strangely, jumping will cause this desynced player to automatically teleport and resynchronize with their location according to the server

#

Any ideas? This is very frustrating

bitter oriole
forest flint
bitter oriole
#

Dedicated server is indeed a higher quality approach for competitive games that have anti-cheating facilities and a large player count

#

But it only makes sense if that server is hosted in a datacenter

chrome bay
#

It could also be useful if you want the network stuff to tick at a fixed rate though, or be totally independent from the hosting players' local game

#

e.g. remote players can sometimes look pretty weird on listen servers

sick escarp
#

someone help me fix this pls

#

my player 2 cant shoot

real ridge
#

guys can I ask is any way to store player state after quit game ? even I will run 5 clients of games on pc can I save after quiting it for all 5 ?

#

somehow ?

#

๐Ÿ˜„

#

I am not sure if it will working

#

I generated some sort of unique player id and I want it save so after running game i will see that he already has his unique id generated

upbeat basin
real ridge
#

(but before connecting to server )

#

talking about in game menu or lobby or i dont know how to call it

#

just after running game

upbeat basin
real ridge
#

just for now for testing I want save it for client before connecting to server and then via varest I will send it to my database where I can start matchmaking

#

with these ids

#

and then I will execute server with map

#

to start game

upbeat basin
#

If that's the case you can use SaveGame to save your string on the local disk

real ridge
#

okay and i can use this save game only for 1 client per 1 pc ?

#

or can run 4 clients and all 4 will be saved ?

upbeat basin
#

4 clients in a single PC?

real ridge
#

yes

#

not possible ?

upbeat basin
#

SaveGame basically creates a file with .sav extension and writes the variables that you have created under it. You can give SlotName parameter any string as you wish to name the file and distinguish for each player, by naming with the playername for example. There is also a UserIndex input that you can give that might work, which I never used before so don't know much about how or what it does

real ridge
#

how can they cheat with that

upbeat basin
#

The string you saved can/might be changed with third party programs, to imitate another player or to break the game

#

If it's a coop game or running on a listen server, you don't need to care about this, because server itself is already running in the client PC. But if you're working with a dedicated server and it's important to prevent cheats then it's not an ideal case so save something on the client, that is required to match the player with data on the server

real ridge
#

okey thank u

sick escarp
real ridge
#

guys any easy tip how to make something like really eassies matchmaking ? I will hit play and firt 4 players which it will find will join game ?

#

๐Ÿ˜„

marble gazelle
#

well you always need some server that does this for you. Multiplayer is never "easy" and it the worst to start with to do games.
I think net subsystems like steam or epic are helpful on this, but I never used them, so dig into these ^^

harsh lintel
#

Is there a way I could debug why my client can't connect to a dedicated server through open 127.0.0.1? The project uses CreateSessionCallbackProxy without issue but I need to be able to connect to the dedicated server

harsh lintel
#

I'm doing this but now I'm getting "incompatible unique net ID"

pallid mesa
#

any of you have tried server streaming with world partition?

warped berry
#

Is there a way to differentiate between steam lobby callbacks for joining/leaving players and lobby data parameters? they both trigger the same callback from steam

harsh lintel
#

how do I turn a FString to a FUniqueNetIdRepl?

grizzled stirrup
#

Should GameSession->HandleMatchHasEnded(); be called before destroying a session?

#

If you intend on destroying it anyway after is there any reason to call this function?

winged badger
#

It can let you propagate something like "host has left the session" if youre using listen servers

#

That way players are mad at host instead of your "crappy network code" ๐Ÿ˜

winged badger
#

Or something similarly as bad

winged badger
#

@warped berry

grizzled stirrup
#

Ah it would only be if the host leaves via the menu and doesn't disconnect right? You'd then fire that line on the host and clients can react accordingly?

winged badger
#

It would put clients in main menu, but without a message properly blaming host for the disconnect

warped berry
quasi tide
fluid summit
#

Hi everybody! i'm trying to set a "SaveGame" variable from the client to the server.

This works right for the server, but for the clients i get this error

LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: SG_Character_C /Engine/Transient.SG_Character_C_21 NOT Supported.

I found little to none related documentation on how to make this actually be supported.

Does anyone have any idea on how to do it?

harsh lintel
#

I'm adding -nosteam to my server but it seems like it's being ignored

latent heart
#

Solution to that would be to create a struct with your character's properties, save that instead and send that to the server.

#

The ones you want to save, that is.

#

Or do some sort of convoluted system where the client asks the server to create a character (via rpc,) the server creates it and sends an rpc back with the new character, and then the client sets all the properties and sends it back to the server Shrug

fluid summit
#

Oh i see the problem now, i think i can work around it. Thanks!

#

Passing a ST instead of the Object did the work, just need to encapsulate all the variables of the SG into one ST.

dark edge
fluid summit
#

St = Structure

#

Yeah, sending the data was the right way to do it

#

Hi! it's me again

#

Maybe i got something wrong about how the PlayerState is on server and on client.

that blueprint is only triggering on the Server

dark edge
#

Is there an Amanda Huginkiss here?

fluid summit
#

But on the server version of the clients, it's not triggering the node "OnBeginPlay"

fluid summit
dark edge
latent heart
fluid summit
#

The PS_BP on the server that replicates to the PS_BP on the client

latent heart
#

And see what happens.

sinful tree
fluid summit
#

Oh i see, that makes sense.
So i guess my logic with how the PS is presented for both client and server is okey, it's just a matter of timing

dark edge
sinful tree
#

Not even sure about that.

dark edge
#

I really wish we had a couple built in "Everything is ready to go on server and client" events to hook into.

pallid mesa
#

we

#

do

dark edge
fluid summit
#

I guess we can make a Event that triggers both on client and server and checks if both are ok, only than proceed.

fluid summit
dark edge
#

Puhun vรคhรคn suomea

latent heart
#

(on the client)

pallid mesa
#

feel free to steal my stuff

#

but please, try to understand it

#
  • have a good day
sinful tree
sinful tree
#

In Vori's examples, they have the OnRep_playerState which would be the right place to run anything clientside.

latent heart
#

When the PC replicates, it should guarantee that the PS has, though.

#

..I think?

sinful tree
#

It doesn't

pallid mesa
#

the replicated playerstate

latent heart
#

But yeah, use onrep then!

fluid summit
#

Just in case, i just tested if reliable RPC will handle the client not ready yet and it doesn't.

pallid mesa
#

so onrep in the controller is the safe place to ensure the ps has the right vals

#

also... feel free to grab the ntp clock that is in there

#

lmao

#

it is more accurate that gamestate's one (except for the first 10 seconds)

fluid summit
#

If i'm right, your method is exclusive to C++ and not by BP.
Because you can't override the "OnRep PlayerState" by default unless you create a new variable on the PC for the PS and flag it OnRep.

pallid mesa
#

so TLDR: add this on C++ create some k2s and you can have this exposed in BP's

#

you can even make the delegate BPable

#

but I don't recommend it

fluid summit
#

Yeah, i just wanted to confirm if it's possible on BP without exposing functionality with C++.
Thanks for the data, it's actually usefull

pallid mesa
#

in BP's you have to do waiting loops ๐Ÿ˜ฌ

#

so if for some reason you want to obtain the same functionality only using BP's

#

you could create functionality that synchronously waits for values to be valid in the client

harsh lintel
#
    FUniqueNetIdString NetID(SteamId);
    Super::PreLogin(Options, Address, FUniqueNetIdRepl(NetID), ErrorMessage);
``` This is crashing, is it wrong?
#

it's on PreLogin, I'm also using -nosteam

fluid summit
#

I have no idea, but i think may be able to help if you tell me what your desired behavior is

crystal crag
#

Anyone have any idea what would make pending net game never getting cleared in PIE, but it gets cleared just fine when running outside of the editor?

#

Like even high level general things to check to give me some leads to chase down would be cool. I tried to pull up the references and the engine references it a bunch

fathom aspen
#

Persists means you still have a game mode actor when you seamless travel, not that it's the same game mode. You seamless travel to a new level/map that has a new GameMode configured and hurray

#

I'm not sure what's the question here

shell forum
#

This means that OnPostLogin will never be called after the connection to the server. If you want a OnPostLogin when a map changes you need to not use seamless travel.```
fathom aspen
#

No. What you want instead is HandleSeamlessTravelPlayer or HandleStartingNewPlayer

keen pewter
#

Hello, I have a question. If I fire a server event from a client, this server event grabs the servers 'seed' or whatever. How would I go about running an event back on that original client? Do I need to send the client as a variable on the server event and then run the client event with that as the target? What would be the 'client' variable?

This isn't a character or anything, it's a seperate object in the word that needs a variable to be grabbed from the server version of itself on begin play
Also I'm working in blueprint

fathom aspen
#

It will execute on owning client

keen pewter
#

Oh, so if a client executes a server only event on an actor, and that server only event fires a client only event. That client only event will always fire on the client that called the server only event?

fathom aspen
#

That client event will run on the owning client of that actor. Also the in order for the server RPC to be sent, the invoking client must own that actor

#

So the short answer is yes

keen pewter
#

Oh my, okay, I was thinking way too hard about that.... I'm brand new, hour 0 of replication n stuff as you can probably tell. I'll try it thank you ๐Ÿ˜„

fathom aspen
#

It's okay, we're always here for help. Go for that grind!

#

I would also suggest you to read the compendium if you haven't done so

#

You'll find it in the pinned messages

gleaming kite
#

Is player state the best way to "chose" a character? Eg. You have two player states one for the lobby and one for playing, the lobby one is where you chose the character and then when you connect to the server it reads that?

keen pewter
#

I like the sound of that, I will give that a go ๐Ÿ˜„

fathom aspen
gleaming kite
#

Gotcha, thank you! Seems pretty simple

woven basin
#

How would an Unreal programmer handle dungeon โ€œinstances/mapsโ€ in multiplayer? I.e. in an open world, some players in mage main map, some in dungeon instances (other maps).

Kind of like what Valheim has with its dumgeons in Unity.

My understanding is in MP you have to have everyone on the one map. So do I just load dungeons in as sub levels in some far away X,Y location and teleport the player there?

#

Is there a better way?

winged badger
#

can't help but notice a lot of plurals there @woven basin

#

how many players were you planning on in total?

crystal crag
#

Over 9000

woven basin
#

Like 4

#

Coop

#

Maybe even 2

#

and maybe "instance" is the wrong word - because there would only be one of each dungeon. I guess its more about how you would have dunegons in an open world style in multiplayer, where the dungeon is its own map.

The only way I can think of is the map is a sub-level loaded in far away in the main level.

winged badger
#

well, its that or hard travel

woven basin
#

but I cant do hard travel in that scenario can I? If you have a dedicated server, it needs the main map loaded at all times (Player A in main map, Player B in dunegon)?

winged badger
#

dedicated server can start another instance to run the dungeon

woven basin
#

but that means the players are effectively in different games? i.e. they couldnt talk to each other in that scenario could they?

The more I think about it, the more I think I just need to do "far away" dunegons - it probably avoids all this messy stuff huh?

winged badger
#

they don't need to talk via unreal replication, but yes, they would be technically in a different game

kindred widget
#

I know that ARK:SE just hides their boss rooms under the main terrain. You can glitch out sometimes an see the boss healthbar from pretty far away when someone is doing a boss and you're in the main 'world'. ๐Ÿ˜„

woven basin
winged badger
#

they can be streamling levels

#

so they don't need to be loaded when nobody is doing them

kindred widget
#

Unreal tends to have a lot of hiding stuff under the main game world concepts. Small closed rooms for rendering stuff with lighting you don't want to affect elsewhere, etc. Is in a ton of their concept stuff.

#

But yeah, definitely stream them. Just make sure that unlike ARK, you don't load everything blocking. ๐Ÿ˜„ Entering caves and starting meteor storms with a 15 second game freeze isn't really cool.

woven basin
woven basin
winged badger
#

that ARK is starting to sound like they did their networking in blueprints ๐Ÿ˜„

crystal crag
#

A big part of the game is in blueprints, including some networking

keen pewter
#

I have a question just for my brain to understand. Say you had something like an animal spawner, that is randomly generated on your terrain somewhere, and every 10 minutes or so it chucks out an animal.

If a client joined 10 minutes after the animal was spawned from said spawner, how would you go about making the client aware of the animal?

I'm just thinking if the client was there when it happened there would be a server and client side animal in sync
But if he joined after, there would only be the serverside animal

Purely trying to wrap my head around how this kind of thing works, day 0 multiplayer right now

woven basin
crystal crag
#

I used the SDK and saw so much in BP that I did not expect to find there

static garnet
#

hey people, i wanted to ask, can i have a particle system in a replicated actor? or is that bad and i should have the particles in a separate actor that i spawn with multicast?

winged badger
woven basin
keen pewter
#

So UE knowing that it's replicated it would just spawn itself for the client on the first update to the client?

winged badger
#

but separate actor spawned by multicast sounds a little bit red flaggy

#

whats your specific use case?

static garnet
# winged badger whats your specific use case?

just a simple skill in a multiplayer game. the main actor of the skill is spawned on server and replicated, but i know you're not supposed to replicate particles and just spawn them locally so im trying to figure out whats the best way to do that

winged badger
#

opening another ActorChannel just for particles would be crazy

#

you don't replicate particles, yes

static garnet
#

ok, so whats the best practice here?

winged badger
#

but you can, if its a fire and forget

#

multicast an event in that same Actor that will spawn a particle system

#

if its stateful, as in you interacted and activated a shield

#

then you need to replicate that state, and from OnRep, spawn a particle system

#

multicast will fail for stateful changed, for anyone that is outside relevancy range, as well as for late joiners

static garnet
winged badger
#

when engine replicated an Actor

kindred widget
#

On a side note. If the skill is an actor itself, and you're spawning it, it's likely that the particle system should just be a part of it and auto activated?

winged badger
#

both client and server create it from the Template - if the template has the PCS

#

they both have it on by default, no matter if the component is replicated or not

#

in your case, it sounds like you can put a PCS as a component on the Actor by default

#

and just Activate it on BeginPlay

#

as long as your particle system is tightly tied to the lifespan of the Actor itself - you do not need any additional information except for that Actor entered play, or got destroyed

static garnet
#

ok cool. so i can have it just as a component, and the client will just spawn it himself when the actor is replicated to them, right?

winged badger
#

actor spawns with all its default components, always

kindred widget
#

It would work identical to say a Static Mesh component.

static garnet
#

okay. yeah i guess that makes sense. i thought for some reason it would try to replicate the particles over network if i did that but thats probably only if i would check replicate component, right?

winged badger
#

not even then

kindred widget
#

It won't even do that if you replicate the component.

static garnet
#

wait then why do people keep saying dont replicate particles?

winged badger
#

it would replicate the Replicated UPROPERTYs declared on that component

static garnet
#

if the engine doesnt even do that

winged badger
#

which is unnecessary

kindred widget
static garnet
#

i see okay

#

thank you for clarifying then, i really appreciate it.

kindred widget
#

Remember kids! Don't use tick! Set a timer from beginplay for 0.000001 seconds!

woven basin
#

People say to MULTICAST a temp particle effect - because you only need to see the temp effect when it occurs. i.e. if an explosion occurs - you multicast the trigger for it,

Its like the age old Unreal saying: "If an Actor is not in the forest when the tree fell over, did it really play a sound"

(I just made that up - I like it - lol)

winged badger
#

i think we have a single timer for execution order in the entire game

static garnet
winged badger
#

replicated actors are not free

#

in fact, too many of those is the best way to murder your network performance

static garnet
#

i see. is... is it bad that im doing two of them for every spell basically?

kindred widget
#

They also take too long. Multicasting an effect from a causing actor that is already replicated is much quicker than spawning a new actor for it.

static garnet
#

i see

kindred widget
#

Depends on the spell though. Really one of those "it depends" areas.

static garnet
#

i guess it was just easier to keep things tidy if i have one actor handle the cast time, chargeup effects, and a second one that is just the effector and actually does the work and can be moved around and resized by the first actor. but i guess im sacrificing network bandwidth to do that, huh?

kindred widget
#

Like. Simple firebolt. Would probably just fake it like a typical gun bullet. Large AoE effect that remains for a while? Definitely new actor for the effect. Buffs? Might not even do more than a multicast from the caster component that creates a UObject with some basic particle and animation logic with buff application.

#

There's not really a perfectly straight forward way to do them all in one way. Maybe if the game is incredible simple, it won't matter. The more complex the game gets, the more you have to cut each corner to save networking and gametime performance. So.. It depends. ๐Ÿ˜„

static garnet
#

i see. thats really good to know. i think i need to consider network optimization more than just what looks nice and tidy in the code. i wasnt really doing that before. i guess i'll try to keep things in one actor unless i have a good reason for a second one

#

so if i need a part of a spell to be a mesh that gets moved around and resized, i should just dynamically spawn it as a component of the first spell actor and manipulate the component, instead of putting it in a separate actor and manipulating the whole second actor from the first actor?

kindred widget
#

Possibly. If you already have one actor for the spell, I wouldn't create a second just for a mesh visual.

static garnet
#

i see. thank you.

fluid summit
#

you can use that as a example on how to implement it

static garnet
#

thanks

fluid summit
#

thank the guy who created it on the video later on, the amount on work that guy put on that template is unbelievable

scarlet hinge
#

had a system that does work but im trying to change it up

#

this is on the player blueprint it basically calls fire bullet on server and works

#

wanted to make guns on their own blueprint tho, not the player one just for modularity purposes

#

but for some reason this one on the client says click but does not run Server Fire Gun

#

whereas the original did run the fire bullet function on clients

#

ive tried replicating the gun to no avail

#

i could just do the opposite if i need to just like having variables on the gun

fluid summit
#

are you replicting the BP or Component? if you change the events, but don't replicate the actor, it's useless.

scarlet hinge
#

i am replicating the BP

#

checked replicates

fluid summit
#

Also, maybe using interface would be a good idea (so you don't need to call a specific method for the weapon to fire, you just tell "hey, fire Generic" and the weapon handles it.
If you change the weapon it still works as long as it implements the same interface

scarlet hinge
#

eh maybe

sinful tree
scarlet hinge
#

probably not

#

taht did it

#

set owner

#

dont really know the best method overall but at least this kind of works

#

i basically want a scenario of ~6-12 players max and easily variable guns or some structure i can adapt easily

#

replicating the gun might be expensive tho idk

#

(on the server load)

kindred widget
#

This is a perfectly fine method. Clients cannot RPC to server from anything except actors that are directly or indirectly owned by their PlayerController. Ownership can only be set on Server. Normal ownership is a client's PlayerController and their possessed pawn.

#

6-12 guns being replicated is nothing. Call back when you start considering triple zeros in those numbers. ๐Ÿ˜„

scarlet hinge
#

๐Ÿ˜ฌ

#

well im adjusting my game's ambitions to my own inexperience

#

mainly shooting for 6-12 players at once, each with 1 gun

fluid summit
#

The idea of understanding the concept is great, you may wanna check on the Lyra proyect. It's a multiplayer fps template made by epic

scarlet hinge
#

i might look at it at some point but ive done a lot of these so im just going with what i know

fluid summit
kindred widget
#

Generally speaking. Don't stress about problems until you run into them. Don't draw lines in the sand. You'll just hamper your development. The best way to learn is to find the actual problem and figure the way around it rather than avoiding running into the problem.

scarlet hinge
#

interactors would be nice for modularity but im too lazy atm

#

yeah i just want to at least have a reasonable goal

fluid summit
#

So you are saying a mmorpg?

scarlet hinge
#

no

#

more like black ops

fluid summit
#

just kidding, don't mind me.

kindred widget
#

I still need to look into Lyra stuff. UE5 has kind of scared me after checking out CommonUI. :/

scarlet hinge
#

will probs use the multiplayer w/ blueprints plugin

#

ive done steam connection like host / join games but this needs a server-client system with matchmaking

#

and databasing for stuff like inventory

kindred widget
#

If you're just making a basic shooter. You might be able to get away with blueprints only. Shooters are simple enough games in small settings.

#

I love blueprint. But it will really hamper game development in a lot of cases. I wouldn't even stick BP only for UI at this point.

scarlet hinge
#

im fine with BP i use some C++ in the form of my "custom plugins" when things get annoying

#

but something like matchmaking is a lot of code even for C++

fluid summit
#

i would bet there's already some free system out there for matchmaking, i'm a great proposal of not inventing the wheel when you are doing the work. Reinvent it when you already did the work and want to do it again better

#

Maybe epic subsystem, let me check

scarlet hinge
#

Multiplayer w/ Blueprints is the most popular one i could find

#

it uses AWS and some other services

#

hella expensive tho, could probably get a cracked version until i release something

fluid summit
#

so i'm guessing it should be free already, but i tried looking for it on epic online subsystem and i couldn't find any doc about it

scarlet hinge
#

there is a video for epic online subsystems and such but i need a lot more than host/join

#

also need a secure way to save player info

fluid summit
#

EOS should be able to save player info

scarlet hinge
#

oh it seems to have stuff like that

#

well ill look into it in a bit

#

hopefully there r some examples or walkthroughs

fluid summit
#

probably you got in contact with one of the features of the EOS, the amount of features that EOS have for free is quite big, really worth the time checking it

scarlet hinge
#

yeah i dont see it mentioning inventories or user data but it does store purchase info so probably can store other stuff

blissful saffron
#

Is there an example or walkthrough or setting up EOS for sessions, lobbies, matchmaking, etc that anyone knows of?

#

I've watched a few that are supposed to be for that but they don't seem to be setting it up at all like the website explains or even using the SDK includes, so I think they're just using the online subsystem and not EOS

latent heart
#

There might be some examples in Lyra?

light iron
#

If a component replicates as expected in Standalone and Listen but not Client, what's the most obvious reasoning?

fluid summit
#

that it's not actually replicating i guess, what is your setup?

sinful tree
# light iron If a component replicates as expected in Standalone and Listen but not Client, w...

Whatever you may be doing only happens server-side. In Standalone you are the server, so no problem. In Listen server, the first player is the server, so there's probably no problem for the server, but any clients may still be having trouble. When you're running as client, you're connecting to the server with all your PIE windows, so you don't see what happens at all on the server. That's my guess anyway...

Without seeing more of what you're attempting to replicate, best anyone can do is speculate.

proven fog
#

I see that the GameMode and GameState are created before other actors, but do they BeginPlay before other actors?

#

...I meant to ask that in #cpp but I feel like it's relevant here too.

light iron
fathom aspen
#

If you want to see that in action see AGameStateBase::HandleBeginPlay

twin juniper
#

when I go into network mode client I cannot posses any of the players through the client windows. Is there a big part of multiplayer I don't understand and need to know?

fathom aspen
near bison
#

Hey guys, does anyone have experience using Unreal with websockets for turn based games?

dusky flicker
#

Get Overlapping Actors doesn't seem to work properly when playing as Client on a dedicated server (array is empty). It works fine if it's a listen server though.

#

Also it works if I use a line or shape trace. But I need to be able to use the sword's hitbox

#

It looks like the array is correct for the client, but for the server it's empty. Is it because there's no visual animation for the dedicated server? Because it works fine when there's a listen server.

thin stratus
#

@dusky flicker it's correct that by default dedicated servers aren't ticking animations

#

If your whole thing there relies on an animation then you will have to change the setting on the skeletalmesh component

#

Not sure what it's called again though

peak sentinel
#

Would it make sense to listen for PlayerControllr->OnDestroyed (AActor delegate) to understand if a player left to match or not?

#

iirc they are not get destroyed or something but I might confusing them with player states

winged badger
#

PlayerStates stay around for a few minutes

#

PlayerControllers are destroyed

#

but there is also AGameMode:;Logout that will get tripped in the process

peak sentinel
#

ah there is FGameModeEvents::GameModeLogoutEvent for that

#

thanks Zlo

winged badger
#

PlayerState remains for 5 minutes by defeult in InactivePlayers array

#

and gets reassigned to the PC if that player logs back in

glossy kettle
#

Zlo beat me 2 it but you should read all of GameMode class, it's got a lot of nice flow pieces for MP

short veldt
keen pewter
#

I'm back again ๐Ÿ™ƒ

I have a voxel world generator inside of a blueprint, it's inside the world as standard, as I know, it's owned by the server? But there is a version of it on the client?
What I'm trying to do, is the listen server client sets a seed, when he loads, calls an event on the generator with the seed, to generate using the seed
And then when I client joins, get the seed, call the event to generate on his side.

I've tried repnotify seed variable on playercontroller, on repnotify it gets the generator blueprint and does the generator, this only runs on the server and the client can't see anything
I've tried repnotify seed variable on playercontroller, sending a RPC from the server playercontroller to the client character which then gets the generators and runs the code, but again, the client can't execute the code on from what I know is a serverside actor.
Everytime, the collision seems to kind of work clientside, when you jump you jump from where the terrain would be, but you fall through it afterwards.

I've sent myself into such a spiral and confused myself so badly I know I'm missing something so basic...

I'm basically trying to run an event clientside, from a variable that's set on the server, is the only way to do this setting the seed as server, repnotify the seed on the controller, from the controller pass it to the clientside character, the character then spawns their own generator blueprint actors in the right place and then run the code?

I've read through the compendium, and it helped alot with my other stuffs but I've just confused myself so badly on this I've lost my bearings completely (day 1 of network stuff)

potent cradle
#

An actor that is set to be dormant, no longer considers whether it needs to be destroyed on the client on grounds of being out of net relevancy range. It thus lingers around on the client and does not get destroyed/recreated when back in net relevancy range.

Is this something we can override or change?

#

(ForceNetUpdate does not fix it)

twilit radish
# keen pewter I'm back again ๐Ÿ™ƒ I have a voxel world generator inside of a blueprint, it's i...

I've done something similar except on a smaller scale. I had a maze made out of cubes and planes but the concept was the exact same as you described in the first few sentences. What I did was that I had a replicated actor that would through an OnRep provide the seed to any joining client for that actor and would then spawn non-replicated actors as it's children wherever needed after calculating where everything should go.

Do note that you can totally call code on replicated actors from a client. You just have to make sure it doesn't collide with what the server tells it or make sure the server accepts that.

Some things I would check are:

  • Is the voxel actor already there whenever the replicated variable was called on the PlayerController? Or for the RPC.
  • Are there no errors in the first place? Have you actually made sure that the code gets called?
  • You also mentioned falling through the map when it did work. Have you checked if the server world and the client world are the same? Maybe the seed is somehow wrong or perhaps the world generates differently because of an issue.
  • Have you tried looking at the collision from within the editor to see how that is generated?
gleaming kite
#

Can a client load and unload data layers (for only themselves) in a dedicated server?

twin juniper
#

when I play standalone in the viewport I can control the players I put myself onto

fathom aspen
#

This generally happens if you don't have a PlayerController class specified in your GameMode, though this should affect all network modes. With the info you provided I can't tell what's the issue

quartz iris
#

For multiplayer whats the best way to be assigning a team to a player

fathom aspen
#

You prolly mean assign a player to a team. The easy and intuitive way is to have a property in the PlayerState that represents the team he's in.

#

The teams themselves can be defined in the GameMode

twilit radish
twin juniper
#

Hmmm, yeah I can't really explain much more than I see. I apologize I'm fairly new to this. I should learn more about multiplayer and how it works.

compact talon
#

is there any reason to use replicate multicast over replicate server into a separate replicate owning client?

#

Most times I have tried using multicast it just causes weird issues which are resolved when I have it separated into two different events (one for server, one for owning client)

chrome bay
#

Well Multicast generally means "send to all players this actor is relevant for"

#

Multicast and Client RPC's have very different meanings

#

Client means "only send to the owning client of this actor"

compact talon
#

hrm, I see

fluid summit
#

Hi everybody! this is something that someone gave a solution yesterday, but if posible i would like to not use that one in particular.

How do you handle spawning the UI widget for all party members when someone logs in?
Something like this, but as soon as a new controller pops in

#

i'm having troubles with sync between player controller and player state because the controller just spawned

kindred widget
# fluid summit

Not sure if typo but a New Controller is irrelevant here. Only concern should be a PlayerState. For that you have two choices. If you're BP only, you tick the PlayerArray in GameState and cache it and == it to see when it changes. If you're using C++, subclass GameStateBase, and override AddPlayerState and RemovePlayerState and add a delegate broadcast. These are called on clients.

fluid summit
#

i'm doing something similar to that right now.
But when i pass the player states to the client to update the UI, they are invalid because the server didn't replicated to the client yet since spawn.

kindred widget
#

Never RPC to set up stateful UI. It relies on the state being on the client. Wait for the playerstate to replicate to the client. Which is when it's added to the PlayerArray and AddPlayerState and RemovePlayerState arre called. At that point you know the new state is valid.

fluid summit
#

I can just do a tick on the UI widget and wait for the playerstate to be ready with a "do once" node.
But it seems like a innecesary overkill, there has to be a simplier way that i don't know yet

fluid summit
kindred widget
#

The issue with the RPC is that that RPC runs. What if the player instantly disconnects and stuff happens on the server that causes state never to be replicated? Now you have UI waiting on a playerstate that will never arrive. Generally speaking in terms of UI stuff, you'll almost never deal with RPCs. OnReps are your best friend.

#

Always, always, always display state that the client has and only the state the client has. If it doesn't exist on the client, you have a networking problem that needs sorted out. Server should never dictate this.

fluid summit
#

I did a OnRep from the playerState, but than i ran into the problem that the PC was not ready/replicated yet

#

hmm okey, let me rethink it with that in mind

kindred widget
fluid summit
#

At the moment yeah

compact talon
#

In my game when players die they respawn as a dead version of the character. Where should I handle killing and respawning the new actor? I was thinking player state, but I am not sure.

fluid summit
#

I think gamemode should be the place for that kind of things

twin juniper
#

Anyone here familiar with connection setup?

kindred widget
#

The RowWidget can use Construct or Tick on it's ContextPlayerState to update itself. This container widget that creates and holds them in it's vertical box handles checking the playerarray and removing widgets with invalid states and adding new ones. Then the RowWidget just has to do it's own visuals.

fluid summit
#

that tick checks looks really expensive

#

or because of invalidate it only checks when it changes?

kindred widget
#

It's not. Identical on array is surprisingly fast.

fluid summit
#

i was trying to avoid spawning the widget from the player state, but that could work.
Let me modify it a little bit

kindred widget
#

From player State?

#

This has nothing to do with the PlayerStates except that it's passing one into the widget that needs it for referencing. All of this is in a second widget that can just be added to your viewport.

fluid summit
#

It was just crazy to me all the workarounds that you need to do something like this on BP. All it's needed is to be able to override OnRep PlayerState on the PC or the GS (By default)

twin juniper
fluid summit
#

i'm using advanced session plugin for the connections, it works with steam

#

what are you trying to do?

twin juniper
#

My problem with my game is that it would not end the connection after host terminates listen server. Sometimes it will leave trace behind forcing players to restart just to fix this.

#

I can show you on livestream if you wish.

#

Or you can download and test it with me via Playtest on the game's page.

#

To produce the same bug.

fluid summit
#

What about using GameMode and on PlayerController LogOut, check if it's listen server, if so, terminate the session of all the other ones conected?

kindred widget
# fluid summit oh i see, it's really easy if you just tick on the UI. I was trying to avoid it...

Funny enough, functions like this don't even phase me. When you have to tick to update a list of strings, and tick over those strings to test names of people in your party/raidgroup, and handle getting stats via those strings and removing old UI via them. Then you're in badlands. Honestly, the above solution is incredibly clean. It just has the tick stigma, which people need to get over.

fluid summit
#

wait, i don't think you can do that if the server aut is out, the server is done after that.

#

Let me check it on my setup, i need to add this later on, i may as well just add it now

harsh lintel
#

when I try to connect to a dedicated server through open 127.0.0.1 it works, but when I try to connect to a server hosted on AWS with open <aws IP> I cannot connect to it, I used a tool to check if the AWS server is receiving connections through the port 7777 and it is, am I doing something wrong?

fluid summit
fluid summit
kindred widget
twin juniper
#

What session killer?

#

Problem is it will work once (seemingly), and the problem surmises on second attempt to start a new server.

fluid summit
twin juniper
#

Or the last session will not erase from browser.

fluid summit
#

I'm using advanced session pluggin and whenever i change to a map that is not supposed to have a session, i kill any living session just in case.

fluid summit
twin juniper
#

I will try that in the menu level.

#

Are you also using Advanced Steam Sessions as well?

#

Not just Advanced Sessions plugin?

fluid summit
#

yeah, steam version

#

maybe also make sure with this

fluid summit
twin juniper
harsh lintel
willow walrus
#

a tool that says "filtered" is telling you that it's a longer response than it should be, meaning that probably a firewall let's someone through

#

security rules are a firewall, so it might say that even if your local ip isnt authorized

ashen stone
#

Why even if i override prelogin i get this error on my server?

fathom aspen
#

My wild guess is that you're not using this GameMode

ashen stone
#

It is only happening on dedicated server, i can`t debug it

#

it is running on ARM64, then i removed EOS from server build but the unique_net_id does not match now

#

(EOS not works with ARM64)

ashen stone
fathom aspen
ashen stone
#

Unreal is hard

fathom aspen
#

Welcome to the crying club!

ashen stone
#

is it hard for you too?

fathom aspen
#

Is it not? I'm already in that club harold

ashen stone
#

@fathom aspen i managed to make it work recompiling the project from scratch, it was some c++ cache

#

๐Ÿ‘€

fathom aspen
#

Ah then there is still a piece of hope that it's not hard

ashen stone
#

Yeah, it is easy

#

C++ is hard not unreal

harsh lintel
harsh lintel
#

Duly noted, I can't believe I need steam libraries for the server to work q_q, but I can connect to it now

pallid mesa
#

Just updated my pinned comment with another new article: How to replicate thousands of Actors efficiently. Some of you might be interested. Big thanks to Zlo and Jambax tbh

twin juniper
#

I keep hearing that you have to set up multiplayer first in your project or else you'll have to rewrite the entire game. Do they mean before you do anything at all?

pallid mesa
#

yes

velvet jacinth
#

Hey guys!
Does someone have a method for changing the player character (or default pawn class) to create a working character selection?
Kinda lost here, searched on every google result didn't found a solid one to work.

twin juniper
#

Thank you vori.

quartz iris
#

How can I make it so one button either creates a server if there's no players online, or joins any server with players in it

crystal crag
#

What tech is typically used to push notifications to a dedicated server from your cloud? For example, you have a custom party system that is available from the main menu screen. You want to receive notifications from your private cloud when a player sends an invite. Sure, you could poll a web service when on that screen every X seconds, but it seems like there should be a SignalR-like equivalent for this type of situation.

#

I guess I shouldn't have said dedicated server

#

I should have just said "game"

quartz iris
#

There's no cloud database

#

It's all through peer to peer

#

With steam

crystal crag
#

I wouldn't be using P2P though. This would be a custom system.

quartz iris
#

Why not?

#

I can't afford dedicated servers atm

#

And the max lobbies are 8

#

GTA servers are peer to peer and run 30 players

crystal crag
#

Not trying to sound rude, but you not being able to afford dedicated servers doesn't really apply to my question. I think you might be locking into the specific example I gave as "This is what I am exactly trying to do" when really I was just asking what tech stack is used for more real-time communication between your services and your game clients / servers

#

and I am not using lobbies

quartz iris
#

I don't know what a tech stack is

crystal crag
#

a "stack" of technologies in which are used to provide a solution to a problem

quartz iris
#

Ok

kindred widget
half umbra
#

Hi, why i can't hover and click 3d widget on multiplayer? On server and on Client doesn't work, when i open 1 window then is ok, but when i run it on client and server then doesn't work

kindred widget
# quartz iris How can I do this?

Take the Found Sessions array you saved. Iterate over it to see if it has a session the player could join. If no, create a new session, if yes, join the session.

half umbra
#

Did you find solution?

quartz iris
#

Is the gamemode already on the server?

whole leaf
# half umbra Did you find solution?

It's been a while so I'm not too sure what I did but yes.
Apparently it's related to the pointer index, here's a post about it : https://forums.unrealengine.com/t/bug-widget-interaction-in-multiplayer/402548/4

Screen is how I implemented it in the player

quartz iris
kindred widget
#

Dunno. Depends on your restrictions. If game size is the only one, then your session struct needs that info and you need to check it.

quartz iris
kindred widget
#

I don't have advanced sessions installed. Can you get that info out of the session struct?

quartz iris
#

I don't think so

#

From the find sessions advanced node?

glossy kettle
#

@pallid mesa yea replication graph is cool and all but have you ascended to EnTT yet

quartz iris
glossy kettle
#

oh is it

pallid mesa
#

soonโ„ข๏ธ

glossy kettle
#

thought it was (m)ass

kindred widget
#

Dunno then. If the data isn't in the struct. You have to put it there somehow. Likely through a parameter string or array. If I recall advanced session has that option.

pallid mesa
#

๐Ÿ‡ง ass

quartz iris
glossy kettle
#

you'd still need to write a custom net driver to replicate more than 3 of those thicc 2kb actors tho

kindred widget
#

In the game that the session is in?

quartz iris
kindred widget
#

If memory serves, Unreal has a player count in place already.

#

Maybe not. Can't remember.

quartz iris
pallid mesa
#

entities with fragments are by design lightweighted so

quartz iris
#

This should be able to do it ?

glossy kettle
#

are they based on uobject

#

i havent seen it at all

pallid mesa
#

take a look at the docu in #mass pinned

glossy kettle
#

300 bytes for a uobject in this economy? dietered

glossy kettle
#

thx i will read..

pallid mesa
#

i wrote that with Karl

#

live Q&A in the #mass channel

kindred widget
quartz iris
#

I need to ask this question again

#

How can I make it so one button either creates a server if there's no players online, or joins any server with players in it

#

But for Advanced Sessions

#

Is anyone and expert on this?

dark edge
quartz iris
#

No

dark edge
#

Start with that, figuring out how to find sessions in action already

quartz iris
#

Should I be setting the player controller or player character to a character variable which holds their role

#

For example

#

When the gamemode starts

pallid mesa
#

no

quartz iris
#

Attacker 1 2 3 4 vs Defender 1 2 3 4

#

?

#

That way I can make a scoreboard

obsidian cargo
#

How well does the "Bad" network emulation profile for PIE approximate real life poor network conditions?

#

I tried doubling the latency and packet loss on "bad" and noticed player movement degrades much more rapidly than the stuff I'm replicating.

#

Is there anything additional I should use to validate I'm handling poor network conditions correctly?

winged badger
#

live test on a packaged game ๐Ÿ˜„

winged badger
#

GetPlayerController[Index] i mean, they have a way of biting you in your arse when you don't know exactly what you're doing

latent heart
#

None of what you just said is a thing.

glossy kettle
raw thunder
#

How much performance are we loosing by increasing the PlayerState net update frequency? I would like to have my inventory and attributes stored on the PlayerState and not the PlayerCharacter for repawn purposes. My game is a listen server mode for maximum 5 people. I would like to increase it to something similar to the Character net update. Is this a bad idea?

#

(I am using the GameplayAbilitySystem and I am storing it on the player state)

pallid mesa
#

it'll be fine as long as you delegate things to your pawn

#

ie: the gc system

#

you can cull cues using your pawn relevancy

#

since ps's are always relevant

#

but to be frankly the scope of your game is smol

#

so my main recommendation us to measure your performance before you take decisions that will require further engineering