#multiplayer

1 messages · Page 734 of 1

still owl
#

Nah, it's just a co-op game.

However, if I did this, would the server still be able to move the client under certain circumstances like a knockback ability from an enemy?

I think I tried these options before and the server was no longer able to move the client

limber gyro
#

those options are usefull for stuff like dashing

#

for example

#

you could try for example, when u hit something in the client u set those flags for like a second or half a second, do ur bumping thing and then set them back

still owl
#

Cheers I'll give it a go 👍

bitter oriole
#

Some of PlayerState

#

For each connected player

#

There's a method you can override to add more

#

That's on the server, of course

pliant moss
#

is it possible to create an AIController that does not need to be owned by the server?

bitter oriole
#

You probably don't want that

bitter oriole
#

AI should normally be a completely server side affair

pliant moss
#

Yeah. ok. well my main problem is that i have a free flying camera pawn that is possesd by the player controller. Then my PlayerCharacter is possesed by an AI Controller since my playerController cant possess both pawns at the same time. This creates a problem where all the actions on the player character needs to go trough the server since the server owns the AI Controller. It messes up the GameplayAbilitySystem a bit since all abilities needs to execute on the server. Does anyone have any ideas i could try?

fluid summit
# pliant moss Yeah. ok. well my main problem is that i have a free flying camera pawn that is ...

i'm having a similar problem. Best solution i found so far is explained in here
https://www.youtube.com/watch?v=8ToVKyiVDAg

This is my first Unreal 4 Tutorial series of videos, there will be 3 in total. This video will serve as an intro briefly going over what it is I hope to accomplish with this tutorial for anyone who wants to learn how to make a top down controller that replicates over a multiplayer network.

▶ Play video
#

basically AI owns the Pawn and PlayerController goes through that when input is received, really messed up but it's the only solution i found

#

The other one would be to:
On input from playercontroller, do RPC and implement custom logic to navigate

pliant moss
#

PlayerController goes trough the AI Controller?

#

I will take a look at the video

bitter oriole
pliant moss
bitter oriole
#

Either one AI controller or one PC owns a given Pawn

pliant moss
#

So the client have a local Controller and pawn, and the local controller relays the input to the server?

bitter oriole
#

And yeah, various input goes through RPC to the server through both classes, depending on the game

pliant moss
#

Yeah ok. my gut feeling is that it could potentially be some hassle to get GAS to work with that.

fluid summit
pliant moss
fluid summit
pliant moss
pliant moss
humble bane
#

can a rep notify be called on a different actor?

sinful tree
twin juniper
#

if an actor is dormant but value has changed and client was not relevant, is there a way to force an update for a client when they become relevant?

chrome bay
#

Should do it automatically

#

So long as the actor isn't still dormant

regal geyser
#

How can I make "casting system" in replicated game? Current approach is that when player is interacting with an item event repeats itself with delay 0.01 and on each repeat 0.01 progress is added to the item. I tought that should be just fine and when setting total progress to 5.0 it should take 5 seconds for it to complete, but it's taking around 5.35 seconds on average. Why is that

twin juniper
# chrome bay So long as the actor isn't still dormant

I mean they are still dormant, and maybe say net frequency is 0, but I guess that wouldnt change much since it is dormant. So the only times it needs update is when it becomes relevant for that specific client, and on force net update for relevant clients

dark edge
pliant moss
dark edge
#

Dou you mean like spells with a cast time?

regal geyser
#

Yes, the best example would be engine repairing from Dead By Daylight, because the more people are repairing it, the faster it goes. So for 1 player it takes lets say 30 seconds, for 2 15s, etc.

#

And I'm not sure why repeating this "repair" action with delay and then adding players progress to the engine with the amount the delay had to wait is not very precise and I really doubt that it takes some time for the nodes to compile (for 5s repair its off by like 0,35s)

dark edge
#

Just tick and increase value by rate times Delta seconds.

#

More builders equals higher rate

#

You can use a timer or a timeline to accomplish a temporary tick but same idea.

regal geyser
#

So in tick when using times delta seconds it makes it frame independent?
I was also playing with timer by event but the results were pretty much the same, maybe was just doing it the wrong way.

dark edge
#

Rate = numbuilders
Value += Rate x DeltaSeconds

dark edge
#

The constant is the rate.

regal geyser
#

Sweet, thanks a lot!

dark edge
#

Start with just having it sit there ticking then later you can decide if a temporary tick is worth it or not.

fluid summit
#

Hi! does anyone know the dif between "Is local controller" and HasAuthority ->Remote ?

dark edge
#

Controlled only has a meaning in the context of a pawn. What are you trying to do?

fluid summit
#

I was setting something on the pawn to get the AI working correctly for movement and saw that node. Nothing important

dark edge
#

Anyway, to get to the real concept of if you're locally controlled or authority, you can be both and/or neither.

#

Listen server pawn is both

graceful flame
#

How do you get the player character from within the playerstate? It seems to always get the first client but not the others. My scenario is that I’m trying to assign teams for each client at beginplay. Half team A and other half team B, but the result is only first client is assigned to team A and others don’t have any team.

fathom aspen
#

APlayerState.PawnPrivate

rancid monolith
#

Is there a way to add simulated network latency while playing in editor?
I know there's a file somewhere that I can edit, but is there a way to do it from inside the editor in ue5?

fathom aspen
#

Net PktLag = <ms>

#

In console command

rancid monolith
#

ty

graceful flame
#

Advanced settings, network emulation

fathom aspen
#

Correct

fathom aspen
#

FlushNetDormancy would do the job I guess

fluid summit
winged badger
#

i would not even keep an actor with that replication requirement as replicated

#

but would instead replicate it via another actor that handles all the occasional replications

#

just need to make it net addressable

fluid summit
#

Okey i got the client side moving for this problem, i found an easier method (which i don't know for sure if works 100%)
Remove the default Pawn from GameMode, Spawn it on **PlayerState **and posses it by one **AIController **that you just spawned. Grab a ref for **PlayerController **and **Pawn **for each other.
When in need of move the pawn, tell the **PlayerController **and pass that message to the PawnRef. The pawnRef handles it with the AIController.

With the camera problem, on the **PlayerController **do "OnOwningClient" ->Set view from blend and use the pawn Ref to grab it's camera.

Hope it helps if someone has a similar problem, it's easier than the suggested solutions i found online

winged badger
#

that is just too complicated to be robust

fluid summit
#

there's no other way if you want "Move to location"

winged badger
#

override AGameMode::HandleStartingNewPlayer

fluid summit
#

no simplier way* that i found

winged badger
#

you have a PC reference there, and PS already exists

#

and has copied properties in case of seamless travel already, too

twin juniper
fluid summit
#

oh i forgot that you can override that, that's actually a good idea

winged badger
#

do not call Super, as that will call RestartPlayer() which will spawn the Pawn

#

and just implement its logic/spawning and construct your entire object graph there

fluid summit
#

I'm gonna change it for that later, i'm trying to solve this now.
For some reason the Pawn on client (it can move ok) its always floating and falling through the floor (on server i see it okey)

fathom aspen
winged badger
#

fair guess its using NavMeshWalking on server and Walking on client

#

that one doesn't replicate out of the box, the CMC MovementMode

fathom aspen
fluid summit
winged badger
#

there are several ways to make Actors NetAddressable and not Replicated

#

if it falls through the floor, then your collisions are fucked

fathom aspen
#

Correct, I guess those spawned at runtime are handled this way then

winged badger
#

with extra option that you spawned something with static/mobile mismatch inside another object, as that can completely break the physics engine

#

making a spawned actor net addressable and not replicated is a but complicated

#

you need to deterministically name it and spawn it separately on all machines

fathom aspen
winged badger
#

and its IsFullNameSupportedForNetworking() would need to return true for that instance

#

that is basically how preplaced Actors are net addressable

#

their Names are serialized with the Level, so they are deterministic and same on every machine

#

and that function will return true if it has RF_WasLoaded UObject flag

#

which Actors loaded from level do

fathom aspen
#

Wow, so you literally recreate that behavior

#

Nice ^^

#

@pallid mesa take notes please 🗒️

winged badger
#

you can go one step further and make them replicate too, although that takes extra care

#

it its bNetStartupActor is true

#

engine will assign static NetGUID (you can tell static/dynamic by the last bit)

#

but

#

if you turn the replication on, the server will require clients to Ack the NetGUID immediately

#

and if they can't do it because they, say, didn't spawn that Actor yet, the Ack will fail and ActorChannel won't open

fluid summit
#

thanks!

fathom aspen
winged badger
#

(NavMesh)Walking mismatch generally results in severe Jitter that includes falling

fathom aspen
winged badger
#

but it won't make it through the floor

#

yes, but if they can't Ack right then, you won't be able to open the ActorChannel later

fathom aspen
#

So you have to kinda do it on intervals until it opens?

winged badger
#

so in this scenario you can't let the Actor spawned on clients and server separately try to replicate until you are sure it already exists on clients

#

and it still has to meet all NetAddressable requirements

#

so far, i find it practical for procedural generation and little, if anything, else

fathom aspen
#

Always good to know the use cases, will keep it in mind if I go down that road 🛤️

#

Thanks Zlo!

winged badger
#

after the game starts

#

its too much of a pain in the arse handling cases where packets arrive out of order to be worth the hassle

graceful flame
#

Should a variable that you as a developer never plan on changing still be replicated for security if it impacts gameplay? Stamina regen rate for example.

fathom aspen
#

I don't find it worth the hassle, not till now at least ^^

winged badger
#

replicating it initially provides no security whatsoever

graceful flame
#

I don't follow

#

what do you mean CDO?

winged badger
#

class default object

graceful flame
#

ohh

#

okay so it if there's no custom events that change this stamina regen rate value, it shouldn't matter if its replciated or not?

winged badger
#

as server never changes its value, it will never replicate to correct the client, if they client hacks it to some other value

#

only the first time, just before BeginPlay

#

if i were you, i would pull the static... attributes of your characters into a data asset or a data table

#

makes it far easier to tweak the values later

#

all stuff neatly in one place and all

#

and the data asset/table is packaged and same on all machines

graceful flame
#

So if its on my character BP as a default private variable can a client still hack to something else and change their stamina regen?

winged badger
#

note: they will try to hack your data assets sooner or later, if you have enough players

graceful flame
#

Would it be best to keep that variable on GameMode?

#

Then all the characters that share the same value can read it from there?

winged badger
#

so you override PreSave on it, to create a Hash from all important values in the data asset

#

and save/package it along with the data asset, no blueprint exposed preferably

#

and then you can at any time you please verify if your DataAsset's Hash function returns the same value as the Hash you saved prior to packaging

#

if it doesn't you know someone hacked some values there, and then you can be mean 😄

fathom aspen
#

I saw this the other day and wanted to make sure I get it right.
Does that mean any actor can access GameState on client without being worried of it being null? Cause someone had the issue of it being null in another actor game framework class. I also remember seeing that issue on some thread from 2016. That's why I'm asking...

winged badger
#

it can from BeginPlay and after

fathom aspen
#

Can you point me in source code where I can see that in action

winged badger
#

GameState has to replicate that its time for World to BeginPlay in order for clients to start calling BeginPlay on their Actors

#

so it has to be there already

fathom aspen
#

Ah yeah right, I remember seeing that

winged badger
#

only exception to this rule is if you call BeginPlay on an Actor manually before that happens

fathom aspen
#

Oh can it be called manually? 😄

#

New to me

#

Ok thanks!

fluid summit
fathom aspen
#

Last question for the night, bare with me ^^

So with transient you mean non transient properties right?
Cause for example PlayerState itself is RF_Transient. So I'm wondering how it's saved upon reconnection then? The InactivePlayerArray its saved in belongs to the server I guess that's why? Or because the array is a UPROPERTY?

APlayerState* APlayerState::Duplicate()
{
    FActorSpawnParameters SpawnInfo;
    SpawnInfo.Instigator = GetInstigator();
    SpawnInfo.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
    SpawnInfo.ObjectFlags |= RF_Transient;    // We never want to save player states into a map
    APlayerState* NewPlayerState = GetWorld()->SpawnActor<APlayerState>(GetClass(), SpawnInfo );
    // Can fail in case of multiplayer PIE teardown
    if (NewPlayerState)
    {
        DispatchCopyProperties(NewPlayerState);
    }
    return NewPlayerState;
}
winged badger
#

its not saved per say

#

its duplicated and pointer is kept there

fathom aspen
#

Ah I see what you mean, yeah makes sense

#

A bit off topic, but what does the RF mean?

#

F would stand for flag. What's R?

winged badger
#

no idea

#

doesn't really matter

red furnace
#

Not sure how to ask this... I'll us pictures 😋 Is there a possibility a client could run a function before a server gets done running a function even if its called after?

#

I called an event for the server to update a value. After the loop I called the client hud to update. The HUD seems to update before the server update the value though. This only happens on the client

fathom aspen
#

If the RPCs are marked reliable then they could be queuing, so yes it's possible that HUD event is called before they all finished executing

#

I think what you're doing is dangerous as you can't guarantee they replicated in time you call that HUD event

#

That's why you use OnReps

#

Called RepNotifys in BP

fluid summit
# red furnace

You will save yourself a lot of headaches if you use OnRep to trigger UI updates.

worn wagon
#

What's the optimal flow for controlling player spawns? I have overridden HandleStartingNewPlayer_Implementation to prevent initial player spawning, but this only works on the client in a network settings, the listen server host spawns in regardless. I did some debugging and found that ClientRestart_Implementation is called when the level starts which dispatches a Restart, but I couldn't go any further up the chain and figure out what was calling ClientRestart to begin with.

winged badger
#

i don't let my GameMode call HandleStartingNewPlayer until i want them to spawn

worn wagon
#

I mean i've overridden it and it's literally just an empty function, but somehow the listen server host still spawns in

fluid summit
worn wagon
#

The only thing that works so far for me setting the default pawn class to none, but that's not ideal, it breaks the functionality for several functions

red furnace
fluid summit
worn wagon
fluid summit
#

in my case i'm not calling super, as per indications of zlo

vagrant grail
#

If I do my crouch this way, if anyone joins the game later will he see me crouching or not ? Or do I need to go through a RepNotify too ?

#

Please ping me if any answer 🙂

fluid summit
vagrant grail
fluid summit
# vagrant grail Thank you. That means alot of youtube tutorials do things in the wrong way when ...

This one gives a good visual explanation of how replication works
https://www.youtube.com/watch?v=KsORRtBOJYc&list=WL&index=1

BRY

📹 Part 4 of our replication series unlocks limitless potential with Multicast and RepNotify! In this video, we dive deeper about how Unreal Engine's Actor Replication really works as well as introduce ourselves to a variable replication and how combining the power of variable replication with an event driven design can help us build a multiplaye...

▶ Play video
vagrant grail
fluid summit
#

I have no idea if this is the same problem, but it may help

#
dark edge
dark edge
#

crouch is state

vagrant grail
vagrant grail
#

Also I want to make my character have his head rotate towards where he's looking (and it needs to be compatible with multiplayer, so it needs to be seen by others too), how would I go about that please ? 🙂

dark edge
#

Get one thing working instead of 2 things not working

vagrant grail
#

But I didn't undestand your sentence above

ripe basin
#

Can get bIsCrouched in the AnimBP from the character already, it's inherited.

#

Tutorials aren't necessarily bad, there's just a lot of different ways to do things and you might not really understand the why. Well, and they might not understand the why. But still 😄

thin stratus
#

Do you have enough player starts?

#

You can try opening your character BP and searching for spawn collision handling or so and set it to always spawn

#

Where and when are you possessing them?

winged badger
#

why would you override ChoosePlayerStart to return nothing?

#

and if you're spawning them by hand (not calling Super/Parent) of HandleStartingNewPlayer

#

you also need to manually possess them there

torpid girder
#

Hi, I am wondering about hardware requirements for dedicated servers, I understand everything is cpu based so the faster the cpu the better but what can I expect for memory profiles? I assume textures etc aren't required? And is it possible to make a smaller bundle to make server deployment easier?

#

Oh I should have just asked one question

pseudo merlin
#

hey all, what would be the best way to lerp a characters position between 2 points in a replicated way? should I disable char movement, run the interp on client and server, then reenable when interpolation is over?

#

I'm assuming charmovement replication isnt designed for SetActorLocation() like this

#

but maybe im wrong?

silent valley
coral wing
#

My client gets kicked from server with error: "ActorChannelFailure"
This only happens when my client is on a shipping build but they're not kicked with other builds like debug.

quasi tide
steep wolf
#

is it possible to launch another instance of a server locally through c++ without having to package the game

#

i need it for debugging

ripe basin
#

@quasi tide Any particular reason? 🤔

quasi tide
#

Don't have to check every tick of Update Animation. Only updates the state when I tell it to.

#

So when I crouch for example, my player code broadcasts the event dispatcher. My AnimBP is set up to listen for it. So once it happens, it'll execute the code to update the AnimBP's bool to track crouching.

prime island
#

Hi guys, where should I store my joined player controllers? In the GameMode? Or maybe in the GameState? Can someone help me? ( LAN, only up to 2 player)

prime island
#

Sry, but then how can i access them?

dark edge
#

From PlayerState you can get the PlayerController

#

What are you trying to do tho

prime island
#

I just wanted to keep track of all the playerControllers for later use...

latent heart
#

There's a list of player controllers somewhere. Maybe on the world?!

#

But just use the playerstate array and GetOuter()

lime echo
#

Is it standard to send client to server RPC, and then from the server, send a NetMulticast? Or is there a better way to share new data with all clients from the owner? I need this after input callbacks for example, which the server doesn't get.

fathom aspen
#

Yes you send a server RPC though you don't NetMulticast in server, but you set the replicated property

lime echo
crystal oar
fathom aspen
#

Non relevant players too?

#

If the answer is yes you need to replicate a boolean property for example bDoThisEvent

#

That executes ThisEvent

lime echo
fathom aspen
lime echo
#

Thank you for your help! I'll consider the options and pick the one that best fits my game architecture.

fathom aspen
#

Idk try asking here upvote

dark edge
lime echo
dark edge
lime echo
fluid summit
#

Does anyone know how i can check "array size" in bytes?

vagrant grail
#

I want to make my character have his head rotate towards where he's looking (and it needs to be compatible with multiplayer, so it needs to be seen by others too), how would I go about that please ?

#

Could you link me to a ressource or a tutorial showing how to do that please ?

#

It's too vague to me I need to see / follow a tutorial to learn from it

ripe basin
#

Why not just bash your head against a wall for a few hours, that's always a good learning experience. lol

vagrant grail
#

Thank you

ripe basin
#

Kinda not joking, understanding your failures is good experience. The above video is good, it's basically the same thing but you'd need to use the full Rotation depending on how you want the head to look around, and change the bone to Head

vagrant grail
ripe basin
#

Would also suggest a cutoff for head rotation to turn the body, or you're gonna be an owl

#

Also, also need to force body Rot on forward movement or you'll be walking sideways. But idk what you're trying to do. Maybe you wanna be an owl walking sideways 🤣

vagrant grail
#

It's already the case but when the player is looking down or up the character doesn't move his head which is problematic

#

that's why I need the head to follow where the player is looking at

#

Like I don't like how to player rotates on himself when looking around

#

In which BP, and where in that BP

lime echo
#

Is AActor::GetOwner() returns a valid owner, only when AActor::IsLocallyControlled is true?

fathom aspen
fathom aspen
#

Same idea. Pawn sever side calls is locally controlled, it returns false. Calling GetOwner returns a valid owner

empty axle
#

It should also work unless you have an actor that is either not replicated - then on client side it will be null or you spawn an actor client-side - then on server it will be null.

fathom aspen
#

Literally many examples to why it's not correct

woeful anvil
#

anyone else having issues with UE5 play in editor multiplayer?

fathom aspen
#

Be more specific

lime echo
#

Thanks, but I think I didn't phrase myself correctly. I have a replicated character (I'll call it the player). Now each player spawns (passing FActorSpawnParametrs::Owner = this) a gun which is also replicated. My question is whether each gun's GetOwner() return their "REAL" owner (the one who ACTUALLY spawned them)? Will it be the replicated player on their machine? Or will it be just nullptr (separate from the one who is spawned on the same machine the "REAL" player is in).

fathom aspen
lime echo
fathom aspen
pliant moss
#

How can i debug if a c++ function really is running on the server?

fathom aspen
#

Check NetMode

pliant moss
fathom aspen
#

Nope

#

GetWorld()->GetNetMode

pliant moss
#

thanks il try that

fathom aspen
#

Literally just debug and find what's going on. By the sounds of it, it seems that the player pawns are being spawned close to one another, resulting in such issue. One of the things ChoosePlayerStart does is that it check for encroaching stuff on spawn, and there are then it doesn't let the player pawn spawn, unless there is no other PlayerStart but that. It also probably tries spawning it so it doesn't encroach too much

#

Debugging would tell you what's going on, though overriding ChoosePlayerStart so it returns null sounds weird

pliant moss
#

UE_LOG(LogType, Warning, TEXT("NetMode %s"), *UEnum::GetValueAsString(GetWorld()->GetNetMode())); i cant do this like with normal enums?

#

unresolved external symbol "class UEnum * __cdecl StaticEnum<enum ENetMode>(void)" (??$StaticEnum@W4ENetMode@@@@YAPEAVUEnum@@XZ) referenced in function "public: virtual void __cdecl ULocalTargetingSystem::ServerTargetActorSelectionSuccess_Implementation(struct FHitResult)" (?ServerTargetActorSelectionSuccess_Implementation@ULocalTargetingSystem@@UEAAXUFHitResult@@@Z)

fathom aspen
#

FinishRestartPlayer is what possesses your pawns. It doesn't possess them until they are not valid. Breakpoint that, see what's going on. I would even breakpoint the whole procedure from the beginning

#

I have no idea how your code looks like so I can't say what you're doing wrong

pliant moss
#

So if i have a function with UPROPERTY(Server, Reliable) and when it runs the GetWorld()->GetNetMode() == NM_Client is true. That should not be the case right?

#

or have i missunderstood NetMode?

dark edge
#

I like to have control rotation drive head/look, and movement direction drive body/yaw

#

Control rotation is NOT synced to other clients

#

You'll want to use GetBaseAimRotation for everywhere

#

Or one of those other stupidly named functions

fathom aspen
#

Or it was falsely spawned client side?

pliant moss
fathom aspen
#

Yes

dark edge
#

unless you want the head to not be able to rotate in yaw relative to the body

pliant moss
vagrant grail
dark edge
#

is strafing a thing

#

See how there's 2 directions?

fathom aspen
#

You manually spawning them right?

dark edge
#

if you're standing still and look right then down, does just the head move, or the entire body rotate?

shell forum
#

But I haven't tested in production

fathom aspen
#

You should call SetPawn after they spawn

#

Was that your missing piece?

#

Ah I see

shell forum
fathom aspen
#
// Try to create a pawn to use of the default class for this player
        APawn* NewPawn = SpawnDefaultPawnFor(NewPlayer, StartSpot);
        if (IsValid(NewPawn))
        {
            NewPlayer->SetPawn(NewPawn);
        }
#

Inside AGameModeBase::RestartPlayerAtPlayerStart

shell forum
vagrant grail
shell forum
fathom aspen
#

Forget the name

#

It's part of the procedure

#
/** Setter for Pawn. Normally should only be used internally when possessing/unpossessing a Pawn. */
    virtual void SetPawn(APawn* InPawn);
shell forum
dark edge
shell forum
#

Relatively simple.

#
  • some slight rotation when turning to the side if I see that correctly. Just multiply the yaw by a smaller factor and set the neck bone yaw.
vagrant grail
shell forum
#

in an animation blueprint

#

assigned to your player's skeletal mesh

dark edge
#

Assuming you want ControlRotation to be your aim/view direction:

HeadRot = GetBaseAimRotation()
BodyYaw = SomeFunction(BodyYaw, Velocity, etc). You can probably do it with Orient Rotation to Movement but that won't just hand you the turn-in-place.

dark edge
vagrant grail
shell forum
dark edge
vagrant grail
shell forum
dark edge
fathom aspen
shell forum
#

then you can get the baseaimrotation in the eventupdateblueprintanimation.

#

and assign that to the pitch

#

or head rotation or whatever

#

and modify the bone

#

but multiply by -1 to inverse the pitch

vagrant grail
shell forum
pliant moss
vagrant grail
dark edge
#

AnimBP event graph copies data from Pawn to its own variables.

#

Then the AnimBP animation graph uses its own variables.

#

Show your animbp event graph

vagrant grail
shell forum
# vagrant grail

Do the same but for the pawn's base aim rotation pitch, multiply by -1, and set it to a variable

#

create a pitch variable in the animbp

pliant moss
#

But i should be able to call a server function from inside an client function right? and it should still run on the server

shell forum
#

You don't need aim rotation as a variable.

#

Watch the tutorial I linked above earlier.

#

It will guide you through exactly what you want.

vagrant grail
#

I think the tutorial above uses the Tick() function, is it good ? Because I learned to avoid Tick() function as much as possible and go through events instead (except if it's really not possible otherwise)

dark edge
#

and something like updating something based on aim IS a thing that would be on tick.

#

Event Blueprint Update Animation is sorta like the AnimBP's Tick

graceful flame
#

You could make a black box at 0,0,0 and add some loading sprite inside there, then just make sure the rest of your level is positioned above 0,0,0.

#

Or hide 0,0,0 inside some rock or something

pliant moss
#

jeeeesssseee. atleast i will be able to go to sleep now

fathom aspen
pliant moss
#

Anyways, thanks for helping me along the way. going to bed, cya!

fathom aspen
#

Looks like so

#

They are both called on server

#

Possessing and OnRestartPlayer

fluid summit
#

Hi! i think i'm running into some troubles by using soft objects references

#

i'm using this Structure to hold the info about some tiles (the floor)

#

i have one array of those Structure , that OnRep i use to update the static mesh of all the tiles on the client

#

i was thinking on use "Soft object ref" because if i use the direct ref, the array gets really big in size extremelly quickly and fails to replicate

#

the problem with the "Soft object ref" is that even if the resolve is okey, it fails.

#

This gets fired "OnRep" works okey if i use the "Object ref" but fails to update the static mesh if i use "soft object ref"

#

not sure why is this happening (the soft ref resolves fine) or how to workaround it, any suggestion?

elder sage
#

what would be the basic method to store teams of players, and also to change gameplay attributes based on the team something originates from? An example would be how in Overwatch, some vfx are reduced in intensity if they originate from the same team as the local player

#

I'm thinking something like using the player state array's onrep to map each player state to an int, representing the team number. Then you can just call that from your game mode when needed for things like material functions

dark edge
#

Pawn can get from playerstate, and most things have Instigator attached so you can trace up to originating pawn

elder sage
#

I'd like to avoid casting the player state every time I need to get the team number. Maybe I'm just overthinking it though

fluid summit
dark edge
#

Or even have a teamcomponent

#

Can particles read from Parameter Collection?

#

I'm fairly certain they can, in that case, put TeamInt on a material parameter collection too

elder sage
vagrant grail
fluid summit
# fluid summit Hi! i think i'm running into some troubles by using soft objects references

Just in case anyone has a similar problem, i solved this by adding one ActorComponent for each tile that holds the references and its set to replicate.
The static mesh references is set to replicate OnRep and you trigger that one OnBeginPlay.
that way each component handles the update to the Clients when they spawn and you don't need to store the StaticMesh reference in one array

elder sage
# vagrant grail

what is the control rotation at this point? There probably isn't one set if it's not the local player, as there isn't a replicated controller

vagrant grail
elder sage
humble bane
#

i know am late but thank you prayge

prisma pelican
#

is there a method to set player controller properly? the server can read everything except for is Input Key Down from player controller

elder sage
vagrant grail
elder sage
elder sage
#

also, you can't use control rotation iirc because that is set directly by the controller

#

make the local player set a replicated value, and its onrep can also send that to the anim BP

vagrant grail
elder sage
prisma pelican
#

@elder sage what would i use instead of player controller?

#

do i have to assign each player to a controller before run time?

vagrant grail
elder sage
elder sage
#

another part of your issue is probably that a client can't set something and expect it to replicate. The server is authoritative and will have to do that if you don't want it to be corrected

vagrant grail
elder sage
#

because the local player has a player controller

#

then you rpc the server to set that rotation

vagrant grail
#

The tutorial I followed he used Tick() and I'm not confortable the way he did it as I think there's a better way to do it

elder sage
#

what do you want to do, not update this value in real time?

vagrant grail
#

like update it when the mouse moves, isn't it a better idea ?

elder sage
#

it kinda doesn't matter because the mouse would be moving so much

#

however, those axis events fire constantly, even if there isn't an update to the value

vagrant grail
#

oh then it's the same as the tick()

prisma pelican
#

@elder sage does get player state, then get player controller work?

elder sage
prisma pelican
#

because player state can be replicated

#

but it still does not read

elder sage
#

do what you want with that information

prisma pelican
#

aight ty

elder sage
#

you should read the Cedric network compendium if you haven't already

#

read it all the way through, skip c++ stuff if you want, and then reference it often

prisma pelican
#

alright time to start reading

tranquil yoke
#

I have a component, in which i have a replicated Variable

    bool bHasParent;```
for some reason, whenever i update this parameter on server, it is not replicating to Simulated Proxies.
I have no idea why this is happening.

on the other hand this seems to work 
```    UPROPERTY(EditDefaultsOnly, ReplicatedUsing = OnRep_ReplicatedTransform, Category = "RepComponent|Networking")
    FCustomTransform ReplicatedTransform;

Server Functions :-
Sending bool

{
    if (Comp)
    {
        Comp->bHasParent = hasParent;
        Comp->GetOwner()->ForceNetUpdate();
    }
}

Sending CustomTransform

void APlayerController::Server_SendTransform_Implementation(URepComponent* Comp, FCustomTransform NewTransform)
{
    if (Comp) 
    {
        Comp->ReplicatedTransform = NewTransform;
        Comp->GetOwner()->ForceNetUpdate();
        if (Comp->bUpdateOnServer)
            Comp->OnRep_ReplicatedTransform();
    }
    
}
prisma pelican
#

tyty

vagrant grail
#

@elder sage I did this for now, is it good ? What do I have to do next ?

prisma pelican
#

@dark edge i see ty ill figure some other way

dark edge
prisma pelican
#

check hold down duration

dark edge
#

Input can only get to the server through run on server events

#

So you'll have to either send button down and up as events or send held duration with the up or however you wanna do it.

#

Some stuff is automagically synced through components or Character but that's all run on server events behind the scenes.

prisma pelican
#

yeah it works now!

#

i called the event to server too early before

#

thanks mate @dark edge still got alot of reading to do lol

pure mango
#

I'm experiencing such a weird issue
I have a replicated LinearColor, just the usual
It works like 90% of the time and the color is correct but sometimes it's black for some reason
I added print statements and noticed the color values are correctly replicated but for some reason sometimes the alpha value is NOT replicated?

#

For why reason is it that the RGB is correctly replicated, but not the alpha? And why only sometimes it doesn't work?

thin stratus
#

@pure mango are you 100% sure you don't have a 0 alpha somewhere in your setup?

pure mango
# thin stratus <@479500648103280650> are you 100% sure you don't have a 0 alpha somewhere in y...

Hm, I do have a tick that by default sets it to 0,0,0,0 if nothing interesting is happening
So actually if I change the default to 0,0,0,1
Then it now works
However interestingly, if I set the default to 1,1,1,1 (white)
Then occasionally the color will be like 1,1,0.617366,1... when it should've been 0,0,0.617366,1
So what this means is.. it's like.. partially replicated which is really strange. I'd figure you replicate it all or none of the LinearColor variable

fathom aspen
chrome bay
tranquil yoke
#

and RPC is happening, via PlayerController.

twin juniper
#

hi
I am making online game that have mini board games
I want to create session on server that has 2 players on it

#

anyone have any idea how i should do that??

eternal pumice
#

Hello people! I am new to ue4 networking and am just curious about something. I need my game to have a 100 players in a match, but I doubt unreal editor or even after building my projects client, my pc will be able to handle that many game instances. Any way I could do this stuff so that my pc does not die?

bitter oriole
#

Remember, 100 players is insane

#

Very difficult to optimize, and almost impossible to get the players

eternal pumice
#

I think you are right

#

But it'll be a task explaining it to the client

prime island
#

Hi guys, if I want to test multiplayer through Advanced steam session with 2 Pc's , I always need to package my project, and than pass it to the other desktop? Isn't it enough to just copy the project files to my other desktop and launch it as Standalone? Thanks in advance!

pure mango
supple vessel
#

Hello i developed my dedicated server and if i use IPV4 adress for Open level node. It works for the same LAN
But i want to make connectable for different LAN's so i changed the IPV4 adress with my computers IP but it's not working now. How can i do my ggoal

gilded merlin
#

@supple vessel if you want I can show you how to do that, we can go voice

supple vessel
gilded merlin
#

Guys, any idea why server doesn't get client movement replication anymore when client is attached to other actor? (Attached on server and all clients) (I use acharacter for movement)

gilded merlin
supple vessel
gilded merlin
#

you have to open your default router address (something like 192.168.1.1 probably) and look there to forward your ports

supple vessel
#

did i do something wrong ?

gilded merlin
#

Seems alright, but I need to see that to tell you 100%

supple vessel
gilded merlin
#

sure

spark fractal
#

how do I check if ClientTravel has failed?

spark fractal
#

looking to make sure the ip the user enters is valid before putting it into the clienttravel or if it fails let the user know

pliant moss
#

Im a bit confused by the documentation. If i have a playerController that should have a Replicated character reference. What do i put in the DOREPLIFETIME and why?

bitter oriole
#

The Character

#

Looks fine to me

pliant moss
#

But i want to understand whats going on. What is the first argument. could it be something else then the current class in some special cases?

bitter oriole
#

Here's what it does.

#define DOREPLIFETIME_WITH_PARAMS_FAST(c,v,params) \
{ \
    static const bool bIsValid_##c_##v = ValidateReplicatedClassInheritance(StaticClass(), c::StaticClass(), TEXT(#v)); \
    const TCHAR* DoRepPropertyName_##c_##v(TEXT(#v)); \
    const NetworkingPrivate::FRepPropertyDescriptor PropertyDescriptor_##c_##v(DoRepPropertyName_##c_##v, (int32)c::ENetFields_Private::v, 1); \
    RegisterReplicatedLifetimeProperty(PropertyDescriptor_##c_##v, OutLifetimeProps, params); \
}
#

Replace c, ##c, v and ##v in that code and you have valid C++

pliant moss
bitter oriole
#

Pretty much

pliant moss
#

and playerControllers are replicated by default so i dont have to set the bReplicates = true

echo geode
#

My custom GameState class Tick function is not working. I created a timer on the server side, i want to show remaining time in the UI. Can anyone help?

lime echo
#

Can I strive to make a game that supports both Listen Server and Dedicated Server? Or do I need to make two projects and adjust each one's code for its server-mode?

bitter oriole
#

Though arguably if your game works with listen why bother

lime echo
#

And in the order is different between these modes.

bitter oriole
#

SetupPlayerInputComponent should only bind a bunch of functions

lime echo
#

I do, because I need to bind my anim instance to some actions, and it is initialized only in begin play according to the gun the client chooses.

#

Do you think it's bad practice and instead I should bind it to the pawn, and then from pawn callback, call a function on the anim instance?

bitter oriole
#

Your anim instance should normally be entirely read-only, with its Blueprint graph pulling the pawn's state

lime echo
#

Alright! That does solve the coupling between the two. And any other actor that needs input (like a gun), should just be a pawn, instead of relaying on the main pawn's input?

bitter oriole
lime echo
bitter oriole
lime echo
# bitter oriole Still want to read from the pawn

But then the problem returns. They will subscribe in in their AActor::BeginPlay after spawned from the APawn::BeginPlay, and will subscribe to the pawn's input, meanwhile the input component might not have been initialized, since APawn::SetupPlayerInputComponent was not called yet.

bitter oriole
#

They will subscribe in in their AActor::BeginPlay after spawned from the APawn::BeginPlay, and will subscribe to the pawn's input
No, they will not have any input code

#

They will check for an owner, cats it to your pawn class, and then read the input state with some getter

lime echo
#

So the pawn will have it's own delegates (or variables) which will share input data with the guns?

bitter oriole
#

getters

lime echo
#

Cool! Thank you man very much for your advices! That cleared my mind!

obtuse field
#

Why my seamless travel doesn't work?
I made such function:

void UMiscFunctions::ClientTravelTest(APlayerController* PlayerController, const FString& IP)
{
    PlayerController->ClientTravel(IP, ETravelType::TRAVEL_Relative, true);
}

And I'm calling it in blueprints, but it doesn't teleport me to another server. It just shows black screen. Everything works fine if I use OpenWOrld instead of ClientTravel, so this isn't a problem with my connection

bitter oriole
obtuse field
bitter oriole
#

Seamless travel is only for a client, connected to one server, when the server switches levels

#

From that page:

There are three ways in which a non-seamless travel must occur:
When loading a map for the first time
When connecting to a server for the first time as a client
When you want to end a multiplayer game, and start a new one

obtuse field
#

Hmm... ok

#

Then, I guess I can travel non-seamlessly to a new server, right?

#

If so, what's the difference between non-seamless travel and open level node?

bitter oriole
#

The documentation page you link explains that

#

With the added data that the open level node should be UEngine::Browse

latent heart
#

I think the open level node will disconnect everyone?

obtuse field
latent heart
#

When called from a server then.

#

It doesn't take the clients with it.

#

And since a client has no clients, what I said still stands :/

silver loom
#

What's a good way to solve latency issues? I host a session & my friends movement goes crazy.

dark edge
#

You in BP or C++?

silver loom
# dark edge Design around them.

I have. I’ve used RTCs to server & multicast via switch authority. But every time I package the game it lags. However on the editor no lag

dark edge
silver loom
dark edge
#

P R E D I C T I O N

echo geode
#

It's too weird i can't figure it out.

odd parrot
#

Hello everyone, oddly enough I have a security related question for ya!

I am currently working on a game that uses listener servers for cooperative play. My team and I would like to add some retention systems (no purchases mind you, just cool stuff people can unlock during multiple play sessions). Right now, we use the OSS's user cloud storage in order to make this happen. When a play session ends, the host sends the session score results to each client, and then they modify their user cloud storage with those results. My concern is that because we are using listener servers, the host code that authoritatively handles things like scoring and retention rewards isn't trustable considering it occurs on one of the clients. We know this is largely unavoidable considering the nature of listener servers in general, but I was wondering if there were any techniques we could take advantage of to make the process of modifying these results at least harder? My initial thought was to independently verify the session score results on each client, since we send that data to each client anyways.

Thank you for your time!

lime echo
#

Hi! I would really appreciate your help with this. Let's say I have a class AOwner which, server side, spawns a class AChild so that every client gets a AChild spawned. Now, I need each AOwner to get access (pointer) to the AChild that was spawned on his connection (essentially the AChild that he owns). However, only the server can access the child he spawned. So how can I get this to happen? Thanks! 🙂

latent heart
#

Some more context might help

lime echo
fluid summit
# lime echo Hi! I would really appreciate your help with this. Let's say I have a class `AOw...

A) If you are spawning one AChild for every Client on server side, you can get an array or some list.
B) If you are spawning one AChild for every Client on Client Side Only, you have no way to access it with a pointer from the server.
What you can do on B is execute whatever you need with a RPC(OnOwningClient) and run your logic, you can access the reference to the client from there

latent heart
#

Your desired behaviour is an attempted solution to a problem.

dark edge
#

Owner and child are replicated actors right?

lime echo
lime echo
dark edge
#

ok so what's the problem?

#

is the ref replicated?

latent heart
#

You're replicating every actor to every client, regardless of who "owns" it?

lime echo
#

The problem is that I have ref from child to owner, not from owner to child.

dark edge
#

In Owner, spawn child, then set a ref on self.

latent heart
#

Have a tmap on the owner and then cry when it doesn't work with replication 😄

dark edge
#

Owner
SpawnActor(child) -> Set MyChildRef

latent heart
#

The issue is that it's 1 owner and many children, I think, adriel.

#

So you'd need a TArray of children.

dark edge
#

he says many Owners and 1 Child per owner

lime echo
#

I would've just spawned every child from every actor locally, but I need child to be properly replicated, not just spawned on every client.

latent heart
#

Let's say I have a class AOwner which, server side, spawns a class AChild so that every client gets a AChild spawned
Nowhere does he mention multiple owners

dark edge
#

next sentence

fluid summit
#

What is your relationship for owner->child?
1-1
1-n?

latent heart
#

Good point, Adriel. I shall try reading next time! 😄

lime echo
#

Lol

dark edge
#

This is very much an XY problem question though, Owner having ref to Child is trivial.

thorny saddle
#

hey folks

#
    if (bPrivateInventoryReplicate)
    {
        DOREPLIFETIME_CONDITION(UPCSInventoryActorComponent, Inventory, COND_OwnerOnly);
    }
    else
    {
        DOREPLIFETIME(UPCSInventoryActorComponent, Inventory);
    }
lime echo
latent heart
#

And so is child having a ref to owner

thorny saddle
fluid summit
#

profit

latent heart
thorny saddle
latent heart
#

And how do you create the component?

lime echo
thorny saddle
#
    UPROPERTY(EditDefaultsOnly)
    bool bPrivateInventoryReplicate = true;
thorny saddle
#

in constructor

fluid summit
#

Child -> Replicates (true).
I don't understand what is the problem

latent heart
thorny saddle
#

and how can i fix this btw any idea?

latent heart
#

Honestly no idea. Should work?!

thorny saddle
lime echo
#

So you say that if I spawn locally the child on every connection, and child is set to bReplicates = true, then it will actually replicate? Isn't there a need to spawn it on the server?

latent heart
#

Nothing spawned on the client will ever replicate.

latent heart
#

A UObject/AActor constructor is only for defaults.

fluid summit
thorny saddle
#

i mean in beign play

latent heart
#

No.

lime echo
thorny saddle
#

not change

#

no?

latent heart
#

And it only calls it once.

#

So if you cahnge it after that function is run, it will make no difference.

unkempt tiger
#

Does anyone else find that the FPS is awful when playing with 2+ players in PIE as client? I can't really comfortably test anything due to the bad performance, I don't remember this was the case back in 4.26 (right now on 5.0.2)

lime echo
# fluid summit Show code/blueprint please

Owner.h

AChild* Child;

Owner.cpp

func BeginPlay():
  if (HasAuthority()) SpawnChild(); // Spawn child via server.

func SpawnChild():
  Child = SpawnActor<AChild>(...); // AChild's bReplicates = true

Now the problem is that meanwhile the child is spawned for every connection and is properly replicated, only the the AOwner actors on the server, have a reference to their child (on the server) that was set when they spawned it in AOwner::SpawnChild.

fluid summit
#

are you replicating the variable "Child"? Not the Child itself, but the variable that points to the child.

fluid summit
#

the pointer is never going to be replicated to the clients if it's not set to replicate

lime echo
#

Yeah, but I didn't try to replicate it. As I understand, replicating it will just sync the value of the server with all the proxys, which is not what I need. I need that each AOwner (regardless if proxy or not) will have to the child spawned on his connection.

#

Sorry for being long with this one, I'm just new to multiplayer and trying to get down the fundamentals well.

fluid summit
#

Replicate the Owner, replicate the Child, Replicate the reference to the Child.
When you want to access the Child that everyone has on the ClientSide ->

Get the child ref from server side and execute whatever you want on RPC -> OnOwningClient

#
BRY

📹 Part 4 of our replication series unlocks limitless potential with Multicast and RepNotify! In this video, we dive deeper about how Unreal Engine's Actor Replication really works as well as introduce ourselves to a variable replication and how combining the power of variable replication with an event driven design can help us build a multiplaye...

▶ Play video
lime echo
#

Thanks, I'll look into this. Anyways it seems like something is wrong with my setup (in which the owner needs a ref to it's child).

#

And in general, thank you all for your help!

dark edge
lime echo
fluid summit
#

Nothing on server side points to anything on ClientSide, but if you spawn one actor with replication on, you will have.
Server Actor
|
Client ProxyActor - Client ProxyActor2 - Client ProxyActorN

#

if you want to access the Client version of any replicated actor, from the server. You need to do a RPC-OnOwningClient

#

Which kinda loses sense if you are replicating the actor, because it's going to be the same version for everyone.
I can only think of this being usefull for using non-replicated properties of The ChildActor

lime echo
dark edge
#

What exactly are you trying to do? It feels like you're missing how replication works.

lime echo
#

Yeah I'm starting to feel this too...😄😄😄 If you want I can explain the whole picture (it really is fine if you're done with me and my long discussion 😄). So far I tried to simplify it but it just seam to create confusion.

dark edge
#

Just spell out the InGame mechanic

lime echo
#

I have a class "Player" that has two fields of type "Weapon" (extends actor). Now Weapon is made to be very modular to create whatever weapon I want without extra code (uses composition). Now, Player sometimes asks weapon for abstract questions like CanSprint() to prevent sprinting when reloading, for exapmle. On the other side, weapon needs to ask it's Player questions like IsSprinting() to prevent reloading while sprinting. My Idea, was replicating the Player class and the Weapon class and let each pair on each machine communicate with each other, while both classes are updated from the server. That's why I need references between both.

pliant moss
fluid summit
lime echo
fluid summit
#

If you take the client's side of the history to handle behavior on the server side, you are looking for trouble early on

lime echo
fluid summit
#

Any information that you take from the client that it's not replicated can be used to exploit your game

lime echo
#

And the problem with components weapons is that you cannot have them as a nice blueprint, which means that in order to edit them in the editor I'll need to use something like a data asset.

#

idk, maybe I'm just protecting my weapon system. But I do feel, that changing it all just for one issue is a bit overkill.

dark edge
#

You're not describing anything fancy

#

You can do NON replicated stuff with replicated actors

lime echo
# dark edge Just spawn them as replicated actors and set the replicated references.

That really is a great solution! The only issue I see with it, is that I essentially replicate the each weapon twice (correct me of I'm wrong). Once as an actor in the world, and once as a property. I'll use that in the meanwhile, until I'll find a way to nicely access the local weapon which is already replicated, on each connection from each Player class in that connection.

rancid marten
#

would this be a good place to a question about headless server stuff?

dark edge
lime echo
rustic charm
#

Would a replicated UPROPERTY with COND_OnlyOwner replicate itself if the owner is later set?

dark edge
rustic charm
#

I tried, seems so

short arrow
rancid marten
real ridge
#

guys I have sql database with php script with logged players in game when I logg in game I can find a match then I will open lobby and there I Have table in this table I am downloading names from my table to know who is finding match too to make a battle but how to know if someone new start finding match or someone will left ? i need update that table but how to know when update ? i cant update every second because then I ma printing all names in table in row again and again

#

any tips ?

fluid summit
real ridge
#

i have own dedicated server

#

with eos and sesssions

#

and own database where I am coding backend

#

for matchmaking

latent heart
#

The trouble will be maintaining it after you release or if it gets popular. Chances are you re not writing a scalable system.

#

And it's probably not going to work 100%.

#

Does eos or steam not already have the ability to list players looking for games?

real ridge
#

but not really

real ridge
#

:DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD

rustic charm
real ridge
latent heart
#

I'm not sayi matchmake through steam or eos necessarily, just let them handle the player lists and who is looking for a match.

#

You can still matchmake yourself and spin up dedi servers.

real ridge
#

but atleast I need own database of registered/ players , their loggins

#

emails

#

and so on

#

for this i am just using my own database

#

via varest

latent heart
#

Why? Use steam and eos accounts?

real ridge
#

i am using login via eos but I wanna also to use own login so they can register in webbrowser

#

and i will store their data

#

in database

#

why stick with only one login possibility

latent heart
#

That's going to make people not play your game.

real ridge
#

why ? i know many games where u have to register like warthunder or world of warplanes you make an account and can play

#

or play just via steam

latent heart
#

There's a difference between games with a big enough pull to require users to register.

#

You said yourself, your game won't be popular.

#

If I have to register on some website to play a game, I'm probably not going to.

#

You can't just say, "well Blizzard makes people register with them to play Wow, so it's fine for me."

twilit radish
#

Also regardless of the whole discussion. You probably don’t want a persistent database for matchmaking. Your clients should interact with your website / backend to request a game or cancel the request. Your servers should then based on those requests matchmake people in the queue together. This can all be done in memory and by communicating with other servers.

#

You could use Redis or similar if you want an in memory database if you’re afraid of crashes but sql seems like a bad choice honestly.

real ridge
#

so varest php and SQL Ngmi?

#

not gonna make it

#

😂

#

better to take tips from someone like u ..

real ridge
fluid summit
# real ridge via varest

i did the same setup as my first project to learn multiplayer.

I would not recommend the database to handle the logged/players looking for games stuff.
The database can be handled ok with mysql for player information, statistics, config, etc.
The login may be easier with Firebase (good free plan and easy to setup) and the matchmarking with steam.
That's all the experience i have on that area

real ridge
#

sounds good

#

i was using it for storing loging data in my app

real ridge
#

can I more talk about it with u in DM Tommorow?

clever verge
#

the OnPossess() function on the APlayerController, it only run on the server?

prisma pelican
#

is there a point in using switch has authority if it's a listen server?

dark edge
#

That's your test for if you're on the server

prisma pelican
#

I see, I thought that a listen server is from one client hosting so therefore it would always return remote

#

thanks @dark edge

dark edge
#

You basically have 4 choices.

Host's pawn on Host= Authority and locally controlled
Client's pawn on Host = Authority and NOT locally controlled
Host's pawn on Client = NOT authority and NOT locally controlled
Client's pawn on Client = NOT authority and locally controlled

clever verge
red furnace
#

Does anyone have a few minutes to take a look at my project and help me with some multiplayer concepts?

I was hoping to stream my screen in one of the vacant channels, maybe the Programmer Parlor or just a personal call 😁.

red furnace
graceful flame
#

yup that one

red furnace
#

It's been a awhile but I guess i can read it again.

graceful flame
#

Asking here with great detail and screenshots is also a good strategy, lots of eyeballs here.

red furnace
#

haha for sure. I just feel there are so many parts to this problem i didn't want to bog up the chat.😋

I'll see if I can really refine the question. I think my lack of knowledge is in ownership.

fossil spoke
#
  1. Engine code, Pushmodel is relatively simple and is used everywhere.
#
  1. Yes, significance manager helps you manage reducing performance costs for Actors, it is not specifically tied to Network performance.
#
  1. Custom Net Serialization is simply the act of manually managing how data is packed when being sent across the network (for performance and other magic). It is useful for custom types you define.
ripe basin
#

@fluid summit Watched that Multicast & RepNotify vid, super engaging and fun. I'm sad there's no Part 5 even just to watch him explain shit I might already know but in a fun way. lol 😭

fossil spoke
#
  1. Fast Arrays are what they are in the name, a faster way (performance wise) to replicate a regular array.
#

@sonic dock It is best to read the documentation and especially the Engine Code as these things are well commented and explained in extreme detail.

red furnace
#

Tried to make a quick info graphic of the problem I'm having. In short, I know its a replication concept I'm missing but I can't figure out what. I even made a different project with a simplified process and it works there but not in my main project😋 .

#

the sample project that works^

red furnace
# red furnace

As a caveat, all the tiles are spawn on the server. Any ideas why the server isn't replicating to the client?

sonic dock
sonic dock
fossil spoke
#

You dont need to handle serialization yourself if you dont want to.

bitter oriole
fossil spoke
#

That to of course.

warped sentinel
#

Hi guys I got a problem I've been try to get my head around for a couple of weeks, basically I got a listen server with 2 player ( player 1 is the server player 2 is the client) I been trying to get rpc run on server on player 2 charcter blueprint or player 2 player controller but neither rpc seems to work it just skip the node at start I thought it might be because of ownership but the problem also appeared on player 2 controller and the log didn't show anything about ownership I could send pic of my code if needed

sonic dock
bitter oriole
#

If you have types that cannot be automatically serialized

#

Like a complex non-Unreal class

fossil spoke
#

Or you want it packed in a specific way.

fossil spoke
#

You may only care about partial pieces of information being sent across the network, you maybe able to extrapolate whats missing on the other end.

#

Therefore saving on bandwidth.

marble gazelle
#

But if you do that, be aware that these won't work with the BP VM, so they can't be function local variables or custom pins, as the VM just serializes Reflected properties <.<

bitter oriole
fossil spoke
sonic dock
#

But then NotReplicated will do the work

fossil spoke
#

You can specify which UPROPERTY members are not replicated.

sonic dock
#

Just last doubt. Can you give an example use case where we want serialization which can't be simply done with NotReplicated tag

bitter oriole
fossil spoke
#

Take a look at FHitResult

#

Its a good reference for NetSerialization

#

Look at how the Struct is laid out and exposed to Blueprint, then look at how and specifically why their NetSerialization function is setup the way it is.

sonic dock
#

Thankyou so much both @fossil spoke @bitter oriole Really appreciate your help

#

I will look into hitresult, thanks

fossil spoke
#

Always refer to the Engine code for references on how something is done.

#

Its your best form of documentation.

sonic dock
marble gazelle
fossil spoke
#

Be thorough in your explanation

warped sentinel
#

Sure give me a couple of min

warped sentinel
#

ok the first image is the character blueprint and the second is the player controller I'm trying to do the same thing basically in both the character and in the player controller to see which one work but they both won't execute the rpc

thin stratus
#

One problem is that you CAN'T set owner on client

#

So the server RPC in the actor itself won't work

#

You need to already be on the server to set owner

#

The rpc on the PlayerController however should theoretically work?

#

Eh

#

1 sec

#

Phone autocorrected to can instead of can't

warped sentinel
thin stratus
#

You also can't just use variables from a different exec line in your rpc

#

The first image bottom right

#

You have to pass the data along

#

You can't use the wires from the top event

#

The whole setup look super wonky tbh

#

No idea what hot bar ref is

#

But if you already have that on the server why do you need the rpc

warped sentinel
#

basically iv got a hot bar with values in the client and I need set those values on the server

thin stratus
#

What is a HotBar

#

What is the parent class of that

warped sentinel
#

its a widget

thin stratus
#

You can't replicate widgets

#

You can't send them via rpcs either

#

They aren't meant to be networked

#

They should also not hold any data to begin with

#

Put the data into an actor

#

And let the UI just display it

warped sentinel
#

hm i will try it

sonic dock
#

Hi, has anyone worked with PartialDormancy for some connections which says it calls GetNetDormancy, but the engine implementation of says that per peer dormancy is not supported.
So does it work if we want to make an actor dormant for some connections? If not then why does Partial dormancy even exist for now?

#

Just for reference I am talking about ENetDormancy::DORM_DormantPartial

twin juniper
#

Hey guys I need to replicate this movement for my character, what is the best way to do this when I have an axis value? I know it is wrong to pass the input directly in the replicated event right?

chrome bay
sonic dock
#

Once we set an actor to fully dormant then we cant bring it back to awake right?

chrome bay
#

You can, dormant just means it's not changing currently. When you change a replicated property you just need to flush dormancy

#

But note it will stay "awake" until you set it back to dormant again

sonic dock
#

So basically flush net dormancy is one time replicated data push ?

#

It will stay dormant after push ?

twin juniper
chrome bay
sonic dock