#multiplayer

1 messages · Page 123 of 1

ruby lodge
#

the first one is successful now always

#

I think the server needs to show rip2 once because when it gets it from the client it isn't local for the server

grand kestrel
#

Dunno how many of you are using PredictedMovement plugin, but if you are make sure to check the changelog, there have been a few bug fixes that might be worth pulling

ruby lodge
#

now the actual problem i was having is this:

It is showing accessed none in event tick although in receive restart it worked perfectly fine and displayed the names

#

I have checked this now and it still displays the name although it gives the error

fossil spoke
#

@ruby lodge You would cache that variable on BeginPlay as it comes from a Component that is directly owned by the Pawn

ruby lodge
#

you mean on receive repeat?

fossil spoke
#

Huh? Where in that sentence did I say anything about "receive repeat"?

ruby lodge
#

i don't have a begin play

fossil spoke
#

Then add it.

ruby lodge
#

you literally just told me 5 min ago to delete it

#

and put a receive repeat instead

#

here?

fossil spoke
#

That needs to go in BeginPlay

ruby lodge
#

do you mean to have receive repeat and beginPlay and to put this into beginPlay?

fossil spoke
#

Put JUST the red circled nodes in BeginPlay!

ruby lodge
#

or switch the receive repeat for a beginPlay again

fossil spoke
#

Read what I am saying to you

ruby lodge
#

you are saying multiple things that are contradicting

#

first i had a beginPlay

#

then you told me to delete it and put a receive repeat instead

#

now you tell me to add it again

fossil spoke
#

🤦‍♂️

ruby lodge
#

and i am just asking if i should replace the receive repeat with it or have both

fossil spoke
#

No

#

That was a separate issue

#

You have a new issue now

#

Stop combining them

#

They are different issues

#

I am giving you the solution to your new issue

ruby lodge
#

what do you mean stop combining them. It's still the same node tree, if this destroys the solution for the first problem then i wouldn't have gained anything

#

so

#

add beginplay and put the nodes in them

#

keep the receive repeat as it is

#

besides these nodes

#

gotcha

#

okay now it's working

#

I will show you the final node tree so that you could re-check if you want

ruby lodge
#

Thank you!!

latent basin
#

Hey all i have a simple lean system, the custom event svr lean runs on server and sets lean value. Right now it is working perfectly and when simulating laggy network it still works well.

I was just wondering when i remove setting lean again in the blue highlighted box, when playing with simulated lag it has a big delay to start leaning, why is this and why do we set the lean variable once again affter calling svr lean

#

Why does it make it run better in laggy simulation

sinful tree
#

It's a matter of:
Press Button > Sending to Server > Changing the value locally > Visually appears instantly on the client activating it > Server eventually replicates value > Activating Client is already visually seeing it as it should be
vs.
Press Button > Sending to Server > Server eventually replicates value > Visually appears delayed on the activating client

dark parcel
# latent basin Why does it make it run better in laggy simulation

it's called client prediction. You apply something locally instead sending data to server and wait for server to send the data back to you.
If sending data takes 20 ms to reach the server, it will take another 20 ms to reach you and other client. So it takes 40 ms just to set the lean value should prediction doesn't exist. this is why you should always emulate lag when developing multiplayer game because the lag free world doesn't exist

frozen moat
#

is there a context outside of the character bp where i can receive input events?
context:
i want to swap pawns but i don't want to write the code in each of the pawns if possible

#

it would be helpful if i can get the input event directly in the game mode bp

kind ermine
#

LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = PendingConnectionFailure, ErrorString = Your connection to the host has been lost., Driver = PendingNetDriver IpNetDriver_0

#

im getting this while trying to join session..voice chat is working though

#

but not able to load the map

frozen moat
#

ok i wrote the functionality anyway so i can move it if needed but i want to know where do i do the swapping of the pawns

#

the pawns will mix and match depending on the level

#

so each level blueprint will have an array of the pawn characters to cycle for each player

thin stratus
#

@frozen moat PlayerController

frozen moat
#

is that a bp i can access?

thin stratus
#

Well you should really know what the PlayerController is if you do Multiplayer

thin stratus
#

If you don't, then please read the first pinned Message in this channel

frozen moat
#

cause apparently i don't own the game mode and i can't run server events in there

thin stratus
#

That's correct. The GameMode doesn't even exist on Clients

#

Please read the pinned compendium

thin stratus
#

The top most one. The compendium

#

All of this is basic and fundamental information

#

In terms of multiplayer.

#

The compendium exists to not have to repeat this every day :D

frozen moat
#

ok a question apart from this is how do i get the level blueprint reference so that i can call functions in it or get the arrays from it in the bp character

hoary spear
#

Yet here we are 😄

thin stratus
#

You usually don't

#

There is no BP getter for it

frozen moat
#

hmm

hoary spear
#

You generally dont want ro rely on levelbp

thin stratus
#

C++ there would be, but almost always the LevelBlueprint might be the wrong choice. It has its usages but if you need to access it there is a high chance you are using it for the wrong reasons.

frozen moat
thin stratus
#

That's fair. But without c++ you might not be able to get the reference

#

You can bind inside of it to other actors Delegates/EventDispatchers but that's about it

frozen moat
#

i guess i will avoid the level bp cause it's just what characters i want player 1 and player 2 to own for different levels(i'll just have a table or something)

thin stratus
#

If you are locked to BP only you might have an easier time simply dropping an empty data actor into your scene. And then once at the start of the game either get it with GetActorOfClass or use its own BeginPlay to get any of the statically accessible actors and "register" it there (by setting some reference variable with it)

#

Somewhat similar to how SpawnPoints work (in terms of the idea behind them)

hoary spear
#

Extended gamemode

frozen moat
#

is using GetActorOfClass fine?

hoary spear
#

Sounds reasonable to me

#

For different pawns per player per level

thin stratus
#

It's fine if it's the only way to achieve something

#

To avoid it you can do the BeginPlay version

#

But you might have a case where BeginPlay is too late

hoary spear
#

Or too soon

coarse patrol
frozen moat
#

i think i'm having the same problem right now

#

😛

#

well a similar problem

frozen moat
coarse patrol
#

yeah i read it
and tried the cant spectate bug fix
still no luck

queen escarp
#

Hi eXi- you got some time to contineu helping me with the player display thingi:) ?

frozen moat
#

just a simple question
should i unpossess the pawn when possessing the next? and if so, can i do it inside the character bp itself which is going to get unpossessed?

#

just realised i can't even get context to the possess node in character bp

#

ok i figured out the missing link.
the default player controller that unreal provides in third person template is a cpp header file. i realized i can create a custom player controller blueprint file.

glacial wasp
#

How to port multiplayer code to singleplayer? E,g, I have a code:

    UFUNCTION(Client, Reliable, WithValidation)
    void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);
    void ShowDamageNumber_Implementation(float DamageAmount, AGDCharacterBase* TargetCharacter);
    bool ShowDamageNumber_Validate(float DamageAmount, AGDCharacterBase* TargetCharacter);

Should I replace it with

    UFUNCTION()
    void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);

in case Im not planning to make a multiplayer game? Or does it have to deal with local 'server' when playing singeplayer?

frozen moat
#

omg it finally works

#

😛

coarse patrol
frozen moat
#

no i'm cycling characters based on players

coarse patrol
#

oh ok

queen escarp
#

@dark edge hey i think eXi- bussy maybe you could help me finnish it 🙂 ?

coarse patrol
glacial wasp
coarse patrol
#

in single player local instance of the game will be running on your machine, so u can directly access data, no need to replicate

You don't need the implementation and validation functions in a singleplayer game because you're not dealing with client-server communication or remote procedure calls.

#

i am just noob, better if someone else replies
with better knowledge

coarse patrol
kind ermine
coarse patrol
#

i had similar issue

#

are u using eos? @kind ermine

kind ermine
#

yes

#

im using that

coarse patrol
kind ermine
#

any idea how to solve tha

#

that

coarse patrol
#

in default engine.ini
change this

[/Script/SocketSubsystemEOS.NetDriverEOS]
bIsUsingP2PSockets=true

to

[/Script/SocketSubsystemEOS.NetDriverEOSBase]
bIsUsingP2PSockets=true

kind ermine
#

did

#

same

kind ermine
#

shall i share my default engine file

#

?

coarse patrol
#

yes

kind ermine
#

check dm

fallen orbit
#

One simple question: If I want to create session as online mode, do I have to use steam online service or EOS or other such service?

coarse patrol
#

u can use them or create ur own, using onlinesubsystemnull for customized backend service

fallen orbit
#

My game now can only create LAN mode session. Once I created session as Online mode, logs output "TickWorldTravel failed to Handle server travel to URL:"

fallen orbit
coarse patrol
#

guys anyone have idea why my client spawns spectator class and even if character is possed i am not able to control character, but spectator class controls are working

whole solar
glacial wasp
#

Wdym

#

Unreal build tool generates them?

fallen orbit
glacial wasp
fallen orbit
#

Another question is that in listen server, the host's GetNetMode() is just listen_server, so how to distinguish between client's if_locality on listen_server and host's if_locality on itself (if I want to add some UI only in client)?

whole solar
whole solar
whole solar
glacial wasp
# whole solar What ways? In single game you can remove "Client, Reliable, WithValidation" from...

I mean lets say I'm not planning to add multiplayer for now, So I leave only UFUNCTION() void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter); because its easier to write, read and support. But lets say eventually I decide to make a multiplayer game and take these classes for using in it. So I just move the logic into the _Implementation method, other is just a transport boilerplate. Will it work? Are these 2 ways of writing logic interchangable? Or does every single UE human being using multiplayer-friendly way of writing code right from the start? So they add replication, validation support even into the singleplayer games just because unreal engine can do it? Or is it bad to write UFUNCTION() void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter); instead of a proper client-server method because it doesn't something or breaks in some cases or isnt memory-safe?

Maybe these questions sound strange but I came from another enterprise engine with different architecture and ways of implementing stuff so I just wanna understand how is UE actually meant to be used. For now I can't get neither why including replication code in singleplayer game if its supposed to be running locally, neither why removing replication code from singleplayer game if its supposed to be written this way

whole solar
whole solar
#

The multiplayer code is memory safe, as far as I know. It will not break if you understand when which RPC is executed.

glacial wasp
whole solar
glacial wasp
#

On what content does using

    UFUNCTION(Client, Reliable, WithValidation)
    void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);
    void ShowDamageNumber_Implementation(float DamageAmount, AGDCharacterBase* TargetCharacter);
    bool ShowDamageNumber_Validate(float DamageAmount, AGDCharacterBase* TargetCharacter);

instead of

    UFUNCTION()
    void ShowDamageNumber(float DamageAmount, AGDCharacterBase* TargetCharacter);

depends?

#

Its like general UE API, nothing game-specific

#

Just as everything else Ive asked so far

whole solar
glacial wasp
whole solar
#

If this is a listen-server.

glacial wasp
#

Thanks now it makes sense

quick torrent
#

Hi guys do we need steam app id to test multiplayer sessions?
Context:
Locally, two machines with wo different steam accounts work.
Over the network, (the region is the same) I can't seem to find sessions.

whole solar
quick torrent
whole solar
pastel fiber
#

How to make the DrawDebug* gets rendered on not only servers but also clients?

karmic briar
#

hello, so im not very knowledgable in this topic so please corret me if im wrong.

So im in the process of making my ai and my game designed to have tons of AI's.. for player controlled pawn, if you want a replicated custom movement, you have to use character movement component but i remember i read that is not the case for AI.. do i have to built AI equivalent of CMC from the ground up? I dont mind trying to attempt to build one. i know it will take months and i have to see of CMC do it..

I dont want to go this route but if i have to, anyone have attempt to do this? if so, can you advice me on things i need to do / donts? any pointers?

#

any technology built in unreal you can suggest me look into?

twilit radish
karmic briar
#

for example having ai like >10

#

i remember seeing someone tgalking cmc is expensive even for large amount of ai

whole solar
latent basin
#

Thanks alot for the clear explanation

latent basin
quasi tide
karmic briar
quasi tide
#

Don't give an example. What is your target?

#

Because the difference between 10 and 100 and 1000 is massive

#

And each would warrant a different response.

karmic briar
#

if that the target

#

🤔

quasi tide
#

Which is exactly why crossposting is against the server rules.

karmic briar
#

i just thought since both channel technically relevant to the question, it would be appropriate to crossposting in this case

#

sorry

velvet jacinth
#

Really weird bug.
When the client left the session, the material on the server turn black. Like the material just went off.
What's happening?
I'm using Runtime Virutal Texture by the way

fallen orbit
viscid tapir
#

Hello I got a question about bandwith. I'm adding passively 1 gold coin per 0.5s. Everything is working perfectly as intended but... is it okay to do so ? I have another alternative where I never add passively golds but evaluate the gold coins amount based on server world time and client-side; i set a timer that fakes incrementation of the gold coins. What do you advice me to do ?

dark edge
viscid tapir
#

the second method is overkill ? (to save bandwidth) ?

dark edge
#

the bandwidth of changing a number every half second is approximately zero

#

don't worry about it

viscid tapir
#

Ok thank you !

dark edge
#

1 moving character is like 200x the bandwidth of that

viscid tapir
#

Omg I see

#

Just by the way : I'm updating the value server-side (no bandwidth consummed) and server replicates the changes that calls OnRep to broadcast the client delegate which updates every 0.5s (I set it in a timer) the gold coins amount

#

its still nothing with more context ?

dark edge
#

pretty much zero

#

thats like what, 8 bytes per second?

viscid tapir
#

I think

#

Well, thank you

dark edge
#

basically zero

velvet jacinth
# dark edge Need way more info to tell

Well, I have a landscape with a material that using Runtime Virtual Texture.
Honstly that's it. The client leaves the session of the server and the material turn black.
I did had some bugs with UE that sometimes it turns black when you paint maybe it's an engine bug.
That's make no sense that the client leaving would cause the landscape material such a thing.
There's no camera movement or anything also.
It's only happens when I'm using the RVT, while it's off everything works fine.

frail temple
#

So I've started to come across issues where only certain things work with PIE and other things work with SA, is there any work around for this or just stick to SA as that will be the closest thing for a release multiplayer game? E.g. Gamemode - PostLogin will fire in PIE and not SA but OnSwapPlayerControllers will activate in SA and not PIE

cedar creek
#

Hi i am having a problem with my code is there anyone can help me?

#

i am looking for a solition for hours and couldn't find anything i would be too help if you could help

quasi tide
#

Just ask your question. Don't ask to ask.

frail temple
cedar creek
#

This is in my grave BP

#

When i delete should destroy grave and branch it works fine

#

when i add that it doesnt work at all

#

This is in Character MP

keen hound
#

How would I display a player count from a dedicated server?

twilit radish
keen hound
twilit radish
#

It's also exposed to blueprints.

#

Should work just fine.

ruby lodge
#

how do you replicate metasounds?
i have added an audio component to the bp mesh but only the server can hear his metasounds. He can't hear the rest but the rest can't even hear themselve

waxen breach
#

Working on a little prototype game i've been thinking of, but I cannot figure out the flying mechanic and how to replicate it

#

Here's the entire code for the seagull character, it's a bit messy, mostly because i've torn it apart trying to figure out what i'm doing wrong here

#

Any help or advice would be greatly appreciated

#

(also the recording cuts out a lot, filming on an old quest 2 so if it does that i can't really stop it0

#

Little update, making the flying events multicast actually helps it, but now it just skips upward and isn't smooth

stuck cloud
#

Anyone knows what to do when you get a stuck 2nd mouse cursor?

stuck cloud
# stuck cloud

I only have the problem when set the input mode to "game only" after editing the text input

#

But I'd like to keep it like that, since otherwise I always have to click once after setting the text with enter in order to get keyboard inputs again

feral wing
#

Hi guys, In terms of setting the dedicated server... I have an Issue and I'm not sure what I'm doing wrong.
I set forward PORT into my local router setting to 55000 for example, into dedicated server properties (right click) I put -log -port=55000, into my firewall I also set up inbounds outbounds to that tcp port 55000 and is not connecting from other laptop with the build to the laptop which is running the server. I have an entry map which got on begin play a open level node with my public ip following :55000

grizzled garnet
#

quick help, add movement input called on the client isn't replicating to the server and the client isn't moving, but server to client movement is fine. Do I have to instead call add movement input via RPC?

sinful tree
#

You also can't really connect to your own external IP address when internal to it - your other laptop would need to be on an external network to connect to your external IP address.

dark edge
# cedar creek

Why the hell are you multicasting the destruction of an actor?

#

It should be a replicated actor

#

just destroy it serverside

grizzled garnet
feral wing
#

Do I need to made some changes into some .ini files?

twin juniper
#

Hi guys, whats the correct place to modify the velocity in a CMC? I ask this because I am trying to implement a slide mechanic and while it 'works' can see some desync time to time.

celest copper
#

Quick question: What is the path supposed to point to when using websockets? Is that to a folder on my system or...?

prime pawn
#

So im trying to spawn a npc on client, So if the host calls this function. it spawns npc. & client sees npc, host sees npc, & everthing functions correct, but if client side calls this function, nothing spawns. Any tips?

sinful tree
prime pawn
#

executing on server only

sinful tree
#

But it is on this BP AI actor blueprint?

prime pawn
#

yeah

sinful tree
#

And is this BP AI actor owned by a client?

prime pawn
#

i dont think so, how would i configure that?

#

Essentially what im trying to do, is In BP_AI when dead, spawns a new npc class (BP_AIhumanranged), but in multiplayer

#

works fine on server (host) even works fine if the clients come around the npc will still interact with client

sinful tree
#

You don't necessarily want it to be owned by a client as you shouldn't need to change ownership just to call an RPC. Ownership of an actor is usually automatically handled when you possess it if it is a pawn (usually the "character" the player is playing as) or when you're spawning the actor. If it's something that can be accessible by multiple clients then you don't want to set the owner.
The "Run On Server" and "Run On Owning Client" events will only trigger correctly on clients if the actor they are being called on is owned by a client, therefore, you need to send the Run On Server event on an actor that is owned by the client.

In this case, since you're wanting to handle when the AI is dead, it shouldn't involve the client at all. The server should know when the AI is dying already as damage/death should be getting handled by the server, and the server should be able to determine what/when to spawn the next actor.

#

If you don't, then you're just opening up an RPC that will allow a client to spawn actors all they want.

prime pawn
#

alright thanks for the info

#

how would i make sure the actor is owned by client/

sinful tree
#

You'd call set owner while runnin on the server.

latent heart
#

Because you crossposted.

#

It's divine punishment.

prime pawn
#

huh

grave lynx
#

Hey, is there a way to change/reset a rep notify variable without notifiyng everyone?

rustic ridge
#

Hi guys, does camera camera transform exist on server?

#

Cause, when i shot line trace (I use camera world location for start vector and (forward vector * some value + start) for end vector) on server, there is no camera rotation

grave lynx
rustic ridge
#

but i want to do it on server and when multicast to all clients some action

#

so i won't trust client

#

i saw some examples, where people do server only line trace and it worked

faint parcel
#

If I have a UObject that I replicate by passing it to an actor's 'AddReplicatedSubObject' can I then later remove the UObject and add it to another actor if e.g. an inventory item UObject switches inventory?

inner hearth
#

hey, I'm new to this - is it possible to call RPC from Actor class (client side)? or it works only if Player Controller possess this actor?

chrome bay
#

Actor has to be "owned" by the Client, or another actor which is owned by the client in a chain.

#

Top of the chain is usually the controller

velvet jacinth
#

If anyone here has a good advice for that topic I would be glad to hear.
https://forums.unrealengine.com/t/spawn-player-for-multiplayer-top-down/1332538?u=scoly1

Epic Developer Community Forums

Hey guys, I searching all over the web for a good answer. How to propertly spawn a player character while possessing him with an AI controller, AND keep the corrent ownership of each player character. I’m asking because I’m having some problem with my implementation. I’m spawning a junky pawn as the default pawn, then in the player controlle...

inner hearth
twin juniper
#

Hi guys, I am following some character mechanics tutorials (C++), in particular a sprint, and while it works fine, when I introduce some lag (network emulation) I get some corrections (p.NetShowCorrections 1) from time to time. Is this normal or does it definitely mean an error in the implementation?

fallen orbit
#

Why my GetAuthGameMode() function running in server always return Null? UGameplayStatics::GetGameMode(GetWorld()) is also Null.

dark edge
fallen orbit
proven kayak
fallen orbit
#

" it is not possible to replicate properties or call RPCs through a subsystem."

hollow eagle
#

You cannot replicate a subsystem with that.

proven kayak
#

why not? no actor owner?

hollow eagle
#

Correct.

#

Replication is tied to actor channels. Subsystems are not owned by actors.

#

Or at least the default type of subsystems aren't.

proven kayak
#

even with using the subobject list on some random actor?

hollow eagle
#

I highly doubt it'll replicate correctly due to not actually being owned by the actor. There are numerous problems with that.

#

If you want to replicate something via a subsystem you usually have the subsystem spawn an actor on the server and use that as your method of replication.

proven kayak
#

ive used the subobject list for objects not directly owned by the actor before

#

it does work, sometimes

hollow eagle
#

Yes, but was that actor part of the outer chain?

#

Direct ownership isn't required, some ownership is.

#

And I'd imagine that even if it did work somewhat there'd be random things breaking due to assumptions that an object's outer chain eventually leads to the actor it's replicating through.

#

It also requires the subsystem on both ends to have a stable name (not something easy to guarantee without engine modifications)

#

And regardless, this still requires you to spawn an actor. So why bother with hacking the engine up when you can just use the actor you need to spawn anyway.

fallen orbit
#

Learned a lot. Thanks. UE programming has so many traps.

proven kayak
#

@hollow eagle it does work. i put together a quick test of a WorldSubsystem that registers itself onto the gamestate. i got a variable to replicate to clients at least

hollow eagle
#

yes, but you can't access it except through that actor

#

it's not replicated as a subsystem, and you have no clue what else might break

proven kayak
hollow eagle
#

UWorld::GetSubsystem will not give you the "replicated" instance of the subsystem, it will give you a local instance of it.

#

Which means writing a bunch of extra code to grab the replicated one if it even exists

#

Not to mention, again, that there are likely assumptions around the engine about the actor being in the outer chain.

proven kayak
#

the widget on the client is using the normal accessor tho

hollow eagle
#

I have no clue what those values are or where they come from

#

as far as I know you're checking the wrong thing and assuming a value is being set by the server when it's not

proven kayak
#

"Rep Subsystem Test" is the regular node autogenerated by unreal

hollow eagle
#

I'm aware of that

#

I'm talking about what the replicated variable is and how it was set.

proven kayak
#

set by the game state

#

replicated in c++

hollow eagle
#

I would assume something wonky is going on here. Subsystems are created before replication even begins so that subsystem on the client should have been created separately from replication. At best maybe the existing object is being replaced by the replicated one or the actor is grabbing the originally created one and overwriting properties, but I'd imagine that also results in a ton of wonkyness where the object existed before the actor did. I'd be afraid of what this might do to anything that isn't a world subsystem too.
There are multiple UDN posts about using separate objects for replication when dealing with subsystems, I would assume that even if what you think is going on here is actually happening that this is dangerous without understanding why it works and what other systems could possibly break as a result.

#

And once again: there's little to nothing you gain by doing this, you still need a separate actor.

proven kayak
#

as far as I can tell, since the server and client generate the subsystems with the same name, unreal is able to link the two together since I did this:

hollow eagle
#

Yes, that is indeed how that'd happen.

#

Assuming this isn't some PIE-specific weirdness happening since they're in the same process.

proven kayak
#

good point

#

lemme try standalone real quick

#

yep works in standalone. Multicasts ,and OnReps seem to work too.

hollow eagle
#

Oh, this will also break in weird ways because the name isn't stable

#

subsystem collections don't guarantee anything about the name

#

if by some chance another world existed first and a full GC hasn't happened your subsystem won't be matched up because it won't have the "default" name

proven kayak
#

makes sense

#

yeah, its not overriding the name in any way

hollow eagle
#

Actually, that situation might be fine because the worlds would have a different name. Still dangerous because subsystem names aren't guaranteed in any way and if anything else created an object with the same name as what the server's subsystem had then you'll end up breaking something.

#

Anyway, yeah, not something I'd ever do except out of curiosity.

proven kayak
#

yea i was just curious if i could make it do it

hollow eagle
#

oddly enough USubsystem overrides GetFunctionCallspace which is a network thing. So at some point someone was thinking about replicated subsystems but never actually did anything with it.

proven kayak
#

isnt that also for static functions? BlueprintFunctionLibrary also overrides that doesnt it

hollow eagle
#

Actually, I misunderstood what it's for. It's network related but not because the object is replicated

#

It's about ignoring blueprint calls to authority-only functions on clients

#

and ignoring calls to cosmetic functions on dedicated servers

#

both of which are relevant to non-replicated objects

fallen orbit
#

I spawned actor in subsystem. In the actor the RPC function is```UFUNCTION(Server,Reliable, BlueprintCallable)
void CallOnServerToTravel(const FString& inTravelURL);

void ACSSReplicateActor::CallOnServerToTravel_Implementation(const FString& inTravelURL)
{
UWorld* testWorld = GetWorld();
ENetMode testMode = testWorld->GetNetMode();
AGameModeBase* GameMode = GetWorld()->GetAuthGameMode();
AGameModeBase* testGameMode = UGameplayStatics::GetGameMode(testWorld);
if(testMode){};
if(testGameMode){};

testWorld->ServerTravel(inTravelURL);

}

``` FActorSpawnParameters pram;
 pram.Owner = UGameplayStatics::GetPlayerController(GetWorld(),0);
 ReplicatedActor = GetWorld()->SpawnActor<ACSSReplicateActor>(ACSSReplicateActor::StaticClass(),FVector(),FRotator(),pram);
 ReplicatedActor->CallOnServerToTravel(inPendingTravelURL);
```But why it crashed here(in the gen.cpp file):```void ACSSReplicateActor::CallOnServerToTravel(const FString& inTravelURL)
    {
        CSSReplicateActor_eventCallOnServerToTravel_Parms Parms;
        Parms.inTravelURL=inTravelURL;
        ProcessEvent(FindFunctionChecked(NAME_ACSSReplicateActor_CallOnServerToTravel),&Parms); // Here it crashed.
    }```
#

Anyone kindly enlighten me? Struggling for a long time.

torpid girder
#

hello, i am trying to connect to my websocket server but i keep getting LogWebSockets: Warning: Lws(Warning): lws_client_handshake: got bad HTTP response '400' in the logs

#

i am guessing the module has some predefined settings i need to replicate on my server

dusk orchid
fallen orbit
#

@dusk orchid Actually Not very much info rider gives me. Is this enough? I looked up in the chat history of this channel, I don't think it's like the error they mentioned, because it's not repeating, it just happened.

dusk orchid
fallen orbit
#

client

#

I ran it again. Is this because the actor doesn't exist on server?

dusk orchid
#

yeah im thinking this is the issue I would instead have the server call spawn the actor itself and since its replicated itll spawn it on the clietns

#

the reason you're getting access violation is the server never spawned that actor

fallen orbit
#

So, Everything about Replication only transfer from server to client?

#

And I don't know why this time rider gives me actor is None yet the last time it gives me strange information

dusk orchid
#

Replication != rpc

#

rpc are functions that are called locally but then executed on a remote machine

client -> server
server -> client
server -> clients

#

replication are properties that are set in the server and are then updated to the clients

fallen orbit
#

But what about the bReplicates in Actor? How are these actors replicated between server and clients

dusk orchid
#

if an actor is bIsReplicated = true then properties that you set as replicated will be updated when they are changed in the server

#

it will also be spawned on the client

#

so if i have

AReplicatedActor
UPROPERTY(Replicated)
int32 Health = 100;

if i spawn this on the server it will spawn it on the server and client

if i then in the server say
Health -= 50;

in both the client and server the health variable will become 50

fallen orbit
#

I kinda get it. I used to believe bReplicates would make them same in server and clients, which is the problem I got.

dusk orchid
#

yeah just remember you want the server to be the one in control (usually maybe you don't for things that should only happen in the client)

fallen orbit
#

Thank you very much, my friend.

torpid girder
#

hello, does anyone know why the websocket client might be giving me a Error: WebSocket Connection Error: HS: ws upgrade response not 101 message ? i assume my server needs something configured on it

dusk orchid
#

whats your websocket code look like

torpid girder
#
    TMap<FString, FString> Headers;
    Headers.Add(TEXT("worldkey"), TEXT("secretkeys"));


    Socket = FWebSocketsModule::Get().CreateWebSocket(ServerURL, ServerProtocol, Headers);
    Socket->OnConnected().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketConnected);
    Socket->OnConnectionError().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketConnectionError);
    Socket->OnClosed().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketClosed);
    Socket->OnMessage().AddUObject(this, &UAvalonTelemetrySubsystem::WebSocketMessageReceived);

and then i call connect

#

there is little code in the methods right now other than to log

#
void UAvalonTelemetrySubsystem::Connect()
{
    if (Socket)
    {
        Socket->Connect();
    }
}

not exactly anything unusual from what i can tell

#

i can connect in with postman and send json objects

#

i can only assume i have configured something i don't need

#

for values, ws://localhost:8765/ protocolis ws

#

i checked with the debugger and they values look fine

dusk orchid
#
WebSocket = FWebSocketsModule::Get().CreateWebSocket(CHAT_WSS);

    WebSocket->OnConnected().AddUObject(this, &UXYZChatManager::HandleWebSocketConnected);
    WebSocket->OnConnectionError().AddUObject(this, &UXYZChatManager::HandleWebSocketConnectionError);
    WebSocket->OnClosed().AddUObject(this, &UXYZChatManager::HandleWebSocketClosed);
    WebSocket->OnMessage().AddUObject(this, &UXYZChatManager::HandleWebSocketMessageReceived);

    if (WebSocket.IsValid())
    {
        WebSocket->Connect();
    }

yeah looks very similar to what i have for my chat system, so it must be some config issue

did you try to make your wesocket url
wss://localhost:port
?

#

also what are you using to set up your websocket server

latent basin
#

Hey all, whats the difference between just multicasting vs multicast the running on server? I have a simple system that applies a material to a mesh and i run it on multicast and it works fine, but for different examples some people first multicast and then run on server, for instance like playing montages. What happens if you run it on server after multicasting?

hoary spear
#

Huh?

#

Only server can multicast

latent basin
#

Thats weird i have a system where i have a skin material stored in my player controller and on beginplay i call a multi cast custom event which set material of actor mesh using the material stored frm player controller

#

and it works fine

hoary spear
#

Beginplay fires on server aswell

fair latch
latent basin
#

Thanks

latent basin
fair latch
#

It will get dropped if called by client

#

So server rpc , then multicast

queen escarp
#

hey guys i need help, anyone got time to assist me with some widgets displaying friends on screen?

latent heart
queen escarp
#

)

#

sure so, eXi- helped me start the system but we never got to continue and im guessing hes super bussy so ill just send what we got

#

so first thing is that this is suppose to Add/Remove the Widget "player frames" based on players joining / leaving

#

but obviously its not working

#

need help im tottaly lost :/

woven bramble
#

I got a Fatal Error in my packaged game, which makes it hard for me to find a workaround since I don't see the same error when I try again. It's like a 1 in a thousand chance.
But I also need to resolve the error. Any suggestions?

How can I find the cause of the Fatal Error in a packaged game?

raw sorrel
#

I am finding a way to spawn an Actor from the server, but only have it replicate to certain clients. What would be the best practice to do so?

I'm doing client side prediction for an ability that spawns a projectile for fx. If I predictively spawn the projectile on the client, when the server spawns the projectile, it should replicate for everyone but that client.

I have some ideas for how to do this, but I suspect this might be a common issue and there may be a best practice.

Edit:
I am going for this solution, it seems like a good one
https://github.com/tranek/GASDocumentation#concepts-p-spawn

bool APAReplicatedActorExceptOwner::IsNetRelevantFor(const AActor * RealViewer, const AActor * ViewTarget, const FVector & SrcLocation) const
{
    return !IsOwnedBy(ViewTarget);
}
latent basin
# fair latch Only server can do multicast rpc

Makes sense, so is it fine to just call a multicast then from beginplay since its called by server, or should i just call a multicast to run on server and then call that on beginplay?

hoary spear
#

So you can separate the code ran on server vs clients

latent basin
sinful tree
# latent basin Ok thanks that way it will only be run on server and not client?

If it's a replicated actor, begin play will fire on both the server and clients, and it can actually run multiple times on clients as the actor can go in and out of network relevancy which can cause the actor to be spawned and destroyed on specific clients.

This means that Begin Play is usually not the best place to run RPCs, with maybe exception being the player controller on account that it's not replicated to all clients, and it will always be relevant to the client owning the player controller. It also makes little sense to send a multicast from Begin Play on the server as the actor may not exist on any clients by the time you're calling that multicast, and the multicast would not be received by any clients.

The Has Authority node suggested by Squize will allow you to separate what is running on the server or on a client, so if you connect it on Begin Play, that'll allow you to use the "Authority" path to have things run on the server, and the "Remote" path to have things run on clients. This means you can have different functions happen based on where Begin Play is being called. It also means you don't need an RPC from the server to tell a client that an actor started its Begin Play as a client knows when that actor has Begin Play on its own.

pseudo kernel
#

I'm new to mulitplayer and encountered an interesting problem. I have some debug code which draws some debug things in a character's tick.

I noticed really bad ghosting when the net mode was set to a dedicated server, and fixed it with this:

void ASurvCharacter::DrawDebugMovementInfo()
{
    if (GetNetMode() == NM_DedicatedServer && HasAuthority())
        return;

    // Draw debug things
}

This doesn't happen in any of the other net modes, where they all work as expected without the quick return statement. Does a dedicated server netmode do something weird like draw debug strings to all clients, or run duplicate ticks?

fallen orbit
#

Has anyone had this problem? The server called reliable RPC function ClientTravelInternal() which is the ue engine code and runs on client. But APlayerController::ClientTravelInternal_Implementation() actually never happens.

nocturne quail
#

why the scope is scaled to 0.02 on all clients?

if(ScopeType == EScopeType::4x)
{
if(LocallyControlled && bOwnerisAimingLocally)
{
4xScopeActor_ptr->GetStaticMesh->SetScale3D(1, 0.02, 1);
}
}
gloomy axle
fossil spoke
#

If you are calling that on the Host, it will be scaled for all Clients?

nocturne quail
fossil spoke
#

The Host is LocallyControlled

nocturne quail
#

it is a dedicated

fossil spoke
#

🤷

gloomy axle
#

im not sure why we cant see each other on a session

nocturne quail
# fossil spoke 🤷

i will check it using breakpoints, maybe somewhere it is called twice for all clients

nocturne quail
fallen orbit
gloomy axle
#

this is spawnplayer

#

no clue why we can't see each other in the lobby on the same session

#

we seem to be joining it correctly from JoinSession EOS method with no errors

nocturne quail
# gloomy axle we seem to be joining it correctly from JoinSession EOS method with no errors

🧑🏻‍🚀Support us on our 💲Patreon for awesome benefits: https://www.patreon.com/kekdot

In this video we take a look at how we can spawn characters in multiplayer in Unreal Engine. We take a look at installing a function in the Game Mode that will locate player starts for us, which we then use in a Game Mode function that will spawn our players. Th...

▶ Play video
gloomy axle
#

that's exactly the tutorial i followed

#

lol

hoary spear
#

Is there any time value that is synchronized between client server ?

#

nvm i cn prob live with a little uncertainty

queen escarp
#

hey guys i have a problem i have a "particle effect" on my character as a component and i trigger it by setting visability to server then rpc set visible but its only working like 10% of the time

#

the other times its not vissible

#

ideas :/ ?

#

components are replicated also

grave lynx
#

Hey, I have a question about multiplayer fps. Games like overwatch use first person and third person animations. That Means there is 2 gun for a player (tp and fp model).
I have 2 question, which view id doing the line trace? And do they launch a bullet for both view?

chrome bay
#

Usually the camera

fallen orbit
#

Since UObject doesn't support replication and RPC. Then how is GameplayAbility replicating?

#

And Can I execute RPC in GameplayAbility?

chrome bay
#

Network support can be added to UObjects but they must leverage an existing actor.

#

The GAS component provides that

#

Instanced abilities can replicate and call RPCs

fallen orbit
#

Oh, I see.

hoary spear
#

if a struct property is marked NotReplicated, will local changes stick around after the struct itself is replicated?

woeful ferry
#

if you replicate them

lost relic
#

So Im starting replication, And was starting to build a player controller. Currently all Input is done on the Character, But as My player is A vr character and its the only option for the player to control, Do I even need a Player controller for this?

hoary spear
peak lintel
#

Hi. I have a small question.
Material parameter values are not replicating or what I'm doing wrong here?
If I have more characters with the same skin, the emissive is changing on all characters. What I want is to change the emissive only on the character who receives damage and others to see this.

hoary spear
#

You can mark timelines for replication

peak lintel
hoary spear
#

I'm confused about your logic, i'll admit that

#

You've got a hard set instance reference?

#

or is it a material parameter collection ?

peak lintel
#

When, you hit an enemy, that enemy is playing an montage and everyone sees it. I'm also adding an emissive using a material parameter collection which changes the emissive on the enemy who got the hit. Now, if all enemies are having the exact same skin, the parameter is changing all the skin's emissive

peak lintel
hoary spear
#

Well if they're all reading from the same collection, they're all gonna change

#

Youd need to set the param on the material instance of that specific pawn

peak lintel
#

Should I use the SK and change the material instance?

hoary spear
#

Usually that also involves Create Dynamic Material Instance

#

Id also have the value as an OnRep but i guess this isnt super important

peak lintel
#

Thank you! I'll try it now

solar stirrup
#

Question about replicating instanced structs. If the struct has NotReplicated properties, will they be overwritten when the struct is updated by the server?

#

I know it's not the case with regular structs, just making sure instanced structs don't have some weird behavior

hoary spear
#

Suspect the answer is no there aswell

solar stirrup
#

Yeah that's regular struct replication

#

I suppose it's the same for instanced structs but i wanted to be sure hah

hoary spear
#

Id be surprised if it was different 😅

coarse patrol
#

Hlo guys
anybody know to make client spectate server or other player
https://wizardcell.com/unreal/spectating-system/#1-clients-cant-spectate
https://unrealcommunity.wiki/revisions/61e4ba838805f02ef3f6c996

i referred these two resource, i was able to** make it work for server** but client spectating is not working
can anybody help

C++ Sample project covering common gameplay concepts packed in a small survival game.

WizardCell

Making a Spectating System the “engine way”

frail temple
#

Can someone assist me with this, either I'm not thinking straight or I just can't find the answer. Trying to spawn an actor on Client only but when the server runs it for Client only it also spawns on other clients. It works perfectly fine for Clients but not the ServerClient. (Tried it with Client , Server & No Replication)

dim barn
frail temple
#

I don't want it spawning for the other Clients as it's just a "ghost" building for the Client to decide where they want to place it.

dim barn
frail temple
#

When I turn bReplicates off, it then doesn't spawn the actor when it is called from the server to the Clients . So if this is the issue, I'll assume I need to make two different BP_Actors - One with Replicates on and the other with it off.

#

NVM

#

I'm a fool, I can change bReplicates when spawning the actor.

quasi tide
#

Client that is hosting the game spawns it for Client

This is a weird. That client IS the server in this case

#

Unless you've modified the engine or doing custom networking

dim barn
#

He wants it to work for both Dedicated and Listen servers. That's why you have to handle 2 scenarios.

quasi tide
#

I don't see anywhere where they mention they are supporting both setups. That said - it is trivial to do.

frail temple
#

I haven't modified it. I know one of the Clients becomes the server (the host of the game). It's just when the player for the Server spawns it for themselves, it also spawned it for the other Clients and with every reeplication I tried it didn't work - I didn't know that I could call the Set Replicates after spawning the actor

quasi tide
#

So you're doing host migration?

#

Client has a pretty specific definition in the context of UE networking. It can easily be confused with the way you're using it imo.

frail temple
quasi tide
#

Client implies that you are not the server

frail temple
quasi tide
#

So "client becomes the server" would be host migration pretty much

#

Obviously client also means the player. But for most speak, client is non-server

frail temple
quasi tide
#

Yes.

frail temple
#

Most of the stuff I've done so far work perfectly fine, this was the only issue I've come across.

quasi tide
#

But when asking for help or talking about it, you don't say "the client that is the host". You just say "the server" because that's all that matters.

frail temple
#

Ok

quasi tide
#

Client that is hosting the game spawns it for Client
So with that in mind - this reads very weird if you're only in the context of Unreal.

#

(Again, I know client has a dual meaning here!)

frail temple
#

Yea I get you, I'm trying to figure out how I would phrase it now. Would you just the Server Player? The Player that is running the Server?

quasi tide
#

Just server - because that's all that matters

#

"Server spawns it for the client, I don't want it to. I only want to spawn on the server"

frail temple
#

Ok, so the issue was the server was spawning the actor for all the clients when I wanted it just on the server

quasi tide
#

Right. In which case, you just disable bReplicates (which you already know now)

frail temple
#

Yea, I didn't know I could call bReplicates after spawning the actor

frail temple
quasi tide
#

I wonder if doing a deferred spawn would be better, that way you don't set up the actor channel 🤔

#

@chrome bay Do you know when the actor channel actually gets set up during the actor lifecycle? (not at my IDE)

lusty sky
frail temple
frail temple
lusty sky
#

you need to set it in the constructor if you want the actor to replicate, maybe if you can show your code

frail temple
#

Can confirm, it works that way for now.

I'm using BP's for now since it's technically a prototype game.

#

My literal cheap cut easy way to make it work for the time being. By default I changed it to bReplicates = false and I change it to True when spawned.

lusty sky
#

also check replicate movement if needed

frail temple
lusty sky
#

thats the expected behaviour

quasi tide
#

Actors have like 14 lifecycle events or something crazy like that

frail temple
#

Hang on sorry. So I changed it to bReplicated = False after the Actor spawns as I didn't want it to Spawn for the Clients when the Server called it, that very initial setup would Spawn it for the Clients. Just setting it to False for the time being just lets me quickly test it.

#

Clearly my logic was flawed with the whole "Setting to False after it Spawns" because it still spawned :/

#

I'm just going to add a variable in after where bGhost = True > Replicate = False else True

lusty sky
#

Hmm if its a ghost to display where the actor should be placed, just spawn locally on the client without any rpc's just call spawn actor directly and make another ghost actor that is not replicated

frail temple
#

I tried that but when the Server called to do it without any RPC it still replicated.

#

I tried Replicates = Client/Server/No Replication and they all caused that issue for me, spawning it for the Client as well as the Server

#

Believe me, I thought it was going to be a simple thing but I must have done something somewhere that made it not so simple.

lusty sky
#

it is simple, you should use 2 different actors, one for ghost not replicated (bReplicates = false in class defaults) and the second actor for a building that replicates (bReplicates = true in class defaults) then you don't need to call SetReplicates function

frail temple
#

I'm only using the single actor for now, would it be bad to use a single one in this case?

frail temple
lusty sky
#

maybe thats what caused the problem in the first place, try to make a child actor of your current actor and use one of them as ghost that is not replicated and make the other one replicated without calling SetReplicates function

frail temple
#

I would have probably thought of the child actor further down the track when I go over everything again and ask myself "Why did I do it this way and not the other"

#

I was honestly just going to use the single actor and change out the material & replicates once spawned into the world.

abstract pike
#

Has anyone had replication graph suddenly die on them recently with the GameplayDebuggerCategoryReplicator becoming None in the always relevant node?
🤔

wanton cedar
#

feelin cute, so ill ask for advice, whats the right way to specify the level when executing server travel command? i have seamless travel enabled and a BS level for a lobby..

#

the map is /Content/Maps/LevelTwo =/

blazing spruce
formal solar
#

Is it possible for cheating to occur with client authoritative movement via 'add movement input' and 'add controller yaw'?

I have 2 types of pawn, 1 is visible and is move server authoritatively, the other type of pawn is less important and is invisible. Problem is this has different parameters and I am having trouble getting it to move smoothly using server authoritative movement. Since it's invisible I don't care about slight conflicts between its position on different clients (it's also not relevant to anything fast-paced). But could a player cheat by getting it to move very fast?

serene kestrel
# formal solar Is it possible for cheating to occur with client authoritative movement via 'add...

Clients should be authoritative over their own inputs (i.e. key presses) but if you want to prevent certain types of cheating, the client needs to send these inputs to the server and the server processes these into movement updates. To get smooth movement in this model, the Client needs to also do the same processing and predict the movement updates the server will calculate. The default CharacterMovementComponent works in this way so as long as you're calling AddMovementInput and AddControllerYaw on the client things should be Server Authoritative and smooth

potent coral
#

how to replicate UObjects in blueprint?

#

i checked replication flag but it doesnt seem to work

serene kestrel
# potent coral how to replicate UObjects in blueprint?

Afaik you can't do this for your own arbitrary UObjects in blueprint. If you want to replicate a UObject, you'll need to use some c++, or make your UObjects ActorComponents and attach them to a replicating Actor (as well as set replicates=true on the actor component)

potent coral
#

i am making an inventory system

#

is there any class other than actor i could use to replicate it instead?

serene kestrel
# potent coral is there any class other than actor i could use to replicate it instead?

All replication in Unreal requires a replicated Actor to start with. That Actor can optionally replicate UObjects on it's channel using a c++ method ReplicateSubObjects. By default, Actor will replicate it's ActorComponents on this channel. If you want to replicate your own UObjects on that channel as well, you need to do some c++ (or just use Actor Components)

Alternatively, you can send all of your updates via RPC's which could maybe work depending on your data model but you'll need to handle all kinds of edge cases to ensure reliable sends of data

wanton cedar
#

ahhhh, looking at the log, it showed cant have a space between MapName and ?listen

#

removed that and servertravel kicked

potent coral
#

but can i use components inside a component?

#

because my uobjects are already in an actor component

serene kestrel
#

You can, when you create them make sure to set the Actor as their Outer object though.

potent coral
serene kestrel
#

You want the Outer of the Actor Components you create to be the same as whichever Actor you will be replicating them on

potent coral
#

alright then that would be the player in this case i guess

potent coral
serene kestrel
potent coral
potent coral
#

or is that done automatically in BP?

#

guess the outer for components is always its attached actor 🤷‍♂️

#

ohh no, its the target input

supple vapor
#

Does anyone know what nonOwnedActors mean when doing seamless travel? It's pulling in random actors like the controlled pawn even though the docs specifically say only the controller, player-state get pulled in by default

serene kestrel
potent coral
#

i wonder if stacking this many components on my player would have any detrimental effects though

#

since they are actually attached to the player now and not the inventory component

#

cant use self reference for target

serene kestrel
#

There shouldn't be that much of a detrimental effect as long as your not iterating through all of your Actor's components very often

potent coral
#

well i do use components quite a lot

#

kinda everything is nested in some component lol

#

but in worst case i can use a separate actor as container i guess

#

mass spamming components is no bueno 😂

#

with uobjects i could add 100k in 1 loop no problem xD

#

now it freezes for a minute and then dies when i try to add 10k lol

serene kestrel
#

Ah, yea 100k objects is quite a lot...

potent coral
#

im still hoping i can get the uobjects to work, maybe im just being retarded lol

dim barn
#

@potent coral Is each item in the inventory a new component?

potent coral
hoary spear
#

sounds a bit strange I'll admit

potent coral
dim barn
#

But why not just have an array holding all the items?

hoary spear
#

^

#

And who needs millions ..

potent coral
#

well thats what i do, just the items are uobjects lol

hoary spear
#

Uobjects is pretty common

#

i use GameplaytagStacks

#

works fine

potent coral
#

but how to replicate it? `,...,´

hoary spear
#

replicateSubObject

potent coral
hoary spear
#

can't

potent coral
#

cancer

hoary spear
#

you can do structs tho

#

😄

potent coral
#

structs arent powerful enough

#

guess components is the only way then

hoary spear
#

why are they not?

#

what do you miss?

#

or want

potent coral
#

because i cant subclass structs lol

hoary spear
#

yeah you can

#

well

#

not in bp

#

😄

hoary spear
#

InstancedStructs exist

potent coral
#

blueprint structs are useless

#

why cant i just replicate uobjects and their properties lol

hoary spear
#

but

#

isn't item info static?

potent coral
#

no

hoary spear
#

!?

#

okey then x)

potent coral
#

thats basic data for all items

hoary spear
#

Count is not part of item definition, neither is durability

#

normally anyways

potent coral
#

but i also have some subclasses like consumables etc with more stuff

hoary spear
#

relationalDB setup would work

potent coral
#

whats that?

hoary spear
#

Instead of a superDT that holds All variables known to man

#

you split it in several DT's,

#

and let one DT point to another DT

#

and thus 'construct' the complete item definition on the fly

potent coral
#

thats kinda what i was trying to avoid with this system xD

hoary spear
potent coral
#

because i made my last inventory like this xD

#

but it was kinda meh

hoary spear
#

I do too, and it's awesome

#

All i replicate is some row pointers

#

(or in my case, just gameplaytags, as those are my rows)

fierce egret
#

I have a weird problem with variables. My array has 10 items, i add 2 more with some code. After adding, code goes to client side to update some widget. But when i print length of array in widget, it prints 10. But if i use Delay Until Next Tick or Delay node, it prints 12. I couldnt understand this. I am already adding array at server side first, then print it in client. Why do i need to use delay node. I know delay is not right solution and dont know what is it about.

First screenshot is when i dont use delay node. You can see it prints ADD firstly. But client doesnt print 12.
Second screenshot is when i use delay. Again, server adds firstly, and client prints 12.

hoary spear
#

how are you printing this

#

unlikely that you're doing OnRep

hoary spear
#

And if you are, is this object pointers ?

hoary spear
fierce egret
#

I print ADD in component and length in widget

potent coral
#

but yeah as @hoary spear suggested, just use OnRep to print your variable

fierce egret
#

Do you mean change replication as RepNotify?

#

Then print in OnRep func?

hoary spear
#

yepp

#

for clients

#

you set the array (or add to it) on the server
Then the clients will get the "OnRep" event when the item is replicated

potent coral
fierce egret
#

It looks good, can clients set a variable which is RepNotify?

#

Or is it same with Replicated

potent coral
#

only server

hoary spear
#

i love how consistent it is

#

bp vs c++

#

😄

potent coral
#

lol

fierce egret
#

Thanks for help :)

fierce egret
#

I will change my codes to RepNotify but it looks better

quasi tide
fierce egret
#

talking about cheating

quasi tide
#

This is how basic prediction works. The client updates their side and then the server may or may not correct the client when the client gets the server's value.

potent coral
#

guess i will just not use shitty unreal replication and use ye ole networking instead

maiden nexus
#

Hi guys! I have a question, I'm using online subsystem steam, and I'm using the dev app id 480, my project create the session successfully, but when I try to join to the session from another steam account, the project doesn't find my currently session created, it's weird
void UNSM_MultiplayerManagerSubSystem::OnFindSessionComplete(bool bWasSucessful)
{
if(!SessionInterface.IsValid())
{
FNSMOnFindSessionCompleteDelegate.Broadcast(TArray<FOnlineSessionSearchResult>(), false);
return;
}
if(LastSessionSearch->SearchResults.Num() <= 0)
{
FNSMOnFindSessionCompleteDelegate.Broadcast(TArray<FOnlineSessionSearchResult>(), false);
CreateSession(3, FString("FreeForAll"));
return;
}

SessionInterface->ClearOnFindSessionsCompleteDelegate_Handle(FindSessionCompleteDelegateHandle);
FNSMOnFindSessionCompleteDelegate.Broadcast(LastSessionSearch->SearchResults, bWasSucessful);

}This always create a new session because the searchresult it's 0

hoary spear
#

Personally i had trouble with that myself and just jumped over to advanced steam sessions 😅

grand kestrel
#

Can we not post memes in programming channels, they're distracting

rain condor
#

Anyone knows how install als replicated plugin?

potent coral
#

well its not like the inventory will be used that often

#

and in worst case i can switch to a system that isnt object oriented

#

yeah thats on my radar rn too

#

wdym?

grand kestrel
potent coral
#

well im making a blueprint only project, so doing it the unreal way is kinda my only option xD

quasi tide
#

You're going to have a bad time if you're trying to do networking as BP only.

grand kestrel
#

Is there even such a thing as a blueprint only project when the entire engine is built on C++
Adding C++ to your project is no different

quasi tide
#

Not saying you can't mind you. But so many things are simply not exposed to BP

grand kestrel
#

I don't understand the purpose of BP only

quasi tide
#

And depending on your goals - it might actually simply not even be possible.

potent coral
#

well i already have a working blueprint inventory system for multiplayer, im just trying to make it in a new/better way

grand kestrel
#

Anyone making a multiplayer inventory instead of using ArcInventory is either doing it for the sake of learning or insane imo

potent coral
#

but i wasnt aware how cancerous networking uobjects in blueprint was when i started making it xD

grand kestrel
#

You pretty much aren't going to make something better

#

Its not cancerous, its just not supported
There's no reason you can't just do it in C++ and expose your replicated UObject to BP

quasi tide
potent coral
#

well this new system has no problems adding 100k new objects in a single for loop

grand kestrel
quasi tide
#

I haven't heard of this plugin and it doesn't look too enticing to me. Especially considering I don't use GAS at all. Definitely don't want a plugin that has that as a dependency.

potent coral
#

for comparison, when using actor component in the same system, it cries already when adding just 100 objects

#

thats literally 1000x worse performance lol

grand kestrel
quasi tide
#

It's not a matter of being familiar with GAS for me. It's a matter of not wanting that dependency.

grand kestrel
#

Why's that?

quasi tide
#

Because I don't use it and it's just extra crap

potent coral
#

u dont need GAS to have gameplay tags

quasi tide
#

Not to mention - this is a code plugin, so that is potentially $150 per seat. However the rep at Epic wants to define it that day.

grand kestrel
#

What? Its not per seat

quasi tide
grand kestrel
#

Licensing terms are clear, you can share with people working on your project

quasi tide
grand kestrel
#

I will continue to go by the licensing terms

quasi tide
#

If you have 5 people are working inside of the plugin (IE the code part), you need 5 copies of it, per Unreal's own terms

#

Along with screenshots of discussions with Epic

#

But if your level designer is using it (for w/e reason), just using it, you don't need the additional "seat"

grand kestrel
quasi tide
#

Good question. Maybe you'll have better luck getting Epic to clarify.

grand kestrel
#

Anyway sorry for getting off-topic
Didn't mean for it to turn into a thing 😄

fossil spoke
#

Guys move to a different channel please, this is offtopic now

quasi tide
#

We stopped

fossil spoke
#

👍

fierce egret
potent coral
#

or change replication conditions

#

or could also use a RPC to print your message on client with value from server

fierce egret
#

I will check replication conditions, thank you

potent coral
dark edge
potent coral
#

nein! not zeh GAS!

fossil spoke
#

@potent coral Please stop posting memes. If you want to post memes do so in #lounge

potent coral
#

💔

grand kestrel
olive kraken
#

Hey, double checking something here.

If I get the game instance and cast it inside a widget class, and right after I load a save object, does that mean that 100% I'm getting the save object of the local machine and not any other server and/or client?

#

Or, in other words, what is the best method to retrieve a save file within a widget?

quasi tide
#

GameInstance is local only

#

Widgets are local only

#

So if you're getting a save game that way, it is the save game on the local machine.

gloomy axle
#

Hi all,

I'm having a bit of an issue hosting a dedicated server via a batch file, I followed Epic Games' EOS session tutorial, but at the very end myself and another dev (on a separate machine) can't seem to see each other when joining the session. We're using UE 5.2. and the latest EOS. Here's the general flow:

  1. We both open the game application
  2. I run StartServer.bat with this command:
    "C:\Program Files\Epic Games\UE_5.2\Engine\Binaries\Win64\UnrealEditor.exe" "C:\Users\MyName\Documents\Unreal Projects\ProtoPlaneFootball\missile-ball\ProtoPlaneFootball.uproject" Lobby -server -log -epicapp="Server" -options pause
  3. We both login correctly on the game application, through EOS Login. We confirm this by being able to see the overlay and our username in-game.
  4. We click Play Game to bring up a sessions list
  5. In the sessions list, we both see the same session id and session container (just a join and delete button)

When we both join the session, we can't see each other.

I confirm the session is being created via the StartServer batch file by checking the dev portal, so I'm not sure if it's due to the join session logic or if I'm missing something crucial. Below is my JoinSession logic in my EOSGameInstance.cpp
https://pastebin.com/DnjfUKtC

#

we've been trying to see each other in-game for a while, not really getting anywhere

olive kraken
# quasi tide GameInstance is local only

I see, thanks! So if I'm not wrong, I don't even need to use the game instance, any save game that I cast within a widget will be the save game of that local machine. Correct?

quasi tide
#

If the widget is what is loading locally, then yeah.

#

Because you could also send a save game through the network, as an FYI.

#

So assuming you're not doing that

olive kraken
#

Yeah, not the case, trying to retrieve all saved settings without getting wrong save objects

#

useful, needed to double check for peace of mind, thanks!

gloomy axle
gleaming crane
#

Hi everyone, just wondering if Advanced Sessions is updated for use with 5.2? If It is, it is recommended to use if I'm trying to do multiplayer hosted servers through Steam?

fossil spoke
#

The Logs will tell you if it managed to join successfully.

gloomy axle
fossil spoke
#

For both players?

gloomy axle
#

yeah

fossil spoke
#

Why are you both calling Create Session???

gloomy axle
#

Oh my bad thought you were asking something else

#

the command prompt logs shows it created the session

#

but nothing afterwards about joining, despite using JoinSession on the same name

fossil spoke
#

So one player calls Create Session?

gloomy axle
#

no player does, it's ran via a batch file

fossil spoke
#

Which would be the host.

gloomy axle
#

it's a dedicated server

fossil spoke
#

Ok then Im talking about the Players Logs

#

What does their Logs tell you about connecting to the session?

gloomy axle
#

Well I see the connection info before and after the client travels, it changes but that's about it for logs

#

then it puts them into the staging area

#

but there's nothing on the dedicated server, hosting the session, command prompt that shows they join

fluid prawn
#

Question, with sub stepping used for simulation of anything on the client side (Movement, Physics), if the client simulation is fixed and anything is substepped below the upper limit does this data need to be also replicated to the server or can the client just send the final result of the simulation to the server and then the server just interpolates that data as is (meaning the server doesn't need to substep also).

thin stratus
#

@fluid prawn the CMC at least performs substepping on both ends.

#

But of course only once RPC

#

Not one per substep

#

At least the current cmc

#

5.4 should come with a new system iirc

#

At least they said so at UnrealFest

fluid prawn
#

he had issues with desyncing also

#

after adding client side substepping and was just sending the movement to the server as is

thin stratus
#

Substepping is meant to have a more precise result. Since server compares their result against the clients one, it must to the steps too

fluid prawn
#

yea

#

well I didn't know but logically in my head I was thinking like, well if say I substep all clients at 60 hz or w.e ideally I'd like to sync the server at the same rate

#

I assume CS works this way too I think

#

128 60 tick etc

thin stratus
#

Well client does not send the substeps

fluid prawn
#

no ofcourse

#

I mean like the server does the calculation also

#

ie it substeps based on client data sent

thin stratus
#

Yeah but the server uses a calculated delta time for clients iirc

#

Basically time since last move I guess

fluid prawn
#

yeah

thin stratus
#

I'm eager to know how Movement 2.0 will be

#

I really hope it will allow more than just characters

fluid prawn
#

I had someone ask epic about it and give me some little details

thin stratus
#

And more systems to use prediction

fluid prawn
#

was something along the lines of modularity and roll back

#

but he said that it wasn't something you couldnt sit down and implement given time

thin stratus
#

Pretty sure since 5.3 shipped, one can scout main branch for this

fluid prawn
#

but for new people its def a time saver

thin stratus
#

I think right now the engine has a huge problem with only the CMC being properly predicted

#

And every other system running its own prediction code, not in sync with another and often only half assed for the given problem

#

Time will tell

fluid prawn
#

yeah, it's needed a rework since I first came into unreal. I am glad they are working on it. I remember there was a prediction plugin I was seeing pushed on the github

#

that also kinda died, rumors the person working on it left or something

#

Thanks @thin stratus for the wonderful response

thin stratus
#

The plugin is also still there. They update some small stuff on it. Could be that it's the core of the new movement. Who knows

quasi tide
#

It pretty specifically says a goal is to allow it to be on any actor

queen escarp
#

Hey eXi- You got time to help me 🙂 ?

hoary spear
#

You shouldn't randomly ping people

#

If he's here, got time to help, and want to help, he'll answer

#

if not, bugging him with pings is not a good way to go

queen escarp
#

y i know you right

#

its just he started helping me 1 week ago with the thingi :/

#

but yeah your right

hoary spear
#

Pose your question, and somebody else might be able to answer

#

Gotta expect to do a little work yourself as well, understanding it as best you can

queen escarp
#

yeah ofc ive tried trust to

#

me*

#

i guess i can ask again it quite much thats why ppl wont answer cuz its not just "a wrong" its not working at all really

hoary spear
#

You should try and reduce your problem to as few things as possible

#

and be precise when describing it

#

showing code helps alot

queen escarp
#

yeah ok so firstyl what im after is a UI lineup of the friendly players

#

yeah so its quite alot really messy but this system is suppose to add/remove widgets in the slots based on ppl joining / leaving

#

problem rn is that nothings happening

hoary spear
#

And what have you found out from debugging?

queen escarp
#

yeah so the first bugg we had was that it got a null reff from the playerhud widget from wich eXi told me to relloacte it to the player controller instead of the player wich i then did (was alot of work) but that the first thing now that works

hoary spear
#

But whats debugging it now telling you?

#

What code is not fired or which variable is not valid etc

queen escarp
#

well

#

thats like the hard part

#

the "character from the friendly hero is NOT VALID*

#

and that being set up like this

#

from this part calling it

hoary spear
#

You shouldnt use GetPlayerController for one

#

Whats calling SetCharacter ?

#

Is it valid when its set?

#

Is that server side or client side ?

#

And... are you checking a replicated variable in a widget?

#

Or do you have a replicated variable in a widget?

#

The reason i ask is because widgets dont replicate

#

So having a replicated variable inside a widget doesnt make sense

#

Not sure what Exi suggested, but wouldnt it be reasonable tonread out the player array from the gamestate and use that to chevk affinity/team and add the widgets based on that list?

queen escarp
#

im not sure tbh he made this example the wholeness but we never "finnished" thats the part

#

im not sure of any of that i just did what he suggested

#

maybe this is a to hard way to do it i maybe should find a easier solution :/?

hoary spear
#

If theres so much insecurity at this stage i kinda wanna suggest dropping multiplayer if thats an option 😅 it adds a ton of complexitiy

#

Steep leaening curve, many gotchas

#

Being able to debug, understanding the framework, server authority etc etc etc

queen escarp
#

im to deep into the proeject to drop it 😛 everything else works fine its just this part im struggeling with with mp

hoary spear
#

Nothing special about this vs the rest 😅

#

You didnt answer most of my questions tho

queen escarp
#

yeah im trying to get it but it messy

queen escarp
#

i mean

#

in my head this logic should work ?? im getting all gamestates and getting each playerstate from that and getting info from each ones individuall state ?

#

right ?

hoary spear
#

You're cutting so much, it's hard to see the full picture

#

But im theory it should work if their replication is complete

queen escarp
#

im just testing

#

right ?

#

so now it only gives the local players info on all frames

hoary spear
#

Does this work?

queen escarp
#

its only displaying its own name

#

its own states*

#

oh right could the problem be

#

in the player state this is how im setting player character

#

by get player character

#

thats could be the issue right

#

or why is it not working :/&

coarse patrol
queen escarp
#

Y

#

@coarse patrol exactly

coarse patrol
#

👨‍🏫 My Patreon link:
https://www.patreon.com/kekdot
Download Project Files | Premium Tutorials | Courses


In this tutorial video I show you how you can make a replicated Player List that displays the players that are connected to your session. The Host/Server of the session will also be able to kick the players from the session, and will not...

▶ Play video
queen escarp
#

will do ty!

potent coral
queen escarp
#

just testing stuff

queen escarp
#

ok so i remade the whole thing

#

based on the tutorial

#

@coarse patrol

#

since the tutorial is not exactly what im after obviously im trying to adjust it but it was basicly what i already did before but missed a few things, tho now im stuck at the same problem

#

so now it works by when pll joining / leaving the game the Widgets gets updates removes/added correctly

#

however the update information dose not

#

this is the problem

#

theyre all displaying player 1´´s info

#

@hoary spear

hoary spear
#

What is player char bp parent anyways?

queen escarp
#

thats the "player character"

hoary spear
#

Again, these random tags...

queen escarp
#

aye it begann as something else but that was months ago and renaming stuff in unreal ive noticed is a big nono X)

hoary spear
queen escarp
#

oh'*

#

aye sry xd though u would be interessted since u started to help 😛

#

so this one ?

#

😮

hoary spear
#

Yepp

queen escarp
#

its working

#

noooicee

#

i think

#

altho

#

one small thing

#

now its adding the ammount of players in game

#

i dont want it to add "self" only friendly players

hoary spear
#

Check the owning controller of the playerstate

#

And if its equal to the owning controller of the widget, block it

#

You also dont need to cast to your game instance fyi

queen escarp
#

im not casting to my game instance :/ ?

hoary spear
#

In the start you are

queen escarp
#

thats the game state

hoary spear
#

Ah same

#

Dont cast it if you dont need it

queen escarp
#

oh, well its a custom one so then i have to ?

hoary spear
#

No

queen escarp
#

i just did as the tutorial said

hoary spear
#

Custom is extension of basic

#

Screw the tut

#

Trust me

queen escarp
#

oh ok

hoary spear
#

😈

queen escarp
#

so i just get the game state really ?

hoary spear
#

Ye

#

And grab playerarray from there

queen escarp
#

yy

#

testing

#

hm aye that dident work :/

hoary spear
hoary spear
queen escarp
#

when i only get the game state

#

comparre to casting

hoary spear
#

Its the same gamestate

queen escarp
#

oh yeah my bad

hoary spear
#

Casting doesnt fix invalud gamestate

queen escarp
#

thats noit the problem

hoary spear
#

Exactly

queen escarp
#

ok so on my client´s its not showing the host

hoary spear
#

Thats the point right?

queen escarp
#

erhmm so this is weird

#

server shows all 4 client 1,2 shows only 1 and client 3 shows all 4

#

wtf

hoary spear
#

Ok pc is not replicated

#

My bad

#

Check if the playerstate is == owning players playerstate

#

Or rather !=

hoary spear
#

If its equal its the owning players playerstate

#

Otherwise its another clients playerstate

#

Your checking playerstate against playercontroller

queen escarp
#

oh right

hoary spear
#

You gotta keep track of the object types you're comparing

queen escarp
#

so acctualy like this ?

hoary spear
#

Yepp

queen escarp
#

hm ok idnno what happening but this is weird

#

displaying 3 2,2 1

hoary spear
#

Assuming you plugged in the owning player

queen escarp
#

yy

hoary spear
#

When you made the widget

queen escarp
#

did

hoary spear
#

Is it still updated on tick?

queen escarp
#

no

hoary spear
#

Timing is an issue

#

Replic takes some time

queen escarp
#

so basicly its updating in the game mode with the login / logout

hoary spear
#

Try it on tick just to verify

queen escarp
hoary spear
#

Gamemode is server only

queen escarp
#

yeah and that calling the fucking Updateplayerlist

#

botttom right

hoary spear
#

Also swap for retriggerable delay

queen escarp
#

ah smart

hoary spear
#

And change it to 1 sec

queen escarp
#

aye thats smarter % better ofc but same issuue

hoary spear
#

Same still?

queen escarp
#

so the game mode calls this in the game state

#

rep notify updates the widget

hoary spear
#

Check if the widget is updated multiple times

queen escarp
#

hm thats weird

hoary spear
#

You dont need to set arrray w notify

#

Im not sure thatt works?

#

If ttheres no changes

queen escarp
#

again the tutorial said so 🙂

#

im doing listen server tho could that matter ?

hoary spear
#

No

#

Id have a "playerarraychanged" rpc tbh

#

But idk

#

Hard to verify your issue

queen escarp
#

instead of rep notify ?

#

aye :/

hoary spear
#

But youd want a delay between the replication, and the event on the clients

#

I shame delays relentlessly for network code

#

So i dont approve of my own suggestion

#

😅