#multiplayer

1 messages · Page 617 of 1

hasty yoke
#

Thank you ratJAM

shy flicker
#

@dark edge Seems like it detected the file as corrupted as i pass it from the other PC. Just creating a blank one and adding the info fix the issue. Thanks!

inner cove
#

When an object is spawned by the server and set to replicate, the construction runs only on the server right?

dawn ledge
#

I think both client and server would construct the object

vivid seal
#

@meager spade curious, why do you client RPC to confirm the hit when you’re going to multicast immediately after to confirm it for everyone? Is it just because the multicast is unreliable and the client RPC can be reliable?

meager spade
#

client rpc is reliable, multicast is not, correct. also that runs different logic specifically for telling the client your hit was good.

#

the multicast does not go to owning client FYI.

#

i mean its run, but owning client does not run the logic inside

#

cause the clientrpc handles that

twin vault
#

something broke my code somewhere between updating to 4.25
the AGameState::PlayerArray has the wrong amount of players, but i cant find out whats wrong by debugging...
seems like RemovePlayerState isnt working or something

fossil zinc
#

Is the Game instance local for all players? I'm trying to do something in the game instance of all players but only works on the server, even with a multicast

twin vault
#

yep its local

#

use game state etc

potent cradle
dark edge
potent cradle
#

No specific usecase, just looking for general best practices and trying to gauge just how bad it would be.

#

But seems like I'm on the same page, that there should generally be a good reason to set it as reliable.

dark edge
#

Yeah it's very rare that I end up reaching for a reliable multicast. I typically like to use rep notify for that kind of stuff

elder ravine
#

If anyone might wanna hop in a call with me so I can Show my Case Realtime then let me know

dark edge
vivid seal
#

if i pass a struct by const& to an RPC, will it work, or do i need to pass by value any time i'm going to another machine

kindred widget
#

@elder ravine Looks like you're doing something weird. All you should have to do is make a variable in the tank if it's controlled by a controller and then on tick, in only the locally controlled version of the tank, get it's controller, cast to player controller, locally set the hit cursor result, then ServerRPC that result to the server version of the pawn to set it for it to replicate to all except owner(Since owner is setting it locally). Then you can do your rotation stuff like on tick or whatever.

elder ravine
#

@dark edge

dark edge
#

@elder ravine that looks all sorts of fucky. To start, on tick, branch on IsLocallyControlled, and calculate either the aim position or rotation

#

Then, set AimPosition or AimRotation and also send it to server via a run on server event.

#

The aiming variable should be set to replicate, with condition SkipOwner

elder ravine
dark edge
#

Yes, PlayerController should only come into it when you're doing the trace to calculate where to aim. You can also just use the ControlRotation if that works for your setup.

elder ravine
dark edge
elder ravine
#

Ok will do

random nymph
#

Anyone here knows how to make linux dedicated server build that uses steam?

elder ravine
dark edge
#

@elder ravine not quite. After you check if it's locally controlled, you do a local aim, and then you call send aim to server.

#

And then on both the server and client, you rotate turret to aim at aim location

#

Your run on server event needs an input, which will be the aim location or aim direction

elder ravine
#

@dark edge It's sort of almost working now.

Server can not control itself. But Server sees clients moving now.

dark edge
#

@elder ravine both local and not locally controlled need to use the variable to set the rotation of the turret.

#

Just if it is local, you calculate the variable, set it, and send it to server.

#

So if not local, just set turret rotation

elder ravine
#

I feel so dumb, can't get it through my head. Can u Sketch it out ? I'll pay u on paypal

dark edge
#

Sec

#

I don't have the calc aim location math in there but that's basically it

elder ravine
#

I've set this now and it works! (apperently I also needed to tick Component Replicates on in the top right)!

dark edge
#

Make sure the send aim to server is NOT reliable

#

@elder ravine that will sort of work but it's unnecessarily complicated. Now you have to replicate the turret component instead of just replicating the data required to set its orientation. Also, with any sort of lag, the owning client is going to be rubber banding like crazy

elder ravine
dark edge
#

Because you aren't doing it the way I showed you.

elder ravine
#

Oh yes I see, i'll now do exactly as you showed

random nymph
#

I'm trying to build linux dedicated server, but this is the error I get

  LogWindows: Error: === Critical error: ===
  LogWindows: Error:
  LogWindows: Error: Fatal error!
  LogWindows: Error:
  LogWindows: Error: Unhandled Exception: 0xc06d007e
  LogWindows: Error:
  LogWindows: Error: [Callstack] 0x00007ffafec73b29 KERNELBASE.dll!UnknownFunction []
  LogWindows: Error: [Callstack] 0x00007ffa464f6d45 UE4Editor-Kingshunt.dll!__delayLoadHelper2() [d:\agent\_work\5\s\src\vctools\delayimp\delayhlp.cpp:312]
  LogWindows: Error: [Callstack] 0x00007ffa464ebcc5 UE4Editor-Kingshunt.dll!_tailMerge_steam_api64_dll() []
  LogWindows: Error: [Callstack] 0x00007ffa463a5eeb UE4Editor-Kingshunt.dll!AMainMenuPlayerController::AMainMenuPlayerController() [E:\KingshuntAwsLocalRefresh1\Source\Kingshunt\Private\Kingshunt\MainMenuPlayerController.cpp:31]```
#

Any ideas?

meager spade
#

well something in your controllers constructor is failing

#

show me your constructor

random nymph
#
AMainMenuPlayerController::AMainMenuPlayerController(const FObjectInitializer& ObjectInitializer)
    : Super(ObjectInitializer)
{

}```
#

And to be more precise the Development server Linux code compiles fine, but the error comes when trying to package the server target

#

And I have libsteam_api.so and steamclient.so in Binaries/Linux and I have added those as RuntimmeDependecies on the server target in my Build.cs

tardy glacier
#

HI! I'm trying to use the Gameplay Abilities UE4 plugin to replicate abilities and root motion animation montages across players. I'm also using SmoothSync to smooth normal movement but found that SS does NOT work with root motion if the server is using it (the server pawn jerks around real bad on the clients' screens).

Anyone else have a similar setup and maybe some idea of what I could change to get the SS to work better with the server player?

lost inlet
#

__delayLoadHelper2 seems to indicate that your game module is linking the steamworks SDK but it can't find the DLL on disk

#

is there a reason you are doing this?

#

@random nymph

random nymph
#

I shouldn't be linking it on server target

lost inlet
#

well this is the editor target

#

plus I wouldn't link the steamworks SDK in a game module anyway

random nymph
meager spade
#

UE4Editor-Kingshunt.dll

lost inlet
#

UE4Editor-Kingshunt.dll

fossil zinc
#

Hey guys, I'm creating and joining a session but after a while I want to go back to a main menu, however there I can't create other session to play again in the same instance. I assume that the old session is still created, how can I fix this so I can create new sessions without closing and opening the game again?

lost inlet
#

for online stuff, I prefer to go through the OSS. but if you really need the Steamworks SDK then I would recommend you use SteamShared as a dependency instead

#

since that manages the dependency order and loads the appropriate DLLs

random nymph
#

What do you mean by going through the OSS?

gritty pelican
#

i have problem with RPC

UFUNCTION(NetMulticast, Unreliable)
        void Multicast_SpawnMeleeWeaponImpactEffects(
            TEnumAsByte<EPhysicalSurface> PhysicalSurface, 
            FVector_NetQuantize ImpactPoint, 
            FVector_NetQuantize ImpactNormal, 
            int32 MeleeWeaponItemID, 
            int32 MeleeWeaponSkinID);
        void Multicast_SpawnMeleeWeaponImpactEffects_Implementation(
            TEnumAsByte<EPhysicalSurface> PhysicalSurface, 
            FVector_NetQuantize ImpactPoint, 
            FVector_NetQuantize ImpactNormal, 
            int32 MeleeWeaponItemID, 
            int32 MeleeWeaponSkinID);
lost inlet
gritty pelican
#

can i set TEnumAsByte in RPC?

random nymph
#

And how can the build target be editor if I select Server as build target and then build for linux 🤔

quick flint
#
void AHVS_Character::Client_EnableCustomRenderDepthForTeam_Implementation()
{
    for (TActorIterator<AHVS_Character> It(GetWorld()); It; ++It)
    {
        if (It->GetTeam() == GetTeam() && !It->IsLocallyControlled())
        {
            It->GetMesh()->bRenderCustomDepth = true;
            It->GetMesh()->CustomDepthStencilValue = 252;
            It->GetMesh()->MarkRenderStateDirty();
            if (IsValid(It->CharacterWeapon))
            {
                It->CharacterWeapon->GetMesh()->bRenderCustomDepth;
                It->CharacterWeapon->GetMesh()->MarkRenderStateDirty();
            }
            else
            {
                UE_LOG(LogTemp, Error, TEXT("Client_EnableCustomRenderDepthForTeam It->CharacterWeapon was nullptr. It was probably not initialized yet."));
            }
        }
    }
}

void AHVS_Character::PossessedBy(AController* NewController)
{
    Super::PossessedBy(NewController);

    PlayerController = Cast<AHVS_PlayerController>(NewController);
    
    Client_EnableCustomRenderDepthForTeam();```
#

So I made this Client RPC which is called from the PossessedBy method.

#

However, CharacterWeapon is not yet initialized, and sometimes (at least in PIE) there is only one character at the time of using TActorIterator

#

Where should I call this method, if not in PossessedBy

meager spade
#

well you weapon should pull it if its not ready at the time

#

in its beginplay

#

or w/e

gritty pelican
#

can help me?

meager spade
#

its just an enum

#

so yes

quick flint
#

The biggest issue I still have in Unreal is race conditions

meager spade
#

@quick flint that is with anything networked

#

not just Unreal.

gritty pelican
#

i have this error

error C2511: 'void ACPP_FL_Pawn::Multicast_SpawnMeleeWeaponImpactEffects(EPhysicalSurface,FVector_NetQuantize,FVector_NetQuantize,int32,int32)': overloaded member function not found in 'ACPP_FL_Pawn'
meager spade
#

TEnumAsByte<EPhysicalSurface>

#

not just EPhysicalSurface

quick flint
#

I mean I've used Unity to make multiplayer games and never had this issue, but it's because they make a separate solution for this called "Script execution order"

gritty pelican
#
UFUNCTION(NetMulticast, Unreliable)
        void Multicast_SpawnMeleeWeaponImpactEffects(
            TEnumAsByte<EPhysicalSurface> PhysicalSurface, 
            FVector_NetQuantize ImpactPoint, 
            FVector_NetQuantize ImpactNormal, 
            int32 MeleeWeaponItemID, 
            int32 MeleeWeaponSkinID);
        void Multicast_SpawnMeleeWeaponImpactEffects_Implementation(
            TEnumAsByte<EPhysicalSurface> PhysicalSurface, 
            FVector_NetQuantize ImpactPoint, 
            FVector_NetQuantize ImpactNormal, 
            int32 MeleeWeaponItemID, 
            int32 MeleeWeaponSkinID);
#

i make it, but have this error

meager spade
#

if it doesn't work just send it as a uint8

#

uint8 PhysicalSurface

quick flint
#

^

gritty pelican
#
void ACPP_FL_Pawn::Multicast_SpawnMeleeWeaponImpactEffects_Implementation(TEnumAsByte<EPhysicalSurface> PhysicalSurface, FVector_NetQuantize ImpactPoint, FVector_NetQuantize ImpactNormal, int32 MeleeWeaponItemID, int32 MeleeWeaponSkinID)
{
}
``` here will be uint8 to?
meager spade
#

ofc

#

tho can you not just do EPhysicalSurface? hmm

#

let me check

gritty pelican
#

but how i can convert to TEnumAsByte

if (ItemMeleeWeaponInfo.MeleeWeaponImpact.Contains(PhysicalSurface))
#

i have TMap with impact effects

random nymph
#

Looks like I got the linux packaging working by removing the steam bUsesSteam from the server target. Gotta test if I can use it without it

meager spade
#

@gritty pelican just cast it

#

btw

#
{
}
#

compiles just fine

#
    void ServerTest(EPhysicalSurface Surface);```
gritty pelican
#
if (ItemMeleeWeaponInfo.MeleeWeaponImpact.Contains(static_cast<TEnumAsByte<EPhysicalSurface>>(PhysicalSurface)))
meager spade
#

no

#

just do this

#
        void Multicast_SpawnMeleeWeaponImpactEffects(
            EPhysicalSurface PhysicalSurface, 
            FVector_NetQuantize ImpactPoint, 
            FVector_NetQuantize ImpactNormal, 
            int32 MeleeWeaponItemID, 
            int32 MeleeWeaponSkinID);
        void Multicast_SpawnMeleeWeaponImpactEffects_Implementation(
            EPhysicalSurface  PhysicalSurface, 
            FVector_NetQuantize ImpactPoint, 
            FVector_NetQuantize ImpactNormal, 
            int32 MeleeWeaponItemID, 
            int32 MeleeWeaponSkinID);```
#

and it will work just fine

gritty pelican
#

thanks, will try now

#
error LNK2019: unresolved external symbol "__declspec(dllimport) class UEnum * __cdecl Z_Construct_UEnum_PhysicsCore_EPhysicalSurface(void)" (__imp_?Z_Construct_UEnum_PhysicsCore_EPhysicalSurface@@YAPEAVUEnum@@XZ) referenced in function "void __cdecl `dynamic initializer for 'public: static struct UE4CodeGen_Private::FBytePropertyParams const Z_Construct_UFunction_ACPP_FL_Pawn_Multicast_SpawnMeleeWeaponImpactEffects_Statics::NewProp_PhysicalSurface''(void)" (??__E?NewProp_PhysicalSurface@Z_Construct_UFunction_ACPP_FL_Pawn_Multicast_SpawnMeleeWeaponImpactEffects_Statics@@2UFBytePropertyParams@UE4CodeGen_Private@@B@@YAXXZ)
#

i need to add PhysicsCore to private modules?

#

now compile success, thx

dawn glen
#

So its been a while since i worked in multiplayer. When i did it in the past it seemed confusing how to do it in c++ properly. You have a function that calls a RPC to server that calls a RPC to multicast and there are other functions that have to be added if you want it to be reliable and so on... So i went looking for "best practices" or "standards" for how multiplayer should be structured and most of what i come up with is old. So has nothing really changed with multiplayer that i could follow those guides and be fine? Or does someone have a link to a better more up to date guide?

pallid mesa
#

eXi's compendium is definitively a good start

#

given that you are starting over after so many years

dawn glen
#

So that older document still is completely relevant then. Not much has changed with how it operates.

quick flint
#

In PIE, there is a massive problem

#

If you spawn two players, in dedicated server mode and then try to create a Client RPC to enable GetMesh()->bRenderCustomDepth = true; on the characters spawned it will not work for some reason

#

You know. Race conditions are considered an exploit by the federal government in the USA lol

unkempt tiger
#

Does anyone know why my server is sending weapon A and my client is received weapon B? This has been slowly driving me mad

#

I'm sending the weapon as a weak object pointer that's a uproperty inside of a replicated state property

quick flint
#

not sure why ur even doing that tho

unkempt tiger
#

Its the active weapon being used, as part of the character state

#

Is there another way?

quick flint
#

well i don't understand what you're trying to do

#

can you give more info?

unkempt tiger
#

Yes, my player state has several things that describe what its doing: imagine position, velocity, and active weapon pointer, that struct is called FPlayerCharacterState

#

Because I have my own prediction system, I am maintaining a cyclic buffer of FPlayerCharacterStates, upon which I do things like prediction and rollback

#

Each state has a tick ID (some int in [0, 127]) which I use for time placement, since that tick is incremented in fixed time intervals

quick flint
#

And the server is sending the wrong value?

#

Have you tried to step through it using a debugger step by step to see what's being sent?

unkempt tiger
#

As far as I can tell? The server is sending the correct value, it's that the client is receiving the wrong value

#

For state 62, server sent weapon 'SphereThrower', but the client received weapon 'JumpMove'

quick flint
#

Well who is sending the value?

dark edge
#

Are you sure those pointers aren't just mapped to different things on either side?

quick flint
#

Like is this replicated?

#

If it's not a replicated value then it won't be the same

unkempt tiger
#

The weapons are actors that are replicated

#

It works 99.9% of the time, but it's that 0.01 percent where sometimes there's a mismatch

#

I tried that as well, it's the same issue

#

I think this is a bug with pointer replication of some sorts? Like all my non-pointer values are replicated perfectly

#

So much that I can guarantee that if I map my weapons to unique IDs and send those IDs instead it'd work

#

But it feels like a completely silly workaround

quick flint
#

I've never had this issue before

dark edge
#

I bet you the same weak pointer during either end points to something different. That's what it smells like to me.

unkempt tiger
#

I think you're right, but how do I track it down? Am i the one at fault here?

#

Those actors aren't new as well, they've been relevant for the client for quite some time

dark edge
#

I don't know is there any particular reason you're using a weak pointer instead of just a typical pointer or reference?

unkempt tiger
#

The main reason is that these states are stored in a buffer over time, and if a weapon is destroyed, I want the weak pointer to just be invalid

#

I'd rather not rely on UPROPERTY chains

#

I am still fairly sure it's not the weak pointer that's at fault, since the same issue existed without them as well

#

I suppose not

young spoke
#

The offset is consistent regardless, its driving me crazy XD

supple crypt
#

Trying to make a basic menu to start/join a listen client (all from my local machine at this point)
My Bp looks like this

#

however when joining with that join button I get this

#

The start game button appears to work (game loads the 3rd person example map fine).

#

What am I doing wrong?

#

I have tried loading the level and then connecting but I get the same error (tried that so I would not be in the main menu map)

supple crypt
#

replacing localhost with 127.0.0.1 makes it work... are dsns not allowed in there?

grizzled stirrup
#

If a replicated character spawns a replicated pickup but then that character gets destroyed, will the pickup stick around, owned by the world?

#

Or will it also get destroyed?

fringe matrix
#

if the pickup is an actor, it should just have a nullptr owner when the actor gets GC'd. that said if the pickup requires ownership that can leave it in a bad state, so you might consider doing something before the owner is destroyed.

terse prawn
#

Does a replicated actor's static mesh component's location replicate if the static mesh component is set to simulate physics?
I have players dropping items by walls and then bounce away and its in a different spot than on another client's end

terse prawn
grizzled stirrup
#

Thanks!

terse prawn
#

@grizzled stirrup just saw it, but you should take into consideration what Grimicus said
#multiplayer message

grizzled stirrup
fringe matrix
# grizzled stirrup Could you elaborate on when it would require ownership? If the character owns it...

when something owns it, like for instance in my game my items are not visible when they aren't equipped so when the character dies, if I don't do anything they'll just be invisible, so I have some code to make them going into a bag that drops when the character dies instead, then other chars can loot the bag. so just letting the actors implicitly be de-owned isn't necessarily good for your game, so just think about how you want it to behave. Yes, anything with UPROPERTY() referencing the destroyed actor would be set to nullptr

grizzled stirrup
#

Great many thanks for elaborating!

#

In my case I do want the pickups to exist independently from the character but spawned from them (as different enemies drop different things)

#

So perhaps I just won't set the owner in SpawnParams

#

And that'd be enough

pallid canyon
#

ugh T_T. It seems like Oculus OSS CreateSession creates both an oculus room and an unreal session, but if you're using Moderated rooms, you create it with API calls instead. How then am I supposed to create a session for it? Joining a room with an ovr_JoinRoom2 call does nothing without actually having a session on the server (to no ones surprise)

#

you're supposed to be able to find a moderated room with the FindModeratedRooms node, but it doesn't return any useful session information either. At best it tries to connect and returns
Warning: GetAddressInfo failed to resolve host with error SE_HOST_NOT_FOUND

paper lava
#

I need a master server and far as I underatand it, that's done with the online subsystem.. So, couple questions: can I use the steam subsystem before I release on steam? If I use vanilla subsystem, how das that even work, big picture.. Do I create a level or aomething?

modern swift
#

when the character or actor replicated and spawned from server. what function will call for both autonomousProxy and simulatedProxy , seems beginplay only call in autonomousProxy , but I want both

wise zephyr
#

hey guys for some reason the server doesnt see the correct actor tags on the client

winged badger
#

@modern swift every instance on every machine calls BeginPlay

#

unless you broke your GameState, then no Actor on any client will call it

wise zephyr
#

zlo u talking to me?

winged badger
#

no, you didn't ask a question that anyone here can answer, as there could be a million reasons for that and you didn't narrow that at all

stoic acorn
#

I'm trying to add on EventBeginPlay a HUD Widget for all players on the PlayerController, but for some reason the IsLocalPlayerController boolean is returning False.. Why would that be?

winged badger
#

use a HUD derived class

#

to manage widgets

#

it doesn't have those concerns, as it exists only for the local controller

stoic acorn
#

oh.. so on the character bp?

winged badger
#

no

#

HUD

#

YourCustomHUD_BP

#

you can set HUD class in the GameMode

stoic acorn
#

oh right.. I've been thinking about this all wrong then. Thanks I'll give that a go

winged badger
#

its pretty much designed to manage all widgets that aren't menus or loading screens

#

(its lifetime prevents it from handling widgets that might persist during level transfer directly)

stoic acorn
#

I initially had tried to do that but it wasn't appearing for anyone (including the listen server). I then tried it this way on the PlayerController and it was working but only for the Server

#

What I'm trying to create is a "Player Wins" screen that pops up at the end of a round

meager spade
#

that should be invoked by the GameMode via a client RPC called by the GameMode on each controller when the game is finished

clear sand
#

Hey guys, so back to dedicated servers and clients. How would I not make client to connect to server upon starting? I have some login/reg menus before user actually can login to server. If I select client as a mode in PIE - it connects me to server immediately along with starting standalone dedicated server. When I set mode to standalone - it starts as both client and server, so I cant actually differentiate if specific server code actually runs on server or client.

#

What is the correct workflow to develop client/dedicated server parts without mixing them together?

#

Before 4.26 running client mode would not spin up additional dedicated server

winged badger
#

@stoic acorn RPCing each controller is one of the few cases i approve of GetPlayerController(Index), you go GetNumPlayers => for 0 to NumPlayers -1 => GetPlayerController(Index) => CastToYourPC => SendClient RPC in GameMode

#

(iterating through every PC in the game and sending a RPC)

bitter oriole
#

That would be surprising

proper olive
#

I got a weird bug/issue hoping someone can help me brainstorm over...

#

Material with translucency rendered in front of fog until I checked Compute Fog Per Pixel

#

but it doesn't fix the issue for clients! 😮 😦

dawn glen
#

Is it still a thing where you cant reliably test multiplayer functionality in engine? Used to have issues that either wouldnt show up in a build or would break something in a build that works fine in editor and was a pain to have to constantly build out a server and test.

proper olive
#

nvm I fixed the issue by syncronizing the fog between clients n server better

ocean geyser
#

@dawn glen launch the game outside of the editor, no need to package. i create batch files for this

client:
"C:\Program Files\Epic Games\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\USERNAME\Documents\Unreal Projects\Project\Project.uproject" -game 127.0.0.1 -log -ResX=1280 -ResY=720 -WINDOWED

server listen:
"C:\Program Files\Epic Games\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\USERNAME\Documents\Unreal Projects\Project\Project.uproject" -game FirstPersonExampleMap?listen -log -ResX=1280 -ResY=720 -WINDOWED

server dedicated:
"C:\Program Files\Epic Games\UE_4.25\Engine\Binaries\Win64\UE4Editor.exe" "C:\Users\USERNAME\Documents\Unreal Projects\Project\Project.uproject" -server FirstPersonExampleMap -log -ResX=1280 -ResY=720 -WINDOWED
celest sleet
#

So how does does one spawn in an actor attached to another actor in a way that parent actor has a reference so that it works in multiplayer. I have a VRPawn attempting to spawn in the motion controllers. the client players motion controllers are spawning but are not connecting. I think it may be some problem with replicated events, but I have tried several combinations of casted events, and I am not getting any clue how to get it to work.

#

so in the Pawns begin play it calls a casted event to server to spawn the controllers, that much seems corect

#

but where do I attach the controller to the pawn, I have tried both in the same event they were spawned on the server, to no effect, as well as in a casted to clients event.

#

I just would like some info as to where the actor attachment should be occurring, I have tried so many times to get this thing to work over the past 3 months

#

is it need to be attached to the actor only on the server(And I just did it wrong), is the correct method to attach it within a casted event to all clients?(that I just implemented poorly when I tried). or could it need to be done witha repnotify

empty axle
#

Isn't the motion controller a component actually?

kindred widget
#

@celest sleet Not really sure what a casted event is? I think you mean RPC. And no. If you have two actors, they both need to be set to replicate, they both need to be spawned on the server, and the attached one needs to simply be attached on the server. The attachment replication will affect all clients after that automatically.

celest sleet
#

@empty axle I built this project off of the VR template, and how it worked was the vr controllers was an actor that contained the Motion controller component. with alterations the motion controller component is now part of the pawn, but the hands are still part of this other actor that I am trying to attach to the motion controller component in the pawn

empty axle
#

Anyway, yeah basically what Authaer mentioned

#

Probably that motion controller also have to be set to replicate in order for the attachment to replicate to clients

celest sleet
#

@kindred widget very interesting. as that very much seems to describe the latest test from this morning. they are all being spawned on the server and are all set to replicate and were being attached on the server, yet it worked for the host of the listen server but not the client. could it be a problem that the actual AttachActorToComponent node is inside of an interface call?

empty axle
#

@celest sleet So you are attaching the hands actor to the motion controller component on your pawn. Is the motion controller component set to replicate also?

celest sleet
#

yep

jaunty onyx
#

hello guys, basic question :

When we say we have 70ms (net pkt lag command for exemple)

Does this mean I have 70ms to reach the server including the server answer ? Or Should I add an extra 70ms to have the return ? Do you see my point ?

bitter oriole
#

Net packet lag 70 means 70ms additional to reach server and then 70 more back assuming client & server are set up the same

#
  • frame time on server to get ping
#

Looking at 160 ping

stoic acorn
young spoke
#

My server(top image) does a line trace just fine

#

But my client's always apppear to have an offset line trace

arctic turret
#

Hi, does anyone know if there is an out of the box replication of when a gameplay ability ends on the server? Or do I need to watch on GameplayAbilityEnded delegate and do it myself?

feral tendon
#

Hello guys!

I am having hard time making a packaged game and making it work with Steam. The error I get is the following:

What I have tried:

  • cleared all Saved/Intermediate/Binaries folders and regenerated these
  • I have all the modules included in uproject file + everything works when launching the game when not packaged
  • I have check the Plugins in project settings multiple times, everything is also checked there

Any idea, what might be causing this?

dawn glen
#

Anyone know how a game like Satisfactory is able to allow co-op multiplayer without having to manually set port forwarding or opening ports in the firewall?

winged badger
#

using a service that does NAT punchthrough

#

or publicly exposed dedicated servers

#

one of the other

dawn glen
#

I dont think they use exposed dedicated servers so must be this NAT punchthrough, will have to research that. Threw me offguard when i let a friend join my game and it just worked.

winged badger
#

steam sockets will automatically punch through NAT for example

#

all you need to do for that really is have the host send a packet to clients IP:port

#

so the host's router expects a packed from clients address

#

and doesn't ignore it

#

as they all communicate with steam servers first, steam servers set that communication up

#

simple as that

grizzled stirrup
#

If manually destroying replicated actors on the server right before unloading a sublevel and loading up a new one, is there any reason the client occasionally doesn't have these replicated actors destroyed for them?

#

Does unloading a sublevel cause all replicated actors spawned in that sublevel to be torn off or something?

supple crypt
#

When joining a server (open ip) there is a slight moment when I see the map before my player controller loads a ui widget. How can fix this? It feels like I load the map before I have a player controller.

grizzled stirrup
#

You can manually keep the loading screen up for a bit longer

#

That's what I do at least

supple crypt
#

what would I search to find info on that?

#

Think I got it, will work on it and see if this solves my problem, thanks

fallow quail
#

Hello everyone, we are trying to connect a listen server to an outside client from the internet. We already port forwarded a specific port in order to make the connection, but how do we specify which ip and port the server listens to when starting the game (other than 127.0.0.1:7777)?

pallid canyon
#

Trying to figure out how to get Oculus Moderated Rooms to work with their Find Moderated Sessions node is literal hell. Thank you for coming to my ted talk.

random nymph
#

Is there a way to use different DefaultEngine.ini file when building for client or for server?

shy flicker
#

Hi everyone, I'm working on a dedicated server project, and I want to create a UI on the players when they connect. I've pretty much have the same structure as the MultiplayerShootout but I can't get it working. Any idea what can I be doing wrong? Here is the code:

karmic briar
#

@shy flicker sould be on remote

winged badger
#

@shy flicker use a HUD

#

engine RPCs clients under the hood, providing a HUD class they should instantiate slightly after PostLogin (same frame)

#

and unlike the PC, HUD is a good place to manage widgets from

shy flicker
shy flicker
karmic briar
#

nvm

winged badger
#

PostLogin isn't a good place for generic gameplay logic btw

#

it only works after hard travel

#

it doesn't get called during seamless

karmic briar
#

zlo knows i didnt think bout using HUD

winged badger
#

you do have HandleStartingNewPlayer that is called from both PostLogin and HandleSeamlessTravelPlayer

#

so it works no matter what method of travel you used

#

(HandleSeamlessTravelPlayer is BlueprintNative, meaning it has default c++ implementation - which spawns the default Pawn for Controller, so if you need default Pawn spawning you need to add call to Parent function when overriding it in Blueprints)

random nymph
#

I have linux dedicated server running, but when client joins the server the server crashes with this
[2021.02.11-09.08.51:613][825]LogCore: Error: appError called: Assertion failed: GetType() == FName(u"NULL") [File:../Plugins/Online/OnlineSubsystemNull/Source/Private/OnlineSubsystemNullTypes.h] [Line: 12]

#

In defaultengine.ini I have ```[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemUtils.IpNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=NULL
PollingIntervalInMs=20```

#

Should the DefaultPlatformservice be Null instead of NULL? That was working on windows dedicated server with NULL

random nymph
#

Got it working by commenting out one check from the OnlineSubsystemTypes.h

eternal citrus
#

How can I reference to my ui that i am creating in player controller?

#

Also I want to reference it in my player character

halcyon totem
#

I am having a strange issue maybe someone can help. if I place my characters and spawn them to far away from my other characters, certain replication is not being replicated, how can I make sure things are replicated no matter how far away the other player is?

meager spade
#

mark them always relevant

halcyon totem
#

will this cause lag?

eternal citrus
halcyon totem
#

@eternal citrus what do you mean calling it once, I only see a check mark thats says always relevant

sharp kestrel
#

Anyone know how I can make a camera placed in the world apply to all players? I have one in my lobby positioned exactly how I need it, but it only works for host.
I've attached a Set View Target coming off of OnPostLogin but that only seems to work for the first non-host joining. Any ideas?

#

I'm currently running three standalone instances, will get proper network testing done but so far it doesn't appear to work as intended.

kindred widget
#

@sharp kestrel Rather than relying on Networking for that, why not just have a camera in the level that registers itself locally for each client in GameState. Then each client can get their own version and set view target. No networking involved.

fallow quail
#

Hello, quick question! How do you package a dedicated server with UE 4.26? When I go in visual studio and build "Development Server" I get "Server targets are not currently supported from this engine distrivution"

chrome bay
#

Are you working from a source build of the engine?

fallow quail
#

I saw on youtube videos you have to download it from github, but can't find the build source!

chrome bay
#

Yeah you need to build the engine from source (aka github), change your project to that engine version and then you'll be able to build the server

fallow quail
#

ok thanks!

twin juniper
#

Hi all, when testing multiplayer in editor, my client window has suddenly gone blank, black screen. I can't understand what might have caused this, since I loaded up an earlier version of the project where it was working before, and it's also not working on this either. Are there useful commands to help me debug the point of failure?

#

I also rebuilt, same result :/

fair drift
#

Hi, a quick one but I was wonderin why this BP shows the anims perfectly fine across all clients:

#

but the picture below, with the variables replicated the same doesn't show client to client:

#

They're more or less identical - is there anything different i need to do for a looping animation?

#

( BP 1 unsheaths a weapon once - BP2 is for constant walking.)

unborn nimbus
#

are you using MaxWalkSpeed in your anim bp?

fair drift
#

Not under the anim bp, I don't believe

#

Just a "Can Walk" transition boolean

unborn nimbus
#

are your rep conditions set correctly?

fair drift
#

The Start and Stop walking events are Run On Server

unborn nimbus
#

on the variables, not the event

fair drift
#

and the booleans are "replicated"

unborn nimbus
fair drift
#

That's set to none, I believe

#

Yes

unborn nimbus
#

are the characters still walking or just playing the anim?

fair drift
#

The movement speed and everything checks out okay, just no animation client to client

#

It works client to server though

unborn nimbus
#

you should be driving your anim from the character speed

#

you shouldn't have to create these variables for walking

#

because character movement component is already replicated internally

fair drift
#

So instead of "IsWalking = true - do animation"

#

Try "If player speed == 200 - do animation"

unborn nimbus
#

yes

fair drift
#

I'll give it a shot!

unborn nimbus
#

but more complex than that

#

your locomotion animations should be driven by a 2d blend space

#

so the speed should be an input to the blendspace

#

not just (if speed > 0 animate)

fair drift
#

is that required to get this work or just advised?

unborn nimbus
#

just advised

glad minnow
#

For a multiplayer racing game that I want to work over lan, would you guys recommend cpp or blueprints or both?

unborn nimbus
#

always both

glad minnow
#

Ok cool

regal sand
#

What would be the reason why, I cannot get the error messages to show up? The goal, is to have the client get a UI and Sound message if they are camping

#

I cannot get anything to go to the view port; wondering if something is wrong with this logic

twilit radish
#

I would just debug it until you know exactly at which point it goes wrong, it's a bit difficult for us to guess where your exact problem might be.

twilit radish
#

Also a question from me, does Unreal support anything out of the box for weapons that use raytraces to hit an enemy? To my knowledge weapons in multiplayer games rewind time to see if a 'bullet' hit an enemy to compensate for latency. I couldn't find anything however, I would also be happy with something that allows me to rewind physics to a certain time frame so I can do it my self 🙂

wise zephyr
#

hey guys i am having a problem with replication...The client spawns a projectile and it is in the previous location of the barrel... i have an image of my code before running on server and after...is there away way to compensate for the lag?

dark edge
#

@twilit radish a line Trace is super easy. Validating a hit on the server with past position is a lot trickier

#

For multiplayer shooting, just do client side hit detection and worry about cheat prevention later. if you have to ask the question, it'll be too much to deal with right now.

twilit radish
#

Why would it be "too much to deal with right now"? I'm just asking if Unreal has something built in for this so I don't have to reinvent the wheel.

dark edge
#

No it doesn't have something built in right now.. You have to reinvent the wheel.

#

I'm sure there's some systems on the marketplace that you can looking to. I guess the reason why there isn't any stock lag compensation in the engine is because different games have different approaches to it

twilit radish
#

Fair enough, was just curious as some things are built into the engine. Like the movement component as an example :D

dark edge
#

There is a more generalized Network prediction plug-in being worked on right now, but who knows when it'll be finished

twilit radish
#

Thanks for the answer! 👍

kindred widget
#

@twilit radish Realistically, cheat prevention is nice to program in early if you know what you're doing, but it's not a daunting task to fix later. Truth is, you may never get to the point that it's necessary if the rest of the game is bad. It's better to polish the feel and style of your game rather than a feature that only competitive players are going to care about. You can have the most secure, unhackable/uncheatable game ever created, but no one's going to touch it if it looks bad and feels bad to play. On the other hand, if this is for learning purposes, then that's a different story. Realistically no system is perfect. Anything purely uncheatable is all done on server, and stuff done purely on the server will feel bad for a client. So you have to find a way in your design style to let clients say they've done something, but also allow your server to validate it as much as possible. For instance, it you want some quick and dirty protection, simply record the player's location at like 0.1 second intervals on the server for up to two to five seconds. Let clients say they hit something at a supposed server time. When that RPC reaches server, you can math it out based on the hit player's capsule size, and see if a shot from the shooter's rewound position could possibly hit a part of the capsule within reason. This will at least prevent shooting people through walls and such. It's an over simplified method and still very prone to cheating, but that's the basic idea of the cheat prevention without making it feel bad for the player. Otherwise you end up will things like ARK. Shoot an arrow at a Dodo bird, and the client can see an arrow literally going through a Dodo's skull, and it just trots along happily because the arrow didn't actually hit it on the server. Where as line trace guns never miss because they're done differently than the projectiles.

twilit radish
# kindred widget <@!158195342158987266> Realistically, cheat prevention is nice to program in ear...

I guess that's a fair point as well. I was mostly just looking at what the possibilities are to make it secure, but that all falls apart if no one wants to play it yeah. (Although in my defence I don't think if this would work properly anyone would notice anyway). But no matter what I make it's not going to be the next CS:GO or something similar, and if I ever have to do make that I guess that's a different story at that point. So maybe it's better to not waste my time on that yeah, thanks for pointing that out! 👍

#

As long as it doesn't entirely ruins games of course. My idea isn't against others players, so it shouldn't matter in this case with shooting 😛

kindred widget
#

It's something that major games have third party teams for. It can be a fairly comprehensive topic, but at the same time it can also be very simple depending on what you need.

drowsy vigil
#

Howdy everyone! Finally decided to be social and join the UE discord.

Ok, so I'm having a weird issue with replication, and I'm not sure where to start.

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/1861518-odd-issue-host-to-clients-replication is the relevant forum post about my issue with some pictures.

To be specific, I'm just playing with replication at this point using my own custom character and custom animations. I started working on crouching, and everything works fine in single player, but something seems to be missing.

Host player can obviously run the code no problem (It's a Multicast event for host player only), but for some reason the clients see the transition to crouch happen in full, then the relative location of the mesh on the character pawn snaps back to it's old spot, thus making the clients see the host in the ground. Host is fine. Any ideas would be very welcome as I'm new to multiplayer in Unreal. I played with Mirror and Unity and got a few projects up but I clearly have a lot to learn in general.

twilit radish
#

Oh for sure, I wasn't planning on making some advanced Anti-Cheat with machine learning or anything. But some security couldn't hurt were my thoughts. Which I still have, but I guess I should just prevent the things that really ruin the game like infinite items, crashes etc. If someone was going to use an aimbot I couldn't stop them anyway, even if I would protect my self from false hits.

winged badger
#

@twilit radish as long as you don't release susceptible to the hack where client has authority to calculate shots, then when fire is pressed it locally teleports an enemy in front of the bullet you'll already be better off then most games that got released in the last couple of years

dawn nova
#

Hey guys, I'm using replication graph and I'm having an issue with it crashing when the player is supposed to respawn, our respawn system works so that a new player pawn is created and that the player unpossesses the dead pawn and possesses the new one, this seems to cause it to crash with the error message "No Classinfo found for FirstPersonCharacter_C", we've already added it to Global Actor Replication Info Map

#

I am assuming I somehow have to remove the unpossessed pawn from the replicationgraph and register the possessed one?

celest estuary
#

Anyone got a project they have for third person , where you can poses and drive a car with none of the default sedan involved ?

supple crypt
#

When joining a multiplayer game there is a split second that I see the map from 0,0,0 (and then my player controller load the spawn selection screen), this only happens to clients and not the host. Is there way to stop this from happening? Like keep the screen black until the widget loads?
here is a short video
https://streamable.com/7vqb6z

celest estuary
#

Add a background image of black

#

Make sure it’s at to full sized

#

And Centred

supple crypt
#

I have tried loading a widget in the level bps begin play, but it does not fix the problem

celest estuary
#

Remove the background and just don’t add it till it’s in the last click with a delay

supple crypt
#

the 1st menu is on a different map

celest estuary
#

Keep the jelly fish away

#

If u set it up on a camera just put a black wall behind the view

#

Then u don’t have anything to destarxtnfrok

winged badger
#

put up a loading screen from your GI @supple crypt

#

remove it from HUD's BeginPlay

#

there are several ways to control the camera too

supple crypt
#

Was hoping to avoid using a GI (it's a BP project)

winged badger
#

GameInstance?

#

what does that have to do with it begin BP?

supple crypt
#

Can i do a GI in BP? here I have been thinking I could only use it with a cpp based project

winged badger
#

you can't really manage widgets that have lifespans not completely inside the lifespan of a PlayerController

#

from anything PC or Level related

#

you can just make a blueprint inheriting from GI and set it up in project settings as game GI class

#

thats it

#

with loading screens in particular

#

you open it on menu level, you close it on game level

#

to do that you need to keep a reference to it, and blueprints don't offer too many alternatives to GI to do that

supple crypt
#

I will give that a try, I had found some solutions using a GI but they were all cpp based and were using a movieplayer (So I had assumed GI was something you could only use with cpp)

winged badger
#

depends on how far you want to take this

#

to just show a widget, you don't need anything more then this

#

if you want widget to animate in any way, for that you need movie player

#

as it doesn't run on Game Thread

supple crypt
#

This project was just a way to learn some replication stuff... and now I'm getting hung up on some finishing touches (just a basic black image widget will be fine for this).

winged badger
#

so it won't get blocked while loading the level

#

btw @supple crypt if you're in any way familiar with c++ i do recommend avoiding doign any networking in blueprint

supple crypt
#

Once this project is done I plan on doing the same thing in cpp

#

the networking parts were quite simple so far (I mean all I have is a basic team system and spawn selection)

winged badger
#

it can replicate variables, it has some replication conditions available, it can send RPCs and it has a hack instead of replication callback

#

and i just summed up entire BP networking functionality

#

its also very limited in its ability to fine tune seamless travel

steel vault
#

Does netserialize get called on a struct within a struct? Meaning, if I have a struct with netserialize handled, but it's a UPROPERTY on a parent struct with net serialize, will it still handle its own serialization?

drowsy bobcat
#

can any one tell me if ping from the player instance needs to be times by 4 for the correct value?

dawn nova
#

the player state you mean?

#

it might be times 8, im going to look and confirm

#

yes, you were correct, you need to multiply it by 4

#

the Ping property on the playerstate that is

winged badger
#

wait, they actually didn't put in a getter that already mutates that for you in PS? 🤯 🔫

dawn nova
#

i dont think so, at least not in the version im using (4.23)

winged badger
#

i wish i could say im surprised

meager spade
#

@winged badger they made a getter in 4.25+ but you still need to do the multiply yourself

meager spade
#

yup

winged badger
#

should had made the variable private and a getter that delivers *4.f

#

and avoid all confusion related to this

dawn nova
#

yeah its weird that you even need to do that just to get the ping like everyone reads it

meager spade
dawn nova
#

they might've as well just added * 4 there, not sure what the base one is used for?

meager spade
#

dunno but yeah

drowsy bobcat
#

Thanks guys yeah its some what confusing lol

dawn nova
#

No problem

#

Anyone here familiar with ReplicationGraph by any chance?

winged badger
#

use override of SetPawn to toss the new Pawn into PC's bucket

#

haven't worked with it, just loosly familiar

steel vault
#

I know one of you gurus knows about nested NetSerialize...

dawn nova
#

@winged badger was that a reply to the question i posted earlier?

winged badger
#

yeah, seems like a good place to do it

#

runs on both server and client in AController

#

from Possess and from OnRep_Pawn

dawn nova
#

im just wondering if its actually that, because the error message makes it seem like it

#

says it cant find classinfo for the FirstPersonCharacter (character blueprint), but I have been playing with that before I pressed respawn, so thats why I am thinking its something like the old pawn needs to be removed from the graph and the new one added?

winged badger
#

old one should just go away when destroyed

#

so i don't think you need to remove it by hand

dawn nova
#

Maybe it's something where I need to notify the replicationgraph that a player possesses another pawn? I'm fairly new to it and the documentation on it is quite limited

winged badger
#

i don't know what replication does and doesn't do by default

#

implemented a custom push model before they rolled the replication graph

#

so it wasn't needed

steel vault
#

I'll try rephrasing. If you have a struct that defines NetSerialize, will you need to handle how all of its UPROPERTY's are serialized even though one of them might be a struct that has a custom NetSerialize defined?

dawn nova
#

I think you might have to call the NetSerialize from the struct within and add it to the result of the serialization of the other UPROPERTYs? if that makes sense

winged badger
#

it has to call NetSerialize to serialize it

#

its just not the default implementation anymore

steel vault
#

So the UPROPERTY inside of the parent NetSerialize would just do Variable->NetSerialize()?

winged badger
#

it would if its a UPROPERTY struct

steel vault
#

Gotcha

winged badger
#

would be something like NetSerialize(Property, Ar)

#

but yes

steel vault
#

Ahh no wonder I couldn't find any examples. That makes sense, thank you.

twin juniper
#

anyone find any help with smooth snyc ? like a discord server for the asset or anything like that?

supple crypt
#

@winged badger Had time to try and use the game instance to add a full screen widget but even that goes away on level load

winged badger
#

it shouldn't

#

widget that is on screen is referenced by the viewport

#

which belongs to local player

#

which doesn't have its lifecycle tied to a level

#

so it needs to be explicitly removed

supple crypt
#

and here I am calling it before doing open ipaddress

#

I made the widget just white to make sure it was opening and whatnot and now the same thing happens like in the original clip I posted but now with a white background then the random part of the level at 0,0,0 and then into my normal spawn selection

winged badger
#

give it owning player

supple crypt
#

tried that

#

same outcome

#

and it's only clients that have this problem, host is fine

halcyon totem
#

I am confused, I made a button in a widget and everytime you press the button it adds 600 seconds to the match duration in the game state before I join the server.... but when I start the match it stays at 0

#

in my game state its set to 0, but I thought my button presses were suppose to set the new value?

steel vault
#

If you are doing this before you join a server then I think you need to handle passing it along when you do your server travel, I believe.

halcyon totem
#

yeah its before joining the server

steel vault
#

@winged badger if your struct does not define a NetSerialize, but contains UPROPERTY structs that do, will it automatically use the NetSerialize for each struct or do you have to call NetSerialize on the parent struct and invoke each property? I know you said if I specified it I would need to, but what if I don't?

steel vault
#

Actually. What is the point of you doing this beforehand?

#

You should travel to your server and modify match duration when you're there and then start the game some other way.

#

Or, store this variable on GameInstance if it's just something that your owning client passes along after travel.

#

Basically when you travel it's wiping your game state.

#

Here the person ended up doing what I said. Store in game instance then pass it along when you get there.

halcyon totem
#

ok im going to see if that method works. I wanted to be able to set the time before the match, but it seems that I might h ave been saving the variables in the wrong place, I will try it out and let you know how it goes. thanks @steel vault

regal sand
#

What is a good method for holding and writing player scores in a 2 player non split screen local multiplayer game? Would I just check for player index each time? Or use get owning player?

spice skiff
winter quail
#

Im getting a weird issue where in a Standalone version of my game, actor component variables on a Character are being set to the actorComponents default values, instead of the values set in the Characters actual Blueprint. Playing in Editor, the values get set correctly, but in Standalone its wrong. Im playing only as Server. Anyone had this?

empty axle
#

Is it possible to have replicated properties or RPCs in a WorldSubsystem?

winged badger
#

possible... kinda

#

worth it? absolutely not

#

with the unreal's quirk to change the Outer of replicated UObject to the Actor that replicated it on clients

#

might not even be possible

empty axle
#

okay, thanks for clearing it out

winged badger
#

@empty axle world subsystem can spawn an actor to do its replication for it

#

its way simpler

empty axle
#

yeah that is my current approach. I just though if it might be possible to get rid of that replication outsourcing

winged badger
#

UObject needs an Actor/Channel to do the replication for it

#

it can't replicate on its own

#

plus the Actor doing the replicating would have to implement several functions to get it to replicate

#
    virtual bool IsSupportedForNetworking() const override;
    virtual void GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const override;
    virtual bool CallRemoteFunction(UFunction* Function, void* Parameters, struct FOutParmRec* OutParams, FFrame* Stack) override;
    virtual int32 GetFunctionCallspace(UFunction* Function, FFrame* Stack) override;
    virtual void PreReplication(IRepChangedPropertyTracker& ChangedPropertyTracker);
``` something like that
#

and you'd still have to handle Unreal swapping Outers for replicated Subobjects

#

sorry, above functions would have to be implemebted by subsystem

#

Actor would need to implement ReplicateSubobjects

#

you'd also need to prevent clients WorldSubsystem to initialize locally

#

cost quckly exceeds the benefits

chrome bay
#

What you could do although it's not quite the same thing... is add an actor component to your AWorldSettings class

#

I used to do that for manager-like stuff until UWorldSubsystem came along

#

But yeah otherwise proxy actor would be the safest way I'd say

empty axle
#

Yeah, looks like it is much more work than the benefits from it

modern swift
#

hi guys if my pc spawn a actor and set ownership when it spawn, when that actor replicated and spawn in client, how can I identify the owner is that pc, I tried to get owner but it return None

empty axle
#

PlayerController is only replicated to the client that owns it not to everyone that is probably why you are getting None here

kindred widget
#

Theoretically, the owning client's Owner variable should be a valid player controller, since that object exists there.

modern swift
#

for example I have 2 pc spawn 2 actor, I expect on client 1 actor can get pc, 1 actor return none, as on client only 1 pc is exist, but my case is all actor return none

#

I tried to use delay try to wait the pc spawn on client but I still got none

sharp kestrel
#

By setting ownership you mean pawn possession?

#

Oh wait, there's a "set owner" node, didnt realise.

bitter oriole
#

Doesn't spawning come with an owner parameter ?

sharp kestrel
#

Just checked and yeah. Instigator too.

#

What does ownership actually do though?

chrome bay
#

Gives you (as a client) the ability to call RPC's on it etc.

sharp kestrel
#

Righto.

chrome bay
#

Connected to a bunch of stuff really

sharp kestrel
#

Alright.

On an entirely unrelated note. How can I ensure data read from a user's PC gets shared to everyone?
I'm using functions in the game instance to read/write variables for the local player's appearance.
When they enter a match, their player controller will get that data, so at this point it should all be locally held.
It gets passed to the pawn who stores it as a replicated value, meaning everyone should be able to see it, right?

bitter oriole
#

Player state.

sharp kestrel
#

It can't be done via pawn?

bitter oriole
#

It's not that it can't, it's that player state makes a lot more sense

#

It's not going to be killed or go out of bounds, it'll exist earlier at boot, and it can persist data between levels

sharp kestrel
#

Right. Current outcome is that the local player see's their own outfit, but everyone else has default settings applied. Happens to all clients.

bitter oriole
#

Also always relevant etc

#

The proper way here is to RPC the server-side controller and write the player state

sharp kestrel
#

Okay, I'll give that a try.

#

That said; I don't think persistence between levels is too critical here. Its already stored on local PC and in the Instance on game start, and I don't believe a single Get Instance to get the data would be that taxing on processor, right?

bitter oriole
#

I mean, it's up to you. If the appearance is only character related, feel free to do the same but store in pawn instead

#

Shared player data in general makes more sense in player state

#

Since, you know, pawns die and stuff

sharp kestrel
#

True, true.

#

Though when the pawn dies, the appearance becomes irrelevant since there isn't respawning (at least not yet).

bitter oriole
#

Yeah, if it's truly pawn specific the pawn is fine

sharp kestrel
#

In that case, do you know why non-client pawns seemingly use the default data?

bitter oriole
#

Did you write the replicated data on the server ?

sharp kestrel
#

ah

#

If its just a regular event (no server/multi) setting a replicated variable, that data still won't replicate?

bitter oriole
#

The event would need to fire on the server

#

Replication is entirely server-to-clients, so client-to-server data needs to go through RPCs (server event in BP)

#

Basically your player controller needs a "server send data" server event to send the data at boot and then the server side PC writes the pawn style

sharp kestrel
#

Right, I'll give that a try. Will need to make a build before I can test it though.

#

Cheers.

kindred widget
#

I think it really just depends on the outfit selection. If it's a one time thing that persists through death, etc, probably best to put it on State and all clients can just get that character's state on beginplay and set it up when the actor is relevant If you lose the appearance via something like dropping your inventory, probably better on the Pawn since you don't want it to persist death.

sharp kestrel
#

Would it be enough to just set the event call to "run on server" or does this need to call something in game mode?

bitter oriole
#

Set it to run on server and call it from an owning client with a replicated version of the actor

kindred widget
#

Out of curiosity, does anyone know what the basic replication cost of an actor component is in bytes?

#

I'm trying to simplify my inventory system. Right now my current working model is to have many different struct types for very different items. Putting most of this in the same struct would be an unnecessary amount of extra replication. But I'm wondering if putting this information into components and copying them from actor to actor for use and movement is going to be worth that simplification.

echo geode
kindred widget
#

Yeah. Thanks. Already working on that. But it was worth the question to see if anyone knew before going through a lengthy test.

winged badger
#

you can do custom serialization for them

#

your structs

echo geode
kindred widget
#

@winged badger How do you mean? I thought that only worked to stop certain things from replicating on all versions of the struct? For instance, if I have an item that has seven different things that need to replicate, and an item that only has three, I can't use the same struct I thought?

#

As in there wouldn't be a way to tell the seven property struct just to not replicate these four properties for this exact struct, but do for this one.

winged badger
#

what is your item, struct, uobject?

kindred widget
#

At the moment it's just a struct. I was considering moving over to actor components and using two different arrays. An array of simple structs for the simpler objects, and then an array of pointers to a parent class of the more complex items that were all likely going to end up being placed on actors anyhow when used.

winged badger
#

will you need logic inside your items?

kindred widget
#

Some. The more complex stuff I was considering components for were eventually going to be weapons/armor. The original plan was to use actors for the weapons and handle the armor in the pawn classes, and spawn the weapon like actors from the item ID in the struct, but I quickly started realizing I need quite a few more variables saved for my upgrade system. Quickly started feeling stupid to have all of that stuff on one struct when representing basic materials in the inventory that only needed three variables.

winged badger
#

as long as items are UObjects of any kind

#

you can replicate the lot in a generic way

#

fastarray with item that has a UObject* or TWeakObjectPtr to the replicated UObject

#

and a TArray<uint8>

#

your UObject base for items would have 2 functions - to encode and update itself in the fastarray

#

and to interpret the byte array as its own data

#

so your fastarrayitem callback would look something like

#
if (Item.IsValid())
{
  Item->PostReplication(ItemData); // ItemData being the byte array
}
#

you can have other members in fastarrayitem that are common to every item and always need to be replicated, ofc

kindred widget
#

I'm honestly starting to wonder if this effort is worth it right now. I know that each struct would initially replicate the full amount for an item, but after that it would only replicate the specific property changes. I might honestly just go with a simple TArray of a struct for now and reuse all I can in that struct for the items and make some getter functions that sort the data for me. I can always refactor later if necessary, but I don't think inventories are going to get too large to the point that this would be a serious issue.

clear sand
#

Hey lads, how do I make my game mode to spawn player at desired location(depending on transform coords that im getting from server) I know we have FindPlayerStart(). But I cant wrap my head around how to do it. I was thinking of creating spawn point inside function and returning it. Or is there "better" way of doing that?

dawn nova
#

If you want to programmatically create spawn points then you can use SpawnActor<APlayerStart>(FTransform(x, y, z)) to spawn a APlayerStart at a given location and then use FindPlayerStart() to get a reference to the ones you've created, or you can just save the result of the spawned APlayerStart in a property and use that

clear sand
#

Thanks, thats what I was about to do. Is it worth to remove it sometimes later, because I might get flooded by spawn points at some point

floral crow
#

I'm replicating arrays of structs in more than one place so it might come quite handy to master

winged badger
#

NetSerialziation.h header

#

its half docs and examples

floral crow
#

nice!

crude copper
#

hi guys! Tell me please what is the correct pipeline for launching abilities in turn? What I mean, First Ability -> Execute and apply gameplay effect, I want to run second ability after first finished, but this gameplay effect block second ability. I remove this effect in first on end. In standalone it works fine, but in network not.

#

p.s. If I just use only gameplay tags(without gameplay effect) in ability properties all works correctly

drowsy bobcat
#

I'm trying to start a dedicated server without a steam client I keep getting this error Failed to initialize Steam, this could be due to a Steam server and client running on the same machine any one have any ideas?

potent cradle
#

Is there a clean way to create a unique netid while developing and testing with PIE? That is to say, when you spawn 2 clients, they (probably logically) have the same uniquenetid

chrome bay
#

They have different ones in editor

#

It just creates a random string each time

potent cradle
#

Huh 🤔

#

Maybe I'm doing something wrong then

#

Lemme recheck my code

chrome bay
#

They're not like "proper" ones ofc, just internal to the editor

winged badger
#

@tulip ferry server keeps all actors at all times

#

if the actor is static it will persist on client even if not relevant

#

dynamic actors that are not relevant get destroyed on clients and are respawned if they become relevant again

potent cradle
winged badger
#

foliage - instanced static meshes

#

just do a procedural spawn, replicate a seed to clients so they do the exact same thing

#

then its one actor for all foliage

twin juniper
#

Hi guys, I'm testing multiplayer, and really kind of stuck here since it spontaneously stopped working last night ... That is, it stopped working for ALL projects ... If I start a new project and open a multiplayer session, I get a black screen, the only message that really stands out from the log is: LogNet: ReplicationDriverClass is null! Not using ReplicationDriver.

#

If anyone has any knowledge to share on this, I'd much appreciate it since the documentation is returning nothing, and this is super discouraging ... :/

winged badger
#

that becomes significantly more complicated if you're BP only

#

then a fastarrayserializer with item for each foliage + status

#

check NetSerialization.h for documentation on it

twin juniper
waxen socket
#

Hello. Quick question today: If a variable is set on the client, and then an RPC call is made to set the variable to the same value on the server, will the OnRep callback function be run on the client? Do OnReps fire when the value is replicated or only when the value is changed?

chrome bay
#

Yeah only when you receive a different value

#

Unless you specify REPNOTIFY_Always

#

In which can the OnRep will get called whenever you receive that var from the server

waxen socket
chrome bay
#

Someone else would answer 😄

waxen socket
#

😅 Maybe.

kindred widget
waxen socket
#

It's a niche subject.

kindred widget
#

Between You, Zlo, and Kaos, you guys have cleared a lot of air with UE4 networking. Not sure it would make half this much sense otherwise.

waxen socket
#

Stranger too.

kindred widget
#

This is fair. He's done a lot for my C++ learning more than multiplayer.

#

Unreal Slackers nomination awards anyone?

waxen socket
#

Jambax would probably rather us just buy and play his game. 😄

potent cradle
#

something something check out Hell Let Loose something something

winged badger
#

@tulip ferry the real bonus is that its capable of client side callback per item

#

which makes keeping large sets of object in sync real easy

#

with fast array you'd generate the foliate

#

stash it into the fastarray and let clients mirror that

#

as a simpler of 2 options

#

if your actor with ISMC has a fastarray, basically any foliage instance is uniquely identified just by its instance index

#

now you can let server and clients generate the same ISMs with same seed

#

then replicate just the changes

#

or you can have server generate, add the item with Index, MeshAsset, State to fast array for each instance

#

then clients would add the instances from replication callbacks

#

personally i still prefer the seed option for initial generation

#

with seed option, syncing late joiners will be more complicated though

#

as when the foliage actor replicates, the item callbacks would happen before replication callback for the generation seed

#

so you'd need to handle that as a special case

#

(don't execute callbacks if foliage wasn't generated, then after it is generated manually iterate fastarray.items and apply changes)

kindred widget
#

I do the reverse with fast arrays and foliage. I record where foliage has been removed. You could seed it initially with a simpler variable, and then only record the changes to that.

#

Probably less to replicate in the end.

winged badger
#

if the clients and server separately generate the foliage from a seed and use instanced static mesh component for them

#

they will have exact same meshes, in exact same location at exact same instance index in ISMC

#

so if server updated something like 17, Harvested the client knows that ISMC instance 17 has been harvested

#

but yes, the client would have to RPC interaction with foliage to the server

dawn nova
#

Anyone know where I can find the ShooterGame with ReplicationGraph example from Epic? The content example I download doesn't have ReplicationGraph

chrome bay
#

Where did you get it from

#

It's in all versions from 4.21 onwards IIRC

#

Certainly in 4.26 as I DL'd it yesterday

dawn nova
#

I have 4.23 and I cant even see the replicationgraph in there

#

in the solution

#

I'm downloading 4.26 now to see if that one has it

fallow quail
#

Hi! I'm trying to start a dedicated server, and switched unreal version to source build 4.26, but when running the Server.exe, i get these kinds of errors, any idea how to solve this?

dawn nova
#

Are you trying to load a whitesquare texture in that Canvas class?

#

If so seems like there needs to be an if check to see if the texture object has been found

#

Or you need to correct the resource path

#

You might also be getting this because its related to UI and the server doesn't have anything visual

fallow quail
#

Hmm, what i did was just take an empty ThirdPerson project, package the client, switched version to source build and then build development server

#

So the server does not have a UI, i guess

dawn nova
#

Seems to be saying "Package contains EditorData only which is not supported by this build", I think it's related to that as well

fallow quail
#

Maybe it’s because i didn’t include the starter content in the project?

chrome bay
regal storm
#

I've tried this with Has Authority but that doesn't seem to change anything

#

Just trying to generate a random number every X seconds per player that everyone can see

#

The clients are generating twice it seems

dawn nova
#

Possibly because one client is the server and the client at the same time, should not happen with a standalone server I believe

regal storm
#

So it seems all clients do this with my current setup (just switched to "Play as Client" and it happens also

#

Hmm, it seems like the timer by event thats triggering the event is maybe firing twice?

dawn nova
#

Or the RepNotify is firing twice

regal storm
#

So maybe this is a known thing, but if I connect the event to a timer by event node, it no longer lets me modify the settings above

#

Okay, so I figured it out

#

The "Set Timer By Event" has to be run on the server

steel vault
#

Anyone else know about the order of NetSerialize in structs? I need to know if a struct without NetSerialize defined allows UPROPERTY structs inside of it to run their custom NetSerialize without needing to invoke it and call each one manually?

winged badger
#

how do you imagine it works?

steel vault
#

I am hoping it just lets them do their own net serialize

winged badger
#

it iterates over UPROPERTY fields and serializes each one in turn

#

when that property is a struct only way to serialize it is to use its net serialize

#

it can't work any other way really

steel vault
#

Gotcha. So the only case where it wouldn't use that net serialize is if you made one for the encompassing struct and forgot to call serialize on it

#

Allowing you to skip serialization

winged badger
#

but if you have a custom net serialize

#

you're overriding that

#

which means that you have to call the serialize for each property you need

steel vault
#

Noted. Thanks for the explanation.

wise zephyr
#

can someone please tell me how i can see the cull distance of a blueprint in the editor?

wise zephyr
#

i have a sphere same size as my cull distance

#

for some reason

dawn nova
#

Net Cull Distance Squared is what you want

wise zephyr
#

when i enter the cull distance its not working

dawn nova
#

you have to take the square root of that to get the actual net cull distance

wise zephyr
dawn nova
#

its Squared, so what you enter will make it so the square root of net cull distance squared is the actual distance

wise zephyr
#

i just linked my code to set the sphere collision same size as cull distance

#

and when i am right on top of the object its not showing to client

dawn nova
#

is there no simple SetCullDistance method on actor?

#

I thought so, I may be wrong

wise zephyr
#

when i make the net cull distance a huge size it works but if i put it at a reasonable size it doesnt work

dawn nova
#

1000 means the actual net cull distance will be 31 units, is that what you want?

wise zephyr
#

i want it small the cull distance is the same size as that collision sphere in the blueprint picture..and for some reason its not working :/

dawn nova
#

that Cull Distance object in your blueprint picture, is that the name of the Sphere which you are trying to use the size of?

wise zephyr
#

yeah that represents the cull distance

#

in the construction script i set it to the same size as the cull distance

#

and when i am right on top of the object its not showing up

#

this works

#

but why does it have to be so high

dawn nova
#

to me it looks like the cull distance in that blueprint is actually a scene component and you are adjusting its scale according to the square root of net cull distance squared times 2

#

yeah it needs to be quite high for it to work, the default net cull distance is quite a high number, let me look up real quick what i have it set to just to give you an idea

wise zephyr
#

thanks so much man!

dawn nova
#

float CullDistanceSquared = 225000000.f;

wise zephyr
dawn nova
#

this is quite normal

wise zephyr
#

right but

#

the sphere collision is not properly scaled i guess

dawn nova
#

I think you might not be using the right function for that

#

Scale multiplies the size by the scale that you pass, thats what you want or not?

wise zephyr
#

i just want the sphere collision to represent the size of the cull distance

dawn nova
#

I think you want set sphere radius possibly>

wise zephyr
#

ah shit i sent the wrong vid

#

ugh

#

ah thanks

#

ill do that

#

that was it man!~!!!

#

thank you!!!!!!!!!!!!!!

dawn nova
#

ah, im glad that fixed it!

#

no problem

shadow arch
#

quick question, when you play a game and are acting as the host. Does that make you the "listen server"? or is the listen server just a server running in the background and you're still playing as a client

dawn nova
#

if you are the server and the client at the same time you are using a listen server, if you are using a standalone server then it's not

shadow arch
#

hmm ok i see

raw egret
swift kelp
#

when I change its new size in the editor, the clients still think it is 90, any idea why or do I just need to make sure I always update it in C++?

twilit radish
#

Doesn't it update while playing or?

rapid bronze
#

Hey guys, I have a little problem and was wondering if anyone would know what causes this behavior:

I currently have set up the Steam integration and in my PlayerController i initialize SteamID and SteamUsername

In the GameMode: OnPostLogin i get the Controller Reference and Cast to my custom PlayerController where i get SteamID and SteamUsername

Problem happens when I have a Dedicated Server out of the Engine, for some reason SteamID returns 0 and SteamUsername returns Null in the GameMode
I know the values initialize right tho cause in my Main Menu widget they show up just fine.

thin stratus
#

SteamUsername being the DisplayName?

#

@rapid bronze

winged badger
#

PostLogin = server exec, it can only pull data from steam client on the machine running the dedi, unless you sent it as a login optional string

thin stratus
#

Yeah, and both SteamID as well as Name should be available through the PlayerState it if needed

rapid bronze
#

Yeah cause i was accessing it directly from the PC in the GameMode, is that a problem?

#

But yeh, DisplayName

#

Basically what i was doing is

#

Event OnPostLogin
Returns New Player (Controller)
Cast To MyPlayerController
Get ID and DisplayName initialized in MyPC
Use them in GameMode

thin stratus
#

Well, SteamID and DisplayName are already available on the PlayerState

#

UE4 grabs the Steam DisplayName and put it into the PlayerName variable.

#

And SteamID is available through C++ via the UniqueNetId iirc

rapid bronze
#

Good to know, but in this case, is me calling the variables from MyPC in the GameMode the problem and not through PlayerState or wot?
Using SteamCore btw so have the possibility to get the ID and DisplayName through BPs

halcyon totem
#

im having some weird issues, if I join as the client to my game, I cant see the host player, but the host player can see me in a packed game, what could cause something like this

toxic quarry
#

I'm trynna get some networking up

#

yet I can't find replication settings in events

#

ok got it figured out

stoic acorn
#

I’ve seen so many tutorials now where they do a lot of gameplay BP work on the character. I was under the impression that this wasn’t best practice, is this correct?

thin stratus
#

That question is too vague :P What is "Gameplay BP Work"?

stoic acorn
#

i.e. calling variable stat values from the character to HUD. Wouldn’t it be better to do that on the player controller as the character pawn can be destroyed

kindred widget
#

Still too vague. What's the use case?

halcyon totem
#

this is weird, I am using streaming levels in multiplayer I have 1 persistant map and 3 other sub maps, if the server player is in map 3, and a client in map 1 going to map 2 wont stream in for the client unless the server player moves to map 2. But this only happens with a client VR player if I use a clietnt FPS player it works fine

#

is this method frowned upon?

twilit radish
stoic acorn
#

I have 3 players (one of which is the Listen Server) I've created an Information Widget screen for each player from the PlayerController but have everything hidden. On an event during the game I want each player's Information Widget to update (ESlate Visibility = Visible) I'm controlling this from the GameMode. For some reason the 'Get All Widgets of Class' is returning only 1 widget. Is this correct? I was expecting 3 to return

#

So when this is triggered only the server is updating and the widget elements become visible, but not for the clients

sweet marsh
#

Hi guys, can someone explain to me why a multicast function does not run sub functions e.g. allowfloating multicast function runs allowinteraction multicast function but that function #doesn't trigger

chrome furnace
#

Hi, is it possible to make a prediction system for replicated variables using blueprints?
E.g. there is a replicated actor with a RepNotify integer variable, which can be changed by everyone.
I was hoping for client to change the local version of the integer variable and then send the change to the server (using RPC) to replicate for everyone, but this approach can desync clients.
E.g. for the integer variable set to 0 initially for everyone, if ClientA changes the value to 1 and the ClientB at the same time changes the value back to 0, the server will end up with 0 and does not correct the value for the ClientA, because he thinks the value of the ClientA is still 0.
Please, is there a way to sync the variables?

kindred widget
#

@sweet marsh Wait. What? If I read that right, you're running a multicast function from a multicast function?

sweet marsh
#

Yeah, well it calls a function that inside does a check on authority and will either run it via server then multicast or multicast direct if the authority

kindred widget
#

You should check out the RPC doc page. In short, the only RPCs that work from clients are ServerRPCs. Clients cannot RPC to other clients. So if you were to run a multicast from a client, it would only run on the client. If you run a multicast from the server, it will run on all clients, and then if those clients tried to multicast, it would only run on that one client.

sweet marsh
#

Ahh no i understand that, sorry here's a code example

#
{
    // Launch the item
    if (Launched)
    {
        FTransform ModifiedTrans = FTransform(GetActorRotation(), GetActorLocation(), GetActorScale3D());
        UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), Launched, ModifiedTrans, true);
    }

    // Play the collected SFX
    if (LaunchedSFX)
    {
        UGameplayStatics::PlaySoundAtLocation(GetWorld(), LaunchedSFX, GetActorLocation(), 1.0f, 1.0f, 0.0f, nullptr, nullptr);
    }
        AllowFloatingStateUpdates();
}```
#

That code is the code for launching which in turn triggers

#
{
    if (GetLocalRole() < ROLE_Authority)
    {
        ServerAllowFloatingStateUpdates();
    }
    else
    {
        MulticastAllowFloatingStateUpdates();
    }

    //GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green, FString::Printf(TEXT(__FUNCTION__)));
}
void AIGCCarryableBase::ServerAllowFloatingStateUpdates_Implementation()
{
    AllowFloatingStateUpdates();
    GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Red, FString::Printf(TEXT(__FUNCTION__)));
}
void AIGCCarryableBase::MulticastAllowFloatingStateUpdates_Implementation()
{
    // Start ticking and checking for vicinity overlaps and whether the item can float 
    SetActorTickEnabled(true);

    // The item is now carryable again
    SetIsCarryable(true);

    // TODO only allow interaction after a delay to stop grabbing straight away
    // Re enable the interaction collision to allow vicinity checks again
    AllowInteraction(true);

    // No one is carrying anymore
    CarryingCharacter = nullptr;

    // Make note of the time we were dropped or launched
    NotCarryingTime = GetGameTimeSinceCreation();

    GEngine->AddOnScreenDebugMessage(-1, 3.0f, FColor::Green, FString::Printf(TEXT(__FUNCTION__)));
    
}```
#

in here i noticed that the MulticastAllowFloatingStateUpdates_Implementation is getting called but the values only update for the server

kindred widget
#

@sweet marsh Hmm. That's odd that a multicast only runs on the server. You're certain that this object is replicated? And if it's a component, that it's part of a replicated actor? To be fair, something like this looks very statebased and I'd recommend something more like a replicated value for it. Is it possible to do this in something like a Repnotify using the CarryingCharacter value?

sweet marsh
#

i had the system using rep notifies and it worked better but still similar issues, but i still think there is some odd disconnect that causes it to drop out

#

let me try and put that back in then post the results

lucid vault
#

I'm trying to store the winners of a round in the game instance, but I can't have a TArray of FUniqueNetIds because FUniqueNetId doesn't derive from a U class

#

How would you generally do that? (I'm storing in game instance as I want the winners to persist through levels)

#

I guess I could ToString it and store that

#

Actually, the game instance can't replicate apparently. I guess I need to have the game instance send the array to the game state every time the game state changes (such as switching levels) somehow

kindred widget
#

Should be fairly easy to do. Could just update the server's GameInstance right before changing levels, and pull the information in GameState's Beginplay.

dawn nova
#

Hey guys I fixed the issue with ReplicationGraph I was having, seems the issue was that I was giving items to the new player pawn when it respawned too early, I moved the code from BeginPlay to PossessedBy and that stopped it from crashing with "No ClassInfo found for ..."

halcyon totem
#

what would cause a player not to be able to steam in a level in a packed game? my VR player cant make the level stream but a FPS player can make the level stream

stoic acorn
#

Should a separate User Widget be created for each player?

meager spade
#

for what?

#

Widgets are local only

#

never replicated

stoic acorn
#

Sure. I thought that but I can't work out why the client widgets aren't updating on my player win screen.

meager spade
#

you can't use RPC's in a Widget

#

nor should the server loop through widgets

#

you should send a client rpc to the player controller

#

player controller gets that widget (on local player) and update the widget.

stoic acorn
#

Right.. did not know that. I'll give that a go.

#

Thanks for the pointer UKaos

meager spade
#

np

toxic quarry
#

I can't get crouching to replicate

#

the other code isn't very important rn, only worried about the crouching

#

this is passed into the character class itself from the player controller

#

the crouching itself doesnt work

#

the print strings work and even tell me which client is receiving this input

#

meaning it does work

#

if I use "set capsule half height" it simply leads to it not being replicated

#

despite the fact capsule component replicates

#

fixed it

#

forgot to set Can Crouch

#

I thought that was only for AI that possesses characters

rigid zinc
#

I'm trying a simple SetActorLocation to attempt replication on a Listen Server setup (locally for now), and I have terrible stuttering on the Client one

#

I've also tried to set the ShouldSprint locally after the RPC but same result

#

Anyone knows what could cause that stuttering?

rigid zinc
#

It seems that unchecking the Replicate Movement of the Character, and doing the movement through RPC -> Multicast solves the issue, but I then have to manually replicate all movements (even AddMovementInput), could it be that Replicate Movement is clashing with SetActorLocation?

balmy nexus
#

I have a very quick question about dedicated servers. I'm on build 4.26 do you still need the github source version to do a dedicated server build or is that a legacy thing?

hollow eagle
#

you do still need engine source

pallid mesa
#

so...your variable "ShouldSprint" is only contextualised in the server @rigid zinc therefore that SetActorLocation is happening in the server only, so you'll have an incongruence happening

#

why is the engine source required, can someone enlighten me?, I don't remember

#

is it because of this?

balmy nexus
hollow eagle
#

you can still run a server, just can't have a server-only build

#

as for why they haven't distributed server binaries...

#

¯_(ツ)_/¯

pallid mesa
#

ah okay

#

haha

balmy nexus
#

I'm guessing there is nothing I really have to do to move over the the github source compiled version though at a latter time, or should I do it now before I get further into my project?

pallid mesa
#

it's not much hustle

balmy nexus
#

I had a feeling but thought I would double check just encase

pallid mesa
#

in addition upgrading the engine is trivial if you set your engine in the release branch

rigid zinc
pallid mesa
#

either way that's not how you implement sprint

#

take a look at MaxWalkSpeed

rigid zinc
#

It's not a sprint I'm trying to implement, sorry for the confusion I've badly named the variable here

#

I was just doing some test and used the sprint key input that I had set for something else in the project settings

#

I'm trying to make one dash quickly upon pressing Left / Right bumpers

#

but there's a giant stuttering when I do that, so the picture I've sent is an isolated dubbed down version with the same issue

pallid mesa
#

yeah that's because of how CMC works

#

in theory as long as both server and cli report the same location you shouldn't have much rollback stutter

#

for dashes and these kind of things it's better to apply velocity directly

rigid zinc
#

It's due to the server sending a location with a delay?

pallid mesa
#

well not quite... cmc execution flow is quite complicated

#

you are setting a location for your character in the server however the autonomous proxy isn't there so it has to get there

#

but there is a fight back because there is no client input

#

more or less

rigid zinc
#

Are you talking about the ShouldSprint boolean?

#

Because I've tried setting in both the RPC and locally, same effect

pallid mesa
#

no, I'm talking about setting a location in the server

rigid zinc
#

Here's what I have now, it doesn't just send it in the server

#

I also call it locally as well

#

there's an ugly jitter effect on the client, but not for the listen-server player

pallid mesa
#

so...

#

client location -> server location -> rollback location

#

the jitter will be explicit

#

because the server is going to correct back the position of the character whenever it reaches to the point

rigid zinc
#

why does it happen here but not when I move with AddMovementInput

#

Regular movement doesn't get corrected

pallid mesa
#

because addmovementinput is going through the cmc execution pipeline

rigid zinc
#

And when I uncheck "Replicate Movement" on my character, there's no jitter

pallid mesa
#

ofcourse because if you don't replicate movement

#

this correction won't happen

rigid zinc
#

but wouldn't that lead to a disconnect in position?

pallid mesa
#

yes

#

there is a lot to understand here

#

like a lot

rigid zinc
#

hmm in that case I should probably leave Replicate Movement checked to avoid having weird position issues to debug later

pallid mesa
#

yes, and implement your dash adding velocity

#

it will be less hustle for you 😄

rigid zinc
#

So for a dash, I should do change the Speed of the character temporarly and use AddMovementInput?

#

Instead of manually doing so with a SetActorLocation

pallid mesa
#

yeah, or add velocity in a direction

rigid zinc
#

I do not seem to have that function / node by default, do I need a specific component?

pallid mesa
#

cmc -> velocity

dawn nova
#

Hey guys, my game is crashing because a Ghost NPC falls and gets damaged (triggering an RPC Flinch()) before the players connection is properly initialized, I am using ReplicationGraph and this is resulting in the error No ClassInfo found for Ghost_C. Is there a way I can check the player is able to receive this before calling the Flinch() method if AI were to get falldamage before being properly initialized? I am overriding the method ACharacter::Landed for this

pallid mesa
#

I don't know if I understood correctly your question

rigid zinc
#

Thanks for the help! I'll try the AddMovementInput / SetVelocity approach 🙂

pallid mesa
#

but you need to have a way to avoid your AI character to call a function in an early initialisation stage, am I right?

pallid mesa
dawn nova
#

I'm not sure how, that's what I'm trying to figure out

#

Yes

pallid mesa
#

Do you have any way to know if your AI is initialised?

dawn nova
#

This was not a problem before ReplicationGraph, I had a similar error which I fixed by changing the method in which something was done from BeginPlay to PossessedBy for example

#

but this one is a bit different scenario so im not sure

pallid mesa
#

If you want a quick fix

#

just aggregate a boolean in the Finch function

#

but this seems very specific, maybe you can debug a bit to understand what is happening

#

but if you need to deliver this asap

#

a boolean should do

dawn nova
#

I'm not really in a rush but it's blocking me from progressing

#

I've tried checking explicitly if the pawn is properly possessed by its AIController

#

That was not it

pallid mesa
#

it's very specific tho... hard to help you without more data

dawn nova
#

The AI is supposed to be spatializated on the 2D grid

pallid mesa
#

but it dies beforehand

nimble sinew
#

real quick question

pallid mesa
#

go ahead nbond

nimble sinew
#

From unreal wiki on dedicated servers: "Dedicated servers are more expensive and difficult to configure, requiring a separate computer from all of the players that would participate in a game, complete with its own network connection. "

dawn nova
#

well it falls a short distance and triggers the Flinch method where it crashes

nimble sinew
#

is this technically correct? cant you run a dedicated server and connect to it on the same machine?

pallid mesa
#

and why does it say it crashes? @dawn nova do you have a stack trace?

hollow eagle
#

not technical limitations

pallid mesa
#

^

hollow eagle
#

there's no reason to run both a dedicated server and a client on the same machine except for testing

#

so yes, you can

#

but you wouldn't in a shipping game

pallid mesa
#

and you can run N dc servers in the same machine

nimble sinew
#

okay thanks. and in general, im assuming code for listen server and code for dedicated server are going to be pretty much identical, except listen would have graphics support?

cosmic trail
#

yeah @dawn nova knowing why it crashes will make it easier to check, if there's a null value or something, just check against whatever is crashing it

dawn nova
#

The stack trace shows it going through TakeDamage because of the overridden Landed method from ACharacter, and TakeDamage ends up triggering the Flinch RPC, and that's whjere it crashes, the error is "No ClassInfo found for Ghost_C" but the error message doesn't really pertain to the problem in this case I believe

hollow eagle
#

you don't need a source build just to run a server-only instance... you just can't tear out client code

nimble sinew
#

i.e. if i want to give players an option between dedicated or listen its not really too hard to switch between

cosmic trail
#

are these all blueprint?

dawn nova
#

But it crashes before it even gets to execute the Flinch implementation

#

Like it crashes inbetween because of a replicationgraph error I believe

pallid mesa
#

and where does the rep graph error out?

dawn nova
#

When it calls the Flinch RPC, right before trying to execute the implementation

hollow eagle
#

so that's correct

pallid mesa
#

but yeah the way you have to connect to them

#

equal

cosmic trail
#

@nimble sinew dedicated you might not want to do any visual logic to optimize it

nimble sinew
#

i mean less about the connection

#

but like, am i going to need to be writing seperate logic for a listen server vs dedicated

#

or can dedicated basically just be the exact same as a listen server just minus the visual logic

pallid mesa
hollow eagle
#

you may just to disable certain things on the dedicated server that are purely visual

cosmic trail
#

some cases yes: if(NetMode() == NM_Dedicated)..

dawn nova
#

I'll show you guys a picture of the stack trace and where it errors out, its something related to the AI falling too early and it erroring out

hollow eagle
#

but generally things are mostly the same between dedicated/listen

#

as long as you don't assume you have a local player

cosmic trail
#

not necessarily fully separate logic, just different things to enable/disable sometimes

dawn nova
#

I mean I could solve it by putting the AI decently on the ground but still this shouldn't happen

nimble sinew
#

alright cool. thanks for letting me interrupt guys. i will likely be here a lot more in the coming days/weeks lol.

dawn nova
#

Hold on I'm just going to run it and let it crash to show you

cosmic trail
#

From a dedicated server cost perspective, what is cheaper: a 10 player multiplayer game or 5 player multiplayer? Is it cheaper the more people you can host on one game process since they use more shared resources(compute/memory) at the same time? On the flip side, network load exponentially increases with more players, how much would that factor in to cost if any?

hollow eagle
#

it depends on the game

cosmic trail
#

hmm, RTS in my case

hollow eagle
#

I don't mean the type of game

#

i mean it entirely depends on the specifics of everything in the game

#

there is no general answer

pallid mesa
#

number of replicated variables/number of rpc's... server logic... etc

cosmic trail
#

so it comes down to the actual compute/optimization of that game towards the different configurations

#

because it can go either way..

pallid mesa
#

complying with the base requirements of the game, yes

#

for example, if you have a gun that shoots very rapidly in a shooter

#

you'll be generating some traffic that is required due to the nature of your game

#

so it's about game specifications + optimisation

dawn nova
#

So you can see it goes through Landed, to TakeDamage, to its super, in its super it calls Flinch, and in the generated file it crashes

#

so I assume its just the problem of it being called too early before initialization

cosmic trail
#

@dawn nova Might wanna get symbols for engine to help see more

pallid mesa
#

ye

#

I was about to suggest that

dawn nova
#

What information is missing?

pallid mesa
#

all I see is hex haha

dawn nova
#

you can see the method names

#

on the right

#

and the line numbers

pallid mesa
cosmic trail
#

the engine callstack, it would tell u which actual functions are being called, which line of source, etc, what you're actually crashing on

pallid mesa
#

yep

cosmic trail
#

Because the process event is what calls replication graph eventually, so it's out of the Flinch() function at that point

dawn nova
#

the other stuff is in engine, its a problem with it just falling too early in game initialization, i just need to know if there's a check I can do to prevent it from being called this early

pallid mesa
#

of course it is in engine

#

but to figure out what is happening you better grab the symbols

#

I should have said "why" instead of "what" in that last sentence

dawn nova
#

I know what is crashing it, the AI calling Flinch too early - but I will grab the symbols but I'm not sure if that will help me

pallid mesa
#

yeah but you don't know why, that's the thing

#

the symbols will tell you what is crashing explicitly

#

trust me

cosmic trail
#

@dawn nova when you break in there, on the "this", look at the values, is it already possessed? What type of controller possess it(AI? Player controller?) Look at any variables in the "this" object to see if you can use any of those to indicate whether or not it is not initialized

pallid mesa
#

the engine symbols will help you A LOT

#

grab them anyways

cosmic trail
#

compare the "this" object values to when it is already initialized. And if that doesn't work, set a new variable when your player does possess it, and check that variable

dawn nova
#

I already checked if it is possessed by adding a condition that didnt work unfortunately

#

That fixed the last time I had this issue though

#

By moving from the methods that were called from Beginplay to OnPossessed

cosmic trail
#

possessed is not good enough if it's possessed by an AI controller and not the player yet maybe?

#

because it can automatically be possessed by an AI controller first, before the player possesses it

#

so you might get that triggered twice

dawn nova
#

Oh yeah but the one making it crash in question is actually an AI

cosmic trail
#

you want to wait for the player to possess it right?

dawn nova
#

No the player doesnt have to possess it, the problem is that the AI falls somewhere in the map making the Flinch RPC fire too early before it was ready or something, I'm getting the symbols right now though to tell you guys the exact engine lines

cosmic trail
#

I'm saying OnPossess will trigger ON the AI possessing it, which is not what you want to check for, you want to check that it is the Player possessing it. So you have to do an extra check to see maybe what Kind of controller it is.

#

Ok, yeah I'm not sure how your possession and controllers work

pallid mesa
#

anyways, before I go to sleep, I'll repeat again, get the symbols

dawn nova
#

Well the particular pawn that is making it crash is supposed to be controlled by an AIController, so non player controlled at all

#

I am getting the symbols

pallid mesa
#

hooray!

#

you'll see how with the symbols the exploration will be much easier

dawn nova
#

I didn't think it would help since I thought its a matter of putting a certain condition around Flinch or even moving where it is executed, its checking for the ClassInfo before its present which is why I get that error

#

Any idea how I can add the debug symbols when I already have it installed?

nimble sinew
#

binary build>? right

#

@dawn nova

dawn nova
#

I'm not sure what you mean by that

nimble sinew
#

did you build unreal from source

#

or did you just download and install it

dawn nova
#

The one I'm testing it on is non source, but I also have a source one installed

nimble sinew
#

well

#

if you open epic games launcher

#

go to library