#multiplayer

1 messages ยท Page 57 of 1

dark edge
#

Your question doesn't make much sense. You can get the game mode, and cast it to your specific game mode subclass, if you're on the server. On client, Get Game Mode will fail because the game mode doesn't exist on clients.

real ridge
#

so it messed up something

real ridge
#

i need somehow call game mode function from client

dark edge
#

Do you know what casting is?

#

read my name

dark edge
real ridge
#

via cast I can call function what is placed in game mode

#

right? ๐Ÿ˜„

dark edge
#

You need a run on server event between the clientside stuff and the serverside stuff

#

run on server event is the ONLY way to tell the server anything

real ridge
#

i know

#

i was doing it like this

#

idk why its crashing....

dark edge
#

just show your code

real ridge
#

cant load

real ridge
#

well 2 hours of work are in bin

dark edge
#

First of all GameMode shouldn't be storing PlayerWithBomb

dark edge
#

According to that code it is

real ridge
#

I have ?bomb bool in player state and game mode just go through all controllers and check if they have bool is true

#

if it is its found it

dark edge
#

Just have PlayerWithBomb be a reference in GameState (if other ppl are meant to know it)

real ridge
dark edge
#

no need to loop or whatever

real ridge
#

but still dont understand why if I have bad cast or code editor wont run .... fk why it just cant throw error when trying to play

#

but no it wont run editor at all..

#

ah

#

i need now remake it

dark edge
#

What are the general rules for your game? A player can have a bomb. What else are the mechanics?

real ridge
#

and I stopped it at the end to see

#

i take bomb and then after countdown it will take damage to the base which is nearest

#

to the player who has bomb

#

but i cant anymore run that game as its at 75% vcs of bad cast

#

๐Ÿ˜ฆ i am going to do it from scratch

worn steppe
#

I have a RPC marked as Client that is only invoked from the server, and inside this client RPC I draw some debug text and set some HUD text. I only see the HUD text on the client that I expect to, but the debug text is drawn on all clients. it's a 2 line function, the first line draws the debug text, the second line sets the HUD text. this makes absolutely no sense to me? surely it should only be drawing the debug text on the client that its updating the HUD text on?? can anyone explain this magic

dark edge
#

I'd do it like this.

In bomb actor:

Event Overlap -> if has authority and other actor = Airplane or whatever -> Attach to OtherActor -> Disable Collision -> Timer/Delay -> Destroy closest base

#

No need for gamemode or gamestate or anything like that.

#

It's that simple

#

DestroyClosestBase can inform the gamestate or gamemode if you want for scorekeeping etc

real ridge
thin stratus
dark edge
#

well you get the picture. Let the bomb do the bomb stuff, no need to involve Gamemode or Gamestate etc.

worn steppe
real ridge
thin stratus
dark edge
real ridge
thin stratus
#

Pretty sure onscreen debug is showing on everyone due to the single process

real ridge
#

thats why I did stuff after countdown is 0 in game mode

dark edge
#

let the bomb do the countdown

real ridge
#

but when I pick it I cant see it anymore

dark edge
#

I mean it's a matter of taste but that's how I'd do it

real ridge
#

its picked

worn steppe
#

oh boy, lots of things break if it's not a single process. this is not good ^^

real ridge
#

who took bomb?

#

hm

#

can work?

dark edge
#

Why not put all the logic for everything including the airplane flight inside the gamemode

#

lol

real ridge
#

i dont want to see it on map anymore

#

its like collectible

dark edge
#

Just don't do that. Turn off collision, set it hidden, attach it to the plane that picked it up.

real ridge
#

sorry for dumb question how to attach XD

dark edge
#

I'd do the item logic inside the item, then it'd be trivial to make a new item like one that you can pick up that'll heal the closest base. You'd just change a few values and voila, it'd just work.

#

all up to you tho

real ridge
#

ok i will try but another question i do have this timer which is running when it is 0 i should call event from bomb but can I cast to it from widget?

dark edge
#

timer lives on bomb as a replicated variable I'd say

real ridge
#

nope i am calling countdown function to game mode from bomb after picking and then in game mode calling it on all clients and then widget has timer itself

real ridge
#

i thought its not good solution so i used game mode to it

worn steppe
#

argh, I've been using things like GetLocalRole() == ROLE_Authority and only running client side actions if that is not true. I've been testing as Play As Client. guess whos listenserver does not work at all

real ridge
versed ocean
#

can I remove mesh instances from server or are they literally not even known about by the server?

dark edge
#

UI should be local only

real ridge
#

if i pick bomb

#

then all should have 10sec countdown

#

on monitor

#

i need multicast it

dark edge
#

Bomb is a replicated actor. Bomb state has an onrep which tells every local HUD or Playercontroller to show the UI

real ridge
#

I did it like this

#

from bomb

dark edge
#

That can work

real ridge
#

and its only multicast as its called from remote

#

so its authority server

#

its working but I tried on another pc my project and its again 75% loading

#

so something is wrong there...

#

some cast

dark edge
#

Your code is jumping all over the place. The bomb can just multicast within itself or use an onrep

#

Picked up -> multicast or onrep -> get local playercontroller -> cast to yourplayercontroller -> show countdown

dark edge
real ridge
#

last thing I need is when I kill player who "has" bomb and kill him bomb will drop on his position and prepared for picking

dark edge
#

Get what you have working first before trying to add more on to it

dark edge
# real ridge are you sure ?

I mean it's a multicast event so yeah it'll execute everywhere. That's assuming you've replicated the actor etc.

dark edge
#

I'd make an OnDeath dispatcher on the pawn and the bomb binds to it on pickup so it knows when to release itself and go back to being a pickup

#

Or the pawn can have a variable MyBomb or MyPickup and tell it to detach when the pawn is killed. Either way.

real ridge
#

and its not replicated

#

without loop

#

now its working I did this moved it to bomb

#

from controller

worn steppe
#

What is the correct way to check if execution is on a dedicated server vs a listenserver vs a client?

#

Checking against ROLE_Authority doesn't work because that is both dedicated and listen servers, but I don't want to allocate client-side resources on a dedicated server (e.g. a player HUD)

dark edge
#

Basically on every machine, the Bomb tells the UI to show the countdown. That's it

#

Bomb on server:
Overlap -> Change state -> Multicast

Bomb Everywhere:
Multicast -> tell local UI to show countdown

OR

Bomb on server:
Overlap -> Change state (repnotify)

Bomb Everywhere:
RepNotify -> Tell UI to show countdown.

Either way, the ONLY networked thing is the repnotify or multicast in the bomb. that's it

real ridge
#

and just multicast value

#

10 9 8 7

worn steppe
#

maybe the issue is that I should be placing HUD and other client-specific stuff in the PlayerController instead of the players Character

#

but where is the PlayerController :x

dark edge
real ridge
# dark edge repnotify my dude

i should go sleep and rest, thank you for all conversations u cant imagine how much u helping me even i look dumb every time

#

thank you I really appreciate your time

#

will continue tommorow

#

much love

fathom aspen
#

So you can check IsNetMode for example

worn steppe
#

thanks, I will keep that in mind. it would be simpler to just add some NetMode checks against dedicated server then, although I am now in the middle of moving all of the client-specific code to PlayerController. granted, I haven't fully figured out how that will fix the problem yet, so I might end up needing NetMode regardless?

fathom aspen
#

What do you mean by the client-specific code?

worn steppe
#

things like, displaying "Press [Action Key] to Interact" on screen

fathom aspen
#

PlayerController would have code that naturally belongs to it

#

PlayerController is like the interface between the human player and in game player

worn steppe
#

I'm just trying to leverage the fact that the client owns PlayerController

#

so maybe I'm doing a dumb thing

fathom aspen
#

You could look into the engine source to see what is there already to get a better feeling of what should exist there

worn steppe
#

that is a good idea

fathom aspen
#

For example I wouldn't have HUD stuff in PlayerController

#

HUD/Widgets exist inside HUD class

#

HUD is a good manager for Widgets and is also easily accessible from PC

worn steppe
#

for some reason I was discouraged from using the built in HUD functionality, so I've just put it into the character since that was easy

#

probably dumb in hindsight

modest crater
#

HUD is a fantastic place to put that stuff but in lyra UE is starting to move awway from the HUD class idk why

fathom aspen
worn steppe
#

oh

fathom aspen
#

But I wouldn't take Lyra as an example to build on when I'm solo deving

#

It's meant more towards AAA teams tbh

modest crater
#

ahhaha

#

I was wondering

fathom aspen
#

I miss Laura

austere burrow
#

Hey all, I'm having a strange problem. When I change input modes from UI to Game on client the E key (which is my UI confirm key) does not work on first press, but then works normally. For the host (listen server) there is no issue. I'm using Common UI and enhanced input. Any help is appreciated - I'm not even sure where to start

#

Key events are all local so idk what might be causing the discrepancy

glass vector
#

how do you check the android packaged version number in your game in BP?

#

i want players to not be able to join multiplayer rooms if their packaged version number does not match

short arrow
worn steppe
#

Okay, I think I figured it out finally. All I need to do is check if a character is controlled by the player controller, and if so then run the logic of adding the HUD elements

#

Question is, how do I compare instances of ACharacter against one another?

#

wait so the character isnt even possessed when BeginPlay is called. oi. at least PossessedBy() should work

steady nimbus
#

Hmm I'm having quite an issue with ServerTravel, I tried to read all the docs I could on it but...

  1. I use GAS for all my stats/abilities and I believe everything is correctly replicated
  2. I have this inventory component on my PlayerController - when you pick up a weapon it goes into the inventory and this is all replicated and other clients can see the equipped item on the player and whatnot

The problem is when I use seamless travel, it does not seem like my PlayerControllers are persisting and the pawns are completely reset (as is the inventory)

however, I've already double checked that I have a transition map and seamless enabled across all my gamemodes (but I'm using all the same game modes)

fossil spoke
steady nimbus
#

Do I really need to move my inventory system to PlayerState and then do CopyProperties kinda stuff?

fossil spoke
fossil spoke
worn steppe
#

would that include functionality for playing local interface sounds and things

#

rather, is that where you would put that kind of functionality

fossil spoke
#

UI is all Client side per Client.

fossil spoke
worn steppe
#

I'm wondering if there is any other times where I would have client side behavior that should be local to a single client that isn't interface-based

fossil spoke
#

Anything that is Predicted is Client side behavior for only that Client.

worn steppe
#

good point

edgy patio
steady nimbus
fossil spoke
steady nimbus
edgy patio
fossil spoke
#

SeamlessTravelFrom is what I was thinking of that i couldnt remember the name of.

steady nimbus
#

interestingly enough https://docs.unrealengine.com/5.0/en-US/API/Runtime/Engine/GameFramework/APlayerController/SeamlessTravelTo/ I can't seem to call/find that from BP in the PlayerController lol but it does mention
not called if PlayerController is the same for the from and to GameModes

Called when seamless traveling and we are being replaced by the specified PC clean up any persistent state (post process chains on LocalPlayers, for example) (not called if PlayerController is the same for the from and to GameModes)

#

btw thanks @fossil spoke and @edgy patio for helping out* -- extremely helpful in at least diving into some of these as I was going a little crazy why it wasn't working lol (still isn't but maybe getting closer)

edgy patio
#

No problem, I'm trying to figure out how to deal a kind of similar problem

#

I'm not sure in your game, but I probably would make my own CopyProperties to handle the inventory data.
You could override the GameMode's HandleSeamlessTravelPlayer function to call your custom CopyProperties.

#

But in this way I am implying that the inventory will always exist and should be persistent, otherwise you wouldn't Copy anything and you would lose your data

near granite
#

I want to replicate the movement of actor, In the blueprint of this actor, I add the "switch has authority" macro so that i can run this code only on the server in order to replicate..

Am i doing right??

worn steppe
#

you know, I guess this makes sense, but I just now realized that repnotify variables do not call the notify function on the listenserver, but that is kind of annoying

#

been going crazy trying to debug that

kindred widget
# worn steppe you know, I guess this makes sense, but I just now realized that repnotify varia...

Generally you don't really want to call OnReps on server code. If you need to do the same thing in server and client code, you make a new function and call that from the setter and the OnRep.

It makes debugging replication stuff a lot cleaner because you can know easier if you're actually getting onreps on the client and can run through the callstack easier with a breakpoint in the server setting code or the OnRep to know if you're on client or server.

The Blueprint style of calling OnRep on the server automatically is generally frowned on.

worn steppe
#

Good to know, I don't know anything about blueprint logic really

near granite
#

Is the repnotify function unconditionally executed as multicast?

worn steppe
#

DECLARE_DELEGATE_OneParam(DelegateName, Param1Type) it is safe to pass one of these as an RPC parameter, right?

winged badger
#

No

#

There is also no point passing delegates

worn steppe
#

hm ok

winged badger
#

You should think of blueprint onrep as property changed, not replication callback

#

Because that is exactly what it is

winged badger
# worn steppe hm ok

Only dynamic delegates can be serialized, but even they cant convert object pointer to netguid iirc

worn steppe
#

I think it will be OK to just use the delegate and then invoke an RPC afterwards

#

honestly, I have no idea though

winged badger
#

Delegate basically comes to invocation list of functions

worn steppe
#

yeah, I just wanted a callback function basically

winged badger
#

That doesnt translate well over the network

#

You have delegate as a member in dame class as rpc

#

You have each machine bind their handlerd locally to it

#

Then you rpc just broadasts delegate member

worn steppe
#

it's just tricky since sometimes a server is a client, sometimes it isn't, and I have no idea anymore when what is executing where

near granite
winged badger
#

Mobile, cant view screens really

near granite
#

If I move the project to another computer, do I have to redo the dedicated server build as well?

latent heart
#

Not if you also moved the dedicated server.

near granite
#

but i have this error " Client target not found"

winged badger
#

That gets executed normally

near granite
near granite
#

There is no tag but only component tag.
Can i use component tag as same concept when i use tag?

real ridge
#

where I want change value?

kindred widget
#

You call delegates. Widget should be bound to them. Gameplay classes should have zero reasons to ever have a pointer to a widget.

near granite
#

When RightGrip is input, the repnotify variable R_Rock becomes true, and when R_Rock is called, the repnotify variable of BP_Pulse becomes true.
START changes to True, and then I made the code like the third picture run, but it doesn't work,,,Could you give me some advice?

faint parcel
#

Is it true that with DOREPLIFETIME(Class, Array) changes to the array elements (using a pointer or reference) doesn't trigger OnRep_ methods to be called? But if using DOREPLIFETIME_CONDITION_NOTIFY(Class, Array, COND_โ€ฆ, REPNOTIFY_Always) changes to the elements to trigger OnRep_ methods on clients (like the user writes here: https://forums.unrealengine.com/t/repnotify-for-arrays-not-triggered-when-modifying-a-contained-value-by-reference/117036/2?u=aperfectmisterman).
I have been foolishly making changes to elements in a TArray of USTRUCTs (mutable structs, buuuh!) and having problems with replication. Is this the reason?
I think I will move to just assigning new elements to the TArray to avoid using mutable structs, should fix the problem as well, right?

real ridge
#

guys I am trying to remove widget by multicast when I start new countdown but I still have both there I am just using remove from parent on multicast.. ๐Ÿ˜„

#

trying it like this but not working

kindred widget
real ridge
#

when I tried use remove all widgets

#

it worked

#

but I deleted all

#

i need just that one ๐Ÿ˜„

kindred widget
#

Sounds like you have created too many and are only removing the last created one.

real ridge
#

I am creating on all clients

#

and also I need remove on all clients

#

here I am creating it

#

I am trying to add there remove from parent

#

before add to viewport

#

but no effect

#

weird

kindred widget
#

Where is this multicast broadcast from?

real ridge
#

from has authority line

#

so its server calling multicast

kindred widget
#

What on the server calls it?

real ridge
#

remove ?

kindred widget
#

The Multicast.

real ridge
#

that multicast is connected to this authority

kindred widget
#

What calls that though?

real ridge
#

i dont get your question sorry

#

wdym

#

my english is weak ๐Ÿ˜„

kindred widget
#

What is the event to the left of the HasAuthority?

real ridge
#

actor begin overlap

#

its bomb picking

#

so I am doing it on server

#

so noone can cheat

#

but remove from pparent should work

#

after multicast....

kindred widget
#

Quick dirty check. Put a DoOnce before your CreateWidget node. And try it again.

#

I'm assuming something is calling your ClientsCountDown multicast too much and you're not checking if the widget is already created and on screen. Possibly leading to multiple widgets that look like one. So RemoveFromParent is only removing the last one.

real ridge
#

second countdown didnt even start

#

bcs of do once

kindred widget
#

Try this then in your multicast. It'll only create your widget once. And will not try to add it if it's already in the viewport.

real ridge
#

ah I am retard I first need solve how to sync time because now I have timer inside bomb and also own timer inside widget both have time 30 sec but its not synced I should set timer from bomb and do not let widget to count

#

its foolish solution

faint parcel
#

I'm replicating some teams structs, but the PlayerStates that I use to refer to players are nullptr on the client. I assume this is because playerstates are not yet replicated at that point?

fathom aspen
#

Prolly. They take more time to replicate than other actors

meager fable
#

I'm getting insta kicked after trying to join the lobby on EOS, enyone had simillar issues before?

LogNet: Browse: EOS:0002812933264bd788f4dbbffcb75940:GameSession:97/Game/Maps/SP-MainMenu_Placeholder
[2023.01.29-15.58.32:206][252]LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768)
[2023.01.29-15.58.32:206][252]LogNet: Created socket for bind address: 0.0.0.0 on port 0
[2023.01.29-15.58.32:207][252]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2023.01.29-15.58.32:207][252]LogNet: Game client on port 7777, rate 120000
[2023.01.29-15.58.32:210][253]LogSockets: Warning: GetAddressInfo failed to resolve host with error SE_HOST_NOT_FOUND [11001]
[2023.01.29-15.58.32:212][253]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: , Name: IpConnection_3, Driver: PendingNetDriver IpNetDriver_3, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID, Channels: 0, Time: 2023.01.29-15.58.32
[2023.01.29-15.58.32:212][253]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = PendingConnectionFailure, ErrorString = Your connection to the host has been lost., Driver = PendingNetDriver IpNetDriver_3
[2023.01.29-15.58.32:213][253]LogNet: Warning: Network Failure: PendingNetDriver[PendingConnectionFailure]: Your connection to the host has been lost.
[2023.01.29-15.58.32:213][253]LogNet: NetworkFailure: PendingConnectionFailure, Error: 'Your connection to the host has been lost.'
[2023.01.29-15.58.32:213][253]LogNet: DestroyNamedNetDriver IpNetDriver_3 [PendingNetDriver]
[2023.01.29-15.58.32:216][254]LogNet: Browse: /Game/Maps/SP-MainMenu_Placeholder?closed
kindred widget
near granite
#

hi

gloomy tiger
#

Hey guys - does anybody have an article or reference related to how UE serializes variables before dispatching them through the network?

#

I'm more curious about fstructs specifically, but anything helps

twilit radish
#

It's just a stream of bytes per certain 'action', those streams are referred to as "bunches" within the Unreal source. Then actual packets contain those bunches, whether that's one bunch, a part of a bunch, multiple bunches or a combination of all of that. Serialization depends per specific object on how it's done, a Vector does it different to for example an entire struct. You might be interested in reading this as an example if you have source access: https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Runtime/Engine/Classes/Engine/NetDriver.h#L187-L218

#

Structs in specific if you don't do anything else than marking things as a UPROPERTY and mark that struct as replicated somewhere within an actor will use 'Delta Serialization', which I suck at explaining lol. If you use a custom net serializer within C++ you can disable that behaviour. But that's something you need to explicitly do.

gloomy tiger
#

Hey @twilit radish - thank you for your inputs. All of that was helpful. ๐Ÿ‘

prisma snow
crystal crag
#

Is it possible to use duplicate player names when calling NewController->PlayerState->SetPlayerName(...)?

#

For example, I spawn three of the same monster AI class and I want them all to be called "Muffin Monster 1" - would I be able to call NewController->PlayerState->SetPlayerName(FString("Muffin Monster 1")); for all three or would that cause problems?

latent heart
#

Probably yes (it would work)

plain gust
#

When user join in Session and executes UpdateSession() in PostLogin(), Session is not found in FindSession()
what's the problem?

quartz iris
#

How can I make the other player see what costmetics you have? As the client only sees their cosmetics on the other player

#

The costume is selected by the player using enums

prisma snow
#

Just a sanity check - if I ask for HasAuthority() in the Player Controller, it will only return true for the clients or, in the case of a listen server, for the PC of the listen server player, right?

#

I'm doing some client-only setup that runs on info from GameMode so

twilit radish
prisma snow
graceful flame
#

This is the updated version of that diagram with Game Instances

prisma snow
#

Then, for some code to run on the client version of the PC, I have to check that it does not have authority

#

But then it is possible that the listen server doesn't work properly

twilit radish
#

Correct, listen server will then break.

prisma snow
#

This are not RPCs

twilit radish
#

You don't have to run it as an RPC. IsLocalController can be used for the client.

graceful flame
#

oh for listen its different

prisma snow
twilit radish
#

Yes, it checks if it's locally 'controlled' aka will only run whenever it's the client or the listen server but only for their own controller.

prisma snow
#

Excelent that's what I need

#

thanks

#

fingers crossed I fix this bug finally ๐Ÿ˜„

ember furnace
#

Hi, i have problem with multiplayer event replication, i have 3 clients, client 1 and 2 are working as intended, but somehow when client 3 is posting message server side event wont fire(ServerSendMessage event), even if local event fire (SendMessage)
i'm using option to play as client, dunno why 1 and 2 client works but third one don't

twilit radish
#

How are you getting the PlayerState for 'SendMessage'?

ember furnace
#

From widget

#

This part in widget fires as expected, then in player state it fires local event and then server event but only for client 1 & 2, on client 3 it does nothing

#

also in 4 clients scenario: client 1 2 and 4 is working just fine

twilit radish
#

Can you instead of the Get Player State node try this?

ember furnace
#

it worked, but why?

twilit radish
#

My guess would be because Get Player State with the argument 0 grabs someone else's PlayerState. That method internally just picks the first item inside the Player Array that the Game State stores and grabs the player state. I don't think that one necessarily has the correct order because people can login at any time in any order. Which seemed likely to me if the network call failed because you can't call methods from an actor on the client which that client doesn't own.

kindred widget
#

GetPlayerState(0) will just return the first player who got put in the Gamestate's PlayerArray.

ember furnace
#

thanks for help, back to learning magic world of networking

quasi tide
#

Trying to get other clients to play the ADS animation.

Player replicates its current state (Aim, Walk, etc..), in animBP, I check that the state is Aim. If so, I blend in the aiming animation. Otherwise I don't. Works correctly locally and the server can also see it. However - other clients cannot. I have confirmed that the true branch fires off. Any ideas?

twilit radish
#

What's beyond the true though? If that does fire something else must be messing it up I guess.

quasi tide
#

Just the lerp to smoothly go between animations

#

It does fire off

dark edge
prisma snow
#

Is the standalone play mode "safe" for testing multiplayer, in the sense of being very close to two real players from different computers?

#

I'm testing something that doesn't work in PIE (due to shared render target that should be different for every process) and it's not working in standalone, and idk why

quasi tide
#

See - true branch plays. Top right is client 2, middle is client 1, and the ABP is showing the route of Client 2, from the perspective of client 1.

#

So they SHOULD be doing the animation

quartz iris
dark edge
#

Or rather

#

you need to get the costume from game instance, pass it to server, and set a replicated variable

#

then the repnotify of that variable is where you'd actually apply the costome

dark edge
#

.

Client tells server which costume it has
Begin Play -> Is Locally Controlled? -> get enum from gameinstance -> run on server event

Server tells everyone which costume to use for this character
Run on server event -> set MyCostumeEnum(replicated, repnotify)

Everyone applies the costume
RepNotify -> actually set costume on mesh

.

#

Client passes costume enum to server which sets a replicated variable and everyone uses that to show the right costume for that character

quartz iris
#

Could I not just set the variable as replicated?

dark edge
#

You do, but that can only be set FROM THE SERVER

quartz iris
#

The ones in the gameinstance

dark edge
#

do you want each client to say which costume it has?

quartz iris
#

Yeah

dark edge
#

then it needs to tell the server which costume it has. Step 1 in what I posted

#

the server has its own gameinstance and knows nothing about the clients gameinstance unless told

quartz iris
#

Idk it seems a lot of work to have to save/load the variables in the client side variables then have another one for the server for each variable

dark edge
quartz iris
#

Fr dude i'm losing my shit ๐Ÿ˜ญ

dark edge
#

You could have a savegame or gameinstance on the server keep track of what each player has, that'd be server-side inventory basically

quartz iris
#

But i'm almost there

dark edge
#

but do what I spelled out and it'll work

quartz iris
#

Alrighty

quartz iris
dark edge
quartz iris
quasi tide
#

Fixed my bug. Was something else. I was returning early in my OnRep in C++ that would execute a delegate that provided important information. So, bug was a delegate wasn't being executed due to exiting too early.

dim trail
#

should i be binding delegates on the server or client?

fathom aspen
#

No definite answer. You bind them where you need them to be fired/called

quasi tide
#

Hmmm - what could cause a widget to not show after doing a seamless server travel? Can't track down why my pause menu does not show up anymore after traveling.

#

HUD begin play calls Remove All Widgets to be safe. For w/e reason - it's being really weird about the 2nd branch statement. Claiming that it is active, even though it isn't.

abstract pike
#

Just in case this is useful to anyone out there who is using replication graph and wondering why their non relevant actors are replicating when multicasts are called. There is a map where you can set the default behaviour for multicasts and whether they open channels or not. The actor is set to true by default meaning it will open a channel for a multicast. If you want to stop this behaviour you need to add this inside InitGlobalActorClassSettings.

quasi tide
#

Alright - this part of the HUD is all jacked up after doing a seamless travel.

#

Wait - so BeginPlay doesn't get called on seamless travel? (for PC)

hollow eagle
#

no, actors retained during seamless travel won't have beginplay called again

#

BeginPlay gets called when the actor is spawned. An actor that still exists from seamless travel isn't newly spawned.

quasi tide
#

Well - that explains my funkiness most likely. Must still be holding on to some garbage references.

#

Yup - that was it. Glorious

quasi tide
#

@dull lance Yeah - I know. It gives you the controller that is travelling though. So I'm doing a client RPC on that.

#

controller->clientRPC()

#

Well - I answered my own question. This is in the base implementation for the method. So it should be good as long as super is called first.

#

It's 578 for me ๐Ÿค”

#

Well - it should be safe. Because HandleStartingNewPlayer is after PostLogin (I know PostLogin doesn't get called for seamless) and PostLogin is first place it is safe to do RPC

#

This is the bottom part of the function.

#

Won't be for a few days until I can properly test it working in a real-world online scenario though.

#

@dull lance My idea was to do this pretty much. Have a way to reset things on the PC itself. Instead of only having the methods in the GameMode. So far, this works in packaged singleplayer. Will let you know in a few days if it works multiplayer. That's when we're doing our network playtest.

gray holly
#

I just want to see step one work and see 2 players in the same game

#

Following the instructions just starts 2 copies of a single player thirdperson game example

kindred widget
nova wasp
sonic python
#

Hey Guys

#

In Mobile

#

Create Session Is not working

#

This is my Bp codes for this

#

I'm not using Any Online Subsystem Except Google

#

How To Fix It?

thin stratus
#

I'm pretty sure Google has non Session Subsystem

uncut atlas
#

does cross-platform automatically work for dedicated servers? like if an xbox and playstation tried to connect to the same server ip address will it work and they'll be able to play together?

latent heart
#

Should do, I think.

uncut atlas
#

interesting...

latent heart
#

I don't have access to the devkits, so it might be a case that they require specific platform-based session stuff which is incompatible somehow.

uncut atlas
#

oh ok. thnx!

twilit radish
#

I mean Fortnite, PUBG for example do it so considering that I would very much assume you can 'just' do it ๐Ÿ˜›

latent heart
#

Maybe they do it via EOS or something

#

Shrug

twilit radish
#

I don't see how that changes anything though. Something still has to handle different clients from different platforms if that was the case.

latent heart
#

I'm just saying that's the only potential issue... not that it definitely is one ๐Ÿ™‚

thin stratus
#

@uncut atlas @twilit radish @latent heart UE blocks different UniqueNetIDs

#

If your Server uses NULL, Xbox uses Live and PS uses whatever they have, then you will not be able to join

#

If all of them use NULL then it would work, but with NULL you lose all other things that Subsystems offer you

#

That's why stuff like EOS exists and is required

#

it acts as a central UniqueNetID for different authentications via e.g. Steam, Xbox, PS

twilit radish
#

You don't have to use EOS for this. I totally get your point and didn't realise NULL doesn't accept the IDs, but there's absolutely nothing stopping you from authenticating people your self without EOS. Or.. Alternatively if you don't care about authenticating at all just not doing it.

#

But I can see how EOS is convenient to use yeah.

thin stratus
#

Yeah I didn't mean that EOS is the only solution

#

But EOS was mentioned

#
void AGameModeBase::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage)
{
    // Login unique id must match server expected unique id type OR No unique id could mean game doesn't use them
    const bool bUniqueIdCheckOk = (!UniqueId.IsValid() || UOnlineEngineInterface::Get()->IsCompatibleUniqueNetId(UniqueId));
    if (bUniqueIdCheckOk)
    {
        ErrorMessage = GameSession->ApproveLogin(Options);
    }
    else
    {
        ErrorMessage = TEXT("incompatible_unique_net_id");
    }
twilit radish
#

To be honest I should have realised this as I looked at this specific code like a whole 2 days ago ๐Ÿคฃ

#

I was implementing my own matchmaker and was rejecting logins and ran into this specific Super I had to deal with ๐Ÿ˜›

latent heart
#

Ha. So I was right! ๐Ÿ˜„

twilit radish
#

Well actually, technically Unreal can do it just fine without stupid IDs ๐Ÿ˜›

#

๐Ÿ˜‚

thin stratus
#
virtual bool IsCompatibleUniqueNetId(const FUniqueNetIdWrapper& InUniqueNetId) const { return (InUniqueNetId.IsV1() && InUniqueNetId.GetType() == GetDefaultOnlineSubsystemName()); }
#

For completion

twilit radish
#

Do the subsystems even authenticate with their platforms in the first place btw? Or do they just accept whatever you throw at it.

thin stratus
#

Depends on the Subsystem, but they should auth

#

Steam for example calls Steam_Init or so somewhere

twilit radish
#

So it's just dedicated servers that are special I suppose assuming we are using multiple platforms.

thin stratus
#

Usually yes, cause they are the middleman

#

But again, all clients must share the UniqueNetID type

twilit radish
#

Could override it though. But yeah.. By default that's a RIP.

thin stratus
#

It was allowed before 4.24 or so

#

It caught me offguard back when it was changed

#

But the ID is used in multiple places, so I wouldn't think it's a good idea to play with different IDs anyway

twilit radish
#

I mean there's a command to disable it if you really want to.

thin stratus
#

Yeah I just don't know the problems that could arise

#

And overall it's probably better to just plan ahead of crossplatform stuff

#

Especially with options like EOS being free

#

Even if you get them to connect, you still lack things like shared Friendlists etc.

#

There is more to it then just the server connection

twilit radish
#

But friend lists etc. are not going to work from a dedicated server either way.

thin stratus
#

Like you can't even query another profile

thin stratus
twilit radish
#

Oh you mean from like a player perspective where it's just easier to find your friends?

thin stratus
#

For example

#

You also can't really query player profiles. Imagine you have a post-match list of games that were played. Outside of a networked environment.

twilit radish
#

Ah alright, I thought you meant the server accessing that and was confused for a sec ๐Ÿคฃ

thin stratus
#

Sony Players couldn't query a SteamID profile

#

Na I mean overall experience

#

Peeps nowadays can be happy EOS exists

twilit radish
#

I mean that's not necessarily a problem IMO. Don't see why a dedicated server can't pass on stuff like profile picture or a nickname etc.

#

But yes, I get the general problem ๐Ÿ™‚

thin stratus
#

Outside of a networked environment.

#

E.g. in your mainmenu "Match History" or so

twilit radish
#

Fair enough.

thin stratus
#

You can work around it of course by saving those things into the cloud and just given a "hardcoded" list. But it would be easier to just point to the users ID

#

So the Client can even look at their profile, invite them to a match etc.

twilit radish
#

It's definitely more convenient yeah.

thin stratus
#

But yeah, we are on the same page :D

twilit radish
#

Could technically do it all your self if you want to, but it's just more convenient to have EOS or whatever do it yeah.

thin stratus
#

I think the big headache that a lot of people would have is "How do I even make my own UniqueNetId with my own backend?"

#

Which I can't answer without looking it up either

#

Probably needs a custom Subsystem implementation either way

twilit radish
#

Definitely needs a custom OSS yeah. The engine depends in too many places on that interface. And honestly probably a good idea anyway if you want to swap it out xD

thin stratus
#

Would be fun to have an open source subsystem but a lot of work

#

Also can't guarantee it's safe, cause I'm not good with the webdev part of this

#

So a self-hostable

#

Surprising this doesn't exist yet, but I guess people are too tied in with the existing ones or just use EOS at this point

twilit radish
#

Would be fun to try it though, but I would not make it open source my self honestly. Sounds like a good way to get a bunch of people not knowing what they are doing on your github page asking constantly for support ๐Ÿ˜›

#

Honestly you could easily monetize this as a company:
Create the software, host it for people that want to use it and let them pay for it, create API endpoints etc. so they can interact with and you just got your own platform system.

#

But then again, that's basically EOS at this point I suppose. Maybe it's better suited as an open source project yeah.. ๐Ÿคฃ

thin stratus
#

You mean Gamesparks, PlayFab, and what they are all called? :D

twilit radish
#

maybe

thin stratus
#

I would rather just make it open source and not give support beyond accepting properly discussed PRs

#

I don't want to earn money with it

#

I even have a Plugin + MasterServer sitting on some Repo somewhere

#

That we never released

#

Way too much headache to market this

twilit radish
#

๐Ÿ™‚

#

Make it, open source it, ask Jetbrains for a free Rider license. Profit.

thin stratus
#

lol

#

We are already paying for 4 Rider licenses

#

We are beyond the free part ;_;

twilit radish
#

Rip.

prisma snow
#

but I bet most people use the pre-made solutions like Steam or EOS, it's just way easier

dusky yoke
#

Iโ€™m setting the playerโ€™s camera location on Event Tick, and the clients are jittering around with the code activated.

I tried running the code through a custom event from server to multicast, was a small improvement but still not great. It made me think that the tick on the server might be different than the clientโ€™s - is there a best method kinda deal when working with event tick?

sonic python
#

Does Eos Online Subsystem From the Marketplace provide Matchmaking, Matchmaking server?

short arrow
sonic python
#

Own Server?

#

How Should I do that?

latent heart
#

Pay money to somebody like playfab

sonic python
#

Okay Now There's a Doubt

#

Join session. ,create Session code is done

#

For that to work

versed ocean
sonic python
#

We have to implement online Subsystem Eos

latent heart
#

Making a MP game as your first game when you don't know what a server is or where you might host servers isn't ideal.

sonic python
#

For Eos To Work We Need Servers?

#

Right?

worn steppe
#

can you do P2P matchmaking instead?

sonic python
#

But this isn't my first game

#

This is my first Mp game

worn steppe
#

I think dedicated servers are probably overkill unless your game is going to sell a ton of copies

sonic python
sonic python
latent heart
#

You started sensibly! ๐Ÿ˜›

latent heart
#

Session / Session hosts only provide ways for people to talk/connect, not to play.

sonic python
#

So Eos Won't Provide Any Servers so Multiplayer can't happen with it alone?

latent heart
#

Correct.

worn steppe
#

it can if you have a listenserver player right?

latent heart
#

Sure. That's the other option. Don't have private dedicated servers. Let people host their own or use listen servers.

sonic python
worn steppe
#

there are downsides to p2p player hosting but it's a looot cheaper

latent heart
#

You only need to pay for a server if you run it. Lots of games get by with a limited number of self-funded public servers and then let people host their own.

sonic python
#

Now There's no need for $$$ thing for Listen server ?

latent heart
#

Nope. That's run by your players.

sonic python
#

Hmm Niceee

#

So How To Implement It?

latent heart
#

However, they aren't ideal.

#

They rely on players have good internet connections.

#

It's implemented by default. UE supports listen servers out of the box.

#

In fact, it actually doesn't support dedicated servers unless you download the source and compile yourself.

sonic python
#

Okay So For Multiplayer to work in mobile after doing the codes

#

I just have to implement Eos Online Subsystem?

latent heart
#

A phone probably won't be able to host a server.

sonic python
#

And It would work?

latent heart
#

They will have bad internet.

sonic python
thin stratus
#

You can host with a Phone

#

Just that Google has no Session stuff

#

That's why they want EOS

sonic python
thin stratus
#

EOS will handle the Sessions just fine, but your Phone will need to host as already explained

sonic python
#

Ok So We Just Need to Implement Eos Online Subsystem.?

latent heart
thin stratus
#

So you'd authenticate with your Google Account with EOS (linking it affectively)

sonic python
thin stratus
#

But after that it should just work. I haven't dealt with EOS yet though

latent heart
sonic python
#

Ok Like Let Me Check The Steps ,.

#
  1. BUYING Online Eos Subystem
#

From the marketplace

#
  1. To Add Client ID and things.. in the dev epic games website
verbal tendon
#
  1. is where you will most likely encounter problems
latent heart
#

Phone connections are just unreliable by nature, imo. They're fine for web browsing because it's a lot of discrete connections, but they don't do consistency if the phone is actually be used outside of the home.

sonic python
#
  1. To Tick Online Subsystem Eos
verbal tendon
#

the process it not documented and the error messages are unhelpful at best

#

So the first time you set this up will be painful until you get it right

sonic python
#
  1. to implement IDs and things in Project settings.
verbal tendon
#

Also be aware that you cannot release your EOS-game as a demo to the public

#

before epic does brand verification ONLY people added manually to your epic org will be able to use the game

#

that is a big disclaimer that is not mentioned anywhere

worn steppe
#

you have to buy EOS?

sonic python
#

Like Releasing the Game is a problem?

verbal tendon
#

yes like if you were trying to pitch a MP game to a publisher

#

People wont just be able to use it

#

Epic needs to do brand verification on your game/company before anyone can play the game

thin stratus
#

You don't need to buy EOS

verbal tendon
#

before that only people in your epic org can use it

thin stratus
#

What you find on the marketplace is probably Redpoints Online Subsystem Integration

worn steppe
#

ah

thin stratus
#

Which exists for free too, but then you won't get any Support

sonic python
thin stratus
#

Idk if Epich as their own subsystem by now for it, but the Redpoint one is supposedly better anyway

thin stratus
#

Yeah, if you have trouble with the Plugin itself

verbal tendon
#

I recommend buying one of the market plugins. it is not worth the time to deal with EOS raw

thin stratus
#

If you don't pay for their license then you are on your own

thin stratus
#

But the Plugin has a free license if you want to test it first

#

at least iirc

sonic python
#

Ok so the free version can be used however we want?

verbal tendon
#

So for example, we had EOS and I wasnt aware of these limitations, so instead of being able to give the publisher a live 2P demo, we recorded a video of us playing internally and showed that off

thin stratus
#

You'd need to read up on their license terms

verbal tendon
#

Also what cedric said

#

Also ... nothing is ever truly free in life

thin stratus
#

Might be that the free version doesn't support other platforms

verbal tendon
#

You either pay for it with money or time

thin stratus
#

They say "console" but not sure what that means

verbal tendon
#

Depends on what is more valuable to you at the point when you have to make the purchase

thin stratus
#

If you're a developer earning less than $30k USD/yr, a Free edition is available. Check the website to see if the Free edition is right for you.

#

So you'd need to pay if you earn too much either way

sonic python
thin stratus
#

You have to get the paid version

sonic python
#

Ok So It's safe to buy the free version?

thin stratus
#

You can also do this all without their plugin, but then you have to integrate EOS yourself. Not sure how far epics own subsystem is

sonic python
#

Eos Ourselves?

#

How is that?

thin stratus
#

EOS is a third party library from Epic Games. The Marketplace Plugin integrates this and adds BP nodes etc.
You can do what the Plugin does yourself, but that's a lot of work and needs a good chunk of C++ knowledge

sonic python
#

Oh Ok Not That Good In C++

thin stratus
#

Yeah then you don't really have a big choice here :D

sonic python
#

Yeah

thin stratus
#

If you are serious about your phone game then you might need to invest into the plugin

sonic python
#

Yeah I'm pretty serious

thin stratus
#

You can try if the free version works for now, but I don't know if they support Google in the free version

sonic python
#

I'll Buy The Paid Vee

#

So After Buying it

#

I don't need to change any codes in the Bp right?

thin stratus
#

Can't promise

#

Have never used EOS or the Plugin

#

Might need custom Session nodes that the Plugin provides

#

That's up to you to research first

sonic python
#

Is it?

#

Oh Ok

#

Thanks Man

#

And Thanks Guys

#

I'll check how to do it and Reporrrt it to you

peak sentinel
versed ocean
#

was trying to view the packets flying around in here I dont see any actors but I know I'm getting replication working perfectly fine?

#

prob has to do with this stats macro not specifically called out during my engine build? shrug

twilit radish
peak sentinel
#

too bad, many network engineers I knew suffered a lot because of rep graph ๐Ÿคฃ

#

another day I thank god for not being interested in low level netcode

twilit radish
#

๐Ÿ˜‚

quasi tide
#

And still no TMap ๐Ÿ˜…

#

improve the performance, scalability, and maintainability
Until benchmarks are actually shown - to me, this is a big nothing burger.

eager jolt
#

how can I tell if the current controller is the Listen Server?

prisma snow
#

GetNetMode()

twilit radish
#

You can use the NetMode for example.

#

Unless you're using BPs.

eager jolt
#

im using BPs

#

is there an equivalent?

quasi tide
#

Check if server. Then check if dedicated server.

#

Wrap it in a BPFL and there ya' go

eager jolt
twilit radish
#

That one yeah, but that also triggers for a dedicated server. Depends on if you care or not I suppose.

#

I think also for Standalone? Pretty sure it just checks if you're not a client.

eager jolt
#

thx

#

its just a small game for some mates so im not bothered about that

twilit radish
quasi tide
#

Isn't the reason they do the networked stuff through the character for the CMC is because component replication is heavier than what they are advertising? ๐Ÿค”

twilit radish
#

Yes, but that's because they call a whole lot of RPCs inside the CMC. At that point it does actually matter and for a few RPCs or whatever it really won't matter. So probably why they used "relatively low" ๐Ÿ˜›

#

But you can still use just the actor I suppose.

#

IIRC every frame until 60 when it starts to combine stuff(?). If I remember what Cedric said at some point ๐Ÿ˜…

worn steppe
#

The networking model in unreal still confuses me. I thought I understood it, e.g. this function runs on the server, this function runs on the client.. but then for listenservers ๐Ÿ˜– ?? and so you remove all of the checking to see if you are on a server or a client to make things work but now everything just runs everywhere unless you mark it with a macro to be server or client specific and thats great except then things randomly just don't work on clients and i don't know

quasi tide
#

Far easier to do these guards in C++

#

But you can just do the checks that I mentioned above in BP and it'll be fine

worn steppe
#

i don't have any blueprint logic

#

ยฏ_(ใƒ„)_/ยฏ

quasi tide
#

if (GetNetMode() == NM_ListenServer)

dark edge
worn steppe
#

yeah, I just don't know how to set it up right

quasi tide
#

or if (GetNetMode() < NM_Client) - will run for all servers/standalone

worn steppe
#

I went thru the unreal networking docs, read a bunch of the stickied stuff, thought I had it, but I don't have it

dark edge
#

standalone is authority and locally controlled

#

listen server's pawn is authority and locallycontrolled

#

clients pawn on clients machine is not authority but is locally controlled

#

etc etc

worn steppe
#

if (GetNetMode() < NM_Client) this is the only check I'm using now

worn steppe
dark edge
quasi tide
#

if (GetLocalRole() == ROLE_SimulateProxy) - you are a client, EXCEPT in the case of controller/pawn. They use ROLE_AutonomousProxy for the local player.

worn steppe
#

I am going to save this conversation and go reread some of my project code, perhaps this will be useful

#

thanks

quasi tide
#

I used to think that the ROLE_AutonomousProxy would be applied, even for say, the weapon used by the pawn. But it did not seem to be the case the other night.

peak sentinel
#

for 100 players

twilit radish
#

Bandwidth can get expensive I would imagine with 100 players xD

sonic python
#

Guys

#

I think I have Set it up

#

But The Create Session Fails , when opened in Standalone

winged badger
winged badger
quasi tide
#

Does PostNetInit get called after a seamless travel? ๐Ÿค” I'm wagering no.

clear island
#

yea my server empty is at 10% cpu, 1 player joins, and it jumps to 50% ๐Ÿ™ƒ

winged badger
#

For what actors?

quasi tide
#

Ones that would've been in the travel list

winged badger
#

Usually yes

quasi tide
#

Conceptually - they shouldn't

#

๐Ÿ˜ฑ

winged badger
#

As pc and ps tend to get reinstsntiated

quasi tide
#

Yeah - I guess that's fair.

winged badger
#

Pc travrl list is usually empty

thin stratus
#

Unless PC doesn't

#

Then RIP

winged badger
#

And other actors are persisted only on server

stiff oracle
#

why i cant see my friends lobby when he hosts a game, and he cant see mine when i host, it works locally tho with the same network, but wont work when they are 2 different networks, how do i fix that?

thin stratus
#

PC not calling BeginPlay after SeamlessTravel still annoys me

winged badger
#

It is a weird choice

stiff oracle
#

yes

thin stratus
#

Which one

stiff oracle
#

the base one

thin stratus
#

The base one doesn't support Sessions outside of LAN

stiff oracle
#

ahaaaaaaaaaaaa

#

i am dumb

thin stratus
#

Sessions require a MasterServer aka SessionList

#

There is nothing you can add or request Sessions from with the NULL Subsystem

#

You'd need to use e.g. Steam

quasi tide
thin stratus
#

I'm sure i still have a bug in the Lobby kit cause of that

#

But it works cause I never travel from Gameplay to Gameplay

stiff oracle
thin stratus
#

I only travel Lobby -> Gameplay -> Lobby

#

Which recreates the PC

winged badger
worn steppe
#

I have a component that binds OnBeginOverlap/OnEndOverlap. It is attached to random BPs in the world. When a listenserver character enters the region, OnBeginOverlap is fired off with authority and everything works great. When a client character enters the region, OnBeginOverlap is fired off WITHOUT authority and since the component is not owned by the invoking client I can't even trigger a server RPC. Is there a proper way to fix this or do I need to only bind OnBeginOverlap/OnEndOverlap on the character itself and then have some kind of common interface that I call on the component itself or something?

winged badger
#

All collisions are local

thin stratus
#

The Collision should be triggered on everyone* no matter who walks over it

#

As in, OnBeginOverlap should trigger on Server no matter if Server or Client walk over it

worn steppe
#

That was my expectation but logging GetNetMode and GetOwnerRole seems to indicate otherwise

#

(unless I am misunderstanding something)

thin stratus
#

Idk what it prints for you, but with 1 Server and 1 Client, you should get two prints if a Client walks into the Collision

quasi tide
thin stratus
#

One for the Server version of the Client's Characer and one for the Client's version

worn steppe
#

Is there a way to log to the dedicated server log?

#

that's in a console

thin stratus
#

UE_LOG

worn steppe
#

ty

thin stratus
#

UE_LOG(LogTemp, Warning, TEXT("[%s]"), *FString(__FUNCTION__));

#

Something like that

#

Or whatever else you want to write

winged badger
#

Makes for quite a mess if you have both lobby-game-lobby and game-game transitions

sonic python
#

Create Session Fails

#

A Question , Eos , How To Implementation Listen Server?

#

Will It Work On Standalone only when it is a Listen Server?

winged badger
#

You should not be starting sessions with standalone net mode

#

You can, but you shouldnt

worn steppe
#

so, characters are owned by the client, but, is it OK to keep extra state information on the 'server side instance' of the character?

worn steppe
#

my character presses an keyboard key, this calls some function (bound using the enhanced input action system). my understanding is that this function is executed on the client. I need it to talk to a component that is attached to a BP that is owned by the server. to do that, the only thing I can do (to my knowledge), is run a server RPC on the character itself from the bound input action function. but, at some point at some earlier time, that component needed to register with my character that it was "subscribing" to my characters input events. I suppose I could invoke a client rpc and maintain the list on the client, but I figure I may as well just do it on the server instance of the character since the client doesn't actually need to know about this list, it just needs to exist somewhere so when the input action is fired off and I invoke the server rpc to notify the component I have a list of components to notify

#

this is a complete jumble to try to talk about

dark edge
worn steppe
#

well, my my player presses the keyboard key, the function that is executed is bound on the character class. In terms of gameplay, I have lets say a water source that the player can drink from. when the player walks near the water, they should be able to press E or something to drink from it

#

I imagine this will be the model I use for a lot of things, like picking up items from the ground, interacting with doors, chests, etc

#

so I'm trying to get it as right as can be now

quasi tide
#
  1. Client presses interaction
  2. Do local checks as needed
  3. ServerRPC the interaction
winged badger
#

But, you should really send a pointer to the actor youre interacting with via that RPC

#

And have an interaction interface

worn steppe
#

my goal was to have the component register an on interact delegate to be called

winged badger
#

If you have 2 interactables right next to each other, server and client might nit independentky evaluate the same actor as target

dark edge
#

Depends on how you want to do it but that's the general gist of it

winged badger
#

1st, always

rich furnace
#

Using Advanced Sessions for Steam, if I wanted to create private and public lobby, would I be using a separate "Create Advanced Session" for the specified lobby types I want?

quasi tide
#

I always do local checks before doing a ServerRPC - can save on unnecessary RPC calls

worn steppe
#

ok, in that case, I will keep the list of subscribed components on the clients version of the character. thanks

#

well well well, everything is working now. thanks everyone

serene terrace
#

hey hey
I want to ask a question so I am having problems with my game for some reason
Iโ€™ve been developing a multiplayer game, everything was working properly up until I reopened the project recently, and I was generally able to both create and join a session on the same machine without issue.

Randomly this issue has occurred where everything works fine and loads properly for the player that is creating the session, and they are able to jump into the level with the new game mode without problem. When a second player joined that session before, it USED to work just fine and load the same game mode without problem, but now it is straight up deleting the game mode before it even loads the level. It is still JOINING the session successfully but it is ignoring the default game mode for that level, its not maintaining the game mode from the previous map, thereโ€™s no pawns or controllers from what i can see and even though it has the time of day sky its either spawning the character controller in a really weird place or not loading the rest of the level at all. This would make sense, i guess, since all of the defaults are tied to the game mode itself. Why is this happening???
I have already tried everything I can and I cant find a solution I can hop in discord share my screen and I hope someone can help me
I am Using Unreal Engine 5.0

dark edge
# winged badger 1st, always

or 2nd with a sanity check so client doesn't say they wanna interact with 1 thing but interact with another on server

#

depends on how close together your interactables are

serene terrace
#

does anyone know what is the cause for the problem

#

I have been stuck on that for the past 3 days at this point

winged badger
serene terrace
#

okay so when I join my game now it says the first player has a gamemode but the second one doesnt and it doesnt spawn

winged badger
#

First player should get all login events when 2nd one joins

#

Also, and i cant stress this enough, joining a session is not the same as connecting to unreal server

#

Those just usually happen around the same time

serene terrace
#

then is their a reason for the second player not getting the gamemode

#

?

#

because I have specified for this map you should get Gamemode_MP but for some reason only the second player isnt getting it

quasi tide
#

Clients do not get the GM. It does not exist on clients.

#

Only servers.

serene terrace
#

got it

#

then their must be a reason for the second player to not spawn and I cant seem to figure it out

dark edge
#

otherwise show your default pawn setting in gamemode

stiff oracle
#

i still cant find my friends sessions even after using online subsystem steam

#

any help please

serene terrace
#

I can refer you do a useful video

#

one sec

stiff oracle
#

oh please

serene terrace
#
#

this video helped quite a lot when I did it

stiff oracle
#

btw

serene terrace
#

yes

#

?

stiff oracle
#

when i tried to use the latest steamworks sdk

#

i was doing it by the documentation, it gave me steam sdk not found error

#

something like that

#

i then changed the folder's name back to the original version, and the steamwork.build.cs back to the original version but i didnt change the sdk folder back to its original one

serene terrace
#

I am unsure of that I didnt dabble much in steams online subsystem

#

I would recommend watching the video fully then trying to see if it works again

stiff oracle
#

alright thanks anyways ๐Ÿ˜ƒ

serene terrace
#

wlc wlc glad I can help

twilit radish
prisma snow
#

brrrrrr

worn steppe
#

can't wait to play PaintShaker Simulator 2023

twin juniper
#

Okay so I asked in c++ but didn't really figure it out. I have a c++ character that is not replicating it's movement to the clients. If I run the game in standalone or listen server then my character moves when I issue a move command to it's ai controller. But it doesn't replicate in client mode

pastel escarp
#

when is replication variables are considered too much ?

#

Is it like 10 replicated property per actor ? 50 ? 100 ?

prisma snow
#

efficiently done, Unreal can handle hundreds and thousands of data per second, but that requires understanding the system and your game and context very well

pastel escarp
twin juniper
#

For anyone wondering, I just solved this. I had to set the capsule component to replicate. The weird thing is that my old blueprint based characters don't have this set but still work?

sonic python
#

The Create Session Fails on Mobile and Standalone

#

Why is that?

#

Even if Lan Is True , It fails

oak oracle
#

Hey devs , i was watching some video on Crouch on youtube , and what he did is this (Screenshots) and evrything worked just fine both on Server and Client , i donโ€™t get why its crouching fine on Server if the actual crouching code is inside of On_Rep functions . Isinโ€™t repnotify functions should get called only on client?

graceful flame
sonic python
#

Online Subsystem Eos is enabled, other Subsystem like steam is not.

#

Except Google Play, for in app purchase

#

So Like Why Is Create Session Failing?

#

Just Want to Know Why.

pale obsidian
prisma snow
#

I know this is not strictly UE, but I found a very interesting article about networking:

twilit radish
#

I skimmed through it, but I donโ€™t think this is useful for most games. They are making the assumption that you can predict what something does and that it does this in a mostly deterministic way. Unreal is not so great on deterministic stuff if you ask me. Along with that games are extremely unpredictable, players are completely unpredictable and AI behavior can change any second based on.. You guessed it. Those unpredictable players ๐Ÿ˜›
Although I think there would be scenarios where you can apply it to, but I doubt it will matter a whole lot.

quasi tide
#

Why does the fast array require the variable to be named Items? What happens if you have more than one in a class?

fossil spoke
quasi tide
#

I've been deceived

#

Bamboozled even

dim trail
#

i dont understand why initgameplaystats is being called before setupgasdelegates

        if (HasAuthority())
        {
            //setup attribute change delegates
            SetupGASDelegates();

            //initialize gas on the server
            GetAbilitySystemComponent()->InitAbilityActorInfo(this, this);

            InitGameplayStats();
                }
fossil spoke
dim trail
#

when i debug, the initgameplaystats gets called BEFORE steupgasdelegates. these are being called in the possesedby method on the pawn

#

I dont understand why thats the case?

#

the whole method:

//Needs to init gas on possessed by
void APlayerCharacterBase::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);

    if (GetAbilitySystemComponent())
    {
        if (HasAuthority())
        {
            //setup attribute change delegates
            SetupGASDelegates();

            //initialize gas on the server
            GetAbilitySystemComponent()->InitAbilityActorInfo(this, this);

            InitGameplayStats();
            InitInitialGameplayEffects();
            InitGameplayAbilities();

            UCombatComponent* ThisCombatComponent = FindComponentByClass<UCombatComponent>();
            if (ThisCombatComponent)
            {
                //ThisCombatComponent->InitAvatarActor(this);
                ThisCombatComponent->OnDeathDelegate.AddDynamic(this, &APlayerCharacterBase::OnDeath);
                ThisCombatComponent->OnKillDelegate.AddDynamic(this, &APlayerCharacterBase::OnKill);
                //ThisCombatComponent->TargetActorReplicationDelegate.AddUObject(this, &APlayerCharacterBase::OnTargetChanged);
            }
            OnInitGAS.Broadcast();
        }
        //GetAbilitySystemComponent()->GetNumericAttributeBase(URagnaAttributeSet::GetJOBEXPAttribute());
    }
}
fossil spoke
#

How are you determining that its being called before? Seems like you are misinterpreting something. It cannot be called before since the function is literally after.

dim trail
#

the call stack

#

let me check something

autumn prairie
#

ahh found some ๐Ÿ˜„

#

seems good for now. i need to read more up on this tho. NetworkSmoothingMode = ENetworkSmoothingMode::Linear; NetworkMaxSmoothUpdateDistance = 50.f; NetworkLargeClientCorrectionDistance = 500.f; NetworkMinTimeBetweenClientAckGoodMoves = 0.1f; NetworkMinTimeBetweenClientAdjustments = 0.05f; NetworkMinTimeBetweenClientAdjustmentsLargeCorrection = 5.f; NetworkNoSmoothUpdateDistance = 25.f; NetworkSimulatedSmoothLocationTime = 0.1f; NetworkSimulatedSmoothRotationTime = 0.1f;

copper grove
#

probably a dumb not 1 size fits all solution but i dont really see any good places for discussion about these 3 values:
MaxClientRate=15000
MaxInternetClientRate=15000
NetServerMaxTickRate=60

#

like what is an acceptable rate for a multiplayer shooter... granted ok, you increase tickrate, should make the game more responsive in theory right, but then you can probably host less games (without massive optimizations)

#

so is its fine jsut setting it to 30?

#

or this like, a thing of the past and everything should be at least 60

fossil spoke
#

Entirely depends on your game, how well its optimized and your targets.

#

The higher the tick rate the more performance heavy it will become, the less instances you could theoretically handle.

copper grove
#

right, thats what i wonder in terms of costs vs gameplay feel

fossil spoke
#

Its very very dependent on your game. Thats why there isnt a lot of resources that talk about specifics.

#

Unfortunately.

#

The ClientRate is just the net speed.

#

In todays conditions its fine to push that up pretty significantly from the default.

subtle patrol
#

Not sure if this is multiplayer related question but I want to ask how many games that have online servers, do announcements in game from somewhere else

autumn prairie
#

just wondering.

fossil spoke
subtle patrol
#

Hm thatโ€™s the way

#

Thanks

#

So letโ€™s say I can trigger an event from a http request?

#

Something like this right?

fossil spoke
#

Likely what would be appropriate is a HTTP request to an API like GetMessageOfTheDay, which would return the latest entry in some Database somewhere that contains the "announcement".

subtle patrol
#

Thatโ€™s seems perfect

rose pollen
#

I have a custom child class of primary data asset that is used as a payload for a gameplay event. the event happens server side and I to do some stuff and then send to payload to the clients via an RPC. however, not to surprisingly, the data asset doesn't go through the rpc and the client just has its event called with none as the input. If I take the same code but pass a string through every works so I guess the issue is in serializing the data asset. Is that just not possible or is there some interface that the data asset could implement that would allow it? In general is there a proper way to pass a primary data asset from the server to the client or should that not be done?

snow thorn
#

does anyone know how to replicate that code properly

#

im making a chat box

#

the print string replicate fine but the widget doesn't have the same text for both clients

#

can anyone help with this

tight crow
#

set the text variable to replicated?

#

"New Text"

snow thorn
#

its the text that isnt being displayed

tight crow
#

you can also try running it through a server > Multicast? Thats the only two things i personally would try

#

I made one in an old project, and i remember going back and forth to get it to show on both. Ill try and find the BP and screen shot

tight crow
#

im opening it now, havent opened it in a year so its taking forever

snow thorn
tight crow
#

multiplayer is crazy. Its the simple stuff that seems the hardest to do lol

snow thorn
#

ya thats why i was trying to learn through this

tight crow
#

im gonna DM you because its a few pics and I dont wanna blow up this chat lol

snow thorn
dark edge
#

Chat should live in GameState or something

#

UI is a VIEW of the data, it is not the data itself.

snow thorn
dark edge
#

Your chat should go something like:

Text entry -> run in server event in playercontroller -> multicast in GameState or ChatManager

snow thorn
#

well got it to work guys

native tapir
#

I'm trying to call server rpc in client using UActorComponent that attached to PlayerController but seems like Server RPC doesn't working in UActorComponent even the owner is PlayerController Is there anything I misunderstood for server and client relationship?

kindred widget
native tapir
kindred widget
native tapir
kindred widget
#

That's odd then. You should be able to RPC even without the component as replicated.

native tapir
#

Well, It's not working I think Server RPC function always need to place in playercontroller..

#

What i was trying to do is separate some ability like interact ability and attack ability to using actor component and communicate with server but those are not working.

#

Because I really don't want to put all functionality about Server RPC in playercontroller.

I want to organize another way but I assume there's no way to do that..

Am I right?

upbeat basin
#

Well splitting the logic with components, even for multiplayer stuff, should be a valid way to organize things

#

Are you sure you're using your own controller and not trying to get the owner/controller of the object/actor you are interacting with?

native tapir
#

The Code :


void UInteractibleAbility::Interact()
{
    if(IsValid(AvailiableInteractibleActor))
    {
        SR_Interact_Implementation(AvailiableInteractibleActor);
    }
}




void UInteractibleAbility::SR_Interact_Implementation(AInteractibleActor* InteractibleActor)
{
    if(IsValid(InteractibleActor))
    {
        InteractibleActor->Interact();
    }
}


It's simple just linetrace to interactibleactor and if player just press e then Interact function just calling SR_Interact function which is UFUNCTION(Server, Reliable)

#

And InteractibleActor :
Code :

void AInteractibleActor::Interact()
{
    SR_Interact();
}

void AInteractibleActor::SR_Interact_Implementation()
{
    IsInteract = !IsInteract;
    if (IsInteract)
    {
        InteractDelegate.Broadcast();
    }
}

void AInteractibleActor::OnRep_Interact_Implementation()
{
    if (IsInteract)
    {
        InteractDelegate.Broadcast();
    }
}


Interactible Actor is calling SR_Interact BUT! It's not triggering with warning : LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_InteractibleActor_3. Function SR_Interact will not be processed.

#

Is there any mistake...?

#

It's working in playercontroller but trying to seperate functionality to using actorcomponent is not working....
I think there's something I misunderstanding but I can't find out

kindred widget
native tapir
kindred widget
#

If the Actor is never meant to be owned, ditch any networking related to Server/Client. It should only have OnReps, and Multicasts. It'll be easier to debug. Then put a breakpoint in the component's SR_Interact. See if that breaks in gameplay. If it does not, put a break in Interact and see what your component's state is. It's owner should be PlayerController, check the netmodes, etc.

upbeat basin
#

Hmm I want to say that your component should also be replicating in order to call RPC from it but Authaer said otherwise, so I'm not sure

#

Putting breakpoints should help us more on that, maybe your component is required to be replicated for the UInteractibleAbility::SR_Interact_Implementation to be called on the server. Maybe your argument you give to (aimed interactable actor) it isn't being replicating hence when the function executes in server it doesn't have a valid InteractibleActor to call the AInteractibleActor::Interact on it

kindred widget
native tapir
#

Is that means RPC must be called from actor?

upbeat basin
#

What does being name stable mean?

native tapir
#

not working in actorcomponent?

fierce grove
#

I have a server owned actor that needs to explose ... to broadcast this explosion with particles.... is the only way Multicast?

native tapir
#

I've already replecated components

kindred widget
winged badger
kindred widget
#

Yeah. ๐Ÿ˜„

#

But the TLDR is that you don't need a replicated component. It just has to be name stable on a replicated actor to RPC, as it goes through the actor's channel to do the networking.

upbeat basin
#

Is this when I use something that is replicates as the argument of an RPC, how it being resolved on the other device?

winged badger
#

And its name stable by default only if its a default subobject

upbeat basin
#

Using this name?

#

I'm considering it's an FName?

winged badger
#

Not quite

#

All actors from level have same nsme on all machines

#

All rheir defsult vomponents have a same name relstive to their actor owner

#

So an object csn be resolved by name over the network

#

But the name only gets sent once - after which its replaced by NetGUID

#

Ssme thing applies for asset pointers, their names are always the same in the package, same as level actors

#

None of those need to be replicated for you to be sble to replicate pointers to them

#

Replicated actors are assigned a netguid as they spawn , and are never resolved by name

#

Their default components have a stable name relative to owner

#

And as owner can be resolved, so then can the components

upbeat basin
#

So this should apply to default components of both default actors in the level as well as the spawned ones since their owner can either be resolved by their names or NetGUID?

winged badger
#

Yes

upbeat basin
#

Got it, thank you very much

upbeat basin
winged badger
#

Kinda, you have to keep in mind that there are engine base component classes as well, that sometimes replicate stuff too

#

like attachement replication in USceneComponent

#

so its not just your replicated variables

upbeat basin
#

Got it, thanks again, to both of you

sonic python
#

Ok Stuck

#

Guys Does Anyone Know ,Why Create Session Fails on Standalone.
Online Subsystem Eos is Enabled.

#

And If Possible How to fix that?

twilit radish
#

I would suggest asking in #epic-online-services , also provide some logs or something similar in there. No one can magically guess what the issue is ๐Ÿ™‚

sonic python
#

There are No Errors in the Log

#

Like Simply The Create Session Fails

#

Is it because of Eos?

twilit radish
#

EOS doesn't have to be the issue, it could be, but in general it works just fine for a lot of people. But like I said try asking in #epic-online-services as people there know a lot more about the issues that can happen with EOS then we do in here. There's also Epic staff in there usually.

gilded hedge
sonic python
#

Verbose?

#

What's that?

sonic python
gilded hedge
#

But long story short, if you need details on why something is failing it's always a good start to figure out where that system is logging and increase the related verbosity in your settings. I think for Eos you'd start with LogOnlineSession

sonic python
#

Ok In Session Frontend

#

I get this warning

#

LogScript: Script Msg : Create Session - Cannot Map Local Player to unique net Id

gilded hedge
#

That's where you lose me, I'm not super familiar with the online subsystem. An initial guess would be that standalone doesn't support features like assigning local players a network id. Or maybe you should just trigger a login before attempting to start the session. Post this in the Eos channel and see if someone can help further!

sonic python
#

Oh Ok

#

Thanks Man

prisma snow
#

Is it possible to connect two packaged games using the command line? I want to test something in a packaged build (to rule out some possible editor interference) and it would be quicker if I don't have to do a connection menu widget

sonic python
#

And One More Thing Like Is It Compulsory to Make The Player Log in

sonic python
#

Ok now the Create Session Fails Even In Play in editor

kindred widget
sonic python
#

Like Should The User Should Be Logged In?

#

Like Should There Be User?

#

And One More Thing

#

Should I Authorise Epic Game Account

oak oracle
#

hey devs , can someone please explain why my multicast RPC only executing on Server ?

gilded hedge
sonic python
#

When I Click Authorise Epic Games Account

#

It says Oops! It looks like the Authorisation didn't start up correctly as there is no log file present .Please Contact Support

gilded hedge
#

seems like something is misconfigured on the eos side of things

verbal tendon
#

Step2: Make sure you entered the correct values in your INI files

#

Step3: Make sure the workflow is correct

#

Step4: Use EOS DevAuth

gilded hedge
upbeat basin
fleet crown
#

Is there any way to interact with a gameserver beacon from an API Backend? Like without using an UE4 client to interact with it

gilded hedge
# verbal tendon ๐Ÿ™ƒ

oh well, then continue it there...i think there are more chances to have the right people see question if it's posted there rather than in a generic multiplayer channel. but, whatever works

sonic python
verbal tendon
#

In the fodler somewhere. I dont have EOS on this PC

sonic python
verbal tendon
#

windows explorer search for devauth

sonic python
#

Ohk

#

I'm using the Paid Version

#

Eos

verbal tendon
#

regardless

sonic python
#

Do I still need that?

verbal tendon
#

its part of EOS SDK

sonic python
#

Oh ok

verbal tendon
#

It facilitates development once you are used tot eh workflow

#

your IP address wont get blocked from epics server

sonic python
#

Ok Found There's two ZIP ,

verbal tendon
#

and you can easily test multiple users locally whilst only authenticating once

sonic python
#

Oh ok

sonic python
#

And Darwin

#

I couldn't authorise it

verbal tendon
#

screenshot?

sonic python
#

In Project Settings > Epic games services

#

Should I app;ly this compulsorily if im going to release my app on google play store

sonic python
#

I think I'm gonna go crazy..