#multiplayer

1 messages · Page 214 of 1

crisp shard
#

ok yea, def was somehow just inputing on both screens w specfically the left shift, but when i seperate them it doesn't do it

vestal pelican
#

Note: they may have been replicated but

twin vessel
#

If i had a UObject replicated through replicated sub objects list, and it was to be garbage collected on server, would it be destroyed on client too, or would the client just keep its copy of the object till it gets garbage collected on client too?

verbal ice
#

It's marked as garbage when the client receives the notification that the subobject was destroyed on the server

twin vessel
#

Ok thanks
Is there some delegate that gets broadcast before the destruction?

verbal ice
#

No, but there's an interface you can implement in your subobject

#

IInterface_ActorSubobject

#

Gives you two functions:

class IInterface_ActorSubobject
{
    GENERATED_IINTERFACE_BODY()

    virtual void OnCreatedFromReplication() {}
    virtual void OnDestroyedFromReplication() {}

};
twin vessel
#

Oh thats cool

#

Thanks

verbal ice
#

o7

twin vessel
#

What happens on the client if i remove the object from the replicated sub objects?

verbal ice
#

You're meant to keep the replicated subobject list in sync on the client for replay purposes mostly

#

If you don't use the replay net driver, you're probably fine

twin vessel
modest dove
#

does anyone happen to know how to add a custom header to a packet? I would like to add the global variable which every replicated actor shares to reduce the packet size

verbal ice
# twin vessel What do you mean by keeping the list in sync? Am i supposed to call RemoveReplic...
While the server will certainly need to maintain these lists, actors/components on clients should also maintain their subobject list locally, particularly for any actors with local authority. This is especially important if a project is recording replays on clients, as actors on a client will temporarily be swapped to a local authority role when recording the actor into a replay. Because of this, any replay recorded actors should maintain their subobject list on the client, regardless of their local NetRole.
#

Okay so you should just do it outright

#

You can use the interface to maintain it (AddReplicatedSubObject in OnCreatedFromReplication(), Remove in OnDestroyedFromReplication())

#

Make it easy

twin vessel
#

Nice, apparently when i read that documentation i stopped right above that point lol

stable marsh
#

Just wanted to say thanks - I believe that fixed it (was tired last night too so had an errant duplicate connection).

vapid gazelle
#

Fair to say that controller assignment and de-assignment to pawns (for the sake of possession) is always controlled on the server, this isn't something a client can initiate and manage on their own without the server's authority?

verbal ice
#

What's the scenario you're thinking about

sonic frigate
#

Hey party_manny

Has anyone found a solution for moving platform in multiplayer the other players slide problem ( smooth sync) or without smooth sync it is too jittery, so I use client side control ( for better feeling locally) ?

I have tried enable/disable UE replicate movement, but it does not work properly.

( Smooth Sync used becasue if ther is any lag the animations in host side jittering.

fickle lichen
#

Hey, does anyone know why when i connect to a server, i don't load not the server map but the main menu map. like when i create a server, the map is loaded but connecting to the server doesn't work. it connects to the server but doesn't load the map

keen adder
#

Like using a repvar?

river shore
#

Hello guys!
So I face this issue when I attach my Button to my Terminal (as an actor component) and then run it the button turns twice for the local viewing client. It does work perfect though when I do not attach it and leave it as its own object.

void ATerminalButton::OnInteract(UPrimitiveComponent* HitComponent, APlayerController* PlayerController)
{
    if(HasAuthority())
    {
        
        bIsRotated = !bIsRotated;
        MARK_PROPERTY_DIRTY_FROM_NAME(ThisClass, bIsRotated, this);
        StartRot();
        //Send Data to Terminal
        ATerminal* Terminal = Cast<ATerminal>(GetOwner());
        if(Terminal)
        {
            if(bIsRotated)
            {
                Terminal->OnButtonTurnOn(bIsCorrect);
            }
            else
            {
                Terminal->OnButtonTurnOff(bIsCorrect);
            }
        }
    }
    else
    {
        bIsRotated = !bIsRotated;
        StartRot();
    }
}```
the interface gets called twice once by the local viewing player and once by the server for network prediction
When I delete the "StartRot();" function after the check on authority it works but will not turn for the server.
bIsRotated is replicated like this
```c
    FDoRepLifetimeParams RepParams;
    RepParams.bIsPushBased = true;
    RepParams.RepNotifyCondition = REPNOTIFY_OnChanged;
    RepParams.Condition = COND_SimulatedOnly;
    
    DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, bIsRotated, RepParams);

thanks for any help!

sonic frigate
# keen adder Have you tried attaching them to the platform on all clients?

I havent tried attaching yet. It is a good idea actually, If players can keep the free moving on platform. Maybe with a trigger zone could work, only if jump out of trigger deattach, right?
(although currently the platforms working locally ( only set first frame) and player snyced maybe the attach cant help hmm)

keen adder
#

The way i normally do things (never tried in multiplayer) is to literally attach the player to any movable actor it lands on, and detatch when they jump. So it automatically works on any moving platforms

#

And so if you jump the platform keeps moving under you

#

Since you are detatched

thin stratus
#

There is no need to attach Characters to movable bases.

#

CharacterMovementComponent already handles standing on something that moves.

#

The more important thing is to ensure the thing that moves is mostly in sync between players.

sonic frigate
fickle lichen
#

can anyone send me DefaultEngine.ini file with steam subsystem pls?

thin stratus
#

Cause it ticks the pose via the rpcs and not let frame

brazen anvil
#

In a inventory, would you set up client prediction for picking up, dropping, moving items or would you just send RPCs and make the moves based on the RPC?

void moth
#

Hey, all! I'm excited to report that I've solved a connection problem (LAN mode Listen Server) that I asked about here, over a week ago. I wanted to share the answer because this is, AFAICT, not documented anywhere, and I've never seen it in a tutorial. This is in Blueprint prototyping, but I think it would happen in C++ as well.

Symptom: CreateSession() with bUseLan=true works fine. FindSessions() with bUseLan=true locates the test session after a couple seconds of beacon scanning. JoinSession() also works at first, and the log has all the setup and performance metric counter initialization messages. Within a second, however, the session is disconnected with Error Code 5, SE_EINVAL.

Solution: My application doesn't have a "lobby level"; the network session control is done within the single level that exists (this an XR engineering app rather than a game). After the session create, the server didn't call LoadLevelByName() or equivalent because [I thought] I didnt' need it. WRONG! The "listen" option is essential and is not implied by the fact that you're in the level that started the Listen Server. Loading the same level I'm already in causes the server to become active, and the client connects.

Follow up: See my next post. The connection happens, but then there is another problem.

#

Now I've got another warning, which might as well be an error because it's stopping the app from working. Log extract (with private info and IP addresses replaced with fakes):

`/[2024.09.28-15.10.26:464][ 62]LogWorld: Bringing World /Game/MyUnrealProject/Levels/UEDPIE_1_L_NetworkSessionTest_X.L_NetworkSessionTest_X up for play (max tick rate 0) at 2024.09.28-11.10.26
[2024.09.28-15.10.26:464][ 62]LogWorld: Bringing up level for play took: 0.001907
[2024.09.28-15.10.26:464][ 62]LogLoad: Took 0.029761 seconds to LoadMap(/Game/MyUnrealProject/Levels/L_NetworkSessionTest_X)
[2024.09.28-15.10.26:464][ 62]LogGlobalStatus: LoadMap Load map complete /Game/MyUnrealProject/Levels/L_NetworkSessionTest_X
[2024.09.28-15.10.26:464][ 62]LogGlobalStatus: TravelCompleted Pending net game travel completed
[2024.09.28-15.10.26:490][ 63]LogNet: Client netspeed is 100000
[2024.09.28-15.10.26:490][ 63]LogNet: Join request: /Game/MyUnrealProject/Levels/L_NetworkSessionTest_X?Name=mycomputer.example.com-18A4EED10BC348D292AB29FBABBC1D1D?SplitscreenCount=1

/// Snipped some irrelevant UI widget messages from my code

[2024.09.28-15.10.26:496][ 63]LogNet: Join succeeded: mycomputer.example.com-18A4E
[2024.09.28-15.10.26:498][ 63]LogNet: Warning: Incoming ip address doesn't match expected server address: Actual: 10.100.200.30:17653 Expected: 10.100.200.30:7777
[2024.09.28-15.10.26:498][ 63]LogNet: NotifyAcceptingConnection: Client refused
[2024.09.28-15.10.26:517][ 64]LogNet: Warning: Incoming ip address doesn't match expected server address: Actual: 10.100.200.30:17653 Expected: 10.100.200.30:7777
[2024.09.28-15.10.26:517][ 64]LogNet: NotifyAcceptingConnection: Client refused`

The last message pair repeats infinitely until I stop PIE. I'm just starting to investigate, but suggestions welcome if you've seen this one before.

sonic frigate
vapid gazelle
# verbal ice What's the scenario you're thinking about

I was curious if there's ever a scenario where a client gets to possess something that's only local to them and the server doesn't need to approve it. Sounds like that's never the case? My impression is that controller + pawn pairing is always verified by the server?

thin stratus
vapid gazelle
thin stratus
#

Yeah if it's only for flying around and no one would see or notice you

vapid gazelle
thin stratus
#

Unreal is generally Authority based

#

This just goes hand in hand with how UE works in terms of replication

#

Nothing is allowed to get to other players from a Client.

#

Everything goes over the Server

vapid gazelle
#

Relatedly, if I can possess spectator pawns client-side only without the server being involved, why is the Unpossessed event server-only? I'm assuming things will still run by the server one way or another even if the rest of the clients don't need to know anything about your spectating activities?

thin stratus
#
ASpectatorPawn* APlayerController::SpawnSpectatorPawn()
{
    ASpectatorPawn* SpawnedSpectator = nullptr;

    // Only spawned for the local player
    if ((GetSpectatorPawn() == nullptr) && IsLocalController())
    {
#

As a matter of fact, that's how Spectators are alreayd handled in UE

vapid gazelle
#

Ah I think you answered my question there.

thin stratus
#

GameMode tells GameState the SpectatorPawn Class.
GameState replicates it and calls SpectatorClassReceived in the OnRep of the variable.
That then tells the PlayerController to start Spectating (if the state is right).
And that does the above.

thin stratus
#

Server != Authority

#

If you use HasAuthority in an Actor, then that can return true if the Actor got spawned locally.

#

It's not the same as IsServer

#

It's just that the server has authority over Replicated Actors

#

So most people never get into the situation where HasAuthority would not mean Server.

#
/// <summary>
/// Function will only run if the object has network authority
/// </summary>
BlueprintAuthorityOnly = 0x00000004,
#

The comment on the ReceiveUnpossessed function is wrong

#

imo

#
/** Event called when the Pawn is no longer possessed by a Controller. Only called on the server (or in standalone) */
UFUNCTION(BlueprintImplementableEvent, BlueprintAuthorityOnly, meta=(DisplayName= "Unpossessed"))
ENGINE_API void ReceiveUnpossessed(AController* OldController);
#

AController::Possess has no check against Server, only against Authority.
Same with AController::UnPossess, which doesn't even have the BlueprintAuthorityOnly specifier.

#

UnPossess does not even check against Authority fwiw

vapid gazelle
#

Thanks for explaining that! Let me double-check why I was convinced of this previously, one sec.

brazen anvil
#

In a inventory, would you set up client prediction for picking up, dropping, moving items or would you just send RPCs and make the moves based on the RPC?

vapid gazelle
#

@thin stratus ok here's the bit that threw me off, the node says both "Server Only" and "Authority Only" here

thin stratus
#

You'll notice that your prediction of picking up might need to affect other systems.

#

E.g. maybe your Items have Weight and you walk Slower.

#

And that becomes a huge rabbit hole of stuff to predict.

#

Maybe you gun aims differently if you have more weight on it or so and now the shot is different so you gotta predict the shot, and then you gotta predict the damage and then you gotta predict the death

#

And what if you mispredict any of that?

#

So tl;dr, what I want to say with that:

#

Try to only predict the absolute minimum to make the gameplay feel smooth.

brazen anvil
#

Yeah I didn't think of all of that. I was thinking about like moving items around or dropping.

thin stratus
#

Yeah I know, it's a more generic answer

vapid gazelle
#

Looking at the corresponding code

thin stratus
#

It#s probably one of those "Blueprint users are too stupid to understand what Authority means." things.

#

Where Epic just slaps the next best thing on there

thin stratus
#

The locally spawned Spectator Pawn has the Client that spawned it as Authority

thin stratus
#

FORCEINLINE_DEBUGGABLE bool AActor::HasAuthority() const
{
    return (GetLocalRole() == ROLE_Authority);
}```
vapid gazelle
#

Ok understood now, basically in UFUNCTION the Server specifier is the actual server-only directive, while BlueprintAuthorityOnly does not imply server, just authority, which often overlaps with server.

thin stratus
#

/** The network role of an actor on a local/remote network context */
UENUM()
enum ENetRole : int
{
    /** No role at all. */
    ROLE_None,
    /** Locally simulated proxy of this actor. */
    ROLE_SimulatedProxy,
    /** Locally autonomous proxy of this actor. */
    ROLE_AutonomousProxy,
    /** Authoritative control over the actor. */
    ROLE_Authority,
    ROLE_MAX,
};
#

/** Authoritative control over the actor. */

#

Nothing here says Server

#

I also don't think a locally spawned and possessed pawn will change to AutoProxy role. Not sure.

vapid gazelle
#

Referring to these two:

thin stratus
#

That doesn't limit it to Server. That has nothing to do with that.

brazen anvil
#

I have a weird question. Lets say someone built a FPS similar to like Counter Strike. Lets say 5 v 5. If someone followed (mostly) youtube videos on creating the game, would it end up being poorly optimized? Like is a 5v5 FPS with no "best methods" implemented end up playing terribly?

vapid gazelle
thin stratus
thin stratus
#

If you call that on a Client Owner Actor it would move to the Server.

#

This is a not a Gate.

brazen anvil
thin stratus
#

If you want a Gate, check IsServer

thin stratus
#

One learns a lot of things to prevent bad performance. But there is always a time during which one needs to squeeze some more ms out of the CPU or GPU.

#

You shouldn't code literal poop, but also don't need to over optimize everything from the start.

brazen anvil
#

What if it is part of the framework. Wouldn't you want to start on a solid foundation?

thin stratus
#

I don't think it changes anything

#

We are talking about optimization, where the changes to optimize are usually not that big.

#

The majority of the foundation would stay as is, unless you coded said poop.

brazen anvil
#

Ok thanks for your help

thin stratus
#

And if you follow tons of YouTube tutorials and mixtures of them, then you have a higher chance to code badly

#

Mainly due to those tutorials:

  1. Not being curated.
  2. Sharing things they learned thinking it's good, but it's actually bad.
  3. Having tons of different coding styles and standards.
brazen anvil
#

Ha I was using YT as an example. I don't watch them and follow them. I do watch Stephen U. videos though.

thin stratus
#

Yeah all good, but if you bring it up as an example then I gotta be able to comment on it :D

brazen anvil
#

Sure sure

vapid gazelle
brazen anvil
#

although, it is hard to know what is a good method versus a bad method when you don't know how to do what you are trying to do.

thin stratus
#

Yeah that's the toughest thing. The YouTube tutors also mostly don't know.

#

I def also have some stuff I think is good and how you do it and it's possbly shite.

#

Takes time and iteration to learn this all.

brazen anvil
#

Yeah. I can tell

quasi tide
thin stratus
#

Jambax James?

quasi tide
#

Yeah

#

For some reason - I use his name and online handle interchangeably. I don't know why.

thin stratus
#

No worries. His company only calls him Jambax, even during meetings.

#

Just ask him about some NPP Prediction stuff when you write with him next time. He loves talking about that.

void moth
latent heart
#

Even engineers in a shared simulation at work will still have the TTP, though.

void moth
# thin stratus Yeah that's the toughest thing. The YouTube tutors also mostly don't know.

This is so true! I was squirming in my seat recently when I viewed a tutorial on UE networking and the instructor -- who may or may not know what they're doing within gamedev specifically -- tried to define some network terms and got it completely wrong. I'm new to UE multiplayer but have 30+ years experience in network design, so the misuse of the terms stood out. (BTW, reading the official docs on the same topic backs up my use of the terms.)

#

YT or written tutorials are like AI coding assistance: Useful tool to see ways of doing things, get an overview of how a thing can be done -- but don't check your brain at the door.

thin stratus
#

A text can be commented on and quickly fixed at least

#
  • who knows if the comment on the video is the wrong information
#

If one wants to create a good resource then it's probably best to have lots of eyes on it and being open for changes to it

#

Which reminds me that I still need to put my compendium up for PRs

grand kestrel
# thin stratus Yeah that's the toughest thing. The YouTube tutors also mostly don't know.

Maybe they can make actual income from tutorials. But personally my time is spent working, or actually making stuff. So I contribute in the form of public repo. No time to make tutorials - they're very time consuming. I also didn't learn from them at all myself. It makes me wonder why they have time to make tutorials because most professionals don't. But if I genuinely wanted to I'd find the time I guess so it's not impossible that good devs exist on YouTube

thin stratus
thin stratus
#

I would love to know.

quasi tide
#

I agree with Cedric here - they (most likely) have time. They just most likely don't really want to.

vapid gazelle
#

I was using Google's NotebookLM to aggregate resources on UE's networking and it generated this podcast style conversation for me which I think y'all would find at the very least entertaining. I piped Cedric's site into it and Alex Forsythe's videos, so it's funny they're both mentioned in there.

quasi tide
#

Even if it is at an irregular schedule. The time is there.

grand kestrel
thin stratus
#

I guess it comes down to the individual and how they structure and prioritize their life

grand kestrel
#

Yeah. So creating YT tutorials would have to be pretty important to you

thin stratus
#

You can duplicate a person and give one of them a dog and they already have a lot less time.

grand kestrel
#

Even my indoor only cat needs more time than I had anticipated 😄

#

Worth it tho

void moth
grand kestrel
#

I do wonder if 1 more makes it easier, so they can entertain each other

#

Well I won't get into that here lol

thin stratus
#

Let me have done that mistake for you.

keen adder
grand kestrel
wet nymph
#

Just out of curiosity, when looking at Voxel Plugin documentation there is a phrase talking about TCP sockets: "Requires the server ports to be open, so won't work on Steam.", what exactly that mean? steam only allow certain ports to be open? or it just mean it will not work with the Steam Online Subsystem?

void moth
# void moth Now I've got another warning, which might as well be an error because it's stopp...

Sorry for replying to my own post, but in case someone encounters it later from a search: SOLVED!

The problem was that seamless travel was disabled in PIE mode. I issued this console command:

> net.AllowPIESeamlessTravel true

After that change, it Just Worked. I had suspected seamless travel was somehow involved, because the error was being issues after the server reloaded the map. I'd been all through the project settings and editor preferences, but I didn't realize there was this CVar as well.

tired current
#

is anyone familiar with steam sessions? sometimes when testing my build i see random servers, is it like other ppl with the app ID 480?

short arrow
#

App ID 480 is for testing purposes and leaves a lot to be desired

#

It's also region locked keep that in mind

fervent condor
#

Does anyone know, Is there any reason why when a server changes a replicated variable (UDataAsset pointer), that it wouldn't replicate, and its ReplicatedUsing function not get called?

fluid prawn
#

quick question

#

For the Netdriver. Is this a single object instance that is used across all actors and is part of the WorldContext. I see UNetConnection hold a pointer to it so I suspect in general there is one net driver ?

#

from looking at the code It smells like the main pipe that all a connections (Actors/Players) subscribe to.

crisp shard
#

when destroying objects using chaos in multiplayer, im not sure what the best way to replicate this would be... i've considered spawning a destruction force via the field system by repnotifying a impact point location, so everytime a new location hits it will spawn this force that will destroy the building, but im not sure if this is a solid approach.
the destroyed buildings do destroy themselves once destroyed tho, so maybe not as bad, but yea not sure if there's a better appraoch for replicating the destruction of buildings

short arrow
silver pendant
#

can someone help with this
I'm spawning an actor on server, but it only show for other clients when I spawn on multicast which shouldn't happen at all
the actor is set to replicates and replicate movement already

#

an already have an owner as the actor trying to spawn it, which is player controller

lament flax
#

to call server RPCs from client, the client needs to own a connection
in c++, can i use the Netdriver or the NetConnection (or something else ?) of my character to send a RPC ?

my goal i to call server RPCs from client side of an actor that is not owned by the player, to avoid to add to much external code in the player because of redirection

kindred widget
#

That's a ton of effort to avoid just making a generic interaction system.

lament flax
kindred widget
#

Why would a player need to RPC through an unowned actor though?

lament flax
#

because im in a widget representing the state of the actor

torpid crest
#

Hello everyone,

How would you approach this situation?

I have a skylight and interiors in my multiplayer game. When traveling to an interior, I use a teleport actor and hide the skylight, relying only on the lighting baked for the interior level. This works for clients, but when the listen server uses that function, it disables the skylight for all clients, even when they are outside.

Skylight is replicated

kindred widget
#

And the player looking at this widget needs to affect this actor on the server that they don't own because?

lament flax
#

see it like a inventory

kindred widget
lament flax
#

is it that complicated to use the connection of anything to call an RPC ?

#

if yes i can just put my specific RPC on the controller and call it a day

kindred widget
# lament flax see it like a inventory

I'm still not understanding why you need to RPC through the unowned actor though. You say inventory. My player owns an inventory, that inventory has the ability to try to affect other inventories and is player owned on their Pawn or PlayerState.

lament flax
#

i said "see it like" because its not a inventory

kindred widget
#

It's more about systems design. You don't want random people calling RPCs on things that you haven't told them they can own.

lament flax
#

i see, but i am still curious on how i can call a RPC through the UNetConnection

#

or if a blog post talks abotu the steps of a RPC

slow dust
#

Hi everyone! 👋

I’m currently working on a custom multiplayer session management plugin in Unreal Engine and would love some help with a few specific functions I’ve implemented. Here are the details:

Functions I’m Working On:
CreateSession
UFUNCTION(BlueprintCallable, Category = "Multiplayer|Sessions")
void CreateSession(int32 NumPublicConnections, int32 NumPrivateConnections, bool bUseLAN, bool bAllowInvites, bool bIsDedicatedServer, FString MatchType, FString ServerName);
Parameters:
NumPublicConnections: Number of public connections allowed.
NumPrivateConnections: Number of private connections allowed.
bUseLAN: Boolean to specify if the session is LAN-based.
bAllowInvites: Boolean for allowing invites.
bIsDedicatedServer: Boolean to specify if it's a dedicated server.
MatchType: String for the type of match.
ServerName: String for the name of the server.

    FindSessions

UFUNCTION(BlueprintCallable, Category = "Multiplayer|Sessions")
void FindSessions(int32 MaxResults, bool bUseLAN, FString ServerTypeToSearch, bool bSearchEmptyOnly, bool bSearchNonEmptyOnly, bool bSearchSecure, TArray<FString>& OutServerNames);
Parameters:
MaxResults: Maximum number of sessions to find.
bUseLAN: Boolean to specify if the search is for LAN sessions.
ServerTypeToSearch: String to indicate the type of server to search for.
bSearchEmptyOnly: Boolean to search for empty servers only.
bSearchNonEmptyOnly: Boolean to search for non-empty servers only.
bSearchSecure: Boolean to specify if secure servers should be searched.
OutServerNames: Output parameter that will hold the names of the found servers.

    JoinSession

UFUNCTION(BlueprintCallable, Category = "Multiplayer|Sessions")
void JoinSession(const FOnlineSessionSearchResult& SessionResult);
Parameter:
SessionResult: The result of the session to join.

issues when trying to find and join sessions can't find the sessions, and I’m not sure where to look for potential problems.

twin juniper
#

When spawning a SpawnSystemAtLocation on the server, does it replicate or would I need to Multicast to all clients?

nova wasp
#

it isn't replicated afaik

verbal ice
#

Unless it's driven by a replicated property

#

In that case use a rep notify

queen escarp
#

hey when im loading all clients into the game map from ther lobby map i create the loadingscreen in the player controller upon entering but there is a short 1-2 sec where the camera spawns in the ground then loadingscreen pops up

#

is there anywhereelse where i sohuld put the loadingscreen that loads faster or advice ?

kindred widget
queen escarp
#

hmm yeah but everything works atm, i might do that on the next project prolly since im gussing id have to remake awhole lot ?

kindred widget
#

Not really. Just take out whatever calls you have to your current loading screen. Place your current loading screen in a project setting, and yawn.

#

Using CommonLoadingScreen is as hard as adding the plugin and specifying this.

queen escarp
#

aye but if im gonna try that i would like to have it fresh tbh easier to learn that way, now everything works

#

oh

#

but will that solve my current issue ?

kindred widget
#

CommonLoadingScreen puts a widget up when you travel maps. So it's up before you start loading your other map. And it's not taken down until your new world has begun play. But at beginplay if you need a longer loading screen for whatever reason you can register a reason and then simply remove it when done with it.

#

Since you have no loading screen before bginplay, I assume it'll solve your issue. Why you need one after beginplay I'm unsure.

#

But if you need one post beginplay. You could simply put up a task around the reason.

queen escarp
#

ok i will look into it

#

also side note / im using the add controller yaw/PITCH node for the replication part, but not im gonna test to set the actor rotation towards mouse location

#

is there any prebuilt for that i dont really wanna Rpc set actor location :/?

kindred widget
#

What is this for?

queen escarp
#

actor rotation

#

i want him to rotate towards mouse location at all time (also using gamepad so rotating towards stick input=

#

)

kindred widget
#

You're not using the controller rotation stuff? Like the pawn should usually be using UseControllerRotationYaw or whatever it is true. The rest is like animgraph faking with the replicated pitch via GetBaseAimRotation

#

Then your client can just set their controller rotation to whatever they want to follow their mouse. Everyone else gets updated from it.

queen escarp
#

yeah im using the controllerrotation yaw but im moving with w,a,s,d and rotating with the mouse is the idea

#

common top down

kindred widget
#

That's fine. But I'm not sure what WASD has to do with it? EG The pawn should check if it's locally controlled, get it's controller, set it's control rotation to point to the mouse target.

queen escarp
#

hmm yeah but m testing to turn stuff on/off nothings changin now im just rotating left or right using the mouse

#

its not setting the rotation towards

#

maybe i deleted something default ?

kindred widget
#

Are you using IAs for the mouse movement?

queen escarp
#

yeah

kindred widget
#

One or multiple?

#

Like 1D or 2D axis?

kindred widget
#

You need to replace this with...

#

Something like this.

queen escarp
#

aye thats what i thought

#

hmm imma test that one

#

the thing is that the cursor is hidden also... hmm

#

well it works but its chasing an invisible mouse cursor... hmmm that will be messy

#

and how would i get this tho work with a gamepad stick also :/

soft relic
#

instead of casting like this, do a branch for "is locally controlled" and then get player controller with the existing pure function

#

are you trying to do mouse cursoe or center of screen?

#

Cause if its mouse but mouse its hidden, then it makes sense you show your mouse first

queen escarp
#

yeah but the mouse will be hidden when playing so idnno how to make that proper if u cant se it

soft relic
#

so what do you want to achieve? Cause it doesnt make sense to want to look at the mouse if the mouse is invisible

queen escarp
#

hmm yeah true, hmm well the mouse is never used except for Ui stuff... hm could change the cursor style tho while visible thats an idea

soft relic
#

What is it you are trying to achieve?

queen escarp
#

just easier movement, now u rotate the character by moving mouse left and right with the mouse, but overall movement will be easier if u look at the cursor instead

#

same with gamepad look at where stick is pointing

soft relic
#

is this topdown?

queen escarp
#

y

soft relic
#

that wont work, you can ideally get the input 2d valuae (mouse or gamepad), and as long as its more than a vector length of 0, convert it into a rotator and apply it to your character

#

using a mouse for this would not work for gamepad and its also wrong, since technically the mouse would have to move over the player to really look into another direction

queen escarp
#

yeah

#

hmmm its a thinker 4 sure

twin juniper
#

What does this error actually means?

LogNetPackageMap: Warning: UPackageMapClient::InternalLoadObject: Unable to resolve default guid from client: ObjectName: Bullet_1, ObjOuter: /.../.../...:PersistentLevel

odd iron
#

Hello guys .
If my game have like 500 EOS Sessions is it possible to get the whole count of connected players inside these sessions ?

kindred widget
soft relic
#

Make sure your server and client are updated. If it's in editor, make sure the machine trying to access Bullet actually has that actor spawned

sturdy sand
#

Hi. Just want to know does mover have client-side prediction architecture? Does it have multiple compressedflags unlike in cmc?

eternal canyon
sturdy sand
#

Alright

odd iron
odd iron
#

Before deploying new server

kindred widget
#

If you want decent relatively realtime updates, you'll probably want to rely on Beacons. Session data is notoriously fucky and slow. Specially with Steam.

odd iron
broken grail
#

Hi all,
I have the issue that my coins are not displayed the same. Only text is not matching but in the left top corner the rigth value is added. Any suggestions?

short arrow
odd iron
#

@kindred widget Mate I've made a few research about the Beacons but my question is Can I make a server just for Queue players can join it and this server can only route players to the servers ?
I mean when the players count reach 40 the server can open a matchmake ticket for them ?

kindred widget
#

Ah, I thought this was to gather a count of everyone currently playing. If you're doing a queue, I don't think you need beacons or a server, but I could be mistaken. I'm not as familiar with EOS, but I know Steam has some matchmaking code that you can just queue to which I believe eventually leads into you joining the session. I'm not familiar with how it works though.

worthy oak
#

Yeah usually another service is handling this cause you could Que, you might also want to just spin up another server

odd iron
odd iron
worthy oak
#

I’m not as familiar with beacons so unfortunately I can’t answer that

odd iron
#

Me too xP @worthy oak

kindred widget
#

Beacons are kind of just like a secondary session. They allow the use of RPCs to and from another machine, but not replication, and connecting to said session also does not cause a travel.

odd iron
#

and Also thanks for the good information as always

kindred widget
#

I'd assume so. I mean you'd still need at least a blank map. But on a dedicated server it wouldn't cost anything really.

odd iron
#

Cool i will try and see what my Brain do @kindred widget xD

rustic sable
#

any good ways to close a dedicated server so that endplay is called? I want it to unregister itself from my lobby when it closes instead of just killing the process directly. Any console command ways of doing this?

keen adder
#

Heya, so what's the best way to deal with items and lag?

#

Ex: laggy client tries to cook a fish on the campfire -- it takes 1 second to actually appear (auth with server), and then when they take it off, it takes 1 second to be removed

#

But during the lag, they can try to keep adding fishes to the fire. Or when they remove it, they can tryto keep removing the fish multiple times while waiting for the server and getting infinite fish

#

All I can think of is some kind of server confimation, but wouldn't that take even longer, under the laggy conditions?

tldr: How do I deal with taking and placing items when players are laggy? To avoid situations where both players take the same or multiple of the same item before it's removed

cyan marten
#

Hi I have a newby question,
I wanted to create a custom game state on my template third person shooter but when i change the gamestate it doesn’t work as the template one.
Do i need to do something on my gamestate to make it the same as the default one?

haughty ingot
#

If you’re saying it doesn’t work at all, make sure you inherit from the correct gamestate. I never use the templates so I’m not sure what gamemode they use as default, but if you inherit from GameModeBase, you need to use GameStateBase, same with the non-base version

cyan marten
#

This solved my problem, many thanks

haughty ingot
#

np ❤️

cyan marten
#

Love

lament flax
#

can i call a RPC from a unowed client actor if i get the owning connection of the player controller ?

keen adder
#

The way I handle it, if a client wants to dmg a server-sided enemy:

#

The Client RPCs the server, telling it which enemy it wants to dmg. The server then dmges the enemy

short arrow
#

The server can call an rpc anywhere and everywhere it wants owner or not. There's no exceptions for clients, either you own it and you can call RPCs or you don't own it and so you cannot call RPCs

keen adder
#

The client can't make the enemy dmg itself or call server rpcs directly

lament flax
# short arrow Huh

i would like to call a Server rpc thats inside a actor placed in level, so by default it cannot call server RPCs from client side because its not owned by a owning conenction

keen adder
#

You gotta call the server RPC on yourself and pass in the actor you want to make the action on

#

you can pass AActors through rpcs

lament flax
keen adder
#

That's the only way, I have an entire class dedicated to redirected rpcs

short arrow
#

I wish they would make it so you have multiple "owners" of an actor so things like this would be easier but it is what it is

#

Actually I wonder if that's a simple actor function you can override to allow RPCs to go through regardless of ownership

#

It's gotta be overrideable somewhere 🤔 gonna add that to my list of things to check

kindred widget
#

I don't know if you can do that with multiple owners. But those functions are your RPC calls.

keen adder
#

But yeah I'm a little stuck on how to deal with triggers during lag.

Ex: 2 players wanting to activate a switch. Player 1 activates it, but player 2 is lagging and does not receive the rpc, thus is also able to activate it (or aquire an item, etc)

Any good tutorials on this type of thing?

short arrow
#

Ah! Figured it'd be some additional check in the UNetDriver :p

keen adder
#

if a player is lagging by a second, they will be able to pick up an item that has already been picked up, for example

#

because they have not yet received the change on their end

short arrow
#

They should be asking the server if they can pick it up, and the server picks it up for them.

keen adder
#

But if they are lagging by a second, that now doubles the lag

#

right?

short arrow
#

Yup

#

Sort of

#

There's no getting around that unless you let the player predict that they've picked up the item, and then the item just disappears once the client finally receives the update that it'd had already been picked up

#

There's only so much you can do for lagging players

keen adder
#

So for placing a fish on a fire for example,

I place the fish, my game then disabled the fire as i wait for server confirmation (so i can't keep placing it)

#

Then I get the confirmation that someone else placed a meat instead

#

and so nothing happens for me

#

OR i get confirmation it was placed and my fish vanishes

#

BUT

#

What if then I place the fish, and throw it on the ground while waiting for the server to confirm

#

or do I need to like, lock the inventory and the fire so nothing will change while waiting for the server

#

man 😐

lament flax
#

just hope that your player will not lag this much

short arrow
#

Literally that ^

keen adder
#

I just tried with my artist from brazil, and i did lag that much haha

#

was able to break all kinds of stuff Canada->Brazil

#

Even just a split second delay from the server is enough to break stuff

short arrow
#

The best experience is just wait for the server to confirm things otherwise you'll have to take the prediction route which means things that you thought you picked up will potentially disappear if you really couldnt

#

In any game like this, server literally does everything, clients just ask it to do it

keen adder
#

Yeah, will def have to rethink things a bit to get it all solid

short arrow
#

Server updates inventory, and state of the game

keen adder
#

oh, even dropping stuff on the ground?

#

like for minecraft

#

i doubt server would manage player inventories, just manage what is on the floor

#

but yeah ill have to think about it

#

Also very odd interaction: Player movement is very quick, while reliable RPCS/Repvars are slow as hell

short arrow
#

Even dropping stuff on the floor. And yes it does also manage inventories. For example when you move something in Minecraft from one spot to another

keen adder
#

So a player can run over, attack an enemy, then run back

short arrow
#

You asked the server to move it to that slot, and the server did.

lament flax
#

most people are on the same continent

short arrow
#

And then you received the location of the latest update

keen adder
#

server will see the player run back and fourth, then do the attack somewhere else, and enemy dies lol

short arrow
#

Atleast I'm pretty sure Minecraft works that way I haven't played it in years. But any inventory where you can see real-time changes from other players. It's all happening on the server

kindred widget
#

IMO, you should make server 100% authority for most things. Client telling the server what they hit is fine. Server can authenticate it, but they still have to tell the server.

short arrow
#

^

keen adder
#

Yeah I just mean player personal inventories. I doubt server keeps track of everyones personal inventory 😮

short arrow
#

It should

keen adder
#

But anyway thanks for the info guys, def got some stuff to think about 🙂

short arrow
#

Otherwise duplication is possible

#

Our game sure does

#

Nothing happens without the servers say so

#

Player inventory or not

kindred widget
#

My inventory is all server auth. They're just components on everything that has an inventory. The player uses their own inventory to try to interact with other inventories. Everything a client sees is replicated back to them.

short arrow
#

We also make use of prediction though, clients need to predict something is actually possible before they can even bother asking the server to do it

keen adder
#

Hmm, and if they make an impossible action their item will reappear or whatever

lament flax
keen adder
#

Yeah makes sense, considering that'll only happen in laggy situations

rustic sable
#

so how do you handle something like weapons overlaps then? like I only have the collider bound on the server but the issue is it frequently doesn't register where as on the client it's reliable.

keen adder
#

Alright sounds good, thanks for the info guys! I'll def start considering more server auth inventories

twin juniper
kindred widget
rustic sable
kindred widget
#

You should try to catch someone like Jambax when they're around. He's done this in real practice. But as far as I understand it they save timed moves or something. And when client says they hit something, server virtually rewinds the objects to their timeframes to validate it. So that client can't just shoot through walls and whatnot. I'm not sure how that works with actual projectiles like a rocket. I think most of that was done with virtualized bullets which just trace over multiple frames to simulate movement and drop.

rustic sable
#

dang ok, the rabbit hole gets deeper

verbal ice
#

For hitscan the client tells the server when it hit and the server would rewind like you said

#

If you're in a scenario where rewinding isn't feasible for your game (tons of players perhaps, or other cases where it's not possible) then yeah you can go with simplified checks

#

That's what games like Squad do afaik

#

@rustic sable ^ for the later part of the message

kindred widget
#

Yeah, I don't know specifics, but I know he's talked about it a couple of times on here. Never had to solve the projectile problem myself. 😄 Been working on UI or RTS games

verbal ice
#

Really depends how tight you need it

#

CS/Valorant/R6 Siege can get away with that since it's low player counts and high tickrates, they have the budget

#

50v50 games or more really can't, the server performance would take a massive hit recording and rewinding player moves (depends on how much data you save and rewind. A simple bound check might be good enough and not too costly)

kindred widget
#

He was working on Hell Let Loose at the time I remember him talking about it. So a bit more higher player counts.

verbal ice
#

ah so HLL does rewinds? Interesting.

#

Worked on Post Scriptum/Squad 44 and we didn't hah. Guess that's another thing that separates us, that's cool

kindred widget
#

Maybe. 😄 Vague memory here.

verbal ice
#

@chrome bay I'm intrigued if that's something you can comment on

#

CMC was hammering us on Squad 44 at the time so if HLL does do rewinds, how?

latent heart
#

Don't use CMC?

verbal ice
#

HLL didn't use the CMC?

latent heart
#

It was a question. 🙂

verbal ice
#

Ah, fair

rustic sable
#

as far as my project it's fairly casual so letting the client say hey we overlapped (melee) or have a successful lintrace (ads) then having the server validate somehow should be enough. This even happens when running and connecting to the server locally, but not when playing in pie, so will have to do some further debug, mulitcast out what the server things mob positions are etc. Really didn't think this would be an issue till we started playtesting 😅

short arrow
#

You do this by constantly saving the location of every player for the last x amount of seconds

jade scroll
#

i have player icons on minimap in my multiplayer game. how can i only show the icons for the right team?

rustic sable
# short arrow You said what you have is enough. I just wanted to confirm that the most fair wa...

interesting, thanks for clarifying how to go about this, I was wondering where to start. I still think I need to further debug why this is happening because like I mentioned it even happens when I connect to a server launched locally where there should be close to no latency and the mobs are standing in place. The overlaps on the server often miss where as if I play the game in pie the problem goes away. Same with the line trace where the mob is just standing there. Sometimes I get misses on the server where there doesn't seem to be a reason for it. I'll put in more debug code this week to track down whats happening.

verbal ice
#

Ghost ping?

vestal pelican
#

Am I mistake or are InstancedStructs not replicatable by Iris? If that's true, is there an alternative?

verbal ice
#

They can be replicated by the regular net driver so Iris should be able to. If not, it's probably just missing a serializer?

soft relic
#

Some screenshots would help to see how your map system works like

jade scroll
#

i jsut have this code on my character...

short arrow
jade scroll
#

this only code

#

this i the icon widget

soft relic
#

does your minimap show other players right now?

jade scroll
#

on every team it shows all player icons.

vestal pelican
rustic sable
short arrow
#

the projectile movement in unreal engine will literally teleport if the framerate can not keep up with the distance traveled based on speed

#

I've seen multiple cases of people making their projectile so fast that it quite literally teleports each frame potentially "going through" the target

rustic sable
jade scroll
#

i set team in lobby

#

my character has a team variable

short arrow
#

line traces are instant, but if you are using a line trace then there's no such thing as overlap

rustic sable
#

2 different issues, overlaps for melee, linetrace for arrows

short arrow
#

which one are you having an issue with exactly?

#

overlaps when swinging a weapon?

#

they also fall short of the same thing I just mentioned with projectile bullets

rustic sable
#

well both 😅 but I'll start with the melee probably. I have a feeling the underlying cause is related

short arrow
#

if your projectile is only 15 or 20 frames, or your server fps is only 15 or 20 frames, the blade would actually teleport past the character sometimes

#

the chain breaks at the weakest link here

rustic sable
#

yeah true

#

but with a local server tho? strange

short arrow
#

to avoid situations like this, your overlap check would need to not be animation nor frame dependent

#

it has nothing to do with ping

twin juniper
short arrow
#

so local, dedicated, or client wouldn't matter

rustic sable
#

hmm ok

short arrow
jade scroll
#

how can i tell each player only show the team icon? how can it be done?

#

i have no idea -.-

rustic sable
short arrow
# rustic sable hmm ok

try attacking with a 60 fps animation, and then try attacking again with 5 fps tickrate

jade scroll
#

yeah but how can i only show xx

short arrow
#

you can debug trace the sword, and you will see huge gaps with 5 fps tickrate

jade scroll
#

how can i set... show only this and this -.-

#

there is no node

twin juniper
#

hire someone

rustic sable
kindred widget
# jade scroll there is no node

There's not a lot of nodes for a lot of things. You need to create your own functions for things. For example, you put your widgets on your minimap somehow and associate them with a player. How do you do that? Start there. Use the association to gather it's team property and affect the minimap according to a comparison of the local player's team to the team of the associated one.

vestal pelican
short arrow
# rustic sable well yeah the anim notifies to enable / disable the collider are based on the an...

I was bored so I thought I'd whip up an example, this is how framerate effects overlaps AND traces. The first animation was 60 fps, the second animation was 20 fps. The hit landed with 60 fps, but missed with 20 fps... also a good example of why it's not the best idea to make crucial things framerate dependent. Finally, even if your animation is 1,200fps it will always be capped by your total fps.

#

this example is only for traces tho but it's the same concept with overlaps, depending on framerate and speed you can teleport right through a collision box

rustic sable
twin juniper
short arrow
short arrow
#

Overlaps only detect movement changes, Or something similar to it, if you teleport into a collision box without using sweep, and then teleport out of it, an overlap will never be detected

#

I'm sure you've tried spawning inside of a collision box before and noticed that it did not trigger until you actually moved

#

the fix to this specific issue is to not allow the trace to be solely based on framerate. Alternatively you could draw some additional traces to connect from the last trace location to the new trace location to detect if anything was inbetween those two locations during the swing.

#

that's actually the method we used for our space game, it was massive and so the projectiles were moving so quickly they were teleporting, often leading to situations where they would teleport passed the target...

#

https://i.gyazo.com/a6b1df9eec43e93eb2776c0e03d4c33d.png
Like this... Frame 1 the bullet is at some location, Frame 2 the bullet is at a new location, but sometimes the target was inbetween both locations, at that point we'd draw a line from frame 1 location to frame 2 location to see if we hit anything if no overlap was detected

twin juniper
#

Does it fix that problem?

short arrow
#

Nah, don't think so. The best you could do for the box collision would be to constantly check for overlaps manually, the engine by default only triggers this when movement happens, but you can actually get overlapping actors yourself regardless of of that

#

though I believe get overlapping actors is rather expensive if too many actors are in there at a single time

twin juniper
#

because my bullets are going pretty fast and I'm at 35 fps and they are always hitting the stuff they should, even when it's not tick actors

short arrow
#

you likely won't have any problem, assuming you didn't upscale your game to massively stupid amounts it likely won't be an issue for you

#

it's just something that could happen

short arrow
#

if the distance is atleast x3 smaller then the players capsule it'll never miss

soft relic
#

theres also the CCD (continuous collision detection?) you can try enabling

short arrow
twin juniper
soft relic
#

yeah, not sure how well it works performance wise but definitely one of the best ways for continuous collision checking

#

you set this in your StaticMeshComponent

#

not the projectile component

#

or your collision component, whatever it is

twin juniper
stable marsh
#

I'm trying to make unit spawning functionality similar to something like Clash Royale - do I handle spawning those units on the server or do I call it from the player controller that owns the unit?
I don't believe I'm grasping server/client fully so - if I have a BP_GameMode, do I treat that as the server script or can server execution occur within my BP_PlayerController?

soft relic
#

select your collision component and you will see it

#

if its cpp then just set CCD or something like that in constructor

twin juniper
soft relic
#

you mean projectile movement enables CCD? how would it know what components to do that on? can you share where you saw that code?

short arrow
soft relic
#

Afaik, you manually enable this on your collision components, projectile movement is not related to that.

short arrow
#

CCD came out 3 years ago, n1 epic games

#

it fixes the overlap problem for projectiles

#

but that wouldn't exactly fix the sword problem

twin juniper
short arrow
#

rip

soft relic
#

CCD is not related to physics though

twin juniper
#

"and it already performs CCD"

short arrow
#

Weeelp, idk anything about CCD so hope you guys get to the bottom of that I'll be reading from the shadows

soft relic
#

How do you know it already perfoms it though?

#

it has its own version of CCD

#

doesn't hurt to also enable collision CCD on your component tho

twin juniper
#

read what Jambax said, it's really it

soft relic
#

I had this help my collisions many times before

twin juniper
#

there's no physic in a bullet, it's UProjectileMovementComponent + Some Particle Effect + BoxComponent

soft relic
#

BoxComponent has CCD you can enable as well, jsut enable it and it will definitely help here and there lol

#

Projectile movement is line tracing which is another safe check, but having CCD enabled as well is also an addition

twin juniper
#

it doesn't seems like it

soft relic
#

yeah, CCD and what projectile comp does are 2 different things resolving the same issue. If one doesn't fix it for you, try the other one. They are different methods.

stable marsh
soft relic
short arrow
twin juniper
stable marsh
thorny wyvern
#

So if I'm concepting a project, and I know eventually I will want a multiplayer element but I have no knowledge of how replication and multiplayer works or what the final state of this project will look like right now, how hard would it be to retroactively go back and add the necessary replication steps once I've finalized things for local use? Should I just suck it up and learn replication first or is the process relatively painless assuming I know what needs to be replicated?

quasi tide
#

Don't. Start with MP.

#

It is far more difficult to add MP in a SP game than to add SP in a MP game.

broken grail
broken grail
verbal ice
#

Don't use an RPC for this

#

You generate the values on the server (authority) and it will be replicated to the clients

#

@broken grail

chrome bay
verbal ice
#

I see, makes sense

grand kestrel
lament flax
nova wasp
#

interesting... Can they each return a different net connection?

#

like can multiple clients use the actor to send rpcs?

lament flax
#

i didnt test it yet

#

but from i see in source code it should work

#

screen 1 - what decide if a client can send RPC to server
screen 2 - what gets the connection on AActor
screen 3 - So technically, if i give the net connection of my player controller it should work

lament flax
nova wasp
#

I guess that's one a time

soft relic
#

Does SpawnActorDeferred work properly for replicated actors?

hexed pewter
#

Considering all PlayerControllers are on the server and every client has it's own version of PlayerController , does it make sense to setup InputContextMapping with AddMappingContext on the server or should setting it up on the client be good enough?

chrome bay
upbeat basin
lament flax
#

But its should be uncommon, if you abuse this it might be a proof of bad design

broken grail
crisp shard
#

When destroying buildings with chaos in multiplayer what is the best way to replicate the destruction?

thin spear
#

can someone help me understand why does this overlap execute twice on the server? the gameplayeffect fires multiple times when playing as a client.

in my head its working out like this. client tells server it wants to fire a projectile through an anim notify.
server fires projectile, it then overlaps another player and onSphereOverlap executes, the effect is applied, Destroy is called.
on the client the bHit bool is set to true.

if the overlap replicates to the client first then bHit will be false, the sound and niagara effect will play and bHit will be set to true then once Destroyed replicates bHit will be true so that condition should be ignored and no further effect will play.

if Destroyed replicates to the client first bHit will be false and the effects will the play an destroy the local instance of the projectile actor.

but in practice the server executes the gameplay effect twice and the clients execute the effects sometimes once, sometimes it seems like theres a stack of 5.

the projectile is spawned from an anim notify and the SpawnProjectile function should only happen on the server

    if(!CurrentActorInfo->OwnerActor->HasAuthority()) return;
#
void ABaseProjectile::OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
    UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{
    if(GetOwner() == OtherActor) return;
    UGameplayStatics::PlaySoundAtLocation(this, ImpactSound, GetActorLocation());
    UNiagaraFunctionLibrary::SpawnSystemAtLocation(this, ImpactEffect, GetActorLocation());
    
    if(HasAuthority())
    {
        if(auto TargetASC = UAbilitySystemBlueprintLibrary::GetAbilitySystemComponent(OtherActor))
        {
            UE_LOG(LogTemp, Warning, TEXT("Hello World"));
            TargetASC->ApplyGameplayEffectSpecToSelf(*GameplayEffectHandle.Data.Get());        
        }
        Destroy();
    }
    else
    {
        bHit = true;
    }
}

void ABaseProjectile::Destroyed()
{
    if(!bHit && !HasAuthority())
    {
        UGameplayStatics::PlaySoundAtLocation(this, ImpactSound, GetActorLocation());
        UNiagaraFunctionLibrary::SpawnSystemAtLocation(this, ImpactEffect, GetActorLocation());
    }
    Super::Destroyed();
}```
narrow oak
#

Hello internet people. I'm trying to make a character creation system and one of the features i want to add is an ability for the player to import a custom texture for the face and body of their character. How would i go about replicating the custom local texture if possible? (my game has a multiplayer mode but will not be an mmo)

broken grail
#

Now i have the issue that the server is not getting the data from the client.
On client side its updating the new server name. but the server to get the new client name.

lost inlet
#

The client doesn't not replicate variables to the server, you'd need RPCs for that

#

This also looks slightly cursed

lost relic
#

Ok So I would Like to spawn the second player as a different actor while playing as the listen server or client, is there a place I can set that?

keen adder
#

Just to clarify, there's no way to do a multicast to everyone except the owner right?

#

Or any other ways to direct a multicast?

#

Ex: Owner makes a particle, sends to server, server sends back to everyone including owner, even though owner doesn't need it

verbal ice
#

Not at the moment no

#

There's a PR to add support for this in the future, if it ever gets merged

keen adder
#

Cool, thanks for the info

#

Just a bit odd considering repVars have this but multicasts don't 😛

fiery wadi
#

Hi quick couple of questions here, I run this and the server can damage the enemy (I see the health decrease) but if the Client hits nothing happens the Event ApplyDamage doesnt trigger at all, I saw somewhere someone said that you have to run the Apply Damage inside a Execute on Server custom event (Which i dont undestand because the Apply Damage shows a "Authority Only" and states only run on server anyway.

And can someone show me how I would go about making the Client able to damage also please ? I,m guessing its because all the code before the line trace is not run on the server so it,s all run on the client before the server event fires. ??

thin stratus
#

Otherwise the Client can tell the Server to damage any kind of Actor in the Scene.

#

And the suggestion to run the Damage event on the Server is correct.

#

The Authority Only part only means that it won't run on Clients. Not that it automatically moves the call to the Server.

#

When you press the F key, you are local.

#

The reason why your screenshot doesn't work is that you are using a pin from different exec line

fiery wadi
#

Ahh so i would do better having a Event Run on Server (Perform Line Trace) and then do all the rest on the server

thin stratus
#

That is not allowed

fiery wadi
#

Oh ok never knew would be better to pass it as a parameter?

thin stratus
#

Let's assume you don't care about cheaters, you need to send the BP_Enemy pointer to the Server via a param

#

Yeah, what you are doing there is trying to access a Pointer that points to Memory (RAM) of the Client ,on the Server

#

That's literally impossible :D

fiery wadi
#

lol that makes sense 🙂 thank you for your amazing explanation!

thin stratus
#

More specifically speaking, this will basically result in the Server trying to damage a nullptr

#

In C++ this isn't even possible

#
void ASomeActor::OnFPressed()
{
  AEnemy* TracedEnemy = DoSomeLineTrace();

  Server_DamageActor();
}

void ASomeActor::Server_DamageActor()
{
  /// Where does BP_Enemy come from? :P
  TracedEnemy->ApplyDamage(..);
}
#

vs

#
void ASomeActor::OnFPressed()
{
  AEnemy* TracedEnemy = DoSomeLineTrace();

  Server_DamageActor(TracedEnemy);
}

void ASomeActor::Server_DamageActor(AEnemy* EnemyToDamage)
{
  EnemyToDamage->ApplyDamage(..);
}
#

But again, that allows cheating

fiery wadi
#

So this would look better?

thin stratus
#

Yeah the second RPC is then redundant though

#

And you gotta make sure you use the right values for the Trace Locations. Your Arrow there might not point in the correct direction on the Server, depending on how you rotate that thing.

#

Most of the time, one uses GetBaseAimRotation, and the Camera's Location to do the traces.

#

Somewhat depends on the game of course

fiery wadi
#

the line traces appear to go all in the right location on the clients but ye maybe the server is line tracing from a different direction now because im telling the serveer to run the line trace and not the client.

thin stratus
#

Yeah it depends on these two

#

Idk how you position/rotate teh Arrow_1 Component

#

If you only do that locally, it will not be in sync

fiery wadi
#

Its attacjed to the actor using the 3rd person template

#

so I would imagine it would replicate its transform details too.

#

but can test it 🙂

kindred widget
fiery wadi
#

Thank you @kindred widget !

thin stratus
#

Yeah right, it#s generally the rule to not cross the wires. Jokes aside, if you take a value from a pin of a node X, then you should only use that value in nodes that are part of the ongoing exec wire.

#

If you call any function or event that starts a new exec wire, you shouldn't start pulling the value all the way to that one

#

That's what params are for

fiery wadi
#

Its working as expected now you can see Client 1 and Client both shot different line traces and damaged the enemy 🙂

#

Many thanks guys, Its so hard to find easy to understand answers on the internet sometimes I spent a good few hours trawling the internet and numerous videos trying to find the information you guys have provided me with in less than 10 minutes, I super appreciate it!

#

I,ll have to search for particles and stuff next, I looked at the https://cedric-neukirchen.net/docs/category/multiplayer-network-compendium/ and https://wizardcell.com/unreal/multiplayer-tips-and-tricks/ which seem nice for the theory side of things but doesnt offer too much with practical examples, So you kind of end up feeling a bit like "I,m reading it but struggling to understand "How to use it", If this makes sense.

This compendium is meant to give you a good start into multiplayer programming for Unreal Engine.

WizardCell

Good practices to adopt, and bad habits to avoid when doing online multiplayer in Unreal Engine

ripe lotus
#

good day.
if i set the transform on a static mesh that's replicated (let's say on tick or smth). does ue performs prediction and tweening on that mesh on the client side? or is that only done for movement components?

thin stratus
#

Only the CMC and maybe the ProjectileComponent does smoothing

#

Everything else simply applies the Transform when it arrives

ripe lotus
#

gocha, so the server would be potentially sending updates every tick to every client in the above case right?

thin stratus
#

Unlikely. That woudl be a lot of bandwidth

#

Depending on update rate and other factors, it might replicate less often

#

The Server could, for example, have a lower frame rate than the client.

twin juniper
#

Guys, I have a question: I'm spawning a Niagara with RPC, making a run on server event execute a multicast event that has the spawn system attached. The server doesn't have information about the Niagara that spawns. My question is, is there another way to do it? Generally, when I need to spawn something, I do it from the server and while it's replicated, it's reflected in all the clients. But in the case of the Niagaras, I don't know how to continue. Thanks.

ripe lotus
ripe lotus
#

i have this component, owned by the pawn. have multiple pawns. im calling a rpc that is netmulticast from the server. but if i set it to Ureliable, it ONLY gets called on the server, only if i set it to Reliable is called on every client.
Any idea why? (i don't have anything network related filtering yet (like priority netculling etc). I tried this a few times, it's 100% reliable/unreliable.
also using variables with replicatedUsing don't get called :((((

verbal ice
#

However if it's stateful (on/off) you're want to replicate a property, like a boolean for example, and use a rep notify for clients to enable/disable the system

twin juniper
#

I've made a predicted bullet actor and this is now the error I'm getting, does anybody know thre reason why this happens?
LogNetPackageMap: Warning: UPackageMapClient::InternalLoadObject: Unable to resolve default guid from client: ObjectName: BulletActor_305, ObjOuter: /Game/Characters/UEDPIE_0_Test.Test:PersistentLevel

twin juniper
tough knoll
crisp shard
#

what would this mean? it comes up when im sprinting. there's no visible error happening but curious what it means

LogScript: Warning: FLatentActionManager::ProcessLatentActions: CallbackTarget is None.

short arrow
crisp shard
short arrow
#

Yeah sounds like a timer was started and then the actor was destroyed before the timer finished

crisp shard
#

at least not when im getting that

short arrow
#

Are you doing this in blueprint or cpp?

#

I believe in cpp it's possible to call a delayed action without specifying a target for the callback

crisp shard
quiet yarrow
#

for network relevancy on late joiners. How do you guys recommend me use rep notify on a physics based object that was moved?

#

I was thinking rep notfiy once the object sleeps, but I know that wont cover all cases

fossil spoke
#

What do you mean? RepNotify for what?

quiet yarrow
#

its a physics based object (cube, sphere). It gets moved around the scene. When a late joiner arrives and the object is no longer moving. The object is incorrectly positioned.

#

repnotify the staticmesh actor *location would correct this no?

chrome bay
#

Replicated Movement should already take care of this

nova wasp
#

Do you mean a physics actor that only replicates where it starts simulating from, J?

soft relic
#

In that case at least make the rep condition to Initial Only. From what I understand it does replicate but its not perfectly in position the first time someone joins regardless of the existing replication logic

lost relic
#

How would I replicate a collision box location that is constrained to my motioncontroller hand to the server as the ones there are not moving

dark parcel
#

is the motioncontroller hand already replicating it's transform? If it is why don't you just attach the collision box to the hand

lost relic
#

yes I did it like this , Not even sure its correct method , first I set the local transfroms of the games hands for the IK to follow , and then set them on the server?

#

But My collision boxes act as the physical hands and are simulating,, The weapons attached to those but on the server Im not sure how to make them move .

#

so I just turned on component replicates on the motion controllers and now the boxes move but there not in the correct positions , weird then I set the constraints and the boxes to do the same and things look better but there is some jitter on the boex even when Im not moving the hands.

karmic trellis
#

Hello, I have a problem with Character Movement Replication. When I testing on far client tests with Steam testing with Listen Server. How can I improve this issue? btw ms around 20-50

dark parcel
#

looks like the player is fighting againts something

karmic trellis
#

oh sorry I forgot to show it

karmic trellis
#

btw I tried to change both NetUpdate frequency and MinNetUpdate to 200 and 400 too but all same

dark parcel
#

You are only changing the max walk speed for the client

#

that's de-sync for sure

karmic trellis
#

hmm I thinked system already simple replicating for character movement so didnt tried different anything for it

dark parcel
#

you want to test with lag as well in editor

#

0 ms doesn't exist in reality

#

and a tiny bit of ping makes a lot of difference if the code isn't right

karmic trellis
#

oh when I test in 0ms it doesnt shown any visible problem

dark parcel
#

well 0 ms is what you call a fake test

karmic trellis
#

thenn what u prefer to me 🤔

#

😅 I m pretty new for this things replication so cant thinking about movements and replicating same time lol

dark parcel
#

well changing the walk speed in blueprint not gonna give you the smooth result you are after

#

because this is working outside the cmc framework

karmic trellis
#

oh but changing location doesnt give me simple movemental aceleration too

dark parcel
#

https://discord.gg/uQjhcJSsRG
In this video I am introducing a series I will be making which explores the character movement component and how you can extend it in depth.

0:00 Intro
1:00 What is the CMC?
2:00 Do you need a custom CMC?
5:35 What does the CMC provide?
7:10 Outro

▶ Play video
karmic trellis
#

humm I will check thanx

#

oh ue dont have a basic ready to use template/code for this?

dark parcel
#

blueprint lacks a lot of feature when it comes to mp imo

#

tldr , you change the walk speed based on the bit in FSavedMove. No blueprint solution for this

#

any other attempt will result in de-sync

karmic trellis
#

😕 ok thanx

upbeat basin
#

Is ChecksumMismatch (and disconnection of client) happens only when a confliction happens? We were able to fully experience main menu in two different game versions but one got kicked after server travelling to game level due to ChecksumMismatch. Do I need to manually check if the versions are same to prevent players get into same lobby if they have different versions?

twin vessel
#

Im having issues with my respawn system.

What i do is:
From the respawn function in the game mode i call:

Character->Destroy()
RestartPlayerAtPlayerStart(Controller, PlayerStart)```
After respawning, i want to update the HUD (the following is for clients):
so in `MyCharacter::OnRep_PlayerState`, i call a `MyHud::InitHud` function with as parameters the player controller and the player state.

The problem is that if i try to get the character from the player controller in `InitHud`, it fails.

When the client first spawn at the start of the game, everything goes smoothly
twin juniper
chrome bay
#

That's what it does, replicates the movement/physics/transform

twin juniper
#

bReplicates seems to also replicate the transform tho

chrome bay
#

You need both

#

bReplicates will set the initial transform only when it's spawned, as part of the spawning packet

#

bReplicatesMovement takes care of actual movement replication

twin juniper
#

so for instance, a static bullet that never moves would be good by using only bReplicates, and a moving bullet should have both of them enabled. Right?

chrome bay
#

Basically bReplicates for any replication at all

#

bReplicatesMovement if you actually want transform updates

twin juniper
#

Thanks!

lament flax
#

any reasons why onrep function wont be called by engine when a array entry change ?

#

its a array of custom struct, i tried with ALWAYS but same results

#

it gets calls when i fill it and set a valid ptr

#

but when i edit other members of the struct its not reping, i have a simple override of NetSerialize to do atomic replication

primal summit
#

hello again. I have a question for implementing an in game invite system. The goal is to select a player from a server list (this is a dedicated server), have a notification pop up asking if they want to accept (I have a UI for this already), and then on accepting have them teleport to the inviting player and change their character.

I have done countless hours of research and trial/error on this, but I have come up short every time. Does anyone know of a method to accomplish this (or if there exists a store package that accomplished this)?

Thank you for all of the assistance

keen adder
#

Hey, so is it possible to have some players in another level?

#

Ex: In an open world game, the server must spawn all enemies for players who go far away, and thus the server must have those areas loaded

#

But what if a player goes into another level, like indoors. Can the server also somehow load that level in order to spawn the enemies?

#

Or should that level be hidden somewhere within the same world?

verbal ice
#

It would have to be in the same world

#

The engine doesn't support having different levels for diffferent players

keen adder
#

Ah, so if it's an infinite world, there's not really much space to spawn these in

#

So does that mean it'll have to spawn like, 1000 ft lower or something?

verbal ice
#

Sounds like you're gonna have to get creative ^^

#

Possibly

keen adder
#

lol

#

alright, thanks for the info man

#

will prob spawn lower or higher, and render everything else invisible

lusty sky
tough knoll
#

does anyone know why me and a anouther person game crashes when i load a new level

lament flax
woven bramble
#

There is a box inside the AI character. My goal is to hide the mesh of the AI character only for the character that triggers this box.
(Run on owning client or is locally controlled did not work, or I did it wrong...)

verbal ice
#

Sanity check, does a rep notify get called for an unmapped actor reference on a client?

#

Or does the engine wait for the actor to be mapped before calling the notify?

#

It's just a UPROPERTY(ReplicatedUsing = ...) AActor* SomeActor; not a struct containing an actor reference

ripe lotus
#

Anyone knows why a replicated actor component would only trigger netmulticast reliable but not unreliable? also variables don't trigger the onrep.
i have no special settings in the project and neither have i overriden any of the network relevancy related functions.
im on c++.

lament flax
#

Also for the onrep, are you in BO or c++ ? What type is the var, are you sure you are setting its value on server (and its a new one)

ripe lotus
ripe lotus
dark edge
#

is locally controlled on otheractor will work.

#

You'll have to cast it to at least Pawn

lament flax
#

Sounds like design flaw

lament flax
ripe lotus
#

i have other actors that replicate variables and have rpc and they work fine. but not this component.

lament flax
ripe lotus
lament flax
#

I cant help with no code snippets

#

This is all your interpretations

lament flax
ripe lotus
#

i see. i cant share due to contract.
i was wondering if anyone had any idea of why this things happen, thanks anyway.

upbeat jolt
#

Hey guys, does this bind event node get replicated? Or do we have to encapsulate it inside of a ServerRPC in order to bind it on all clients? "BINDED" get's called on both server and client but the "play montage" print string only gets called on the server.

lost inlet
#

no

ripe lotus
lament flax
#

So for example only server or client side

#

But you can bind them in each side

#

This means calling the broadcast on each

upbeat jolt
#

If I call it on server and owning client, how will the other clients be updated then?

#

the context is we are trying to replicate an anim montage

#

so we are trying to locally broadcast a delegate which will trigger the anim montage on each client

lament flax
#

I guess

upbeat jolt
#

ok so I have to multicast the subscribtion then?

lament flax
#

Well if you want all clients to get it you need to bind locally on all

#

And broadcast with multicast/onrep var once

upbeat jolt
#

hmm ok I think im starting to understand

#

thanks so much! let me go try to act on this advice 😄

rustic sable
# short arrow I was bored so I thought I'd whip up an example, this is how framerate effects o...

hey just wanted to share my findings on this. Not sure if the fps is running differently on the dedicated server but since notifies get 'qued' they can get missed when things are happening fast. This is especially problematic with something like a enabling colliders on melee weapons. Besides the usual suspects which I already had: Visibility based anim tick option' set to Always tick pose and refresh bones on the mesh and the notify set to trigger on dedicated server You also need to use branch point for the montage tick type. You can only have one of these per frame but it ensures that it triggers reliably. Thanks for the help on this!

brazen anvil
#

If I call a server RPC, does that thread that called it wait for a response or acknowledge of some sort before it continues?

rustic sable
#

no you would have to set up a delegate

#

an onrep might work in some cases

twin vessel
#

To make a death + respawn system, would it be better to destroy the character and then make a new one, or to hide the character till respawn, and just reset stuff like health and similar?

rustic sable
#

I feel like the engine is more designed to unpossess the previous character and possess the new one.

dark parcel
midnight palm
#

The more I digg into the code, the less I understand the documentation. And only for player movement replication 😦

verbal ice
dark parcel
#

Reference replicated on who?

#

When someone says something is replicated on client, it means it has arrived on client.

#

Rep notify in cpp for clients gets called when the value is updated

verbal ice
#

In certain cases rep notifies can get called with an unmapped object

#

i.e. object reference in an array or struct

#

Wondering if the same applies to my case

#

Engine code says possibly not

#

But I'm not entirely sure

mellow lava
verbal ice
#

RPCs do not work in objects that arent replicated

#

@ripe lotus send code

ripe lotus
ripe lotus
verbal ice
#

Oh I mean it's sorted anyway ^^

ripe lotus
#

thanks for the help anyway :) i really appreciate it.

verbal ice
#

Interesting though. Probably has to do with unreliable multicast RPCs being routed differently, I'm intrigued now hah

mellow lava
quiet yarrow
nova wasp
#

could force the actor to be net dirty when the new player joins

lament flax
#

any reasons why onrep function wont be called by engine when a array entry change ?
its a array of custom struct, i tried with ALWAYS but same results
i have a simple override of NetSerialize to do atomic replication in the struct
the struct has multiple members like a UObject ptr and a uint8
the OnRep gets called in some situations like: filling the array, setting the UObject ptr to a valid one, increasing the uint8 var, but not when i decrease it

chrome bay
chrome bay
#

OnRep only gets called (by default) if the received value is different from your local value. Otherwise it skips.

lament flax
#

even with REPNOTIFY_Always it doesnt get called

chrome bay
#

It's not being sent then most likely

#

So Server might think you already have that value, or you have a serialization error etc.

verbal ice
#

Might just have to try and whip up a scenario where I can test that otherwise heh

lament flax
#

im setting the Ops to

upbeat basin
#

I'm getting PostLogin before the GameMode::BeginPlay for the listen server. Is this a constant order or is it open to change?

lament flax
#

well if the player joins later he can call PostLogin after the begin play

#

so no order

verbal ice
#

Since there's no latency related issues

#

I'd check what calls BeginPlay on the server

#

The gamemode handles that differently afaik

crystal palm
#

Hello , I'm Learning multiplayer
And i'm stuck badly
i will aprecicate if someone help me out 🙂

short arrow
#

upon pressing left click -> check if there's a blocking hit -> SpawnRunOnServer(HitLocation) -> SpawnActor

crystal palm
crystal palm
short arrow
#

waste of bandwith, that stuff doesn't grow on tree's! 😛

river shore
#

For some reason my button turns twice even though the function which does set the rotation isn´t called twice. Replicate Movement is also turned of but the Server still replicates the rotation down to the first client somehow. (The button is its own child actor attached to the Terminal, When not attached the button works fine without this error). is there some check box I forgot or what am I missing? Thanks for any help 🙏

river shore
# soft relic show the code
void ATerminalButton::OnInteract(UPrimitiveComponent* HitComponent, APlayerController* PlayerController)
{
    if(HasAuthority())
    {
        bIsRotated = !bIsRotated;
        MARK_PROPERTY_DIRTY_FROM_NAME(ThisClass, bIsRotated, this);
        StartRot();
    }
    else
    {
        bIsRotated = !bIsRotated;
        StartRot();
    }
}

void ATerminalButton::OnRep_ButtonRot()
{
    StartRot();
}

void ATerminalButton::StartRot()
{
    if(bIsRotated)
    {
        UpdateButtonTimeline->Play();
    }
    else
    {
        UpdateButtonTimeline->Reverse();
    }
}

void ATerminalButton::UpdateRot(float Alpha)
{
    const FRotator NewRot = FMath::Lerp(CloseAngle, OpenAngle, Alpha);
    this->SetActorRotation(NewRot);
}

Interface is one time called by the local client and also but the server(if server intercats only once)

rain slate
#

Hey guys I can't understand where my replication is failing :
Ce first screen is my playerstate, and the second is my player controller who updates my playerstate boolean, but i don't see the logs being printed
Especially this one :
UE_LOG(LogTemp, Log, TEXT("HANDLEPLAYERREADYSTATUSCHANGED"));

bitter robin
bitter robin
#

That check of yours probably belongs at the same place you set bIsReady

rain slate
bitter robin
#

Yes, because right now you are doing it on repnotify which happens on the client, which then obviously fails the if

rain slate
#

So i'm suppose to run repnotify on the server directly ?

bitter robin
#

No? there is no need for a repnotify there at all, but you could, I suppose. It makes little sense though since the client side of it will always fail.

rain slate
river shore
bitter robin
river shore
bitter robin
#

That said, if you just want to have like ready checks or whatever by peoples names you can just read their playerstates, and if you want to then start a countdown or something to start the game that would just be initiated by the server and replicated via the gamestate as either just a bool or timer, or rpc or something..

river shore
river shore
bitter robin
river shore
bitter robin
#

Just removing the entire else

river shore
#

ah

#

yeah ok

river shore
bitter robin
#

I'd probably just add them in StartRot()

river shore
bitter robin
#

Oh, I meant you just manually add such a thing.

#

That said, if I were to do it I'd go all the way and just manually rotate the button and only have bRotate act as desired direction, and manually rotate further on the client side so if you click fast or click halfway through it doesnt do work things. 🤷‍♂️

river shore
# bitter robin That said, if I were to do it I'd go all the way and just manually rotate the bu...

yeah thats the way I wanted to do it
thats why I added the replnotify condition

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

    //Set up the params for the replication
    FDoRepLifetimeParams RepParams;
    RepParams.bIsPushBased = true;
    RepParams.RepNotifyCondition = REPNOTIFY_OnChanged;
    RepParams.Condition = COND_None;
    
    DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, bIsRotated, RepParams);
}
river shore
soft relic
#

Yeah ideally you never use replicate movement for just a rotating button. Have you debugged whether the StartRot only calls once for each machine (server and client)?

#

also trying removing the else condition from the HasAuthority just for testing purposes

#

It is possible the client Rotates it, then the server changes the rep notify variable which then triggers another Rep Notify on the client, essentially re-rotating it again

#

And make sure Replicates is true bt replicate movement is false

river shore
river shore
river shore
soft relic
#

one is by rep notify and the other from your else condition

river shore
river shore
river shore
soft relic
#

test with 2 players first, but isnt it intended? One should be server, and then once for each client

river shore
#

Thats why when I place the button normally everythign works fine

#

like the replication network prediction, no issues at all

#

But the moment I attach it to some kind of actor (even a blank one) it replcates the rotation like replciate movement is enables

soft relic
#

which means its something wrong with the code OR theres some bug

#

I do know that you should never use child actors especially when replicating stuff

#

so you better try that without a child actor and it will most likely solve itself

soft relic
#

Cause they are buggy, and often have replication issues as well. At least thats my experience with them and I was always able to solve them when simply using direct actors

#

you can attach it in the world outliner instead

#

or spawn in via its parent BP and attach manually via code

#

If child actor is the issue, I really wouldnt bother investigating it since child actors are horrible

river shore
soft relic
#

Attached is different from child actors

river shore
dark edge
kindred widget
#

Should go in the playerstate regardless, IMO. Just don't replicate it if you want it private. Cause someone's gonna want that shit shown, then not shown, then shown again repeat 500x before game releases. And I'd rather click the Replicated checkbox and remove it from UI code than have to constantly move it back and forth between Controller and PlayerState. It's the state of the player, stick it there.

twin juniper
#

I'm wonderying if that's good to do in a multiplayer game? since I want the player to be able to be replicated to everyone around

quiet yarrow
# chrome bay Doesn't make sense really, that's the point of replication. Might need to debug ...

I think you might be right, but im still getting the same results. I sorta narrowed it down tho. So if the ball is part of the world spawn, it doesn't replicate new position if moved by a client when the new client joins late. (The late client only sees the actors origin location)

However, when a client moves a server spawned in actor that isnt world spawned that actors location is always replicated correctly even if a new client joins late. So im sorta confused why that is...

#

when the world begins are the actors spawned by server?

brazen anvil
#

I have a question related to multiplayer. Lets say I want to equip a item. When I equip this item I have to change my players pose. How would I handle the changing of the character pose? Assuming the networking for the weapon is already setup and replicated. Would I do a client RPC telling the client to change the pose? Would I set the pose to a replicated variable? If I send a RPC do I have to do a multicast for other players so they can see the change?

dark edge
#

just replicate held item and the rest is dependent on that

#

ItemI'mHolding (replicated, repnotify)

brazen anvil
#

Yeah thats what I was thinking except my current setup doesn't have a concept of a 'ItemImHolding'. Basically I have containers. Each container has a rule for what item goes in it. So if I create a container as primary and a container as secondary I don't exactly have a way of determining which one is held. I guess I would need to replicate something that says which container is the "helditem" container?

tired current
#

how would i go about replicating a state change in an animation blueprint?

dark edge
#

The anim bp should be dependent on some replicated state elsewhere.

tired current
# dark edge Dont

so for example should I be reading the state of my player in its animBP on tick to update the animBP's state? or is there a more optimized way to do it not on tick?

soft relic
#

It would be exactly like that, dont be afraid to use tick

#

But ideally do cast on Animation Init to your custom character bp and save its reference in a variable which you can access from tick

twin juniper
thin stratus
#

You don't need to enable that for the component to exist on the clients

twin juniper
#

yea that fixed the problem!

ripe lotus
#

anyone knows if there's a simple way to do a client-side animation/tween when an actor stops being relevant? (other than manually rpc and animate)
Im trying to avoid the pop in/out. I have a custom isnetrevelantFor.

dark edge
woeful frigate
#

Is there a good way to encode a specific asset class, such as UCurveFloat as a small integer for networking from server to client? Does Unreal have a way to keep all assets of a certain class in a deterministic array?

dark edge
#

how big do you think a pointer is

#

Unless you're talking about some runtime-defined curve, in which case you'd probably have to compress it yourself. But it can't be that big, a curve can be tiny, it's basically just the keyframes

sinful tree
#

It's something like 40-80 bytes the first time an asset is referenced across the network, then it's like 4 bytes after that.

left marsh
#

Hello. I am updating an old project from 4.24 to 4.25. One of the changes is that Actor->bHidden is now private. But I have a field calling DOREPLIFETIME_ACTIVE_OVERRIDE(ACustomActor, this->bHidden, false); What would be the appropriate replacement macro?

#

there's a function AActor->bIsHidden() but that doesn't fit the existing macro.

kindred widget
#

It's because assets, or pointers to assets specifically are serialized as paths. But once sent once it can be mapped as such so that the client can look that back up without having to send it again.

woeful frigate
#

I'm guessing the server needs to keep a record of asset paths sent to every client and then look that up. Unreal has a system for this built-in?

sinful tree
#

I don't have a 4.25 C++ project so I can't verify if that function is available

left marsh
dark edge
#

how many bytes/s are you currently spending on this?

sinful tree
left marsh
#

The macro expects a UProperty, not just a value

woeful frigate
primal summit
#

quick question; would anyone know what would cause a client package the inability to connect to the dedicated server package? It tries to connect but times out, and the server doesn't even register the connection attempt (it shows incoming data packets but it does not respond to them)

#

the log stays blank on the server

primal summit
primal summit
# fossil spoke What does the Client log say?

[2024.10.04-02.59.11:522][784]LogNet: Browse: [server_IP, I edited this]/Game/Hunted_package_test_WP
[2024.10.04-02.59.11:522][784]LogInit: WinSock: Socket queue. Rx: 32768 (config 32768) Tx: 32768 (config 32768)
[2024.10.04-02.59.11:522][784]LogNet: Created socket for bind address: 0.0.0.0:0
[2024.10.04-02.59.11:522][784]LogNet: IpConnection_2147479956 setting maximum channels to: 32767
[2024.10.04-02.59.11:522][784]PacketHandlerLog: Loaded PacketHandler component: Engine.EngineHandlerComponentFactory (StatelessConnectHandlerComponent)
[2024.10.04-02.59.11:523][784]LogHandshake: Stateless Handshake: NetDriverDefinition 'GameNetDriver' CachedClientID: 2
[2024.10.04-02.59.11:523][784]LogNet: Game client on port 24015, rate 100000
[2024.10.04-02.59.21:523][464]LogNet: Initial Connect Diagnostics: Sent '9' packets in last '10.002254' seconds, no packets received yet.
[2024.10.04-02.59.26:441][799]LogStreaming: Display: 0.002 ms for processing 83 objects in RemoveUnreachableObjects(Queued=0, Async=0). Removed 3 (1010->1007) packages and 3 (2264->2261) public exports.
[2024.10.04-02.59.31:525][144]LogNet: Initial Connect Diagnostics: Sent '10' packets in last '10.001858' seconds, no packets received yet.
[2024.10.04-02.59.31:539][145]LogNet: Warning: UNetConnection::Tick: Connection TIMED OUT. Closing connection.. Elapsed: 20.00, Real: 20.00, Good: 20.00, DriverTime: 20.02, Threshold: 20.00, [UNetConnection] RemoteAddr: [server_IP, I edited this too], Name: IpConnection_2147479956, Driver: PendingNetDriver IpNetDriver_2147479957, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID

#

I blanked out the server IP

fossil spoke
#

Did you port forward?

primal summit
#

As I am relatively inexperienced with development, I am unsure (tbh idk what that means exactly). I know that I am currently using a command line "open [serverID&port]" to access the server. It worked and then suddenly stopped working. I am unsure what I did to cause the issue

#

older versions worked

primal summit
#

I am working with a small indie company and am currently their ownly reliably available dev when it comes to UE5 coding work...and I still know little (think potato level skills)

vagrant grail
#

In a summary, how Pickables Objects per client are done ? Like imagine if you create a pickable coin but instead of once picked by a client it disappears for everyone, it disappears only for the one who picked it up but still there for others to pick it up too.

Like I can do all the logic of picking on the Client but it's not safe and people could cheat, so what's the right way of doing that ?

silent valley
vagrant grail
silent valley
#

Run the logic on the server on the pawn for example. You could store an array of coin indices on the pawn which the player has picked up.

#

The client code uses onrep or queries the array to decide whether the coin is visible or not.

vagrant grail
silent valley
#

Yes it's scalable, you can choose to run it on server or client or both by using HasAuthority check

#

Very unlikely that such a mechanism would be the source of bad performance in your game.

#

You could choose to do it the other way. The coin itself could store a replicated list of players that have picked it up. Easier to write but more inefficient.

vagrant grail
silent valley
vagrant grail
silent valley
vagrant grail
silent valley
#

The easiest for you would probably be the second. So in the BP for the coin you have a replicated array of pawn references.

Use a HasAuthority node in On Collide so it runs only on server, and add the colliding pawn reference to the array.

Setup OnRep for the array, and if the array contains a ref to the local pawn, hide it on that client.

Something like that anyway.

vagrant grail
silent valley
#

Yes that's why you check if the local pawn ref is in the array. Only hide it if that is true.

vagrant grail
#

I'm not sure to understand, because hiding it if the local pawn ref is in the array will still hide it for everyone

silent valley
#

No...

vagrant grail
#

I think I'm missing something 🤔

#

Like to me the presence of the player ref in an array doesn't make it hide automatically only for him, there's a middle step I'm missing that makes it hidden only for him

#

like the logic part

silent valley
#

Each client runs onrep themselves. So say there's 2 clients and a dedicated server.

The server adds C1 to the array.

C1 onrep runs and he sees that his local ref is in the array so he hides it.

C2 onrep runs and his pawn is not in the list so it stays visible.

vagrant grail
#

how does it "see" that his ref is in the array ? Like wouldn't that array be on the server, while the OnRep will execute on the client ?

#

Like how would the server communicate that info to the server ? Through RPC ?

silent valley
#

The array is replicated.

#

I think you might need to understand the basics a bit more before trying something like this.

vagrant grail
#

but it feels like it's not the best way in terms of networking as a replicated array is alot even more when there will be multiple of the object / coin spawner 🤔

silent valley
#

Yes like I said its more efficient to store a list of coins that are picked up on each pawn itself. And make sure the array is replicated to owner only. But it's more complicated and I can't explain in detail how to achieve it.

#

But... don't worry about approach 2, it is not terrible. And it's easier to write and easier to extend too.

vagrant grail
vagrant grail
silent valley
silent valley
vagrant grail
vagrant grail
silent valley
vagrant grail
verbal ice
#

There's no best one

#

It all depends on your game and its requirements

#

You could spend months working on one with little benefit over one you'd make in a few hours or days if your project doesn't need it

vagrant grail
verbal ice
#

Googled it real quick, I am now

vagrant grail
verbal ice
#

Make one that fits your needs, and if issues arise in the future, fix it then

#

That device seems pretty simple to me

vagrant grail
#

Like for instance for that device, what do you think Epic Games went for in terms of way of doing it and optimizations, etc...

verbal ice
#

Doesn't change what I said. Your needs are a flexible device that could suit multiple game types.

#

Don't worry about optimization until it becomes an issue. Apply what you know while writing it, don't spend too much time on that

vagrant grail
#

😦

verbal ice
#

Think about a few things you think creators would like with your item spawner. They can always request new things in the future

#

An item spawner really shouldn't be super complicated

#

The server spawns an item. You can have settings on it that change how that item is spawned. That's pretty much it

#

It technically doesn't even need to replicate if the item itself is replicated. Depends on the data your spawner needs to send to clients, if any.

#

And again, depends on your game, we don't know everything you know about it

vagrant grail
#

Yes an no, like for instance I'm already doing that on a UGC plateform but it's very limited so i want to do the same but in Unreal where there's no limit in tools

vagrant grail
# verbal ice And again, depends on your game, we don't know everything you know about it

Again, I'm not doing that for a game (as I don't have any game), I'm just trying to create a general set of components / devices for me (and maybe people later if I sell it on the marketplace) to create multiplayer games of any type by just putting those devices in the world and changing the settings to fit their needs.

Like my goal is to recreate this big "easy to use" framework to create multiplayer experience by writing as few lines of code as possible and changing only properties to fit your needs.

I hope it's clearer with this now 🙂

verbal ice
#

Different games are built differently with different needs, you can't really create a one-size-fits-all solution. Make your product, sell it, and your customers will then ask you for additions if they need

#

This channel can't build your product for you. If you hit an issue while building it, ask away

vagrant grail
verbal ice
#

Not really

vagrant grail
#

how ?

verbal ice
#

UEFN mods are just mods. Fortnite's solution fits Fortnite, which mods are just built on top of

#

Games are wildly different

#

All UEFN mods share the same base - Fortnite

#

Games share the same engine, but that's it. They don't have any other similarities.

#

So while Fortnite's solutions fit all UEFN mods, because they share the same base, they wouldn't fit other games.

vagrant grail
#

And that's what I want too 🥲 That's why I'm asking for that Object Spawner, what would be the best choice (like if you were Epic Games and created that in that context), what approach would you take between having an array on the Coin Spawner and having and array on the player controller 🤔

verbal ice
#

An array of what

silent valley
#

If you want it to be simple for people to use, keep the logic contained in the spawner only.

#

the other approach would require users to modify their pawn class

vagrant grail
#

On the Spawner : An array of all the players in the game who picked up the object
On the Controller : An array of all the objects the player picked up

Like the goal here is to create an object spawner that can be picked up by everyone, and once picked by someone it disappears only for him and other people still can come pick it up for them

dark parcel
#

Why does the client need to hold any reference

#

One way is to spawn on server, then spawn on respective client locally

#

So the client's one is just for visual

#

Server checks when the collision happend on its machine. And just tell the owner of the colliding pawn to delete its version of the coin.

#

I dunnoe if that fits a system, sounds like something specific to game type or use cases

#

Maybe it's just me but one of the reason why I avoid plugins, especially the ones like quest manager or dialogue is they are not catered to my use case.

What people say above rings true imo. Many core system are project specific. You can only get soo far trying to make something as generic as possible.

keen adder
#

Heya, can I somehow convert a replicated actor into a UUID, replicate it, and then convert it back to the proper actor?

#

Trying to reuse some code that has a float signature, but use it for passing a player, basically

#

Or I guess, there's a Player/ClientID somewhere right?

thin stratus
#

Replicating a Pointer to an Actor already replicates the Guid

#

Only the initial package has some additional information iirc

keen adder
#

Yeah but I'm reusing a big system that has a param for a float already

#

So it would be ideal to just use that. I see APlayerState has PlayerID, I guess that would be the right one to use right?

thin stratus
#

Not at all

#

PlayerId so some remnant and arbitrariy number that identifies a player during a session and is not persisted or anything. 99% of a time you don't use that number at all.

keen adder
#

Oh lol, I know they all change per session but imagined they are at least properly replicated

thin stratus
#

The NetGuid that is used to identify a replicated UObject over the net is handled by replicating pointers.

#

The float param you have is not suited for that

keen adder
#

Ah I see, and there's no way to obtain the netGUID?

thin stratus
#

You can probably get it via the PackageMap or similar. But no clue how to parse back and forth, cause one usually doesn't do that by hand.

keen adder
#

It's really just in the multicast, to see if the local player made the server call

#

Yeah true

thin stratus
#

Can't you just call the RPC in a Client-owned Actor?

#

Then you don't need to send the Player along

keen adder
#

I just deleted some of my rambling, but tldr:
I can pass the player actor through rpcs, and then check if it's local while loading my primary assets -- which is where the issue actually was with using a float, not in the RPCS. 🙂

Thanks for slapping my brain into gear eXi