#multiplayer

1 messages · Page 198 of 1

thin stratus
#

I'm mostly talking about the Components

#

Not the Actors

#

It's runtime spawned Components that cause such issues

normal raven
#

Oh yeah?

thin stratus
#

If those are already Subobjects, then that's probably not the case for you

normal raven
#

Well I'm using actors currently

thin stratus
#

E.g. if you do UStaticMeshComponent* const NewComponent = NewObject<UStaticMeshComponent>(...); then that needs to be marked as NetAddressable and be stably named

normal raven
#

Riight

#

But isn't that the same thing if I want to link up actors that were spawned locally?

thin stratus
#

I haven't actually linked up Actors yet

#

Never really had to

normal raven
#

Gotcha

meager spade
#

we fake the actors

thin stratus
#

Ultimately they might follow the same rules though

meager spade
#

to make it seem like they existed on the level

normal raven
#

Kaos I really wanna know how you do that lol

#

Do you not get issues with based movement in multiplayer?

meager spade
#

no

normal raven
#

So you don't replicate. What faking are you doing then?
Can you give me the 1'000 " view version?

meager spade
#

we just set 2 options i think

#

on the actor

#

and ensure the name matches client and server

normal raven
#

Chunk->bNetStartup = true;
is one I guess

#

is SpawnParameters.NameMode = FActorSpawnParameters::ESpawnActorNameMode::Requested; the other one?

#

And then you're saying you don't need to enable replication, because the names are the same?

meager spade
#
        //These two bools trick the UE4 networking system into thinking this actor came from a level package.
        Actor->bNetLoadOnClient = true;
        Actor->bNetStartup = true;```
normal raven
#

So what is NetLoadOnClient for if you don't replicate?

meager spade
#
    SpawnParams.OverrideLevel = InLevel;
    //SpawnParams.Template = InTemplate;
    SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
    SpawnParams.bDeferConstruction = true;
    const bool bIsReplicated = InClass->GetDefaultObject<AActor>()->GetIsReplicated();
    APrefabRandomizer::ActorID++;
    //This keeps the name the same, so we can reference actors by a stable name, crucial to tricking the UE4 network system
    SpawnParams.Name = FName(*FString::Printf(TEXT("RNDPFI_%s%llu"), *GetNameSafe(InClass), APrefabRandomizer::ActorID));

    UE_LOG(LogPrefabricatorService, Warning, TEXT("Spawning Actor from class: %s, Chosen Name: %s"),  *GetNameSafe(InClass), *SpawnParams.Name.ToString());
    
    UWorld* World = InLevel->GetWorld();
    AActor* Actor = World->SpawnActor<AActor>(InClass, SpawnParams);
    Actor->SetActorTransform(FTransform::Identity);

    Actor->Tags.AddUnique("Prefab");``` we dont use chunks
#

but this is what we do to spawn the actor

#

client and server side

#

we are not chunks or w/e

normal raven
#

Wow, ok interesting

meager spade
#

but we have pre-designed buildings of different shapes

#

which fit in the map, randomly

normal raven
#

right

#

Nice, ok

#

Lemme get my hands dirty here

#

I'm assuming you don't have to do a lot of deleting and then recreating your actors? Otherwise you'd having naming conflicts?

meager spade
#

we also skip all replication of actors till all clients and server has generated the level

#

yeah like i said

normal raven
#

Ok yeah

meager spade
#

the level is created once

normal raven
#

Gotcha

meager spade
#

but the same concept applies for your chunks and stuff

#

you want them to exist as if they were loaded from the map

#

so you dont replicate 100's of actors

normal raven
#

Right

meager spade
#

needlesly

normal raven
#

That's very similar to my current approach

meager spade
#

if you can solve the naming issue

#

the rest is pretty easy

normal raven
#

Yeah the naming issue is solved now

meager spade
#

then its plain sailing

normal raven
#

Did that a few days ago

meager spade
#

as long as both client and server matches

#

its all good

#

just use bNetStartup

#

(tbh this is all you really need)

normal raven
#

Good news!

#

I was at that valley of despair right after the peak of mount stupid I think haha

#

Oh, sorry, we don't do GIFs in here huh? My bad

kindred oyster
#

hey, I try to rework my in item / inventory system. and have some problems. Its Uobject based. New Items loot are added and updated on client and server, but if I add more of the items it doesnt update the amount (i modify the quantity with a item base function)

kindred oyster
#

yeah

#

i have printed a string there, but no server or client prefix

sinful tree
#

What does the Modify Quantity function look like?

kindred oyster
#

its a function on the uobject item base

#

so it should update the item within the array

#

hm

#

wait

#

I ve printed the value

#

and it is correct

#

but the values on blueprint doesnt

#

wait

#

ok, the server holds the correct data but on client the quantity is not updated

#

my item array is a array of uobjects, it seems that changes on the items are not detected. Maybe someone has an idea?

devout sonnet
#

God damn. I call the function "spawn Cards" 1 time. I even put a print string in there to say hello every time its called. WHY is it spawning exponentially more cards every round?!?

#

NEVERMIND! Just playing around with the For Each Loop functionality..

narrow oak
#

hi

#

i'm working on a 3D inspection system where when the interact with the desired object, a new actor is spawned (spawn is not replicated) and then this actor set up a scene capture to only displays a set mesh on a ui along with some information about the object.

everything works fine in standalone but for whatever reason, no matter what i tried (is locally controlled, is locally viewed, switch has authority, is server, event that only happen on client, etc) the static new static mesh set for the spawned interactable after the interaction is always replicated on the ui.

i figured it was because the "get static mesh" node i get from the active interactable (that doesn't replicate either) from the static mesh component is set to rep notify by default but i don't know how to work around that.

any ideas?

#

I also tried "relevant to owner only and set the owner of the spawned actor to the player local player character

kindred oyster
#

is it uncommon to do a splitted interaction logic (for server / local)?

#

this way?

#

server interaction is for server stuff (items, inventory, stat base stuff) the local for client side (widget handling, npc dialogues, some effects)

torpid lantern
#

So I've traced my PlayFab headaches to a conflict with the Steam subsystem. Apparently if my dedicated server is running Steam online subsystem, it cannot be joined directly via IP.

So I need Steam OSS to be __OFF __for my dedicated server builds / instances, but __ON __for my game client instances.

On the client, I still want to collect the steam session token and pass that to playfab for authentication. But the server is using API keys and I don't need a steam token or ID.

This feels like a silly question, but is there a way to configure my builds to use different DefaultEngine.ini files depending on the target?

fossil spoke
#

If you want to connect to Dedicated Servers with IP, you need to turn off the Steam Socket Subsystem

fossil spoke
#

This will allow Clients to make IP connections

#

While still having Steam available

torpid lantern
#

Oh hell yeah!

fossil spoke
#

This goes into the DefaultEngine.ini

torpid lantern
#

Thank you Matt, trying now!

#

Should I still keep this DefaultPlatformService=Steam

fossil spoke
#

Yes

torpid lantern
#

and I can use the same DefaultEngine.ini both client and server builds?

fossil spoke
#

Yes

torpid lantern
#

Amazing, sounds like this is what I'm looking for.

eternal dune
#

Are line traces supposed to work on a server? I am calling LineTraceSingleByObjectType and it works on a client, but on the server it is returning false all the time

torpid lantern
# fossil spoke This will allow Clients to make IP connections

Ah dang, that didn't work. Unless I messed up my DefaultEngine.ini

The overlay still triggers on the client, which is good. But the client cannot connect to the server using open [ip]:[port]

If I set DefaultPlatformService to null and bEnable=false; then I can connect to the server via open level, but my steam overlay does not trigger on the client.

DefaultPlatformService=Steam
bUseSteamNetworking=False

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=<removed>
AppId=<removed>
ModDir=<removed>
Description="Pumpkins Game"```
fossil spoke
#

Attention to detail mate. Can you spot where you went wrong?

torpid lantern
#

squinting

#

No.

#

wait

fossil spoke
#

Look at the config code you just posted

#

Look at the config code I posted earlier

torpid lantern
#

I bet you could hear my head thump the desk from there. I put it in the wrong section.

fossil spoke
#

Right

#

Attention to detail

#

It matters

#

Easy mistake to make though. It happens

torpid lantern
#

I bet that would have taken me days to find otherwise too. Thanks again, re-deploying now.

rotund sail
#

so I have an issue where the character appears to rotate between two positions at once, resulting in this flickering. It appears on autonomous proxies, and I was thinking theres some sort of rotation setting conflict or smth but im unsure. any ideas?

mortal mica
#
else if (CharacterOwner->GetLocalRole() == ROLE_AutonomousProxy && IsNetMode(NM_Client))

Isn't the IsNetMode(NM_Client) check redundant in this case? Wouldn't the local role only be Autonomous on clients ?

mortal mica
torpid lantern
# fossil spoke Attention to detail mate. Can you spot where you went wrong?

Does sequence matter when setting bools in the config, or would capital letters throw it off?

I've tried this and it's still not letting me connect via IP while using Steam. Unless maybe my Advanced Sessions plugin is screwing with the (netdriver?)

DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bUseSteamNetworking=False
bEnabled=true
SteamDevAppId=<removed>
AppId=<removed>
ModDir=<removed>
Description="Pumpkins Game"```
fossil spoke
#

That flag set to False should disable the SSS and allow IP connections to be made

torpid lantern
#

I see this: GameNetDriver SteamNetDriver_2147482461 shut down

And then a few lines later I see this: SteamNetDriver_2147482371 bound to port 8080

Can I infer based on the difference in display names, that the game is shutting down one steam driver but then launching another?

Weird that I would even see any with that bool disabled.

fossil spoke
#

The NetDriver is a different thing to the Socket Subsystem

#

You should always have a NetDriver

#

So thats just saying that a SteamNetDriver was bound, which is good.

#

I wonder what happens if you set DefaultPlatformService=Null

#

Just so you are aware, you can have as many Online Subsystems enabled as you like.

#

So you can have Steam enabled without having it being the primary NetDriver

torpid lantern
#

I think steam stops working for client if I set that to null, but I will test.

Each deployment takes about 25 minutes for me.

fossil spoke
#

This allows you to do things like use EOS as the NetDriver but allow Clients to access the Steam Overlay etc

#
[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/OnlineSubsystemRedpointEOS.EOSNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="BeaconNetDriver",DriverClassName="/Script/OnlineSubsystemRedpointEOS.EOSNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")

[OnlineSubsystem]
DefaultPlatformService=RedpointEOS

[OnlineSubsystemSteam]
bEnabled=True
bUseSteamNetworking=False
#

This is our setup

#

EOS is the primary service

#

But Steam is enabled

#

We dont use the Steam Socket Subsystem

#

As we want to enable IP connections

torpid lantern
#

I feel like EOS is the next step, just trying to get PlayFab auto-scaling proofed before going that route.

fossil spoke
#

We have both Listen Server and Dedicated Server support, we use GameLift, but also have a PVE element that is Listen Server based and utilizes Sessions.

#

EOS handles Sessions for us and Gamelift is obviously Dedicated Servers.

#

The Redpoint Plugin is very much worth the money

#

I believe they also have a Blueprint plugin that exposes its features

#

But thats a separate Plugin

#

So you would have to buy both if you are stuck in Blueprint world.

#

If you can manage C++ then just the Redpoint EOS plugin is enough.

torpid lantern
#

I'm stuck in blueprint for now; trying to see how far I can get.

fossil spoke
#

Good luck.

#

Id be surprised if you can get Playfab working without C++

thin stratus
#

Weren't at least some of the red point plugins free if one doesn't need support? Can't recall

fossil spoke
torpid lantern
#

I think I am very close with PlayFab. I've got the REST calls connected for my player data, they have a BP plugin that helps with async management.

thin stratus
#

PlayFab in theory also has a plugin that allows it to work in BPs. But can't say it's a good implementation

fossil spoke
#

I cant remember if Gamelift had a Plugin. If anything all it did was wrap the API, not expose it to BP.

#

Its been so long

#

Since I implemented it

normal raven
#

Is a client side rename of an actor taking 27ms normal 👀

Might be a fluke, but man, why is it taking so long?

#

Most of the time it's half a ms, but sometimes it spikes. Might be more going on than meets the eye I guess.

torpid lantern
upbeat basin
torpid lantern
#

Match State Changed from EnteringMap to WaitingToStart that's the last state change that I see in the server logs.

Does the server need to be in a specific state to accept connections from IP?

#

I'm really feeling like this might be my advanced sessions plugin biting me.

fossil spoke
dark edge
dark parcel
#

Like if all dialogue doesn't have to be in sync and all the data it need is available locally without change then there wouldn't be a need for networking at all

rotund sail
# dark edge smells like blend space shenanigans

I ended up printing some of the aim offset values, and was using a version of the GASP. Its not really setup for multiplayer at all, and I didnt' realize that the client was setting the AO value as well as the server. I reoganized a little and voila, its working all fine now

upbeat basin
worthy oak
#

There is a local event that says “hey chest got open, here’s the inventory for your widget”

#

Another use, checking if the player is allowed to open a door or interact with this based on some logic. Which would be controlled by the server

solar stirrup
#

If not you probably flushed async loading

#

Which caused to it block

upbeat basin
#

https://pastebin.com/RPtsaLRY

I'm having problems on connecting to a listen server after, seemingly, successfully joining the session (OSS Steam) and successfully obtaining connection string. Pastebin includes server and client's logs related to network activity. I'd be happy to be pointed about anything that I'm failing to catch about either resolving or identifying the problem. Using 2 steam accounts on 2 different pcs on same local network right now. Changing subsystem to Null or client using the open <lanAddress>:<port> command works perfectly fine to successfully connect to the server

quiet fjord
#

Guys I have a problem, it turns out that I am doing a mechanic where my pawn controller is automatically moved towards a point but it turns out that only the server manages to do it fluidly and if it jerks when I execute it from my client it conflicts with the server and the movement He does it with jerks, how do I fix that?

upbeat basin
hidden turtle
#

Is anyone able to help me with setting up multiplayer on lyragame for steam?

shrewd ginkgo
#

I need an is impostor bool to be randomly selected like among us and stored in ThirdPersonBP how can I do that.

shrewd ginkgo
#

right now this is how I spawn players in gamemode when they enter the map

shrewd ginkgo
quiet pulsar
#

doesnt have much programming knowledge but i guess it would make sense to get a random player from the AllConnectedPlayers array and then set its isImposter bool to true

quiet pulsar
#

Hi All
I was following a tutorial on inventory systems. When i drag an item from inventory to the world, spawning of that item actor is done inside character bp. (https://youtu.be/8HGAoXRsQCI?list=PLV98WIslM9wsH20l2UxDQJUDStPT-ImlM&t=1289 Tutorial Timestamp)

is there any other way i can do this without putting the spawning code inside character bp. Can i put that code inside game mode and call it maybe?

Hi All and welcome back to episode 18 of our Multiplayer replicated inventory component in Unreal Engine 5. The Purpose in doing the inventory as a component is that we can easily add it to any character or project we like in the future!

If you are new to the channel and like the content please like and subscribe :) And as always let me know i...

▶ Play video
normal raven
soft relic
rain condor
#

Is secure to pass uobject from widget to widget on multiplayer??

thin stratus
#

Widgets are local only, so that should be fine

signal geyser
#

Hi everyone! Is there a way to set an actor to replicate (or not) at the time of spawn?

shadow aurora
#

Weird question but does anyone know if there's a way to DC from an instance without closing the connection? Got an interesting case where it looks like a player has somehow managed to do that... I've got two logins (one initial login, and one login later) with seemingly no disconnect in between. Dude said he crashed but I've never seen a connection remain active after a crash 🥲

thin stratus
#

Nope, not out of the box. iirc needs Engine modifications that no one has ever done yet.

thin stratus
signal geyser
thin stratus
tardy fossil
#

using the photon sdk and a custom netdriver, you can do the first step of host migration, selecting a new host when the current one leaves and have everyone connect to the new host.. but it's photon only

rugged sandal
#

if that is not critical for your case, then both would work equally fine for you

signal geyser
#

But begin play isn't called anyway, especially if you're setting things in the same frame as spawning the actor

rugged sandal
# signal geyser But begin play isn't called anyway, especially if you're setting things in the s...

I don't think that's correct.
According to the actor lifecycle diagram here https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-engine-actor-lifecycle
When you call SpawnActor. it will go through the whole chain of calls up to BeginPlay, before returning from the SpawnActor call and proceeding to the next line of your code, and with SpawnActorDeferred, the call chain will stop after AActor::PostActorCreated, and will return control to your code, where you'll need to call AActor::FinishSpawning for it to pick up from where it stopped and proceed to run construction script, initialize, BeginPlay, etc for the actor

Epic Games Developer

What actually happens when an Actor is loaded or spawned, and eventually dies.

#

but if you set the actor to be replicated in the same frame as spawning/finishing spawning it, I think effectively there will be no difference for your case from client PoV

signal geyser
dusk fable
#

quick question , when making an MP game , is it better to test it on standalone mode or listen server mode ?

grizzled stirrup
#

It's usually much faster to test in PIE with listen sever

#

If you are planning on making a dedicated server game though you'll need to test differently

dusk fable
#

no , just player hosted

#

because sometimes i have things working in standalone , but not in listen server and vice versa

#

and got confused on which mode wld be suitable to test as accurate as possible

grizzled stirrup
#

As accurate as possible would be separate dev packaged builds

#

But in general things work the same in PIE listen server especially if you use separate process (but I find most things work fine even without that)

dusk fable
#

got it , thank you

solar stirrup
eternal dune
#

Does anyone have any idea why a line trace would generate a hit when run on a client but not when run on a server? The object that should be hit is placed in the editor and is replicated. The line traces are using the same start and end coordinates according to my debugging. But the server line trace just always returns false

ocean geyser
#

question regarding the fast array serializer, when it says "the order of the list is not guaranteed to be identical between client and server in all cases", is there an example of what cases might make the order become out of sync between the clients and server or can just general use cause it

eternal dune
#

From reading the code I think just general use can cause them to get out of sync

ocean geyser
#

balls

#

ty

twin juniper
#

It's useless to keep the order in most cases when using fast array anyways, like for an Inventory, you will generally do the sort client side in the widgets (sort them alphabetically or per categories etc)

#

but if it's really needed you can just have an index stored in the entry

ocean geyser
twin juniper
ocean geyser
# twin juniper You need to keep order for what ?

make ui bindings simpler. basically delegates that fire off when an item is added/removed and to make life easier just have it contain the item data and the index of which to modify in the UI (such as add a thumbnail to a specific box or remove it based on index)

twin juniper
#

my items have a FGuid for that

#

and for my QuickBar i have a simple array of struct that have the ItemGuid and SlotIndex

ocean geyser
twin juniper
twin juniper
#
void FLyraItemList::PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
{
    for (const int32 Index : ChangedIndices)
    {
        FLyraItemEntry& ItemEntry = ReplicatedEntries[Index];
        check(ItemEntry.PreviousCount != INDEX_NONE);

        if (ULyraControllerComponent_Inventory* InventoryComponent = ItemEntry.ParentInventory.Get())
        {
            if (ULyraItem* ItemInstance = InventoryComponent->FindItemInstanceByGuid(ItemEntry.ItemGuid))
            {
                bool bItemChanged = false;
                bool bAmmoChanged = false;

                // See if Count changed
                const int32 CountDelta = ItemEntry.Count - ItemEntry.PreviousCount;
                if (CountDelta > 0)
                {
                    ItemInstance->ItemEntry.Count = ItemEntry.Count;
                    bItemChanged = true;
                }

                // See if MagazineAmmo changed
                const int32 AmmoDelta = ItemEntry.MagazineAmmo - ItemInstance->GetMagazineAmmoCount();
                if (AmmoDelta > 0)
                {
                    ItemInstance->ItemEntry.MagazineAmmo = ItemEntry.MagazineAmmo;
                    bAmmoChanged = true;
                }

                // If anything changed, tell the client
                if (bItemChanged || bAmmoChanged)
                {
                    ItemInstance->OnItemChanged.Broadcast(bItemChanged, bAmmoChanged);
                    InventoryComponent->RecentlyChanged.Emplace(ItemInstance);
                }
            }
        }

        ItemEntry.PreviousCount = ItemEntry.Count;
    }
}
#
USTRUCT(BlueprintType)
struct FLyraItemList : public FFastArraySerializer
{
    GENERATED_BODY()

    bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParams)
    {
        return FastArrayDeltaSerialize<FLyraItemEntry, FLyraItemList>(ReplicatedEntries, DeltaParams, *this);
    }

    UPROPERTY(SaveGame)
    TArray<FLyraItemEntry> ReplicatedEntries;

    UPROPERTY(NotReplicated)
    TArray<ULyraItem*> ItemInstances;

    ........
#

that's an example @ocean geyser

#

But yeah before that I was just sending the guid and fetching the item in widgets directly but it's not a big deal and just more code for nothing.

ocean geyser
dark parcel
eternal dune
dark parcel
#

Net pkt lag in console command

eternal dune
#

But I can sit still while next to the object and it never will be found no matter how long I wait

dark parcel
#

Is the collision settings the same in server machine?

#

Make sure the channels can be traced against in server machine

eternal dune
#

How would I check that? The only settings I know of are on the object properties

dark parcel
#

You can print or log it . You should get server:
Or client:
With print string

#

Though if you never change the collision settings anywhere, that's most likely not the issue

dark parcel
kindred oyster
#

Hey, I'am about some Basic rework of my Item / inventory and Interaction System. Through some dialogues with people here, I will rework my complete Interaction System to Work Serverside ( after pressing a Key IT calls Server Events that handle Interaction stuff) because IT seems better for the Most cases. But I also have some Interactions that Open Widget Menus, and I struggle with Handling this Kind of stuff. Because it relates only the Client that is interacting and I don't know how I should Display the Widget for this specific Client. maybe someone has a Tip or food for thought?

shrewd ginkgo
#

I need an is impostor bool to be randomly selected like among us and stored in ThirdPersonBP how can I do that.

eternal dune
shrewd ginkgo
#

right now this is how I spawn players in gamemode when they enter the map

kindred oyster
#

One Idea that I have is to make two Interaction (Interface functions, one call in Server and one call local) but I don't know If this is a legit way

sinful tree
# kindred oyster Hey, I'am about some Basic rework of my Item / inventory and Interaction System....

You may not need to do everything server side. Seeing as widgets are entirely client side, there's no reason why you couldn't have a client interact with something that then displays a menu. The only time where it may need to be done on the server is if the interaction itself changes something with the gameplay that you want to ensure that the player is allowed to do, and/or needs to be replicated to everyone else.

As an example, I personally wouldn't care if somehow a "dead" player tricked the system to be able to speak to a character and read the dialog it has there. I would care if the dead player were able to choose an option in that dialog that unlocks a door. I could easily make it so that any gameplay related logic would need to be RPC'd to the server and the server can then verify if that player is able to make that action.

#

tldr: you design it so that the widgets will show as you need them and when the conditions for them are met based on what values the client has. Any important choices would require an RPC to the server of some kind indicating the choice made, and the server can validate if the player can make that choice and then replicate and do whatever else is needed from that choice.

kindred oyster
# sinful tree You may not need to do everything server side. Seeing as widgets are entirely c...

Yeah Actually I make the interaction localy but it seems laborious in most of cases where the server should handle stuff (loot, actor changes, spawning actors...) Showing Widgets are rather rar, there will be npc dialogues but actually not planned to be gameplay relevant. The Problem of actual Server Side Interactions for this Actors are that within the Actors I cant send Server RPC because the Client isnt the owner, so I send it to PlayerController or Character with Actor Reference and handle the Server RPC there. With the Interaction System Handled by Server this is much better. Visuals can be sended through multicast or repNotify. Or With my Idea I can setup Interaction Local for some pure cosmetic or widget based stuff

#

A other idea is to set the widget by the server and send a change for display the widget which is loaded with bool repnotify

sinful tree
#

You build a component that you utilize on your player controller that performs the interactions. You make the RPCs generic. All the data about the interactions can be replicated from the actors that you want to perform interactions with. You'd send RPCs through the component with reference to the actor you're interacting with and the interaction you want to perform.

kindred oyster
#

ok, a interaction controller that handle it

#

how relevant is the point where I send the Server RPC? for Latency?

kindred oyster
#

right?

sinful tree
sinful tree
eternal dune
#

Ugh. I reverted and am now back to a previous problem. Objects placed in the editor don't have an owning NetConnection. I can't remember what I did to solve this

#

Oh wait! I had to adjust where some code ran.

#

Make sure it ran on the server instead of the client

normal raven
kindred oyster
sinful tree
# kindred oyster So, the Interaction Interface is on the Actor I want to Interact. On Interact Ev...

If your intention is to have a system where you just press a button and it starts interacting with something in the world and that opens a door, widgets aren't really involved. You'd only need a simple system for something like this. Input > Get Actor To Interact With > RPC To Server with Actor > Server calls interface on actor.

It's a bit more complicated if you're throwing widgets into the mix. If you want to have a mix of both systems, where you want to dynamically choose whether a widget is shown or not, then you'd have to have some means for the client determine if a widget should be shown, so then you'd need to define some information about the available interaction that could take place, and then your interaction system would look more like:
Input > Get Actor To Interact With > Interface with Actor to get Interaction Information > Decide based on interaction information if action should immediately call an RPC or show a widget

kindred oyster
#

yeah thats something I also think about. for example I have an Interface Option where I can choose if Interaction prompt is shown or not

#

so I can say has "server rpc or local"

#

thanks datura, you help me alot

kindred oyster
charred island
#

I have a semi-client authoritative model for my physics drive spaceship pawn where I am essentially trusting the client's simulation within a margin of error. Right now this is happening by naively copying the transform from the client to the server (as well as linear velocity). This works, but I get the jitter seen here when viewed from another client (remote ship is visible in the left window). Is this because of variations in the timings of when the server receives/processes the transform copy?

gritty warren
#

In some talk many months ago (maybe even last year), I asked an epic person about the physics control component and replication. I distinctly remember a response that it should be possible.

I was wondering if anyone has heard of or knew about resources relating to the replication of the physics control component, so that physics can be simulated and at least roughly in sync? 🤔

#

(looking at it as a solution for recoil)

gritty warren
#

Not sure how much different it is

charred island
#

well, it's specifically an article on getting physics based pawns to sync properly, with several WIP methods of doing that

gritty warren
#

That's why I'm hoping someone somewhere has some kind of info on it

charred island
#

I messed around with it a bit, but couldn't get it to behave well

#

this article is also very useful

#

I implemented that and it kinda sorta worked, but I will still getting positional desync at times

gritty warren
#

oh, that does seem good

#

definitely getting there

charred island
#

do keep in mind that it's a WIP tech for the engine

gritty warren
#

I probably need to learn more about the physics control component itself also, maybe if I keep reading on both ends that I will eventually get something to click

charred island
#

so hard to know whether it's you that's the problem or the engine

#

for my purposes in my space sim, it wasn't responsive enough, and also was not preventing desync reliably

gritty warren
#

yeah that makes sense

#

and you're talking about the Physics COntrol component specifically?

charred island
#

No, I'm just referring to the stuff in the article.

gritty warren
#

oh I see

charred island
#

if you're just trying to model recoil it might be overkill

gritty warren
#

if I can get it working, it'd be significantly easier than animating all that stuff myself lol

#

I am going to do it procedurally via control rig otherwise

#

but it's just a bit difficult to make it look really nice that way

charred island
#

is there any way to give a client authority over a specific actor's simulation?

kindred oyster
#

someone here that worked with uobject based item / inventory and replication?

rain condor
#

I have a toggleinventory func on player controller and i get the error "only local player can be assigned to widget" when i tried to open the inventory on client window

torpid lantern
# torpid lantern No luck, setting `DefaultPlatformService=Null` just breaks the steam connection ...

In the interest of sharing learnings, my netdriver problem was the result of using wrong double-quotes in my DefaultEngine.ini

I was using:
+NetDriverDefinitions=(DefName=“GameNetDriver”,DriverClassName=“OnlineSubsystemUtils.IpNetDriver”,DriverClassNameFallback=“OnlineSubsystemUtils.IpNetDriver”)

I should have been using:
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

fossil spoke
#

You are connecting with IP now?

#

With Steam enabled

torpid lantern
#

Yup! Your suggestion of using bUseSteamNetworking=false was what I needed to do, but I guess the snippet that I copied from somewhere was using the wrong quotes.

Server is using IpNetDriver and Client can connect to PlayFab container instance using IP, and client also has Steam overlay. Thanks again.

#

Your earlier comment about attention to detail couldn't be more true. I want to say I'll learn and do better, but I feel like this is going to be a recurring problem for me.

eternal dune
#

Yeah, OK. Making my object interaction run on the server is what unconvered the bug where the server doesn't find the object to intereact with

fossil spoke
eternal dune
#

OK! I know why the line trace is failing on the server. It's starting and ending locations are wrong. It's like it's never moving from the initial position. Let me guess: cameras on the server don't move, do they? I'm starting the line trace from the position of the camera because I want interactions to be focused on what the player is looking at.

torpid lantern
eternal dune
#

I turned on replication for all components, and now I can see the server line trace coords are changin, but they still aren't the same as on the client

#

Yep. I changed from using the camera location to using the pawn's eye location as the starting point of the line trace and now it works. Lesson learned

terse karma
#

hey guys back again with another probably simple question that i cant find an answer or info about. Im trying to end a match ( free for all) when a player reaches a set score. Im just not sure where to place the logic or the entirely sure how to go about it. Do i place that in the game state and trigger it when a player state reaches desired score ? ive tried creating a custom event in the game state and calling it when any player state reaches score and using the player array to loop through and just do a simple print string but it doesnt seem to function on all only on a connnected client

terse karma
#

are you calling it locally ? on the player that owns the widget? widgets arent replicated

#

becasue the replicated actor OWNs the copy of the widget. its a unique instance of it for each player

#

its created for that client

#

where is this created ?

#

no authority should only do it on the owning client

#

you have to call a multi cast from the server to act on all

#

because the server owns it youd have to set ownership to the client . im new to multiplayer but my understadning is a client cant change something on the server if it doesnt own it

#

that im not sure. sorry man hopefully someone else a bit more knowledegable can chime in and help. i dont want to provide you with bad information.

#

have you plugged a print string into the cast failed pin to see if its failing to set the owner?

torpid lantern
#

So your actor owns the widget, and the server spawns the actor.

You need to get a message to the client they they need to do a thing with their version of the widget. Maybe the server can send a multicast to all of those actors, who can do a thing with their widget.

#

Unless I misunderstand your issue.

boreal scarab
#

I have some questions about game servers vs p2p and what I should use with ue5

  • Are people who choose to go on steam just hosting their own game servers and using steams API for them? Or are they just opting for steam's p2p?

  • Is it even possible to integrate steams p2p as your connection solution in ue5?

  • Can you go on steam and just bypass their whole networking thing altogether and use EOS with either a listen server or dedicated one?

My game is simple. It just spawns 2-player competitive turn based matches that last 5-15 minutes a piece. I really don't want to do P2P because I don't want to subject people to easier cheating and/or IP address leaks. But I really am just at a loss for which direction I should even start heading, the more I read the more lost I get lol

fossil spoke
#

There is no actual P2P in the context of Clients connected to Clients

#

There is only ever Dedicated or Listen type servers.

boreal scarab
#

Yeah I realize that but steam has their own P2P solution

fossil spoke
#

Thats just the Socket Subsystem. Its just how traffic is managed.

#

Focus on wanting either Dedicated or Listen Servers.

#

P2P really has little to do with that choice.

#

You absolutely can host your own Dedicated Servers and have them discoverable through Steam

#

Its basically the same process as if you were doing Listen Servers

boreal scarab
#

hm.. okay. Would a "listen server" then count as a dedicated server from steams PoV?

fossil spoke
#

A Server is a Server

#

Steam doesnt care.

#

Steam is just a mechanism for connecting people.

#

Same as EOS

#

You connect people together via Sessions

#

Those Sessions just facilitate the discoverability of Servers

#

Either Dedicated or Listen

charred island
#

is there any build-in method of using the unreal replication system for a client-authoritative pawn? (that gets replicated to the server)

boreal scarab
#

okay.. sorry I'm pretty ignorant on this topic so thanks for educating me.

If I go with a listen server, and then steam sees that as a dedicated server, then players on mobile which don't have steam installed would be able to play with players on PC with steam installed?

If so I'm a little confused on what the value of integrating with steams networking APIs are at all in that case

#

I'm so lost on the end to end integration, is there a good place to learn this stuff haha?

#

I don't think I even know what I don't know

#

All the videos I've found are like "How to add multiplayer with steam!" and they just pick one. I don't see anywhere that explains the difference between UE5s listen/dedicated server and how that relates to p2p vs dedicated servers and what the implications are for each, their discoverability across platforms, etc etc.

fossil spoke
#

@boreal scarab You should check out the Redpoint EOS Plugin.

#

It manages cross platform play really well.

#

EOS is designed to allow cross platform, which is what it sounds like you want.

#

Also, a Listen Server is a Player

#

So you want a Player on PC with Steam to be able to host for Clients on Mobile? Is that right?

boreal scarab
boreal scarab
fossil spoke
fossil spoke
boreal scarab
#

"Ignore" I think is the better term heh. I'm looking at steamworks documentation and they have a section on steam networking. I wasn't sure if I launch on steam, and take advantage of other parts of their api, if I would also have to hook into their networking apis

fossil spoke
#

Ignore Steamworks

#

Its abstracted away from you in Unreal

#

Via the OSS

#

Again, Redpoint Plugin takes away all of the guesswork especially with Steam.

boreal scarab
#

ohhh! Okay that's huge, I didn't realize that Redpoint had steam integration capabilities built in

fossil spoke
#

It doesnt necessarily, it utilizes the Unreal OSS for Steam

#

OSS = Online Sub System

#

Steam has an OSS

#

Facebook has an OSS

#

Occulus has an OSS

#

etc etc

#

These are Unreals abstraction layers around things like the Steamworks API

#

So that its generic

#

To work with in Unreal

boreal scarab
#

So how does stuff like.. achievements and trading cards and store presence and stuff like that work? All that kind of stuff is there too?

fossil spoke
#

Depends on the OSS

#

Sometimes they dont have all the features implemented

#

But Steam Achievements certainly work

boreal scarab
#

I see, so redpoint just has an abstraction layer with an interface and if the platform you're working with implements it then it'll work

#

i'm sure that's an oversimplified explanation but hopefully mostly correct heh

fossil spoke
#

Go and read their documentation, it might make more sense than me trying to explain it

boreal scarab
#

okay will do. Thanks a lot!

boreal scarab
#

Which linux distro do people use for deploying and running their game server binaries to? CentOS? Debian? Ubuntu?

wet bridge
#

Hey, is there much performance difference between calling a multicast rpc and just calling each client rpc independently?

#

From the server if not clear

short arrow
#

Try not to overthink it

wet bridge
chrome bay
#

There is potentially additional serialization cost

#

But I doubt any perf difference will be measurable. Just use the most appropriatte one.

shrewd ginkgo
#

I need an is impostor bool to be randomly selected like among us and stored in ThirdPersonBP how can I do that.

#

right now this is how I spawn players in gamemode when they enter the map

neon summit
#

There's probably alot of different ways but getting a random index for array of your controllers probably the best and store in playerstate?

soft relic
#

anyone knows how to make this work on clients? From what Ive seen, it sounds like you need to directly edit the cpp code of the engine

soft relic
#

seems like this fixed my issue

neon summit
rain condor
#

I have a toggleinventory func on player controller and i get the error "only local player can be assigned to widget" when i tried to open the inventory on client window

dusk fable
#

maybe try "is local controller " if it turns "yes" toggle inventory if Not , do nothing

dark edge
dark edge
#

what does the inventory widget do when toggled?

dark parcel
#

@rain condor how do you create the widget?

#

i have a feeling that's where you pass a non locally controlled PC as the owning widget or something

rain condor
#

I created on player controller too

dark parcel
#

show code

#

damn, was scouring internet and holy moly

rain condor
#

I saw that hahah

rain condor
dark parcel
#

How is Create Container called?

#

whos calling it?

rain condor
#

I called it on spatialInventoryWidget

dark parcel
rain condor
#

I was looking for that part

dark parcel
#

you are passing player controller variable here

#

how is it set?

#

and why do you have a pointer to a player controller?

#

seems weird, you should always just get the local player controller

rain condor
rain condor
dark parcel
# rain condor

Where is this bp? what is the base class it's derived from?

dark edge
#

What class is this code in?

rain condor
dark edge
rain condor
#

On player controller

#

At begin play

dark edge
#

show it

dark parcel
#

getting there 🤣

rain condor
dark parcel
#

Controller begin play is already fishy enough, understand that servers have copies of every client controller

#

ok that's the issue

dark edge
#

needs to run only on owning client

rain condor
#

So i have to created on toggle inv func?

dark edge
dark parcel
#

Just have Is Locally Controller check, on true, follow through with your logic

#

if you have 3 players, your server essentially made 3 inventory widget in his machine with your previous logic

rain condor
#

There we go

#

Thx guys

gaunt apex
#

Hey guys I got a strange problem: I am not able to connect to a server map on a linux server from Unreal Editor. If I make a Windows build everything is fine. The error message in editor output log

eternal dune
#

Does BeginPlay not run on Servers? I've got an Actor item in my level, and according to my log messages it's BeginPlay is only being called on clients, not on the server

eternal dune
#

The first print string prints, but the second one does not

#

This is on an ActorComponent that defines item properties, for what it's worth

#

ACK! No, it's on an Actor. It sets a value in a component, though

#

I'm trying to set the value only server side and have it replicate down to the clients

#

So what about my basic question: Does BeginPlay run on servers or not? An internet search says "yes" but my testing says "no"

#

If it is supposed to run on servers then I know I need to dig deeper

dark edge
eternal dune
#

In the Output Log

surreal fox
#

Can we make matchmaking system like PUBG, Fortnite but with the listen server?
Like making the first guy that we found a host and other a client. Also is it possible to switch host when the actuall host leave the match?

narrow fog
#

I have a Board that consists of Grids made up of Tiles, which can host CombatUnits. From the GameMode, I have the server setting up a Board for each player with variously positioned CombatUnits. The player can then pick up and move the CombatUnits to a different Tile (which happens only for the autonomous proxy). Once time runs out, the next phase begins and the units are given AI, which puts them back to their original positions before beginning combat. Ideally, the updated unit position would be seen even when done by a simulated proxy, and the unit position would persist through the combat phase.

The CombatUnits, their reference to their Tile and vice-versa are all replicated, as is the hierarchy from Tile through Board. There's clearly something I'm having trouble wrapping my head around

kindred widget
tardy quarry
#

Hello, does anyone know if it's possible to run an AIController on clients? I'm looking to stand-up a load testing framework where I can launch dedicated servers in the cloud and then spin up headless clients that connect to these servers and send inputs over the network the same way a player would. The launching of the dedicated servers, matchmaking, etc isn't the issue. It's having a client that can be scripted to send inputs over the network, or in other words an AI that isn't server controlled but client controlled.

dark edge
tardy quarry
dark edge
#

I would probably start with a component that can be placed on a playerController.

#

The first problem is to figure out if calling or emulating inputs is possible.

#

If it is then there's no reason a component on playerController couldn't spoof a player.

dark edge
tardy quarry
#

Yea ok maybe this isn't as novel as I was making it out to be. I had first imagined a custom player controller (or component that lives on a player controller) that would just do something silly like execute a server RPC at some cadence. That's a version of a client-side controlled bot. Easy enough. Next step is figuring out the best way to iterate on that logic that dictates when to call said RPC and do other interesting behaviors, and I think state trees or something similar are the answer there. Thank you for your input @dark edge it's much appreciated!

shadow aurora
#

Having a bit of a brain fart moment, any suggestions on how I can make an actor that I'm spawning via SpawnActorDeferred invisible on clients until I send down an RPC later?

kindred widget
winged badger
#

They can also be invisible by default.

eternal dune
# dark edge where are you seeing the prints

Well whack me upside the head with a wet noodle. You were on the right track.. For some reason my "print string" calls were printing the to screen, but as far as I can tell, not to the output log. I'm getting BeginPlay running on the server after all.

#

But now I have to wonder why the initial value being set in BeginPlay is not being replicated. I suppose formal replication won't happen because BeginPlay on the server will run before the Actor is create on the clients, but why would the initialized value not be set on the clients? That's the underelying problem I'm trying to solve. On the server I NewObject create the InvItem property in BeginPlay, but on the client that property remains unset until I do something on the server that updates it's value. Then I see a log message from OnRep_InvItem

surreal fox
winged badger
#

The NetTick happens later during the Tick, so even if the Actor is replicated the very same frame it was spawned in on server, that will still hold true, and as new replicated value was set before the packet to instruct client to spawn that Actor is sent, it will always, without exception work.

eternal dune
#

I'm onto something. I had changed some of the interaction code and I just realized I had not updated the UI components that call it. Working on that now. Seems they were calling the wrong function

#

It's never what you think it is

kindred widget
twin juniper
#

When i pay 100$ to steam i have to name my game right lol?

winged badger
#

im fairly sure you're allowd to rename it later

eternal dune
#

Yep! The problem was in the interaction UI widget. Everything else was a red herring that led me astray.

Onward to the next bug!

twin juniper
#

?

#

stop pinging people for stupid emojis

dusk fable
#

------------------------------3D widget issue :
i set up a 3d widget in lobby , when the host is alone in lobby , he can interact with the widget , but when another player joins , neither of them can interact with the widget

#

or is there a way i can make the 3d widget interactable by every player ?

dark parcel
#

You have to enable widget interaction component on player that wants to interact with the widget

dusk fable
#

yeah , i did that

#

but the main issue is that , clicks are not registered

#

the widget has level button list , that any player can chose from to start the chosen level , as i said if the host is alone , he can interact and the clicks on the widget are registered , and it shows the chosen map , but once another player joins , neither of them can interact with the widget

edgy helm
#

Hi guys, sorry but newbie question. Help appreciated. In a packaged game hosting and joining worked… once. Never again. Tried all troubleshooting steps (VPN, changing port, changing firewall).

dark parcel
proven pagoda
#

I only have 2 PCs and it works fine there, I have yet to have a third person connected via steam to see what happens to a client rehosted as a client again

gray blade
#

anyone know why this displays 0/4 players in the server browser? (before anyone says it im switching to steam subsystem this is a prototype)

#

I also can the listing and cannot join level despite the the on succsess firing

#

nvm I needed to ?listen in options

fringe dove
#

What's the right way now to disable steam when using editor builds?

I used to have steam configured in Project/Config/, and then overrode things to disable it in Saved/Config/; that way when I did a deployment I didn't accidentally disable steam, but I could toggle it through the project Saved. Now some time from 5.0 on editor launches are wiping out custom changes to Saved/Config/WindowsEditor/Engine.ini for me.

#

What I had before in the Saved/ engine ini was:

; append this to Saved/Config/WindowsEditor/Engine.ini to disable Steam subsystem for editor without screwing up packaged builds

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName="DemoNetDriver",DriverClassName="/Script/Engine.DemoNetDriver",DriverClassNameFallback="/Script/Engine.DemoNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Null

[/Script/OnlineSubsystemUtils.IpNetDriver]
ConnectionTimeout=6000.0
InitialConnectTimeout=6000.0

[OnlineSubsystemSteam]
-bEnabled=true
bEnabled=false

[PacketHandlerComponents]
!Components=ClearArray

[OnlineSubsystemSteam]
bEnabled=false
#

and I think before UE5 it was in Saved/Config/Windows instead of Saved/Config/WindowsEditor

outer sphinx
#

Hello how are you? Question: I use this method to change the speeds of my character. I was thinking of doing it with rep notify, it's more efficient, isn't it?

gray blade
solar stirrup
#

That will cause rubberbanding

gaunt apex
dark parcel
charred island
#

are there any special considerations for drop-in multiplayer vs a lobby where all clients get servertravel'ed at once?

fossil spoke
charred island
brittle ledge
charred island
gray blade
#

anyone here expierenced with steam subsystem, is it normal on the same machine with two instances to not be able to connect?

neon summit
gray blade
#

also it says my ping is 9999

fossil spoke
#

You cannot test Steam on the same machine

gray blade
#

ok good to know

dark parcel
gray blade
dark parcel
gray blade
#

at least it sorts geographically i guess

modest crater
#

@dark parcel who dis

dark parcel
#

Wut @modest crater

modest crater
#

|| you changed your pic didnt you? Laura in disguise PepeHmm ||

dark parcel
#

Maybe she will come back one day if we establish red panda sanctuary

#

Need the 🐐 back

surreal fox
open aurora
#

Hi, im having trouble seeing my server i created on my pc from a different one. Must be a firewall issue, right? because it works within the editor

shrewd ginkgo
#

these ones in gamemode. IsSus bool in third person bp.

#

this is in thirdperson bp

#

this one gameuı

#

I randomly select the killer among 4 people and when I print it in third person character, it gives 3 false 1 true, but when I write it on the screen with ui, it writes false in everyone. what is the reason for this.

#

is something wrong about my choosing system

molten parcel
#

is there any built in way to compensate for projectile firing lag?

#

i want to spawn a projectile immediately for a player with high ping

#

i want to learn client authoritative multiplayer how do i accomplish this?

#

basically from my understanding the server no longer will check if you're in the right place, or check if you have ammo or health, it's up to the client

proven pagoda
#

Even tho it's written in C++ the whole plugin is designed to be used entirely in BP. I struggled with getting it to work properly when I was trying to implement it in C++

#

It's rather easy to set the basics up, and then it comes with a bunch of util functions for polish design with it not just the basics

lost inlet
#

the author of that never heard of subsystems?

proven pagoda
lost inlet
#

this is a common pattern, though I don't know why you needed to rush to that plugin's defence

dark parcel
#

I don't see a reason to force user to change their GI to theirs one tho

#

when the author could just make a subsystem

lost inlet
#

though that single PDF does make ask questions, like how does it pick the new host? the saving is a little manual, but I get how that part works. it just makes a save game and sends the data over multiple RPCs to the new host

violet sentinel
proven pagoda
shrewd ginkgo
#

I want to sort the server rows I created from top to bottom according to their pings and number of players with different buttons. I can search their names but I thought it was not enough.

lost inlet
#

ah it's just ping, but curious that it picks the host that is closest to the average ping rather than the player with the lowest ping

shrewd ginkgo
#

how can I do that

lost inlet
proven pagoda
#

This is the start transfer

surreal fox
surreal fox
proven pagoda
#

He does have 2 void delegates he did make in C++ tho. HMS_PreSaveActor and HMS_PostLoadActor there are BP events inside the Migration Interface Component that you can handle BP logic when it saves data and when it loads after migration

#

or you can bind callbacks to the native versions if you need presave and post load native functionality

surreal fox
tardy fossil
#

if the server spawns in a non replicated Level instance actor (not placed in map) and the level instance has actors marked as replicated and net load, will they spawn for clients without the actual level instance actor data being replicated?

proven pagoda
woeful ferry
lost inlet
#

a save system that can pick a new host

woeful ferry
#

this part is pretty weird

lost inlet
#

and send the save state to that new host

#

which is just serialise it like a save game, compress the raw buffer, and send that in chunks using RPCs

#

it'll reload the map though since it'll have to travel

woeful ferry
#

the multiplayer support for most plugins are atrocious

#

usually just a bunch of multicasts for data

#

or set replicated vars on both server/client

lost inlet
#

this one sorta makes sense but it's not as seamless as it makes out

#

it'd be impressive if it managed to do it without a hard travel

woeful ferry
#

yea, was just speaking about plugins in general

lost inlet
#

oh yeah, I'm sure the BP-only slop that's regularly featured in the free for the month category is even worse

woeful ferry
#

save systems made in BP is my worst nightmare

#

the complications people go through by not using reflection

charred island
#

I have a multiplayer game with a steam session. When I host a server on one client, and another client joins, the host can see the remote client move, but not the other way around. Is there something I need to do to configure the remote client to receive updates from already loaded pawns?

charred island
#

(for clarity, this works fine when I start 2 clients in the Listen-Server netmode in the editor. it's only when I launch two standalones and then host/join through steam)

scarlet summit
#

Good day to one and all!
Who has dealt with the problem of launching the game through PIE which connects to a dedicated server? (Dedicated server is built).
Who solved this issue on Unreal Engine 5.4.2?

#

The problem is that when trying to connect via PIE to a dedicated server, the connection between the client and the server is broken (kicks the player).
If you build the client part, then connection to the dedicated server without problems.

#

Or if I disable replication of some moments, it connects via PIE to the dedicated server (built dedicated server) without problems.

scarlet summit
#

anybody?!

thin stratus
#

So just uproject file rightclick launch game

thin stratus
#

Package the client or at least only use standalone

charred island
scarlet summit
scarlet summit
thin stratus
#

You usually test PIE dedicated server by just setting it to Play as Client

#

If you package the server you should also package the client

scarlet summit
#

Absolutely, but I have a DSS plugin that does not allow this feature to be tested as a Client

#

On version 5.3.2 I had Unreal editor crashing, in 5.4.2 kicks the player without crashing the editor )

#

The test runs on a clean project

lament flax
#

what is the rep COND that reps only once and only for owner ?
i only found COND_InitialOnly whichs doesnt keep it to the owner, and COND_InitialOrOwner thats does something i dont fully want

latent heart
#

Can you even have a non-reliable variable?

lost inlet
#

no

#

that's just RPCs

latent heart
#

That's what I thought.

#

And the whole point of unreliable rpcs is that they don't get sent again until they are acknowledged. They're just lost if they get lost.

magic vessel
#

Running into a problem with client travelling

[2024.07.12-21.02.15:948][554]LogSpyderweb_EOS: Display: Client Traveling to [EOS:000203cba214457ba8dd2640935427fa:GameNetDriver:26]
[2024.07.12-21.02.15:948][554]LogSpyderweb_EOS: Display: On Join Session complete - Client Travel Successful
[2024.07.12-21.02.15:949][555]LogGlobalStatus: UEngine::Browse Started Browse: "EOS:000203cba214457ba8dd2640935427fa:GameNetDriver:26/Game/UI/Menus/MainMenu/MainMenu"

I'm trying to go to a different map, with the main menu being the default game map in the project settings

if(SessionInterface.Get()->GetResolvedConnectString(SessionName, ConnectString) && !ConnectString.IsEmpty())
        {
            SessionInterface->ClearOnJoinSessionCompleteDelegates(this);            
            if(APlayerController* controller = UGameplayStatics::GetPlayerController(this, 0))
            {
                UE_LOG(LogSpyderweb_EOS, Display, TEXT("Client Traveling to [%s]"), *ConnectString);
                controller->ClientTravel(ConnectString, ETravelType::TRAVEL_Absolute);
                UE_LOG(LogSpyderweb_EOS, Display, TEXT("On Join Session complete - Client Travel Successful"));
#

Here is how I'm setting the Lobby map for the Listen Server:

        const FName LevelName = FName(*FPackageName::ObjectPathToPackageName(LobbyMap.ToString()));
        GetWorld()->ServerTravel(LevelName.ToString() + "?listen");

I'm using a soft object ptr

shrewd ginkgo
#

I want to sort the server rows I created from top to bottom according to their pings and number of players with different buttons. I can search their names but I thought it was not enough.

#

how can I do that

topaz holly
#

Hey i was wondering how i could make a decent looking crouching system for true first person in the 3rd person template
Using the default crouching system is pretty weird since the camera just snaps down and adding camera lag smoonths out the movment of going down but the camera clips through the head and it just looks awful
@topaz holly when replying

eternal dune
#

I've got a replication timing issue and I'm wondering if there is a standard way of handling this. I have an inventory system. It will send a broadcast message when the inventory changes, such as an item being added or deleted.

I also have a UI element that displays the contents of the inventory. It subscribes to the broadcast.

The problem, it seems, is that the UI element is receiving the broadcast message and updating it's display before the inventory component actually replicates, which means the UI does not update to show the new contents.

What I need to be able to do is have the UI detect when the inventory has been updated. I see no Post Replication event I could hook into though. What's a good way to handle this?

solar stirrup
#

You should be using a rep notify for this

eternal dune
#

Rep Notifies can only notify you of replication events on yourself, not on another object

solar stirrup
#

Uh no?

latent heart
#

The rep notify itself will only trigger on teh object the variable is on, but that rep notify can call other things.

#

Like your ui update broadcast.

eternal dune
#

Hmmm. Wait. I think I see what your mean.

#

Oh but wait. The reference to the inventory component is part of a UI Widget. I though UI widgets didn't exist on servers, so how could it replicate?

latent heart
#

If you're storing your inventory in a ui widget, you're doing it wrong.

#

You should have complete separation from the display of data and where it is stored.

eternal dune
#

The inventory component is part of the PlayerState (or an Actor in the case of a container). The UI Widget is created with a reference to the inventory component so that it can read the inventory

latent heart
#

Right, so the inventory component needs to have a rep notify trigger when it gets updated?

#

What's the problem?

eternal dune
#

But widgets don't exist on the server, so how can they have any replicated variables?

latent heart
#

The replicated variables are not on the widget.

#

They are on the inventory component.

#

Unless the inventory component is also a widget, then see my previous message about inventory being on widgets.

magic vessel
#

Have event delegates on the component that the UI listen for
Trigger these delegates on the Rep Notifies

eternal dune
#

Ah. So I think what you are saying is the define a RepNotify on the inventory contents, then have that trigger the broadcast to notify that a change has occured. Is that what you mean?

magic vessel
#

I think so, that seems correct

eternal dune
#

OK. Let me go try that.

latent heart
#

Just make sure the UI subscribes to the inventory event, not the component triggering a ui event.

eternal dune
#

Thank you both. That works. And I hadn't even thought about manually unsubscribing. wouldn't that automatically happen when the UI Widget is destroyed? It is not permanently kept around

latent heart
#

Yes

eternal dune
#

Thank you again.

#

I love how programming works. I thought to myself "I'll make my first serious project something simple, like an inventory component." The actual inventory management took very little time. The vast majority of what I've done for it is learning replication and UI stuff to build a test environment. 😄

sinful tree
#

Working with data is typically fairly straight forward. Representing that data in a meaningful way... Much more difficult in my opinion XD

eternal dune
#

I think I'll learn Z-Machine coding and stick with text based interactive fiction games. Much simipler. 😉

#

Who's ready for Zork 2024: Return to the Great Underground Empire?

opal pulsar
#

idk where to ask

what happens to assets on a server build? Like say I had a subsystem that would load me a bunch of primary data assets and inside it had a mesh reference that wasnt a soft pointer (intentional) would these meshes also be loaded on a server and eat up ram?
or does the asset manager have some kind of check if headless to not waste resources loading them

plush shoal
#

I'm having the weirdest bug of my life, I couldn't find any mentions of it online, for some reason on both PIE (as client) and rarely in game (When certain people host listen servers), upon spawning the player, it's as if you only half posses it, you can look around somewhat, however there's no pawn control rotation, you can't move, and your movement component does nothing, yet it registers some inputs as you can see by the camera shake which is tied to the input value of the movement inputs, this issue has been happening on and off for a few months and I've tried everything, I've made new gamemodes, made new player characters, I've used the default player on a basic gamemode with no function, I've migrated the code to a new project, used new maps, everything, but for some reason this keeps happening, I can't figure out the cause but any help would be appreciated as I have very little time to solve it, thanks in advance

solar stirrup
turbid iris
#

hi guys
i have this api from GPT :
curl https: //api.openai.com/v1/audio/translation
-H "Authorization: Bearer $OPENAI_API_KEY"
-H "Content-Type: multipart/form-data"
-F file="@/path/to/file/german.m4a"
-F model="whisper-1"

when i request to server . i got error massage "can't pars multipart from data"
so what i have to do ?

solar stirrup
#

That's not really a question for here

candid flare
#

Hi, does anyone know what the problem might be? Every time I try to run the listen server in the editor, it crashes with this error:

LogWindows: Error: appError called: Assertion failed: InstanceIndex < GetMaxInstanceIndex() [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Public\InstanceDataSceneProxy.h] [Line: 48]

timid fox
#

How do I deal with replication of an actor to a joining client happening before the actors components are initialized? The actor has a widget component that should update it's texts from the replicated properties, but when the replication happens, GetWidget() still returns a nullptr.

lost inlet
#

so at that point you'll have any replicated vars in the initial bunch

#

and then OnReps should fire delegates for updates

#

OnReps for variables received in the initial bunch will fire before BeginPlay

timid fox
#

I see, I only have the OnRep updates right now. So in BeginPlay of the component I also need to update the values once. Somehow I thought that would be covered with the OnRep 😅

lost inlet
#

why is it that way round?

solar stirrup
#

Rep notifies can fire before BeginPlay if you're unlucky

solar stirrup
#

woops

timid fox
#

Yeah, didn't know that yet, thanks!

lost inlet
#

but yeah, in general I wouldn't have gameplay actors or components have a direct dependency on the UI, usually it's the other way round, and even further you have MVVM in the engine now

#

(but it's experimental)

true dust
#

Hello, everyone! I'm trying to implement online multiplayer with EOS since before our game only worked with LAN connections. Can NULL and EOS be active in the Plugins at the same time? Is there a problem with that?

potent tundra
#

why doesnt component collision automatically replicate when set on server?

#

is it the only property with this quality?

#

if not, how can i find out what properties do and dont replicate

kindred oyster
#

Hey, since today I got a warning after test with 2 players (play as listen server) "Not enough login credentials to launch all PIE instances, change editor settings" all seems to work bit its annoying

magic vessel
#

I'm still running into the problem with the client travel to the lobby menu

FString ResolvedString;
SessionInterface->GetResolvedConnectString(SearchResult, NAME_GamePort, ResolvedString);
UE_LOG(LogSpyderweb_EOS, Warning, TEXT("Resolved Connect String [%s]"), *ResolvedString);
if(IsValid(GetWorld()->GetFirstPlayerController()))
{
  GetWorld()->GetFirstPlayerController()->ClientTravel(ResolvedString, TRAVEL_Absolute);
}

It's returning to the Game Default Map

#

I've tried it with the other overload:

FString ResolvedString;
SessionInterface->GetResolvedConnectString(SessionName, ResolvedString);
UE_LOG(LogSpyderweb_EOS, Warning, TEXT("Resolved Connect String [%s]"), *ResolvedString);
if(IsValid(GetWorld()->GetFirstPlayerController()))
{
  GetWorld()->GetFirstPlayerController()->ClientTravel(ResolvedString, TRAVEL_Absolute);
}
#

It's still getting the default map:

[2024.07.13-15.23.16:415][331]LogSpyderweb_EOS: Warning: Resolved Connect String [EOS:00023cd3814d420c891eae915d39e8d4:GameNetDriver:26]
[2024.07.13-15.23.16:415][332]LogGlobalStatus: UEngine::Browse Started Browse: "EOS:00023cd3814d420c891eae915d39e8d4:GameNetDriver:26/Game/UI/Menus/MainMenu/MainMenu"
magic vessel
#

I've tried to disable seamless travelling as well, but that hasn't worked either

proven pagoda
#

If I'm calling a NetMulticast that sends 1 Param through is it better for bandwidth for me to broadcast USkeletalMesh* or int32

flat lark
magic vessel
#

Maybe, but I didn't think that would be an issue. I've been looking through Lyra to see if I could spot how they handle it

magic vessel
magic vessel
open adder
#

a game to be played with P2P lobbies. It will be released on Steam and Epic Games. It will support crossplay. Online services, online subsystem ...plus. EOS, EOSSG, etc., what exactly do I need to use, I'm drowning in the documents. Could you please provide a recommendation or a page that explains it well?

soft iron
#

does anyone know why this setup doesn't replicate movement? the client simulates and moves, the "server" location moves with the client and tracks well. But none of it is replicated on other screens 🤔

terse karma
proven pagoda
#

I can't believe I'm struggling so hard with saving and loading data on clients off a savegame object

#

My game saves and works wonderfully on the server but any actions the clients take it just doesn't work idk bro sometimes this is just dumb

kindred widget
#

What savegame data do you need on a client?

proven pagoda
#

A local variable that really only matters on the player

#

it rolls through UI on clients and saves to disk since I'm not dedicated server

#

The saving and loading system works if you're a lobby host and return as another host

#

anything you do on client save or load to disk is not working properly

#

I almost had it solved yesterday but I lost it when I changed too many things at once

kindred widget
#

Should work fine. But that depends on what it's for and if something is overwriting it due to networking.

charred island
#

I am having an issue with Steam lobbies with the packaged game - when I package as development, steam works as intended. But it doesn't work when I package for Shipping. Is this because I'm using the steam development app ID (480)?

proven pagoda
#

You're a genius my friend

#

It's impossible to test more than 1 machine savegame objects because you only have 1 save file on your disk it doesn't make multiple save files for editor testing

#

Trying to troubleshoot this from just packaging and using 2 PCs is rough sometimes especially with the savegame stuff

#

It's so bad I spend so much time making complicated changes everywhere and the answer the whole time was this little branch here

rapid lodge
#

Anyone know if it is possible to show collision on clients, similar to the show collision command? I have some weird issue with hitboxes being desynced.

soft iron
#

@terse karma hey dude thanks for taking a look. This is inside a character blueprint. And no I don't think it is. It's turned into a bit of a mess to debug haha. But basically I don't think I've managed to get any movement on the server yet, only the client. Any help is greatly apreciated

terse karma
# soft iron <@1059859571767787581> hey dude thanks for taking a look. This is inside a chara...

if you want to call a multi cast event it needs to come from the server. Its not replicating most likely becasue of that. If you instead create a Run on Server RPC and then call the multicast from the server event the multicast would work. I cant say the rest of the code would work but if you place a switch has authority first then if server run event. if remote -> run on server -> multicast -> do your thing

short arrow
#

also you don't need a debug for it, there's an option in the collision component to turn on the collision for it

#

alternatively there is "draw debug box/sphere/etc" nodes

rapid lodge
# short arrow not unless the collisions actually exist on the client

Ty, I saw that there was a setting for the collision component to be drawn in game. I still have the issue that overlap events are not generated for the client unless the host is looking at the actor, and I cannot figure out why. All of the overlap happens at the server, and as long as the host character is looking at the client character things work normally. However, if the host character turns around, overlaps stop registering.

gloomy rose
#

can anyone help me with my respawning requirements? I'm looking to only spawn player(s) if they are dead and my round ends. I believe I am needing a way to compare the length of players to the length of alive players. Or check if any connected player has died and if so and only then respawn my players

winged badger
#

you iterate player array in gamestate

#

any player that is dead should be flagged either on their PS or pawn

#

then you respawn those that are flagged

#

server only

latent heart
#

If it's a listen server, it will run locally if you're running it on the server (because that's the "client" you're playing as)

#

If you're doing it on the local palyer, that is.

#

Just 1 player?

#

With 1 player on a listen server, there is no other client and nothing will ever be replicated.

#

When you asy "run on owning client" you are saying "run locally" because the server is also the one and only client.

winged badger
#

i put some effort into convincing epic to get rid of that node recently 😄

#

GetPlayerController/Pawn[Index] is the cause of about 90% of bugs that crosswire different players

#

so suggestion was to replace it with GetLocalPlayerController

#

it really has only one good use imo

#

GetGameMode->GetNumPlayers->For (0 to NUmPlayers - 1)->GetPlayerController{loopIndex]->Do Something with PC

#

or iterating every player controller from server

#

its good for that

#

you always use a relative reference rather then a static one, if you have a choice

#

from Pawn, you'll use GetController, from widget GetOwningPlayer, from PlayerState GetOwner Cast to Controller... etc

#

hard ref is bad if you let them get out of hand

#

i've seen project where size map for PlayerCharacter blueprint is basically size of every asset in the game combined

#

but

#

as long as someone is playing the game, your PlayerController will be loaded

#

now as long as it doesn't hard reference half the project, you're fine

#

as far as loading goes at least, plenty of other ways to mess things up

#

components do help, so does the use of c++

#

all c++ classes are always loaded by default, so casting to the c++ base and calling a function on it will not cause the inherited BP to be loaded whenever you do that from another blueprint

#

you can start small

#

RPCs, not really

#

Replication Callbacks do

dark edge
#

As someone who's doing that for a very big system, I'd recommend doing a full rewrite with a fresh project, using the lessons learned from the prototype

winged badger
#

nope, RPCs work the same

dark edge
#

that's repnotify maybe?

winged badger
#

but blueprints don't have replication callbacks

dark edge
#

repnotify runs on server in BP but not in C++

winged badger
#

they have property changed callbacks masquerading as replication callbacks

dark edge
#

as it's not really a repnotify, more of a OnThingChanged

#

ye

winged badger
#

so if you set a varaible on client locally, that has RepNotify on

dark edge
winged badger
#

its "replication callback" will fire

dark edge
#

are there built-in property changed callbacks like in UPROPERTY or something?

winged badger
#

there is something called IPropertyChangedTracker

#

never explored how it works under the hood, as i prefer a Setter function then rely on integrated callbacks

#

easier to debug that way

dark edge
#

Yeah I was just curious why it didn't seem to be commonplace. You'd think that the ability to subscribe to an OnChanged for any variable would be a great base feature of an engine, although there's probably some serious performance reasons why you wouldn't have that as baseline.

hollow eagle
#

That sort of interface does exist, but it was made for UMG MVVM (and originates from other more general MVVM frameworks)

#

having to do that for all properties would be bad for performance which is why you have to opt-in and write a bit of extra code to emit those notifications.

hollow eagle
#

that is only for the editor

#

it can't help you at runtime

opal pulsar
soft iron
#

@terse karma thanks a bunch I'll try this later 👍

somber glade
#

In blueprint if you run the increment or decrement function on an integer set repnotify, that will trigger the repnotify (assuming it's run as server) correct? I expect it would, but wanted to verify since it isn't explicity stated

winged badger
#

with BP, it will trigger RepNotify anyway

#

even if its run locally on client, but only for that client

lime echo
#

Is it wasteful to have single RPC? Like:
UFUNCTION(Server, Reliable)
void ServerDoAction(int32 ActionID);

As opposed to have multiple RPCs? Like:
UFUNCTION(Server, Reliable)
void ServerDoAction1();
UFUNCTION(Server, Reliable)
void ServerDoAction2();

If I understand correctly, in the second version, the RPC header is utilized better and basically includes without additional bandwidth overhead the action ID, whereas in the first version the action ID is an additional parameter. But maybe I'm wrong, so I just wanna verify this. Thanks.

latent heart
#

I'd probalby use a uint8 instead of int32, but sure.

#

You gonna have more than 256 actions?

lime echo
#

Nah sure it's just for the example. I'd use the smallest possible int size.

#

Which indeed shouldn't be higher than uint8.

#

But still, option 1 still has more data that needs to be sent, or am I wrong?

latent heart
#

By a single byte, sure.

#

(that's nothing)

#

You would hope, at least, it's not sending parameters by name, but encoding them in the minimum space possible.

lime echo
#

Yeah I just wondered why GAS chose to take approach 1 to activate abilities, but I guess that it's still better than replicating each ability.

latent heart
#

Option 1 is also a lot more extensible. You can have anything send any action without relying on the PC, for instance, to add a method for it.

lime echo
#

Yes that can be good

lime echo
latent heart
#

I do hear that component replication is bad because it relies on the actor channel and takes extra data to make the distinction that it comes from a component.

#

But I don't know the specifics.

#

As as it's not sending reliable rpcs 5 times a tick, you're probably okay.

lime echo
#

Thank you for all your help! I will consider going for a more monolithic character class and remove some stuff.

latent heart
#

We're experimenting with unreliable rpcs. It's quite fun writing a probalby useless system for it 😄

lime echo
#

With how much Unreal brings to the table it really is hard to make a system that isn't useless

latent heart
#

Heh. The opposite really. There's probably a system which is already better!

#

Or a plugin on the marketplace or whatever.

magic vessel
latent heart
#

It depends on how they're used.

#

I wouldn't want to spam unreliable rpcs at the server from a component (for view orientation updates, etc)

orchid eagle
#

Hi there, so im having a small issue here which i don't know what is the best way to get over it
so what i have is in the game state i create my tribe map to store all the tribes info
and that is being set on the server and the issue i found is if the players gonna search on that tribe they need to restart there clients to be able to see it / know about it
so here is my question
is it okay to do a multicast in this case as there is no repnotify for maps or what is the best approach to it
here is a video with the issue incase i wasn't clear in my post

#

i think the multicast is not the best thing here as i would need to do so with every event i set the tribe map inside it
so is there a way get the tribe map to be shared on both the client and server whenever its updated

bright tiger
#

I'm doing a launch mechanic (launch character; client locally execute launch and then Server RPC that executes the the launch in the server) with the basic CMC. The issue here is that I get so many corrections with a minimum amount of lag (even with average).

Is out there anyway to solve this?

proven pagoda
# bright tiger

I think an issue is the forward vector is going to be slightly different so the movement component on the server would be likely to correct. Try sending the client forward vector through to the server RPC and pass that as a param into the launch function?

#

Idk in the end just usually when I'm doing vectors predicted I send those through to the server from the client

charred island
#

does the epic online subsystem have a similar thing to the steam dev app id (480) that anyone can use?

bright tiger
proven pagoda
#

I have just a small launch pad mesh with an overlap box on it, the overlap event is bound on server and clients and it launches me perfectly around my map how I have it set up

bright tiger
proven pagoda
#

I can do that later tho I haven't tested much of my game with more than 50ms honestly

bright tiger
#

I think its thje speed, am just testing anormal movement with high speed and jumping causes corrections too

#

Here without launch

sinful tree
# bright tiger I think its thje speed, am just testing anormal movement with high speed and jum...

The CMC has built in prediction of movement. If you end up doing something on the server, the client won't be in the right position and the server will then have to correct it.
The way to do this is either stop using the CMC and build your own movement system/component or learn how the CMC works and build in the move you're attempting to do within the CMC so it gets properly client predicted.

#

It won't be functional within blueprints alone if you're wanting to still use the CMC. It must be done within C++.

bright tiger
sinful tree
#

It is, but you can only execute it on the server. You can't execute it locally on the client first.

#

And you'd probably still end up with some corrections.

bright tiger
sinful tree
#

All one would have to do is spoof an RPC and they can basically move anywhere on the map.

proven pagoda
#

I feel like I'm gonna do my best to anti cheat this but if people are gonna use cheat engines to hack it all you can't stop everything

sinful tree
#

In multiplayer it's a little different - you can allow clients to cheat locally, but that doesn't mean it actually has to modify the actual state of the game that the server has authority over.

#

eg. They can set their health to 50000, but the server is the one that knows their health is only 100.

#

You can stop anything that the server is in control of.

bright tiger
#

Though I've read in forums that cars in Fornite uses client authoritative and anticheats in the server because of physics complexity for example

sinful tree
#

"Wall hacks" for example - the reason this works on a lot of games is because the location information of all the players nearby are usually sent to everyone. So someone is able to read the locations in memory and then place overlay images to point out those locations. To fix this, you can make it so the server only sends the locations of enemies players that are actually within view of the player. Now the person doesn't have the information so they have no idea where the other players are.

bright tiger
#

For example, GTA is so damn broken in hacks because of this issue?

sinful tree
#

GTA is broken like this because they allow the clients to do too much to the game state.

#

The very first online game of GTA5 I entered, I all of a sudden unlocked a whole bunch of "findables" or whatever you wanna call them, basically levelling me up instantly to 20.... And that's probably because they allow clients to send an RPC indicating that player X picked up item Y.

bright tiger
bright tiger
sinful tree
#

I'm not sure if it's P2P or Client-Server either which plays a big role... If it's P2P then all rules are out the window.

short arrow
bright tiger
short arrow
#

It's too new imo, there's like 0 documentation

#

whereas I'd say CMC is like 10% documented

bright tiger
short arrow
#

yes but the community has a lot more information on CMC so it get's bonus points

sinful tree
short arrow
#

I'm pretty sure almost no one knows how mover 2.0 works here yet at a confident level

sinful tree
#

And from what I keep hearing, it's not ready for prime time yet either <_<

short arrow
#

I had lots of issues with it stuttering in a multiplayer test I did a few weeks ago

bright tiger
#

Thank you for the info!

jagged kernel
#

Hi, why is auto possess player not automatic even i already changed it? When I press play every player's possess is Player 0

lusty yarrow
#

Hey I'm having issues with NetMulticast function not executing on clients at all, only on server. UFUNCTION(NetMulticast, Reliable) void NetMulticast_RegisterPrefabCallback(const FName PrefabName, const FPlaceableObjectInfo PrefabInfo); called from UFUNCTION(Server, Reliable) void Request_SaveAsPrefab(AActor* InGroupActor, FName PrefabName); Am I misunderstanding NetMulticast? I'm calling it from an actor component attached to the player character, both component and character are replicated but when I call the function from the server, only server executes it.

#

I want to send an rpc from server to all connected clients with a FName and a ustruct.

fossil spoke
#

When are you calling it? Keep in mind, that if you are calling an RPC immeditaely after spawning an Actor, it may not have been created on the Client before the RPC arrives.

lusty yarrow
#

Both actors exist when calling the RPC. On Button press from Client 0 I call Request_SaveAsPrefab and inside that I call NetMulticast_RegisterPrefabCallback, hoping the netmulticast function would execute on client0 and client 1

#

Tried doing it from blueprints and same result

fossil spoke
#

Does the output log mention anything?

#

Did you forget to call Super in a function like BeginPlay or something like that?

torpid lantern
#

Can somebody tell me if this is a silly approach in terms of security:

I need to pass a variable (EntityId) from Dedicated Server A to Dedicated Server B. I do not want the client to be able to mess with that var

I just realized that I can have the sever open ip:port against a player controller.

So would I be able to attach EntityId as a parameter on that server-side console command; then read that parameter on the receiving server without the client knowing about it?

fossil spoke
#

Alternatively you can just setup a traditional Socket connection

torpid lantern
#

Beacons sound interesting; my limitation is BP but I see some plugins.

#

Going to consider beacons for future, but I feel that that'll conflate my scope quite a bit. I'm in PlayFab for hosting and I don't quite understand their port management system.

In the interest of simplicity, would it be semi-safe to pass EntityId as a connection parameter; if the open command is initiated server-side. Or am I misunderstanding that command?

daring cape
#

Thinking of implementing player sprinting and such and went looking through Lyras code (very confusing LOL)

Is Lyra using gameplay tags for character movement replication for things like sprinting, crouching, etc? Or are these purely client-sided?

fossil spoke
#

It sounds like you might want to save that ID off into an external database and have the new Server read it in.

#

If you are limited to BP, these types of things become very difficult

#

A perfect example of why BP only projects are never a good idea in multiplayer.

deep shore
#

Is there a way to trigger an event when all connected players have loaded the map after server travel? I can’t do anything like checking the length of the player array because there might be any number of players.

fossil spoke
deep shore
#

one event to take everyone out of spectate mode and possess their characters at the same time

fossil spoke
#

There is no single event that triggers when ALL Players are "ready".

#

Since Players connect at different times

#

How do you expect that to work exactly?

#

You would need to implement that yourself.

deep shore
#

they would all already be connected to the server, but will load the map at different speeds. I’m just wondering if there’s any way to know when all clients have finished loading after the server changes maps. Just trying to figure out the best way to get a fair start to a match.

fossil spoke
#

Typically BeginPlay in the GameState is a good place to start.

#

Its on you to figure out when "all" players have loaded.

#

Since that is arbitrary

deep shore
#

Thank you!

daring cape
#

Does UE have smooth position rollbacks?
I just enabled network emulation, set it to bad, and started running around. It's rolling back the player location, but it does it in such a janky way

#

Just straight up teleports the player rather than lerping to where they should be

nova wasp
#

are you aware of how bad "bad" network emulation actually is relative to the average game connection?

#

that much packet loss is extreme

#

yes it will exceed the built in limits for character distances from the server and force corrections

#

you can try tweaking network smoothing settings if you like but "bad" network emulation is more for testing if things still... work at all

#

rather than being a smooth experience

#

UCharacterMovementComponent::SmoothCorrection might be a hint, I'm not sure exactly how it handles extreme positional corrections on an autonomous proxy

#

ah that's just for sim proxies

daring cape
#

Is that like this stuff?

modest crater
#

There are also some tweakable params for thresholds of how far a client can be "off" before it corrects

#

yep that stuff

#

those are the params

#

he was mention the func

nova wasp
#

appears to be done in ClientAdjustPosition_Implementation

daring cape
#

Ah alrighty ty heart Is there are a visualization tool for this stuff?

nova wasp
#

actually yes

#

p.NetShowCorrections

daring cape
#

Sweet yeah, that's working well thanks. Feels like that distance should get increased a bit.
Just tested with AD spamming and the characters sometimes teleporting.

#

Guessing the red outline == no smooth or ssomething

#

Sorta related, so..

#

I've got this code right for the player character, binding actions and whatnot.

Given the character has replication to true, would I be wanting to test for authority here?

#

Or rather, the role**
So does UE auto-handle setupinputcomponent/beginplay/etc in regards to the actor role, or do need to manually check "if is autonomous proxy" "if is simulated proxy"?

nova wasp
#

uh, it depends

#

the player controller only exists on authority and the owning player

#

beginplay runs for everyone

#

you can just breakpoint and see where it gets called by watching {,,UnrealEditor-Engine.dll}GPlayInEditorContextString

daring cape
#

So inside of the begin play here, before casting the controller, i'd probably just wanna check the role of the actor right..?

#

Cus it's doing a cast and trying to bind the mapping context. But that, and binding actions seems irrelevant for simulated actors on a client i would think.

#

(im just assuming that when a character is simulated, UE is just setting the position/velocity/rotation)

nova wasp
#

casting to something that is null is fine, that's even an indicator that unreal uses to figure out if the pawn is locally authorative etc

#

IsLocallyControlled etc is probably what you want

warm sparrow
#

i need other actors in my world to react to changes in the playerstate. I want the actors to bind to events happening in the playerstate to accomplish this. What is the best way to know that a new player joined the lobby and thus their playerstate is initialized for the actors to bind to its events?

#

I know there is onpostlogin in gamemode but that is only on the server and not the client. I could send an event to gamestate from gamemode which clients could receive but i feel like that would be subject to race conditions because it would happen right when the client joins

#

what is the most elegant solution to this? I couldnt find anything on the actor lifecycle docs about this

fossil spoke
#

Have the PlayerState call a function on the GameState which notifies of their presence. Actors can then freely bind to an event on the GameState

warm sparrow
#

yes that seems like a great way to do this, thanks!

daring cape
warm sparrow
#

once the actors learn that a new playerstate is initialized from the gamestate, they could bind to the playerstate itself as well through gamestate event too right? that way i can keep playerstate related code in playerstate

fossil spoke
daring cape
#

Seen UE has a bunch of different networking plugins, are any of these worth using..?
I've tried to find out info on NP but there's not much from epic directly. Iris docs say it might not be effective for smaller player counts.

fossil spoke
#

Dont go randomly enabling plugins because you think you might need them

daring cape
fossil spoke
#

Why are you so concerned about that? Are you really expecting that the majority of your players will be playing with high ping and therefore that smoothness is needed? Sounds like you have a different problem if thats the case.

#

Do you even have an audience?

#

Why focus on a feature improvement at this stage that likely no one will even notice.

#

Focus on building a game people want to play

#

Instead of obsessing over tiny details

daring cape
#

Well, not everyone has a great internet connection. I play games like OW and my ping* sometimes randomly shoots into the hundreds, usually for a few seconds.
That game handles it really well. I get it's not the most pressing feature, but with networking in particular, it's sort of something that needs to be planned out early on

nova wasp
#

as it is a player that is the authority as well

daring cape
#

I'll add in IsLocallyControlled then thanks

nova wasp
#

P2P in unreal?

#

a listen server is still a server, p2p implies neither is the authority

#

everything replicated goes through the server

#

clients don't talk to one another

fossil spoke
#

In Unreal.

#

A Listen Server is a Server, its literally in the name.

#

The Host is the Server.

#

It is not a Client.

#

Just because they have a graphical interface doesnt make them a Client.

daring cape
#

Think I've just got my terminology wrong, I'm thinking host client == with 5 players, 1 of those players client acts as the server.

#

that's listen server right..?

fossil spoke
#

Its not a Client acting as a Server

#

It is the Server, its not acting as anything.

modest crater
daring cape
fossil spoke
#

At most you should only test with like 1

#

Also, it should only really be tested to verify that your game can recover into an acceptable state

#

Real world, you are never going to have consistent packet loss

daring cape
#

Okay thank you, i'll drop that down. Wasn't sure what a good avg percentage for it was, UE has it defaulted to 5.

#

Really just aiming to test the latency as that's something I feel can be a lot more variable

fossil spoke
#

Yeah well even a latency that high is a bit rediculous

daring cape
#

Is this round trip or just client -> server?

fossil spoke
#

Incoming + Outgoing == what

#

Round trip

daring cape
#

:O Oh my gosh, I know its experimental, but I tried SirKai's modified mover/network prediction plugin repo, it's incredible!!
No severe teleporting issues with the default movement component, AND it doesn't have the jitter from the base mover plugin.

#

Even with these settings it's really, really smooth. Sure there's latency, but the client sure doesn't feel like its bad

surreal fox
upbeat estuary
#

Hi, I think I'm doing something really stupid here but I seem to be unable to get the NetDriverDefinitions working with my own Driver, or any other driver really. Using 5.4.2 here, has anything changed there from previous version?
If I change the lines in BaseEngine.ini, it works fine. But in my project's DefaultEngine.ini it just seems to be completely ignored.

upbeat estuary
#

Using cmd line args also works, e.g. -NetDriverOverrides=DisplayClusterReplication.DisplayClusterNetDriver

thin stratus
#

Might be worth sharing what you actually wrote into the ini file.

upbeat estuary
#

I've tried a few variations, but the main part just comes from nDisplay itself, which writes it automatically. This one e.g. does not work:

[/Script/Engine.GameEngine]
!NetDriverDefinitions=ClearArray
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="/Script/DisplayClusterReplication.DisplayClusterNetDriver",DriverClassNameFallback="/Script/OnlineSubsystemUtils.IpNetDriver")
+NetDriverDefinitions=(DefName=DemoNetDriver,DriverClassName=/Script/Engine.DemoNetDriver,DriverClassNameFallback=/Script/Engine.DemoNetDriver)
#

Even the variation copied directly from BaseEngine does not seem to be read correctly. Even tried it on a blank project and everything, I'm quite sure I'm just absolutely blind and it's something completely obvious

outer sphinx
#

Hello guys, a question, I am trying to achieve a mini mmorpg with the unreal server, what language do you recommend to request the account data from the database to the client? I still have doubts about PHP, I think it is not recommended. The idea is to make several APIs so that they return the server address, corroborate account data, and also return exp, inventory, etc... thank you very much

thin stratus
#

You'll notice that 10 people will tell you how 10 different languages and frameworks are better than the other 9.

latent heart
#

That's why you need to come up with an 11th language that unifies the good points of the others!

#

/xkcd

narrow fog
#

Hey gamers, I've got a Board that consists of Grids made up of Tiles, which can host CombatUnits. From the GameMode, I have the server setting up a Board for each player with variously positioned CombatUnits. The player can then pick up and move the CombatUnits to a different Tile (which happens only for the autonomous proxy). Once time runs out, the next phase begins and the units are given AI, which puts them back to their original positions before beginning combat. Ideally, the updated unit position would be seen even when done by a simulated proxy, and the unit position would persist through the combat phase.

The CombatUnits, their reference to their Tile and vice-versa are all replicated, as is the hierarchy from Tile through Board. There's clearly something I'm having trouble wrapping my head around

edgy yacht
#

Hi all, so I'm new to making multiplayer games and I wanted to test out how to do splitscreen multiplayer before diving into development, how can I go about all players having a gamepad instead of it being one person on mouse and keyboard and the rest on controllers? I'm using the third person template without any changes btw

lament flax
#

Any ideas why REPNOTIFY_Always doesnt call OnRep functions on client ?

modern cipher
#

Did you call it on the server?

lament flax
sinful marlin
#

oh theyre back. or maybe not, idk. Thought for sure cat had the same pfp

tame kraken
#

What is the way that I can make the players automatically join and see each other in the session with the create and find and join sessions?

#

now they find the same session ID and join it, but they don't see each other

#

I need to do the extra step of traveling with the ip address

sinful marlin
#

Is there a way to replicate timers started through the world timer manager?

surreal fox
#

I have stored the player controller in an array on Gamemode with OnPostLogin event. But now I have no Idea how am I going to know that which index shoud I use to access the player controller I want to use!
I am new to mulitplayer I'll really apreciate your help. Thankyou

thin stratus
#

Which gets confusing if devs throw both topics into one question :P

thin stratus
#

The way to handle this is to ensure that you always have "relative" or "context-based" information

#

It's a bit depending on what you are doing, so I can only give you a generic example.

E.g. if you handle Damage in your Character Blueprint, on the Server, and the Character dies and needs to be respawned via the GameMode, you can call "GetController", on the Character, to get the "relative" controller (given you haven't unpossessed the Character yet).

tame kraken
thin stratus
lusty sky
opal pulsar
#

what happens if a replicate a TMap through a structs NetSerialize function? just Ar << MyMap, I know it is going to atomic replicate the entire map every time but I only intend for it be an initial only payload so it doesnt matter about atomic replication. Does it work fine and can I rely on the key being the same on both ends?

chrome bay
#

Depends what it's keyed with

#

Not 100% sure you can just << but it might work

#

Keep in mind if you do it won't call NetSerialize on the internal properties

modest crater
#

Is long as one reflected thing changes it will run that function and serialize anything you put in there wont it?

opal pulsar
# chrome bay Depends what it's keyed with

its a map of gameplaytag to struct, the alternative is I do .Array() and send it as that and then on the other end, convert it back to a map? I jst want to make sure its valid to send a map like that, what is the issue with them anyway, just the delta serialization?

chrome bay
#

What I mean is that just using the << operator won't reach into internal NetSerialize() functions. A GameplayTag is a good example:

FGameplayTag Tag;

// Serializes tag as a string
Ar << Tag;

// Serialize tag as it's network int
Tag.NetSerialize(Ar, Map, bool);```
#

Yeah so in which case, you shouldn't use << Serialize the number of items in the map, then add each one individually

modest crater
thin stratus
#

I would argue that you should alter your setup if it requiers you to replicate TMaps

chrome bay
#

100%

#

Not just tags, any struct that has it's own specialist override for NetSerialize

#

You can NetSerialize a TMap so long as it isn't keyed with objects, but you have to do it more manually than just <<

thin stratus
#

If only << would check if WithNetserializer and fall back to it somehow. Pretty sure it could pull the PackageMap out of the Ar somehow. And the bool is wasted anyway xD

chrome bay
#

Yeah

opal pulsar
#

as I said, it only needs to happen once, is it safer to do a .Array() and serialize it that way and then reconstruct it back to a map?

chrome bay
#

Psuedo-code:

int32 Num = Map.Num();
Ar << Num;

if (Ar.IsSaving())
{
    for (auto Itr = Map.CreateIterator(); Itr; ++Itr)
    {
        Ar.NetSerialize(Itr.Key(), Map, wah..);
        Ar << Itr.Value()
    }
}
else if (Ar.IsLoading())
{
    for (int32 Idx = 0; Idx < Num; Idx++)
    {
        FGameplayTag Key = ;
        FStruct Struct = {};

        Ar.NetSerialize(Key, Map, wah..);
        Struct << // or whatever

        Map.Emplace(Key, Struct);
    }
}
opal pulsar
#

ok thanks

opal pulsar
chrome bay
#

Oh my bad, should be Key.NetSerialize()

opal pulsar
#

ah yep, I see

opal pulsar
chrome bay
#

all the time, Iterators can do other stuff like removing the current element etc.

#

If it was an option I'd use index based for loops everywhere tbh but C++ constantly tries to be smart

tame kraken