#multiplayer

1 messages ยท Page 63 of 1

thin stratus
#

So if you want to be sure that you need it you gotta remove it and test

#

There is even a console variable to force combining off :P

grand kestrel
#

Will give it a try

real ridge
#

guys quick question do I know mix array somehow? I have custom spawning but this for loop is checking playerstarts one by one in same direction every time so it will pick always first red and first blue, not if I will always mix it

#

how I can mix it ?

#

i dont want to delete them / my game has also respawn

#

then they will not be able to respawn

#

ooo shuffle

#

okay ths

#

thx

rose pollen
#

I have a replicated pawn I have attached a child actor component to, then i set the child actor class of that component to a replicated actor. When the server dynamically spawns the pawn using "Spawn Actor" everything works fine, but when I just have dragged the pawn onto the level about 50% of the time the child actor isn't visible to the players (but logging shows it is there from the servers perspective)

#

is there something about the loading order of the level where if the pawn loads before the players that the replicated child component isn't visible or something? any idea how to fix this, is very annoying for trying to test some behavior in PIE

grand kestrel
#

@thin stratusDo you know if there's a way to disable CMC's root motion prediction easily? They didn't make a bool or something? ๐Ÿคฃ Trying to implement my own for a specific system and I think it's conflicting

#

Might try removing it from the move response container

twilit radish
#

Poor Cedric is going to get nightmares again over the CMC at this point lol.

grand kestrel
#

I'm revoking my question, looking at it, its too.. integrated, I'm probably tackling what I'm doing the wrong way ๐Ÿ˜„

twilit radish
#

Also I tried to profile Iris just now, but honestly I have absolutely no clue what it's supposed to change. I don't see any real differences in my profiler (if anything Iris has some weird spikes(?)). But I can't tell if my profiling technique is just wrong, if I'm just stupid and perhaps didn't properly disable it again or something or just have a bad testing case ๐Ÿคทโ€โ™€๏ธ
Basically set up a scenario with a listen server and client and a thousand replicated actors with 2 properties being changed in tick.

grand kestrel
#

Should just let it try and predict it instead of doing it myself, and just predict the stuff it doesn't do like motion warping vectors and the actual montage thats playing (which can, albeit rarely, get out of sync)

quartz panther
#

soo, i finally made a sucessfull connection to dedicated server through eos using two different machines... the lack of port forwarding was an issue and i didn't need a static ip address in the end... hopefully that would work with other machines with different internet connections.

grand kestrel
#

EOS should definitely be taking care of the IP routing so yeah wont need static IP

quartz panther
#

now my question is how could i join a session as a group of players (something like in tarkov) lets say i invite 4 more players in the group, the group leader is the one who decide when we join the server. is that something that is difficult to implement with eos or is it supported already?

#

@grand kestrel is this still a EOS related question? i assume this is universal to how unreal handles connections?

grand kestrel
#

Isn't this just lobbies?

quartz panther
#

sorry, just started with the whole multiplayer thing, still not 100% on point with the terminology.

quartz panther
pallid mesa
#

I think this was an interesting experience

twilit radish
#

๐Ÿ‘€

#

Casual half a second debug break though ๐Ÿ˜‚

pallid mesa
#

yeah hahaha

#

lyra has too many ensures

#

and ofc when you duplo the dynamic level collection all the gameplay features yell at you

#

so you need to be like suuuuper careful because some GFs react to the AddToWorld delegate

#

the way to differ from the replay world is that noone got a controller

#

a bit iffy but got it working nicely

twilit radish
#

๐Ÿค”

winged badger
#

debug camera controller has no pawn

pallid mesa
#

haha

#

this is the other way around

#

these pawns are treated like sim proxies

#

so no controller anywhere XD

#

I just set my viewtarget to the instigator pawn and interpolate rot and loc

#

rot is getbaseaimrotation

#

which is replicated and makes it onto the replay world (duplicated level)

#

so i had to override the camera component and the camera modes

grand kestrel
#

Hmm why can't CMC handle a montage played from HandleImpact predictively, it just desyncs each time whether I do it via a local predicted GA or through Montage_Play

    Super::HandleImpact(Hit, TimeSlice, MoveDelta);
    
    UAnimMontage* Anim = TraversalAnimations.Last().Montage;
    const UAnimInstance* AnimInstance = CharacterOwner->GetMesh()->GetAnimInstance();

    if (!AnimInstance->IsAnyMontagePlaying())
    {
        bIsTraversing = true;

        if (UAbilitySystemComponent* ASC = UAbilitySystemGlobals::Get().GetAbilitySystemComponentFromActor(GetOwner()))
        {
            const FGameplayTag Tag = FGameplayTag::RequestGameplayTag("Ability.Traversal");
            ASC->TryActivateAbilitiesByTag(Tag.GetSingleTagContainer());
        }
        
        // AnimInstance->Montage_Play(Anim);
    }
#

It handles it fine if it stems from an input

#

I must be missing something obvious

pallid mesa
#

didn't succeed there either, if you find out lmk o>

grand kestrel
#

I could make it caches the result then a "pretend" input applies it, but thats an awful hack

#

Is it.. like.. double prediction, where the HandleImpact is already predicted but then its predicting the root motion on top of it

#

@pallid mesa HandleImpact only sets bQueued to true, this doesn't desync

    if (bQueued)
    {
        SetMovementMode(MOVE_Flying);
        bIsTraversing = true;
    
        if (UAbilitySystemComponent* ASC = UAbilitySystemGlobals::Get().GetAbilitySystemComponentFromActor(GetOwner()))
        {
            const FGameplayTag Tag = FGameplayTag::RequestGameplayTag("Ability.Traversal");
            ASC->TryActivateAbilitiesByTag(Tag.GetSingleTagContainer());
        }
    }
    Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
#

Oh, well, I'm wrong, sometimes it does

#

Its a start

#

@pallid mesa Got it, just move SetMovementMode into the ability. Doesn't desync now

#

So the main thing is to remove it from the predicted loop into TickComponent

#

Finally, a way forward ๐Ÿ˜„

#

You could probably get away with SetTimerForNextTick within HandleImpact but I haven't tried yet

modest crater
#

Hey Guys I'm stuck an I'm not sure where a better place to do this is. I'm creating a widget that is acting as my "main HUD" because its just like the master widget with all other health, score etc related widgets within, It works fine when create an add it to the viewport in BeginPlay of the controller class where I just guard it with a IsLocalController, my issue is when it comes to respawning, I'm trying to have my game mode handle creating a new pawn an calling unpossess an possess on the new one and then after I call posses in the game mode Im calling a client function on my player controller that is responsible hooking up the new pawns OnHealthChanged an other delegates, my issue is when I call it for clients (not listen server) the new APawn* newbodyI pass through is null for clients but not for the listen server. I assume it has to do with not replicating in time before i pass the pointer but im not sure. Here is the code an the Client_NotifyClientOfRespawn


void AMinion_GM_Base::RespawnPlayer(APlayerController* pc)
{
    if (IsValid(pc))
    {
        APawn* oldPawn = pc->GetPawn();
        pc->UnPossess();
        FTimerHandle respawnOnTimer_Timer;
        TDelegate<void()> respawnLogicDelegate;
        
        respawnLogicDelegate.BindLambda([this, pc, oldPawn]() 
        {
            const FVector spawnLoc = FindStartLocation();
            const FTransform spwnTrans = { FQuat::Identity, spawnLoc };
            FActorSpawnParameters spawnParams;
            spawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AdjustIfPossibleButAlwaysSpawn;


            APawn* newbody = GetWorld()->SpawnActor<APawn>(minionPlayerSubC, spwnTrans);
            if (newbody)
            {
                pc->Possess(newbody);
                oldPawn->Destroy();
                
                if (AMinion_PlayerController* castPC = Cast<AMinion_PlayerController>(pc))
                {
                    castPC->Client_NotifyClientOfRespawn(newbody);
                }
            }
        });
        GetWorld()->GetTimerManager().SetTimer(respawnOnTimer_Timer, respawnLogicDelegate, 5.0f, false);
    }
}
modest crater
#

Inside of the client function if comment out the code and print its current GetPawn() it should in theory be the new pawn I just possessed (which it is on the server) but not for the client, the server is clearly aware of the new pawn an possession before the client is, clearly I need to move where this is being done but im not sure where to move it to

winged badger
#

the RPC will arrive before the NewBody Actor replicates

#

so the argument it carries cannot be resolved on clients

modest crater
#

I'm unsure of where this is "suppose" to be done

winged badger
#

there is AController::SetPawn function, virtual and runs both from server after possess and on clients after OnRep_Pawn

#

you should use it to wire your logic there

modest crater
#

thanks, ill try that

winged badger
#

this will work for local client only btw

#

as the others don't have the player controller involved in this respawn

modest crater
#

So it wont work for a listen server? sorry im just new

winged badger
#

it works fine for the server

#

as it has all the player controllers

#

and for local client, as it has the PC for which you're doing the respawning

#

on other clients though, that SetPawn won't run as there is no instance of the PlayerController for which the pawn is being set present

modest crater
#

Oh okay, I understand I think

winged badger
#

but as your client RPC is failing, and it runs only on local player involved

#

SetPawn should do just fine

#

that function is also a good place to bind various delegates... etc. that need to be bound on both server and client

modest crater
winged badger
#

its plausible

#

unposessing and possessing both call it on both server and cleint

modest crater
#

where do all the cool kids put their UI updating logic for new pawns? im struggling, lowkey about to set a .5 second timer to update after possession an call it a day hahaahh

winged badger
#

you can just call a function/event on the HUD from there (on local client)

#

or broadcast a delegate HUD listens to, same difference

#

if your HUD has a c++ base, PC has OnPawnReceived delegate (if i recall the name right) that would also work, but its not dynamic

modest crater
# winged badger if your HUD has a c++ base, PC has OnPawnReceived delegate (if i recall the name...

Yeah it was the right place I was looking for, I just did a few checks with a cached pointer to ensure it didnt make multi huds. Thanks heaps for the help I really appreciate it

void AMinion_PlayerController::SetPawn(APawn* InPawn)
{
    Super::SetPawn(InPawn);
    
    if (IsLocalController() && InPawn && InPawn != currentPossessedPawn)
    {
        currentPossessedPawn = InPawn;
        Client_NotifyClientOfRespawn(currentPossessedPawn.Get());
    }
}
real ridge
#

thanks i did same way like this but for some reason its not working need to find problem i dont see any bar

#

it looks like on the start of game its loaded but immediately get deleted

#

ah found problem my pawn is not valid weird

fierce grove
#

I have a PC that has temporary ownership of a server Pawn... setting ownership to the PC works... what when I want to remove ownership what would be the right way?

chrome bay
#

SetOwner(nullptr)

#

Careful though as posession/unpossession also messes with the owner

fierce grove
swift olive
#

My player pawn is stuttering on the client, i profiled with Unreal insights and im only sending a couple bytes so it shouldn't be latency. Anyone got a clue what it could be?

twilit radish
#

An actual pawn or a character?

swift olive
#

Character

kindred widget
twilit radish
# swift olive Character

Did you modify specific parts? Unless you perhaps turned emulation settings on by accident or modified things it definitely shouldn't stutter. Also how are you adding the input to the character?

twilit radish
#

You guys don't make a big web of code going to random actors to just get input somewhere? /s ๐Ÿ˜‚

kindred widget
#

It drives me nuts when people put controls in their controller, just to store a reference to something and call custom inputs. ๐Ÿ˜ฌ

twilit radish
#

I'm going to be honest with you, when I started with Unreal at some point I did something like this in the absolute worst possible way. I had a pawn that received input and I needed it on a different actor. So what I did was I created a method for every single input I needed on that pawn and then inside the body of that I called the appropriate function on that actor ๐Ÿ˜… ๐Ÿ˜†

Unreal has definitely been a journey so far lol.

#

Also as a disclaimer, no this was years ago I definitely don't do this any more.

upbeat crystal
#

I have a question Multiplayer Join Session I have a vehicle and character blueprint setup it works fine in 2 windows without joining session but when you create and join the session it does not update the collision

kindred widget
#

Yeah. I had a few small arguments over that with people who somehow think that enable input is bad. Like.. You're doing the same thing! Just in a worse way!

kindred widget
copper grove
#

Vori ๐Ÿ‘‹๐Ÿป is there anything additional to implementing animation budget allocator, I've got it turned on I can see in the console log, I have skeletal mesh component budgeted as my character meshes, set to auto register, but it never actually kicks on... [i have it set to 0.1) just to see it kick on and even with an army of characters it never does

blissful atlas
#

how to lobby in unreal engine

#

is there a video

meager fable
# blissful atlas how to lobby in unreal engine

You can start with unreals tutorial series, they are pretty decent although there are mistakes there https://www.youtube.com/watch?v=abmzWUWxy1U&list=PLZlv_N0_O1gYqSlbGQVKsRg6fpxWndZqZ

In this video we take a look at the finished project and step through each of the features that will be covered in this series. We show our functional Main Menu and its options, a lobby where players can chat with one another and select their characters for the game, some server options such as changing the map or match time as well as the abili...

โ–ถ Play video
blissful atlas
#

thanks

meager fable
#

I'm trying to add a teleport type movement to my character that is already moving with character movement component, I'm currently using this and it works like 90% of the time but sometimes just failes. With mem breakpoints it looks like my teleport function passes but then character movement component error correction teleports me back to the starting loc

twilit radish
#

The CMC already handles* the teleporting / position replication, you don't want to multicast the teleport but instead just let the server deal with it. Although not entirely sure why you end up back at the first position unless you're using client authoritative movement.

#

Also the * is because I believe it doesn't handle predicting teleportation by default on the client, so it will very likely end up in getting corrected for the client. But I may be wrong on that one, someone else may know ๐Ÿ™‚

meager fable
#

Client authorative movement is disabled for my cmc and running the event server only results in no tp :/

clever hound
#

1>   Creating library C:\Unreal Projects\ProjectVR\Intermediate\Build\Win64\UnrealEditor\Development\ProjectVR\UnrealEditor-ProjectVR.suppressed.lib and object C:\Unreal Projects\ProjectVR\Intermediate\Build\Win64\UnrealEditor\Development\ProjectVR\UnrealEditor-ProjectVR.suppressed.exp

1>PlayerPawn.gen.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl APlayerPawn::Client_MoveRight_Implementation(void)" (?Client_MoveRight_Implementation@APlayerPawn@@UEAAXXZ)

1>PlayerPawn.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl APlayerPawn::Client_MoveRight_Implementation(void)" (?Client_MoveRight_Implementation@APlayerPawn@@UEAAXXZ)

Wtf are these scary looking errors

twilit radish
meager fable
#

yup

twilit radish
clever hound
# twilit radish What exactly are you trying to do?
UPROPERTY()
        FVector NewLocation;
//Movement 
void APlayerPawn::Server_MoveForward_Implementation(float AxisValue)
{
    //MovementDirection.X = FMath::Clamp(AxisValue, -1.0f, 1.0f);

    if (Controller != nullptr && AxisValue != 0.f)
    {
        const FRotator Rotation(0.f, HeadCamera->GetComponentRotation().Yaw, 0.f);

        NewLocation = GetActorLocation() + FRotationMatrix(Rotation).GetUnitAxis(EAxis::X) * AxisValue * MovementSpeed;
        SetActorLocation(NewLocation);

        UE_LOG(LogTemp, Warning, TEXT("%f"), AxisValue);

        Client_MoveForward();
    }
}

void APlayerPawn::Client_MoveForward()
{
    SetActorLocation(NewLocation);
}
twilit radish
twilit radish
clever hound
#

Should it not be

twilit radish
#

You're missing the _Implementation part in the declaration then.

clever hound
twilit radish
#

๐Ÿ™‚

twilit radish
# meager fable

Just gave it a try with this simple setup. Works just fine for me, maybe try quickly creating a new character and see if that one does work I guess?

#

Also it does not actually say it fails to teleport in your logs right? Just making sure ๐Ÿ˜›

meager fable
#

nope, tp suceeds :p

#

okay, this works on a new character

#

but not on my old one

twilit radish
#

Try comparing the two and see what's different I guess, I'm not entirely sure at this point my self what exactly might mess it up. Worst case you could try rebuilding your character with the new one and see if it still works or breaks at some point.

twilit radish
#

Well.. Yes, that pretty much answers it lol.

verbal tendon
#

Just make client fully authorative, ignore checks on server

#

whatever problem you were experiencing, is fixed now! ๐ŸŽ‰

twilit radish
#

I mean depending on your game it might be better IMO as you don't have to deal with first of all complicated net code, then also packet loss becomes like essentially no issue and interactions in general may feel a lot better (bumping into others for example). But there are definitely some downsides to it and it's absolutely not right for all projects either.

clear island
#

@clever hound using replication there does not guarantee it reaches the client before that client rpc is called

#

you can send it in the client rpc itself instead

clever hound
clear island
#

no, in the server rpc, the place where you are setting NewLocation and calling the client rpc, you send that as a function parameter : Client_MoveForward(NewLocation)

cold moat
#

stupid questions time: if i spawn actor only on the server, but set it to replicate, does it get "spawned-via-replication" on simulated proxies too? (assuming it is NetRelevant)

twilit radish
#

It gets replicated to all that are relevant yes. If anything that's the only way to do it as a client doesn't have the authority to spawn a replicated actor (will just spawn it locally for them).

cold moat
clever hound
# clear island no, in the server rpc, the place where you are setting NewLocation and calling t...
UFUNCTION(Client, Reliable)
        void Client_MoveForward(FVector NewLocation);```
```cpp
//Movement 
void APlayerPawn::Server_MoveForward_Implementation(float AxisValue)
{
    //MovementDirection.X = FMath::Clamp(AxisValue, -1.0f, 1.0f);

    if (Controller != nullptr && AxisValue != 0.f)
    {
        const FRotator Rotation(0.f, HeadCamera->GetComponentRotation().Yaw, 0.f);

        NewLocation = GetActorLocation() + FRotationMatrix(Rotation).GetUnitAxis(EAxis::X) * AxisValue * MovementSpeed;
        SetActorLocation(NewLocation);

        UE_LOG(LogTemp, Warning, TEXT("%f"), AxisValue);

        Client_MoveForward(NewLocation);

        UE_LOG(LogTemp, Warning, TEXT("%s"), *NewLocation.ToString());
        
    }
}

void APlayerPawn::Client_MoveForward_Implementation(FVector NewLocation)
{
    UE_LOG(LogTemp, Warning, TEXT("%s"), *NewLocation.ToString());

    SetActorLocation(NewLocation);
}

I might be just stupid because I still dont get it

clear island
#

is the value not the same?

#

should be

#

or close atleast

#

also you're missing FVector there

#

you put it in the declaration on the header file (.h), but not the implementation (.cpp)

clever hound
#

1>C:\Unreal Projects\ProjectVR\Source\ProjectVR\PlayerPawn.h(83): error : Function parameter: 'NewLocation' cannot be defined in 'Client_MoveForward' as it is already defined in scope 'APlayerPawn' (shadowing is not allowed)

twilit radish
clear island
clear island
#

in that .cpp function

clever hound
#

void APlayerPawn::Client_MoveForward_Implementation(FVector NewLocation) this?

clear island
#

yep

clever hound
#

its there

twilit radish
#

You already have a member variable with that name. You can't do that.

#

Give the RPC variable name a different name ๐Ÿ˜›

clear island
#

oh yea thats right

#

you have a "global" variable called NewLocation and also a local one with the same name

cold moat
#

yeah i do try to google all the time, usually though some things turns out i confuse/commingle two things and google is completely lost too

clever hound
# clear island you have a "global" variable called NewLocation and also a local one with the sa...
UPROPERTY()
        FVector NewClientLocation;```
```cpp
//Movement 
//Movement 
void APlayerPawn::Server_MoveForward_Implementation(float AxisValue)
{
    //MovementDirection.X = FMath::Clamp(AxisValue, -1.0f, 1.0f);

    if (Controller != nullptr && AxisValue != 0.f)
    {
        const FRotator Rotation(0.f, HeadCamera->GetComponentRotation().Yaw, 0.f);

        const FVector NewLocation = GetActorLocation() + FRotationMatrix(Rotation).GetUnitAxis(EAxis::X) * AxisValue * MovementSpeed;
        SetActorLocation(NewLocation);

        UE_LOG(LogTemp, Warning, TEXT("%f"), AxisValue);

        FVector NewClientLocation = NewLocation;

        Client_MoveForward(NewClientLocation);

        UE_LOG(LogTemp, Warning, TEXT("%s"), *NewLocation.ToString());
        
    }
}

void APlayerPawn::Client_MoveForward_Implementation(FVector NewClientLocation)
{
    UE_LOG(LogTemp, Warning, TEXT("%s"), *NewLocation.ToString());

    SetActorLocation(NewClientLocation);
}

๐Ÿค” ๐Ÿค” ๐Ÿค” ๐Ÿค” ๐Ÿค” ๐Ÿค” ๐Ÿค” Idk maaan this is so weird that it still does not want to work
I made the NewLocation "const FVector"

clear island
#

you're using NewLocation in your UE_LOG

twilit radish
#

@clever hound Don't let your NewClientLocation

UPROPERTY()
FVector NewClientLocation;
```and
```cpp
void APlayerPawn::Client_MoveForward_Implementation(FVector NewClientLocation)
```have the same name.
clear island
#

I think you want to print the parameter instead

cold moat
#

How could i "sync" up autonomous proxy spawned grenade actor to a server one? (obviously keeping the server one authoritative) Or is this a path to jank and tears and/or tons of interpolation and I should just rely on server spawning one and hope for the best (it would look kinda goofy because we have tons of players that play from US on EU servers and vice versa)

twilit radish
#

That too.

clear island
#

but also yes, you'll have the same problem with that code, 2 variables with the same name

clever hound
clear island
#

replicating does not guarantee it will arrive before that client rpc is called

#

the client rpc could be called but the new value may not have been replicated yet

#

if you want to use replicated variables you'd remove the client rpc and use rep notifies instead

clever hound
# twilit radish <@802596752447766569> Don't let your `NewClientLocation` ```cpp UPROPERTY() FVec...
//Movement 
void APlayerPawn::Server_MoveForward_Implementation(float AxisValue)
{
    //MovementDirection.X = FMath::Clamp(AxisValue, -1.0f, 1.0f);

    if (Controller != nullptr && AxisValue != 0.f)
    {
        const FRotator Rotation(0.f, HeadCamera->GetComponentRotation().Yaw, 0.f);

        Location1 = GetActorLocation() + FRotationMatrix(Rotation).GetUnitAxis(EAxis::X) * AxisValue * MovementSpeed;
        SetActorLocation(Location1);

       
        UE_LOG(LogTemp, Warning, TEXT("%f"), AxisValue);

        FVector Location2 = Location1;

        Client_MoveForward(Location2);


        UE_LOG(LogTemp, Warning, TEXT("%s"), *Location1.ToString());
        
    }
}

void APlayerPawn::Client_MoveForward_Implementation(FVector Location2)
{
    UE_LOG(LogTemp, Warning, TEXT("%s"), *Location2.ToString());

    SetActorLocation(Location2);
}
    UPROPERTY()
        FVector Location1;

    UFUNCTION(Client, Reliable)
        void Client_MoveForward(FVector Location2);```
But how does the Location 1 value turn into location 2 then
twilit radish
# cold moat How could i "sync" up autonomous proxy spawned grenade actor to a server one? (o...

It's a bit of a pain honestly because of latency. The problem is if you don't predict the autonomous grenade then it's going to lag potentially behind quite a lot because the server needs to spawn the actor and then also replicate it (which may not necessarily happen directly) + of course whatever latency applies to that. The general concept I believe I've seen used is to spawn a local version for the person who threw it and then just have the server spawn a replicated actor but not replicate it to them (except perhaps the explosion?) and then have the server just explode it whenever you want to keep authority. But tbh most games have a horrible grenade throw system regardless because of this, there's always going to be the problem that a different client gets less time to react to the explosion than whoever threw it because of latency.

#

I believe there's also a video about a GDC talk from Bungie (creators of Halo) where they discuss some of this stuff somewhere in the channel pins.

cold moat
#

im mostly worried about issues of "my grenade bounced off the tree to the left on the client but it went right on the server"

thin stratus
#

You actually sync them up tbh

clever hound
twilit radish
thin stratus
#

Iirc you throw the local one and tell the Server when. With the Latency in mind, the Server would spawn the Grenade where the Client's version currently is and test everything in between with a traces.
Once the Server version replicates to the Client, you hook them up and remove the predicted one

clear island
thin stratus
#

Something something, Unreal Tournament

twilit radish
#

But mine was not meant as a "this is THE way to go" ๐Ÿ˜›

cold moat
cold moat
#

i think a bit of an issue might come from the game being ported off HL2 and their weird netcode

clear island
#

@clever hound it seems you're misunderstanding some of the basics:

  • Client RPCs are called from the server but executed on the client
  • Server RPCs are usually called from the client but executed on the server
#

you can also call server rpc's on the server

#

but they will only be called on the server

clever hound
#

I know that

clear island
#

in your code, on the server, you are calling a ClientRPC with a FVector as parameter, so you're sending that FVector value from server to client

cold moat
#

We really want to improve overall performance, because the game is at least 64 player multiplayer, with tons of projectiles flying about, so i cant do crazy logic either

#

projectiles as in grenades and shells, not bullets

clever hound
#

So it would be other way around. Would it have the same problem

clear island
#

I dont understand what you're trying to do, but usually when it comes to movement you do it on the client first then send a server rpc to do it on the server

twilit radish
#

Rather difficult for us to say what fits within your performance budget and what doesn't. Which depends on the implementation of things either way I suppose.

prisma snow
thin stratus
#

I think it's probably best to just not predict those. At least not unless you really need to cause it visibly spawns too late. I would go from the pov of making it best for the local client who throws it

#

But this can get complex pretty quickly

#

UE I lacking a really good base implementation of predictively spawning actors and rewinding a set of actors

prisma snow
#

The only system that I know with very good general purpose prediction would be deterministic lockstep rollbacks

twilit radish
#

Lockstep is absolutely not suitable for a whole lot of games though ๐Ÿ˜…

prisma snow
cold moat
#

Hl2 uses rollbacks right

prisma snow
earnest comet
#

Hello everyone, smol question if I may!

#

I recently starting to learn multiplayer.

#

I was wondering if blueprint interface events can't be used in multiplayer?

#

There are no replication options for them from what I understand, I just want to confirm. Thanks!

cold moat
#

and i dont really have much experience...so thats suboptimal xD

lucid viper
#

Hello!

Might be a noob question but im trying to understand the Anim graph and replication. My Walking and Running blendspace animation is replicated but not my Sprinting.

I created a anim instance cpp, created a bool for Sprinting so I am guessing that I need to manually replicate this across all clients somehow. But why not just use the wame Walk/Run blendspace for Sprinting? I currently have the walk/Run blended with an aiming upper body animation. I prefer the full body sprint like Fornite.

So my understanding to replicate my value across all clients I need to setup a few things in my header:

UPROPERTY(Replicated, BlueprintReadOnly, Category = Movement, meta = (AllowPrivateAccess = "true"))
bool IsSprinting;

void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

Then in my cpp:

#include "Net/UnrealNetwork.h"
void UCustomAnimInstance::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(UCustomAnimInstance, IsSprinting);
}

Is that it or do I need to create a server_implementation and multicast functions as well?

winged badger
#

Anim instances dont normally replicate

#

And they also shouldnt

#

Put you bIsSprinting in the character and replicate it there, then pull it into anim instance UpdateAnimation

lucid viper
#

Ah interesting, so if I set something like IsSprinting = Character->IsSprinting; in my UpdateAnimation. As long as my character variable is properly replicated, then it should sync up correctly with my anim instance?

#

Also to make sure im doing the replication correctly. I would then setup my character header like so:

UPROPERTY(Replicated))
bool IsSprinting;

void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

Then in my cpp:

#include "Net/UnrealNetwork.h"
void UCustomAnimInstance::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(UCustomAnimInstance, IsSprinting);
}

Would this be all I need or do I also need to include a On_REP, Server_Impl and or Multicast function?

#

I get al these 3 confused

winged badger
#

Yes for replicating sprinting through charactet

#

No, mostly, for everything else you just asked

lucid viper
#

kk thx for the info, really appreciated ๐Ÿ™‚

winged badger
#

For RPCs

#

2 functions need to be implemented, and subobject calling RPCs doesnt need to be replicated at all, only its actor doed

#

GetLocalFunctionCallspace and i think CallRemoteFunction

#

For server/client RPCs additionally actor owner needs to be owned by the player controller

#

For OnReps you need to use ReplicatedUsing and object itself, as well as its actor owner need to be replucated, and you need to declsre and define OnRep function

hardy monolith
#

Hello! I'm looking for a way to read custom arguments when a client joins the server. I already do it for the host, but it's unclear how to do it for the client. I'm attaching an example of how I set arguments ๐Ÿ™‚

twilit radish
#

Pretty sure it's not possible from blueprints to retrieve those values for a client, they are stored inside a class that doesn't expose the variable (the net connection) to blueprints and the moments it gets passed on in the beginning in for example the game mode it does not seem to get passed on to blueprints either.

So you'll either need to use C++ for this or you'll need to use a different solution. You could for example RPC the data up to the server in the player controller, but definitely not ideal yeah :/

quasi tide
#

Isn't there a parse options node?

twilit radish
#

But how do you want to parse it when you can't access it from BPs?

#

Unless I'm just stupid I guess xD

quasi tide
#

Pretty sure you can. You do it in OnPostLogin or something like that. I can't recall exactly.

twilit radish
#

That's where the fun part begins, gamemode indeed has those parameters but does not pass them onto the BP events and the actual method is not a ufunction you can implement.

quasi tide
#

I just found it annoying, so I just RPC that stuff to the server, lol

#

I don't care. Co-op for the win.

#

Alleviates A LOT of stuff some people have to worry about, lol

twilit radish
#

It's pretty simple in C++ to access but it's really poorly exposed to BPs. As in just not.

quasi tide
#

Most things actually end up being pretty simple in C++ honestly. Considering most of the engine is opened up for you, lol.

twilit radish
#

But you need the FString for it. Which you can't get.

#

Also to be honest the only reason I know how to access it is because there was someone we spend half an hour searching with to find a way to grab that stupid connection string from C++ x)

hardy monolith
#

Okay, let's then refrase question

#

When my player joins server, the get join menu and I would like them to be able to customize some parameters, like color of their pawn.
I already made UI to select the value, and now I need to pass it from Client to Server when joined

twilit radish
#

I would just use the same way Durox just described, basically you temporarily save that data in somewhere like the game instance as that persists throughout world changes and then when you've joined the server you can send a RPC to the server with the data you want to send.

hardy monolith
#

Yeah, true, but I wanted to prototype everything in Blueprint before moving to C++

#

Big downside of C++ that many times it makes engine crash, which consumes a lot of time

twilit radish
#

What I just described is completely possible in BPs ๐Ÿ™‚

hardy monolith
#

I was just reading back your discussion, sorry ๐Ÿ˜

hardy monolith
#

If I ever get back to refactoring this, haha

#

Is there a way to create custom persistent actor?

twilit radish
#

I mean.. The engine is sometimes just not leaving you with a whole lot of choices when it comes to blueprints and multiplayer ๐Ÿ˜…
With C++ too at times I suppose, but that can be more easily solved with a source build.

hardy monolith
#

I'm always thinking about ways to create more general tools to solve such problems

twilit radish
#

Actors aren't really meant to persist like this. There are "subsystems" however that have various life times, although I have absolutely no clue if they in specific exist in BPs.

#

But anything that persists data beyond a world change should work I suppose. As long as you can access it when you need the data again to send to the server.

honest rain
#

Hello hello Slackers !
I am trying to understand how OnRepNotify works, but I can't get past the compiling when I am trying to implement the function in my .h file ๐Ÿ˜ฆ
I am doing this :

        TObjectPtr<UMaterialInterface> Material;

    UFUNCTION()
        void OnRep_MaterialUpdated();

yet this won't compile and it would say that external symbol is non resolved. I checked the naming and it seems fine :/ any idea ?

twilit radish
#

Show your compiler output ๐Ÿ™‚
Also I don't think there's much point in replicating a pointer to a material interface in the first place. But I could perhaps be wrong in that.

honest rain
#

I am trying to set a material on an actor server side, and I want to replicate this to the client whenever the material would be updated ๐Ÿ™‚
I just succeeded compiling by adding

{
    DOREPLIFETIME(AActor, Owner);
}

although I am not totally understanding why, and its not clearly said in the documentation why we need this

twilit radish
#

You should call the super on that btw, otherwise the actor it self isn't going to replicate properly.

#

The reason that method exists is so you can specify exactly how you want to replicate certain properties, there's more dynamic stuff to that if you need it as well but it basically just maps out what properties to use and how.

honest rain
#

I see, thanks ๐Ÿ™‚

#

Can't run unreal now that I added this xD It will throw a assertion failed error at initialization hum/
Here is my chunk.cpp file :

{
    UE_LOG(LogTemp, Log, TEXT("MATERIAL CHANGED"));
}

void AChunk::GetLifetimeReplicatedProps(TArray< FLifetimeProperty >& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(AActor, Owner);
}

.h file :

        TObjectPtr<UMaterialInterface> Material;

    UFUNCTION()

        void OnRep_MaterialUpdated();
twilit radish
#

I totally did not look at what you were actually replicating in the DOREPLIFETIME, but you don't want to set the Owner in there. It's already being taken care of by the actual engine so need to do that your self. You would instead use whatever variable you made your self.

#

So for example:

 DOREPLIFETIME(AChunk, Material);
honest rain
#

oooh I understand, that makes sense

twilit radish
#

But I'm still not sure if Material will work honestly. Normally the way you do this stuff is by having a 'look up table' as I have seen it been named before. There's no reason to try and replicate entire objects most of the time like materials and a lot of objects don't even support this in the first place. The better way to do this is to replicate for example an ID or a name or whatever fits in that use case and then use that to find the material.

honest rain
#

The thing is I am setting the Material from a manager that spawns the Actor. It does set the material, but server side only, I figured it would be only simpler to just replicate that material set to the client while setting it on the server

twilit radish
#

Well in this case you're only printing a message when the OnRep gets triggered. So it's indeed not going to do much else than printing that message ๐Ÿ˜›

honest rain
#

that's... true lol

lucid viper
#

Hey guys,

Struggling to replicate my Sprinting bool. I want to use this bool for my animation instance to then control my sprinting animation across all clients. This is what I got so far in my Custom Character source file:

void ACustomCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(ACustomCharacter, IsSprinting);
    //DOREPLIFETIME(ACustomCharacter, bIsInAir);
}

void ACustomCharacter::OnRep_Sprinting()
{
    if (IsLocallyControlled())
    {
        IsSprinting = CustomMovementComponent->Safe_bWantsToSprint;
    }
}

void ACustomCharacter::SetSprinting(bool bNewSprinting )
{
    IsSprinting = bNewSprinting;
    ServerSetSprinting(bNewSprinting);

    if (bNewSprinting) {
        if (CustomMovementComponent) {
            CustomMovementComponent->SprintPressed();
        }
    }
    else {
        if (CustomMovementComponent) {
            CustomMovementComponent->SprintReleased();
        }
    }
}

void ACustomCharacter::ServerSetSprinting_Implementation(bool bNewSprinting) {

    IsSprinting = bNewSprinting;
}

void ACustomCharacter::SprintPressed()
{
    SetSprinting(true);
}

void ACustomCharacter::SprintReleased()
{
    SetSprinting(false);
}
#

Its still not replicating and I dont understand what im missing

#

Even ChatGPT spit out a very similair output lol

honest rain
#

I found that chatGPT gives a lot of times not complete informations, especially about replication stuff ๐Ÿ˜›

clear island
twilit radish
#

ChatGPT has absolutely no concept of context when it comes to Unreal. It may be cool for general concepts to be explained or whatever but it's absolutely horrible for direct implementations.

clear island
#

or more like, negate that

#

you probably want !IsLocallyControlled()

twilit radish
#

I don't see why the entire IsLocallyControlled is needed in the first place. If you don't want it to be called on something that's for example locally controlled just skip the owner in the replication ๐Ÿ™‚

clear island
#

or use skip owner condition with DOREPLIFETIME

honest rain
twilit radish
#

I guess the engine can link them up in this case through a net ID / name or whatever. But it's still advice in general, not everything will work like that. An example is dynamic materials for example, they don't replicate their properties when you do it like this and the entire thing it self doesn't even replicate either.

karmic jacinth
#

Is is possible to make an homing projectile work in a networked way?

honest rain
#

I see, so ideally I would create a variable server side referring to the material, then ask for this variable from the client whenever needed ?

karmic jacinth
# honest rain you mean replicated ?

It does replicate but only seem to apply the base speed of it and not the direction. I tried adding "replicate Movement" but the experience is terrible.

twilit radish
#

I guess it's fine in this specific case? But just depends. Not entirely sure what material does under the hood ๐Ÿ˜›

twilit radish
#

Replicate movement is a horrible experience in general yes, if you're not using any physics based actor it just directly sets the location etc. ๐Ÿ˜…

#

Or not using the character system*

karmic jacinth
#

Should I not use homing projectile and use my own predictive code maybe?

#

Because I just wanted to prototype something

twilit radish
#

I've not in specific used that, so I'm not sure what it does or doesn't do.

karmic jacinth
#

Oh wait I'm setting the target after the spawn so this part doesn't get replicated.

#

Ok it is working now! I'm setting the target as a Replicated variable that I pass to the Projectile and I set the homing target in the begin play.

glad escarp
#

Hey dudes. Any local multiplayer gurus out there? I'm using Create Local Players to spawn additional players (In GameMode) but I can only get it to spawn one additional player. When I add more it doesn't add a player 3 or 4. Anyone know why?

twilit radish
#

Sorry @honest rain need to correct a mistake I made here. In general there are objects that are perfectly fine to be used like the way you did it. This is because the engine basically knows how to find them because it maps it in a certain way and it's available on both the client and server, so for example your material it can find. I'm not 100% sure how much network overhead this has compared to a simple ID or whatever but that doesn't really matter for now I suppose. That being said there are definitely still a lot of scenarios where this isn't the case or where the properties of something may not replicate over the network. But wanted to correct my mistake here ๐Ÿ™‚

glad escarp
glad escarp
earnest comet
#

Hello folks, is there any tutorial, guide, docs about how to handle desync issues? I am testing my netcode with network emulation and everything is wrong if I have 200 ms. Any help is appreciated! Thanks!

dark edge
earnest comet
#

Basically "what am I doing with my life" stage of things.

#

I wonder how I can delay the host's flipbook change trigger on its own side according to the lag, while making client's change delayed for host.

#

Basic desync shenanigans thonk

lucid viper
#

I think I might be screwing up the replication of my bool. I removed the LocalController I had and tried to add a condition to my DOREPLIFETIME but still no luck.

This is my header file:

    void SprintPressed();
    void SprintReleased();
    UPROPERTY(Replicated) bool IsSprinting;

    void SetSprinting(bool bIsSprinting);
    UFUNCTION(Server, Reliable) void ServerSetSprinting(bool bNewSprinting);

This is my character source file:

void ACustomCharacter::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME_CONDITION(ACustomCharacter, IsSprinting, COND_SkipOwner);
}

void ACustomCharacter::OnRep_Sprinting()
{
    if (IsLocallyControlled())
    {
        IsSprinting = CustomMovementComponent->Safe_bWantsToSprint;
    }
}

void ACustomCharacter::SetSprinting(bool bNewSprinting )
{
    IsSprinting = bNewSprinting;
    ServerSetSprinting(bNewSprinting);

    if (bNewSprinting) {
        if (CustomMovementComponent) {
            CustomMovementComponent->SprintPressed();
        }
    }
    else {
        if (CustomMovementComponent) {
            CustomMovementComponent->SprintReleased();
        }
    }
}

void ACustomCharacter::ServerSetSprinting_Implementation(bool bNewSprinting) {

    IsSprinting = bNewSprinting;
}

void ACustomCharacter::SprintPressed()
{
    SetSprinting(true);
}

void ACustomCharacter::SprintReleased()
{
    SetSprinting(false);
}

Quick video showing the issue:

#

I also added IsSprinting = CustomCharacter->IsSprinting; in my NativeUpdateAnimation from my custom anim instance source.
My understanding is that as long as you replicate it correctly in the character source, technically it should follow / replicate down to my anim graph as well, right?

wooden abyss
#

Hello, I have a question about spawning AI in a multiplayer game. I have an actor in my level that serves as the spawn point for my enemies as well as actually spawning the enemies in waves. The logic of when to spawn an enemy is dealt with in the GameMode. The GameMode triggers the Event of the Actor in specific cases. Is that already enough so that the AI is only spawned on the Server and then replicated to my clients? Right now it works as intended but I just wanna make sure that this is actually not giving me any problems down the road. I would think that if the GameMode calls the Event to spawn AI they should only be spawned on the server cause the Gamemode only exists on the server correct? Even though the Event is implemented in another actor class

dark edge
#

Everything but GameMode exists on both

#

but don't multicast the spawn, instead spawn replicated pawns. Pretty much don't multicast anything except cosmetics

wooden abyss
#

Yeah my pawns are replicated and my Gamemode calls the Spawn Event. So they should only be spawned on server and not on each client correct?

#

Not using multicast either

#

This is my actual spawn event

#

And I call that from the Gamemode

#

So it should be fine right?

dark edge
# wooden abyss

I would just get Waypoints from the actor and have the gamemode do the work but same thing really

#

the actors in the level can just be data that the gamemode uses to do the actual spawning

#

just like PlayerStartActor

#

it's just there to be a place really

wooden abyss
#

Alright thanks @dark edge !

clear island
#

remove it

#
void ACustomCharacter::OnRep_Sprinting()
{
   IsSprinting = CustomMovementComponent->Safe_bWantsToSprint; 
}
#

I'm not sure you need that CustomMovementComponent->Safe_bWantsToSprint

#

I think you can leave that completely empty

#

the value is already being replicated

lucid viper
#

Still dosent seem to be working correctly

clear island
#

is that SetSprinting function being called on the server when the server presses the sprint key?

honest rain
honest rain
# twilit radish Sorry <@290156232898117634> need to correct a mistake I made here. In general th...

I will post this just in case someone encounter the same issues I had setting material and vertex colors on ProceduralMeshComponent.
good thing to know : It seems CreateMeshSection is deprecated and should not be used anymore. I am not sure if this is because I couldn't get my vertex color material to work, but I have been using CreateMeshSection_LinearColor instead and it works great.
After your suggestions, I replaced the objectPtr with a UMaterial* Material. I don't think it is making a lot of difference, but I guess both options are viable !

spawning a new actor from worldManager.cpp :

                if (NewActor)
                {
                    AChunk* NewChunk = Cast<AChunk>(NewActor);
                    NewChunk->ChunkW = this;
                    NewChunk->Material = Material;
                    NewChunk->OnRep_MaterialUpdated();
                }```
my actor I spawned.h :
```UPROPERTY(ReplicatedUsing = OnRep_MaterialUpdated, Category = "Chunk", VisibleAnywhere)
        UMaterial* Material;```

actor spawned .cpp:
```    Mesh->CreateMeshSection_LinearColor(
        0,
        FChunkMeshDataVertices,
        FChunkMeshDataTriangles,
        FChunkMeshDataNormals,
        TArray<FVector2D>(),
        vertexColors,
        TArray<FProcMeshTangent>(),
        true);
{
    UE_LOG(LogTemp, Log, TEXT("MATERIAL CHANGED"));
    Mesh->SetMaterial(0, Material);
    
}```
Thanks again for your help ๐Ÿ™‚ cheers
pure mango
#

I have an AnimMontage that can spawn actors (AN_Spawn_Actor).
But AnimMontages cannot have events (therefore cannot use RPC).

Can I just stick Server_Spawn_Actor RPC in GameInstance and then just have AN_Spawn_Actor call it?
Or is that messy or is there a better place to put the Server_Spawn_Actor RPC?

vagrant grail
#

Could someone explain to me why on this picture (it'a tutorial) he's using a "Has Authority" if we're already in the gamemode which is on the server ? ๐Ÿค”

dark edge
deep shore
#

If I uncheck the โ€œsimulate physics on dedicated serverโ€ option for a character mesh, but multicast โ€œset simulate physicsโ€, will ragdolls still occur for clients? itโ€™s not important that the simulations match at all.

kindred widget
# lucid viper I think I might be screwing up the replication of my bool. I removed the LocalCo...

Personally, I would recommend ditching the idea of branching on the Sprinting bool in your animbp and rely on speed instead. Sprinting is just a specific condition that enables faster speed.

Currently you'll have problems later if you say... add movement speed abilities that increase speeds. You'll have a character walking at the same speed you normally sprint and because you're not "Sprinting", it'll still play the slower walk animation.

Sprinting should be viewed as an ability. Enable and disable. It's affect is to increase speed and that's it. AnimBP shouldn't care about the source of the speed.

arctic minnow
#

Whats replicated wrong with this?

#

๐Ÿ™‚ ๐Ÿ™‚

#

๐Ÿ™‚ ๐Ÿ™‚

dark edge
chrome bay
twilit radish
#

If you have any specific questions you can ask them here or In #gameplay-ability-system for GAS. But if you're looking for people to help you out on the entire game this is definitely not the place. That's something for the job board.

native tapir
#

SRRY guys

real ridge
#

guys any ideas why my dynamicall healthabrs not working? should I RPC those player variable? idk if its ok to rpc inside widget

chrome bay
#

It's not. Widget should just be reading from some variable on the player or whatever

#

Also you're just setting the colour, nothing else

real ridge
#

and then I am comparing send player + locall player

prisma snow
#

Also it would be a bad idea to have them do it, widgets are not game logic

#

I'd suggest you to handle health etc in a character or pawn component and do the RPCs or replicate health through them

real ridge
#

idk how to then make this dynamical health bar ๐Ÿ˜„ I am shocked noone cant find anything regard to this theme and its in every game

#

kekw

real ridge
prisma snow
#

Widgets are not objects that should store gameplay values such as health

#

You need to use actors and components to do that

#

and then update the widgets to show the health from the component

#

Your comparison only compares the variable Player to the PlayerPawn and their team IDs

#

For such comparison I'd made sure that the teams are correctly setup and that the references you compare do correspond to your player and the others

#

I think there are several layers of problems so take it slowly and do it properly from the beginning

real ridge
#

and I bet I can't send replicated variable to widgets of all

#

so it's not working now

serene furnace
#

hello, I have some trouble with this, anyone can think of something, my Rep notify turns to run on the server only if I use this node, if I remove it, is replicates properly, I thought it my be linked to the fact that my "item master" is replicated actor, but if I make it not replicated, the rep notify fires only on server still.

I tryed "has Authority switch" and Authority is firing properly the Rep notify, meaning that its the server that is firing the rep notify, but things are still not sent to client, im out of idea ๐Ÿ˜ฆ

prisma snow
prisma snow
#

I'd really advise you to read the Network compendiums and learn multiplayer basis properly

kindred widget
#

The comparison is fine. If it's not working, it's because the variable is not replicated correctly.

#

There's nothing wrong with the widget's logic. The issue is that Team is not correctly set on the character.

rose pollen
#

I just put my game on steam to test, it is multiplayer with a dedicated server and I made a completely empty entry level for the client default map that just calls load level by name on the server ip. When I navigate to my executable in Steam > steamapps > common > mygame and double click the exe it loads and connects to the server perfectly, but when i click "play" in steam it just sits on the loading screen and doesn't connect to the server. Does anyone know what the difference between clicking "play" and double clicking the executable is? my launch options are set to the bare minimum i think.

serene furnace
stoic lake
#

Hi, is it possible to multicast a function?

twilit radish
stoic lake
#

instead of having to use a custom event

twilit radish
#

I believe you can't in BPs. You can however just immediately make it call your own function.

#

But not 100% sure, couldn't find anything for it though.

stoic lake
#

what do you mean exactly?

twilit radish
#

As in just directly call a function to handle the implementation when the event gets triggered.

#

Not ideal, but better than nothing I suppose.

stoic lake
#

would this be good practice? The play sound function also plays the sound, not sure if that's nessecary, or if just the MC plays the sound for all clients

#

this is what's inside the playsound function

twilit radish
#

A multicast triggers for everyone that's relevant for the actor. That includes the server. So you're likely playing the sound twice now on the server.

stoic lake
#

Alright

#

thanks

#

so this, and then the multicast would suffice?

twilit radish
#

Would definitely give it a try, but seems fine.

stoic lake
#

๐Ÿ‘

rose pollen
stoic lake
#

how bad is this in terms of performance?

#

/ is a multicast set to reliable hooked up to a tick performance heavy?

#

or bad practice

rose pollen
#

others here a lot more experienced than I so maybe someone will disagree, but I don't think its great performance wise, generally you want the actor running as an simulated proxy on the clients when possible, so have some minimal replicated stated that is enough for your piano to know what it should be animating and then let it animate all of that client side

#

so something like two replicated ints that are the start and end of the loop you have there, you update those server side

#

the piano just knows client side it should be playing from the start to the end

prisma snow
stoic lake
#

the for loop check every key's current value in the animation curve, so having just the first and last index wouldn't be possible

stoic lake
prisma snow
#

still why reliable? what is the worse case scenario if an update is missing?

rose pollen
stoic lake
#

or replicate component*

stoic lake
prisma snow
stoic lake
#

making the mc reliable fixes this issue

stoic lake
prisma snow
# stoic lake

sorry but a screenshot gives little information nor context.

Reliable RPCs are slower than unreliable ones and there is a risk (although probs not high in this case) to overflow the buffer

prisma snow
# stoic lake what do you mean exactly?

Idk what are you exactly RPCing, but if those are events such as "key x pressed" an unreliable RPC that misses will just skip that event (bcs it doesn't reach a client). The next ones would be ok

twilit radish
#

To answer this. It's an absolute horrible idea to run any sort of RPC functions reliably on tick. The reason for this is that Unreal has to make sure that they actually arrive and has to do so in order too, when you're doing this on tick you're very quickly overflowing the reliable buffer Unreal uses with the slightest amount of packet loss. Which becomes an even bigger issue as soon as you get more connected clients, what if 2 clients drop a packet for example? Then Unreal has to resend them again.

This is an issue because Unreal will drop clients where this becomes the case as it can at some point not recover from sending all these packets any more because too many stacked up. This is from a test I ran quickly:

[2023.02.15-14.36.03:529][773]LogNet: NMT_CloseReason: (Server Disconnect Reasons) 127.0.0.1:17777
[2023.02.15-14.36.03:529][773]LogNet: - RPCReliableBufferOverflow
[2023.02.15-14.36.03:529][773]LogNet: UNetConnection::SendCloseReason:
[2023.02.15-14.36.03:529][773]LogNet: - Result=FailureReceived, ErrorContext="FailureReceived"
[2023.02.15-14.36.03:530][773]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = FailureReceived, ErrorString = Outgoing reliable buffer overflow, Driver = GameNetDriver IpNetDriver_0
[2023.02.15-14.36.03:530][773]LogNet: Warning: Network Failure: GameNetDriver[FailureReceived]: Outgoing reliable buffer overflow

prisma snow
#

BTW you are not doing one multicast per tick, you are doing 88

prisma snow
stoic lake
#

I have a curve set up, every key has a value mapped to it, this value means how far along it is in the curve. The tick basically checks which keys' values are currently below the length of the curves and adds the deltatime to the current value.

rose pollen
stoic lake
#

and then just lerping between 2 positions based on the position in the curve

prisma snow
prisma snow
#

replicate only key up and down events

stoic lake
prisma snow
#

the exact position of the key doesn't need to he replicated

prisma snow
#

each transform being 9 floats

stoic lake
stoic lake
stoic lake
prisma snow
stoic lake
#

because doing this with a timeline was impossible as I am using instanced meshes for the keys I had to use a different way to animate multiple keys at the same time

prisma snow
#

two options

#

either do one RPC with an array of indexes and transforms (still unnecessary)

#

or RPC significant events such as key up key down, and let the exact curve be calculated in the clients independently

stoic lake
twilit radish
#

The whole transform thing is not going to be fun either way as this will not look smooth on a client regardless. Clients receive packets at inconsistent timing because of latency and packet loss. So the moment you're sending over the entire transform and just apply it immediately it's going to jump to the position/rotation etc. I would very much go with Max's last option.

#

Saves a ton of unnecessary data and solves the issue of not being smooth in the first place in a really easy way.

stoic lake
#

how do I calculate the position on the clients on a serverside blueprint?

#

aah wait

#

I got it

#

Thanks a lot guys

twilit radish
#

Not even Cedric's compendium mentions it ๐Ÿ˜ฆ

#

Other than "don't do it" I suppose lol.

rose pollen
#

you use an array of which keys are down (probably only 1-10 ints long at any given time), server sets that array, clients animate them on the repnotify

prisma snow
#

IF the piano thingy is the main part of the game and there is not much else being networked I'd also increase the frequency to something higher than 0.4

twilit radish
#

It really depends on what the use case of this is especially if you remove the transforms though, if it's a random piano somewhere random in the map. Sure replication all the way as no one cares about it. But if this is for example a music festival game or whatever and your piano is the main thing of the game I would use RPCs so you don't get the whole replication frequency system on top of it. Especially if you replace the transforms with "push up/down" events. But in general yes, replicated variables are definitely better suited for stateful events. Just not necessarily always, there are definitely exceptions to it.

stoic lake
prisma snow
#

also I guess that even if location is technically a state property, it usually changes often enough that it makes sense to consider it eventful

prisma snow
rose pollen
#

Hypothetically what is best practice for handling things where someone logs in or comes into relevancy range if you are doing rpc @twilit radish , wonโ€™t their client not have gotten the last rpc and thus not know the state on load? Having an issue like that right now in my game

stoic lake
#

#blueprint message

I'm not sure if this works but this is the discussion where the idea for the curves and values linked to the keys came from

#

will probably clear some things up

prisma snow
#

you just need to sync/replicate the start of the curve and the rest is calculated in server and clients without further synchronization

twilit radish
stoic lake
vagrant grail
#

Anyone has a really good tutoriel on multiplayer please ?

stoic lake
#

All the key press event does is set the current curve value of that specific key to 0, then tick makes sure it will eventually get back to the end of the curve. which is 0,4 in this case

stoic lake
vagrant grail
#

I need something that goes deeper on the subject

quasi tide
#

Practice practice practice.

#

Read papers. Watch GDC talks from people who actually have the battle scars of actual networked gameplay

vagrant grail
quasi tide
#

YT is shit in this regard. It is only going to cover surface level stuff that the docs already cover

#

Which is fine - if you just prefer videos to learn from

#

Everyone wants the secret sauce - but the truth of the matter is, you just need to do things.

quasi tide
#

Don't even worry about changing levels.

#

Google the things you don't understand

vagrant grail
quasi tide
#

The most important thing - ignore best practices when learning.

#

You don't understand why they are best practices when you're learning

#

Make mistakes

#

Just do what makes sense to you in the context of your game.

#

Architecture will always be able to be criticized and improved.

rose pollen
# twilit radish If you want to use a RPC to send data when something becomes relevant or someone...

it is the colored balls shown here: https://www.youtube.com/watch?v=grvt64xG20U&ab_channel=Swordai, when the sword hits a ball it triggers an RPC that updates the colors, what the colors should be in stored in a replicated array, but I am only actually updating the colors visually via RPC which works perfectly except when someone joins the game and wants to interact with a ball

Been working on a training mode for my sword fighting game, this is an initial prototype that involves feinting and swinging only (no blocks, working on incorporating blocks, ripostes and kicks now).

I am bad so I run out of stamina and stand there waiting, but directly after a hit lands you can see the cursor turn to a + and you can combo swin...

โ–ถ Play video
quasi tide
#

The more you work with doing the replication and stuff like that, the more 2nd nature it becomes.

#

People like Jambax and Zlo didn't become them by sittin' around trying to find a deep resource. They just...made networked games and practiced.

twilit radish
rose pollen
#

Yeah agree will try reworking into that

#

Was worried it wouldnโ€™t be as responsive to the hits

twilit radish
#

If the actor does not have a high update frequency you can force a net update, that's totally fine in that case I would say. But then you don't have to worry about relevancy / new joiners.

vagrant grail
quasi tide
#

Cedric's compendium is all you need.

#

Covers all the concepts for networking in UE.

rose pollen
#

How do you force update?

twilit radish
#

Is this C++ or BP?

quasi tide
#

Specific tricks (like prediction, rollback, etc..), it won't cover. Because those are game-specific.

#

It does cover everything you need though.

twilit radish
#

As in, for beginning yes. That's what I meant.

#

I just worded it badly xD

real ridge
#

guys how it is possible I am destroying actor after game over but in menu i still can shoot and I hear shooting behind screen when I push mouse ๐Ÿ˜„

twilit radish
#

If you're just beginning, Cedric's compendium covers basically everything you need yes.

rose pollen
real ridge
#

calling this from my widget to destroy me and propably not working heh

quasi tide
#

For the deep topics, GDC vault is probably one of the better resources. Because it is done by people who have actually released games.

vagrant grail
quasi tide
#

Then you need to make a game that would utilize those concepts.

#

Make a simple racing game to learn how to deal with networked vehicles.
Make a simple UT clone to learn how to deal with competitive FPS networking.

#

Key thing being simple

vagrant grail
#

UT ?

real ridge
#

I dont want shit your deep convo but I have serious question why destroyed player can still use mouse input ? something weird

twilit radish
#

Unreal Tournament I guess.

real ridge
#

weird

#

I made mistake ?

#

"called" is executed

prisma snow
kindred widget
#

You're assuming something isn't spawning a new one. Or that the code running on mouse click is running through the thing you're destroying. You need to debug and find out if this is even being called, if the actor is even being destroyed, and if both are true, why input manages to make it to the left mouse click.

#

Also regardless of all of those. You should disable gameplay input when dead.

twilit radish
# quasi tide Then you need to make a game that would utilize those concepts.

Test projects/games are my absolute favorite way to learn things like this btw. You'll just never truly get the same understanding from something unless you need to actually make it work. Reading up on something is good to see what you can do with something initially, although YouTube tutorials in specific end quite quickly with multiplayer in my experience. There are not a whole lot of people covering multiplayer topics tbh so let alone a whole lot more in the advanced sections, that's mostly Epic them self doing an occasional livestream once per year or indeed a random GDC talk ๐Ÿ˜…

real ridge
#

which is weird

#

really weird

#

it should be

kindred widget
#

What calls your left click code?

prisma snow
stoic lake
#

I don't see any other way than using a tick or a timeline, but a timeline can't be played for multiple objects at once

prisma snow
#

it is random? player input?

stoic lake
#

simple linetrace from the player calls the playnote event on the piano blueprint

prisma snow
#

that somebody pressed a key or linetraced or whatever

#

and the rest is client-side

stoic lake
prisma snow
stoic lake
#

It is

prisma snow
#

then

#

you can xD

stoic lake
#

Somehow it's not updating for the clients even when replication is set to true

prisma snow
#

it won't update automatically lol

#

you need to do the RPCs

#

no offense but this could be faster and easier for you if you learned the basics first

#

use the compendiums pinned

stoic lake
#

haha damn, finally got it working the way you said

#

Thanks for the help mate

prisma snow
#

np

#

but please check the compendiums pinned, those are really goo resources and will help you a lot

twilit radish
#

Compendium is awesome ๐Ÿ˜„

stoic lake
#

Yeah will definitely do, cheers

prisma snow
#

Both are

twilit radish
#

Never heard of this 'Wizard' person ๐Ÿ˜›

#

Although I do feel like his compendium is a bit more for when you're further into things already. Would definitely not call everything beginner friendly xD

rose pollen
#

keep waiting for the database section of that compendium

#

feel like i am guessing a good bit on what's best

twilit radish
#

Would not be surprised if he doesn't want to dig into the entirety of a database along with his job tbh.

rose pollen
#

haha yeah it may be listed as "coming soon" forever lol

twilit radish
#

But then again, I'm not him. So not going to put words into his mouth xD

rocky stag
#

Hello , my game server restarts a couple of time and then crashes with this error .

#

[2023.02.14-19.15.15:264][723]LogWorld: Error: Unable to travel to '/Game/FFA/Maps/Test5' - package is not a level
[2023.02.14-19.15.15:264][723]LogWorld: ----SeamlessTravel is cancelled!------
[2023.02.14-19.15.15:264][723]LogNet: Error: TravelFailure: NoLevel, Reason for Failure: 'Unable to travel to '/Game/FFA/Maps/Test5' - package is not a level' with a NULL UWorld

#

This happened after moved my project from 5.0 to 5.1

#

Used this method for restarting the game server

woven bramble
#

Hello, I'm stuck somewhere for Multiplayer FPS game. When they look at the character, they will see a TPS (FullBody) character, but we will see FPS while playing the game. Does it make more sense to do this by adding a Fullbody mesh and FPS mesh into one Character BP and changing the "owner see", or is it TPS BP + FPS BP?

eternal lake
woven bramble
eternal lake
woven bramble
# eternal lake I asked if you saw any problems with that approach

When I put Fullbody Mesh + Fps Mesh in a Blueprint, there is no problem. (except aimoffset)
I haven't tried it for 2 Blueprints separately. So I don't know if I will have problems or not. If there is only one thing I know, it is that I have to install this system in the form of 2 separate Blueprints. Any advice on how to do this? I don't know how can I do it.

#

"except aimoffset"

eternal lake
#

Why would you intentionally double your workload?

woven bramble
# eternal lake Why would you intentionally double your workload?

That's true, but I have to. So I want to get a TPS look for a Multiplayer FPS game. I could also have something simple just add TPS and put it on a camera head, but I don't want that. FPS Mesh should be of high quality and realistic.
Is there a method you would recommend for 2 separate Blueprint characters?

rose pollen
#

P1 is look down and left at his foot, P0 sees P1 head position accurately from aimoffset from the difference in the BP above, arm positions don't match exaclty in my case as the FPS arms are different than the TPS arms (with animations i am using, the TPS arms obscure your vision too much when fighting, so FPS arms follow same animations but are positioned lower and further back than the characters actual shoulders)

young spoke
#

whats a good way of destroying or omitting a bunch of static mesh components on your server that are just visuals

#

currently in BeginPlay()i check if (GetNetMode() < NM_Client) //skip;

twilit radish
#

Assuming you mean dedicated servers? Those don't load assets like that as they don't have an interface to view it, would just be a bunch of wasted memory. Also GetNetMode() < NM_Client returns for listen servers and standalone too FYI.

woven bramble
# rose pollen

So I need to make AimOffset for TPS and for this "Use Controller Desired Rotation" has to be false (disable). But the "Use Controller Desired Rotation" option must be enabled for the FPS to work properly. Could you watch the video please?

young spoke
rose pollen
twilit radish
#

But things like textures it could perhaps use are for sure not loaded.

woven bramble
# rose pollen it looks like your heirarchy of components is backwards, make FP arms a child of...

I made FP arms a child of the camera, didn't work.
I don't think it has anything to do with it. The game is a completely FPS game and the Client will only see us as TPS. I don't need CameraBoom either.
If I put the camera on the head of the TPS and choose the easy way, like removing the FPS mesh, the problem is solved, but I don't want that.
There is 1 FPS Mesh, 1 TPS Mesh, and the game is an FPS game, my goal is to apply AimOffset for TPS Mesh. And I can't figure out such a simple thing.

rose pollen
#

my setup is a bit different but I think you are fairly close

#

not exactly clear to me from video what is wrong, i would try to disable "Use Controller Desired Rotation" completely, make your FP mesh a child of the camera, have your "look" input add relative rotation to the camera

#

but there are lots of ways to do it I think and you are on the right track

woven bramble
#

Thank you so much, I'll try to find true way.

twilit radish
#

https://www.unrealengine.com/en-US/events/gdc2023

Battle-testing UE5 Next-Gen Systems with Fortnite
Please Epic give us actual performance overviews / insights into Iris ๐Ÿ˜‚

Unreal Engine

Join Epic Games at GDC 2023 for the State of Unreal, insightful tech talks, and the chance to play the latest Unreal Engine games at our booths on the show floor.

quasi tide
#

Most likely - it's just going to be what their blog post covered. The one talkin' about using 5.1 features in Fortnite

twilit radish
#

๐Ÿฅฒ

gloomy tiger
#

Is there any way for me to set listen on a map after opening it?

ocean dust
#

Hello, all. Is there a reason AGameMode::PreLogin is not exposed as a BP-overrideable function? I can't assign a player ID before ChoosePlayerStart is called because PostLogin and HandleStartingNewPlayer are both called AFTER ChoosePlayerStart...

#

Also, when should I set up my UI on my PlayerController clients? If I try to do it in BeginPlay, my listen server fails because OnPossess has not been called yet, but if I do it in OnPossess, that is never called on the remote clients...

latent heart
#

Your UI shouldn't really care if you have a character or not.

#

Of course, it can change depending on what you have, but it shouldn't just fail.

ocean dust
#

I have Shields, Health, Power, and Heat components on my Pawn that deal with those resources and are replicated. But if the Pawn has not been possessed by the PC, how is the UI supposed to know what values to put there?

latent heart
#

If the pawn isn't there, just hide the ui elements? Or set them to 0/0?

ocean dust
latent heart
#

Have a fallback.

ocean dust
#

What is the appropriate event to set up my UI? Even if I hide it before the pawn is available, I need to set it up at some point. Do I have to busy-wait with a Tick (common in Unreal, unfortunately) or is there a network event that I don't know about?

latent heart
#

There are definitely possession events, but I don't know if they are exposed to BP.

ocean dust
#

Well, I can confirm that at least in PiE testing OnPossess in BP is never called on remote clients

latent heart
#

It would need to be a specific RPC tied to possession. Or an OnRep.

ocean dust
#

Well, my hack was going to be creating a new variable for my Pawn that is RepNotify, setting that in OnPossess, and then handling that on the client once the replication occurs

#

Does that seem reasonable/necessary? Working around the fact that clients have no event called after possessing a replicated pawn?

latent heart
#

So yeah the onposses isn't a networked event, it seems.

#

Fun stuff.

#

So the pawn itself is an onrep'd variable.

#

So just use that.

#
    UPROPERTY(BlueprintAssignable, Category=Pawn)
    FOnPossessedPawnChanged OnPossessedPawnChanged;``` or this
ocean dust
latent heart
#

Copied directly from AController.

ocean dust
#

Yeah found it. Will investigate, good find!

#

So far, it looks like that delegate is never called for first-time possession. I don't see that being called for my listen-server, nor my remote client, but the server-side PC for my client gets the notif, but not the client itself

#

How are other people doing this? I've taught myself everything about Unreal, and I'm realizing that I have a wildly different approach to things than most people and even the folks at Epic. I fight Unreal ALL THE TIME because I just have a very different archtecture approach

#

I should really hire someone to teach me at some point

prisma snow
#

for multiplayer I recommend the compendiums pinned

#

probs starting with Cedric Neukirchen's one

ocean dust
#

I have read it, I understand the architecture, I don't recall if it goes into detail on exactly how to implement many of these things (because they are often game-specific)

ocean dust
pale obsidian
#

The comment above it: Event called after a pawn has been restarted, usually by a possession change. This is called on the server for all pawns and the owning client for player pawns

ocean dust
#

Investigating, good find

#

I would prefer it on my PlayerController (that's where I am building and presenting the UI), but I can work with it

ocean dust
#

Good catch, thanks all!

#

Funny enough, the first event I see is the custom variable OnRep notify, before anything else is called on the remote PC

#

So might have to use both approaches: use the OnRep to Bind Event to ReceiveRestarted, then use the bound event to update the UI and carry on as "ready"

#

Have guests coming over, have to put a pause on this for now, thanks for your help, all!

tame quarry
#

Before I design my whole game in the wrong way. I'm pre-thinking the future multiplayer part of my game. I'm doing a squad based rts. So its small groups of units fighting other groups of units.
When 2 groups clash, I select random units and send them to the enemy group of units. At random.
Is this randomization good for multiplayer because it means each machine will have its own randomization. So each machine will select different units and different targets to go to.
This means that ech time there is this type of combat, i cant use randomization, i must use a predictable formula that will be used in both machines. Or if i cannot do that, i must send a packet for all the units, right? Which is not very efficient.

#

Should i rethink this through? It may need a deterministic formula instead of so much randomization.

robust oriole
#

Uuuugh... i have a pawn, on which i overrode the "on unpossess" function to spawn the default AI controller. At certain points in my game, i want to unpossess the players pawn and let the AI take care of the pawns movement. This is done in blueprint, i call "unpossess" on the pawns controller (Server side), and then issue the command to the pawn that starts the movement (also server side).

Now what confuses me is that this works in PIE when i play as a client with 2 players, but DOESNT work, when i play with only one. When i play with two, both the ensures for GetAuthority and the AI Controller return true, when i play with one, the Getauthority returns false, and the AI controller is null (because the pawns controller itself is null)....

can anyone tell me what i did wrong here?

kindred gazelle
#

Is there a reason why server events take a long time to trigger when called from the client?

To me it obviously makes sense since it takes time to go from client -> server -> client, however it would only be noticeable for complicated logic. I'd assume that on average network emulation profile in editor it wouldn't take too long, but I'm noticing that it takes long enough for errors to occur sometimes (for example, a simple item pick up can take a quarter of a second which is long enough for the client to try picking it up multiple times before the server tells the client it has been destroyed, which causes an error "pending kill"). But I notice it for simpler things too, like the most basic server event will take a quarter of a second to trigger on the client which does get annoying. Tbh, it could be an issue just with our project so if that's not normal let me know

I notice that this is happening even on average network profile, and it gets exponentially worse on "bad". The way I've been getting around it is by having things occur on both client and server (such as inventory changes on server, but the UI updates independently on the client so that the client doesn't need to wait for the server). Is this a standard approach to ensure network delay isn't noticeable? Or is there another better method

robust oriole
kindred gazelle
#

I'm doing listen server with 2 players

#

It does the same things though when playing multiplayer in the shipped version

robust oriole
#

did you try overriding the network emulation settings? afaik default network emulation has a latency of like 0.1s, though im not 100% certain about this

real ridge
#

where is better to handle widgets which should be multicasted to everyone in player controller or his pawn?

#

for example count down

#

timer

#

or game over?

kindred gazelle
prisma snow
#

I'm personally going to try a server approach because there might be corner case scenarios where you want units to fight in a less strict way

#

For example if the enemy battalion is already engaging and there is no room to fight properly, units might fight closest enemy from other battalions or buildings

robust oriole
twilit radish
#

AI stuff should (and is in general enforced) to be on the server side for good reasons though ๐Ÿ˜„

short arrow
#

Anything significant imo anyway

twilit radish
#

Also @kindred gazelle what you described is just latency. I would recommend fixing those errors as your players are going to ruin into them regardless of you turning off the emulation or not. In your case the emulation profile is for everything which means that it's for both incoming and outgoing packets on both client / server.

So Client 1 sends a packet -> 30/60ms delay -> server receives -> 30/60ms delay -> processes on the server and sends a responses to Client 1 -> 30/60ms delay -> Client 1 receives -> 30/60ms delay and only then they actually get it. On top of the packet loss.

So sounds like normal behaviour to me what you've going on there. And if it's hindering gameplay then you should take that as a sign that someone who is actually playing your game with a slightly bad connection will have issues with it ๐Ÿ˜‰

short arrow
#

I would probably make something like a bunch of rabbits running around client sided

twilit radish
#

Depends on whether or not it needs to be synced. If it needs to be synced it's not a client's job to do it.

#

Also Unreal shields off decent parts of AI stuff on client net modes, as Fennel found out ๐Ÿ™‚

short arrow
#

Yeah that's why I said anything significant, in the example I gave with a bunch of rabbits running around. Probably doesn't need to be replicated in most cases, because it'd probably nuke your servers performance

twilit radish
#

I mean to be fair, games that do this do not just load in a million rabbits all at once. The Forest has creatures for example and has at best 30-50 of them inside your distance. (Birds, rabbits, deer etc.) Which I think is still a bit of a high number.

short arrow
#

case by case thing I guess, depends on what kind of game you're making. IIRC the forest doesn't allow many players in their multiplayer lobbies. So there's a lot more to work with

#

but something like rust or ARK would be detrimental for sure

robust oriole
#

Can i, on server side, unpossess a pc's pawn and instantly possess that pawn with its default controller?

twilit radish
#

Should be just fine, does something not work about it or?

#

If anything, the possess function ultimately unpossess if there's still a previous owner ๐Ÿ™‚

robust oriole
twilit radish
#

That does not sound like you're on the server to me then.

robust oriole
#

If i unpossess in the server does it call OnUnPossess on the client then?

twilit radish
#

To my knowledge it should be a server side event only, are you sure you're actually calling the unpossess from the server though?

#

It does not seem like Unreal does much to protect from that (because why should it anyway I guess). So that might mess up some things too if accidentally happening.

stoic lake
#

Hi there, how exactly does replicated actor input work? I haven't been able to find any solid articles or documentation on this

#

For example: having a keyboard event on an actor and wanting to multicast that event

twilit radish
#

That's because they don't replicate by default whatsoever. If you need to send up something to the server you just do it your self. If a client as an example presses the interact button the client sends a message/RPC to the server "Hey I pressed my interact key" and then the server can do whatever it wants ๐Ÿ™‚

stoic lake
#

I tried that, but the server ignores the event.
Play note is multicast somewhere down the line

#

The actor has been set to replicate

twilit radish
#

Is the actor owned by the client trying to press the key?

stoic lake
#

Ah right, would that mean I have to set the interaction up in the playercontroller and send that message up to the server there first?

prisma snow
#

yeah

twilit radish
#

If you don't want to or it makes no sense to set the player as the owner of that actor then yes.

stoic lake
#

Okay, thanks :)

robust oriole
twilit radish
#

Can you show your setup?

robust oriole
#

1sec

#

@twilit radish This is the RCP that i call on an actor

#

this is the function within there, where i call "unpossess"

#

and at "AttachToGrid" the pawn needs to have an AI controller, because that uses AI movement

twilit radish
#

Can you show the relevant log part of what exactly Unreal is yelling at?

robust oriole
#

its not yelling in the logs, which makes it hard to debug... if the unit's owner isnt the listen server client, but any other client, it just doesnt spawn & assign a new controller in the overridden unPossessed PikaThink

#

because this returns client PikaThink

twilit radish
#

How did you check if that is the case though?

robust oriole
#

went through it with the visual studio debugger

#

the weirdest thing to me is that it used to work pretty much exactly like this...

#

wait let me rewind to an older version >_>

twilit radish
robust oriole
#

this version worked PikaThink

robust oriole
#

in that moment i want to take away control from the player and let the ai move that character PikaThink

twilit radish
robust oriole
#

no, thats a separate actor called "Encounter manager". i spawn that at the start of an encounter

twilit radish
#

Is that one replicated?

robust oriole
#

yes it is

twilit radish
#

Is it actually spawned on the server?

robust oriole
#

thonk let me check

#

its spawned like this inside the game mode, so id assume yes thonk

twilit radish
#

The game mode is already on the server, not sure why you're calling a RPC there towards the server at the end.

#

Or well even better, game mode only exists on the server.

robust oriole
#

PikaThink good point, that doesnt need to be server side RPC. but i doubt thats what is causing this issue thonk

#

...

#

i turned it off and on again

#

i didnt change shit (except that RPC you mentioned)

twilit radish
#

Turn what off?

robust oriole
#

editor

#

and now it works

twilit radish
#

You aren't using hot reload right..?

robust oriole
#

i wasnt changing anything in C++ atm

#

but i do use hot reloads when i do, usually. unless i change u-things then i restart the editor

twilit radish
#

Soโ€ฆ don't use Hot Reload in Unreal Engine 4 because:

Data corruption in Blueprints: it can reset and mangle any variable at whim. The only way to fix it is to roll back to a previous file version from a backup or from source control (perforce, git, svn, etc.)
It can't deal with header changes (.h files) or constructor changes
It's deprecated, not maintained by Epic anymore
Just don't use hot reload please. If you insist on using something similar use live coding instead but please ditch hot reload:
https://horugame.com/dont-use-hot-reload-in-ue4/

#

It's very likely that it just messed up something somewhere tbh if all you had to do was restart the editor.

robust oriole
#

hot reloads = live coding, right? and the issue persists in ue5?

twilit radish
#

No. Hot reload != Live coding.

robust oriole
#

oh ๐Ÿ˜ฎ let me read up on the diff

twilit radish
#

And yes UE5 still has the exact same issues. Hot reload is garbage and should get removed from the engine.

clear island
#

hot reload was the previous solution

#

live coding is the new recomended one

#

although some bugs still have transferred over

robust oriole
#

oh in that case no, not using hot reloads, only live coding PikaThink

twilit radish
#

It's at least better than hot reload, but indeed still far from perfect.

clear island
#

yes and even when using live coding, only use it when you change function bodies is what I'd recommend

twilit radish
#

Either way.. Hot reload strikes again ๐Ÿคฃ

robust oriole
#

id say "alls well that ends well" but im kinda scared this might happen again PikaThink

clear island
#

keep some backups, I've had cases where maps got corrupted and I wasn't even using live coding or hot reload

#

the joys of UE ๐Ÿ™ƒ

robust oriole
#

das why im using version control^^

clear island
#

yea you should

twilit radish
#

IMO just don't use both. Not having to deal with the corruption / weird issues that come from it is so much more worth your time besides that it does not save an extreme amount of time anyway as Visual Studio can already do incremental builds where it only changes the stuff that was actually changed.

#

Also +1 for version control yeah.

robust oriole
#

1 points for git-ryffindor

cold moat
#

confusing question:

void UArcItemFragment_SkeletalMesh::GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    DOREPLIFETIME(UArcItemFragment_SkeletalMesh, Mesh);
}

If i stick one of those into non-replicated TArray<UArcItemFragment> Stuff, will it still replicate anyway?

#

i DON'T want it to replicate

#

Its on an Actor that replicates it's movement, but the data is only needed on the server

twilit radish
#

Not sure I understand you. You don't want to replicate the item because you only need it on the server, then why are you replicating it?

upbeat basin
#

Confusing question indeed

cold moat
#

its a story and a half lol

#

well, im working on grenades

#

those fragments hold data for the weapon, but the item can be put away right after throwing

#

so i need to take a snapshot of relevant part and copy it onto the actual grenade actor

#

so that each grenade(or mine or whatever) has its own instance of the data (so you cant retroactively get a damage upgrade or something after throwing 10 mines)

#

but, will the fragments even replicate, when the array holding them isnt replicated?

twilit radish
#

This does still not make it much clearer if I'm honest. I really don't see why you just don't replicate the data.

#

If an array isn't marked as replicated then no the array is not going to replicate.

#

If a specific item within is replicated it self then that's a different story ๐Ÿคทโ€โ™€๏ธ

#

An exception were something implicitly replicates is if you throw it in a struct as a UPROPERTY and then replicate that struct for example, but then again you're explicitly replicating that struct. Although in that case the NotReplicated specifier exists.

cold moat
#

would

UPROPERTY(NotReplicated)
TArray<ReplicatingFragments> Stuff;

work? doesn't seem so

#

๐Ÿ˜ฆ

cold moat
#

the object only exists on the server

#

will it create a free-floating object on the client?

twilit radish
#

If you have a a TArray of actors for example:
TArray<AActor*> MyActors;
And that MyActors array is not replicated doesn't mean that the actors them self can't be replicated is what I was trying to say.

#

However if you do the exact same thing with actors that are not replicated but the array is now replicated they will just be nullptrs on the client because they don't exist from the client's point because they aren't replicated.

#

But again, still no idea what you're trying to do ๐Ÿคทโ€โ™€๏ธ

cold moat
cold moat
#

does the replication system do anything at all in this case?

twilit radish
#

UObjects don't replicate. Since 5.1 you can specifically do this if you want to though. But if you have a TArray that is not replicated then you aren't replicating them unless something else is replicating them. Doesn't matter if you put Replicated above some random variable in there. If you're not explicitly replicating that object "somewhere" in your project then no it's not going to magically replicate as you're not telling it to replicate.

#

It's the exact same thing with actors and anything Unreal related, if an Actor is not set to replicate it's not magically going to replicate.

#

You explicitly mark what you replicate and what not. Whether that's a variable, an actor or whatever.

cold moat
#

So, you basically need the object instance on both the server and the client for its properties to try replicating?

#

does the non-functional part of replication have any cost?

latent heart
#

Where would they be replicated to if the object didn't exist?

twilit radish
#

An uobject it self can't replicate it self. The only thing in Unreal that can do this are actors. An uobject can be since 5.1 be a replicated variable inside an actor but that's it.

#

Well it could also before 5.1 if you made some changes, but again it can only be a variable inside an actor if you want it to replicate as uobjects them self have no power to replicate on their own without an actor.

high ibex
#

hello all, in a basic car template in UE5 , off road car is going 130 + in certain time in server but in client, it is stucking at 102 or maybe 104 speed .. i thought this as the issue of replication and tried run on server, mc events but still no effective result. Replicate movement is set to true. In standalone, car hits 130+ as normal as in server. i'm unable to figure what 's the issue ? thanks for answers

cold moat
high ibex
#

oh sorry, i have put no. of players to 2 players and net mode as play as listen server and clicked on play thus getting two windows - one as server and other as client. For the same distance, where the car in server goes till 130 km , the car in client is not going beyond 102 km/h mark.

cold moat
#

That would be my first guess

#

Outside of that it is kinda hard to say, we have no idea how your code works

high ibex
#

oh .. for the movement, i have not added anything extra though .. the same bp code for move forward and move right which comes after creating project with template, is i am using

stray reef
#

men, can someone explain me why deltatime is different between client and listen server in PhysCustom of the character movement component?

chrome quest
cold moat
#

It's basically semi random "how long did the last update take"

chrome quest
#

Deltatime depends on hardware. And is not even consistent on the same hardware. Also depends on the code running on the said hardware.

stray reef
#

how can I synchronize a value of a resource that is consumed during a certain type of movement?

#

i have a jetpack that use fuel during the time that is active

#

i was thinking to consume it with delta time in physcustom but i guess is a totally wrong thing to do

cold moat
#

Well, I dunno how you feel about Gameplay Ability System xd

stray reef
#

no pls hahaha

twilit radish
#

You may want to see it as "stamina" which in that case there's an implementation of in the last pinned message in this channel.

stray reef
#

i just need to make the amount of fuel consistent between all client

stray reef
#

thank you i will study that implementation

lapis zinc
#

Hi I cant find any answers online, is it possible to have a multiplayer game that doesnt have steam subsystem or epic online service? I want to connect two people internationally, but every tutorial I find is just connecting people on the same wifi network or using some sort of third party system like steam sessions. Ive look into port forwarding but seems like its to complicated for everyone to just switch to port forwarding all the time. Any help would be much appreciated!

twilit radish
#

The reason why everyone uses third party systems is because two (or more) computers can not directly play with each other. So you either indeed need to port forward and specify the IPs or you need to use something that can do this for you. This is where systems like Steam, EOS etc. come into play because it's costly and difficult to setup your self. You can in theory do it your self if you want but I would just not recommend it tbh.

fleet viper
#

Hey there, im trying to replicate my mission system. My OnMissionStarted event is fired on the server (since ending and starting is handled by the server) and now i want to create a callback for my clients ui. Im trying to replicate the information back to my client via a client rpc but that rpc is never called..why tho? Shouldnt the server be able to call the client side at all times? (especially since this is in a player controller)

lapis zinc
twilit radish
#

There's Photon which is free to test things out with but requires you to start paying when you hit like 20 players or something. It "supposedly" should work with Unreal but I've barely ever seen anyone here talk about it nor used it my self for Unreal.

#

Beyond that I have no clue.

twilit radish
fleet viper
#

@lapis zinctheres also reverse winter studios who just launched their own launcher, they also have a website called like that

fleet viper
lapis zinc
#

I mean thats a pretty good start, I appreciate it! Thank you!

twilit radish
fleet viper
#

roughly 0,2secs after begin play

twilit radish
#

Because it should indeed just work. Player controllers always have an owner and are always replicated, the only case where they can drop is if you're calling this before the actor is properly replicated.

fleet viper
#

this is really weird huh

twilit radish
#

That "Debug Start mission" thing is not attached to beginplay right?

#

Or something similar?

fleet viper
#

its a custom object that holds the flow of the mission

#

so i dont think it should

twilit radish
#

I think I see the problem. You're starting call Start Session Mission on the server with a multicast. Then that starts the mission. That runs on both the client and server.

#

Which in return probably also just calls that RPC on the client.

fleet viper
#

that could be a reason

#

nope

#

just for ref i am simulating in client mode

twilit radish
#

I mean I guess it should still work either way, it's not entirely how you should be doing that but oh well. What I would try to make sure of is that the initial call actually happens on the server and not the client.

fleet viper
#

output log says that the initial call only happens on the server

twilit radish
#

And you're sure your start mission node isn't returning early for a client/server or something similar and then not calling your event?

fleet viper
#

ill try another delay

quasi tide
#

Sounds problematic

fleet viper
#

but i dont think that its a time issue

twilit radish
#

I also don't see what a delay would do anyway. But in general it's a bit confusing code.

fleet viper
#

you were actually right

twilit radish
#

You're trying to call the start mission event for everything, that's fine. But then the start mission event calls a client RPC with that the mission actually started while the client already does the same thing and that's where I get lost a bit.

fleet viper
#

the delay helped

#

lol

twilit radish
#

Where did you put the delay?

fleet viper
#

I broke the code down too

#

just right before the rpc call

#

wait wtf

#

idk how but the default on mission started call function is suddenly on client too

twilit radish
#

That's what I just told you. A multicast runs everywhere.

twilit radish
#

But I think at this point you're calling this from somewhere where the controller is not properly replicated to the client yet tbh.

quasi tide
#

Mission doesn't even need to "start" on clients to be honest. Server just updates things that needs to be sent.

#

Sends messages, etc..

quasi tide
#

Just use Flowgraph honestly.

twilit radish
#

What is flowgraph?

quasi tide
#

The bees knees

twilit radish
#

The what now

#

๐Ÿคฃ

fleet viper
quasi tide
twilit radish
quasi tide
#

I don't know if I'd even mention Iris honestly ๐Ÿ˜…

#

Heaven only knows when it'll stably release as well as actually be usable.

twilit radish
#

They already enabled it in UE5-main.

#

And in 5.2 Lyra will have it enabled too.

quasi tide
#

So 5.3?

twilit radish
#

Idk ๐Ÿคทโ€โ™€๏ธ

#

Whenever they feel like it ๐Ÿ˜‚

quasi tide
#

Still waiting on the stats though ๐Ÿ˜…

twilit radish
#

Yes ๐Ÿฅฒ

quasi tide
#

"Trust me bro" - hardly a source

twilit radish
#

Do any Epic staff look on the multiplayer forums, would it be worth asking about it there?

quasi tide
#

ยฏ_(ใƒ„)_/ยฏ

twilit radish
#

Oh there is a discussion thread :0

quasi tide
#

Thread, sure - discussion implies a back n' forth though.

twilit radish
#

๐Ÿ˜…

solar stirrup
#

I kinda wish the new subobject replication made it simpler to replicate X subobject to a list of specific players

#

Since the subobject can only have one net group, kinda makes it a little dirty

twilit radish
#

Bit more work though.

chrome bay
#

Even I've moved to the new system ๐Ÿ˜„

#

You had no control what connections the objects replicated too in the old version IIRC

twilit radish
#

Ah nevermind then.

kindred widget
#

New system?

twilit radish
#

I finally got Iris working I think! Although it's a bit whack. CPU performance seems quite a bit worse with a lot of actors. However it seems like they are more efficiently being able to pack together replicated properties in the end(?).

The test was basically 1 listen server and 1 client. Both using -nullrhi (so no graphics) and both the same profile arguments. The server would spawn 2000 actors that constantly in tick increment a float and an uint64 that both are replicated. They were all standalone builds without running the editor and as minimal stuff going on for the PC. The only difference was toggling iris through a launch argument.

#

Can I just safely zip up profiling things? Then I can share them here I suppose.

#

It does get a bit more stable, perhaps when all actors were finally replicated(?). But yeah. Not so sure I like what I see ๐Ÿ˜…

quasi tide
#

Experimental

#

I'll probably end up shipping like 2 games before Iris is usable ๐Ÿ˜…

twilit radish
#

This is what I was talking about, there's like a sudden "wow, let me actually be more performant now"..

winged badger
#

Takes a while to replicate 2k actors

twilit radish
#

Well yes. But it goes up to 5-7ms during that period while with disabling Iris it does not spike up so bad as Iris does whatsoever.

#

After that point it does become pretty even with the normal system, it's not better or worse at that point though.

kindred widget
#

What about constantly changing stuff though? Like 2k actors coming into and going out of relevance? Cause isn't that what Iris is supposed to affect by replacing the replication graphs?

winged badger
#

Dev editor?

#

And iris optimizations come into play with handling relevancy and also having genericout of the box struct delta serialization with compression

#

None of which applies to your experiment here

twilit radish
prisma snow
#

Is it fair to compare Iris to the existing solution which obviously cannot handle 2k actors? ๐Ÿ˜„

twilit radish
#

I mean it handled it better than Iris did lol.

prisma snow
#

Idk Iris' purpose but I guess is to do the same thing more efficiently rather than doing different things

gloomy tiger
#

Greetings!

Not sure if but - is it possible to listen=true a map without re-opening it?

winged badger
#

Did it? Or is iris time slice interval different?

prisma snow
#

it would be an interesting experiment if any of the two systems claimed or pretended to be able to do that

winged badger
twilit radish
#

See the first two screenshots I posted. Iris ran between 5-7ms for a solid 20 seconds when I assume replicating the actors while the normal replication system did not go that high whatsoever.

rocky kestrel
#

How to set dynamic parameter value only locally in player beginplay?

#

This how I do it now and it doesnt work

winged badger
#

To play the devils advocate here, iris might had been replicating more actors per frame

rocky kestrel
winged badger
#

IsLocallyControlled

rocky kestrel
twilit radish
#

If only Epic would just give us a performance overview and how they actually test it. Because 'something' has to be tested as otherwise you can't see if what you're creating is better or worse lol.

#

But I don't feel like it's a completely unfair comparison though. Even if we for example assume that the regular system may better slice it than that still shows that Iris can be improved there as you really don't want a bunch of spikes.

prisma snow
twilit radish
#

Okay wait I'm stupid that's not true lol.

#

Finally, itโ€™s worth noting that as of CL 22864286 in UE5/Main, Iris compilation is now enabled by default (i.e. bUseIris=true), with Iris being disabled at runtime by default. The rest of the steps here should still be taken in order to enable Iris in a project. Additionally, the experimental Iris plugin will need to be enabled for the project, and the โ€œnet.Iris.UseIrisReplicationโ€ CVar set to 1.

#

But still something I guess ๐Ÿ˜„

honest rain
#

Hey guys ! ๐Ÿ˜„
So I am trying to get a NetMulticast function working, but I must be missing something somewhere.
My actor 'World' is in the scene when the game starts for both server and client.
In this world I have a function

        void testServerSpawnToClients();```
 and in cpp 
```void AChunkWorld::testServerSpawnToClients_Implementation()
{
    UE_LOG(LogTemp, Log, TEXT("This SEEMS TO BE WORKING"));

}

but it only fires on the server. Now the reason it only fires on the server, is because no clients are calling it ?

#

I mean no owning clients

opal fox
#

@honest rain from where are u executing that multicast

honest rain
#

From the World actor, begin play function

opal fox
#

and are u playing as a listenserver or a client on a dedicated server?

honest rain
#

I am playing as a client on dedicated server

#

now the function seems to be only firing on the server, not the client

opal fox
#

I dont see anything wrong with the code u provided, and if ur calling that in begin play from an actor that uve instantiated in ur level then something else must be wrong

#

I just did that exact thing u did now and it works for me

#

canu maybe paste the begin play function

honest rain
#

sure !

{
    Super::BeginPlay();

    testServerSpawnToClients();

}
#

here is the constructor :

{
     // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
    PrimaryActorTick.bCanEverTick = false;
    
    bReplicates = true;
    bAlwaysRelevant = true;

    USceneComponent* sceneCom = CreateDefaultSubobject<USceneComponent>(TEXT("RootSceneComponent"));
    SetRootComponent(sceneCom);


}
opal fox
#

have u removed net load on client on the actor or something ?

honest rain
#

I don't think so

#

no it is checked

opal fox
#

try running as 2 seperate clients

honest rain
#

ok

#

still only working on server

opal fox
#

i have ur exact same setup in my actor that I just created

#

and I get 2 logs from multicast

honest rain
#

is it possible that it is because the function is called when the actor is not fully replicated on the clients ?

#

I got this warning though :
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor ChunkWorld_UAID_244BFE55969AA26401_1423050272. Function Generate3DWorld will not be processed

#

Generate3DWorld is in the beginplay function as well

opal fox
#

yeah looks like u dont have a connection to the network on that actor, did u spawn it in the code somewhere, or have u created a blueprint actor and dragged it into the level ?

#

I assume its only spawned on the client

honest rain
#

Yeah I dragged it directly on the level

#

so when I start the game it is already there

opal fox
# honest rain so when I start the game it is already there

`` #pragma once
#include "CoreMinimal.h"
#include "Components/BoxComponent.h"
#include "GameFramework/Actor.h"
#include "Net/UnrealNetwork.h"
#include "LevelManager.generated.h"

class ADefaultCharacter;

UCLASS(Blueprintable)
class TERANT_API ALevelManager : public AActor
{
GENERATED_BODY()

public:

ALevelManager();



UFUNCTION(NetMulticast, Reliable)
    void PrintMessageToEveryone(const FString& Message);

protected:

virtual void BeginPlay() override;

};

CPP:

void ALevelManager::PrintMessageToEveryone_Implementation(const FString& Message)
{
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Magenta, Message);
}

void ALevelManager::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
if (OtherActor)
{

                    PrintMessageToEveryone("Hello");
             
    
 
}

}

``

opal fox
honest rain
#

what if you call the function from begin play ?

opal fox
#

Let me try

#

Only got 1 log though

#

but the debugscreen message happene twice

#

try using debugscreen message

#

Not sure whats going on here actually, just trying to help out xD

honest rain
#

thanks for trying ! ๐Ÿ˜„

#

I am going to try with debugscreen

opal fox
#

No I did get the Ue log twice actually, it just happened alot higher up, I had to search for the log to get both

#

So I think ur code is probably fine

#

The server calls that log, then some initialize happens on ur actor and u get the log filled with lots of other stuff, then u only see that last message at the end.

#

I guess a good confirmation you could print is to see if u have authority inside the string message.

honest rain
#

oh I get 2 print screen messages

opal fox
#

@honest rain filter the entire log by only the string ur printing, then u will see both messages probably, they happen with like 1 second in between

#

ur multicast is fine

hardy monolith
#

Hello! I use the mouse position to rotate object. If mouse is close to the edge of the screen, I want pawn to be rotated.
The question is - since rotation needs to be done server-side, to do it I need to replicate mouse position from client to server every tick. This doesn't sound like good solution to me ๐Ÿค”

#

This is BP code which controls movement

opal fox
honest rain
opal fox
#

@honest rain no the log is there u jnust need to filter the search

#

Then u will see that the log happens twice, its just happening with some delay after the first call from the server

honest rain
opal fox
#

Yes you can do that, but I would suggest just using standard replication for that

#

u can just replicate a value and the clients will be notified if that value is updated

#

theres a function called OnRepNotify

honest rain
#

Yes but that's only for values right ? What if I want to call that UFUNCTION(NetMulticast, Reliable) void PrintMessageToEveryone(const FString& Message);
but from a Server function ?

opal fox
#

I guess u can just use a multicast , especially for those 1 shot events I dont see any problems, maybe someone else has other ideas, but im pretty sure thats what they are made for.

#

maybe tag it as unreliable if its not so important to get it out immediately

honest rain
#

true

#

thank you ! ^^

hardy monolith
#

So, there is no way to get rid of mouse position replication, but I can do it not as often

#

Not sure if it's fine for input delay

outer sphinx
#

Hi guys, one question. Does anyone here use the "mysqlConnector" plugin?

honest rain
#

So I can't get my head around how that works, and it's driving me crazy ๐Ÿ˜†
here is the full setup :
World.cpp , Function Server being called spawning an actor actor.cpp :

World.h :

    void Generate3DWorld();

World.cpp:

{
    Super::BeginPlay();


    Generate3DWorld();

}

void AChunkWorld::Generate3DWorld_Implementation():
{
      AActor* NewActor = World->SpawnActor(ChunkType, &translateTest, &FRotator::ZeroRotator);
      NewActor->InitializeGeneration(Frequency);
}

Actor.h :
UFUNCTION(NetMulticast, Unreliable, BlueprintCallable) void InitializeGeneration(float FreqNoise);

Actor.cpp :


void AChunk::InitializeGeneration_Implementation(float FreqNoise)
{      if (HasAuthority())
    {
        // This code will only be executed on the server
        GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Magenta, "bBool BEING REPLICATED");
    }
    else
    {
        // This code will be executed on the client
        GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Yellow, "bBool BEING REPLICATED");
    }
}```

The 'InitializeGeneration' function will only be called on the server, which I guess is normal since the server is calling the function... but at the same time, the function is Multicast, so it would make sense that it will be replicated on clients as well, since the actor it is being called on is set to replicated ? What am I missing ? how could I get the function to get called as well on the client ? I tried using OnRepNotify but it seems still being called on server only
honest rain