#multiplayer

1 messages · Page 137 of 1

white smelt
heady copper
#

dark parcel
#

isn't that plugin just using Online Session Subsystem

nova wasp
#

confirmed it still works (on my ue5-main fwiw)

heady copper
#

It is

#

So match making can’t happen on listen servers no?

thin stratus
#

It can, I already answered that

dark parcel
#

you will have to create a backend I suppose? Why are you pursuing something like that if you are an indie dev

thin stratus
#

The same reason all the others before them pursue it

white smelt
thin stratus
#

Cause they think they are different, can make the leap and they don't believe the people who dealt with this for years when they say it requires a bigger studio and money.

#

And then you never hear from them again

nova wasp
white smelt
#

if a game developer brings out an original game idea they can succeed

#

just like battlebit did

nova wasp
#

The result was pretty bad because it slows down a tooon when you send many changes in each frame. Like... 1~ received update to the value on the client a second

white smelt
#

with your stand point you wont make it far in life man

nova wasp
#

for things that don't update as often it will work muuch better

thin stratus
#

I won't what?

nova wasp
#

?????

nova wasp
#

they aren't actors... but that's not the point

dark parcel
#

You should asses your limits too tho, don't think that you are more special than others

white smelt
#

im just looking to use it for an inventory system

nova wasp
#

technically the thing that replicates them is a single manager actor for me fwiw

#

a kind of a "replication manager"

white smelt
#

i saw that on some post

#

with a health component

nova wasp
#

but the fastarray itself should work on whatever, this is just to help with the boilerplate crap

nova wasp
white smelt
#

right now i have one fastarray for each player that is supposed to manage one inventory only

nova wasp
#

so there's a bit of survivor bias, but I still want to make a cool co-op game so I get to suffer with multiplayer lol

white smelt
#

when people stay persistent and original they can achieve

dark parcel
#

not always, there are more ppl that failed than succseed

nova wasp
#

I think having one per player is just fine... you won't be pumping inventory state every frame a hundred times like I am for these transforms

white smelt
thin stratus
#

Sure, but the number of people who do is really, really, really, tiny. And going for something that is financially almost unachievable doesn't get you far.

white smelt
#

but i saw people that made shit games and made good bucks

dark parcel
#

I lost about 26,000 dollars already

nova wasp
#

it's a good mindset to have but try to keep it realistic, don't go too crazy with limited time and resources

dark parcel
#

just continuing cuz some people already supported the game in the past

nova wasp
#

and don't burn yourself out...

white smelt
#

right now what im trying to is i have this ambitious project and sit through it

#

and this way i learn ue 5 cpp well

dark parcel
#

I'm still kicking my self till today for having an ambitious project

white smelt
#

just these tarrays right now is really kickin butt

thin stratus
#

I think there is a large diff between an ambitios project and outright trying to do something that hasn't worked out ever before.

white smelt
#

where did someone ever state the impossible here

#

you took this guys multiplayer dreams in one snap of fingers man

thin stratus
#

They will pursue their dream either way, don't worry

#

Doesn't change the outcome though

nova wasp
#

it feels like bucket crab stuff sometimes but... too many scary stories to want to not caution them

white smelt
#

positive vibes only baby

nova wasp
#

Star Citizen... 2!!!

#

jk, jk

dark parcel
#

we got ppl trying to make GTA or MMO

nova wasp
#

Nothing any of us make will be that wild lol (in scope and schedule)

dark parcel
#

some with bp only

#

most of them are solo dev too, and they get offended when someone said it's outright not doable

white smelt
#

but let them try why not

dark parcel
#

no one stopping them?

white smelt
#

even if it wont work haha

thin stratus
#

Solo Devs without C++ knowledge, that want to create a Matchmaking-based game, without having much money to spent, just need a reality check.

thin stratus
white smelt
nova wasp
#

In my mind if you massively lower expectations a multiplayer game alone isn't that wild:

  • no backend stuff
  • co-op only, client trusting for many things

Is my idea to reduce the complexity of it

thin stratus
#

Yeah but what does that help? If you want to actually release the game, the test server is redundant

#

The main point is the financial commitment

nova wasp
#

A massive, massive amount of bullshit is removed if you don't need to make a competitive thing imo

white smelt
#

playtest hype the game

#

boom

#

if it doesnt work out you shut down the project

#

but atleast try

white smelt
#

i believe in everything now

thin stratus
thin stratus
white smelt
#

if you make a good game you can survive of of community servers just sayin

#

Ark ForEx

nova wasp
#

yes sir, making a good game 🫡

thin stratus
#

I think the argument of "when you make a good game" is kinda lame

#

Pretty sure for one there were a lot of good games that failed.
And then "a good game" is very subjective

#

Let alone the fact that "making a good game" is not that easy after all

#

Even objectively

white smelt
#

oh yes it is

dark parcel
#

Sorry for bumping the question one last time.
It doesn't seem that Steam actually give out pings to session?

#

the solution I find online is, the OP end up pinging each of the session him self by sending packets and getting the RTT

thin stratus
white smelt
#

creativity is key to lock the plyer into your game world

dark parcel
nova wasp
dark parcel
#

It does have pings in ms

thin stratus
dark parcel
#

but for steam it will return 999999

thin stratus
#

So Steam has an "old" and a "new" NetDriver

#

Quotation marks, cause the new one isn't just a few weeks old

dark parcel
#

so someone do the digging and I think he said something down the line that steam doesn't actually provide session ping

#

we can get it once we are inside the session ofc

thin stratus
#

If you use the SteamSockets NetDriver, you should get Pings

nova wasp
#

If you actually join the playerstate should have it at least :U

dark parcel
#

I will look it up. Thanks guys

thin stratus
#

Na it's about the Session Results

dark parcel
thin stratus
#

The old Steam stuff never fills the Ping

#

And the default value is 9999

#

I fixed that last time on "Bang on Balls"

#

By using the other thing, which is SteamSockets iirc

dark parcel
#

Tyvm, gonna look it up 👍

white smelt
nova wasp
#

I have a regular unreal-related job and I do personal projects on the side for public/personal stuff

#

personal stuff is mostly messing around, I'm still fairly new to multiplayer internal trivia as I only really started to look at that stuff a year or so ago

#

I still fumble remote role stuff all the time lol

#

(pins in here helped a lot)

silent rampart
#

why is my project looking like this when i press play, I also can't seem to move around or jump.
even on package version of the game.

thin stratus
#
  1. Is this #multiplayer related?
  2. What exactly are you referring to? The clouds? Generally low settings? Anything else?
silent rampart
white smelt
#

thats not settings related

unkempt tiger
#

im noticing that a level loaded actor is beginning play after it's already been destroyed by the server (I think). Thus some of its components are invalid, causing the client to crash, is this even a thing or did I fuck up very badly?

unkempt tiger
#

one should be able to assume that all default sub object components are valid during begin play, right?

dark parcel
thin stratus
#

BeginPlay can be called very delayed, cause it's mainly triggered by the GameState from outside

#

It's questionable if the BeginPlay call would already be filtered if the Actor is invalid

dark parcel
#

I have bug in multiplayer too. On join, the mesh is a hair on the floor 😦 . But they get updated once the char move

thin stratus
#

Not sure if the Actor could enter a state where the Actor is valid but the Components aren't anymore

silent rampart
unkempt tiger
dark parcel
dark parcel
thin stratus
unkempt tiger
#

I'm just asking myself how silly a if (!IsValid(this)) return; line would be at the start of begin play

thin stratus
#

There are serialization problems ones every blue moon

thin stratus
silent rampart
unkempt tiger
thin stratus
#

And you created that Component as a DefualtSubObject?

unkempt tiger
#

indeed, under a FApp::CanEverRender scope though, since it's a component just for rendering

thin stratus
white smelt
#

I figured out my fastarray is working fine but the logic behind creating the inventory is not working or completely absent

unkempt tiger
#

inside the constructor:

thin stratus
#

If you have conditions for the Object to be created, then you gotta ensure that the Condition is also implying that it's always valid on BeginPlay, or otherwise limit it to the same Condition or check if valid

dark parcel
thin stratus
#

If it's Blueprints only, you can recommened the OnControllerChangedEvent, that calls on Server and Client and can be limited via IsLocallyControlled

dark parcel
#

But begin play is too early as well for imc setup

#

Since the actor not possessed yet

#

It's a common problem in multiplayer afaik

#

Actually I m not sure. I just tested my mp game

#

And I have them in begin play

#

So nvm that can't be it

thin stratus
#

@dark parcel BeginPlay is too early

#

Cause you only want to hook up Inputs locally

#

And IsLocallyControlled is not guaranteed to work on Clients when BeginPlay calls

#

Cause the Client doesn't know that the Pawn is possessed yet

#

Hence the OnControllerChangedEvent, that calls when the Controller is valid locally, so you can use IsLocallyControlled

unkempt tiger
#

okay, I concluded that FApp::CanEverRender seems to return 'false' on clients that haven't yet fully connected (at least when used inside level actor constructors during seamless travel)

#

thats so not what i was expecting from something named 'FApp' :(

thin stratus
#

So you use that cause the Server is a Dedicated one and you don't want the component on that?

unkempt tiger
#

yeah, just trying to avoid bloating it up

thin stratus
#

Wouldn't that still crash

#

For the Server call of BeginPlay?

unkempt tiger
#

not to my understanding, since FApp::CanEverRender returns false both during construction and begin play on a dedicated server

#

the inconsistency is only for clients, where during construction the component isnt created (CanEverRender returns false), but on begin play, it returns true, and thus enters a code path that assumes the component in question is created

thin stratus
#

Wouldn#t that help you more

unkempt tiger
#

it def would

thin stratus
#

Idk if there is one for DediServer specifically

#

But #if WITH_SERVER or rather the NOT version of that

#

Would probably help?

unkempt tiger
#

it might, i'll have to do some checks

#

but yeah agreed, preprocessors are the way to go, ty 💪

dark parcel
thin stratus
#

💀 the boob jiggle

#

The main thing is that the Character doesn't seem to replicate when not being moved

#

We had similar issues in The Ascent after teleporting a Character

#

Can't recall what exactly it was

#

How do you replicate that mesh?

#

I assume via some OnRep?

dark parcel
#

No replication yet, I just got joining to work. They are just loading the mesh from the local game instance save file

#

it's Async load, dunnoe if that's an issue. I mean it happend on single player too when they are not rendered to screen. Kinda weird

thin stratus
#

Hm, not sure

dark parcel
#

Thx anyway, I'm gonna try to get the ping to work first. Another problem can wait for another day 😄

native tapir
#

What happen if call Server RPC in HUD?
Client is own the hud but server doesn't have client hud so, I think Server RPC is ignored is this right?

tardy fossil
#

can an actor have a replicated pointer of another spawned actor that was spawned by the server?

sinful tree
sinful tree
tardy fossil
#

hmm im having issues with late joining players not seeing it.. would it mess it up if the actor with the replicated pointer got loaded in before the actual actor it was referencing?

thin stratus
raw thunder
#

Hello everyone,
I am having an issue with my clients controllers not facing the PlayerStart rotation. I tryied to set FinishRestartPlayer in AGameModeBase with no change.
NewPlayer->ClientSetRotation(NewControllerRot, true);
NewPlayer->SetControlRotation(NewControllerRot);
They are always facing the (0,0,0) rotation, even if the values of NewControllerRot are correct.
The Pawn is spawned in the right direction but not the client controller (on server I don't have the issue)

I saw multiple forums on this issue with no explanation, can somebody please help?

outer sphinx
#

Hello guys, a question, I created an inventory with blueprint which in addition to storing items allows you to drop them, the question is: I want to use the inventory in a multiplayer open world project that you recommend I replicate in addition to dropping the items? Is it necessary for the server to know the number of items each client has in their inventory? Do you know any source of information about replications where I can learn? thank you

blazing spruce
# outer sphinx Hello guys, a question, I created an inventory with blueprint which in addition ...

As far as i'm aware, the server should be the one responsible for doing pretty much anything inside the inventory except UI stuff, the server should know what each player has in their inventory and should be responsible for updating the inventory when picking up/dropping an item, you dont want the client being in control of what it can and cant have in their inventory to help prevent cheating

#

The client can be the one to request the action, but its the server who should be actioning it

#

If you haven't done any multiplayer before you should read the network compendium which is pinned in here

outer sphinx
#

Of course, that's what I thought, giving that responsibility to the client, I was exposed to them being able to cheat with the items easily.

outer sphinx
quasi tide
#

Playing multiplayer games != developing multiplayer games

#

Read the pinned posts to get up to speed on things

graceful flame
limber cloak
#

does anyone know how to make private dungeons for each player just like in Albion online in Unreal Engine 5? What do I need to learn to do this?

#

I need to load multiple levels somehow but not to close the main level. How to do this?

sinful tree
# limber cloak does anyone know how to make private dungeons for each player just like in Albio...

You likely won't be able to find much on this. Unreal's built in networking system relies on all things being within 1 single world. There is a plugin available on the marketplace that can support mutliple worlds but they are not replicated, effectively, they are client-side only, and that plugin alone is priced at $400. In order to be able to facilitate properly replicated worlds it would effectively require a rework of the networking system to accomodate simulation and replication based on the current world, which would be no easy feat.

If you just want to have multiple levels loaded in a single replicated world, then it would involve spawning them far enough apart so there is no overlapping parts and outside of render distance from one another. You'd likely need some separate "gamestate" like actors for maintaining the state of the dungeons. You'd also need to ensure any logic you're running takes only the dungeon and its parts that are relevant into consideration with your calculations.

dark parcel
#

Using steam socket makes Online subsystem fail to compile :S, I guess they are not compatible
For some reason it compile now but can no longer make a session with advance session

grand kestrel
#

i.e fake it

#

No one's building an MMO like Albion in unreal though, if they need suggestions from here

peak lintel
#

Hi guys! I have a question.
How to solve the camera possesion in a multiplayer game? Because, I've tried everything (from creating a widget on begin play, on event init in game instance), there's always a default camera spawned in the level for a second, until the player possesses the character.
So, when the level starts, I can see a random place from the level and only for a second, I'm possesing the character. This also happens, in the main menu. For 1 second, the camera is in a random place and after that my widgets appear. Thank you!

limber cloak
quasi tide
#

If you ever wonder - just ask, "Will Fortnite need this?" and you'll have your answer.

native tapir
#

Does Interface support call server rpc from client side??

I'm implement interaction system using interface and I have some problem.
This is ServerRPC function in IPlayerInterface.

class IPlayerInterface
{
    GENERATED_BODY()
    
    UFUNCTION(Server, Reliable, WithValidation)
    virtual void Interact();
    virtual void Interact_Implementation() = 0;
    virtual bool Interact_Validate() = 0;
};

I'm implemented this interface in PlayerController. in order to call server rpc.

And I'm call Interface function like this

void UInGameUserWidget::OnInteractionButtonClicked()
{
    if(IPlayerInterface* PlayerInterface = Cast<IPlayerInterface>(GetOwningPlayer()))
    {
        IPlayerInterface::Execute_Interact(GetOwningPlayer());
    }
}

IPlayerInterface::Execute_Interact(GetOwningPlayer()); this function is called in client but Doesn't broadcast to Actual implemented function (Which in player controller)

native tapir
native tapir
quasi tide
#

Because Epic didn't implement the support.

native tapir
quasi tide
#

Because I've tried it and many others have as well.

#

You can now join this elite club as well

native tapir
#

Oh, Thanks

#

Thank you XD I'm newbie and Your words encouraging me

quasi tide
#

A vast majority of your code, you'll be calling a ServerRPC on w/e class you're in and then doing logic there. IE - doing the interface call while already on the server.

crude quail
#

Can I make a replicated property server-validated somehow? The only way I see to do this is to send a client RPC to the server requesting the change, and then the server makes the adjustment. But I'm losing most of the benefits of having replicated props in the first place. I'm basically in a circumstance where I have like 50 mana, client initiates transaction, server needs to check if they actually had enough mana, then accept/reject the change.

cloud estuary
#

Hey guys, I've got a question that I haven't found an answer to for a couple days and it's really annoying. I've got a multiplayer game based on steam and over the top of the player character there is a name tag, and in the lobby, a "host" tag, which are widget components with a text component inside them, each.

#

I've set up the name tags but I cannot for the life of me set it so that the host tag, which indicates who is the host, appears only above the host for everyone.

#

Only managed to either make it appear on top of everyone, or on every other player.

#

How would you replicate a widget component's text so it only appears above the listen-server player character's head, visible by everyone?

sinful tree
crude quail
#

unfortunate

sinful tree
cloud estuary
cobalt pollen
#

Starting to dig into multiplayer for the first time... it seems like an array using repnotify doesn't fire the onrep event when an element is removed. I'm setting the array to itself after removing an element, it works but it feels wrong.

cobalt pollen
fossil spoke
#

As you could investigate using a Fast Array, they have much better control and options available for managing replication changes to elements

cobalt pollen
#

I'm comfortable enough to use something like that, thanks I'll look into it

thin stratus
#

In C++ they should work fine.

cobalt pollen
#

Maybe I'll just setup the onrep event in c++ and test it out and then expose my own onrep event to BP 😅

#

I just prefer BP for iteration speed but for core netcode I can see why it makes sense to move it all to c++

rose turret
#

is there a best practice for handling both P2P and dedicated server modes for a game?

for example, I have some shared UI that all players look at (game setup, etc.) and it relies on an OnRep_ to change its state. but when I do P2P I just have two standalone clients so those OnRep's aren't firing...

thin stratus
#

Datura typing a book.

sinful tree
# rose turret is there a best practice for handling both P2P and dedicated server modes for a ...

There is no P2P with Unreal Engine. It is either a listen server or dedicated server.
P2P is a completely different networking technology in which there is no central server/authority and state is shared between all players.

The only difference between listen and dedicated is that there is a client playing on the instance that is acting as the server, so you can't separate logic that "only should happen for clients" or "shouldn't happen on server" such as using "Has Authority > Remote" to try and indicate it needs to execute only on a client as the server is also like a client.

#

Just trying to word things right 😛

thin stratus
#

I expected a longer message 😅

rose turret
#

interesting. so if I do two standalone clients and use sessions to join them together, what happens? one converts into a listen server even though it was run in standalone originally?

thin stratus
#

Sessions are not the same as connections

#

Sessions only hold the info about a connection/game

#

To connect players, one has to open a level with the listen option

#

And thus becoming the ListenServer

#

Which will cause it to listen for incoming connections etc

#

Others can then join it. Sessions are there to make the finding and joining a bit easier

#

But they are mainly an addition

rose turret
#

if I run OnlineSubsystem->GetSessionInterface()->CreateSession(0, FName("GameSession"), Settings); it seems to create something that another standalone client can connect to

past flicker
#

Anybody using the Network Prediction plugin or is that dead? I'm using Character and GAS, but that could change if the prediction plugin has enough value.

rose turret
#

is that automatically running listen for me?

(also, given this, I'll reframe my question to: how do I write code robust to being both a listen server and dedicated server if I need logic in an OnRep?)

rose turret
rose turret
past flicker
rose turret
thin stratus
#

If you don't also start listening, no one can actually connect

#

Listening is like throwing a party at your house. Session is posting your address with the party invitation on some public wall so everyone can read it and find your house.

rose turret
#

makes sense. plus some NAT punching I've heard

thin stratus
#

Yeah depends on the subsystem

rose turret
#

what do I do about this ReplicatedUsing snafu? I've been developing in dedicated server mode and now I have a minor mess on my hands

thin stratus
#

But steam for example also gives NAT punching

thin stratus
fathom aspen
thin stratus
#

If you want to code for both server versions you will need to branch where you set your variable and also call the OnRep manually for the listen server fwiw

thin stratus
rose turret
thin stratus
#

Yop.

fathom aspen
#

That's the thing. Saw on Redpoint's that the recommended flow is to listen before you create the session

thin stratus
#

Starting the session on the other hand no clue

fathom aspen
#

But yeah I'm taking it with a grain of salt

fathom aspen
rose turret
thin stratus
#

UE by default creates and starts before listening

fathom aspen
rose turret
rose turret
thin stratus
#

UE tries to connect for a while. That race condition should barely happen

thin stratus
#

At least never had any issues with this concept before

rose turret
thin stratus
#

Usually yeah, also cause I use PushModel anyway

#

So I need to mark the property dirty

rose turret
#

oh fascinating. ok well off to create a bunch of setters then. you're right that it's not a big deal but the conversion is annoying -- I'm sure there are some "if I'm in an OnRep, I'm the client" assumptions that I'll discover soon. good lesson for the future

thin stratus
#

Can also just call the OnRep all the time and filter out dedi server in the OnRep. Doesn't really matter

rose turret
#

yeah that's what I'll do, just means I need to be a bit chattier in these functions

thin stratus
#

For your own code you have the option to call the OnRep anyway

#

Epics code however yeah

#

You will find lots of things that will be annoying

#

Starting with stuff like OnRep_Controller

rose turret
#

oh shoot right. I set the player name and do stuff on rep. bah

thin stratus
#

And Possess

#

Cause there you have OnRep only call client side

rose turret
#

do those client functions not fire in standalone mode?

#

ugh come on epic

thin stratus
#

Standalone is not network though

rose turret
#

yeah I thought maybe they put the same if statements in to call it in standalone

thin stratus
#

And I'm not sure. Don't think they do? They do in BPs but that's a different story

rose turret
#

yeah I know about the BPs. which adds another divergent behavior lol

thin stratus
#

In theory OnRep is used to notify about the replicated property having changed on a client

rose turret
#

well I'll see you on the other side

thin stratus
#

So assumption is that it wouldn't call in standalone

rose turret
#

yeah I get that architecturally the problem is that it's easy to use ReplicatedUsing as "have client react to a change" and then when the calls stop happening it screws up your logic

thin stratus
#

Calling OnRep by hand on the server is in theory also against the design. One would rather have a function that the OnRep calls and that the server can call manually. But it's easier to just skip that function and use OnRep

rose turret
#

or, it does for one of the players in the group but not the others 😢

#

yeah for sure. the middle function isn't doing anything

#

last question: can I RPC to myself if I fire a server RPC on a listen server client?

thin stratus
#

Yes

rose turret
#

phew ok, thanks

thin stratus
#

It is handled as a normal event

#

Same the other way round

#

There is a chart in my compendium

#

That explains that

plucky prawn
#

pretty sure thats not available. steam doesnt give you this information afaik

fossil spoke
#

If you have Steam Sockets enabled, then you wont be able to resolve their IP. Traffic is routed through a relay server. Thats pretty much the point of it, to mask IP addresses.

#

Dedi + Steam Session has nothing to do with Steam Sockets in this context.

dark parcel
#

If I use Steam Socket, I can't use Advance session? When I travel to map, I just get booted back to main menu

fossil spoke
#

If you didnt connect to the Server with an IP address, you are using Steam Sockets.

distant talon
#

the steam sockets plugin doesn't work with steam sessions when i tried it oddly enough

fossil spoke
#

What OSS are you using?

#

OSS Steam?

dark parcel
#

For me, yes

fossil spoke
#

I meant @distant talon

dark parcel
#

i'm trying to use Steam socket so I can get ping

distant talon
#

Funnily enough it seems to apply to both

#

steam sockets doesnt work with the steam online subsystem when i tried it ages ago

dark parcel
#

I just gave up today trying to ping server results =(, skill issue I know but there dont seems to be an easy way to ping sessions

distant talon
#

you certainly don't need steam sockets for ping, i believe a ping value is right on the playerstate

dark parcel
#

Yeah but that's once u are in the session, I need the ping for server browser

#

was told to use Steam socket, so that's what I tried today but don't seems to work with Advance session

distant talon
#

I use this node from the session result structure in my server browser

#

using advanced sessions

#

steam sockets is a totally different tech from the steam subsystem as far as i can tell

dark parcel
distant talon
#

Hmm, it works fine here

dark parcel
#

hmmm not for me, and as far as I know steam doesn't actually provide ping if we use the steam net driver

#

haave to use the steam socket's one

#

some ppl even go as far as writing code to send packets them self and getting the RTT

distant talon
#

Ah, i see, i don't use the steam net driver i don't think. here is my plugin config, i'm not using steam sockets at all, only the subsytsem.

#

I suspect the relaying only happens on steam sockets, i don't have a solution for you (other than just ditching the steam sockets/driver)

dark parcel
#

well I'm using steam soo =(. thx anyway

#

i can live w/o it, rather focus on gameplay more than spending more time on this

white smelt
#

one question replicating health states, normally before i knew about FastArraySerializers, i would have just replicated players health variables, on the component itself but im thinking that might lead into performance issues considering an amount of players and all the variables being replicated.

for example this blog:
https://vorixo.github.io/devtricks/network-managers/

does it with the help of FastArrays and a Helth network manager actor.

before that i would have never thought about storing the Data in an Array.

what should be my go to.

sudden harbor
#

What are the limitations with listen servers (player hosting games) compared to dedicated servers? When is a dedicated server required?

sinful tree
# sudden harbor What are the limitations with listen servers (player hosting games) compared to ...

Listen servers are more resource intensive in that the machine that is hosting the game is also having to visually display things where a dedicated server wouldn't as it's essentially headless. This means you can typically fit more into a dedicated server than you could on a listen server under the same CPU and RAM configuration. If you're running the dedicated server and also connecting with a client on the same machine, then you're probably using up more resources overall.

Dedicated servers aren't strictly required, but in certain circumstances they'd be the only valid choice, for example, if you were choosing to host the servers for players so that players can't spoof your backend systems (like leaderboards, or persistent player stats), and otherwise avoid cheating as a listen server host is technically in control of the game and therefore can cheat without any consequence.

sudden harbor
fossil spoke
#

I would not use a Network Manager for Player/Pawn related state

#

You lose other optimizations by using a Network Manager, like Relevancy.

#

Or at least, you need to be less strict about it.

#

Everything is a tradeoff.

white smelt
solar stirrup
#

Do you have to send those to everyone though

#

Could just send them to the owning client

fossil spoke
#

When you know what and how things can be done, you get a better understanding of how to optimize those things more effectively.

#

Right now you are just making guesses with no base understanding.

white smelt
#

if this wouldnt happen server side players would be able to cheat more easilly

fossil spoke
fossil spoke
fossil spoke
#

But it all depends on your games needs as well.

#

A choice of a particular optimization depends on a lot of factors.

white smelt
#

how would i enable this by default in the project settings

#

if i change it would it stay forever?

dark parcel
#

Hey guys, where would be a safe place to make a call on client when joining?
Trying to look for something like OnControlledChanged , but can't seems to find the event

#

gonna skim thru the compendium

severe nymph
#

Event handle starting new player

#

You have a ref to the joining controller

#

Rpc your call

#

Run on owner if you’re only needing it to run on client

#

It’s safe to trust with server travel

#

Vs event begin play on the controller which won’t get fired again unless your hard loading

dark parcel
severe nymph
#

Event handle starting calls from gamemode

#

By default

#

Create a client only function in the controller

#

Create an interface and link it from an rpc

#

Or direct cast

#

Your choice

severe nymph
#

Just an FYI for anyone having issues with later engine versions and online subsystem steam

#

This resolves the issue that popped up where listen servers could no longer return session results

#

LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamFindLobbiesForFindSessions bWasSuccessful: 0 NumResults: 4' failed in 15.096867 seconds

#

Before UE4.27.2 the FindLobbiesForFindSessions result would return regardless of if you were hosting a friends only session, in a null session (standalone) or a client within a session.

#

This returns that behavior

ebon zealot
#

Can UE5 work with relay servers?

#

I couldnt find much when looking it up, just want to know if it's possible to do without big amounts of development to get it working

frank birch
#

do on_rep notify (c++) fire during first time replication? 🤔 (say, I just joined and received an actor, all its on_replicated methods will fire?)

elder sable
#

Hi, do we need to manually call AddReplicatedSubObject with uobject children of the root subobject ?

heady copper
#

Hey guys am having a minor challenge

#

When I seamless travel to another map the game mode is not changed to the particular game mode I want that map to have

#

It’s still having the lobby game mode

#

Help please

fathom aspen
#

Then you either failed to travel to that map, or that map doesn't have the right GameMode class configured

fathom aspen
fathom aspen
fathom aspen
ebon zealot
#

I havent looked much into online subsystems and all of that, kind of leaving it till the very end when i'm planning to release, I shouldnt be confident knowing I can make relay servers with steam then right?

elder sable
frank birch
elder sable
#

there is postnetinit if you want to make thinkgs on the net initialization

heady copper
heady copper
fathom aspen
elder sable
ebon zealot
#

I'm guessing unreal already has integerations with it

fathom aspen
#

Read my last article, goes in depth over these guarantees

fathom aspen
fathom aspen
#

Savage.

fathom aspen
heady copper
fathom aspen
#

These stuff are pretty straightforward

heady copper
heady copper
fathom aspen
fathom aspen
heady copper
fathom aspen
#

Not yet

heady copper
fathom aspen
#

Not sure how this info helps, but if you feel it's related and plugin owner has help support, you can always reach out to them

heady copper
potent crescent
#

Hello! I'm trying to add Steam Multiplayer in Unreal Engine 5.2.1
For some reason this works on my computer (connecting two instances of the game), but when I run the compiled game on a friend's computer, it doesn't find any sessions. What am I doing wrong?

blazing spruce
#

If you wanna keep the functionality inside the widget then try changing the GetPlayerController's to GetOwningPlayer's, when you're using GetPlayerController that takes an index its only going to be whoever the first players controller is at index 0

thin stratus
#

Steam would require 2 PCs or at least a virtual machine

severe nymph
#

You can’t see your own session as steam subsystem will filter it

#

Also if you start in a session by default ue5.1 might suffer from the same issue ue4.27.2 has

#

I fixed and linked it here

#

@potent crescent

#

If your hosting a listen server by default meaning your starting a session in your game instance before trying to find other sessions it “might return false after timing out” if it’s bugged like ue4.27.2 is

#

[2023.12.13-01.45.00:098][828]LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamFindLobbiesForFindSessions bWasSuccessful: 0 NumResults: 4' failed in 15.096867 seconds

#

Check your logs for this

#

In this case the sessions are found and incrementally added to the array and logged via numresults but the task times out and returns false.

#

Thus the event execution returns failure for the node and the struct returns empty

#

It was introduced here in this commit

#

I’ve reported on UDN as well

eager flare
#

is it easy to create simple multiplayer game? I just watched a tutorial and it seems like theres inbuilt blueprints for hosting a session, joining leaving etc.

old star
#

In Unreal Engine 5.0.3 after you call Execute Console Command: "ServerTravel Map" everyone is sent to the destination map but all the widgets are still on the screen.

That isn't the case with Unreal Engine 5.3.2. When you call that, beside the fact that you can now use it in editor and not having to use standalone, all the widgets are automatically removed. The problem is that I want them to still stay on the screen and remove them later manually. Is there a way to force them to still stay on the screen?

thin stratus
#

In theory, that they stay in 5.0.3, is already not really good

#

Epic, ages ago, enforced removal of Widgets on Travel, because when originally introduced, they crashed more than anything else, due to people keeping Widgets on the Screen that had references to the World, which due to the Travel no longer existed

#

I don't actually know what removes them, but you would want to breakpoint the Remove code in C++ I guess

old star
thin stratus
#

You mean a Loading Screen?

#

That is usualy done differently

#

Loading Screens, if done right, use the Media/Movie System, and iirc also only really support Slate

old star
#

mostly because when the new map is loaded there is a split second were the camera is set to 0,0,0, or maybe there is a fix for that and I don't need that loading widget

thin stratus
#

Not sure if there ever was a proper plugin

#

Think Nick Darnell or so had one or at least tried to make one

#

Yeah, that's what you use Loading Screens for usually

#

Which have the option to be removed manually

old star
#

Thank you!

thin stratus
#

Don't know how up to date that is

#

But iirc Loading Screen without C++, like an acutal one, is not a thing

#

With a bit of luck you can just copy paste most of the stuff in the tutorial I guess

old star
#

My game is mainly blueprint, but there were times when what I needed wasn't available in blueprints, so it is fine, I'll just use C++ for that

#

it doesn't seem hard, so thank you again!

thin stratus
#

No worries

#

The really hard part will be the Widget

#

Cause iirc this requires Slate

queen mortar
#

Hey guys I'm making this game where players can hit and damage each other, but I have a problem. In the game, there are two levels: pre-game lobby and actual game map and I want players in lobby map to hit each other, but not to take damage from each other. On the other hand, I want players in actual game to hit and take damage from each other. Right now I have implemented a bool variable in Player Blueprint if player can take damage. In each level's Level Blueprint I made a reference to player's blueprint and set the variable as in images below.. But the weird thing is that only Client can take damage from server, but server can't take damage. I don't know how to fix it so I'm writing here. Any suggestions?

sinful tree
# queen mortar Hey guys I'm making this game where players can hit and damage each other, but I...

You can't use Get Player Character 0 in multiplayer reliably as it attempts to get the first known character which isn't necessarily the one you want, and even less so if you're trying to use the level blueprint to do this as there's no way to get a reference to a specific player when they're entering the game in the level blueprint.

Additionally, damage is normally something you want handled on the server. This appears like you may be doing damage locally which could end up with health values being unsynchronized. You shouldn't need to have a client tell the server what montage to play either, the server should know what montage to play and possibly multicast it to others.

If you want to have something that prevents damage for all players individually, based on the current map, you can have the map set a bool in something like the gamestate which is more accessible to other actors. Using OnPossess in the character (which only runs on the server), you can check if the controller is a player controller, and if so, read the bool from the gamestate, and if it is true, set the bool in the player character. Again, making sure that your damage function is only running on the server, then the damage shouldn't be applied to any players.

true vine
#

What’s the best matchmaking/lobby system tutorial for ue5.3?

blazing spruce
#

Hi, I've got a spectating system set up so when the player dies they start speccing other players but i want the spectating player to be able to see any post processing effects that happens to the player they're spectating, right now im doing some post process fx when the player gets into low health states but the spectating player doesn't see them because im only running them on the owning client, how can i go about making it so that the post processing fx also replicate to any currently spectating players?

queen mortar
queen mortar
sinful tree
final holly
#

In C++ I couldn't figure out how to create a widget for multiplayer or how to integrate local control. Could you please enlighten me

queen mortar
queen mortar
#

I have one more problem. So when listen server pressess leave button, the session should destroy... and it pretty much does, but client stays in it and that session could not be joined anymore... Also Im using advanced steam sessions v5.1. Any fixes?

sinful tree
queen mortar
#

this is what I did

sinful tree
#

Check and make sure you're reaching these nodes. You can put print strings or use breakpoints. If you're not reaching there, then your logic beforehand isn't setting the value.

#

The branch in the middle here is also redundant as it's checking whether or not BP_GamePC == New Controller which is what you're using in your cast anyway, so if the cast failed, it wouldn't reach this point, otherwise it would always be true.

queen mortar
sinful tree
#

It should only be running on the server as Possessed only runs on the server.

queen mortar
#

But in the main game map it works as it should

marsh marten
#

hey yall simple question as I have not worked with networking before. Would resolution scale (r.ScreenPercentage) affect packets in anyway, and is there a good way I can test this?

#

My hunch is that unless you're running a custom render pipeline, the screen percentage step in TSAA wouldnt really be a part of networking, right?

#

if you're playing online with a cranked screen percent then maybe the hardware could lag on drawing frames which would delay packets, but it wouldnt like, ADD data to packets right?

plucky prawn
#

With fast array replication, if I get notified when something is added, removed or changed is it possible to get the actual item or index? From what I've seen it only gives me the array that was changed

thin stratus
plucky prawn
severe nymph
#

I've outlined it somewhere else but essentially you create a custom LocalPlayer class

#

inherit this as a child of your actual class

#

then in the constructor set that class cameramanager to black

#

hard set

#

then use a fade in function on your actual controller after the rep takes place and you transition from the local player class to your controller

#

you will see the localplayer class in your project settings

#
#include "CustomPlayerController.h"

UCustomLocalPlayer::UCustomLocalPlayer(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) {
    PendingLevelPlayerControllerClass = ACustomPlayerController::StaticClass();
}```
#

Something like this ☝️

#
ACustomPlayerController::ACustomPlayerController(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
    PlayerCameraManagerClass = ACustomCameraManager::StaticClass();
}```
#
{
    SetManualCameraFade(1, FColor(0), false);
}```
#

This will ensure the localPlayer Class also has the fade effect you expect and see when you are possessed by a non "server travel" client for that brief period of time "PendingLevelPlayerController"

#

The LocalPlayer class has to be a C++ class I believe but everything else can also be done in blueprints if you prefer

#

You won't see the 0,0,0 because your fade-in wont happen until your posessed by the non local controller and the localPlayer controller essentially is solid black.

dusty void
#

I just lost the last three days of progress I had on my project 🫠

plucky prawn
#

Is it because you didn't use version control?

dusty void
#

yah it's my first project and it's purely just to learn how everything works so i didn't bother with it T_T

plucky prawn
#

Could have been data corruption or accidentally deleted or something else

idle bane
#

what do you do if you get a blue screen with ue5?

plucky prawn
#

Unlikely that it was specifically unreal that caused it. What does Windows event viewer say?

heady copper
#

Hey guys

#

It’s me again lol

#

Am still trying to solve this issue

#

When I seamless travel to another map the game mod is not changed to the one I set on the map am traveling to please help

dusty void
#

is there a reason why it's checked as locally controlled on beginplay but when the health value changes (character takes damage) it doesn't check as locally controlled??

vestal forum
#

How do you enable CheatManager for clients for debugging purposes in editor?
When i play as client, PlayerController CheatManager is null for clients. Is there a way to have cheat manager for all clients?

white smelt
#

for example when i use a debug command to apply damage on the client it does to it for about a second then goes back to its original value since it didnt happen server side

white smelt
#

i have one question particulary about FastArraySerializers.
since fastarrays dont have particular load orders and can be random on each client.
did anyone achieve to sync their slot position across all clients and the server.

i was thinking to try out and give my items a variable int32 that on storage saves and initializes the position its being sorted in.
to then use this variable to organize the UI Display based on that variable.

the reason mainly im focusing on research ways of sorting grid positions in my Array is that im looking to make a spatial inventory using fast array where a gun has a 2x3 slot coverage for example.

in theory this should work but maybe someone tried and it didnt.

white smelt
heady copper
#

Sorry wah do you mean

#

The battle map has a game mode and ave implemented that in the world setting but it I seamless travel from lobby to battle map 🗺️ I can’t even control my character

#

And the game mode don’t change

vestal forum
thin stratus
nova wasp
#

I've never set up a grid-based inventory setup before, if I were you I would consider maybe thinking if the elements can rotate etc in the grid

white smelt
white smelt
#
bool FRSInventoryList::IsSpaceFree(const FIntPoint& Position, const FRSInventoryItem& Item) const
{
    // Calculate the item's effective dimensions based on its rotation and ItemDefinition
    int32 ItemWidth = Item.Rotation == ERSItemRotation::Horizontal ? Item.ItemDefinition->Width : Item.ItemDefinition->Height;
    int32 ItemHeight = Item.Rotation == ERSItemRotation::Horizontal ? Item.ItemDefinition->Height : Item.ItemDefinition->Width;

    // Check if the item fits within the grid boundaries
    if (Position.X + ItemWidth > GridWidth || Position.Y + ItemHeight > GridHeight)
    {
        return false; // Item doesn't fit within the grid boundaries
    }

    // Check for overlaps with existing items
    for (const FRSInventoryItem& ExistingItem : Entries)
    {
        // Skip checking against unoccupied slots if applicable
        // Assuming IsOccupied() is a method to check if the slot is occupied
        // if (!ExistingItem.IsOccupied()) continue; 

        // Calculate the existing item's effective dimensions based on its rotation
        int32 ExistingItemWidth = ExistingItem.Rotation == ERSItemRotation::Horizontal ? ExistingItem.ItemDefinition->Width : ExistingItem.ItemDefinition->Height;
        int32 ExistingItemHeight = ExistingItem.Rotation == ERSItemRotation::Horizontal ? ExistingItem.ItemDefinition->Height : ExistingItem.ItemDefinition->Width;

        // Check if the existing item overlaps with the space required by the new item
        bool isOverlap = !(Position.X >= ExistingItem.Position.X + ExistingItemWidth ||
            Position.X + ItemWidth <= ExistingItem.Position.X ||
            Position.Y >= ExistingItem.Position.Y + ExistingItemHeight ||
            Position.Y + ItemHeight <= ExistingItem.Position.Y);

        if (isOverlap)
        {
            return false; // Overlap detected
        }
    }

    return true; // The specified area is free
}```
#

also im working on a function to mark multiple entries dirty based on the size of the item

nova wasp
#

that's not really multiplayer as much as just a way to find collisions from a rectangle in a limited size grid

white smelt
#

yes

nova wasp
#

I'm a bit worried sending over items piecemeal will get weird though

#

if something moves in between the receives things might get weird

#

I guess as long as it's safe for clients to move stuff around without stuff exploding locally it may be fine

#

as in a "predicted" move between spaces in the inventory? assuming you even need or want that

white smelt
#

if we have a grid thats 10x10
we have a total of 100 entries to mark dirty.

row 1 would be 1to10 row 2 11to20 and so on

#

based on the rotation position and item size we caculate which entries to dirty.

we have a total of 100 entries so 100 positions to mark dirty, since it can happen that the order is random we have to save additional variables in our fast array like position to then check if an item is occupying the said slot.
when marking dirty we have to make sure it marks multiple entries dirty

#

we also need an algorithm to check and caculate available free space

nova wasp
#

as long as the server has the final say, it's probably fine to have to send updates that way?

#

is this something you need to have locally predicted?

viscid heart
#

FastArraySerializer.h line 186 has explanation how it works

nova wasp
#

oh, sick

#

can you define how it creates new ReplicationIDs? that way I could probably skip some extra stuff on mine

#

I suppose mapping it would work fine but I would rather just raw send the int over (if I can)

viscid heart
#

No idea, I just create empty slots on a server, and then reuse those slots all game.

#

they go from like 1 ... 20

#

whatever your inventory size is

white smelt
viscid heart
#

You could create fixed size inventory, let it replicate, then sort by replicationID?

nova wasp
white smelt
#

i need FGuid and position to make up which item takes which entries

#

like i said one item could take up multiple slots depending on its size

nova wasp
#

I feel like you need the server to control if items can even exist there and then send them when they are in acceptable positions

#

then just have them... where they are

#

and mark them for sending then?

white smelt
#

yes, the order of the entries is not important, just the position an item takes and how many entries it marked dirty
based on its size and current position

#

i dont know if it would 100 % work but that would be the logical order

#

i wish 2D arrays would work with FastSerializer would make everything so much easier

viscid heart
#

you can treat it as 2d array

nova wasp
#

having 2d arrays randomly change order from replication order would be... not really a 2d array in intention

viscid heart
#

just create it, sort by replication id (both server and client) and then just calculate how many slots you overlapped, they are in order now

nova wasp
#

and yeah, you can just make a bunch of functions that more or less makes it serve as a tarray but with your own mapping internally

viscid heart
#

if you create the inventory in a loop, it will have rep ids like this : 1, 2, 3 ,4 , 5...

white smelt
viscid heart
#

it just not might be in that order on client and you need to sort it

nova wasp
#

ideally the order they come in time-wise doesn't matter, they just go in X position

viscid heart
nova wasp
#

all you need is how wide a row is and you can just mod% the offset

white smelt
#
row1 = 1-10
row2 = 11-20
row3 = 21-30
and so on

a grid would be 10x10 for ex = 100
nova wasp
#

sure, that would work

white smelt
#

100 total entries

nova wasp
#

I assume this is the worst case of each slot having a small 1x1 thing in there

nova wasp
#

if you have a giant thing occupying multiple slots you could send it over and just have it occupying those spaces, the server wouldn't need to send data on slots some giant thing is on top of

#

unless the items don't have size? I'm confused?

white smelt
#

width x height

nova wasp
#

why do you need to send information about slots we know something is covering up on the grid?

white smelt
nova wasp
#

let's say you have 1 giant 100x100 item that covers the entire inventory

#

how array items should you have to send?

white smelt
nova wasp
#

I think it's possible to only send the actual items and their transforms + bounds, rather than sending dozens for just one thing

#

I am thinking in terms of like, tarkov or stalker or something I suppose

#

"slots" is a vague term

white smelt
#

paint is wild i just wanted a grid

nova wasp
#

just draw some lines, sheesh

white smelt
#

i quote can you make me a simple grid=

nova wasp
#

generative UI is probably not going to work for making simple diagrams, especially when you don't ask a direct question? also #generative-ai

white smelt
#

you understand the logic here a bit?

nova wasp
#

I understand what you mean, I just don't think you have to represent every single empty grid over the network

#

it can just be... empty

#

aka an inventory with only 1 item in it would only send over that item + transform
and something else maintains the size of the container

white smelt
white smelt
#

we store grid position and occupancy

nova wasp
#

so when someone joins they get sent 1000 empty slot indexes over the network for an empty container?

white smelt
#

where you come up with this from what i just explained

nova wasp
#

alternatively: an inventory with a single larger item sends over multiple dozen slots for every one that SINGULAR item occupies?

white smelt
#

yea cause it covers the whole thing

#

let me figure out the main logic first and then optimize man

plucky prawn
thin stratus
#

Just check the FastArray header

#

You have both things explained there

white smelt
# plucky prawn these ones? ```cpp void PreReplicatedRemove(); void PostReplicatedAdd(); v...
//Item Definition
USTRUCT(BlueprintType)
struct RSI_API FRSInventoryItem : public FFastArraySerializerItem
{
    GENERATED_BODY()

    // --- Identification ---
    UPROPERTY()
    FGuid ItemGuid;

    UPROPERTY()
    int32 Count;

    UPROPERTY(NotReplicated)
    int32 PreviousCount;

    UPROPERTY(EditAnywhere)
    URSItemDefinition* ItemDefinition;

    UPROPERTY()
    float Durability;

    UPROPERTY()
    FIntPoint Position;

    UPROPERTY()
    int32 Width;

    UPROPERTY()
    int32 Height;

    UPROPERTY(EditAnywhere)
    ERSItemRotation Rotation;


    bool operator==(const FRSInventoryItem& Other) const
    {
        return Other.Count == Count && Other.ItemDefinition == ItemDefinition && Other.ItemGuid == ItemGuid;
    }

    bool operator==(const FGuid& OtherGuid) const
    {
        return OtherGuid == ItemGuid;
    }

    bool operator==(const URSItemDefinition* InItemDef) const
    {
        return ItemDefinition == InItemDef;
    }

    int32 ConsumeCount(int32 NumToConsume);
};```
thin stratus
#

I don't have UE available atm

plucky prawn
#

alright thanks. just trying to make sense of how it all works

nova wasp
#

there's nothing wrong with your inventory struct, I just don't think representing one giant item as dozens of indexes makes sense when you... already have a size? why even have size then?

thin stratus
#

But yeah, seems to be those 3

white smelt
white smelt
#

if you know one shout it, and i will try and work on that

vestal forum
white smelt
nova wasp
#

are they in any shape other than a rectangle?

white smelt
#

no

#

Fint?

nova wasp
#

you already... you already did that

#

unless the size was for something else entirely? I'm so confused

white smelt
#

yes thats only the position

nova wasp
#

what are these for then?

white smelt
#

item size

nova wasp
#

are the item size and how many spaces they occupy different ideas?

#

or, concepts I should say

white smelt
#

item size initialy starts from pos in z and y

nova wasp
#

so can things be on top of other items?

white smelt
#

but we need the values inbetween to control and check space taken

nova wasp
#

why? why can't you just check the other items and if they occupy that range with a bounds check?

white smelt
#

if its of same item type

viscid heart
#

maybe just have the items replicated, just like you have now, and then client and server both know the grid size and can just calculate does it fit there or not? what sthe problem, i forgot already

white smelt
viscid heart
#

you could loop trough items or just manage non replicated array that know which grid slots are taken, and if your calculation says that it tries to go to taken slot, abort

white smelt
white smelt
nova wasp
#

okay: did you write this code you showed us? did someone else do this and give it to you?

white smelt
#

and right now we just bounce back and forth and there is no sign of progression in understanding the issue and why it wont work

white smelt
#

im iterating and changing the system to allow for a grid based spatial approach

nova wasp
#

assuming items are atomic (they aren't separate pieces in a 2x2 item) there is seemingly no reason you have to send 5 entries to represent items in this pattern:

#

this is less about optimization and more about it being confusing to have 4 entries you have to manage for a 2x2 item that occupies that blue area

viscid heart
#

yeah if you just send two items, each with position and size, and you know the grid size, you can calculate if they overlap

#

now I kinda want to design and implement spatial inventory

white smelt
nova wasp
#

more regular #multiplayer question:
are there any real guarantees with rpc ordering/timing based on being at/from a similar net object? Is there some way to tell replication to only send/receive a pair of RPCs together in one packet?

#

I assume not really, I can cheese things I guess but I'm wondering if I'm missing something

nova wasp
white smelt
#

i test my current progress and see if it works as expected

marble fox
white smelt
#

i only used it for position rn

marble fox
#

Yeah

white smelt
marble fox
marble fox
white smelt
old star
# thin stratus https://unrealcommunity.wiki/loading-screen-243mzpq1

I tried that but nothing shows up with NewTestLoadingScreenWidget, maybe it was changed since then to simply be empty, but at least BeginLoadingScreen is called, as I added a variable and updated it's value inside that function, and after a map is loaded that variable has its value updated to what is inside the function. So maybe I need to make my own Slate widget... that is goin to require a few tries for sure

fathom aspen
#

If I wanted to guarantee two RPCs are received in the same packet, I would probably make them one RPC instead

marble fox
grizzled stirrup
#

server RPCs called on the server are treated just like regular functions right?

fathom aspen
#

Yeah

#

Might end up invocating a couple of extra functions, but yeah it's local

heady copper
#

@brittle wharf

white smelt
dark edge
#

don't, if you are

lusty sky
ebon zealot
# dark edge don't, if you are

why not? does it not allow faster access of data so you can do a[x][y] rather than looping and checking if the x & y match? I guess you can use 1 map<int, item> and have the int be the packed position but is that worth?

modern cipher
#

because he wants to use fast array

ebon zealot
#

ah

modern cipher
#

you cant do that with fast array

white smelt
#

oh no im using a 1d array, so just one fast array with calculated indices

#

its still not working tho

neon obsidian
#

Is there a specific method for syncing Instance Static Meshes when a client joins? These meshes are housed within PCG Partition Actors.

crude quail
#

I'm a bit confused, I have a server rpc here:

    UFUNCTION(Server, Reliable, BlueprintCallable, Category="GameplayEvents")
    void ServerTryPlayCard(TSubclassOf<ACardActor> CardActorClass, const FVector2D ScreenSpaceCursorPosition);

    UPROPERTY(BlueprintAssignable, Category="GameplayEvents")
    FOnCardPlayedDelegateSignature CardTryPlayEvent;
//...
void UCardSubsystem::ServerTryPlayCard_Implementation(TSubclassOf<ACardActor> CardActorClass,
    const FVector2D ScreenSpaceCursorPosition)
{
    CardTryPlayEvent.Broadcast(CardActorClass, ScreenSpaceCursorPosition);
}

and a not-replicated server only object listening for it

#

But this does not call from clients

#

only running on the listen server

thin stratus
#

What is that Subsystem?

#

Not sure any of the Subsystems can run RPCs, let alone ServerRPCs

crude quail
#

It's a regular world subsystem

UCLASS()
class NECROMONICON_API UCardSubsystem : public UWorldSubsystem
{
    GENERATED_BODY()

public:
    UFUNCTION(Server, Reliable, BlueprintCallable, Category="GameplayEvents")
    void ServerTryPlayCard(TSubclassOf<ACardActor> CardActorClass, const FVector2D ScreenSpaceCursorPosition);
    
    UPROPERTY(BlueprintAssignable, Category="GameplayEvents")
    FOnCardPlayedDelegateSignature CardTryPlayEvent;
    
protected:
    virtual bool DoesSupportWorldType(const EWorldType::Type WorldType) const override;
};
#

oh

thin stratus
#

ServerRPCs require a ClientOwned Actor(Channel)

#

So I doubt that would work

eager flare
#

how would i be able to host the server myself so me and my friend can play

crude quail
#

well that would be a thorn if so hmm

thin stratus
thin stratus
crude quail
#

that would explain why it's not working

#

gunna have to think about how this has to work then

#

cheers

eager flare
#

or do i have to open my ports?

#

cuz i dont see option where u can choose ip and ports

thin stratus
#

You are doing two things in that screenshot

#

You are creating a Session with the Subsystem you are using, which is used to later find said session and join it.
And you are starting to "listen" for incoming connections.

#

The Session (Creating, Finding, Joining) is just information.

#

The "listen" is the part that is hosting.

#

If you aren't using a Subsystem that allows online sessions, such as Steam, then the session part is relatively redundant

#

By default, the game will listen on port 7777

#

Steam performs NAT Punch Through, so you don't have to open the port

#

But without that you'd need to open that port in your Router

#

The IP it hosts on is your Routers Public IP

eager flare
#

Okay thank you I think im using the default subsystem(idk havent touched anything) so basically I just need to open up port 7777?

thin stratus
#

If you use the default Subsystem, then you are only creating LAN Sessions, so you can ignore Sessions for now fwiw
If you want to join that Game over the Internet, then you have to open the Port 7777 and your Friend has to connect directly to your public ip + port via console command:

open <ipaddress>:<port> e.g open 127.0.0.1:7777

#

You don't need to add the port to the command if it's 7777 anyway iirc

#

The Sessions stuff, over Internet, doesn't work without Steam or similar. You'll only find Sessions in your Session List in LAN atm.

eager flare
thin stratus
#

Yeah outside UE it's hard to find an Engine that has this all already available

#

Even the Replication part

#

I think Unity is adding DOTS or so, but not sure

#

Godot has some networking stuff, but I haven't really looked into it enough to know how powerful it is

crude quail
#

So I'm quite confused, calling server rpcs from the player controller seem to be valid, but almost nowhere else. What are the requisites for being able to server rpc?

dusty void
#

Rpcs need to be called from a client owned actor right?

#

I haven’t touched them in my projects yet but I think that was one of the requisites when I was reading up on the copemendium/documentation

eager flare
crude quail
thin stratus
#

Console is disabled in Shipping builds though

dusty void
#

My issue rn is IsLocallyControlled working for my character on BeginPlay but not anywhere else in my code T_T

crude quail
#

although

thin stratus
#

But you can use a "ExecuteConsoleCommand" node and hook it up to your UMG widget with a text box

lusty sky
crude quail
#

The player controller is also not authority

thin stratus
crude quail
#

Is authority and ownership different

thin stratus
crude quail
#

like ROLE_AUTHORITY

#

is not ownership?

thin stratus
#

No

#

Server-spawned Replicated Actors are owend by whatever the Server sets as Owner (either on Spawn or afterwards). Usually PlayerController or PlayerController owned Actors.
Authority is still the Server.

#

Locally spawned Actor (not replicated from Server) would return true for HasAuthority on the Client though

grizzled stirrup
#

Can these kind of warnings be ignored when playing in PIE multiplayer when level streaming levels are unloaded?

LogNetPackageMap: Error: GetObjectFromNetGUID: Failed to find outer. FullNetGUIDPath: SomeMeshInMyUnloadedWorld

I don't recall seeing them in the logs on development builds but I will verify in case this could be an issue

crude quail
#

So if the actor is not owned by the local player controller it cannot server rpc

#

that seem correct?

thin stratus
#

PlayerController or a chain leading to it

#

And the Server has to set the Owner

#

And yes, the Client that calls the RPC has to own the Actor

#

Only one Owner at a time

crude quail
#

So like for example, my player state apparently can't rpc

thin stratus
#

Your PlayerState can RPC

crude quail
#

And that's because it's not owned by the local controller?

thin stratus
#

It is owned by the PlayerController

#

So the Chain of Owners leads to the PC

crude quail
#

it can't, and this is one of the reasons I ended up here

thin stratus
#

You def can RPC in a PlayerState

#

only your own though

crude quail
#

yeah they don't execute for some reason

#

how have I managed to break the player state

#

xD

forest reef
#

My character is hitting a wall or not moving correctly. loaded my working files from last night, rebuilt visual studio files, client side navigation is on. It only happens in client mode. I tried the model and ABP on the mannequin and it worked fine. No idea why I can't get single click motion to work. Any theories? https://imgur.com/a/mR0lDAI

sharp plover
#

Did they change something in 5.X so that animations on the server are played slower? Having the issue that my clients are playing the animation in normal speed but my server is playing them at a much slower speed

thin stratus
forest reef
#

@lost inlet do I have to make a new mesh for different characters?

lost inlet
#

If the client needs the navmesh to operate the movement, then you need to opt in

grizzled stirrup
#

There's a checkbox to generate navmesh on client @forest reef

sharp plover
lost inlet
#

By default navmesh is not loaded on clients

forest reef
#

@grizzled stirrup that is set to true, which was working

thin stratus
#

The Server isn't ticking Client Anims

#

It gets driven by the Server Move RPC for them

#

So Server migth see Client Anims a bit weird

#

That's all I can tell you

sharp plover
thin stratus
#

I think so, yeah

sharp plover
# thin stratus I think so, yeah

Unfortunately didn't change anything, really wonder what it could be. I've also enabled it so that the skeletal mesh component ticks on the server and updates the pose, just weird why it would be slower

dark edge
#

Is it all anims or only locomotion

sharp plover
#

Just state machines, doing nothing to alter the speed or anything

#

Somehow it plays substantially slower on the server in the preview when I set the instance to be the server character

#

Preferably I would want collisions to be server side strictly with client prediction to confirm the hit (lagg comp) but if I can't get the server to play the anim at the same speed as the client I'm not sure what I'll do

#

Used to work just fine in 4.27 but ever since we upgraded to 5.2 it seemed to change

forest reef
#

So I created a new character. Copied everything from the working topdown character c++ code. Same mesh, animation blueprint, controller. topdown character works but mine is stuck

rain plover
#

Hello can someone explain to me what a headless server is please?

sinful tree
rain plover
forest reef
#

My character was hitting a brick wall in the topdown example because these were not checked

crude quail
#

How can I give a player owned pawn to the server?

sinful tree
crude quail
#

Server becomes the owner of the pawn

#

and not the PC

#

I'm in a sort of weird situation where I want the player pawn to be owned by the server

sinful tree
#

Why does it need to be owned by the server?

crude quail
#

it's an invisible attribute bag

#

leaving it as player owned basically makes the systems much more complicated

sinful tree
#

I don't see how. Ownership doesn't really do much apart from handling replication conditions.

crude quail
#

yeah

#

the replication is the issue

sinful tree
#

"invisible attributes" could just be things that aren't replicated at all.

crude quail
#

they are replicated

#

but everything that's happening is server auth

#

having the pawn not be a server entity makes it super convoluted

sinful tree
#

I think you're misunderstanding what ownership is.
If it's a replicated actor, that means it has to be spawned/exist on the server, and server would be the authority of that actor regardless.

crude quail
#

yeah I just went through this earlier

#

authority isin't the issue I'm having

#

it's ownership

#

RPC's are dictated via ownership

sinful tree
#

What issue do you have with ownership though.... Ownership doesn't grant anything special.

crude quail
#

for reasons

sinful tree
#

Preventing replication == you don't want others to see the value.
Preventing RPCs == you don't want those things to be RPCs to begin with.

crude quail
#

here's a concrete issue I'm having

#

This does not work if the pawn is not owned by the server

#

and I only want this code to run on the server anyways

#

I have to grant the ability seperately and then activate

sinful tree
#

Incorrect. It doesn't work if you're not running on the server.

crude quail
#

...

#

that's literally what I just said

#

this is server code

#

it should only be server code

sinful tree
#

No it isn't.. You said:

This does not work if the pawn is not owned by the server

crude quail
#

alright

#

That's the problem I'm having

#

The question I'm asking is how can I make the pawn owned by the server

sinful tree
#

You can't if it's player controlled. You still haven't clearly explained why you even need it owned by the server.

crude quail
#

Because this code does not work on clients

sinful tree
#

That doesn't have anything to do with ownership.

tall cedar
#

hello everyone , does anyone have an idea how does lethal company lobby ship system works?

crude quail
#

What do you mean

#

It's literally an ownership problem

#

If I have a normal server owned object this works perfectly fine

#

If it's player owned it does not work

#

this is the problem I'm having

sinful tree
#

Here's the thing.... You're running that node, and it's on an ASC. That ASC is replicated and is owned by something that trickles down to being a player.

#

So whether you have the ASC on PlayerState or PlayerCharacter, it'll point down to the PlayerController which is player owned.

#

If you're attempting to run something that exists only on the client then it's not replicated. You can't get the server to access it, and you can't add it locally to the ASC as it's something that the server has authority over.

crude quail
#

This object is not local, it's a replicated pawn. But the fact it's owned by the player is the problem. Even if I use server rpc's, gas considers the instigator pawn's ownership as the important factor in the security policy

#

Maybe a better question, what does it mean for the server to own a pawn. Is a pawn that has no controller considered owned by the sever?

sinful tree
#

Server doesn't really "own" anything as "server" is not something that exists as something you reference.

#

Ownership is assigned, typically by the thing spawning the thing that is being spawned.

#

When you're assigning ownership to a "player" what that means is you're usually assigning the owner to an actor that has an ownership chain that leads to their PlayerController.

crude quail
#

so if there's no ownership

#

server owned?

sinful tree
#

No.

#

No ownership = no owner.

#

That's it.

#

I can spawn an actor on the client with no owner, that doesn't mean the server owns it.

crude quail
#

so when the server spawns a pawn

sinful tree
#

Nor does it mean the player owns it.

crude quail
#

it just doesn't exist?

#

like the server must have some representation right

sinful tree
#

The "server" isn't a thing that exists that you can reference. Neither is a "player". The only way you can reference a player is by their "player controller" which represents a player. There is no such thing that represents a "server".

wet briar
#

okay so i have a Charcterblueprint which is used for both client and server i have everything thing replicated to work but im having a issue,i have a sniper which is a child of the ak actor in picture and i made a render target with 2d camera to make a zoom in but as you see in pic the clients texture is the server scope also not indivual how do i get so server and client see there own @sinful tree do you know anything about this i know you help me before with a issuee in past

crude quail
#

I can clearly spawn things on the server

sinful tree
#

Yes, but you can't reference the server as anything.

#

It's not an actor.

crude quail
#

yeah that's my question

#

is it just when you return nullptr

#

ex

#
const AActor* APlayerPawn::GetNetOwner() const
{
    return nullptr;
}

UPlayer* APlayerPawn::GetNetOwningPlayer()
{
    return nullptr;
}
#

is it implied this belongs to the server

sinful tree
#

That just means there is no owner.

#

It odesn't mean it belongs to the server.

crude quail
#

So there's no possible way to fufill the net ownership for GAS?

#

the security policy is just their for kicks?

sinful tree
#

The engine itself knows if it is the authority or server under the hood.

crude quail
#

Yes friend this is what I'm asking

sinful tree
#

But the "server" is not something you can reference.

crude quail
#

How does it know

#

The authority is not what it's checking for the security policy

sinful tree
#

The world netmode.

crude quail
#

can't be

#

I'm running on a server rpc

#

but it's using some credential of the insitgator

sinful tree
#

In order for a client to be able to call this event in a multiplayer game and for it to work properly then the actor must be replicated and they either:
A) Need to be the host for a listen server
B) Be the owner of the actor making this call.

In case A, since it's the listen host, they have authority over the actor, so it will execute.
In case B, if it's not client owned (determined by if the ownership path leads to a player controller) , the server would reject the RPC as the client isn't the owner of the actor.

crude quail
#

yeah we are on the same page now

#

this doesn't execute if I'm not the listen server

sinful tree
#

Then that means the client likely isn't the owner of the actor (ownership needs to be defined on the server too), or, the actor isn't replicated.

crude quail
#

so this is supposed to work?

#

under like normal circumstances

sinful tree
#

Yep

#

So long as it's a replicated actor, and it was assigned ownership to a player and that player is making the call, it should execute on the server, grant the ability and activate it once. (Not taking into account the activation policy of the ability....)

verbal heart
#

Has anyone figured out an elegant way to transition from a main menu "level" to a partitioned level smoothly from a client perspective? I am assuming I need to async load actors that will be in the destination level before calling ClientTravel. However it still has a hiccup and I am manually defining all the actors. I would like to provide a grid cell to load all actors from automatically.

crude quail
#

yeah I'm really confused

#

both prints run

#

but the ability doesn't run

#

and this is definitely replicated as I'm calling it from the player state in this case

#

ability just for ref

#

doing nothing fancy

#

afaik

#

yeah same story on a replicated pawn

sinful tree
#

LogAbilitySystem: Warning: Can't activate LocalOnly or LocalPredicted ability Default__GATEST_TestAbility_C when not local! Net Execution Policy is 0.

#

Doesn't want you activating the ability because it's set to client predicted but you're trying to execute it on the server.

crude quail
#

welp

#

that was indeed the problem

#

Where did you see that log?

sinful tree
#

Window > Output Log

crude quail
#

I had warnings filtered

#

well this was a huge help thank you, I was about to re-engineer a whole bunch of stuff for no reason

sinful tree
#

Glad we got it figured out 😄

crude quail
#

I was so abusrdly confused lol

#

game dev do be like that sometimes 🤣

ripe folio
#

Unreal networking question - how are OnRep functions in C++ timed compared to the setting of the actual replicated variables on the client? Are all actor replicated properties in that tick set to their replicated values, and then all OnRep functions are called, or are they called as each property is changed?

What about with components? Are they all in place before any actor OnReps are called, or are they separately-timed?

lost inlet
#

this is something you can verify with a well-placed breakpoint

hollow eagle
#

Also, the unfortunate answer is that it shouldn't matter. Properties are not guaranteed to be received all at once - even if you set a few properties at the same time you're not guaranteed to receive them all at once, thus making the order of application practically irrelevant.

lost inlet
#

ah yep, run into that a few times

hollow eagle
#

Properly designed replication shouldn't care about what order properties are applied in because it makes no such guarantees, and on spotty (and even sometimes good) connections you'll end up with things arriving in weird orders if you didn't plan for it.

ripe folio
#

I appreciate that. I'm designing a replication system outside of Unreal and trying to understand how it works

#

So no breakpoints for me, just asking

#

Hard to find info, the docs don't say it either

#

(I've used it a lot in the past but been a few years. Can't remember this specific detail)

lost inlet
#

well you're not bound by how unreal works then?

ripe folio
#

It's just a reference, I'm just asking to see how someone else does it

hollow eagle
#

Applying all at once may or may not be more ideal, depends on what kind of guarantees you want to make. If it's applied all at once and OnReps fired later then you can assume you have whatever the latest information is in every OnRep, but you then can't assume any other OnReps have fired for that information.

#

But in the end you still have to design around receiving partial information. "Atomic" replication of unrelated properties is expensive.

ripe folio
#

Yeah that's fair. My initial instict was as-you-get-them one-by-one, even if sent and received together for a single frame. But applied all at once does make the inter-dependencies easier. I'm obviously going to make my own choices but it can be useful to hedge my bets looking at what people who have spent years on things have decided - can be interesting to discover what future problems they've already hit 🙂

#

Though the original question wrt how Unreal does it remains. I know that properties set in the one frame will have their final state for that frame all bundled together and sent to the client (though not every actor will, depending on relevancy, and network priority etc)

nova wasp
#

Series of posts about netcode

hollow eagle
#

fwiw at least the old replication system seems to delay executing repnotifies until after received properties have been applied. Looks like it is per-object, though, so it makes no guarantees about one object having things applied before another.

ripe folio
ripe folio
#

Awesome, thanks!

vagrant roost
#

so im doing a mario style jump in my online game, where when you let off the jump the gravity increases and also once you reach the apex

#

but to my knowledge you cant use timelines online

#

so im wondering if anyone knows a way to go about this

#

the server character behaves as expected but the clients are all jumping as if they were on the moon

marble fox
#

Okay so im not really sure why i cant see the clothes on my player appear if i drag and drop it on the character preview

#

and all of this is happening as it should ive been placing breakpoints through all the code and it ends up where it should right here :

#

Although nothing is equipping / shows on the character, Appears to Only happen on the server cause when i do go as standalone or Listen Server it works as it should

sinful tree
#

If you're setting the mesh only on the server, that probably isn't replicated. Use a RepNotify property that contains the mesh that should be equipped. When you set the mesh on the server, set the property to the mesh as well, and then in the OnRep set the mesh like you're doing on the server.

marble fox
#

it appears to be the problem. Cause if i a remove that while dragging it works

#

but i dont see why that would be a big issue, If the item isnt in the inventory but the setskeletalmesh executes why would that even matter?

final holly
#

When I interact with an actor, a widget with actor-related data will open, but when I interact with the client, the widget opens only on the server. Can you please help? I create the widget from actor.

sullen plover
#

So I've been following this inventory tutorial but the way it handles object destruction doesn't work for me, only the server player can do it, not the client: https://youtu.be/4bXYl11sFew?si=GCt-_XW3BnSrCJPZ

We are revisiting one of my first series on the channel; the inventory system series, this time with different implementations, improvements, and now in Unreal Engine 5.

In Part 4 we handle item interaction and replicating this across multiplayer.

SUPPORT ME
Patreon I https://www.patreon.com/ryanlaley
Buy Me a Coffee I buymeacoffee.com/RyanLa...

▶ Play video
sinful tree
sinful tree
final holly
sullen plover
#

The interaction is literally an input from a player pawn -> server RPC event -> calls destroy event on the interacted actor

gloomy tiger
#

In the context of a replicated TArray<int>, will NetDriver submit a diff to be performed on the client instance or it sends the entire packet altogether?

sinful tree
sinful tree
gloomy tiger
lost inlet
#

so NPP went from being not dead, to dead, to being not dead again? unless there's confusing internal names for stuff. apparently the latest is mover 2.0 will use NPP

sinful tree
# sullen plover On the pawn

Put a print string immediately after the RPC and check whether it is actually running on the server or if it is running at all.

sullen plover
sinful tree
#

This RPC is in a component attached to the player pawn?

gloomy tiger
sullen plover
#

Nope, the player pawn itself.

gloomy tiger
#

Output Log I mean

sullen plover
#

I've tried setting the reference for the interactive object selected by the pawn on the server, but then the output log compalins about the client pawn not having an owning connection.

gloomy tiger
#

If a RPC fails to be dispatched, it will raise up a flag there