#multiplayer

1 messages ยท Page 196 of 1

round mist
#

Did you change the clients movement speed with logic somewhere?

mellow hatch
#

No it's on a fresh project but pktlag is at 400

#

400 with variance of 50 i think and some loss

round mist
#

Then I guess that would probably check out. Is it fixed when you turn off the lag?

mellow hatch
#

Yeah, I was mostly just wondering if that's just kind of how it is functionally.

#

I don't expect people to play a game with that ludicrous of ping, I'm mostly just wondering things

thin stratus
#

It's because the Pose of the Mesh is not Ticked every Frame on the Server but only when the Server receives a ServerMove.

#

Lower Client Framerate -> Lower RPC count -> Lower TickPose count -> Laggy

mellow hatch
#

That makes sense. Thank you

thin stratus
#
    /** True if calling TickPose() from Autonomous networking updates. See ACharacter. */
    UPROPERTY(Transient)
    uint8 bIsAutonomousTickPose : 1;
#
    /** If true TickPose() will not be called from the Component's TickComponent function.
    * It will instead be called from Autonomous networking updates. See ACharacter. */
    UPROPERTY(Transient)
    uint8 bOnlyAllowAutonomousTickPose : 1;

#
void ACharacter::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);

    // If we are controlled remotely, set animation timing to be driven by client's network updates. So timing and events remain in sync.
    if (Mesh && IsReplicatingMovement() && (GetRemoteRole() == ROLE_AutonomousProxy && GetNetConnection() != nullptr))
    {
        Mesh->bOnlyAllowAutonomousTickPose = true;
    }
}

#

The thing with that is that you could argue that it's laggy and looks shite and should be altered. And a lot of people do that. They override PossessedBy in their Character and manually call APawn::PossessedBy to skip the Character one.

#

And then alter the places in the CMC where TickPose is called manually.

#

But you destroy that "sync" they are talking about. Does that matter? I honestly don't know.

mellow hatch
#

I assume it does

thin stratus
#

I almost feel like this is code from 4.0 or earlier that is still from times where Epic largely used UE for UT and similar, where DedicatedServers were more important

mellow hatch
#

Would changing it so the animation isn't entirely dependent on the tick in that way mess it up? Like is there a better way to sync animations than constantly ticking like that?

#

Like with how it is if you tried to make a fighting game in this fashion i feel like it wouldn't work but i think i might just not understand it that well.

thin stratus
#

It depends on what they are trying to sync here

#

They clearly try to make sure that the Movement code is in sync with the Mesh Animation.
That would mostly matter if you use the Mesh specifically for something in relation to movement I guess

#

I don't really see the need tbh, but that is a very specific thing, so you might need to check if changing it breaks anything

#

Since the last time I disabled this it also changed abit, cause there are now like 4 places or so they call Tickpose in the CMC

#

Back when I did that there was one

mellow hatch
#

I've seen people try and time hit boxes to activate and deactivate at certain animation frames around the model itself so I'm just wondering if that's a bad idea or what

#

Like use montages to send animnotifies to call gameplay stuff, I mean

#

And I'm wondering if this sort of jittery animation from ticking the pose would mess with that?

#

Also it seems unnecessary but I could be wrong. In a scenario where you cast a spell a single time and as long as it gets validated, would the tickpose still make the animation messy if the user's ping spikes at that time?

#

My knowledge of ue is limited so if I sound dumb just tell me lol

thin stratus
#

@mellow hatch Honestly, no clue. It makes sense to think about Montages here, as they often are used to trigger gameplay logic, such as enabling sword collision etc.
But since UE is damn bad with Prediction etc. outside of the CMC, I hardly think it matters if that's slightly off.

#

RootMotionMontages might be a thing to think about

mellow hatch
#

at that point i think trying to use that better synced clock in pins might be better since i'd like to make a faster style game. probably the best for keeping things in time at that point?

thin stratus
#

Probably

mellow hatch
#

or close to in time

#

another thing i was wondering is like, if i shoot a singular bullet, does that go in multiple packets? or like how does that work physically. if the packet gets lost does that bullet just not get fired or can ue tell if it didn't go through and try to correct the client at the very least or something?

earnest cloak
#

Why is the variable not replicating to the client? For context that server event is called by a sequencer event. Oh and there also anothr float variable in the same blueprint that supposed to replicate but it is not too
[ Resolved: I accidentally checked only relevant to owner when this actor is not meant to have a owner ]

ivory snow
#

Hello people, I am trying to replicate a muliplayer jetpack effect on Lyra starting project. But I am not sure how to do it, any suggestion? Rightnow I call a function on the blueprint with a gameplay ability that checks if the player is locally controlled if it is it activates the jetpack vfx ans sound effects

dark parcel
#

I scrap all the bandaid and didn't even toggle it

#

He said he ignored the forum noobs and sort it out him self ๐Ÿ˜…

#

I tested with listen server on steam, everything looks fine with the setting he provided

thin stratus
#

Hm, not sure the settings would help if the Client has low FPS and sends less updates. But it's been a while so if that works then great.

dark parcel
#

Hmm I certainly haven't test that.

#

Got like 40 fps on both of my computer

#

No idea how to artificially make it lower

thin stratus
#

ListenServer would need higher FPS than client to make that visible I guess

#

Start actual standalone instances and limit max fps on client

dark parcel
#

Oh I can probably upload development build too and limit the Max fps

wet bridge
#

Hey, what's the best way to design ai in a multiplayer context?
For example, if I tell the ai to go to a location near the client player, does it go to the last location the server thinks the player is, or will the client's copy of the ai automatically do local prediction based on the client character's local position?

shell pendant
quiet fjord
#

Guys, I have a question about how you can replicate the physics of a skeletal mesh, for example, clothing or weapons that have physics.

storm zealot
#

Greetings

(First person multiplayer game, fps and tps mesh is separated)

What is the proper way to attach wepon actor to character hand?

Attaching Actor itself, or its mesh component? (Actor is replicated, movement is not replicated, mesh is not replicated at all)

I have an issue, when server is attaching weapon to Third Person Mesh, all clients did it too - so clients will have weird first person wepon view

quaint tendon
#

How to save multiplayer data in a Steam game? Where should the database be? Does Steam have data tables for each game that can be accessed from within the Unreal game?

thin stratus
dry orchid
#

HI I am working on a multiplayer game. we are using the Online subsystem but i is not working as intended. I am setting my session settings locally an them updating them with SessionInterface->UpdateSession(FName SessionName, FOnlineSessionSettings& UpdatedSessionSettings, bool bShouldRefreshOnlineData = true). this method is suppose to trigger a delegate to al players (p2p) but is only being locally. Anyone know hay is this happening or how to solve it?

dry orchid
#

Right now i am passing a String as session name

olive mason
#

hi im working on creating a splitscreen multiplayer game and i wanted to know if anyone knows how to create fake cursors for splitscreen players

primal trellis
#

Sup guys! (I tried to explain before, but I believe I didn't express myself well)
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can** invite friends from Steam**. But my idea is, when they play, they will look in the **list **and try to find another server that they can join, if it exists, they will join, otherwise they will **travel **with their **current **one and it will become **public **(becoming a possible session to join)

The problem is that when I use find advanced session, I don't want them to find the server itself, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/

but I'm failing in how to compare their current session and the others, which were found in find advanced session

rough scarab
#

I did packaging my project in game and dedicated server target i can join server using my local ip ,I can join with 2 clients ,My remote friend or I cant join the same match the last one tried to join will get fatal error

i dont have Game Instance on my build I didn't setup my Game mode with any logic

any Idea what causing this issue?

#

and if anyone know courses for dedicated server hosting joining logic paid or free plz share it thx

devout sonnet
#

How do I get a player to spawn in a specific PlayerStart? I know i can use GetAllActorsOf Class, but that just gives me an array...

dark edge
devout sonnet
#

its just a stationary rock paper scissors that uses clicking on actors to make your choice. My real issue is how do I spawn the actors that the player can interact with in front of them, and how do i spawn the actors the Opponent can interact with but not have the player be able to interact with them. (Player clicking on opponents Actors does nothing)

I thought, Player 1 will spawn to a specific location and the options are given that players playerState to show that they own them. When clicked on, the actor checks if the playerstates equal each other and decide off of that.

but i really want the starting positions to be random and the interactable actors spawned in front of them.

dark edge
#

Solve one problem at a time

#

I think there's a built in mechanic for a playerstartspot being "occupied"

#

so the first one grabs the first unoccupied start in the array

#

then the next one does the same thing

devout sonnet
primal trellis
devout sonnet
primal trellis
devout sonnet
primal trellis
#

Sup guys! (I tried to explain before, but I believe I didn't express myself well)
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can invite friends from Steam. But my idea is, when they play, they will look in the list and try to find another server that they can join, if it exists, they will join, otherwise they will travel with their current one and it will become public (becoming a possible session to join)

The problem is that when I use find advanced session, I don't want them to find the server itself, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/

but I'm failing in how to compare their current session and the others, which were found in find advanced session

tired current
#

How would I print out the netmode of whatever is calling a PrintOnScreen method in c++? Like if you do print string in BP, it says Server: message or Client 0: message

opal pulsar
#

hey, I have a weapon manager component that has an array of weapon actors, that array is replicated and the weapons are replicated and being spawned on server which then causes them to spawn on clients. As I spawn them I add them to this array here but the clients are showing empty arrays on their ends...

    UPROPERTY(ReplicatedUsing = "OnRep_WeaponInventory", Transient)
    TArray<TObjectPtr<AInventoryWeapon>> weaponInventory;

When spawning it more or less similar to this but I am doing some more setup and attachments in the for loop after spawning.

weaponInventory.SetNum(MAX_WEAPON_SLOT_COUNT);
for(int j = 0; j < MAX_WEAPON_SLOTS; ++j)
{
          auto* spawnedWeapon = GetWorld()->SpawnActor<AInventoryWeapon>(spawnWeaponClass, character->GetActorLocation(), FRotator::ZeroRotator, p);
  weaponInventory[j] = spawnedWeapon;

}
fossil spoke
#

Instead of directly assigning it

#

Or Insert()

#

If you want to keep adding via the index

nova wasp
#

you can also add a debug watch: {,,UnrealEditor-Engine.dll}GPlayInEditorContextString so you see what that is when breakpointing/stepping

opal pulsar
fossil spoke
#

Probably might also want to remove the Transient specifier on there as well, not sure what mess that might be creating.

opal pulsar
#

Well transient is for runtime non serialized things right? My weapons arent spawned until runtime

fossil spoke
#

Transient means that it wont serialize at all.

#

It could be whats causing it to not replicate

opal pulsar
#

Yeah the actor weapon and manager component are both set to replicate and I replicate the array with DOREPLIFETIME(UWeaponManagerComponent, weaponInventory);

#

ok worth a shot

#

nope.. hmm

fossil spoke
#

What is the UWeaponManagerComponent attached to?

#

What Actor?

#

Is that Actor replicated?

opal pulsar
#

The component is attached to my player character

#

I have an enum on the component replicating, its the array thats the issue, I am not sure why though, it must be my setnum stuff perhaps?

#

so weird...

fossil spoke
#

Seems like you are wanting to pre allocate the slots.

#

You should be using Reserve instead

#

And then just Adding the same number of Weapons to the Array afterwards.

opal pulsar
#

well, to be totally honest, i would rather a static array but I lose some nice begin/end and num functionality and epic sucks ass and made TStaticArray or whatever it is not exposed to reflection..

#

I dont want to exceed the max size ever and most of my code already protects for that, regardless of it still having the ability to still grow if I were to make it

fossil spoke
#

Why do you think you need that?

opal pulsar
#

a capped size array?

fossil spoke
#

Yes

opal pulsar
#

Well I dont need it, I am trying to do without now and doing set num to ensure the index of the weapons but its not working

fossil spoke
#

So to restate the issue. You are preallocating a bunch of Weapons on an Array that is set to replicate, however the Clients are not receiving the replicated Weapons?

opal pulsar
#

Clients are receiving the replicated weapons because I can breakpoint my OnRep for their behavior and it runs on clients (for example OnRep_Ammo, or OnRep_WeaponTag for the weapon actor itself), my array of those weapon actor pointers (to be able to actually reference and use them) is empty on the client, even after the weapon actors themselves replicate and spawn on clients

chilly haven
#

Hi,
Question about Seamless travel in multiplayer (dedicated server)
Without seamless, my gamemode BeginPlay spawns actors, and I destroy them in EndPlay.
With seamless, my gamemode BeginPlay spawns actors, but when EndPlay is called, the actors are already destroyed.
Why is this?
Thanks

nova wasp
#

I assume the world has destroyed them in that case (you did not specify anything about the actors in question or which endplay this is)

bright summit
#

hello, I do not know why my custom movement is not working in multiplayer, I used first time the PhysCustom function to code it, I am switching to it in PhysFalling function, I have other custom movement like sprint, custom swimming etc. and it works with prediction (because it is coded properly I think) but the ladder move do not :/ Don't know why and what I did wrong. Looks like server do not have information about player moving. I thought that PhysCustom is already handled by engine to replicate it

void UDXMovementComponent::PhysCustom(float deltaTime, int32 Iterations)
{
    Super::PhysCustom(deltaTime, Iterations);

    if (bIsLadderClimbing && CurrentLadder)
    {

        FVector ViewPlaneNormal;
        FVector VPN_Right;

        float PlayerForwardInput;
        float PlayerRightInput;

        
        GetLocalInputVectors(PlayerForwardInput, PlayerRightInput);
        GetViewVectors(ViewPlaneNormal, VPN_Right);

        float ClimbFactor = 0;

        if (ViewPlaneNormal.Z > -0.75f)
            ViewPlaneNormal.Z = FMath::Clamp(ViewPlaneNormal.Z + 1.5f, -1, 1);

        FVector NewVelocity = ViewPlaneNormal * PlayerForwardInput * LadderClimbSpeed;
        NewVelocity += VPN_Right * PlayerRightInput * LadderClimbSpeed;

        GEngine->AddOnScreenDebugMessage(991, 1.f, FColor::Cyan, "VPN: " + ViewPlaneNormal.ToString());


        FVector ScaledLadderNormal = LadderNormal * FVector::DotProduct(NewVelocity, LadderNormal);
        FVector Lateral = NewVelocity - ScaledLadderNormal;


        FVector ClimbVelocity = Lateral;

        DrawDebugLine(GetWorld(), UpdatedComponent->GetComponentLocation(), UpdatedComponent->GetComponentLocation() + VPN_Right * 300, FColor::Green, false, -1, 0, 3.f);

        Velocity = ClimbVelocity;

        CalcVelocity(deltaTime, 1.0f, false, GetMaxBrakingDeceleration());

        FHitResult Hit(1.f);
        SafeMoveUpdatedComponent(Velocity * deltaTime, UpdatedComponent->GetComponentQuat(), true, Hit);
        SlideAlongSurface(Velocity * deltaTime, 1.0f, LadderNormal, Hit, true);
}
}
#

of course when I am playing as listen server or standalone it works properly

chilly haven
bright summit
bright summit
limber turret
#

I'm using my playercontroller(PC) to proxy calls from client to server. However I'm running into an issue where I have run on server custom events A, B, C, but in C I also want to use A and B.

The problem is I can't call A and B from C, since I need the PC to call A,B and getplayercontroller returns the servers PC from within C.

So I'm wondering if there is an approach to this where I can have reusable functions that make use of getplayercontroller etc without having to care about whether it's already running on the server, I guess I need to have some context of which client that is invoking the RPC essentially.

dark parcel
#

What is it that you are actually trying to do, gameplay wise

#

You don't normally want to use get player controller

#

Use get controller to return the controller that the character has

#

So if you are inside character that is owned by player 2. Get controller will return the pc of player 2. (Only on server and player 2 machine since client only know their own pc)

limber turret
#

Most of the uses are to call server RPCS. I'm using playercontroller since it was a fairly reliable thing that my client owned and the server rpcs needed something I owned.

#

A simple example would be an RPC to eat an apple, would update the inventory, fire of an RPC to send a message "bob eats an apple", and then fire another RPC to drop an apple core on the ground.

round mist
#

I reread and I think I'm definitely misunderstanding. Lol

limber turret
#

I can pass in self to all my functions, or pass in another variable but only if its the server, but that feels a bit messy. Maybe thats the idiomatic way to do it tho?

round mist
#

So client 1 gets their PC and calls a client > server rpc to eat an apple. So that server event is on the player controller. Why can't you call a second event within the eat an apple function?

limber turret
#

if the eat an apple logic was in the PC, that probably works, but the logic for eat an apple would be somewhere else, say in an inventory system class.

So once I'm in that class, I no longer have the PC, unless I store it somewhere or pass it in to that function, because getplayercontroller returns the server PC not the client PC on the server.

round mist
#

Hmm.

dark parcel
#

Server rpc = run it in the server machine

round mist
#

Yeah. I think I would just pass the character as a reference that's eating the apple. Ideally you wouldn't want to string a rabbit hole of functions like that together. Why not just call all the relevant functions from the player controller in the order you want?

dark parcel
#

So if I'm the listen server and you as the client call a server rpc.

All the codes will be executed in my machine

#

Calling any other function after the server rpc is just calling the function in my (server) machine.

#

The server hold a copy of everyone pc

#

So when your pc run a server rpc, it just runs the function in the player controller that the server has

round mist
#

Right. Which is the same controller of the same character.

dark parcel
limber turret
# round mist Yeah. I think I would just pass the character as a reference that's eating the a...

If it can be done with just a sequence, what you said could work for some cases.

The problem is more about the more general case where, If I write a function that A that calls a server RPC, I can't just use getplayercontroller and call it, I have to somehow remember that that function is using getplayercontroller and change that if i ever reuse A within another function.

ultimately it feels like I should just write my own wrapper around the controller to prevent having to think about this. But this feels wrong from a unreal mental model.

limber turret
round mist
#

For eating an apple I'd call it from your rpc on the PC. Run the "remove item from inventory" function on your inventory component (which could live on your pawn or controller). Then spawn an actor, then multicast an alert. All in the same function.

#

Can you give an example of a function that would do that?

dark parcel
round mist
dark parcel
#

Or just character -> eat apple server rpc. Eating is something a character would do.

round mist
#

Typically if it matters which player controller is needed in that function** then you should have an input for it.

round mist
dark parcel
#

One thing I don't like to do is passing ownership to call rpc

#

So I just use components owned by the character

#

Or dump it in the controller

worthy oak
round mist
#

I think they're wanting to build a function library that relies on using 'get player controller' in many of their functions.

limber turret
dark parcel
round mist
#

Unless I am fundamentally wrong about how multiplayer works. Lol

#

Which is possible...

dark parcel
#

So get controller if run on server machine inside player 2 character will return the controller of player 2 character that the server has.

Get controller by player 2 inside its character will get the controller of the player 2

#

Kindred explained it above

limber turret
dark parcel
#

Any action performed by the character can go there

#

There is also player state, game states, etc

#

Really depend what you want to do

#

It's not like you are gonna be doing tons of rpcs. You want to replicate as minimal data as possible imo

worthy oak
#

or ahem GAS maybe? TriggerAction(Action.EatApple)>EatAppleAction

round mist
#

I recommend making components for your character for each feature they need. Health, combat, inventory, etc. and having a relevant rpc graph in each.

limber turret
# worthy oak correct me if im completely just not understanding what your asking. But it kind...

At a high level, I have a bunch of small functions that call an RPC. When I want to compse those functions in some arbitrary way, I'm finding I have to be very careful about my useage of getplayercontroller and this feels like a mental model mismatch, so I'm trying to get an understanding of an idiomatic way to have a library of small functions each making RPCS that I can reuse and chain together without worrying.

round mist
dark parcel
round mist
#

You can get a lot of mileage from an rpc using TriggerActor that passes an array of string parameters and the actor reference.

#

Combine it with a trigger component or an interface and you can do even more.

dark parcel
#

I see a lot of compression done by epic though, so maybe we do need to manage network bandwidth to keep the game running properly

#

Especially rpcs on tick

limber turret
round mist
dark parcel
round mist
limber turret
round mist
#

If it's always the owning player controller being called from the character or controller you want it to trigger on then you don't need an input at all. It should just work.

#

Because again the server controller is the same as the client controller you called it from.

limber turret
round mist
#

Just one has authority and one is local

limber turret
dark parcel
limber turret
dark parcel
#

You can use component to act as a manager I believed. That's my plan for my game anyway

#

You can call rpc on other actors by setting ownership but that's even more ugly and open more ways for vulnerabilities

limber turret
dark parcel
#

95% of tutorial for mp in youtube are pretty bad.

Some are just straight wrong.

round mist
visual widget
limber turret
round mist
#

The only reason you would need a parameter is if you need to know what actor to affect with that function. So in the case of eating an apple you might want the character reference to know who's health to modify from the server.

#

What's an example function you're running into issues with from your game?

limber turret
#

ya, makes sense

round mist
#

Or are you just trying to get ahead of the issues and haven't run into them yet?

#

The important thing to remember is that if your controller calls an rpc, then the server that it passes to is the same controller controlling the same character. It just now has authority to affect things because it's the server.

limber turret
round mist
#

So drop item needs to know where to drop the item? Or it's returning null when trying to get the PC?

limber turret
#

drop item is server custom event, so I need to pass in a param for target since self at this moment is not a PC.

#

drop item will need a way to get the controlled pawn location, right now im just using the PC for that as well, but not passing it as a param. Its just sitting in the PC for now, so I just use it as is.

#

so as a result of this, I'm finding I can't trust any of my functions that use getplayercontroller since if i call them on the server they will break, so thats something I need to resolve.

round mist
#

It just clicked. I see what you're saying. Lol

#

Yeah. You should only be using get player controller in local functions.

#

If you need to, name your functions Local_DoX so you know you can't use that in an RPC call.

#

Or just be sure that any time you use get player controller you think through if it needs to be done on the server and if so it needs an input for the controller.

#

Otherwise it'll just be using the servers local player.

#

Lol sorry that took so long to click. I had to step through the entire process and then I went "Ohhhhh..."

limber turret
#

Ya, all of that makes sense and what I ended up landing on as well, but wish there was a cleaner solution.

heh, its all good. Not sure my explanation was the best

round mist
#

Is the blind leading the blind sometimes in here. But teaching is the best way to solidify newly gained information so I like to try to help when I can. Lol

limber turret
#

Thanks for your help, @dark parcel you as well. I'll sleep on all of this and maybe something will click overnight.

round mist
# limber turret Ya, all of that makes sense and what I ended up landing on as well, but wish the...

Passing a player controller reference isn't a huge problem. It's pretty common. Keep in mind that if you're just using get player controller to call a generic RPC that doesn't rely on a specific character, then you don't need a specific controller. Like triggering a door to open. That can happen on any actor with authority so any PC will work. So if that's the majority of your get player controller use cases then I would just fix the problem children as you come across them.

#

Typos*

limber turret
#

but maybe I wasn't quite doing what you are suggesting

round mist
#

Huh. Can't say I've ever set owner on anything.. but race conditions are very common in multiplayer. Especially when you're performing quick actions in succession. Like multicasting a sound effect then destroying an actor. It'll work on the server but the clients likely won't receive the event before the actor is destroyed. Really annoying stuff.

limber turret
#

Aight, well I'm headed out, thanks again, take care.

round mist
#

Well good luck to you. I feel like nothing was really resolved. Lol

#

No problem! Lol

primal trellis
#

Sup guys
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can invite friends from Steam. But my idea is, when they play, they will look in the list and try to find another server that they can join, if it exists, they will join, otherwise they will travel with their current one and it will become public (becoming a possible session to join)

The problem is that when I use find advanced session, I don't want them to find the server itself, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/

but I'm failing in how to compare their current session and the others, which were found in find advanced session

shrewd ginkgo
#

what is wrong about it

#

I try to give costumes to all of my players randomly

#

Btw I trigger assign costumes after beginplay

balmy turret
#

For a dedicated server game mode, is it best to handle player spawning logic in PostLogin or HandleStartingNewPlayer?

#

I'm leaning towards PostLogin, because I need to do some DB calls via rest api.

wooden jasper
#

Hi,
Can point me in the right direction how to find out, if an object is relevant for replication?
For example if the players are far away from an object that fires an RepNotify they will only get this notify, when they are close.
I would love to know how they do it internally and how i can maybe use this to make my own optimizations.
Thanks in advance ๐Ÿ™‚

chrome bay
#

In short, it's evaluated by the Server every replication frame by checking the distance between the players view location and the actor location. That's about it.

dark edge
chrome bay
#

Yeah, which is hilariously exploitable in itself party_manny

#

Wanna see whats happening on the other side of the map? Mmmk just spoof that location to the server, ez.

dark edge
#

Btw been spamming HLL, love it. Although I gotta ask how so many people were involved. It's got a ton of art but it doesn't seem like the systems are that crazy. Has it just changed hands a lot?

#

Also I've never squinted so much in my life, just shooting at bushes half the time.

chrome bay
#

lol, well the core team at any given time was like 15-20 people tops I think, it has a colurful dev history

balmy turret
#

Is it possible to go into the connecting players controller and grab a variable from their game instance?

quasi tide
#

You have to call a client RPC that will get it and then do a server RPC to tell the server.

balmy turret
quasi tide
#

RPCs are extremely fundamental to networking. Should definitely have a handle on them. I just told you how to do what you wanted. The docs for RPCs are pretty good honestly. It is extremely straight forward. And you should also go through cedric's multiplayer compendium that is a pinned post.

#

You may need to just go through the motions of creating and calling RPCs before they sink in.

balmy turret
empty spoke
#

Hello I created a map and downloaded fps starter kit to setup a team death match but when I try to open the level in the fps starter kit the map doesn't show up
I tried to copy and paste the folder but no luck

When I try to open the basic map in fps starter kit unreal engine crashes

Do you know the best solution?

queen zephyr
empty spoke
#

I downloaded fps started kit from the market place to play team death match on my created map

I'm using the latest version 5.4.2

It says send and restart ue has crashed

queen zephyr
#

Did you buy this?
https://www.unrealengine.com/marketplace/en-US/product/fps-starter-kit?sessionInvalidated=true

If so, the creator has his own Discord server. It's in the description. I would recommend that you contact him first. If a certain piece of code crashes, the creator will be better able to help. This is not enough: "It says that sending and restarting ue crashed".
You need the exact text of the crash that it says.

Unreal Engine

100% Blueprints, convenient to modify and expand, First-Person Shooter game starting template. Featuring FPS and TPS perspectives, inventory, weapon system and more. Singleplayer and Multiplayer modes are included

latent heart
#

And probably to install the debug symbols from the launcher too.

limber turret
shrewd ginkgo
#

what is wrong about it

#

I try to give costumes to all of my players randomly
Btw I trigger assign costumes after beginplay

sinful tree
# shrewd ginkgo what is wrong about it

You're removing items from the array that you're currently looping through which changes how the loop behaves. It seems like you may want to use a For Each Loop with Break to stop looping once you've found a costume you want to use.

Also seems a bit odd to have this on an RPC. This will allow clients to call this RPC at any time.

normal raven
#

Hey, so weird question: I have a replicated actor, owned by the server.
I want to disable replication and destroy it on the server, but leave the client's version intact, (but not replicated). I am using C++
Any tips would be appreciated

sinful tree
# empty spoke

Only hint in there is that there's something looping through some child widgets but the parent widget is being destroyed while doing so.

dark edge
normal raven
normal raven
# dark edge I'd probably look at TearOff first

It's still destroying on both the server and client. Could this be because I am destroying the actor immediately after calling TearOff() and it hasn't updated the necessary network info? I may just need to call Destroy at a different time

shrewd ginkgo
severe cedar
#

I think this is a dumb question, but does anyone know if the PktLag setting for emulating poor network conditions is roundtrip or 1-sided? Like if I do PktLag = 200 should I expect a ping of 200 or a ping of 400?

gritty warren
#

Are there any resources for using streams in a replicated setting?

I'm hoping to generate some random values between a range, with the Min / Max being set with OnRep'd variables, and it'd be nice to only have to replicate the range and esnure that the randomly generated variables are the same ๐Ÿค”

kindred widget
gritty warren
kindred widget
#

You create a Stream out of the Seed. Then you use that stream to randomize between the minmax. Using the same seed and min and max, it will always return the same value.

twin juniper
dark parcel
#

It's okay to not know what you don't know

twin juniper
dark parcel
#

Doing otherwise just make you a bozo

twin juniper
#

it should be called from the server, and the server only, ofc I know

dark parcel
#

And harm other people

twin juniper
#

you just mad at me

dark parcel
#

RPC is literary a function

twin juniper
#

which is on the server

dark parcel
#

Go look up rpc

worthy oak
#

@dark parcel you know cat doesnt look things up xD

dark parcel
#

It can happend on server, all client or client. Also it doesn't help what you said earlier being wrong.

twin juniper
#

Normally: Clicked -> RPC -> Checks ->ย RemoveItem or wtv

dark parcel
#

Yea I don't normally care but I keep seeing him mislead others

#

Saying it with confident too

worthy oak
#

oh I totally get it

twin juniper
summer rivet
#

I've got a fun multiplayer one that hopefully someone has handled before. Starting a session and listening for a connection on a listenserver machine, then joining that session with a client works fine. I added a button to allow the listenserver to stop waiting for a connection by calling destroy session and it should be working. The issue is if I start the join on one machine, then cancel with the destroy session on the other. after a few seconds the client finds the session still and gets "stuck" trying to talk to it. Eventually over steam it times out and I get a Connection timeout error on the client (but this doesnt happen in PIE which is a pain). Soo.. ok not a biggie but once the client times out it reloads back to the first map of the game (my splashscreen) which is rude user experience. Is there a better way to stop the client from joining a dead session so this doesnt happen, or a way to override the engine from defaulting back to the splashscreen map?

dark edge
#

you set the stream up, then every time you call it in sequence you get the same sequence of "random" numbers back

balmy turret
#

Are there any good hands on video series for multiplayer in 5.0+? Building a game with an authoritative server from the ground up; preferably that doesn't have any project files you need to download to follow along.

kindred widget
# summer rivet I've got a fun multiplayer one that hopefully someone has handled before. Start...

Joining a dead session. No not really. The main issue there is Steam. Sessions are only periodically updated. So you're at their mercy there.

About returning to the main screen, that is normal for a lot of reasons. Console TRCs specially. But there is an override that lets you not do the OpenLevel call on a disconnect. But I'm uncertain how that works in the middle of a connection or if it even does at that point.

summer rivet
#

@kindred widgetany idea where the override is at?

scarlet summit
#

Hi people! Who has encountered such a warning? LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: StaticMeshComponent /Game/Maps/Server/startMap/startMap.startMap:PersistentLevel.BP_playerCharacter_C_2147482408.StaticMeshComponent_2147482402 NOT Supported.

#

but in UE5.3 not this problem

#

i`m use 5.4.2 and off the replicate and warning is not see

balmy turret
gritty warren
kindred widget
#

Depends on how accurate you need it to be. Lag always plays a part. GameState has a somewhat synced time.

pearl bear
#

Hello, I have a question that I cannot solve. I'm working on a game similar to Dayz. However, due to my design, I want to host around 500 players on the same server. Interaction between players will be quite low due to the distance. I hope I can achieve this using Relevancy. Since players are scattered around the map, they rarely interact with each other and are mostly busy with PVE content. Has anyone had similar experiences with stock UE netcode at this point? You can think of this question as a thought experiment and express your opinion.

gritty warren
# dark edge based on call order

call order, meaning?

Like, if I have the seed, and I call random float 3 times using the same seed, I should get the same number back each time right?

Or is stream different, in the sense that it provides a preset list of numbers based on a seed, and you iterate through whenever its called?

If so, that could be problematic if not all calls are RPC'd and such, hmm

graceful flame
sinful tree
chilly haven
#

Do you guys prefer to use seamless or non-seamless travel for multiplayer?
Arguably, non-seamless is "cleaner" in terms of resetting everything.

#

I'm using dedicated servers

#

For example with seamless, you don't have the endplay-beginplay cycle for controllers

sinful tree
# gritty warren call order, meaning? Like, if I have the seed, and I call random float 3 times ...

If you were to do something like this on your end the print string should come out to something like 12.080474 for the first print and 9.630316. If I were to reset the seed on the stream again, you can print out that same series of numbers again. What matters is the order in which things are called from the stream. So in the second example, I've reset the stream again, and this time I requested a random bool from the stream which returns as a "false" printed, and then I get the same 9.630316 printed out from before.

gritty warren
sinful tree
#

Yes absolutely.

gritty warren
#

Are there other solutions for synchronizing this? For instance, couldn't I use something like the game time to set the seed?

#

I assume game time is synched across all clients and such in terms of 'when things happen'

#

though, I guess not, now that I think about it

#

because of time delays of actually sending messages

#

Hmm

sinful tree
#

Seed doesn't really have anything to do with it. The seed and stream is just setting what what potential sequence of values can be as they are called from the Stream. if you don't call things in the same order, then it can't be synchronized. You can replicate the seed, but then you have to make sure that the client does the exact same generation from that stream.

kindred widget
#

@gritty warrenBut what is this for in general? Cause there's probably an easy answer here. Hard to help without knowing intended functionality.

rustic sable
#

still can't seem to get this OnComponentBeginOverlap to work. Collision box creation / attach to rootcomponent, and OnComponentBeginOverlap.IsAlreadyBound all return success on the server but it still only fires on client

gritty warren
# kindred widget <@195262904956747785>But what is this for in general? Cause there's probably an ...

I have procedural recoil, and to do so I'm actually generating a random float to shift the gun via control rig. The recoil matters because my bullets leave the barrel of the guns realistically, and that direction determines what gets hit. It isn't completely necessary, but it'd be really nice if the recoil was synchronized to some degree.

I really don't want to have to replicate the actual recoil values I'm generating, but I suppose its not the end of the world if I do. ๐Ÿค”

gritty warren
kindred widget
#

You make a stream from a seed

gritty warren
kindred widget
#

Why for?

gritty warren
#

well actually I'm not sure how this works so maybe it wouldn't be, but in my head I would just sync the random values with the game time via the seed. I guess maybe it doesn't matter if the stream is there in the middle? Idk tbh ๐Ÿ˜ญ

sinful tree
# gritty warren I have procedural recoil, and to do so I'm actually generating a random float to...

The stream part is the whole idea of using a seed.
You generate numbers from the stream which is set by the seed.
You generate in a specific sequence. This is useful for procedural generation.

Each time you fire your gun, you can just randomly generate a new seed (not from a stream) and replicate that and then initialize your stream with that seed and generate from it. You can use the stream to generate the values that the rest of the generation needs to use as well.

runic crane
#

I'll be going through it anyway, but is the pinned Multiplayer Network Compendium a good place to find an in-depth look at the flow of player login and spawning of pawns. I'm running into a lot of gotchas in a row, and would like to actually get a good understanding of what happens.

gritty warren
#

Ah, wait, I see, they actually can all have their own stream huh

sinful tree
#

Yes.

#

If you're replicating the seed and creating a stream from when the gun is fired, each player would generate their own stream based on that seed.

gritty warren
#

That makes sense. So whenever you 'press the trigger', you replicate just the seed, and that instance of autofire will be synced

#

Smart

#

This is why I appreciate unreal source and all the kind folks in it like you

gritty warren
#

thank you so much for this!!!

fossil spoke
#

Its more focused on the fundamentals of networking itself

#

RPCs

#

Replication

#

The relevance to the network that each Actor has

#

Etc etc

fossil spoke
#

Starting in AGameModeBase::PreLogin

gritty warren
sinful tree
gritty warren
#

I guess replicating a single int is cheaper

sinful tree
#

If you're doing a procedural recoil, then you'd probably want to replicate the seed for each bullet as that ensures that even those that do show up late to the party will be producing the correct visuals --- say for example you had a gatling gun that was just continually firing and you decided to use a single stream to generate all the recoil from it. If the person firing the gun was maintaining it for dozens of seconds, and someone joins 10 seconds into that firing - they would be generating from the initial seed which means they would be out of sync. Replicating the seed for each bullet fired allows you to procedurally generate on clients specifically for that shot and without having to send all the values. If you want to maybe restrict how much data is being sent for automatic weapons, as a gatling gun could be a little on the extreme end, then maybe set a new seed every second or two while firing instead.

gritty warren
#

Ah, great example of why my logic would lead to issues down the line

#

Awesome, very well explained! Thank you so much!

gray sparrow
#

when i click a static mesh and attack my character run only to one point

#

he goes around the mesh and attack on other side

#

why he dont attack on the point on the shortest way? o.O

clever notch
#

quick question...i follow a project called City of Titans...an aspiring hero-themed MMO that started back in 2013. Its an indie team, part-time and unpaid volunteers. What they've released to backers so far is a lackluster character creator and the first pass at their launch map...but its a skeleton map; nothing to actually 'do' in it. Also, some stand-in combat powers with set damage and basic animations that i'm sure were all created in a day. My question, thanks for sticking with me through the context, is this: they just mentioned today that their next project is multiplayer...give the context and knowing it's likely a single, part-time, unpaid volunteer dev working on getting multiplayer setup...what is a realistic amount of time it may take him/her?

worthy oak
#

This is a second project they are making in addition to this mmo?

clever notch
opal pulsar
#

Is there any weirdness or funkyness with subsystems and multiplayer? I essentially have an asset subsystem that loads the assets upon the world calling beginplay, my issue is that I cant seem to breakpoint that beginplay ever being called for my subsystem if I run the game as a single client only... I really dont understand

worthy oak
#

Oh I see ok thatโ€™s a little better XD

worthy oak
#

As you are now dealing with multiple servers, scaling, authentication ext

clever notch
worthy oak
#

Then it probably wonโ€™t launch unfortunately

#

Unless they get serious funding and hire a few backend engineers

woven basin
worthy oak
#

Humble opinion, getting two game clients to talk to each other about something is a drop in the bucket compared to a backend infrastructure

#

Itโ€™s expensive, and there are a lot of factors

#

And maybe they really have a dream. Thatโ€™s awesome, but I would take a serious look at the number of โ€œI wanna make an mmo projectsโ€ and the graveyards they left behind

#

Even ones that managed to get millions in funding only to be completely shut down 5 years later

eternal dune
#

Still trying to wrap my head around doing replication properly. Here's the scenario I have

Actor has an ActorComponent
ActorComponent has a replicated UObject property
Replicated UObject has a replicated FInstancedStructContainer

From log messages I can see that the UObject property is getting it's RepNotify called.
But the FInstancedStructContainer is not getting it's RepNotify called.

Hence, the UObject is replicating, but not completely.

Am I correct in believing that this is expected behavior and that if I want the FInstancedStructContainer to replicate is needs to be directly part of an Actor or ActorComponent?

fossil spoke
#

Does a TArray<FInstancedStruct> property replicate instead?

eternal dune
fossil spoke
#

Yeah FInstancedStructContainer doesnt support net serialization

eternal dune
#

OK then, well I know what I'm doing next then. ๐Ÿ˜„

#

But what about it being in a UObject versus directly on my Actor Component? Should that make a difference?

fossil spoke
#

Sounds like you have properly setup the UObject to be replicated

#

So that should theoretically be ok

eternal dune
#

Well thank Heaven for small favors. then

#

When I started I had multiple layers of nested uobjects and didn't realize that would be a problem

modest crater
eternal dune
#

I really need it on the uobject since that object can be stored and accessed even when the actor and actorcomponent it belongs to is not instantiated in the level. This UObject defines the properties of an item that can be added to an inventory

modest crater
#

Well that sounds perfectly valid then ๐Ÿ‘๐Ÿผ

eternal dune
#

OMG it's working finally. I shall sacrifice many RAMs to the goddess Ada Lovelace in your name @fossil spoke ! Thank you!

#

I have been beating my head against this wall for a month or more.

#

At the very least, my efforts have produced a cleaner and less complex design than I originally started with

eternal dune
#

I eliminated some classes that didn't really serve a good purpose so the class hierarchy is smaller now

visual widget
eternal dune
#

I don't understand what you are asking

visual widget
nocturne quail
#

Can someone tell me if its fine to FORCEINLINE onrep's and keep them in .h?

    UFUNCTION() FORCEINLINE void OnRep_bFiring(){}
    UFUNCTION() FORCEINLINE void OnRep_bCrouching(){}
fossil spoke
#

However you probably dont want to.

#

Most of the time the Compiler is going to be better than you at determining inline usage

#

It will do it automatically without you forcing it

nocturne quail
fossil spoke
#

๐Ÿ‘

keen hound
#

what is this error?

#

i have the server.target made

keen hound
woven basin
visual widget
#

you modify the name of event "event" into "Event" for both nodes, what happen?, if it work or not?

humble wadi
#

Hey there!
I've been doing a re-read of networking articles/posts made by Vori, more specifically, atomic replication (https://vorixo.github.io/devtricks/atomicity/).

It's discussed that with non-atomic structs, there is a possibility of achieving such a state on client-side that never existed on the server, such as when you're updating a struct's different members on separate frames as they'll end up in different packets. So far so good.

So when a packet gets dropped, e.g. we had 2 bools in the struct, A and B. Both were false, and we just changed A to true, then couple of frames later, B to true, then we'd have 2 packets with the 2 deltas (change A from false -> true, and change B from false -> true). So if packet 1 gets dropped, then our struct will look like this: A = false; B = true. (this is why we have atomic rep).

But anyways, replication ensures that the client's version of the variable will eventually line up with the servers. So packet 1 has to be resent at some point. So later both A and B would be true.

What happens if we modify A again on server-side, and set it back to false? Is there some mechanism preventing us from updating bool A on client side in such a way that we get packet 3 (set A back to false), and then get packet 1 (set A back to true)? The last state it's on the server is false, so that's should be our last update right?

I'm not sure i was clear enough on this ๐Ÿ˜„

gray sparrow
#

i have a projectile homing ... and event on component hit(sphere) it should hit my character... but the sphere overlap him

#

i have all set to block -.-

dark parcel
#

Check your collision setting on both the sphere and the character

proven pagoda
#

Hey I'm super stuck on something I can't figure out for the life of me. I'm using Advanced Steam Sessions for my lobby hosting. If I'm in editor, on the netmode server machine if I host a lobby then any connecting clients connect to the lobby, but the player never spawns in it's just a camera looking into the lobby at the spawn point. If I host a lobby from the netmode client from the editor, my game works flawlessly. Does anyone have any idea that could lead me? I put some breakpoints and I'm finding the player controller is null, it gets all the way to BeginPlay, but then it just stops calling anything...

#

Also in shipping builds it does the one where it doesn't spawn anyone in all it is is the camera. That's why this is killing me. I can't get a shipping build that works the only way my online is connecting properly is if I'm in editor in netmode client screens

#

Wowwwwwwwwwwwwwwwwwww

#

I been stuck on this for a week after I post this I ask myself what if I just request a respawn at PostLogin in the GameMode like I killed them and it fixed it

#

why did I not do that sooner

#

Well it got the player in the game, but the lobby doesn't start when it fills up. Doesn't count the player coming in even tho it calls PostLogin with valid everything

#

zzzzzzz multiplayer is stupid

proven pagoda
#

Calling server travel with a button calls the function but it doesn't travel either. What is happening

woven basin
dark parcel
#

Cool

shrewd ginkgo
#

I will give random costumes (skeletal mesh) to everyone in the game and I want these skeletal meshes to have names, for example, the name of the yellow costume will be yellow and when other players look at that person, the nametag will appear and it will say yellow. how can I do it?

dark parcel
#

That's pretty basic thing to do, server can assign the random mesh and if the component is replicated, the client will eventually see the costume that the server sets.

If you don't know how to do a one liner like that, you should read the compendium written in this channel.

#

@shrewd ginkgo

shrewd ginkgo
#

can U help me about it? how should I replicate it

dark parcel
#

I've already explained above

#

Also you are only setting the skeletal mesh on server

#

You should use on rep variable for the client to set the skeletal mesh

gray sparrow
#

when i spawn homing projectiles they move the same way

#

how can i make each homing projectile move other way to target

#

that it looks better

primal trellis
#

Sup guys!
I'm trying to work on a """match making simulation""". Currently players can create a lobby, where they can invite friends from Steam

But my idea is, when they play, they will look in the list and try to find another server that they can join, if it exists, they will join, otherwise they will travel with their current one and it will become public (becoming a possible session to join)

The problem is that when I use find advanced session, I don't want them to find the own server, so I created all this logic:
https://blueprintue.com/blueprint/nctlq5h7/

but I'm failing in how to compare their current session and the others, which were found in find advanced session

Does anyone have any idea how I can solve it or a way to do it differently?

obtuse field
#

If I execute server rpc from the listen server it will execute, right?

vital furnace
#

Why aren't the events in my Game Mode being triggered? When I leave the lobby and travel to the game map via ServerTravel, the Game Mode GM_Game associated with this map should trigger events (checked with a Print). Why does it seem like the Game Mode isn't instantiated?

wooden jasper
#

Hi,
Are there any events i could bind to when the NetCullDistance is out of range and an actor becomes irrelevant to all players?
Im trying to optimize replicated physics items and want to turn off everything when its out of range, without adding new distance checks, since they are kinda expensive.

upbeat basin
#

Is it possible/would be fine to create session from the player that will be the listen server, resolve the connection string from the listen server and pass it to other players via the custom backend to let other players in lobby to browse to that connection string without actually joining to the session?

#

Only reason I'm using the session here to get a connection string because I believe using the raw ip would create problems due to NAT? Is it a conflicting state to use a custom backend for lobby/group creation and matchmaking with listen server configuration?

kindred widget
upbeat basin
# kindred widget Why are you avoiding the sessions specifically?

Maybe due to me not understanding it correctly, but our end goal is to make cross platform available between consoles and PC. If we are going to use sessions then EOS+ is required. And in order to link steam accounts with eos accounts, some kind of authorization is required by the user to allow epic save their information (?) and it's a pop up appears in the game, so it can't happen under the hood(?). Both this and EOS still being beta made us from getting distant from sessions and try a third party backend service (currently testing Nakama). Everything is okay with friends, steam authentication, creating parties and matchmaking. But the part that we're not hosting dedicated servers and players need to pass their IP over the lobby is where I'm stuck. I'm not sure if our plan is doable or not to be honest

eternal dune
#

When I start my level then in the player on the listen server I can activate an item to change a condition setting on it, then pick it up, drop it on the ground again, and activate a second time with no problem.

But in a second player on a client, if I try to do the same thing, then I cannot activate the item a second time after picking it up and dropping it. I get the error "LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_Box_C_1. Function Server_SetIntByTag will not be processed."

Why does my spawned actor have no owning connection when activated from a client, but it works fine when activated from a player on the listen server? If it makes a difference, the condition variable being changed is stored in a replicated TArray

The code to spawn the actor is this, and it runs in a server side RPC

        if (bSpawnActor)
        {
            UDcsContainmentFragment const * InvItemContFrag = Cast<UDcsContainmentFragment>(InvItem->FindFragmentByClass(UDcsContainmentFragment::StaticClass()));
            FActorSpawnParameters SpawnParams;
            SpawnParams.SpawnCollisionHandlingOverride = CollisionHandling;
            AActor const * NewActor = GetWorld()->SpawnActor(InvItemContFrag->ActorClass, &Transform, SpawnParams);
            NewActor->FindComponentByClass<UDcsItemComponent>()->InvItem = InvItem;
            if (InvItemContFrag->bIsContainer)
            {
                UDcsInventoryComponent* InvComp = NewActor->FindComponentByClass<UDcsInventoryComponent>();
                InvComp->RestoreInventory(InvItem->StoredInventory);
                NewActor->FindComponentByClass<UDcsItemComponent>()->InvItem->InvComp = InvComp;
            }
        }```
upbeat basin
upbeat basin
sinful marlin
#

Regarding replicated properties and RPCs on a game state, is it possible for an RPC to reach a client before replicated properties are replicated upon connecting to a server?

eternal dune
# upbeat basin What do you mean by "activating" an item? Your problem seems like you lack owner...

You misunderstand. The actor is not in a player's inventory when it is dropped on the ground, so it would be inappropriate to be owned by any player. (And when it's in an inventory, it is not an Actor anymore, it's just a UObject that stores the item's identifying data.)

By "activate" I mean I have an interaction option on the item that can change it's state without picking it up. In particular it changes the value of an int variable stored as part of the item state.

thin stratus
#

Regarding your Session question:

#

A Session is just a bundle of Information on the Backend.

#

What it keeps track of is mostly up to the Service behind it.

#

Usually it's like who's in the session. But also additional settings like what GameMode or Map can be put into it.

#

That then can be querried and displayed. In that way it's mostly used for Server Lists.

#

But even without displaying them it's reasonable to keep track of GameSessions and PlayerSessions with this.

#

EOS is used by Epic and a lot of other parties. You don't need Steam for it, but if your Players are buying the Game on Steam, then it's def good to use the Steam Account to auth the EAS with.

#

And then the Consoles would do their own.

#

With EOS being a thing, I would probably not try to create my own backend. Just too much work.

gritty warren
rancid vessel
#

im doing eos subsytem and when im joining a session i get thisL

LogEOSSDK: Error: LogEOSLobby: Invalid parameter EOS_Lobby_CopyLobbyDetailsHandleOptions.LocalUserId reason: is not a valid Product User ID, Result: EOS_InvalidUser

i found its a bug in ue5.3 but im on ue5.4
any help

gray sparrow
#

i have a huge problem

#

projectiles replicate is easy

#

but how can i replicate homing projectiles ?

#

i find nothing in internet -.-

#

can someone tell me how to replicate homing projectiles?

meager spade
#

huge problem? would hate to see a small problem lol

#

when you spawn then projectile, you make sure you set the homing target, thats it

gray sparrow
#

bro ic an spawn it

#

but how to replciate the homing

#

projectile

meager spade
#

when you spawn then projectile, you make sure you set the homing target, thats it

swift python
#

Has anyone ever seen / heard about an issue where on a dedicated client / server connection, the joining client gets a black screen in world partitioned levels? It's fine in all maps that are not "open world"
the black screen goes away as soon as the client presses any input. if he doesn't click any input within 60 seconds he gets a timeout.
i've disabled streaming for testing, but didn't help. i can see the client spawning in another client (so the server pawn is active and ready)

gray sparrow
#

bro is it that easy?

#

i will try it

meager spade
#

@gray sparrow in our projectile class, we have a function "SetHomingTargetActor"

#

this is called on server, and sets a replicated property "HomingTargetActor", this property is Replicated Notify. In the OnRep_HomingTargetActor, we set the projectile movement components homing taget component to the actors capsule.

gray sparrow
#

i try mom

#

i spawn the projectile on server

#

that spawn actor and set the homing target it didnt work

#

did i somethign wrong? o.O

high lotus
#

set the target on the server perhaps?

#

and make sure the target is also replicated

#

unless you're just running the motion logic on server

gray sparrow
#

i read that the velocity of projectile is not replciated

#

the target change every time...

#

every frame they msut update where the target is...

#

i spwan the projectile on my character

#

i have to set the homing on my character

#

or can i set the homing in projectile bp?

#

i spawn it on the server

#

its a child but the event fire on server

#

actor target is replciated

#

and set the actor target as homing target

#

it didnt work

high lotus
#

that server event doesn't appear to be replicated

gray sparrow
#

it a child bp

#

on parent its fire on server.

high lotus
gray sparrow
#

it sis a child bluepirnt

#

the event is from parent

#

in parent its on server

#

how should the client know where the target acutal is?

high lotus
#

is "actor target" replicated on Homingprojectile 3?

gray sparrow
#

yes

dark edge
#

same start direction + same target location = same path

#

different start direction + same target location = different path

sick saddle
#

Does anyone know if you try multiplayer in PIE if there's only one game instance, or if there's a separate one for every client?

latent heart
#

There should be a separate one for each client. And the server if isn't not a listen server.

#

That migth change if you do "run under 1 process"

#

You never wanna have that turned on.

sinful marlin
#

I asked a couple hours ago but in the case of the GameState, it's possible for an RPC to reach the client before a property get's replicated when the client connects to a server, right? As in there's no guarantee of the order they will be 'networked' in?

latent heart
#

I swear I heard once that all the properties of an object will be replicated before its beginplay is triggered. So you could maybe delay the rpc response until begin play if it hasn't already been triggered.

Though that doesn't guarantee that other objects pointed to will have been replicated.

#

But that might be entirely wrong.

sinful marlin
#

Hmhm it could have been that actually.

#

I had a case where a replicated ~~UObject* ~~ AActor*member property was nullptr on the client at the time of running a NetMulticast, but that property was valid on the server.

#

Err not UObject

latent heart
#

Yeah, pointers to other objects are like entirely random.

#

Only game state is the first object to be guaranteed to be replicated, I think. Everything else is "random".

#

What you can do is use an OnRep for that actor property and wait for that before actioning the rpc on the client (store the rpc for later response)

#

Or use the beginplay of the actor in question to trigger potential callbacks.

#

"Am I property X on any other actor? Let's broadcast something!"

#

Maybe a subsystem that can handle beginplay subscription services!

sinful marlin
#

Hm, would OnRep work here though? The property may have been replicated but the object it's supposed to point to may not have been replicated yet.

#

Essentially what I'm thinking happened is:

  • Client connects
  • Game State is the first thing to get initialized and has it's properties replicated/updated to match server
  • A Game State RPC was waiting so it runs the RPC
  • Game State is up to date but the rest of the world isn't (on Client)
  • Crash bandicoot.
latent heart
#

Yeah.

#

That's why I suggest a beginplay subscription service. Not really extensible, but yeah.

#

Have you object with the property register a callback with the service for when something begins play (with optional type filter?) and have any possible actor which could fit it trigger that callback with the service when it begins play.

sinful marlin
#

Hmhm. It seems odd to me to for UE to allow any RPC"s to run before it's finished replicating everything.

latent heart
#

Connecting sucks ๐Ÿ˜„

gritty warren
#

Hello, sorry to interupt, but I was wondering if anybody had resources that clearly map out all the different replication related things with examples in UE5.

For instance, I have seen a great number of videos that talk about what an RPC is and how to run an event from a client to the server, which then gets multicasted. But I have not found one that shows this in both blueprints + C++, or accounts for client prediction, etc.

I've seen some videos talking about the 'new' push model, and I'm not sure if that's something that I should be concerning myself with at this time.

My task is to just set some variables that get replicated (in this case, the value of a lean angle, so my animation can be replicated across all clients) and I am having a heck of a time figuring out what the best option is. I recognize I can set on client + call server function, then multicast and skip the owner / autonomous proxy., but is that the best way? It's super unclear to me

sinful marlin
#

If all you're trying to do is replicate an angle, I'd be hard pressed to see any value in anything beyond just a replicated property

gusty slate
sinful marlin
gusty slate
gritty warren
gritty warren
gusty slate
gritty warren
#

Also, if you use a repnotify, wouldn't it go back to the client and update the value?

gritty warren
gusty slate
#

Not necessarily, RPCs and replication are strong enough to make an entire game out of

gusty slate
#

the function will be called meaning a new value is present

#

the variable value will already contain that value

gritty warren
#

gotcha. So how does RepNotify work in the case of client prediction?

Suppose I am rapidly changing values, and I have a very long server time for whatever reason.

I do ServerSetValue(1) then ServerSetValue(2) then ServerSetValue(3), so on and so forth, and the server function simply sets the value of the RepNotify'd variable

#

If I try to do client prediction, where I set it on the client and then also call the server value, wouldn't the repnotify go back to the client and then overwrite whatever new value it was, causing a delay?

reef bison
gritty warren
reef bison
#

I dont see why you would need it

gritty warren
#

See this is also part of the trouble, because other sources I've seen say you should move away from RPCs and use RepNotifies and other stuff like that as often as possible

#

No idea who to believe lol

reef bison
#

you mostly need to understand what they do then you will figure out when to use each of them

#

replication only works from server to client, so you can't update a value from the client without a RPC

gritty warren
#

right but why multicast back to clients instead of setting the variable to replicate via repnotify?

narrow fog
#

I've got something that has me flummoxed. I have replicated Units that also hold a reference to a tile that they're on (in case they're being moved during a phase change etc.). It was initially not working until I replicated not just the tile reference but the actor itself. This has fixed the units missing tile information on clients but now, inexplicably, the middle tile of the bench is misplaced

Expected behavior is in the first image, that is the behavior I get when launching in Listen Server mode with one player OR the behavior I get when I launch with two players for the first time. On subsequent launches of any configuration, the tile behaves as in the second image

The function used to build the board is attached, and four of those are run in a BP_Grid actor and then added to a BP_Board to build the board pictured. Then a BP_Board is dragged onto the level such that the level outline for a player looks as attached. All of the Tile, Grid and Board actors marked to replicate

I just don't get it

crude tree
#

Getting this error when trying to build Development Server.
Development Editor works fine.
When i try build Development Client i get and error The system cannot find the file specified.

gusty slate
#

We don't know what your usecase is exactly, I suggested a RepNotify because I thought you needed a "status" value replication and a multicast isn't best for that

#

Each thing is useful in its respective usecase

gritty warren
#

But then back to my concern, how to use rep notify with client side prediction?

#

lol

#

Maybe if I rewrite my question it can somehow be more clear

#

Hmm

gusty slate
#

I suggest writing what you want to achieve

#

why do you need client prediction for example

#

if it's actually valuable to what players will see or not

gritty warren
gritty warren
dark parcel
#

Then do it locally

#

While telling the server of the change

gritty warren
#

Right, which goes back to my question of "If the variable is replicated with repnotify, will the repnotify go back and overwrite the clientside variable?"

gusty slate
gritty warren
#

I feel like I'm talking in a loop haha

reef bison
dark parcel
#

And multicast is not to be used for anything that needs to be in sync

gritty warren
sinful tree
#

Do on client. Send RPC to server indicating you're doing it.
If the server is ok with the client leaning, set an OnRep variable marked with condition Skip_Owner to then have all other clients have the actor lean.
In the case the server doesn't want to allow the client to lean, you send the client an RPC to reset themselves.

gusty slate
#

I thought you were doing a state change tbh when I suggested RepNotify

gritty warren
dark parcel
gritty warren
gritty warren
reef bison
#

fwiw I think you are confusing the terms. repnotify is a function that is called AFTER the variable is replicated, it has no relation with the value being replicated at all. you only need to use it if you want to run some logic as a result of the value changing

gritty warren
dark parcel
#

If you have some money to spare, there is tutorial that goes to implement client prediction and server rewind

gusty slate
#

I think what he's mostly interesting in is replicating a value to other clients only without the server trying to override the source client value

#

Which is what SimulatedOnly should do

gritty warren
dark parcel
#

Repnotify is just a function that gets called when the value is updated (on client for cpp)

dark parcel
sinful tree
#

I basically just explained what client prediction is.
Do on client, tell server you're doing it.
If server is ok with it, set a replicated value / do whatever it's supposed to do that replicates it.
If not, tell the instigating client to reset themselves

dark parcel
#

For ammo, maybe just update the hud

#

But if I kill an enemy and somehow it's not approved, how do I rose it from the dead

gritty warren
sinful tree
dark parcel
#

Probably not for death but I'm thingking of just showing the damage text right away

#

The apply damage will still be on server only

gusty slate
#

I feel like he's overcomplicating something like a lean. If you're worried about lag, imo it would be better that whatever other clients are seeing is what you're seeing. If in case a lag, I would rather the player not lean than think he's leaning but for others he isn't

gritty warren
#

or on all sorts of stuff

#

but Datura's explanation made the most sense to me, and also I appreciate everyone's contribution

gusty slate
#

the delay in this case would be caused by connection issues for example, it'll be problematic anyway, you're just impacting what the local player sees with your prediction

gritty warren
#

๐Ÿค”

gusty slate
#

dw ๐Ÿ‘ I'm way too sleepy to be in here lol

gritty warren
#

my game is co-op, if that helps clear anything up for you

#

it's totally fine if the local player sees different things than everyone else at slight delays, not like it's going to matter. I'd rather it be responsive for the player

#

but at some point everyone needs to see that the player is leaning

dark parcel
#

If locally controlled, set the lean right away. Do a server rpc

gritty warren
#

yee Datura explained it very well

#

thank you though!!

#

I appreciate everyone's contribution

gusty slate
#

Good luck ๐Ÿ™‚ wrapping your head around multiplayer isn't easy

#

even with experience ๐Ÿ˜‚

gritty warren
#

yeah hahaha, hoping I get there eventually!!

#

thank you, I wish you luck too ๐Ÿ™‚

narrow oak
#
latent heart
#

Is there an event which triggers at some reasonable place for the last possible moment to get an rpc sent this tick?

#

Even it it doesn't get sent this tick, it's possible to send this tick.

#

I fear OnEndFrame might be a bit late.

narrow oak
#

idk i copied this from an other project i did and it worked fine. i added the replication events as a last resort since the rep notify var wasn't doing anything too

#

working as intended because i can print a string when the idle is supposed to be false

#

how do you think i can fix it?

#

uhhh

#

why are my different clients only name "client 0"?

sinful tree
narrow oak
sinful tree
#

No

narrow oak
#

alright thanks for the info

narrow oak
sinful tree
#

You're attempting to call a multicast from an input event. Input events are executed locally only, so if it's a client calling it the multicast won't fire.
You also typically don't want to multicast state. You use RepNotify replicated variables to control state and must set them on the server in order for them to be replicated to others.

Typical flow is:
Input > Run On Server event > Server sets replicated variables / calls multicasts (if needed)

Idle is also likely something you don't need to replicate. It should be able to be handled locally by clients that you can check in your animation blueprint - if the player's movement component has no velocity, then they're idle.

narrow oak
torpid lantern
#

Where do I want to be storing secret keys for my server-side API logic?

Is it okay to put those on the GameInstance or GameMode in variables; provided those variables are only ever accessed via dedicated server RPCs?

sinful tree
# torpid lantern Where do I want to be storing secret keys for my server-side API logic? Is it o...

What I've done before is have the keys stored in an external file and you don't distribute the file. You can have the game instance read them in on init. This can also allow you to easily change your keys without having to recompile anything.

I think what Matt is hinting at is that in C++ it doesn't really matter where you set them as you have access to be able to decide what gets compiled into a server or client build of the game so you can choose to have the variables be set for a server but those values wouldn't be included in a client build.

In blueprints, including the variables in your Game Instance would be a bad idea as the Game Instance would be packaged and sent to clients, and someone with enough knowhow would be able to pull those keys out. Game Modes you can opt to exclude from client builds if there is never an intention of allowing a standalone version of the game being able to use those game modes, just ensure that whatever game modes you're setting them in that you've excluded them from your client builds so you don't run into the same problem distributing the keys as the Game Instance.

torpid lantern
torpid lantern
#

I'm looking in project settings, but would you by chance know which setting is used to configure excluding the gamemode on package? I like the idea of a detached file, but I feel like that would be tricky in BP - or would that be "Load JSON from File"?

sinful tree
torpid lantern
#

You've helped me in the past and I want to extend a big thank you. I think I'd have abandoned game development awhile back if not for the support from yourself and this community.

Much appreciate all of you. โ™ฅ๏ธ

narrow fog
quaint tendon
#

Why would a non-replicated character not jump when the Jump function for the character is called while running multiplayer with a dedicated server?

I have non-replicated characters used in a tutorial area and would like these specific characters to not be replicated but they won't jump/take commands even though nothing is replicated.

sinful tree
quaint tendon
#

It's not possessed. It's just a BP Character placed in the level that calls the Jump function and loops when BeginPlay is called. The debug shows the BP function is being called in the client it just doesn't appear visually. Nothing in the BP is replicated, everything replicated is disabled.

sinful tree
#

Turn on Replicate Movement. The actor itself can still be set to not replicated so nothing should be getting replicated.

quaint tendon
#

You might be onto something, behavior is so weird. Why wouldn't a non-replicated actor just jump, it doesn't make sense.

sinful tree
#

Hmmm.. Even with the actor not set to replicated, the replicate movement seems to be happening on the client too, even without the client performing the move.

quaint tendon
#

There's probably C++ code that is assuming all characters are replicated on the server.

primal trellis
#

I'm trying to get players from one server to move to another server, but it always fails. Can anyone tell me what's going wrong here?

There in the print is the way I currently create a session. And in the second print, the PC's are the players that I get from OnPostLogin. So after using find sessions advanced, I pass the result to this **event **and do the join session

more info: I'm using the Steam server, there are players who** create a session** (being the host) and** join** it (inviting friends from Steam). And I want everyone from the server that I found in **find sessions advanced **to **migrate **to this new host/session (even the current session host, all players)

quaint tendon
#

a) Try putting a ? in front of listen "?listen"
b) Try Open Level (on the client side) instead of Join Session on the server side and see if you can try to use the server's public ip as the Level Name, if it's local it's 127.0.0.1. That's what I do.

primal trellis
quaint tendon
#

c) Try the Join Session on the client and not on the server.

vital furnace
#

After doing a ServerTravel to a map, is the OnPostLogin of the Game Mode for the new map executed? If not, how can I retrieve the Player Controller of the player arriving on the map?

languid wedge
#

I'm coding a phone system that players can use, and this system plays videos via a widget using a Media Player. However, when a client opens a video and the server opens a different video at the same time, both sides end up opening the same video and they synchronize. How can I ensure that each player (client and server) can play their own video independently without the Media Players interfering with each other?

fervent leaf
#

Does someone know how multiplayer games handle dungeon instances? Like in world of warcraft if you are in party and enter dungeon it creates new instance of the dungeon for your party, when you leave it returns to the open world which is same instance for everyone. I don't understand how it is made and how something similiar could be made with unreal engine.

worthy oak
fervent leaf
#

So basically players just seamless travel to a different server which contains the dungeon, would that mean they would need to have thousands and thousands of servers running

worthy oak
#

If your looking for specific technologies that do this, one such option would be AWS gamelift

#

Potentially yes

#

But the servers are shutdown once the dungeon has concluded

#

Some games will shove a few dungeons instances into the same server

#

Player essentially makes a dungeon matchmaking request, backend spins up a new instance based on the request, gives the party the IP. They join, run the dungeon, and when the players leave the instance is shut down

#

This is also typically whatโ€™s happening when games have zones or channels

#

Like in guild wars where they are multiple zone instances for a single map

fervent leaf
#

What about if you dont use dedicated server and one of the players is the server. Is there a way to fake it. Like enter portal -> teleport -> create or load the dungeon which is already inside the map as we cant change the level if server is on a different one

worthy oak
#

No out of the box unreal only supports a single level loaded

#

Now you could teleport the players to a map that isnโ€™t visible

#

Like have your dungeon below the map or something and you just change the location of the player

fervent leaf
#

But then you cant have multiple versions of it

worthy oak
#

Well you could use streaming levels I suppose

fervent leaf
#

Yeah, i'm not really sure how could it be done that actually all of the players would have its own version of the dungeon..

#

Might not be even possible

#

as only way would be propably to load the whole dungeon on runtime like as and instanced actor for each player

#

or instanced level actor, what ever is the name to pack objects from level to an actor

worthy oak
#

Yeah usually this would be done with dedicated servers instances

woven basin
# fervent leaf But then you cant have multiple versions of it

you can - you have set areas under the world for each "instanced" dunegon - and each player goes to their own area. As each player leaves, you unload the instanced dungeon, so if you support 10x coop players at one time, you have 10x instanced dunegon spots under the world, and just cycle them as needed.

fervent leaf
woven basin
#

so you can have multiple of one dunegon in different positions under the world

worthy oak
#

or could use something like dungeon architecht

#

and generate the dungeon at runtime

#

then move the player to that dungeon

fervent leaf
#

I though level streaming is just a way to hide and load parts of the map when its not relevant

woven basin
fervent leaf
#

Or maybe there is some fancy staff in world partition

worthy oak
#

its for streaming in a level ๐Ÿ˜„

#

so dungeon arch to bring it up again

#

can do this for you by not spawning rooms until the player gets close

#

to help with performance

fervent leaf
fervent leaf
worthy oak
#

only just begining to play around with it, its awesome so far ๐Ÿ˜„

twin roost
#

if replicated variables get set in client, do they also get replicated in server and other clients, or do you have to call a server function to set them from a client?

woven basin
twin roost
#

what is rpc?

#

does it stand for Remote Procedure Call?

solar stirrup
#

yes

visual widget
twin roost
#

alright, thanks for the info

narrow fog
# narrow fog I've got something that has me flummoxed. I have replicated Units that also hold...

So throwing an arrow onto the scene at the origin confirms that the tile is being aligned to it.

Is this a problem with replicated level components? Like some sort of loading order problem aligns it to the origin before actually moving it to position?

It's still only happening on the second+ launch of a 2-player listen server configuration, so maybe it's some sort of caching issue with the editor?

eternal dune
#

Can RPCs only be defined on Actors and not UObjects or something? I have a UObject derived class that is used as a member property of an Actor Component. The UObject has server RPCs defined it. The compiler certainly makes no complaints about the RPCs being defined, but whenever I try to call them I get an error that say "no owning connection" and the RPC call is suppressed

eternal dune
#

sigh Even if I move the server rpc to the Actor Component, I still get the same error.
How can a replicated Actor NOT have a net connection?!?!

#

Ugh. Objects placed in the Editor don't have owners, and thus no net connection. It looks like I have to either spawn these objects from the GameMode or have the playercontroller call a server RPC that then does a NetMulticast, which will get sent out to actors even if they don't have a net connection.

What a mess

#

Welp! Time to complicate my code some more!

thin stratus
#

@eternal dune

  • UObjects usually don't replicate to begin with
  • I do actually not know if they can run RPCs, but I would guess they could. Would still go through the owning Actors ActorChannel though
  • For any kind of Server/ClientRPC, the Actor needs to be owned by the Client. That means the Server has to set the Owner to the PlayerController or anything in the chain when spawning it, or it has to call SetOwner on an existing Actor. Both only works if the Server calls it.
ocean geyser
#

i cant remember, by default does the rep notify function fire even if there was no change on the local value or does it always fire? i know its set to OnChanged by default with FDoRepLifetimeParams but im not 100% sure for normal/DOREPLIFETIME

ocean geyser
quasi tide
ocean geyser
quasi tide
#

Have to use the NOTIFY_ALWAYS arg for the CONDITION macro

#

Or maybe it is just Notify_Always

#

I can't remember the exact nomenclature

ocean geyser
open adder
#

in my multiplayer game, when I change weapons, I have to respawn the actor. I spawn on the server, there will be a problem with high ping.
What is the solution to this, best practice?

quasi tide
#

Just accept it. It is high ping.

open adder
#

It causes a noticeable delay even with a 60ms ping.

sinful tree
#

If you wanted, you could do this predictively on the client too, thus eliminating all lag, but that also requires a bit of know-how as to how you revert it if the server doesn't want the player to swap to that other weapon.

magic vessel
eternal dune
primal trellis
#

If a player is hosting a session and he leaves, the entire match will crash, right? Is there any way for me to choose a new host at this time?

sinful tree
primal trellis
kindred widget
#

Lots is sudden interest in host migration stuff going on lately. O.o

hollow raven
#

And not the typical host migration

tardy fossil
#

the only host migration i've seen is built right into a custom net driver class

#

so i think it takes some work and knowledge to get working

slim jay
#

I want to add client-side prediction to the firing event, but it's still not working as I want; the latency is still noticeable. Does anyone have any suggestions?

lost inlet
#

then you didn't predict anything?

modest crater
tardy fossil
#

making prediction work on anything more than a 1 shot click to fire gun can be quite the PITA if you arent experienced with networking/multiplayer... just a warning

thin stratus
#

Runtime spawned ActorComponents. Does one always just set them to be NetAddressable, or is there a different way to ensure they can be addressed?
It would need to return true for IsNameStableForNetworking, but not sure what the requirements are for runtime spawned Components.

stable tundra
#

Hello, I'm attempting to joining my multiplayer game, and am running into an issue.
it appears that there is some form of whitelist going on?
I can provide full logs if nessesary.

Request LAN server list -> I can join the servers no problem.

Request Internet server list -> attempting to join:

[2024.07.05-03.13.57:567][961]LogNet: SteamSocketsNetConnection_2 setting maximum channels to: 32767
[2024.07.05-03.13.57:567][961]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2024.07.05-03.13.57:569][961]LogHandshake: Stateless Handshake: NetDriverDefinition 'GameNetDriver' CachedClientID: 7
[2024.07.05-03.13.57:570][961]LogSteamSocketsAPI: Warning: SteamSockets API: Warning [#2154340560 P2P steamid:90199703177629717 vport 27017] Relay candidates enabled by P2P_Transport_ICE_Enable, but P2P_TURN_ServerList is empty
[2024.07.05-03.13.57:570][961]LogSockets: SteamSockets: Now tracking socket 2154340560 for addr 90199703177629717:27017, has parent? 0
[2024.07.05-03.13.57:570][961]LogNet: Game client on port 27017, rate 100000
[2024.07.05-03.14.04:375][252]LogUIActionRouter: Cleaned out [0] inactive UI action bindings
[2024.07.05-03.14.07:571][868]LogSteamSocketsAPI: Verbose: SteamSockets API: Log [#2154340560 P2P steamid:90199703177629717 vport 27017] problem detected locally (5003): Timed out attempting to connect
[2024.07.05-03.14.15:222][936]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = PendingConnectionFailure, ErrorString = Your connection to the host has been lost., Driver = PendingNetDriver SteamSocketsNetDriver_2
[2024.07.05-03.14.15:223][936]LogNet: Warning: Network Failure: PendingNetDriver[PendingConnectionFailure]: Your connection to the host has been lost.
[2024.07.05-03.14.15:223][936]LogNet: NetworkFailure: PendingConnectionFailure, Error: 'Your connection to the host has been lost.'
[2024.07.05-03.14.15:223][936]LogBlueprintUserMessages: [BP_UO_GameInstance_C_0] Pending Connection Failure
[2024.07.05-03.14.15:223][936]LogNet: DestroyNamedNetDriver SteamSocketsNetDriver_2 [PendingNetDriver]```

server console occasinally prints:
```[2024.07.05-03.14.06:777][508]LogSteamSocketsAPI: Warning: SteamSockets API: Warning Ignoring P2P signal from 'steamid:76561198060294593', unknown remote connection #2154340560```
slim jay
modest crater
#

This is typically how I like to handle my server/client code if they both run basically the same thing, (i would obviously put more guarded stuff in the FireWeapon that only can run on authorities). Its almost like a recursive func but its not at all. Keeps things simple


void FireWeapon() 
{
  Result = LineTrace()
  Blah

  if(!HasAuthority())
    Server_FireWeapon(); // << assuming we own the actor (otherwise this RPC wouldn't fire) 
}

void Server_FireWeapon() // << assuming this a Server RPC 
{
  FireWeapon();
}

#

I'd just call the FireWeapon locally and it'd handled relaying it and calling itself on the server.

slim jay
quasi tide
#

Either him or James have.

#

Not as helpful, I know. But I don't recall and figure it could at least point you in a direction ๐Ÿ˜…

cyan bane
#

Where would you put replication logic for a ui button press that resets the location of certain actors in a level? Player controller?

shrewd ginkgo
#

I try to select random impostor like among us but it select server every time

#

I trigger it in spawn player. spawn player connected event handle start

#

all of those things in gamemode

#

just is impostor bool in character bp

sinful tree
# shrewd ginkgo I try to select random impostor like among us but it select server every time

No need to do any of this part.
The GameState has a variable called Player Array which is an array of PlayerStates. You can get the Controller from the PlayerState. The length of the array is the number of players in the game.
To select a random player to be the impostor, get the array, and do a "Random" of it which then selects a Random PlayerState which you can then use to say that player is the Impostor.

shrewd ginkgo
#

I don't know enough English and unreal engine to understand this, if possible, could you do it and send me a picture. It doesn't matter if it's hard for you. I'll figure it out somehow.

upbeat basin
#

Is there any recommended reading material about online subsystems and EOS, more than just create/find/join tutorials?

thin stratus
#

EOS specifically probably just the docs

#

Not sure what exists there

neat prism
#

Hi all, I think Im overlooking something. I have a Listen Server with connecting clients spawning in and being set up by logic that exists in the game mode. Weapon actrors are spawned on the gamemode (called from a set of logic that passes HasAuthority() in the character). The weapon actor has a USceneComponent that acts as the emitter location for the bullets.

Here is where things get funky: The weapon actor rotates individually of the owning character based on lock on(this works on both client and server). The emitter debug draw shows that my bullets should be spawning in the correct place for the server and client.

However, when a connected client is playing, the emitter doesn't "rotate" with the gun, it only rotates with the actor, despite being parented directly to the gun and the debug draws working. Here is the kicker: when the host looks at the client (or their gun?) Suddenly the spawning of the projectiles works perfectly on both server and client.

Am I having a relevency issue? What is happening? I have been scratching my head since last night.

#

In the first picture, the host is not looking at the client, and the bullets go in the direction of the drawn red arrow:

But when the host turns around their camera (second picture) and can see the gun, the bullets go the right direction (sorry you can't see the bullets i just took screenshots not a video)

thin stratus
#

@neat prism Set the SkeletalMeshComponent to Tick and Update Bones etc. even if not rendered.

#

It's a dropdown somewhere in the SketetalMeshComponent

neat prism
#

you are a life saver. I was questioning my understanding of the engine and multiplayer (let's be honest don't we all)

gray sparrow
#

i have bought the layered fog of war from marketplace

#

how can i set that team 1 dont see team 2 until they in sight?

#

i need to code ai perception?

dark edge
gray sparrow
#

he dont know himself.

#

he dont know -.-

dark edge
#

Sounds like typical plugin shenanigans

#

OK you got 2 systems that you need to make work together. You have whatever system is involved in your AI "seeing" things. IDK what you're using but you're using something.
Then you got the fog of war system.

#

You need to either modify the ai perception setup in some way to USE the fog of war system as the vision test instead of what it usually does by default (line traces I think)
or
You can just not use ai perception and do your own thing.

gray sparrow
#

i really dont udnerstand ^^ ca you explain for a noob?

#

i ahve the fog of war

#

and someone told me i have to code ai perception with c++

#

but i dont know c++ -.-

dark edge
#

You're probably way over your head right now.

#

But you can do it without the ai perception stuff if you want

gray sparrow
#

i can jsut do it wihtout ai perception and only with blueprints?

dark edge
#

do you want fog of war vision to be the ONLY way the ai sees?

gray sparrow
#

i have 2 teams

#

character in team 1 dont see character in team 2

#

and team 2 dont see team 1

#

like league of legends

dark edge
#

yes i get that

gray sparrow
#

can i do this only with blueprints?

dark edge
#

do you want vision to be the only way the ai knows if it can see something or not?

#

Does the fog of war system support being able to ask if a point or actor is visible?

gray sparrow
#

not really

#

can i do this without ai percepton? to set it like league of legends

#

cause the problem is

#

dont dont know any way how to do it?

#

i have no idea how to set this

dark edge
#

You're gonna have to start figuring stuff out

#

this is a HUGE mechanic if you're just starting out

gray sparrow
#

i thught i can set jsut team in blueprint and thats all..

rapid lodge
#

From the documentation of replicating uobjects, it says under modifying or deleting a subobject (using registered subobjects list) that AActor::RemoveReplicatedSubobject must be called as the garbage collector will purge the subobject. Does anyone know what modify entails? Does any change such as incrementing a replicated counter count? And in that case, should you remove, increment counter, and then re-add the subobject?

sinful tree
# gray sparrow i thught i can set jsut team in blueprint and thats all..

I mean, you can have a "team" variable and set it, but what would that do on its own?

Is there a team variable already integrated with the fog of war system itself? Random people on here won't know much about specific code plugins, but the plugin developer should if they're the one that built the plugin. If there is no integrated team setting within the plugin, then you'd have to extend the functionality of the plugin to include one so that it does what you want based on that team value and that can be a large undertaking depending on how that plugin works and may not be entirely doable within blueprints alone.

#

Based on this screenshot from the plugin page, it seems like this should already be possible with this plugin.

gray sparrow
#

this works

#

for the ai minions it works

#

but not for the characters

#

the developer will send tomorrow new docuementation

#

but it dont know if he can do that he tried it today...

kindred cairn
#

Hey guys, I'm suffering with a rubberbanding problem. Can't find what is causing it. Playing on a Dedicated server my simulated proxies are lagging back-forward from time to time, here is a video with the problem: https://www.youtube.com/watch?v=ZJ2dSEGFVZY . Character moves using standard UE Character movement controller. What is interesting this happens to all simulated proxies I see on a screen at the same time. Has anyone noticed anything similar?

shrewd ginkgo
#

this photo in Thirdperson_bp

#

those in footprint_bp

#

I want to make footprint that only can hunter see

#

and the hunter can't leave footprints

#

just the other players have footprint

#

if the hunter is a server, everything is fine, but if the hunter is a client, the hunter himself leaves footprints and this is confused with the footprints of the prey, so there is confusion

#

how can I fix it

gritty warren
#

Like have you done anything at all to the character movement component, or is it just default?

kindred cairn
#

@gritty warren I have reset it to default for testing purpose, but problem is still there.

gritty warren
#

you can also do something like show net corrections

#

i forget what the exact command is

#

but that will tell you if its the server correcting your movement or something else

#

p.NetShowCorrections 1 is the command

#

when you teleport, some red and green spheres will appear if it is because of net corrections and lag

kindred cairn
gritty warren
#

I see, well show net corrections and also your latency

#

even the default CMC can have trouble if latency is high enough

kindred cairn
#

so most likely it's latency issue?

gritty warren
#

No idea tbh, if your latency / connection is fine and you're using the default CMC and you're still getting corrections, I have no idea what to do lol

kindred cairn
#

thank you anyway)

gritty warren
#

--

I'm trying to do some checks to determine if my pawn is
A) Client owned on the client,
or
B) Owned by the listen server host on the listen server (e.g., I am host, and I am my character)

#

For A) I'm just checking GetOwnerRole()==ROLE_AutonomousProxy, which should only be the Client owned on the client

For B), I'm checking GetOwnerRole()==ROLE_Authority to determine if the character is on the server, but I'm not sure how to distinguish if this is also the character owned by the host.

I was trying GetOwner()->GetRemoteRole == ROLE_SimulatedProxy because I thought it'd be a simulated proxy everywhere else, but I'm getting odd results when testing this in PIE

#

Or rather, I'm jsut trying to print out the various roles, and am unable to get each instance to print on all machines

#

(e.g., I have 3 pawns, and I want each one to print its own role + remote role on all 3 instances, for a total of 9 print strings)

rapid lodge
#

@gritty warren I usually use a mix of IsLocallyControlled and HasAuthority. If both are true, you are playing as the host. If LocallyControlled is true and authority is false, you are playing as an autonomous proxy. If Authority is true and local is false, its a server simulated character. If both are false, its a client simulated character.

shrewd ginkgo
#

I want to make skin stealer but something is wrond can you help me

gritty warren
#

It's fine to do so, just checking

rapid lodge
#

IsLocallyControlled is on the pawn class, and has authority is on the actor class. You dont need the controllers at all

gritty warren
#

๐Ÿคฆ

#

I did 'GetOwner' but never casted to pawn

#

silly me

#

thank you!

rapid lodge
#

๐Ÿ‘

gray sparrow
#

guys can someonehelp me

#

i cant get this work

#

" layered fog of war plugin" from marketplace

#

every character see each other

#

how can i hide the other character to another character

sinful tree
gray sparrow
#

anyone know? if i need c++? oder ai perception?

#

or can i do this only wiht blueprint?

sinful tree
#

Do you have any idea what this part of the code does?

gray sparrow
#

not really

#

cause the developer same dont know everything -.-

#

ts the same like gk fog of war

#

i bouhgt 1. gk fog of war worked weeks on it it cost me 55 euro

#

the developer dont know anything

#

then i bought another fog of war for 90euro

#

and its the same -.-

sinful tree
#

Then why are you bothering spending money on something if you don't even know how to read what this does?

gray sparrow
#

gk fog of war 55 euro layered fog of war 90 euro ๐Ÿ˜„

sinful tree
#

There's not going to be an 'easy button' to just do things.

gray sparrow
#

i ask them if i can make it liek elague of legends

#

and they told me yes

#

you can go on both fog of war

#

i ask both develpers if i can use this liek league of legends

#

and i aks if its easy

#

they told me no programming skills needed

#

every thign i bought in amekt palce for 500 euro

#

every thign works well

#

with documentation

#

everythign! implentign in 5mins

#

i got never roblems

#

only with this fog of war plugins!

#

gk fog of war updatet it for me ... he update the plugin for me get it work and it dont work

#

nor the layered fog of war developer give update tomorrow

#

but i know it will not work

#

cause if he know how it works he can tell me something

#

but he cant

#

tommorow come the update

dark edge
sinful tree
#

Ok, so you're venting in the wrong place. The vast majority of people here likely haven't even heard of this plugin, let alone know how to do anything with it.
Most code plugins are just that - code. You need to implement the logic they provide with how you want it to work with your game. How you get to that point is more usually far more complicated than a simple flick of a switch, or someone being able to easily tell you what you need to do, especially so if it's something developed by other people. That little tidbit of code is an example of something extremely simple that could be going wrong, and if you don't know how to read that an interpret what it does then you probably shouldn't be buying them. I'm not saying this to be mean or trying to dissuade you, but you're probably wasting your money and time, and most plugins always require some degree of integration with your own code.

If you have problems with a plugin and don't know what to do, you should be going to the source of that plugin, especially if it's something that is paid. Even if the developer themselves can't help you, you can usually find communities (like Discord channels or forums, etc.) focused around plugin developers or their products where there are people who have used it and may have an idea of what to do.

As for that tidbit of code, why you could be seeing both players on the same team is because it's randomly getting a team index and both players could be getting assigned to the same team.

gray sparrow
#

the problem is

#

blueprint si know how t works

#

but he told me he write 20k lines in c++

#

how can i know how something work

#

he told me 20 k lines of c++ code

#

i even ask him how something work he cant tell me

sinful tree
#

Then your problem is with him.... We can't fix that.

gray sparrow
#

before i bought it he told me i can use it exactly like league of legends

sinful tree
#

Documentation and an API is important for code plugins.

gray sparrow
#

i hoped someone here know how to use it ๐Ÿ˜„

#

or have any idea

#

what i need or have to do

sinful tree
#

And unless you know how to read said documentation and API, then you don't know what you're doing, thus, you shouldn't be buying these kinds of products as you are likely wasting your money.
And again, someone here knowing is EXTREMELY unlikely. You are in fact the first person in this discord to mention it by name.

#

Not only that, but it seems like it was only released a couple of weeks ago... That makes it even less likely that someone may know as it hasn't been around for some time where it may have proliferated through the Unreal community.

#

Reminds me of a guy that was constantly asking for help with playfab on here.... He ended up becoming like 10% of the posts about playfab within a couple of weeks because it's not talked about all that often on here and mostly just as a mention as it being a place that can host games. That's something that has been around for years, yet you still won't find much help on here as it's not something widely used.

#

You probably don't need to go into C++. You probably dont' need to worry about AI perception. It's likely there is some values you need to tweak.

gray sparrow
#

i found 1 guy with this plugin he got this work

#

but he dont tell me how ๐Ÿ˜„

#

in his discrod he told me 1 thing!

#

he only send me this side

#

and told me when i follow this tutorial i will find the solution ๐Ÿ˜„

#

thats all he told me

#

but all people say me i dont need c++ and ai perception

sinful tree
#

He probably sent you that because it has a mention of Teams and using the integrated team solution (which does require C++) but it's not mandatory to use it, nor do you need AI Perception to determine any teams.

#

It goes back to this.... This here looks like it is randomly determining the team index. Do you have some other way of determining what team a player should be on? Do you know where this function gets called? Maybe you have some variable already you're using for determining teams that you could potentially use instead?

gray sparrow
#

there nothign works really well

#

idk how this work

#

i told ya this is 20k line of c++

#

how can i know how soemthing work

#

in blueprints every node has his defintiotn and what it does

#

here is the components

#

and some set team values

#

but i already treid everything

#

and at the end i dont know everythign waht something does

#

again its all c++

#

and for example blueprint nodes i know everything cause it all defined and you can read everythign waht a node doas

kindred widget
#

lol... 20k lines of code for FoW. Kinda verbose.

gray sparrow
#

he told me

kindred widget
#

๐Ÿคทโ€โ™‚๏ธ Either way. If you don't want to hire a programmer, I would recommend learning basic C++ to be able to follow and expose stuff in engine. And this is single player advice. Since we're in the multiplayer channel, C++ is practically a requirement. You can do very basic games in BP only, even multiplayer to some degree, but there is so much you miss out on that keeps your project clean and working well.

gray sparrow
#

i think blueprints is enouhg for a game

#

you can do every thing with blueprints

#

everything

fossil veldt
# kindred widget lol... 20k lines of code for FoW. Kinda verbose.

tbf if itโ€™s actual fog of war, with relevancy and other proper network considerations for both client and server thatโ€™s totally reasonable amount, that shit is complex, if itโ€™s just some hurr durr alpha paint post process then yea 20k is questionable

#

but a proper relevancy intersection and graphics code and all the rest iโ€™d say 20k i wouldnโ€™t be mad at if itโ€™s for literally the entire integration

magic vessel
# gray sparrow you can do every thing with blueprints

I think that is because you haven't been exposed to the full capability of C++. I used to think the same as you, but then started working with C++ and then I realised just how limited BP was. It has it's place but it cannot do everything, and really shouldn't be the place for performance intensive operations or for loops

gray sparrow
#

explain me waht c++ can waht blueprints dont can

#

every one talking

#

tell me what i cant to with blueprint only with c++

hollow eagle
#

go fast, implement blueprint itself (if someone wants to take that as a challenge be my guest), use any of the more advanced networking features, anything that involves custom rendering, see how the engine actually works and why your own code does not

#

I could go on

sinful tree
quasi tide
dark parcel
#

Literary you can't do everything with bp

#

Go make an async loading screen in bp

#

Go make sprinting in multiplayer with client prediction

#

There's soon many things not exposed and you can't just write your own thing, hitting bp limit is very quick

#

Can't use GAS without cpp, can't make use of libraries. You can only do things in blueprint as far as what is allowed to you.

Don't go 100% bp

worthy oak
#

Not quite fair to go that direction either

dark parcel
#

You will see bp limitation even faster in multiplayer.

worthy oak
#

Multiplayer is possible in Bp and has been done

#

But you have to understand its limits

worthy oak
#

Not to mention plenty of plugins that expose stuff for ya in BP

worthy oak
dark parcel
#

Plugins written in cpp

worthy oak
#

Correct

#

But otherwise can be used in BP

dark parcel
#

I never said doing multiplayer with bp is not possible btw

#

Good enough for turn based game

#

I encourage people to learn what they have to learn. Or just pay someone to do it

worthy oak
#

Iโ€™m just saying neither extreme is good

dark parcel
#

Pretending something can do a job when it's not is just limiting one self

worthy oak
#

Other types of multiplayer games have been done

#

They arenโ€™t large in scale but thatโ€™s kinda the point

#

Sure if your doing an mmo or vslorant

#

BP only gonna bite you in the butt super fast XD

dark parcel
#

Plugins isn't really bp only, that's already paying to get what you want from the cpp land

short arrow
#

The indie dev who made choo choo charles using only blueprints (game made an estimate of over 5 million dollars) said something like... "Don't listen to people who say it can't be done in blueprints, if I listened to them I would have never been able to complete the game. There's always something you can do in blueprints there's always a workaround, don't listen to them..."

dark parcel
#

So you are still at the mercy of plugins

#

Or paying people

worthy oak
#

you are yeah

#

but that still is in BP

dark parcel
#

Well your project is no longer 100% bp

#

Which is the point

worthy oak
#

Swords 'n Magic and Stuff is a cozy, cooperative, open world RPG centered around the joy of discovery.An adventure unique to youExplore a large, densely populated open world on your own or with up to 15 friends. Swords 'n Magic is a casual journey of discovery. You play a blank slate adventurer just waiting to carve out a destiny for themselves...

Price

$14.99

Recommendations

781

โ–ถ Play video
#

Open world mutiplayer

#

BP only

#

which is what im trying to say

#

is it an mmo? nah

#

but it was done

#

now time for my ban for posting a link lol

worthy oak
#

casue unreal engine isnt coded in BP XD

worthy oak
#

Yes blueprints has its limits

#

yes C++ overcomes those limits

dark parcel
#

I'm talking about the need to add cpp class to unlock the limit of bp

worthy oak
#

but saying you cant make a 100% bp only game isnt always fair

dark parcel
#

Never did

worthy oak
#

I think thats the impression thats been taken though

dark parcel
#

My old game is 100% bp

#

And it's published

worthy oak
#

all im saying blueprint is a lot more capable than alot give it credit for

#

sure you will have instances, that often show up in multiplayer, where BP just isnt gonna cut it

dark parcel
#

I'm happy to unlock the trial version. Something that I regret not doing earlier

#

If someone come to face a problem where they need cpp, I would encourage them to learn it because of my regret

worthy oak
#

well yeah if there is a good solution in C++ absolutely

#

and plenty of times where C++ just does it better

dark parcel
#

Anyway not arguing about bp only multiplayer.

We had this argument many times

#

My response was to his comment about what cpp can do that blueprint can't?

Blueprint can do everything is what he said

worthy oak
#

right and that isnt accurate

short arrow
#

The argument is kind of funny because you're both right

dark parcel
#

I know and I'm sure you agree