#multiplayer

1 messages · Page 183 of 1

hollow eagle
#

There's one per <type of thing>. Therefore there isn't just one.

#

For a game instance subsystem there's one per game instance.

woven basin
#

or not safe?

hollow eagle
#

yes, it is safe

#

every PIE client (and server) has its own game instance that isn't shared.

woven basin
#

and that applies to all subsystems? a subsystem is a singleton only in the sense of per client, not per process?

hollow eagle
#

no, it applies relative to the thing that owns the subsystem

woven basin
bright summit
hollow eagle
#

an engine subsystem is one per engine (which might as well be a true singleton). An editor subsystem is the same - you can't have multiple editors in a single process.
But a world subsystem is per-world (well, persistent level). A local player subsystem you can have multiple of in a single PIE instance since you can have multiple players in one PIE (for splitscreen or couch coop or whatever).

hollow eagle
#

Avoid static variables and globals unless you're fine with sharing them across instances. That's the main thing to avoid.

#

Almost everything else acts normally unless you're digging into low level parts of the engine's handling of PIE.

bright summit
#

whole initialization process acts differently

hollow eagle
#

Which... is not that different for most purposes and is trivial to handle in most other circumstances.

#

If you're avoiding fixing PIE bugs you probably have bugs elsewhere, and are shooting yourself in the foot by having to launch a separate process just to test changes.

bright summit
hollow eagle
#

I mean... you should be testing packaged builds regularly anyway.

#

PIE does not substitute for real network scenarios.

bright summit
#

this is the lesson I learned

woven basin
nocturne quail
#

i have no idea what are you talking about, this is my own !virtual method and i have not deprecated it yet

hollow eagle
#

Nothing substitutes for actual playtesting. Not to mention differences in build configuration between the editor, non-editor builds, and even between debuggame/development/test/shipping.

bright summit
#

yeah, packaging the game is lottery, one time it will be successful, one time it will crash, another time editor just shutdown without any reason xD

woven basin
#

that teaches you how to run it via a command line

#

it is very simple

#

I have mine in a batch file, and it runs at 3am each morning, sending the build to my NAS

#

so I have a nightly build to refer to, and logs if it fails etc

winged badger
#

that looks like clients unloaded some classes during seamless travel that server kept loaded, leaving their NetGUIDs on its Acknowledged list

#

so server thinks client can translate NetGUID into class, client can't and that happens

#
static FAutoConsoleVariableRef CVarNetResetAckStatePostSeamlessTravel(
    TEXT("net.ResetAckStatePostSeamlessTravel"),
    GNetResetAckStatePostSeamlessTravel,
    TEXT("If 1, the server will reset the ack state of the package map after seamless travel. Increases bandwidth usage, but may resolve some issues with GUIDs not being available on clients after seamlessly traveling."),
    ECVF_Default);```
#

set that to 1, UE5.0 +

bright summit
woven basin
#

I'm guessing GEngine is just as bad?

Inside UPlayer of the default ConsoleCommand in UE5.4 - this is how Epic is getting the console :

UConsole* ViewportConsole = (GEngine->GameViewport != nullptr) ? GEngine->GameViewport->ViewportConsole : nullptr;

So that reference to GEngine is probably the issue?

hollow eagle
#

GEngine isn't bad. There's only one engine in a process, period.
GWorld is bad because there are multiple worlds in a process.

#

Assuming GEngine->GameViewport is the only/primary/expected viewport is bad, but GEngine itself isn't the problem here.

winged badger
#

bonus points if you start juggling worlds during PIE session

woven basin
#
if (PlayerController && PlayerController->GetWorld() && PlayerController->GetWorld()->GetGameViewport() && PlayerController->GetWorld()->GetGameViewport()->ViewportConsole)
    {
        ViewportConsole = PlayerController->GetWorld()->GetGameViewport()->ViewportConsole;
    }
    else
    {
        ViewportConsole = (GEngine->GameViewport != nullptr) ? GEngine->GameViewport->ViewportConsole : nullptr;
    }

I just modified the engine source to this, and its resolved the problem.

i.e. if the UPlayer already has a reference to PlayerController, then just use that to get the correct viewport.

#

otherwise fallback to GEngine.

#

Just tested - problem solved

winged badger
#

that feels wrong

woven basin
#

I appreciate you (and Epic) are probably correct over my lower knowledge. I'm 100% open to an alternative or another approach

winged badger
#

still trying to find what your original problem was

woven basin
#

@winged badger

#

console commands from one client show as output on another client when running under one process.

#

that is the problem I was trying to solve

winged badger
#

ah, i always just ignored that

#

PIE testing single process has more then 1 caveat

#

especially if you expect anything static to have its own value on each client

woven basin
#

yep - which silex and Snaps etc were helpful to point out earlier

winged badger
#

it is good for the first round of tests

woven basin
#

I'm not trying to do anything 'static' - its more how Epic had the console using that static that was tripping me up

#

I've modified my source so I can include Console in my shipping build, and it whitelists the commands I want, rather than allowing all the engine content stuff. So hence trying to test some thing in console.

winged badger
#

including late join tests

#

i would assume there is a way to do that without modifying the engine

#

which is always a last resort - pain in the arse to maintain

woven basin
#

I'm using a source for something else, so splitting the function made it easier

#

but otherwise trying to keep it as close as possible to prevent issues later - yep

bright summit
#

when I was beginning with MP on UE5 I was wondering why the heck AddOnScreenDebugMessage displays on every client, so debug printing was also the problem while testing in single process

feral narwhal
#

anyone know why the data variable isn't being replicated to client actor?

winged badger
#

you didnt set the Data property to replicate?

feral narwhal
#

no I already have it set to replicate in the actor

#

I even tested in the actor's begin play, on the server the data is recieved there fine but on the client its empty

winged badger
#

did you rename the property after you set it to replicate?

feral narwhal
#

no

#

its weird because, on the server it works okay but when the client spawns the item the data is also not recieved

#

so no matter what the client never gets the data

winged badger
#

try setting the data after actor is spawned

#

this is blueprint networking, and it has its weird caveats, c++ code doing the same would orderly replciate

feral narwhal
#

so just updating the data with rpcs in the character who spawned it?

bright summit
#

hmmm

void ABasePlayerController::Local_ChangeSpectateCamera()
{
    if (!GetSpectatorPawn())
        return;

    bIsSpectatingFreeRoam = !bIsSpectatingFreeRoam;

    if (bIsSpectatingFreeRoam)
    {
        GetBaseSpectator()->bIsFreeRoam = bIsSpectatingFreeRoam;

        if (GetMainHUD())
        {
            GetMainHUD()->GetSpectatorHUDInstance()->DisplaySpectatingPlayerInfo(false);
            GetBaseSpectator()->EnableChaseCamera(false);
        }
        
        GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Red, TEXT("ChangeSpectateCamera to FreeRoam"));
    }
    else
    {
        GetBaseSpectator()->bIsFreeRoam = bIsSpectatingFreeRoam;
        GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Red, TEXT("ChangeSpectateCamera to ChaseCamera"));

        if (GetMainHUD())
        {
            GetMainHUD()->GetSpectatorHUDInstance()->DisplaySpectatingPlayerInfo(true);
            GetBaseSpectator()->EnableChaseCamera(true);
        }


        // TODO: Make it nicer to switching to a player to spectate
        Server_SpectateNext();
        if (!CurrentSpectatedPlayer)
            Server_SpectatePrevious();
    }
}```

My camera is not switching for "chase camera" (just simply thirdperson view for spectating players). It's executed locally via PlayerController

```cpp

void ABasePlayerController::Local_ChangeSpectateCamera()
{
    if (!GetSpectatorPawn())
        return;

    bIsSpectatingFreeRoam = !bIsSpectatingFreeRoam;

    if (bIsSpectatingFreeRoam)
    {
        GetBaseSpectator()->bIsFreeRoam = bIsSpectatingFreeRoam;

        if (GetMainHUD())
        {
            GetMainHUD()->GetSpectatorHUDInstance()->DisplaySpectatingPlayerInfo(false);
            GetBaseSpectator()->EnableChaseCamera(false);
        }
        
        GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Red, TEXT("ChangeSpectateCamera to FreeRoam"));
    }
    else
    {
        GetBaseSpectator()->bIsFreeRoam = bIsSpectatingFreeRoam;
        GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Red, TEXT("ChangeSpectateCamera to ChaseCamera"));

        if (GetMainHUD())
        {
            GetMainHUD()->GetSpectatorHUDInstance()->DisplaySpectatingPlayerInfo(true);
            GetBaseSpectator()->EnableChaseCamera(true);
        }


        // TODO: Make it nicer to switching to a player to spectate
        Server_SpectateNext();
        if (!CurrentSpectatedPlayer)
            Server_SpectatePrevious();
    }
}

Ignore pls that mess in code. it is executing on local clients because debug prints are printing correctly but camera is not switching to that active one. Ofc course on server it works xD what am I missing?

hybrid pecan
#

When creating a lobby from the main menu, should it be done in the same level or a whole new level?

feral narwhal
dark parcel
#

You can if you write the code your self

#

Infact someone already done it in market place

#

Not even that expensive and save you time if it's that important to replicate textures

feral narwhal
#

yeah, im taking a picture on one device then sending that over to all clients. But now im wondering if it would be less expensive to just send a notify everyone to take a screenshot from the same position in game

dark parcel
#

They are probably not guaranteed to see the same thing

winged badger
#

that assumes that they would see the same thing

dark parcel
#

Pros and cons

feral narwhal
#

yeah

#

is it that expensive to send textures every once in a while?

sinful tree
#

Depends on how big the texture is.

feral narwhal
#

just 128x128

winged badger
#

single channel?

feral narwhal
winged badger
#

you can send an array of bytes and rebuild

#

on clients

feral narwhal
#

on c++ of course?

winged badger
#

blueprint should be able to do that too

#

you should be able to create a render target from that data

feral narwhal
#

im looking into it, but seems like a hassle to convert the texture to bytes without a plugin no?

winged badger
#

it would just be pulling data from the mip, converting it to uint8 and populating the array... in c++

#

i would imagine a function to get data would exist exposed to blueprints, but i've never had a use for it

silent valley
#

FImageUtils::ExportRenderTarget2DAsPNG() looks like it would do the job, and compress it too

winged badger
#

not from blueprint

twin juniper
#

If I want to move character (Set World Transform), and need to do it on server, can I do it ONLY on server, and not do it on the client? Seems to work but wondering if there are any drawbacks to this

#

And as a general question too, can I do certain actions on client owned actors ONLY on server, if I don't care about the action's latency?

#

Like usually for example when sprinting, you call the sprint function both on the client, and on the server, so that there is no latency. But if the action is important, one-time, and so I don't care about latency, what are the drawbacks of calling only on server

sinful tree
#

You can do whatever you want on the server without doing it on the client, however, not everything is replicated automatically to the clients.

twin juniper
#

Got it, thanks

sinful tree
#

A drawback of having the server always be the authority of everything is that you're then introducing a poor experience for players - If I press my trigger button on my gun, I'd rather it feel that it actually triggered immediately when I clicked rather than wait for the server to tell me that I fired a moment later because I had to wait for the server to say it was ok to do so and that I'm seeing what the server saw.

sour dragon
#

Hello, how does a Event Node know who the Owning Client is by default? If i run a Event with (Execute on Owning Client) in my FirstPersonCharacterBP, is the owning client the client that this FirstPersonCharacterBP request came from?

sour dragon
#

So for example, how is it determined here who the owner is ?

timid galleon
#

Hello, please help me, I use Steam multiplayer in my game, I need to organize a system for getting the current sequence time from the server (I create a server in my game, start the sequence, then after starting the server, the player joins, and I need to make a system that will automatically access my game (server), receive information about whether the sequence is running, if so, the client's game automatically receives the current sequence time on the server) if someone knows how to do this, please describe in detail

short arrow
short arrow
# timid galleon i tried this

the simplest way is to have the client request the time from the server, then the server will send back the time, from there you play at that time

#

I'll show you an example

timid galleon
short arrow
#

is the level sequence player playing anything at all?

timid galleon
short arrow
#

client might not be finished setting up before you've sent the information

#

add a delay to the onpost login to test and see if that's the case

lost inlet
#

hey it's this blueprint again

#

which has RPCs on the gamemode for some reason

ashen plume
#

question about function replication internals, bear with me here...
an abstract actor class has an event set to replicate, a child actor class then adds a call to the parent, does the resulting child call then cause two replications? or does blueprint know to handle this as one replication?

short arrow
timid galleon
short arrow
#

The simplest place would be your third person character

lament flax
twin juniper
#

50 % of the time if I try to test a multiplayer game with a listen server and a few clients, as soon as I press f8 (to eject from one window and start controlling another), unreal crashes with this:
Assertion Failed: !GIsPlayInEditorWorld

#

Any ideas?

hardy turtle
#

hey guys, what would be the best practice to get two players to connect to the same session that the host finds?

bright summit
#

when on client playerstate is available ? want to assign variable in playercontroller but on beginplay it is still null. PostInitializeComponents also

bright summit
bright summit
dark parcel
#

OnRep only get called on Client in cpp

bright summit
#

I know but manually you can call it on server

#

but I don't know if UE does it

bright summit
#

if you want to OnRep function be executed on serer you must call OnRep manually but I don't know if built in OnRep_PlayerState is called on server by engine on the server or not

dark parcel
#

You don't want to call OnRep on Server

#

which is why the blueprint one is eww

bright summit
#

ok

dark parcel
#

also not sure what you mean by call on rep manually

bright summit
#

for ex

dark parcel
#

it's executed on client when something is replicated from server

bright summit
#
void ABasePlayerController::Server_SpectateNext_Implementation()
{
    CurrentSpectatedPlayerState = GetNextViewablePlayer(+1);

OnRep_CurrentSpectatedPlayerState()```
#

somebody told me here you can do it in that way if you want OnRep be called also on server

#

but if it is bad practice, ok

#

good to know then

dark parcel
#

I'm beginner in multiplayer but I don't see the point of calling OnRep on server

#

it's already the server

bright summit
#

I think it is just code organization to not repeat something twice

dark parcel
#

@bright summit nvm, I get what the code is doing

#

but be mindful of context, there are things you want to run on server and things that run on client

bright summit
#

I know

twin juniper
twin juniper
#

What things should I make in unreal to know if I understand multiplayer

magic vessel
#

I'm really stuck on how to implement this feature. Basically I want an ability where a player can see the recent footsteps of other players
My current plan is to have an AnimNotify (Basically an event you can set to trigger on a specific frame in a animation) and from that event, spawn in a new actor (game object which can be placed in the level) that has a decal to print a footstep onto the ground.

The part I'm concerned with is how to do it so that it limits the network vulnerabilities. I could do it so that the anim notify runs locally, limiting the bandwidth required with sending a lot of duplicate data, and have it so that the decals only spawn in if the player has a certain gameplay effect active, but that would technically mean the ability is client side authoratitive, which is bad. Server side means that I'm using a lot more bandwidth, but there is some authentication taking place

#

Maybe if I keep track of the anim notify data on the Game Mode so that only the Server has the data at any given point. Then when the gameplay effect is active, it simply subscribes to the event to receive this data as it is populated. When it is received, it adds it to a component on the Player Controller which replicates down to the client to spawn in the decal locally

magic vessel
# twin juniper What things should I make in unreal to know if I understand multiplayer

Maybe try making an inventory system? It is a requirement for a lot of games, will teach how you handle things like server side authentication of items, replicating data to clients, how to send Client->Server RPCs, and there are already a few examples on YouTube on how to make it for singleplayer so you don't really have to come up with a lot of the logic. Although you will need to learn where to place each piece of logic

twin juniper
#

When I launch multiple windows for sessions (1 listen server, 3 clients for example), how do I switch between windows?

#

Other than f8

#

wasn't there some other shortcut?

magic vessel
#

Alt+Tab

neon summit
#

or shift + F1

twin juniper
#

I have my player character set to replicate but we don't see it when multiple clients are playing... It just seems that the character is invisible

twin juniper
#

r

neon summit
#

Can anyone give me on advice for best way to make the chaos wheeled vehicle pawn's mesh to explode? Currently I'm doing it like this which works but would like someones perspective the best way to do this. Specifically handling hiding the pawn mesh and spawning the collection for explosion

ember jasper
#

@whole iron
Hey !
No problem ! I managed to make it working yeah and it wasn't an easy deal until I put my hands on a MarketPlace Plugin.
I don't know if I'm allowed to promote a plugin on this channel but we can continue this conversation in private 🙂

calm barn
#

Hey guys! Can someone tell me where the event for timeout is? I can't find it!

I want a player to join via IP, but if there's no server I want it to fail after 10 seconds and have an event for that.

I've tried the Event NetworkError from the GameInstance, but nothing

Thanks in advance for the answers 🙏

worthy oak
calm barn
#

Well, both of these never trigger it seems

#

And the log is showing to me this message every 10 seconds : LogNet: Initial Connect Diagnostics: Sent '9' packets in last '10.215907' seconds, no packets received yet. (but with slightly different values each time)

#

Are you doing it in your project @worthy oak?

worthy oak
calm barn
#

It's been running for >5 minutes now, still no timeout

calm barn
worthy oak
calm barn
#

Okay, thank you for your time.

shadow aurora
#

Got sort of a weird issue here if I put my camera into free-movement mode where it can rotate all the way around the pawn. If I then rotate my camera to face the front of the pawn and hit D, the client and server are disagreeing on what direction the pawn is moving which is causing jitter. I imagine it's something to do with the server not knowing about the camera rotation or something, but I'm not sure exactly what the issue is.

Anyone have any suggestions?

sour dragon
#

Can someone tell me why the print string does not fire when i use a "Run on Server" node when the previous code is a Interface Call?

shadow aurora
sour dragon
#

Yeah, i just figured that out, had to run the previous code on the server, but im still not sure as WHY the server can't call at least the print string

shadow aurora
sour dragon
#

That actually makes a lot of sense

shadow aurora
#

You could try changing it to a NetMulticast instead for a quick test

mystic estuary
#

Hello, I've got PS5 build running, but it fails to connect to my dedicated server (it works fine for PC). After I do OpenMap, it says

[2024.05.24-17.12.34:395][576]LogNet: UIpConnection::HandleSocketSendResult: Socket->SendTo failed with error 21 (SE_EADDRNOTAVAIL). [UNetConnection] RemoteAddr: *our public IP address*, Name: IpConnection_2147482369, Driver: PendingNetDriver SonyNetDriver_2147482370, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID Connection beginning close timeout (Timeout = 5.000000).
[2024.05.24-17.12.39:400][876]LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionLost, ErrorString = UIpNetConnection::HandleSocketSendResult: Socket->SendTo failed with error 21 (SE_EADDRNOTAVAIL). [UNetConnection] RemoteAddr: *our public IP address*, Name: IpConnection_2147482369, Driver: PendingNetDriver SonyNetDriver_2147482370, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID Connection will be closed during next Tick()!, Driver = PendingNetDriver SonyNetDriver_2147482370
[2024.05.24-17.12.39:400][876]LogNet: Warning: Network Failure: PendingNetDriver[ConnectionLost]: UIpNetConnection::HandleSocketSendResult: Socket->SendTo failed with error 21 (SE_EADDRNOTAVAIL). [UNetConnection] RemoteAddr: *our public IP address*, Name: IpConnection_2147482369, Driver: PendingNetDriver SonyNetDriver_2147482370, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID Connection will be closed during next Tick()!
[2024.05.24-17.12.39:400][876]LogNet: NetworkFailure: ConnectionLost, Error: 'UIpNetConnection::HandleSocketSendResult: Socket->SendTo failed with error 21 (SE_EADDRNOTAVAIL). [UNetConnection] RemoteAddr: *our public IP address*, Name: IpConnection_2147482369, Driver: PendingNetDriver SonyNetDriver_2147482370, IsServer: NO, PC: NULL, Owner: NULL, UniqueId: INVALID Connection will be closed during next Tick()!'
[2024.05.24-17.12.39:416][877]LogNet: Browse: /Game/login?closed

Does anyone know why it might fail?

shadow aurora
mystic estuary
#

I'm connecting to a dedicated server, the client doesn't have to be a listen server

thin stratus
#

ServerTravel is not for connecting and neither does it need ?listen

mystic estuary
#

Either way, I'm using OpenMap

shadow aurora
thin stratus
#

@mystic estuary Keep in mind that your PS5 license is under NDA, so be careful of what you share

shadow aurora
#

Mentioned the same Socket->SendTo failed with error 21 (SE_EADDRNOTAVAIL)

thin stratus
#

When you test with PC, do you use any kind of Subsystem?

#

And if you test with PS5, do you use a Subsystem for your PS5 build?

mystic estuary
#

I'm not sure about that part. Should it be under ProjectSettings config?

thin stratus
#

No, you set that up via your Ini file

#

Similar to the NetDriver

#

The main point is that there is a good chance that you can't connect to an IpNetDriver and SubsystemNULL Server from a SonyNetDriver and Playstation Subsystem

sour dragon
shadow aurora
mystic estuary
thin stratus
#

I think the UniqueNetId part only hits after connecting. This fails earlier already.

#

Especially if both builds use Subsystem NULL, then it shouldn't matter.

#

Given you have a PS license, shouldn't you have access to UDN?

#

At least to the PS part?

#

The Server here can't really help with Console due to the NDA. You should have other contact points to ask for this.

#

Sicerath is in theory not even allowed to share UDN answers.

mystic estuary
mystic estuary
thin stratus
#

Well it's clearly a Playstation issue then though, so you gotta go to the point of contact for PS and ask them what this is about and how to solve it.

hybrid pecan
#

How does one go about running a locally hosted server on a seperate process from the client? Dedicated server?

timid fox
#

Hello, I'm quite new to multiplayer and a little confused. I have a replicated actor in my game, one tile of a hex map, that contains a widget component. When any player clicks something in the widget, I want to update the tile by calling a method with a parameter on the actor. Since the tile actor is not owned by the player, a server RPC will just be dismissed. I know I should basically route this through the player controller, but that would be I always have to route all necessary payloads through the player controller to the targeted actor. That's sounds not very good, but how would I do this otherwise?

thin stratus
hybrid pecan
#

welp, that sounds fun to set up

thin stratus
#

You can route it through some Component on the PlayerController to keep it cleaner.

#

Or in other examples, if possible, simply tell the Server that you press the key to do X and the Server can then do X on its own.

thin stratus
#

But ultimately to make a Server to distribute you need the Source Engine and build with that.

timid fox
#

Ok, so I'm not completely wrong here, it's just how it is. I'll probably make a generic way to route any of my UI actions to the server. Thanks Cedric!

thin stratus
#

It's ALWAYS a very good idea to review if such a Server is needed, or if the Client can't just host on its own.

hybrid pecan
#

I suppose, It just seems to be a absolute pain in the rear to differentiate between the client and server when its on the same process

sour dragon
#

The logic i do on the server does replicate, so setting transform, spawning actors, changing rotation etc. but when i spawn a particle system it does not replicate. Now my question, does it not replicate because visual effects are not meant to be replicated by the server so its turned off, or am i missing something? Because i cant understand how the clients can see that a item gets added, can rotate etc. but then again a particle system is not visible without a multicast

thin stratus
thin stratus
sour dragon
thin stratus
#

Not really.

sour dragon
#

Great

thin stratus
#

it's very specific so either you get it by context, docs, or source code

sour dragon
#

Still thank you for your anwser 🙂

crimson ore
#

bUseOnlineServicesV2 is not ready for prime time is it?

#

It is incompatible with Steam

lament flax
#

if i want to store for each player its location history, should i use a tmap ?

#

each key of the TMap would a player Actor and the value an array of FVector

crimson ore
lament flax
#

last 1s

thin stratus
#

So something between 30 and 120+ entries per player, depending on FrameRate.

lament flax
#

without using TMap i wonder how i could allocate new array for each player and get them back.
the other way would be storing 1 array for each player actor

thin stratus
#

PlayerState?

lament flax
crimson ore
#

you could be smart about it and store only the differences with timestamps

lament flax
#

so when i have packet latency i would calculate how much should i go far in hisotry

crimson ore
#

like if player is running in straight line with constant speed you don't need to store all of it

lament flax
#

thats some extra optimising that i dont need rn 😅

thin stratus
#

Either way, put it on the PlayerState then

crimson ore
#

ye

lament flax
#

so each playerstate stores its hisotry ?

#

on server

thin stratus
#

Well yeah

lament flax
#

okay ill try that

crimson ore
#

or player character if you don't care of loseing the info when character dies

thin stratus
#

You wouldn't store the PlayerState's Location, but the PlayerState could be the place where you store it.

#

Or just on the Character directly, yeah

lament flax
crimson ore
#

tick with time substeps

lament flax
#

okay

#

now to call OnHit on server to tp all players to old location, i need to get all playerstates.
should i have the actor component that lives on the hited actor get the gamestate to do that, or should i redirect it to the gamstate and have the GS handle this

queen escarp
#

hm A replicated Static mesh

#

changing material on server

#

it dosent replicate :/?

#

materials isent replicated ?

#

cant*

thin stratus
#

No

queen escarp
#

?

#

oh ok, so has to rpc then

thin stratus
#

No

queen escarp
#

huh?

thin stratus
#

What is the Material of a StaticMesh? A one time event or State?

queen escarp
#

one time event

thin stratus
#

What if I join your game after the RPC

queen escarp
#

then it will be "default"

#

as before the rpc

thin stratus
#

Yeah, if that's what you want, then go RPC.

#

Otherwise, RepNotify

queen escarp
#

yeah gotcha, well my game u cant join once it started so it wont be a iussue for me

thin stratus
#

It's not only for late joiners

#

Relevancy also is important

queen escarp
#

hmm

thin stratus
#

The Material is part of the State of the StaticMesh

#

In most cases this should be a RepNotify

queen escarp
#

yeah i get what your saying

#

thansk

winged badger
# queen escarp yeah i get what your saying

Unreal despawns non relevant Actors that are not loaded from the package. If you were to use RPCs any non relevant Actors, as wel as Actors that became non-relevant then relevant again would be in the wrong state.

twin juniper
#

it spawns when I press play

daring wharf
#

guys hi. ı have a problem all client name the same. Why? How can ı change the name

twin juniper
soft peak
#

While I don't think anyone is following this or had ideas (or if anyone is, I missed it among the other conversation), I discovered that I was running into an engine bug that has been confirmed and will be fixed in UE 5.4.3. On dedicated servers, because the server runs single-threaded, the physics event queue is getting cleared before the events are posted to game code. PIE, multiplayer clients, and any other multithreaded contexts are unaffected and will see events.

dark parcel
#

info is available on the internet

languid gale
#

I'm wondering if anyone could point me in the right direction here, I'm slowly learning how multiplayer works, been reading up on EOS, etc. I was wondering if anyone could recommend a company for my first game server? Also, if I were to just have something small for testing, say 5-10 friends while I'm learning, what might costs be for something like that?

#

If anybody has any general tips or know of any vital tutorials as well, then please let me know

dark parcel
#

I personally go for the free option since I never released any multiplayer game and still learning.

#

which is just to host as listen server

sinful tree
#

or if you want to test a dedicated server, just host the dedicated server build on your own machine.

languid gale
#

that's a good point

twin juniper
#

why does my player doesn't replicate, It's invisible

woven basin
twin juniper
sinful tree
#

HasAuthority does not mean it's the server.

#

Authority deals more with who is responsible for the actor. If you spawn an actor locally on a client, then that client would have Authority of that actor.

#

For a replicated actor that is spawned by the server, then the server would be the authority.

twin juniper
#

understood but then, I got another problem, my player character's arm are not replicating even if they should

sinful tree
#

How are you replicating the arm?

twin juniper
#

as it should replicated

sinful tree
twin juniper
#

when the player takes a gun, the gun is located correctly on all clients and server but not the arms

#

they are just not showing

sinful tree
#

Well that's usually because the arms are "Owner Only See".

twin juniper
#

(only visible for itself, seems to not be replicated somehow)

twin juniper
#

thx

#

it's dumb but it's the default settings

#

❤️

sinful tree
#

It's a visibility setting of scene components

twin juniper
#

of rendering

twin juniper
#

How do I replicate the transform of a camera component?

#

The "replicates" on the component is checked, but the transform of it doesn't replicate to other players

#

Do I have to manually pass in transform data via events?

dark parcel
twin juniper
dark parcel
#

If it doesn't click yet, I will try to explain. What ever you do on client machine will only apply to the client machine.
If you want to send data to others, as a client your way of communicating is via Server RPC. The server can then replicate the values to other clients.

twin juniper
#

The camera component in questions is on the server...

#

Which is my question

#

Does Server automatically replicate transform, or do I have to pass it to clients via RPCs

dark parcel
#

you gotta ask first, whos sending what data and what data to follow

#

marking object as replicate doesn't magically replicate their properties

thin stratus
#

And are you moving the Location of the Camera ?

normal viper
#

I created map and I assigned Game Mode to it and Game State, if I enter the map straight when I have this level in the editor, I can see the quest widgets get updated. The info about widgets I care about is in the Game State as Actor Component, and if I enter it by Creating Session, then these widgets are not beeing shown.

rough scarab
#

skgframeworks vs lpsp for fps multiplayer game cons and pros ?

quick musk
#

is that ur post cause i just replied to it with smth that helped me

normal viper
#

If I create widget in the actor component, it doesn't replicate or what i'm doing wrong?
I have BP Resource with Actor Component Gatherable.
I create widget for the Resource inside the Component, because there I have all needed info.

When player clicks on actor (Event Select Resource in Bp Resource), then I sent interface Show Selected Resource to the Player Controller.

Turns out this only works for the server client?
The 2nd client doesn't see the widget when it clicks it. I think I tried all combinations and it only somehow started to work when I put the Create Widget logic in the BP Resource and not in the component, but I really wish I could have it in the component.

woven basin
#

widgets dont replicate

normal viper
#

So I have to create widget inside Player Controller?

#

so every player has their own?

woven basin
#

correct

normal viper
#

wow, even if there is like 1 shared thing in the level?

thin stratus
#

Doesn't need to be in the PlayerController, but you generally have to handle replicating the creation yourself.

normal viper
#

Just trying to understand. Since I have Resource in the level right. Wouldn't it make sense for the Resource to create widget of itself, and players just access it?

#

Or this is the problem that it doesn't work like that?

thin stratus
#

If it should only show for the local Client then you need to target the LocalClient via ClientRPC

#

I mean sure, but if the event that shows it is on the Server, you gotta get to the Client first

#

You are using a ServerRPC to create the Widget

#

So it's pretty normal that this only shows on the Server

#

On top of that the RPC is in AC_Gatherable, which is probably not owned by any Client

#

So Server and ClientRPCs don't really do anything anyway

normal viper
#

Okay, but even if I set it the event to not replicate, it still doesn't work. Which means that this Create Resource Widget doesn't exists anywhere? It's triggered on Event Begin Play

thin stratus
#

What calls the Create Widget stuff?

#

Ah

normal viper
thin stratus
#

so On BeginPlay of the AC_Gatherable you create the Widget?

normal viper
#

Yeah

thin stratus
#

Then the Widget should also exist for everyone

#

You should possibly not mark the Variable as Replicated

normal viper
#

I thought so, but well this doesn't work and I tried to debug it in every possible way

#

I replicated all components, blue prints that are connected here..

thin stratus
#

The Widget Variable shouldn't be replicated

#

And Variables inside of the Widget neither

#

Widgets can't even replicate themselves or inner properties.

normal viper
#

Oh wow, it works now

#

i can't...

thin stratus
#

Yeah cause the variable tried to replicate the Server Version of the Widget

#

But the Widget has no Client version mapped to it

#

So the variable locally just becomes null

normal viper
#

Wow, good to learn on what should I look next time

thin stratus
#

And the variables you have inside the Widget should also not be replicated

normal viper
#

Thank you so much

thin stratus
#

They can't replicate anyway

normal viper
#

but now you are talking about the Widget Blueprint and not the Actor Component that creates widget?

thin stratus
#

Yeah, you have a GatherableReference variable in the Widget

#

That is marked as Replicated

#

That's redundant

normal viper
#

Okaay

thin stratus
#

Widgets are local only. There is no replication ever going to happen. Widgets are meant to mostly display replidated data that is located in other classes

normal viper
#

so only the data that the widgets are taking in should be replicated

#

and widget is created on local, so doesn't make sense because everyone has their own basically

thin stratus
#

Yeah, you can take e.g. a Replicated Health Variable that is located in your Character and display that value. But you can't make a Replicated Health Variable inside the Widget.

normal viper
#

Got it. I was even more confused why it's not working because I have very similiary setup Health Bars and they were working. Probably too much panic mode and trying to click too many things that I had no idea what it ''really'' does. Thank you for claryfing it for me. I have lot's of widgets to setup and this will help me a lot.

daring wharf
dark parcel
daring wharf
#

thenks for help bro.

quick musk
#

have u tried the fix

shrewd ginkgo
#

I want person x to have a phone call feature and everyone else's phones to ring. like the dokaebi character in rainbow six siege

#

how can I do it

gaunt cypress
#

anyone know how do i import a float variable from BP_Weapon_Component to UI Widget?

#

because i cant get all actors from class

normal viper
#

create widget on the weapon, while creating widget you set reference of the weapon (where you have all variables), and then in the widget you can take that variable and get all info from the weapon

gaunt cypress
#

i dont get it

#

i got this, and the In text must be the variable from BP_Weapon_Component, but i dont know how to get the variable from the BP_Weapon_Component to the UI

dark parcel
gaunt cypress
#

oh wait

#

oh bruh i get it now

#

@dark parcel u mean like this?

shrewd ginkgo
#

how do i replicate changing the mesh of my character. when i log in to the map i want to give random appearance to all players but i couldn't replicate the set skeletal mesh. and where and how should i do the random selection part. i want to distribute 8 costumes to 8 people so that everyone will be different

dark parcel
gaunt cypress
#

i did?

#

wait u mean like code?

dark parcel
#

u didn't

gaunt cypress
#

i need to make a code? for the reference

#

in the blueprints?

normal viper
dark parcel
#

deffinitly don't use multicast if it's something that needs to be in sync

#

Just RepNotify your skeltal mesh

#

server set the random mesh, done

#

If Client -> ServerRpc -> GetRandomMeshFrom Array and Set Skeletal mesh

#

If Server -> GetRandomMeshFrom Array and Set Skeletal mesh

normal viper
#

Can someone explain me why the first client that I host with, isn't also the client itself? And it doesn't get event from Game State about quests, but then every other client that joins works normally? Also, looks like the event Quest is firing (foor loop for 2 items), but it's not shown? Any keywords what to look for?
Quest Manager is actor component of game state.

dark parcel
#

if you dump your logic in OnRep, just remember that's only get Client in cpp

normal viper
#

Can I somehow make first window to be both server and client?

#

It says here that listen server is both server and client, but why the UI doesn't get updated then also on it?

dark parcel
#

Listen Server is the Server

#

if you want every player to play as client you will need to play Stand Alone (Dedicated Server)

normal viper
#

like what is the reason that this UI is not working on the first window

dark parcel
#

can't tell from that picture alone

normal viper
#

what i'm missing that the first hosting window isn't also client ?

#

do I have to also add some logic here for the host to become player ?

#

this is Game Instance

dark parcel
#

Are you going to use Listen Server or Dedicated Server?

#

Dedicated Server = Headless, no Render on it's part

#

Listen Server = Player and render but as a Server

normal viper
#

I will use Listen Server I think, like players can host game themselves

#

if the game will be succesfull I will probably want to upgrade to dedicated servers

#

but so far I choose to go with listen server

worthy oak
#

If that’s the case your first window will always be the server and client

#

If you want to test what the game is like on a dedicated server you would set your netmode to client (not standalone)

normal viper
#

so what do I have to look into so this hosting client will also get widgets shown ?

dark parcel
#

Create widget for him?

#

widget is local to each machine

worthy oak
#

By creating the widget in the client. How are you making the widget?

normal viper
#

this is Quest Manager in the Game State

#

and this is Player COntroller

#

and when I host with the first client:

worthy oak
#

And how do you call that?

normal viper
#

and if I join with any other :

gaunt cypress
#

anyone knows what to add in the object for cast to bp_weapon_Component

normal viper
worthy oak
gaunt cypress
#

im trying to get from bp_weapon_component the float variable

#

but it wont work

worthy oak
gaunt cypress
#

its not

#

the variable is in the bp_weapon_component

#

so i need to get that variable from the compoennt to the widget

worthy oak
# normal viper

Ok so something to keep in mind here. Begin play will fire server side and client side and currently your code isn’t distinguishing a difference.

#

I would suspect that if you played with 2 clients in netmode client it would work as it’s being forced to be a client at that point. However in a listen server where one of you is the server, you need to ensure your calling the create widget nodes on the client.

#

Even if client and server in this case would be the same machine

worthy oak
gaunt cypress
#

huh

worthy oak
#

You keep saying component

gaunt cypress
#

i got an widget

#

and im tryint to get the float variable from bp_weapon_component

#

to the widget

#

so i can use the variable in the coding for the widget

worthy oak
#

Right but what is bp_weapon_component and where is it

normal viper
#

this makes sense

#

I moved the logic to the player controler to call to that component to create widget for itself

worthy oak
#

There ya go yeah thats a way to handle it 😄

gaunt cypress
#

nevermind fixed it

normal viper
#

oh god, there is so many small things to consider! 😄

#

thank you thank you thank you!

worthy oak
#

so keep that in mind before you go running server code in there

#

but that is also why its currently working for you 😄

worthy oak
dark parcel
#

you can call server rpc on your controller

#

it exist on server

worthy oak
#

Sorry let me clarify

latent heart
#

I thought PCs do replicate to their owning clients...

normal viper
#

My player controller is kinda whole brain of my player so I put a lot of logic here. Other thing I could consider is probably Pawn that player posseses or Player State (but this I'm like 5%)

latent heart
#

Because the server certainly has a copy of all of them.

worthy oak
#

bad phrasing lol

normal viper
#

each player has their own playercontroller and players don't know about any other playercontrollers basically?

latent heart
worthy oak
#

I misspoke ignore my first comment 😂

normal viper
latent heart
#

Figure that bit out.

dark parcel
#

The server have everyone's controller

latent heart
#

Everything that needs to run on each client for every other client can't be on the PC.

normal viper
#

ohh, you are trying to make me think if should I put some things on Player State?

#

because Player State is avaliable for other players not like PC

latent heart
#

Yes

#

Or their pawns.

#

Depends who "owns" the logic, the player or the thing they are comtrolling.

normal viper
#

okay, I will consider, but so far I try to put info only that is needed for the local player, like I don't have things here that other players would access

worthy oak
#

Yeah if its UI thats a decent argument to be made

#

since UI really only applys to the local player

normal viper
#

In this case of quests, these will be global quests, so each player has their own widget? but they all take info from 1 place (Game State)

worthy oak
#

How each client gets the info for the widget yes that needs some replication consideration

normal viper
#

Yeah, got it ❤️ thank you guys for help

gaunt cypress
#

how do i add multiplayer to my game? Cuz all the tutorials arent working

neon summit
gaunt cypress
#

ikr

neon summit
#

you have to understand it first

neon summit
#

beat me to it lol

gaunt cypress
#

So its better to make dedicated server, and then add the code into the game so u can join the server?

dark parcel
worthy oak
dark parcel
#

you can't even reference, how you gonna reference and keep track of multiple game instance?

gaunt cypress
#

Im working on a singeplayer game, but i cant finish it

#

Im just gonna follow a tutorial...

dark parcel
#

multiplayer is way harder than single player

worthy oak
#

It can be fun though if you wanna get your feet wet

dark parcel
#

I'm a firm believer that one should know how to add before doing multiplication

worthy oak
#

Meh

#

thats what school said

worthy oak
#

and tbh at least in my opinion. Getting something like a shooter or or even a basic lobby setup is achievable and you can learn alot. There will be considerations you will want to take, and testing/expanding to ensure its a smooth experience before release

#

but you can learn the concepts doing that

gaunt cypress
#

nah, im alr ig, its too much for me to make multiplayer game, make dedicated server.... make join and quit.... make replicating things..

#

and blah blah

worthy oak
#

its a ton of work yes haha

gaunt cypress
#

but

worthy oak
#

but anything worthwhile is

gaunt cypress
#

i made a small game, i was making it for the first time

#

i was 2 days learning and 2 days working

#

so 4 days and i made this

dark parcel
#

starting small is a great idea

worthy oak
#

Yeah thats great congrats!

gaunt cypress
worthy oak
gaunt cypress
#

the ai is kinda broken tho

worthy oak
#

if its any consolation AAA games are hardly bug free xD

#

and tbh lately are even more buggy LOL

gaunt cypress
#

i just cant get the doors to work so the ai dont sees me

#

and i also cannot make jumpscares cuz idk how...

#

someone give me ideas for new game

twin juniper
gaunt cypress
twin juniper
#

oh

gaunt cypress
#

does anyone here know how to animate jumpscare?

twin juniper
#

Error: I spawned an actor on the server but it doesn't replicate

#

what is wrong?
I used a Server RPC to make the call from the client to the server to then spawn it

thin stratus
#

Where is the ServerRPC located

twin juniper
#

it was in a component

thin stratus
twin juniper
thin stratus
#

That doesn't really answer my questions

twin juniper
#

I dont think it was

#

it must be?

thin stratus
#

It must be and it must be on an actor owned by the client fwiw

twin juniper
#

the player is owner by the client

#

so it's fine

warm sparrow
#

i was wondering why the begin play in my playerstate component wasn't firing. Then I found out begin play is not even firing on the playerstate itself. Why is that? There are two players in the game so shouldn't the server also print 'begin play' twice for each player?

#

im creating a listen server where one of the players is a server and a player btw

ancient adder
#

It could be you forgot to set the playerstate in gamemode

warm sparrow
#

two player states do spawn and a lot of other replication logic is already working for both players. they can exchange information etc. Its just begin play for some reason

#

i guess ill just call begin play type of event from the gamestate or something like that

gaunt cypress
#

why is my AI's pawnsensing not working? I copied the code for my ai from other game, and on PawnSense, it doesnt do anything, even if put it so if the ai sees you the it prints a string

surreal fox
#

I used default touch joystick but no matter who's joystick I move, only the client character moves

#

someone have any idea why's that?

feral narwhal
#

anyone know what would be the best practice for updating a variable on an actor located on all clients? Is there a better way than to just have the actor call an RPC which is on the character BP?

brazen anvil
#

In my project I am trying to update the character pose based on the weapon that is equipped. When I equip a weapon, I sent a FGamePlayTag to the inventory container of the weapon I am equipping. Then I get the data asset of the weapon in this slot which stores the pose to use for holding this particular weapon. Then I set CurrentPose to the pose on my character. Inside my animation blueprint I get this pose and feed it into Blend Poses node.

Right now I have the tag replicated and was hoping that because the tag gets set (on the server), it would replicate and update the pose, however that is not the case. It works correctly if I replicate the CurrentPose however I don't see why I need to if I can determine the pose based on the tag. Anyone see anything wrong here?

nocturne quail
feral narwhal
# nocturne quail rep_notify

on the actor itself? when i do that it doesnt replicate all the time because the object is server owned I believe

nocturne quail
hollow eagle
#

Just a normal replicated property would do. OnRep/ReplicatedUsing is for if you also need a function to be called when the property is changed as a result of replication.

feral narwhal
#

what if the call is being made from the client's object?

nocturne quail
#

only server can do

feral narwhal
#

I understand but what would be a good way around that, if I want the client to update something

sinful tree
nocturne quail
#

clients call an rpc

normal viper
#

I just realized that I need something other than Player Controller to store resources (gold, wood etc) of my players. I basically have variable Player Number on everything that exists in the game, so everyone knows on which ''team/side'' they are, if that makes sense. Now, when the unit is gathering resource, the logic to increase resource amount, is on the Player Controller, but if I started to understand correctly, I don't really have a way to tell unit that this is his Player Controller, because they are not really possesed? I put photo so you can picture it my tries with that. It was somehow working sometimes, but I don't think it's gonna work perfectly on the cooked game. Or is there something that can help me actually differentiate which Player Controller the ''unit/worker" is aiming at, basically? Btw this is done with Task on behavior tree. The last photo I think it won't actually work if it will be hosted and not LAN, right?

feral narwhal
nocturne quail
#

if your other object is weapon, you should do that rpc in character since character will own that weapon

feral narwhal
#

its a simple bed and when the player interacts I want to update a bool saying that this bed is occupied

#

but it just seems kinda hacky to store so many RPCs all on the character BP i thought there would be a better way

nocturne quail
#

split your character in many parts

sinful tree
#

You'd make a generic RPC for interaction.

#

Like.... Press E > Determines whats actor is in front of the player > RPC to server the actor
Server > Verifies player can interact with that actor > calls an interface or utilizes an interaction component on the actor > actor does its thing

feral narwhal
#

so Id be replicating the interaction rather than the actual bool directly in a way

sinful tree
#

Clients don't replicate.

#

Only the server does.

#

Clients can only RPC to the server. The server has to do the replication.

normal viper
#

I came up with something like that, I'm not tripping? Will I be able to actually get all players controllers if I have listen server with 1 host?

sinful tree
nocturne quail
worthy oak
brazen anvil
#

I have a question. I have a variable (bool) that is replicated. I call a server RPC that sets it to true. In the OnRep, I print the value and I can see it changed to true. It prints on both clients and the server and it is correct. However, when I get the variable in the animation blueprint it is still showing as false.

normal viper
# sinful tree You don't want to use the GetPlayerController X or GetPlayerCharacter X getters ...

Is there any other way to differentiate which Player Controller I'm aiming frm the unit, that isn't really possesing anything at or should I just move my logic to other place, and if yes, then which place is better to just have simple variable which tells what team I have. So like in short I can Loop trough all of these (if I have 3 players I have 3, if I have 5, I have 5 so the number is ==), and then ''aim'' at exactly this.

normal viper
worthy oak
normal viper
#

Why does this work though? It's a bug when it's on the editor and it's not gonna work in the cooked build?

#

I read somewhere that this can only be used on LAN? because there you have Indexes of each player ++, but on listen server everyone is 0?

sinful tree
normal viper
#

So this would be ok way to differentiate which Player Controller I'm aiming at from the server?

#

I guess I can only do it because it's from the AI behavior tree task which is server

sinful tree
#

It's still not a great way to handle it. What happens if a player disconnects?

normal viper
#

Haha right, controller dissapears and everything resets?

brazen anvil
normal viper
#

So I could use the same logic from this to check which Team Number Player State has, but I don't have to care about if I can call to there from the place I'm?

#

Just need to make sure before I dive into another hole xD

#

like this will make more sense than Player Controller to differentiate to which play I want to ''aim''.

sinful tree
#

Anything that you may need to use to determine player ownership is generally best handled by assigning it a playerstate variable.
You don't want to use GetPlayerState X either.

#

If this is in an AI, the AI itself can be assigned a PlayerState that owns it.

warm sparrow
normal viper
normal viper
#

and this would be like base for everything the player owns

sinful tree
jovial inlet
sinful tree
#

You use the reference to the playerstate directly. Your team ID can be a number, that's fine, but the playerstate is the thing that indicates who owns it.

#

Electronic Nodes + Flat Nodes

normal viper
#

My problem, how to tell Actor that isn't possesed or anything so he will know which Player State is his?

#

Like if he deposits resource he needs to know to which Player State right?

#

so I was thinking about checking if the Team ID on worker, is the same as on Player State

#

if yes, then ++ resource

signal lance
#

@pallid mesa Pinned your blog post here^

sinful tree
#

So then if you want to know in your tasks which player is in control, you'd get the pawn of the Ai Controller and read the PlayerState.

normal viper
#

Okay, so to make 100% sure, we are just talking about some kind of consistent variable like Player Number on everything that the player owns?

This one I'm not sure about. you'd get the pawn of the Ai Controller and read the PlayerState.

How do I read PlayerState from the Pawn? Or are we talking about that variable and checking all Player States and matching the variable from the Pawn with the one from Playe State? Or i'm missing something?

#

Because now I have basically all that logic in the Player Controller, but as I said I'm not sure about using this method with calling number index to the player controller and if it's consistent in multiplayer.

sinful tree
#

Team ID, that can be a number.

#

Who is in control of a pawn, should be a reference to the PlayerState itself.

#

You create a variable in your pawn class called "Controlling Player PlayerState"

#

Set its type to PlayerState. Assign it when you spawn it.

sweet sage
#

Is there a way to fix this net corrections?

#

Fortnite don`t has it

normal viper
pallid mesa
#

here.

winter pollen
#

Whats the difference if i run a function off of multicast or run on server when it comest to replication?
For example i was following a tutorial and the guy put stuff after run on server but it didnt work for me because my stuff was already after a multicast event if that makes sense
but it started working when i used multicast
on both client and server

#

so i pretty much solved it by running the function on the multicast event instead, can this cause problems later?

signal lance
drifting quail
pallid mesa
winter pollen
drifting quail
#

Generally in solo you're still the server iirc

sinful tree
# winter pollen Whats the difference if i run a function off of multicast or run on server when ...

Run On Server is a means of having a client to call to the server on a replicated actor, but it only works in a few conditions:

  1. It's an actor that is replicated, the client is calling it and owns the actor they are calling it on.
  2. It's an actor that is replicated and the server is calling it - ownership doesn't matter.
  3. It's an actor that was spawned on the client which wouldn't be replicated - it would execute only on that client.
  4. It's an that is not replicated and the server is calling it - it would execute only on the server.

Multicasts are a means of sending an event to all players, but will only be received by clients if called on by the server.
The same logic applies. If it's an actor spawned on the client, it can still execute but only on that client. For replicated actors, it'll be sent to all clients that have the actor relevant when executed on the server, but non-replicated it'll only trigger on the server.

drifting quail
#

Does anyone know why the emitter location of my tracer particles doesn't update on the client when off the host's screen? Probably a simple setting I bet

normal viper
# sinful tree NO. No numbers.

Hmm, I'm doing logic for Spawning Units from the Player Controller to the Building, should I start with getting Player State from the Pawn I spawned and assign it to the Player Controller, so then from Player Controller I can send it further to everything (building,units etc.) and then I can just get PlayerState from anything and this will basically work?

sinful tree
# normal viper Hmm, I'm doing logic for Spawning Units from the Player Controller to the Buildi...

Use the playerstate as it's something everyone can reference.
An example: Let's say you wanted to color your pawns based on the color chosen by a player.
You wouldn't want to have to replicate the color seperately on all the pawns if all you had to do is know the PlayerState so that you can read the color they picked - then you only have to replicate that color choice once rather than for each pawn.
If you made it so it references the PlayerController, then you can't do that as other clients can't read the PlayerController, and thus they can't know the PlayerState.
If you ever need to get the PlayerController, let's say on the server, you can read the PlayerController from the PlayerState itself.

drifting quail
#

or not...I alt tabbed then my camera went crazy and crashed the editor :L

rustic sable
#

since I have items spawned in the world I don't set the owner until player interaction. Is there a reason to set this back to null, say inventory is full?

#

like 'if' someone else comes along then they take ownership so it shouldn't be an issue generally

brazen anvil
#

Do replicated variables go to owner only by default? Or whatever "None" is for the condition in blueprints.

sinful tree
rustic sable
#

ok, I'll clear it in the edge cases then

normal viper
# sinful tree Use the playerstate as it's something _everyone_ can reference. An example: Let...

This is game changing. This makes me want to throw a lot of logic to the pawn from the controller and then player info on playerstate, but the starting point would be probably after spawning Pawn I would Get Player State and send it to the the playercontroller, so I can distribute it further if I'm handling ''controlling'' spawning logic here. I guess it won't kill it to have 1 more variable with Player State that I can use, right? So then I create Player State variable on everything(building, units) and connect it from the source (in case of Producing Unit which happens from Player Controller, to Unit on Spawn Actor).

#

Wait do I already have Get Player State in the Player Controller that I can send as reference to everything I'm spawning from player controller?

sinful tree
#

Player Controller has reference to its PlayerState and Controlled Pawn.
Pawn has reference its its possessed controller and PlayerState.
PlayerState has reference to its Controller and Pawn.

normal viper
#

Can you just help me with 1 example. This is my starting point for the spawning Building and Units for every player.

#

Should I set Owner as player state?

sinful tree
#

You can, sure.

normal viper
#

or should I create variable Player State inside building and unit and expose it on spawn

sinful tree
#

The problem in doing that is that it's only an "Actor" reference, so then you have to cast it to PlayerState when you want to use it anyway.

normal viper
#

ok, then it's not good

#

so it's better to create new variable and expose it? since I see that actually every actor has PlayerState inside self?

sinful tree
#

Setting ownership also exposes it to be available for RPCs from clients not sure if you want that or not.

#

Up to you. Casting isn't that expensive, but setting the owner has additional things associated to it, like what I mentioned with the RPCs.

#

It may be wise to use the PlayerState in owner, as then if you have variables that only need to be replicated to the owner or everyone but the owner you can do that.

#

If you want to call client RPCs to the owning client then you can do that too.

normal viper
#

Ok, this is a little complicated so I think safer way would be just to create Player State as variable everyhere and set it on spawn

#

so in case of building as it's only actor I can create PlayerState and expose it on spawn, but in case of Character which is Pawn already, it has PlayerState built in, but I cannot expose it on spawn

#

so I just have so create universal variable like PlayerState Something

#

right?

#

So first set Player State from Player Controller in the building

#

and then I can send it further from building to the unit for example? Sorry for stupid questions but I want to make sure now I get it on this one example

grim prism
#

Hey, i've got a power up that when picked up should be hidden with collision disabled for one client, not all so that they can still pick it up, how can i do this?

brazen anvil
#

Is it common or bad to replicate an entire actor component? I am looking at a project that does that.

#
UPROPERTY(ReplicatedUsing = OnRep_CurrentMyComponent)
TObjectPtr<UMyComponent> CurrentMyComponent;

UFUNCTION()
void CurrentMyComponent();
sinful tree
brazen anvil
#

What would be a different way

sinful tree
#

GetComponentByClass

brazen anvil
#

hmm ok.

#

Do you know of any good documentation on how simulated proxies and server code work together? I am interested in reading more about how replicated variables, OnRep, RPCs, etc all work in relation to the different roles.

neon summit
wraith pebble
# grim prism Hey, i've got a power up that when picked up should be hidden with collision dis...

How you would do this is:
-each client has to have knowledge of which player(s) are and are not allowed to see/interact with the pickup. Typically the go to way is to use the unique net id from the playerstate to refer to specific players that can or cannot pick up/see the item
-the item could consider itself disabled when it arrives on scene until it has a vetted list of who can/cannot interact with/see it. If you imprinted that player info onto the item on the server, then let it replicate down to the client's version of the item, the item can know what to do once that info arrives: Either stay deactivated, or activate itself - based on who the local client's player is and whether they are on the 'cannot interact/see' list that arrived. Does that make sense?

This follows common networking practive of initiating the critical info of who can/can't interact/see the item on the server so they have full authority over the situation. I'm assuming you already know the basics of replication and OnRep - but if not, let me know. 🙂

wraith pebble
# brazen anvil Do you know of any good documentation on how simulated proxies and server code w...

There's a lot of resources for this online - epics documentation on this is pretty decent.

But here are some high level points of interest:

-replication:
-a passive form of networking
-can be slower to network than RPCs
-more friendly on net performance than RPCs
-more resistant to player-joined-in-progress-match bugs
-great for networking states
-always flows from server to clients
-RPCs:
-an active form of networking
-typically faster to arrive than replication
-can be 'reliable' or 'unreliable' (whether it is guaranteed to eventually arrive or not) which also can affect timing and perf cost
-great for networking events (replication can networking 'events' too but it's not as intuitive to do so)
-can flow from server to clients, server to one specific client, or from one specific client to server (this gets into 'autonomous proxies')

wraith pebble
# brazen anvil Do you know of any good documentation on how simulated proxies and server code w...

Cont'd

OnRep:
-refers to a special function that is called when a specific item replicates
-generally named as 'OnRep_MyVariableName'
-only needed if you need to run specific code when your item has actually replicated to client
-this fn is automatically called by the engine when the item replicates
-it is common to call this fn yourself on the behalf of the server right after you change something about the replicated variable so that the server and client are running the same code (since the engine will not call the OnRep_ fn on server for you).
-requires you to use the meta word ReplicatedUsing instead of Replicated on the UPROPERTY that is replicating.
-you can actually add a param to the OnRep function that matches the type of the replicated var, and the engine will fill it out for you with the previous value before it was replicated - this can be super handy! Typically, we name that param, when we are using that pattern like so: PreviousMyReplicatedVariable for clarity.

Caveats:
-if you change a replicated variable more than once in a single frame, only the most recent change will replicate over in terms of receiving your OnRep call. In fact, since replication can actually be postponed for a frame or more depending on what's going on with your net-load, it can even miss changes that were the only change in the given frame if it decided not to send that frame - assuming you made a change after that change (which is replicated instead). Basically, when the engine decides to replicate one of your items marked for replication, it will either send the latest version of that thing, or will wait to send it (for some reason I won't get into here). If it does not send it this frame, it may decide to send it next frame - the most recent version of it - which may now be different.

wraith pebble
# grim prism wow, thanks

No prob! I've done this approach on a multiplayer game before and it worked rather well. If you mark the player info on the item right as it spawns, you should be able to just make that info use the replicated initial only condition so it doesnt keep looking to see if it needs to replicate that info. In that case, the replicated info should arrive on client right when it gets its BeginPlay call

grim prism
wraith pebble
# brazen anvil Do you know of any good documentation on how simulated proxies and server code w...

Cont'd

Simulated Proxy:

  • a proxy that is simulated on a client connection to represent what some other player or what the server is doing. i.e. the actions you see it making were originally performed on a machine that is not yours.

Proxy:
-just means 'a thing that is only a representation of the original' <- this is important to understand what Epic means here by the word 'Proxy' because it's never really explained clearly and it can be confusing otherwise.

Autonomous Proxy:
-a proxy that is being controlled by a local player, not on a hosting server, but on a client.

Server (as a net role):
-a thing that is the original. May be controlled by the server (in which case, the roles of any replicated versions of this thing would be considered simulated proxies), or the server may lend control of the thing to a single player (in which case, the role of the replicated version of the thing on that player's client would be Autonomous Proxy and the role of that thing on all other client's machines would be 'Simulated Proxy')

Local Net Role:
-this is also just referred to as Net Role or Role since this is what we are usually talking about when we talk about net roles
-refers to 'what my net role is, on this machine'

Remote Net Role:
-refers to 'what my net role is, on the other machine' where 'other' is a client machine if you are the server, and the server if you are a client.
-if you are on the server, the remote role of anything replicated should either be Simulated Proxy if none of the client's the thing is replicated to is a player that is controlling that thing, or Autonomous Proxy if one of the clients the thing is replicated it is a player controlling that thing.
-if you are on the client, the remote role of anything that has replicated down from the server will be Server.

twin juniper
nocturne quail
worthy knot
#

is it better to use RPCs server -> Multicast or directly a rep notify function in terms of broadcasting changes to all clients in a dedicated server session ?

latent heart
#

Depends what that thing is.

#

Generally a normal replicated variable.

neon summit
#

Should be index 0 in the array

thin stratus
#

What does "My Copy" here mean?

#

You usally work with relative references in that case. And it depends on what part of your game wants to know about the Controller on the Server.

#

E.g. a possessed Pawn can just do GetController on the Server.
Or a the PlayerState can do GetOwner->CastToController.

#

If other Actors that you coded need a concept of "my controller", then you might want to set a Controller Variable on it when Spawning or it similar and use that.

#

I don't think you can just say "my copy of the controller" on the Server at any given time, cause the Server wouldn't know who "my" is.

jovial inlet
chilly haven
#

Hi,
Is it possible to run a dedicated server and client on same PC using steam?
I got his error:
Warning: STEAM: Failed to initialize Steam, this could be due to a Steam server and client running on the same machine. Try running with -NOSTEAM on the cmdline to disable.

#

which seems to imply not. But that would be lame.

woven basin
chilly haven
#

Must I run the steam client for running a dedicated server?

#

Would I need 2 different accounts?

woven basin
#

Only for testing “steam”. You can test multiplayer locally as dedicated and client.

chilly haven
#

yeah I've been using the null online system until now and happily running a dedi and many clients on a PC. But now I want to get steam working.

maiden flame
#

I don't know why you get that warning, but I am able to.

#

Like Afrayedknot suggested, you could run the server in a VM as a workaround.
I can try to help with the setup, but I have no idea why you got the warning.

#

I guess the warning implies there could be a different reason that it fails to initialize Steam.

chilly haven
worthy knot
#

Is it a good idea to rep notify results from hit events ? Because the server and client side always return different values

dark parcel
#

If not shooting then just decide who's hit result do you wanna take. The client side or the server one.

worthy knot
# dark parcel What is this used for?

I have a procedural mesh which changes shape upon hit, and many times it shows slightly different results on both clients , and when logging into the server session with clients no changes are shown on the mesh. Plus if you ask me I would want to take the server results

woven basin
# chilly haven If I turn off the client then the dedi does manage to init Steam. Are you using ...

the thing is - even if you could kinda get it working - are you going to trust it? i.e. you start having issues - is that because you are running together? Or is it a "real" problem?

What if it works 'together' but not when seperated.

Why not just pay $10 to host it on a cloud VM for a few weeks.

Otherwise I feel you might as well just be testing the null connection and just doing MP testing

dark parcel
#

U won't get same result because of latency

#

What I see in my world is not gonna be the same as your world

worthy knot
dark parcel
#

Because that's not gonna work

worthy knot
#

so whats your solution, should I fire first on server authority then multicast everything?

dark parcel
#

Depends on which data u want to take

chilly haven
dark parcel
#

I would probably just listen to client hit data and replicate the change according to the client data

gaunt cypress
#

why does the on component begin overlap activate when im not even overlaping

maiden flame
chilly haven
maiden flame
#

Yes

#

I'm using Advanced Sessions plugin

dark parcel
# worthy knot why client ?

If u want to interact with a door, and you actually hit the door in your world. Don't you want the door to open?

What if in server which is behind when the trace happens, the hit trace doesn't hit the door?

You will end up not opening the door despite interacting with it

#

Really up to your design how you want it to play out

chilly haven
#

Thanks, will investigate that.

maiden flame
#

Ah

dark parcel
#

If u only care what the server sees then go ahead, but the cons is there.

maiden flame
#

Cool

dark parcel
#

U will find out what it overlaps with

gaunt cypress
#

what?

#

no

#

listen

#

i got a capsule on the ai

#

and i got on component begin overlap, print string

#

and it prints when im not even in the capsule

worthy knot
worthy knot
dark parcel
#

I am not familiar with procedural mesh

#

How you actually do the change? If it can be translated to a replicated variable then do that

#

All clients need to do is update the change from the server

dark parcel
gaunt cypress
#

bro what are you yapping about

dark parcel
gaunt cypress
#

bro i dont get it

worthy knot
dark parcel
#

Idc anymore

gaunt cypress
#

ur saying print string the hit comp

#

thats not english

worthy knot
dark parcel
# worthy knot

If you want to follow server, have you make sure to just trace on the server?

#

It probably won't show up as where you hit as client tho imo

worthy knot
dark parcel
#

Because there is delay. Imagine shooting a trace from your character forward for your location.

If your latency is 100 ms, 1 second later, the server machine will shoot a ray from the character instance in the server forward. It won't yield the same result

#

Are you trying to deform your vehicle?

worthy knot
#

It takes the hit location results, inverses the direction of hit then loops through all vertices in the procedural mesh

#

So there’s no line or sphere trace being done

dark parcel
#

What I would probably do is deform the vehicle locally. Then notify the server about where to deform using server rpc.
Then server can notify clients to deform the copy of the vehicle that get damaged in their world and apply the deform effect

#

So if it were me, I will just check if the on hit in my own machine, and if it's locally controlled

worthy knot
dark parcel
#

Anything that needs to be in sync shouldn't go to multicast

#

You either use repnotify, or replicated. If you need a function to run when something changes, use repnotify.

#

But assuming your car can get deformed multiple times

worthy knot
dark parcel
#

On its sided etc. I don't think a single hit on rep will cut it

#

Late joiners will just deform the latest value

worthy knot
dark parcel
#

Sure but that's not gonna help with your multiple deformation problem

worthy knot
#

Because that’s the job of rep notify am I right ? It notifies incoming clients

dark parcel
#

You will need an array that contain the list of deformed data

chilly haven
# maiden flame Yes

Hmmm I don't see the Advanced Sessions plugin in the list. I'm using 5.4.1

worthy knot
dark parcel
#

On client -> vehicle collide-> add deformed data to array -> apply deformation to vehicle.

Send server rpc that updates the array.

Server replicate the array to clients.

Client on rep the array, make the deformation based on the incoming data

That's my 2 cent but I'm beginner in mp.

#

Probably make sure to mark the array to skip owner

worthy knot
dark parcel
#

U wouldn't need to apply any collision to your own vehicle from the server.

#

All of this goes without validation btw, I am not in a stage where I care about cheating

worthy knot
dark parcel
#

Are you using cpp? You can get the old values in OnRep function if you do

#

OnRep, I would just check the length of the array from the old array with the new incoming array.

For loop, apply the deformation starting from the index (new array num - old array num)

worthy knot
worthy knot
#

this is where the loop takes place

#

do you say I should replicate the vertices array variables?

#

as in set them to rpelicate

dark parcel
#

No comment on your system, I have no clue. I only give opinions of how I would send data as the player that collide and send the info I have to apply deformation in my machine and also in the server, which the server ultimately send to all clients and make deformation based on the incoming data

worthy knot
#

yeah I got you

#

I never understood the difference in using - is locally controlled vs using client side authority form the switch has authority

dark parcel
#

Switch has authority is checking if the machine have authority over the actor or not.

Normally authority is server unless, you spawn an actor locally, then even if you are the client. You still have authority over that actor.

#

Locally controlled is to check if you locally controlled the actor or not.

For example, there are 4 players. And there is a function that print hello string if that actor is locally controlled.

Only the actor that you own (eg. Your player character) will print string. The rest 3 characters which are controlled by other players (simulated proxies) are nor going to print string because you don't locally control those characters

worthy knot
#

ok understanding this slowly..

worthy knot
dark parcel
#

When I think about it, it's kinda a bit more complicated. Was thingking that for deformation to be responsive, you might want to deform locally without caring about network.

#

Is your game gonna have late joiners?

worthy knot
#

I also wanted to let you know I am doing the replication tests on 2 clients directly where the dedicated server instance is running in the background, not the traditional 1 window is the server and the other client

worthy knot
#

late joiners is more of a problem lol

#

because the server instance is like that of rust or dayz

dark parcel
#

Well that's gonna be harder to solve then 😕, I am also newbie in mp.

#multiplayer message

Prob got nothing else to suggest other than above. And even then, you might encounter problem where deformation is not responsive (the deformation doesn't happend right away at the time of collusion for vehicles you don't own)

Hard to say when I'm not doing the same thing as what you are trying to do.

worthy knot
dark parcel
#

I am newbie, but there are multiple wise people in this channel. Not the liveliest channel but hopefully someone else can give an insight

lament geyser
#

Hi all, I'm making my first multiplayer game, I got it all set up so that when I launch it's detected by Steam, however when I get a friend to launch it Steam doesn't detect their version and we can't find each other's servers in game

#

not sure if I'm missing something very obvious but any help would be greatly appreciated

timid fox
#

Does someone have an idea what I'm missing here? The GameMode should contain the rules of the game, but I have a widget on an client that should display some buttons depending on those game rules. The client can't access the GameMode, so how would the widget know what to do? The rules are in form of a DataTable and don't change during gameplay, so moving them to the GameState doesn't seem right.

winter pollen
#

I noticed some things dont work as intented when playing as "Client". Is that normal?

#

it works perfectly on standalone or if i check play as listen server

kindred widget
# timid fox Does someone have an idea what I'm missing here? The GameMode should contain the...

Try to consider the GameMode more as a place you do logic that is only on the server. GameState is what you're looking for here.

Consider something like a deathmatch setup. You have two teams, multiple players on each time, and a score for each side.

GameMode would bind events to something like a player's death, to update the correct team's score in the GameState. GameMode manages the functionality of doing the updates. GameState holds the values for that so that both server and client can access them.

dark parcel
# winter pollen I noticed some things dont work as intented when playing as "Client". Is that no...

Multiplayer is all about "Trying" to replicate similar experience across different game instances.
How you send data across the network and how you receive them is for you to design.

Things don't magically be in-sync. It is your job to make the experience seamless by sending data from one machine to another
So by design, you will need to determine, what code runs in the server, what code runs in the client.

winter pollen
#

that didnt help at all

#

lol

timid fox
winter pollen
#

do i need to test playing "as the client" or "as a listen server" ?

#

for me to determine if it works in mulitplayer or nah?

dark parcel
#

depends, do you want to play as a client (meaning you will connect to dedicated server) or do you want to play as a listen server

#

unreal use Server - Client model

#

your game should work wether you are playing as listen server or as client

#

if it doesn't then, well you need to check your code

winter pollen
#

but if you select "play as listen server" it tells you that the editor will act as both the client and a server

#

so whats the differnece between that and play as client?

dark parcel
#

yes because listen server also playing the game

#

Play as Client = you are connected to dedicated server and that will be the server

#

Play as Listen server = There is no dedicated server, you are the server but you are also a client because you are playing the game

#

Think of listen server as a player that host the game

winter pollen
#

how does stuff work on listen server but not on client then?

dark parcel
#

things don't magically work

#

everyone have their own intance of the game

winter pollen
#

it does work if i play on listen server tho?

lament geyser
dark parcel
#

because the code probably run on server

#

and u don't have it run on the client machine

#

and no one can tell if you don't even describe what is wrong

#

can't just say stuff

winter pollen
#

looking up and down doesnt work on client

#

weirdly

dark parcel
#

Have you checked if you added your input mapping context?

#

becareful with begin play in multiplayer btw

winter pollen
dark parcel
#

im gonna sleep in 2 mins

winter pollen
kindred widget
dark parcel
#

as in show another picture that calls it

winter pollen
#

beginplay -> sequence -> this

winter pollen
dark parcel
kindred widget
#

Shouldn't add input mappings in the pawn, honestly.

winter pollen
#

so what should i do?

#

i dont even know what ya'll are talking about tbh

dark parcel
#

You need to make sure that the character is possesed before doing this

dark parcel
kindred widget
#

Adding input mappings in the pawn is just not a good idea in a lot of cases.

#

An InputMapping is a frame that says "This game style needs these inputs."

So you have a game that allows you to run around as a character, drive a car, fly a plane and drive a boat. Four very distinct sets of controls that might need to be remapped differently based on player.

There is no point to adding and removing these based on what pawn you are using atm. Cause you can just add all four of these at the player controller's beginplay, and still only the possessed pawn gets the inputs.

#

Input Mapping Contexts simply say that you "can" use these inputs if they're on an input enabled actor at the moment. Input enabled actors by default are level blueprints, player controller, possessed pawn.

#

TLDR, move this to your player controller's beginplay and it'll run fine.

dark parcel
#

I see, that make sense

#

had mine on OnAcknowledgePossession, wasn't thingking about other actors that I can play as, but to make it scaleable I will do that too

winter pollen
kindred widget
#

Do you have a player controller?

winter pollen
#

I dont know

#

how to tell?

#

i play as a character yes

kindred widget
#

Do you have a GameMode?

winter pollen
#

yes "ThirdPersonGameMode"

kindred widget
#

Open it and look at the class specified as Player Controller.

dark parcel
#

and look for Player Controller in the same World Settings

#

Make a new blueprint derived from player controller. Then set that newly created Player controller in World settings.

winter pollen
#

found my player controller

#

but i get this error

fierce egret
#

Is allowing Client Side Navigation safe for movement stabilization and maybe cheating? Without checking this, my character cannot move in Top Down Template

dark parcel
#

multiplayer is too early for you btw

kindred widget
# dark parcel had mine on OnAcknowledgePossession, wasn't thingking about other actors that I ...

I just started doing most of mine on PlayerController beginplay because it's the same as Lyra's experience stuff mostly. Each "Mode" has a set of controls to apply. And they just apply them early on and leave them.

I do have some specialized ones like for building where I push a context mapping temporarily with an activated widget, also removes itself when the widget is removed etc. So that the building controls can override the pawn's controls temporarily. But for most things you can just plaster them up early and never touch them.

dark parcel
#

this is your first week in Unreal level

winter pollen
#

btw i just realized it was already casting to player controller why would i need to do all this?

#

isnt it essentially the same?

dark parcel
#

you don't need to cast

#

you are inside player controller

#

the logic u copied is from the pawn/character

#

hence the need to cast and get a ref to the controller

winter pollen
#

this is what was originally inside the player controller

#

so whats the point of "moving this to my player controller's beginplay" as @kindred widget suggested

kindred widget
#

Some initialization of pawn happens before gamestate is ready to call beginplay. So this works sometimes at very start of game.

#

Other times. The following happens.
You Spawn Pawn
Beginplay Runs at the end of spawning.
Possess is called.

You had no controller at beginplay.

winter pollen
#

Ok, so what should i do if i want looking up and down being replicated on client?

kindred widget
#

For animations?

winter pollen
#

No, just looking

dark parcel
#

Input got nothing to do with replication

winter pollen
#

then why are we talking about this

kindred widget
#

Look input isn't replicated. It's local authority.

dark parcel
#

no one is talking about replication

#

you are the one bringing it up

kindred widget
#

The topic before will save you from input issues later.

winter pollen
dark parcel
#

yeah, nothing to do with replication

kindred widget
#

The look input might be different. What is your look settings? Camera on a spring arm, or?

winter pollen
#

yep camera is on spring arm

#

hold up

kindred widget
#

What are your inputs in the pawn for looking? AddControllerPitch/YawInput?

winter pollen
kindred widget
#

Oh. Yeah this is animation stuff.

#

There is a thing called a 1D Aim Offset. You can also use the 2D AimOffsets. Same thing largely. But the 1D is easiest for simple shooters. You give the pitch of it via GetBaseAimRotation in the animgraph.

twin juniper
brisk swift
#

I have a multicast rpc that sets item meshes for armor on clients and servers, when this is called mid game is works perfectly fine and clients are able to see the server equip the armor. The problem is when clients join they can't see armor the server is already wearing

kindred widget
brisk swift
#

not sure what i'd put in an OnRep function

kindred widget
#

What did you put in the multicast?

brisk swift
#

ArmorMesh->SetSkeketalMesh(Mesh);

lament geyser
#

#multiplayer message
I switched the ID to the dev ID (480) and that got my friends game to show up on steam, still can't find each others servers though. Any help would be greatly appreciated.

fierce egret
#

Is there any reason why this doesnt work? I couldnt get it

#

I cant rotate the character while playing as client, no matter what i do

#

Character and movement is replicated

ruby lodge
#

I have the following setup to get the rotation and forward vector of the camera of the player that spawned this weapon BP to check the bullet path. Now the issue I am having is, I can't seem to find a way how to get the player camera manager in a way that it works with replication and not with this index 0 node. If I cast to the player controller in beginplay after checking if it's local then the others wouldn't have access to that nevertheless. Maybe I have a wrong idea in mind but I need the rotation of the player camera manager for it to include camera shakes as well

fierce egret
#

Which blueprint is this, character?

ruby lodge
#

like this?

#

no, it's the weapon BP

ruby lodge
fierce egret
ruby lodge
#

maybe I shake wrongly? xD

#

This event runs in the event tick of the character bp

fierce egret
#

You're right, shakes don't affect camera rotation

ruby lodge
#

owning pc is the player controller that owns this character

fierce egret
ruby lodge
#

I guess thee Get owner twice was a typo?

fierce egret
#

No. First one is owner of weapon( character ), second one is owner of character ( controller )

ruby lodge
fierce egret
#

You should call get owner two times if its weapon blueprint

ruby lodge
#

ah yea my bad

fierce egret
#

👍

#

And you can right click and make this cast pure

ruby lodge
#

I assume I should do this once in begin play of the weapon BP and not for each bullet being shot xD

fierce egret
#

Try this catyes

ruby lodge
#

maybe because it's bots they prob return false for the cast to playercontroller on their side?

fierce egret
#

Yes because AIs dont have player camera manager

#

They dont have player controller, therefore no camera manager

ruby lodge
#

would that work for other players though. As far as I know every player can only access their own player controller and thus player camera manager

twin juniper
fierce egret
#

For my rotation problem, it's in my character blueprint.

twin juniper
#

okk thx

worthy knot
#

In rep notifies, setting “skip owner” skips all changes to only the owning client ?

nocturne quail
#

also try this:

void AMasterActor::SpawnBulletServer_Implementation()
{
    auto SpawnBulletLambda = [this]() {
        FActorSpawnParameters SpawnParams;
        SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
        SpawnParams.bNoCollisionFail = true;
        SpawnParams.bDeferConstruction = false;
        SpawnParams.Owner = this;
        AYourBullet* Bullet = GetWorld()->SpawnActor<AYourBullet>(BulletClass, SpawnLocation, SpawnRotation, SpawnParams);
        Bullet->SetReplicates(true);
        Bullet->SetRemoteRole(ROLE_SimulatedProxy);
    };
    for (FConstPlayerControllerIterator Iterator = GetWorld()->GetPlayerControllerIterator(); Iterator; ++Iterator)
    {
        APlayerController* PlayerController = Iterator->Get();
        PlayerController->ClientSpawnBulletRPC.BindLambda(SpawnBulletLambda);
        PlayerController->ClientSpawnBulletRPC();
    }
}