#multiplayer

1 messages Β· Page 155 of 1

burnt hinge
#

how do i sync a map variable?

soft copper
burnt hinge
soft copper
burnt hinge
#

im using blueprint but replication option is disabled. I just read that i can eather fill the map after onrep or use a tarray instead

#

but i need to have the correct info before onrep...

soft copper
burnt hinge
#

oh... i already made the tmap into a struct but using the struct felt useless

#

i guess ill try that instead

solar stirrup
#

Nah it'll complain too

#

You can't replicate TMaps

#

Unless you write custom net serialization and wrap them in a struct

burnt hinge
#

so i need to use a tarray instead...?

solar stirrup
#

Would be the easy solution yes

#

You can always replicate an array and convert to a map locally if needed

burnt hinge
#

sounds confusing

solar stirrup
#

In that case stick to an array ^^

burnt hinge
#

fk sakes. i need to have a character with an index

solar stirrup
#

I mean arrays have indices

#

Worst case just hold it in the struct

grand kestrel
#

Instead of wrapping tmap, create a FFastArraySerializer and add your own tmap type functionality imo

solar stirrup
#

Blueprints

lost relic
#

Prob a stupid question but when adding EOS OR STEAM , can you have both or do you have to create a build for each service?

fathom aspen
#

You can't configure multiple online subsystems but only one. It's done in a specific manner in one of the ini files

lost relic
#

so one build for steam and one for epic then?

warped oxide
#

I'm only here to say that learningn how to make multiplayer makes my head hurt

burnt hinge
quartz star
#

is there a good way to replicate the characters YAW and PITCH ?

nimble bobcat
#

Hi all!
Has anyone worked with Edgegap before? https://edgegap.com/gaming/unreal

They partnered with EOS a couple of days ago. What are the pros and cons of this service?

The easiest way to launch & scale a multiplayer game with Unreal & EOS. Edgegap's automated game servers & orchestration level up your multiplayer.

rose pollen
#

has anyone benchmarked a "Shipping" dedicated linux server build vs a development build? I don't distribute the dedicated server so I have just been using a development build, but I was curious if that significantly hurts performance

twin juniper
#

Hey, can i multicast but only to those that satisfy some conditions?

#

The situation is there are 3 players, 2 players opening the same chest. Player 1 change the chest content and the chest widget on each player's PlayerController need to be updated. If i do Client RPC, only the player 1 get the update. If i do Multicast RPC, all 3 players get the update even though player 3 is not opening the chest.

#

So i need a way that only who is opening the chest get the update.

#

Maybe i should set the chest's revelancy to only who's opening it.

fossil spoke
#

Just send individual RPCs to those PCs only

#

Dont use a Multicast

#

Multicast cannot send to specific connections, it sends to all.

twin juniper
fossil spoke
#

An operation that changes the contents of a Inventory should be managed by the Server

#

A Client can make a change locally, but it must be also sent to the Server to authoritatively make that change

#

At that point the Clients would be updated with the new state.

#

Including the Client that made the change

#

You want this, so that if the Client tried to cheat or made an invalid operation, they can be rolled back to the correct state as determined by the Server

twin juniper
#

yeah i change the content in the server, but Client RPC only send back to owner?

#

or i can have multiple owner?

fossil spoke
#

Huh?

#

The Client would send an RPC to the Servers version of the Chest

#

The Chest would make the change on the Server

#

The Chest would then send an RPC down to any Client that has it open

#

Via their PlayerControllers

#

You would need to manage a list of the Players who have the Chest open

#

So you can make those RPCs

twin juniper
#

oh, so i store the list on the chest

#

it kinda make sense now

fossil spoke
#

Well how else would you know whos got a Chest open?

twin juniper
#

yeah im being dumb here

#

multiplayer always make me overthinking

rose pollen
#

is there a simple way to let players see a simplified version of stat net like in fortnite? I want to show them ping / packet loss / fps

civic storm
#

For console command open + connection string, what function is it calling? And is there a command list for their respective functions in source? I kind of want to understand where the commands come from and call

burnt wadi
#

Does EOS not support crossplay between PC and MacOS? I tried to search someplaces say it does some say it does not

#

Wait I see this is cross store support, soooo it does not support crossplay? MacXwindoes

burnt wadi
#

When i myself tried it didn't work, windowsXwindwos works and mac does login normally and also create session it's just the WindwosXMac aren't working πŸ€”

civic storm
thin stratus
#

Cause that's, despite ServerTravel, how this usually is used

thin stratus
#

Might be the magic button to allow crossplay in general?

honest bloom
#

help please, I still didn't manage to figure it out

burnt wadi
burnt wadi
# honest bloom Sure. There is the log

this is the client logs right? send server too also let it run for 60 seconds after it starts showing sent 10 packets in last 10 seconds, it i think aborts automatically in 60sec and shows bunch of errors then too

#

i am no expert but people here might benifit from those logs to help you πŸ˜„

honest bloom
burnt wadi
#

Hey @toxic falcon those 60 sec failsafe specific to your plugin or are unreal's own feature?

cosmic yoke
#

hello i have a custom actor that a player can interact with the with F key. When that happens the custom actor needs to do a server rpc to do some server side logic. The problem is that the server rpc won't be processed because it doesn't have a valid connection. To fix this right now i only see 2 options:

  • Use the player character as a proxy to do a server rpc that takes in the custom actor as a parameter to either set its owner to the player character so we can run server rpcs or to run the actual logic
  • A bit more hacky approach is to override GetNetConnection on the custom actor and just return the first valid player controller

Obviously the first one is more correct, but doesn't seem very scalable if i have 30 different custom actors that i can interact (and need to execute server side logic) because i would need to make 30 server rpcs for each type on the player character. Is there any other option that is more scalable?

fathom aspen
#

tl;dr use polymorphism to make it scalable

orchid eagle
#

Hey there
what is the right way to setup the motion warping for replication
my game is based on dedicated servers
i tried to make it to run on server for the main logic and when call the add or update warp target node i do that on multi cast event
and the on server event for logic i call that in the attack combo multicast event
here is some screen shots

cosmic yoke
#

@fathom aspen thanks i'll look into it

cosmic yoke
#

@fathom aspen you can't send interface pointers on the server RPC right? so on the ServerInteract i need to pass an actor as parameter and get the interface on the server side right?

fathom aspen
#

I'm not sure if you UHT allows you to pass function ptrs to RPCs, but yeah that was the intention, you pass an actor ptr, and it will figure out the right implementation of Interact that should be called

cosmic yoke
#

seems to be working thanks

wet nymph
#

Hi, I have a quick question, if the rotation is not replicated by default with Pawns, why the server rotation is replicated to clients (shouldn't it not replicate any rotation, neither the server one)?

dusk fable
#

can anyone suggest some tutorials on how to make a private session using steam advanced session ?
i found 2 tutorials with steam invites but didnt work , so any idea ?
ps : private either by using codes or steam invite system that works , thank you

wet nymph
#

If I use Has Authority to add Yaw Input to both it only rotates the server pawn instead of both tanks

dusk fable
#

no , check this video , has the same concept , https://www.youtube.com/watch?v=gG_ggXUiB_Q

Hey guys, in today's video, I'm going to be showing you how to replicate sprinting for your online multiplayer game. This will replicate the movement, speed, and animations.

More Replication Videos: https://youtube.com/playlist?list=PLQN3U_-lMANOaPmzSGLDhyWzKzwgKDz9V

#Ue4 #UnrealEngine4 #Ue4Tutorial
____________________________________________...

β–Ά Play video
wet nymph
#

The problem is that major of the youtube videos is that it talks about the replication through the CharacterMovement which handles a lot of things and automatically replicates the rotation which doesn't seem to be the case of the a "raw" pawn

dusk fable
#

but most likely u'll find vids regarding replication of rotation or any movement , take this for example

#

modify accodingly and see how it goes

wet nymph
#

I will try it, but I still want to understand why changing the Yaw rotation on the server doesn't change it's rotation on the server side

dusk fable
#

well i cannot pin point the issue without seeing and set up u have

wet nymph
#

I add yaw input to the tank controller every tick on server side

#

In this case on the server screen I would expect to both tanks to rotate, but only the server pawn rotates

#

There is any restriction to manipulate the other player controllers even from the server?

dusk fable
#

i dont think u have the right set up there , someone else might provide a better help but i think you should make a custom function put it to "run on server " n remove the "authority node " , then attach the function to the event tick

#

try and see , because im not sure

wet nymph
#

Still the same thing πŸ™

#

Only the server pawn rotates

shrewd ginkgo
#

in the same way, while the stabbing animation I made works in the clients, the aim animation plays only in itself, do you know why?

wet nymph
#

Since direct rotating with Set Actor Rotation works normally

wanton copper
#

Hi all. Have been bashing my head against trying to make a local multiplayer "Press X To Join" screen for days now and am having an issue where my second player controller is not receiving any input after being created with Create Local Player For Platform User (or just Create Local Player). I have tried replicating the solution mentioned here (https://forums.unrealengine.com/t/problem-with-enhanced-input-and-split-screen-on-ue-5-1/714667/13?). (add a delay to assigning the input mapping context

To be clear I am using 2 gamepads, not trying to use skip assigning gamepad to player 1. There are definitely 2 player controllers present in the outliner. When I press the submit button (face bottom) on gamepad 1 I see the print string "[Controller 0] Submit" so I know that's working. It doesn't matter which gamepad is assigned to which player, Either gamepad works for player controller 1 and neither work for player controller 2 (as well as checking the input works on hardware tester).

Does anybody know why this isn't working?

queen escarp
#

hey

#

im showing Floating damage text to all players, i want it to only show if the players character is within 1500 radious of "world location" really advice?

dark parcel
#

what's wrong with the current branch logic?

queen escarp
#

its getting the wrong actor location

dark parcel
#

though I would probably handle showing damage locally for ez mode

queen escarp
#

this kinda solved it tho

dark parcel
#

is this in character bp?

#

because u are running it on every instance of the character

queen escarp
#

yeah

dark parcel
#

if there are 4 players, u will be running it 4 times

#

one for each

queen escarp
#

exactly

dark parcel
#

dont use get player character 0

#

On your branch add extra check

#

and Is Locally controlled

#

if both are true then spawn damage text

queen escarp
#

like so ?

#

true, much smarter

dark parcel
#

well my brain might not work well atm

#

not sure what the end goal is, so test it first

#

if you wan to display player 1 attack player 3 as player 2, this probably won't work. I dunnoe

#

try to test with 3 players

#

1 listen server 2 clients

primal trellis
#

Hello guys

When players log in, I'm saving their name in a struct with two string arrays (team red and blue). What logic do I use to access and compare this information?

My intention is that the Red team doesn't cause damage to its own team, only to the opposing team, the Blue team

As I can't access the player controller from the client, I'm a bit lost on how to do this exactly

solar stirrup
#

But I would suggest using an enum for the player's team

#

and putting it on the playerstate instead

#

that way it's accessible to everyone

primal trellis
#

I will try, thank you @solar stirrup 🀘

prisma belfry
primal trellis
#

I created an Enum with blue team and red team and a new playerState. Then in gameMode, in OnPostLogin I call an **event **that is inside playerState, where I set the state of the Enum

However, when I instantiate a skill and try to access the client information (of the Enum), I can't, could anyone tell me why?
It fails exactly when casting to PS_MageState (which is the new PlayerState that I created)

Sorry for any stupid questions, it's my first multiplayer game

dark edge
#

you're saying "Hey, if you just hit a playerstate, set this variable"

#

you won't ever hit a playerstate

#

you probably want to check if you hit a YourBasePawnClass and check the enum value of its corrosponding playerstate

#

or something to that effect

primal trellis
#

Hmmmm I understand! I'll try it here, thanks! @dark edge

pine cedar
#

hey everyone I joined the server for some online mulitplayer help. I am planning on making a small arena fighting game (8 player max) in unreal and I'm adding multiplayer using blueprint. Will there be any pit falls doing this? Will I need to learn C++ to have functioning multiplayer?

pine cedar
#

Networked

gloomy tiger
# pine cedar hey everyone I joined the server for some online mulitplayer help. I am planning...

You can create an online multiplayer game Blueprints-only, yes; however, it's unlikely it'll be optimal. Been there, done that back in 2018. Wouldn't do it again.

A few points for you to consider:

  • Blueprints alone is slower than C++. (More here: https://intaxwashere.github.io/blueprint-performance/)
  • If going listen server, you're making one of your players the host. That is, you're outsourcing the duty of the server to their hardware. Because your code is BP only, by default, it's going to perform worse than a C++ solution - and this is a situation where you probably want the most out of it.
  • Also if going listen server, the player hosting is virtually executing two processes in parallel: the entire rendering pipeline (to actually see and interact with the game), as well as server code. That is, if running on poor hardware, even a good C++ code won't guarantee good performance, much less BP code.
  • Depending on your demands, you may need some custom code only achievable via C++. Fast Arrays, custom netgraph, etc.
dark edge
#

yes you'll need C++, depending

#

a fighting game will need some fancy netcode

#

Civilization, not so much

#

It might be technically doable but it'll be aweful to live like that

gloomy tiger
dark edge
#

The only Realℒ️ networked game I'd even consider doing in BP only is something turn based or otherwise not very high-paced. Civ, Rimworld, stuff like that.

gloomy tiger
#

For prototyping and having fun with friends, you probably can make it. For commercial purpsoes, today knowing what I know and after the frustrations I had, I wouldn't spend time and energy on it at all. Don't want to be the dreambreaker guy, but hey.

pine cedar
#

Where is a good place to start and will I need to make the project purely in C++ or can I do a mix between both?

dark edge
#

there's no such thing as purely in C++

#

just start working on it, you'll figure it out

#

that's a BIG order, I can't think of much harder to do than a fighting game with networking

#

Just start with BP and you'll learn where the C++ fits in

pine cedar
#

Thanks for the help. I just want to make something that people can play with friends nothing fancy or too competitive.

gloomy tiger
# pine cedar Thanks for the help. I just want to make something that people can play with fri...

I mean, "nothing fancy" and "too competitive" are quite vague.

And I'm saying this because you probably can go Blueprints-only for your project depending on how far you want to go. Are you going to sell it? Do you need anti-cheat? Is it going to be listen server or dedicated server? How stressful are your real-time needs?

I think Adriel is right - kick it off with Blueprints, but do it knowing that at some point you may need C++ and depending on how you wrote things, it may mean some overhauls/big refactors to make the port.

toxic lion
#

Is there something i need to do to foliage to get the removal of instances replicated to all?
I'm calling an interface on the FISM component via a server RPC and it's not able to replicate the removal of the foliage instance to all players

nova wasp
#

you would need a stable index of the ISM element

toxic lion
#

the index seems to be consistent on server and client from what I can tell.

#

Here is both client and server reporting the same index for the same foliage

#

Damage event here

#

And here's the logic on the FoliageInstancedStaticMeshComponent

nova wasp
#

So what's remove instance actually doing? You might see it do something unique for foliage

toxic lion
#

let me clarify
if the server player damages the foliage, the instance removal doesn't replicate to any other client
if a client damages the foliage, the instance removal only works for that one client, and the server

#

other connected clients do not recieve the update

nova wasp
#

so it might be that the server doesn't see the need to send the damage event to clients

#

you may need a different RPC

#

or even a replicated value of all of the dead indices per thingy if you need persistence arguably

#

look up the docs for RPC rules, you probably need to change what it does whether you have authority before sending it out etc

toxic lion
#

I mean, it works for actors right off the bat

#

all googling is showing me is that foliage isntances aren't' correctly replicated and everyone has issues with this.

#

I have tried using a replicated variable OnRep to brute force it, but the engine still does not replicate the removal of the instance to other clients

nova wasp
#

not like that...

#

I think you want something besides these that stores the replicated information

#

AInstancedFoliageActor is not even replicated

toxic lion
#

it not being replicated is probably whats' causing this greif. but it's so tightly coupled with the foliage system.

nova wasp
#

that's fine, you can make your own seperate replicated stuff that's not part of this class

#

nothing is forcing you to make this exact thing replicated, you could add a component to the gamestate or whatever that tracks this crap

toxic lion
#

hmm. let me give that a shot

nova wasp
#

also late joiners etc will need something that tells them which indices are toast

#

or vice versa

#

(if they are a planned thing)

#

Satisfactory didn't have that working for so long...

toxic lion
#

yeah nope. no such luck

#

I don't mind storing the information of which i need to remove when a player joins, but I can't get it to properly remove the appropriate instances.

#

is everyone just using actors in place of actual foliage for interacatble foliage in unreal?

warped oxide
#

So when I try to use the "Get Owner" node and print it as a string it returns literally nothing if I'm a client. Is that supposed to happen?

#

On an actor not already owned by the client

gloomy tiger
meager spade
#

Or not actually set.

civic storm
#

Anyone know how UWorld::NotifyControlMessage() gets called for remote players joining? Can't seem to find the thing that calls it. I see that UControlChannel::ReceivedBunch() has a call to it, but it doesn't stop when I put a breakpoint there

warped oxide
warped oxide
gloomy tiger
civic storm
#

Just trying to trace back how things get called just to know

civic storm
#

UPendingNetGame::SendInitialJoin() has NetControlMessage<NMT_Hello>::Send() but I'm not understanding how it gets the UWorld::NotifyControlMessage() called. I'm not seeing it bound to any delegates, but I may just not be looking in the right spots

keen hound
#

why can't i connect to my dedicated server? I use open level and try to connect, but it doesnt actually connect or add anything to logs

civic storm
twin juniper
#

Hey guys, i am having this weird bug, basically i call a client RPC from the server, when the RPC go to the client it will create a timer to wait for PlayerController.
However when the timer is ticking, i am actually in the server..? How did i went back to server?

void UInventoryManager::BeginPlay()
{
    Super::BeginPlay();

    if (GetOwner()->HasAuthority())
    {
        // Create inventory on server
        TryCreateStorage();
        // Create widget for player, not AI
        Client_WaitForController(InventoryStorage->GetDataStruct(),EquipmentStorage->GetDataStruct());
    }
}

void UInventoryManager::Client_WaitForController_Implementation(FmStorageData InventoryStorageData, FmStorageData EquipmentStorageData)
{
    FTimerHandle TimerHandle;
    FTimerDelegate TimerDelegate;
    TimerDelegate.BindUObject(this, &UInventoryManager::Timer_TryCreateStorageWidget, InventoryStorageData, EquipmentStorageData);
    GetOwner()->GetWorldTimerManager().SetTimer(TimerHandle, TimerDelegate, 0.1f, true);
}

void UInventoryManager::Timer_TryCreateStorageWidget(FmStorageData InventoryStorageData, FmStorageData EquipmentStorageData) const
{
    if (GetController())
    {
        if (GetController()->IsPlayerController())
        {
            if (GetQyPlayerController()->GetMainWidget())
            {
                OnAddStorageDelegate.Broadcast(InventoryStorageData);
                OnAddStorageDelegate.Broadcast(EquipmentStorageData);
                GetOwner()->GetWorldTimerManager().ClearAllTimersForObject(this);
            }
        }
        else
        {
            GetOwner()->GetWorldTimerManager().ClearAllTimersForObject(this);
        }
    }
}
#

Hey guys, i am having this weird bug, basically i call a client RPC from the server, when the RPC go to the client it will create a timer to wait for PlayerController.
However when the timer is ticking, i am actually in the server..? How did i went back to server?

hoary spear
#

Am i understanding you correctly that that is not the case?

prisma belfry
twin juniper
#

im playing as client, my server play worked so i am sure

#

i guess i could call RPC in timer but that's like a lot of RPC lul

#
    //- RPC
    UFUNCTION(Client, Reliable)
    void Client_WaitForController(FmStorageData InventoryStorageData, FmStorageData EquipmentStorageData);
    UFUNCTION()
    void Timer_TryCreateStorageWidget(FmStorageData InventoryStorageData, FmStorageData EquipmentStorageData) const;
#

my function declaraton is also fine

karmic trellis
#

I am new on multiplayer and trying to do some tries on host&play but I cant pull the WB variables -it gets blank- , in the last part 4st end the print gives 1:"Empty" and 2:"ValidWBRef". Where did I wrong? πŸ€”

hoary spear
#

User widgets are not replicated

#

Your attempted change is local

karmic trellis
#

hmm then how can I run an event in wb from client to Server easily? 😦

hoary spear
#

Through the owning player controller

karmic trellis
#

hum how?

#

have a tutorial for it can you prefer me pls?

hoary spear
#

An RPC in the owning controller

#

But...

#

Ur trying to replicate the lobby widget

#

Which doesnt really make sense

#

You want the clients to have their own, and replicate the current state of the players to their individual local lobby widgets

karmic trellis
hoary spear
#

Track the playerstate? Sure

#

Share the widget? No

#

Widgets are client local only

karmic trellis
#

I mean If I go state from client and do them Run on Server and direct it to Wb back?

#

It is like, go to player state and change to client to server there and go back to Widget for Server and run some commands there?

#

you meaned this?

#

πŸ€”

hoary spear
#

Its a regular lobby right ?

#

Where a few players join pre game and can do some selection stuff ?

karmic trellis
#

yess

hoary spear
#

Probably easiest to find a lobby tutorial really

karmic trellis
#

tried to follow some videos but everybody use different ways so hard to get the right way for me lol

#

ok I will try somethings thanks

hoary spear
#

Server is the only one with authority to set replicated variables amd have them replicate

#

You should check out some of the pins in this channel

#

Cedrics multiplayer compendium for one

queen escarp
#

if i spawn a VFX in a RPC and set it to a Variable

#

how will that work will each client have their own one right or

#

is this wrong doing it like tthis ?

rocky kestrel
#

I have big problem in my online game. When I shoot I do everything locally except when bullet hit ground. There is almost half second delay between bullet hitting ground and dealing SERVER damage.

[/Script/Engine.Player]
ConfiguredInternetSpeed=2500000
ConfiguredLanSpeed=2500000

[/Script/Engine.GameNetworkManager]
TotalNetBandwidth=400000000
MaxDynamicBandwidth=4000000
MinDynamicBandwidth=1000000

["Netdriver"]
MaxClientRate=3800000
MaxInternetClientRate=3800000
NetServerMaxTickRate=32

What could cause this latency?

#

Or could it be because I use "Windows development server"?

twin juniper
#

Is testing server travel still unavailable in-editor?

#

I just tried and it crashed.

#

And if yes, how can I test it, do I have to make a build for it? Seems too messed up, because making a new build every time I have an error or need to make a little change, will take ages.

stoic wing
#

i am still trying to figure out what is the issue with the widget. this is my dilemma: call rpc from controller at begin play, to spawn characters, and after the pawn is possessed, i try to create the widget:

dark parcel
#

@stoic wing not the same controller and widget

#

Each player running their own instance

stoic wing
#

the problem is that the widget of the second player to join is also displayed on the server. so as soon as the 2nd player joins, the server widget switches to the widget of the joined player. why is that happening?

dark parcel
#

They don't live in the same world

#

Just to answer the initial question it's not the same controller and widget

#

In the server if there are 2 players there will be player controller 0 and player controller 1

#

Meanwhile in client machine they only have their own controller. Controller 0

stoic wing
#

in the widget i draw the render target of a scene capture component on the screen, but as soon as the 2nd player joins, the server widget displays the same render target as the 2nd player

dark parcel
#

So controller 0 in listen server will point to their own controller while the client machine controller 0 point to their own controller

stoic wing
#

but then i really dont understand what's happening :/

dark parcel
#

What's the issue

dark parcel
stoic wing
#

so. this is my character BP.

#

i use this pixel SSC (scene capture 2D) to render a low resolution render target and i use the widget to display this render on the screen

#

but as soon as a 2nd player joins, the render target of the server changes to the render target of the joined client

dark parcel
#

Seems like u r creating another scene capture then

#

U want to make sure that the piece of code runs once on each player maybe. I'm not sure what the goal is

#

This sound something that should be handled locally too

stoic wing
#

i can explain hopefully: the goal is a 3d pixelperfect camera. i snap the scene capture component on a grid to achieve pixelperfect camera, but then i move the rendertarget in a widget every frame, so it moves smoothly, not jumping by "pixelart pixel" size

#

yes i want to handle it locally but i am a bit confused

#

i can send the project files if u want to check it

dark parcel
#

My take is that it should be something done locally on each character when they join

#

If u created another render target in the server ( which u can check ) then that's Ur issue and u need to isolate the code

stoic wing
#

that is my goal but i dont know how to make sure it happens locallyy

dark parcel
#

Should try something simple first then

#

Like setting variable or running simple rpc

stoic wing
#

i dont create the render target during the game, it is already in the content folder. is that an issue?

stoic wing
dark parcel
#

Good find tho, make sure to test thoroughly with 3 players if listen server

stoic wing
#

thank you for the help, i will keep testing it

dark parcel
#

Render target is just a comp

#

You can get all the players and check with get comp by class

stoic wing
#

not sure if this is what you meant . so i tried with 3 players. only the last player widget displays the correct player. and if i quit with the last player, then the "new" last player's widget starts to work properly

digital tulip
#

How can i make my flashlight aka the spotlight, only be visible to the owner of the flashlight?

#

so other players dont see it

solar stirrup
#

Enable/disable on the owning client only and make sure you don't replicate anything that would turn it back on

digital tulip
#

ok, and how can i make a different light that only other players see and not the owner?

inland hedge
#

How can I make sure that a client does not move on the server given a certain comparison? I have a state on a character (Sleeping or awake) and if the state is not awake it shouldn't be possible to move. I can just not call "AddMovementInput" if the character is on a state, but obviously this is client side only and that can't be trusted. Do I need to hook into some component code somewhere? Setting the movement mode doesn't seem to do anything

tiny pier
#

For some reason when sliding, client will go in the air while server will stay on the ground, bIsSliding, bIsCrouching & CurrentSlideForce is replicated

// NetMulticast, called from a Server function
void APlayerCharacter::HandleCrouch_Implementation()
{
    if (bIsCrouching)
    {
        // Crouch
        Crouch();

        // Slide
        if (bIsSliding)
        {
            // Add Forward Force
            GetCharacterMovement()->Launch(CurrentSlideForce * GetActorForwardVector());

            // Add Counterforce
            CurrentSlideForce -= CounterSlideForce;

            // Disable Movement
            bCanMove = false;
            bUseControllerRotationYaw = false;
        }
    }
    else
    {
        // Uncrouch
        UnCrouch();

        // Unslide
        bCanMove = true;
        bUseControllerRotationYaw = true;
        CurrentSlideForce = SlideForce;
    }
}```
queen escarp
#

Hey guys im working on my NPC rotating towards player function, im using a timeline atm with RPC wich i got told is a bad way* any tips on how to do it ?

#

Coldsummer i talked to you before about it hence why i wrote it down so im dealing with it now *

digital tulip
# digital tulip

Ok but how can i make the light not cast shadow on the mesh itself without turning of cast shadows for all lights?

toxic lion
# toxic lion Is there something i need to do to foliage to get the removal of instances repli...

Figured it out for any future searchers
As it turns out, it indeed is a bit more complicated then I initially believed

Replicating Foliage Instance Static Mesh Remove / Removal:

As a character, or character component:
- Perform trace to determine which instance requires damage (we just need location for now, not the index)
- In a server RPC spawn a new REPLICATED actor (likely the replacement actor)

As the newly spawned actor:
- When the replacement actor begins play, perform a sphere trace at the location of the original hit (small radius of 50 should suffice)
- Cast to FISMC (or your custom FISMC)
- Get the hit index and remove the instance
hoary spear
#

So they're not synced at all

#

Spawn a new replicated actor at some initial location determined by client -> locally trace for the correct index and remove it ...

#

I guess you can just remove the hit index from the initial client trace locally, and do the spawn actor for everyone else

toxic lion
#

That's a more concise way of putting it.
I was never able to get the initial client to remove the index themselves
It just wouldn't replicate to anyone else. I'm guessing because the client doesn't own the instance foliage actor, and thus the RPC was dropped
I'm sure i could have routed it through game mode / game state, or created a component on the player to handle some of this

hoary spear
#

Im a bit surprised by this tbh

#

Kinda makes me wanna test it

toxic lion
#

please do πŸ™‚ if there's an easier way I'd love to know. lol My way feels a bit hacky

hoary spear
#

Just to be sure we're on the same page: the foliage is spawned in the level at editor time right ?

#

Not some runtime shenanigans ?

toxic lion
#

correct.

#

also just edited my message to add that the spawned replacement actor had to be replicated. Should be a given, but just in case.

oblique arrow
#

Where it would be good place for the loot drop mechanic in MP game i've been considering game instance?

inland hedge
#

I'd probably take game mode since that runs on the server and game instance is client too

keen hound
#

why does joining my dedicated server cause it to close?

#

it causes the dedicated server to close

fossil spoke
keen hound
fossil spoke
#

It probably crashed?

#

Check the logs.

keen hound
#

nvm that was the wrong log

#

okay nvm once again, it gives the same error on the server

#

except it isn't a error, it's just closing when i try to connect

twin juniper
#

Hey, according to this, should i mark every Actor possible into DORM_DormantAll ? For example my inventory items.

fossil spoke
#

Can you step through it with a debugger?

fossil spoke
#

But specific optimizations to specific Actors depends on their purpose

#

If you read the dormancy documentation you linked, it suggests only Actors that do not change often be set dormant.

#

For example. If you have Items that are Actors on the ground, the only time they would change is when they are picked up (i would assume).

#

So they would likely be a good candidate for dormancy.

#

Items in an Inventory might change often.

#

You can change the dormancy whenever you like

#

So Items in an Inventory can be dormant if the Inventory is closed.

#

And when its open you can mark them as awake

#

These are just examples by the way.

#

It really depends on the game and its needs.

twin juniper
#

It's kinda vague that you said often. I mean, how often is often? 1 update per second? 100 update per second?

#

The player not gonna change inventory item 100 per second, more like once per 2s

fossil spoke
#

Its vague because its not really something you can just draw a line in the sand for.

#

Changing "often" can depend on something like Player input.

#

Obviously real Players can only provide inputs so fast.

#

But Players can fake inputs

#

With a macro or something

#

So how do you put a number on a scenario like that

#

An Item Changing might be it being "used" (whatever that means) in the Inventory.

#

If I spam the input to "use" the Item, its going to change at an arbitrary rate

#

You cant generalize that

#

So you push it out a level and say something like, all Items in an Inventory are not Dormant if the Inventory is open.

#

Because at any time, at any rate, they might change.

#

Also keep in mind

#

That dormancy becomes less important the more you utilize Push Model

#

As with Push Model, the Actor only builds its list of properties to replicate based on if they were marked dirty.

#

So if nothing was marked dirty, it will be skipped pretty quickly.

#

Yes there is still overhead involved with checking if there are any dirty properties, but its another optimization taking a different approach that reduces the effectiveness of dormancy.

#

You should still be mindful of using dormancy correctly though

#

Even if you use Push Model as well.

twin juniper
#

Optimization sound like something a beginner shouldn't touch lol

fossil spoke
#

You will also learn that early optimization is a waste of time.

#

Once you have built depth to a system, meaning, it has most of if not all of the desired features.

#

You can understand it as a whole

#

And make better decisions about where and how to optimize it.

#

Optimizing (beyond the obvious) during development of a system can be essentially thrown out and wasted if you end up refactoring later when you have noticed your initial design is insufficient and you need to take a new approach.

#

Build the thing.

#

Get the thing working.

#

Iterate on the things design until its solid.

#

Then optimize the thing.

shut vigil
#

Is there anyway to make get base aim rotation replicated better. Its super laggy and makes the camera movement feel crappy. Or is there a way to make get control rotation replicated

twin juniper
#

Sound like you are trying to do some weird things, send the code where you need your control rotation replicated

#

Typically the Character Movement Component just do all of that stuff

shut vigil
#

So because I have blends of the upper body animations and lower

#

the upper needs to be replicated so other players can see

#

but Get Base Aim Rotation is relpicated automatically

#

but its replicated bad

#

its really laggy

twin juniper
#

Anyway, i have a question.

I have an item that have 10 different property, each connect to a different type of widget change. Say i change all 10 properties of that item in the server, and use OnRep on each property to change the widget. It will work, but my widget will have to refresh 10 times. Is there any way i can say like "On each update, wait for all 10 property to be replicated, then if any changes, update them all at once." ?

Now, i am not using RepNotify for this reason, but for each update i make an ItemData struct and just send all the data the widget need through a RPC. The problem with this is the widget display and the actual item in the inventory is not synced. So there is a brief moment before the widget got display and the actual item is replicated. If the player try to use the item in this brief moment, it will kinda just crash. Sure i can check nullptr, but it's a bad design anyway.

So i need to find a way to utilize RepNotify so that it doesn't throw 10 refresh on my widget. Any idea?

twin juniper
shut vigil
#

Get Base Aim Rotation already replicated character rotation

#

Im trying to replicate character rotation without Get Base Aim Rotation because It laggy when you use that

twin juniper
#

What do you mean by it's laggy? Laggy on the owner client or on other clients

shut vigil
#

All clients

#

Its kinda choppy

#

Hold on let me send a video

shut vigil
#

theres alot of choppyness both for the client playing and what the other clients see

twin juniper
#

Looked not-choppy for my human eyes. Anyway when you get the rotation on the owner machine, it should be a local value but not a replicated one

shut vigil
#

This is getting the rotation for each client

#

and putting it onto the server for others to see

#

if I use Get control rotation it gets rid of the choppyness

#

but doesnt allow other clients to see

twin juniper
#

the cmc just do everything

shut vigil
#

I forgot to mention

#

Im doing a true fps so im on the 3rd person BP

twin juniper
#

so do i

shut vigil
#

wait

#

so

#

for when your setting your character rotation

twin juniper
#

its have nothing to do with true fps or not

shut vigil
#

are you using get base aim rotation or get controller rotation

twin juniper
#

GetBaseAimRotation.Pitch

shut vigil
#

and do you have any custom events using multicast or run on server or anything?

#

because mine is also pitch

twin juniper
#

everything is get from current machine

#

no data being passing around

#

look, it the same thing .Don't mind the pre-event graph thing, it's something i stole from lyra and have nothing to do with multiplayer

shut vigil
#

what the hell is wrong with mine

shut vigil
twin juniper
#

you are overthinking this

#

you are doing something wrong somewhere else

shut vigil
#

hmmm

#

so

#

hmm

#

i literally have no idea where

twin juniper
#

just try to look around, eventually you'll find something

shut vigil
#

Ooh i fixed it

#

just had to have a is controlled locally

#

so it checks if its on multiplayer or not

twin juniper
shut vigil
#

what was your fix for makeing sure the camera cant clip through a wall

primal trellis
#

I’ve defined an **enum **with two teams: Team A and Team B. In my GameMode, after a player logs in (using the OnPostLogin event), I assign them to one of these two teams and save this information in their PlayerState.

How do I access this team information in the GameState to determine how many players are on each team. Specifically, I want to keep track of the player count for both Team A and Team B?

As a side note, my ultimate goal is to implement a scoring system where, if all players on one team die, the other team scores points.

gloomy tiger
gloomy tiger
# twin juniper Anyway, i have a question. I have an item that have 10 different property, eac...

So i need to find a way to utilize RepNotify so that it doesn't throw 10 refresh on my widget. Any idea?

There's no way to skip this - not with RepNotify. I mean, by having these 10 RepNotifies, you have to expect a refresh on every change. You can come up with some entangled solution to get what you want because in C++ lands everything is possible, but I believe your problem is in your design.

primal trellis
gloomy tiger
#

Honestly though, refreshing your UI on each/every change is not a bad thing per se - this is a declarative approach, and believe it or not, widely used when building UIs. It'd get bad, however, if these widget refreshes you are saying are doing expensive, sketchy stuff; saying lookups and all.

twin juniper
vagrant grail
#

Guys, I need to have my character's head rotate towards where he's looking at, how to do that please ?

gloomy tiger
vagrant grail
gloomy tiger
#

Ok so for now, that's multiplayer unrelated. You better ask #cpp or #blueprint.

twin juniper
gloomy tiger
#

And it gives you the atomicity you're looking for.

twin juniper
#

well

#

im a genius

gloomy tiger
#

You are, doh!

#

But unless you convert your Item altogether to be a FStruct, you may face some challenges to keep the two states in sync. I'd move it altogether to a big FItemState struct. =p

#

There are problems with the approach above, however. Serialization, diffing & performance, pretty much. But that's a subject for later.

ember vine
#

is there any documentation on chaos and multi? specifically managing stateful destruction for late joiners etc.

#

cant seem to find anything

toxic lion
#

a simple way is to have a boolean that's called something like bMarkDirty
and when any property is changed, mark that boolean as true
Then when all is said and done, only send the rep notify out when the bool is true, and reset it back to false

gloomy tiger
# ember vine is there any documentation on chaos and multi? specifically managing stateful de...

There are a few techniques you can go with, here are two:

  • Have a replicated boolean like bDestroyed that triggers chaos for late-joiners; so what you do is like, only show the game for them once all your destroyed stuff gets destroyed. In the meantime, these people will be behind a loading screen or something.
  • Have a destroyed version of a building and that's what you replicate.

Have seen the two approaches in production.

gloomy tiger
toxic lion
ember vine
#

ah ok, i was going to initially go about it that way but i thought it felt abit crude if not simple. thought i'd check incase there' some fancy way to efficiently serialize state or something

twin juniper
#

I just dont get the technique in general

gloomy tiger
gloomy tiger
twin juniper
#

where does this happen? on the server or client?

gloomy tiger
ember vine
#

u can use atomic struct replication @twin juniper if u want it to get replicated as 1 thing

twin juniper
#

one more problem is it's not always all 10 property changed, so how would it know when to mark dirty

ember vine
#

really ugly and lots of boilerplate but its good

gloomy tiger
ember vine
#

the atomicity is nice though

#

can tuck it away somewhere so dont have to look at it πŸ˜ƒ

gloomy tiger
#

That link is about making it performant

#

Atomicity is just collocating data close together

#

Data that make sense together; data that otherwise wouldn't make sense alone.

ember vine
#

ye but it tells u how to ensure atomicity

gloomy tiger
#

It teaches you to build a NetSerializer so you just replicate what changed etc

twin juniper
gloomy tiger
#

There's not much to it

ember vine
#

it sounds fancier than it is

twin juniper
#

well thank god

gloomy tiger
ember vine
#

before i knew aobut this i had all this spaghetti logic checking replicated properties and making sure it was "fully replicated" with on reps and shit and it was a pain

#

then i found u can just write some other style spaghetti so it just replicates as 1 thing

#

but the atomicity way is less spaghett imo

gloomy tiger
# gloomy tiger When you have those 10 properties of yours separated, they're loose; when you pu...

There are some semantics here, however. Just bundling properties together does not make it necessarily atomic per se. Email and Password, for example, in a login form. If you send them separately and "simultaneously", there's no guarantee of ordering nor the arrival of one or another. They simply don't make sense separated. So you just bundle them into a FLoginData that makes integrity guaranteed. Now, bundling together Email and CharacterPosition3D is hardly atomic, unless you have a specific case where the two make sense together. Anyways, a matter of optics.

twin juniper
#

Just wraping them in a struct not gonna work right? Sound like i also need to do NetSerializer

gloomy tiger
#

By the way

#

There's an Atomic USTRUCT specifier

#
USTRUCT(Atomic)
struct FMyStruct { ... }
twin juniper
#

lol so instead of writing some low level c++ code i can just use that?

#

that's dope

gloomy tiger
#

I don't know; I've just spotted it

twin juniper
#

let me test that out

#

max packet loss or something

gloomy tiger
#

Indicates that this struct should always be serialized as a single unit. No auto-generated code will be created for this class. The header is only provided to parse metadata from.

Hmm, I think it won't work

#

It's weird though; this is the docs for it from source

#

Β―_(ツ)_/Β―

#

Problem w this approach is that your packet size may increase across the board

#

Like always, there's always a gotcha/tradeoff hehe

ember vine
#

WTF when did they add that

gloomy tiger
#

It was there in 4.26

twin juniper
gloomy tiger
#

I believe nobody is using it lol. This is the search result I have in the editor. The only result is the one example I wrote lol

#

Too good to be true lol

ember vine
#

i bet its bugged somehow

twin juniper
#

πŸ˜‚

ember vine
#

well actually according to that article iris stuff atomically replicates by default

#

but yea only downside to auto atomic replication is ur gonna have a fat packet that gets sent out if you decide to cram loads of stuff in there

gloomy tiger
ember vine
#

but in 95% of use cases not to worry

ember vine
#

dunno, idk what iris even is if im honest

gloomy tiger
#

I mean I bet we can but hey

twin juniper
#

i dont know what is iris too, should i get into that

#

the only thing that i read was "100 players" then i am like fk that im out

ember vine
#

well it sounds like its just better

#

what are the downsides to opting in

#

documents do not seem to tell ..

#

ah right i just noticed the top part

twin juniper
#

they said that about everything, metahuman, the procedural tool,..

gloomy tiger
#

AFAIK when Iris is ready, from what I've read, the integration will be quite seamless to your current codebase.

fossil spoke
#

Iris is a new underlying networking layer

#

It does not change anything about how you normally interface with replication or the network in UE.

#

It just changes how the data itself is transported and reasoned about

#

AFAIK

twin juniper
#

Atomic is like you send 2 relevant data but not at the same time

#

And 1 of the 2 can be packet loss

fossil spoke
#

@twin juniper Property Replication is Reliable, you will always get the correct state eventually.

twin juniper
#

yeah but i dont want my widget to refresh more than 1 time, that was the initial problem

#

anyway i should be able to continue in my journey, thanks a lot @gui and @GIRU

gloomy tiger
#

But you don't need to go atomic; that's what I was saying. You probably don't care about this.

pallid mesa
#

@twin juniper @gloomy tiger the atomic keyword in USTRUCTs doesnt do what you think it does (it is only for asset serialization and doesn't have any usage for replication). If you want struct atomicity without using Iris you gotta netserialize it in a single blob like i showcase in the article. Iris seems now to make structs atomic by default :)

#

The thing with structs is that you might have states in the client that never existed in the server. Maybe this isn't a problem for you - or maybe it is. You know tools in the toolset!

#

by making the struct atomic, you'll know that all the states you'll receive in the client always existed in the server

chrome bay
#

Any custom net serializers you've written will need to be rewritten to be compatible with Iris, which is the biggest teething point so far.

twin juniper
#

Getting reply from Vori sensei himself.. What a day to be an Unreal Slacker

chrome bay
#

Going back to your original post @twin juniper, atomicity is impossible here anyway because you have actor/object references.

#

References to other objects can never be atomic. Unless those objects are permanently resolvable on the client, You will get multiple updates or some updates that are missing state.

lost inlet
chrome bay
#

not AFAIK, just something we landed on while trying to move to it

lost inlet
#

tl;dr version of what to expect?

chrome bay
#

Been a couple of months since I looked into it gain but the Tl;DR is the symmetric NetSerialize methods are no longer used, instead serialization looks for templates that have been defined for your type, and calls those functions instead. They've also split off serialization from packing/quantizaton

#

They also tend to be a lot larger sadly 😦

#

Like FHitResultNetSerializer is like 500 lines now

hallow sand
#

Is there a way to see if Iris is working or not? I enabled the plugin, compiled with the SetupIrisSupport(Target); in my project’s .Build.cs file (wasn’t positive that’s where to do it but it worked?), and then copied all of the DefaultEngine.ini stuff from the epic doc.

lost inlet
pallid mesa
solar stirrup
#

That's why I always discourage mixing stuff like the fast array serializer and UObject* references

#

Makes it a headache race condition wise

chrome bay
#

yeah, i mean atomic is fine for POD types but anythimg with a pointer.. bleh

#

Still could be useful in some cases though

unkempt tiger
#

am i wrong to assume that replicated properties with COND_InitialOnly don't need to be push based?

tiny scaffold
#

Silly Question but what's the best way to have the server add an item to an inventory array but also let the client know it was added

steep nexus
#

how can I rotate camera boom on simulated proxies when bUseControllerRotationYaw is false? Help please.

upbeat basin
#

Would BeginPlay call wait until the properties are replicated? Also would there be a difference about this between actors placed on the level vs. actors that are spawned during gameplay?

solar stirrup
#

Unless you enable some obscure setting that i'm pretty sure is disabled by default

tardy fossil
#

It doesn’t β€œwait” per say, but replication is bundled up and sent at the same time so if a server spawns a replicated actor and sets variables right away a client will see them in the beginplay

solar stirrup
#

So it'd be safer to do it in rep notifies anyway

#

But yeah, BeginPlay() won't wait for the replicated properties

tardy fossil
#

Yea not map loaded

solar stirrup
#

Actors spawned are dynamically named and the server sends the path & a net guid for them when replicating them

#

All in all: not much difference, both get net guids assigned to them anyway

#

However, actors loaded from the level don't get destroyed when their actor channel closes

#

They stop replicating but they'll still exist on the client

#

Spawned actors would be destroyed

upbeat basin
torpid whale
#

Hello, how can I create a server-side function in cpp to execute a Destroy?

solar stirrup
torpid whale
#

Destroy the item on the ground, after picking it

solar stirrup
#

Your pickup code, where does it get executed

torpid whale
#
{
    UE_LOG(LogTemp, Warning, TEXT(" AAAAAAAAA Interacted with: %s AAAAAAAAAAAAAAAA"), *ItemToAdd->ItemStruct.ItemName.ToString());
    if (IsValid(ItemToAdd)) {
        int32 SlotForItem = FindSlotForID(ItemToAdd->ItemStruct);  //Buscar slot  con = ID y espacio de al menos 1
        int32 SlotSpace = 0;
        int32 AddAmount = 0;
        //Validamos el item (objeto)
    if (!IsValid(ItemToAdd)) {
        return AddAmount;
    }        
        //Solo se entra al while si se encontro al menos 1 slot con el item de referencia
        while (SlotForItem != -1 && ItemToAdd->ItemStruct.Amount > 0) {

            //Se calcula el espacio en el slot
            SlotSpace = InventoryItems[SlotForItem].ItemStruct.MaxStack - InventoryItems[SlotForItem].ItemStruct.Amount;

            if (SlotSpace < ItemToAdd->ItemStruct.Amount) {
                //Se le resta al item lo que le faltaba al slot para llenar el stack y se deja el elemento de array en su max stack (por colapso)
                ItemToAdd->ItemStruct.Amount -= SlotSpace;
                InventoryItems[SlotForItem].ItemStruct.Amount = InventoryItems[SlotForItem].ItemStruct.MaxStack;
                //Se suma a la cantidad agregada
                AddAmount += SlotSpace;
            }
            else {
                //Se suma la cantidad de forma directa al elemento del array ya que no colapsa el *STACK*
                InventoryItems[SlotForItem].ItemStruct.Amount += ItemToAdd->ItemStruct.Amount;
                AddAmount += ItemToAdd->ItemStruct.Amount;        //Se suma a la cantidad agregada
                //Cantidad del item en el suelo pasa a  = 0
                ItemToAdd->ItemStruct.Amount = 0;
                //Se destruye
                return AddAmount;
            }
            //Se sigue buscando algun slot con misma ID y espacio minimo = 1
            SlotForItem = FindSlotForID(ItemToAdd->ItemStruct);
            //Se verifica si el Item en el mundo sigue siendo valido, caso contrario nos salimos de la funcion
            if (!IsValid(ItemToAdd)) {
                return AddAmount;
            }
        }
        //No quedan slots con la misma ID y espacio, ahora se buscan espacios vacios
        if (FindEmptySlot() == -1)
        {

           ...
solar stirrup
#

You'd wanna make sure you execute this on the server

#

Use Server RPCs if the client triggers it

torpid whale
#

Ok, but how can I create a server-side function? In blueprints I just clicked on it and set it to run on the server side and that's it, how is it done here?

quasi tide
#
UFUNCTION(Server, {put Reliable or Unreliable here as well})
torpid whale
#

Thanks πŸ˜„

torpid whale
#
    UFUNCTION(Server, {Reliable})
    void DestroyItem_SR();
``` is well?
quasi tide
#

Don't include the {}

#

Server, Reliable

#

It was just there to tell you one or two other options that you need to put

unkempt tiger
#

So I'm sending a WeakObjPtr<AActor> of a parent actor, which is null when there is no parent. I am faced with an issue where there was in fact a parent that got replicated, it simply didn't get spawned on the client yet. Is there a way for me to differentiate between the case where the WeakObjPtr is pointing to an unspawned actor, vs where it's actually null?

torpid whale
gloomy tiger
#

That also explains why I found 0 occurrences of USTRUCT(Atomic) in the codebase, lol - anyways, thank you for clarifying.

gloomy tiger
# chrome bay This is a lie, unfortunately

Thanks for clarifying. Well, if that's the only thing required to get Iris in motion, I think it's... less bad? But now that we're talking about it, are you using Iris? If so, I'm curious about the state of it.

chrome bay
hollow eagle
#

It's really not a big deal unless you have a ton of custom serializers.

#

And the need to use custom serializers for atomic replication is gone under iris

gloomy tiger
chrome bay
#

If you don't provide a custom serializer, it jsut falls back to the standard replication path - but that excludes your custom serializers for the "standard" path

gloomy tiger
#

Not too much to lose I think

quasi tide
lost inlet
#

I had to make some small improvements to Iris to get here
unfortunately vague language

nimble sky
#

anyone done a day night cycle so I have all the logic done in my "Time of day" Actor my sun rises sets with a moon everything works as intended im not sure what needs to be replicated to the users I have multiplayer all set up but Player 1 sees a different sun location then player 2 and vice versa depending on whose been playing longer the time of day actor is not updating to match the dedicated server any help would be greatly appreciated I have tried to push the time variable to my GameMode to no success also sent it to the game instance should i be driving the day cycle from the GameMode? im lost lol

gloomy tiger
nimble sky
#

i think i have a disconnect between someone who was testing my game disregard

gloomy tiger
#

This is what our game does:

We have a replicated float CurrentGameTime in our GameState that goes from 0 - 24; the sun adjusts its position based off this CurrentGameTime, which is managed by the server. And that's it.

nimble sky
#

thats what i have too

#

im testing with 2 more laptops side by side with different steam logins

gloomy tiger
#

πŸ€”

nimble sky
#

like i said it could have been the other user not understanding what i was asking

gloomy tiger
#

Where's your CurrentGameTime? Who is setting its value? What's the algorithm you're using to set its value?

nimble sky
#

i just confirmed when PLayer 1 is joining the server its at noon and when player 2 joins they see noon when player 1 sees 6PM

#

the current game time is set in PIE using an exposed to editor i set the time before play

#

so i should be driving the Current Gametime From the game state to set the variable in the Actor time of day im guessing

hoary spear
#

Currentgame time onrep -> set sun position?

nimble sky
#

like this?

woven bramble
#

Does anyone have any information about why Get current players is not working?

hoary spear
#

Whos beginplay is that?

#

I cant see the onrep

#

Id also have local 'prediction' and just semi regular updates from the server

nimble sky
#

thats the actor for the time of day

#

in the class defaults i have the actor set to replicates and always releveant

hoary spear
#

Beginplay plays on all clients and server

#

You should gate atleast the set node so omly server sets it

#

Clients simply follow it

nimble sky
#

@hoary spear

hoary spear
#

Timer can run locally aswell

#

Sorry i can slap together some example code soon

#

Putting kids to bed atm

nimble sky
#

no i think i got it ill have to packagae and see if this works

ember jasper
#

Hi !
I have - finally - a working **VOIP **with Steam Subsystem !
Thanks to VOIPTalker I'm able to change player's voices and spacialization at runtime.

Now I would like players to have multiple voice outputs !
ie. P1 and P2 are in the same room. P1 and P3 have walkie-talkie. P1 says "hello" with walkie-talkie in hand.
-> P2 should hear P1 regular voice
-> P3 should hear P1 modified voice from its walkie-talkie

Does anyone have an idea on how to make that happen ? πŸ₯Ί

nimble sky
#

I dont know but i like that

#

thats a great attention to detail

jade ibex
# ember jasper Hi ! I have - finally - a working **VOIP **with **Steam Subsystem** ! Thanks to ...
Epic Developer Community Forums

This is complicated due to the microphone input component. The old VOIP talker API is not utilized widely and is definitely an older system. You’d need to write some C++ code to attach a source effect to the VOIP talker output. We use the VOIP system in EOS (Epic Online Services) for Fortnite. I implemented some gameplay code that allows us to ...

digital tulip
#

Hello, I want to make a flashlight in multiplayer. One that only others see and the other that only the owner sees. As you see, number 1 is for the others to see and the owner will not be able to see it, and number 2 is the other way around. Please, how can I make this work? I've tried using different kinds of replicating methods and it worked for the clients but not for the server.

magic vessel
#

Then if it is, set the intensity to 0 instead of setting the visibility. If you are replicating this actor & component, that is why it isn't working for the server

cosmic yoke
#

hello, i'm making a first person multiplayer coop game that could have dozens or hundreds of puzzles. Is it a good idea to make each puzzle a pawn that the player controller possesses so it does camera transition automatically, uses its own control scheme and also disables input from the main first person character?

#

in theory there shouldn't be much network overhead if i don't possess them no?

#

just the initial batch of variable replication

#

and then it should stop updating

#

until i possess it

neon obsidian
digital tulip
#

Only meshes i think

neon obsidian
#

One sec, let me see how I did it

dark parcel
#

You can just spawn the flashlight in target machine locally (by setting the flash light actor to not replicate)

digital tulip
grand kestrel
#

I'm looking at this now. And yeah, you're right. There's no need to use ClientHandleMoveResponse, I will update it. This makes it much cleaner for derived classes too, with the Super chain

hallow sand
#

Anyone gotten Iris set up have a second to chat?

grand kestrel
#

@thin stratus Looks like it should go in OnClientCorrectionReceived instead, this is called only from ClientAdjustPosition_Implementation and only when passing these checks:

    if (!HasValidData() || !IsActive())
    {
        return;
    }

    // Make sure the base actor exists on this client.
    const bool bUnresolvedBase = bHasBase && (NewBase == NULL);
    if (bUnresolvedBase)
    {
        if (bBaseRelativePosition)
        {
            UE_LOG(LogNetPlayerMovement, Warning, TEXT("ClientAdjustPosition_Implementation could not resolve the new relative movement base actor, ignoring server correction! Client currently at world location %s on base %s"),
                *UpdatedComponent->GetComponentLocation().ToString(), *GetNameSafe(GetMovementBase()));
            return;
        }
        else
        {
            UE_LOG(LogNetPlayerMovement, Verbose, TEXT("ClientAdjustPosition_Implementation could not resolve the new absolute movement base actor, but WILL use the position!"));
        }
    }

    // Ack move if it has not expired.
    int32 MoveIndex = ClientData->GetSavedMoveIndex(TimeStamp);
    if( MoveIndex == INDEX_NONE )
    {
        if( ClientData->LastAckedMove.IsValid() )
        {
            UE_LOG(LogNetPlayerMovement, Log,  TEXT("ClientAdjustPosition_Implementation could not find Move for TimeStamp: %f, LastAckedTimeStamp: %f, CurrentTimeStamp: %f"), TimeStamp, ClientData->LastAckedMove->TimeStamp, ClientData->CurrentTimeStamp);
        }
        return;
    }
#

The only one I'm not sure about is bUnresolvedBase

#

After it passes these checks it calls ClientData->AckMove(MoveIndex, *this); and then OnClientCorrectionReceived and then begins actually applying the corrections

#

So it does seem like I should use OnClientCorrectionReceived otherwise we could be applying stamina changes that fail sanity checks?

#

That said the engine only uses OnClientCorrectionReceived for drawing debug stuff

thin stratus
#

I don't have the Engine at hand anymore today

#

Can check tomorrow

neat oxide
#

I have a little question about multiplayer side. Actually, i'm preparing a plan for my new simple game, and I would like to know, if I can begin the game and test prototype by solo game and later integrate the multiplayer is that a thing that could be accomplished or I need to create the game with online minding first?

quasi tide
#

Start with MP

#

Retrofitting MP can be done, but it is extremely extremely (yes twice) painful

#

Because general structure of things break once MP is introduced

grand kestrel
grand kestrel
# quasi tide Start with MP

Only exception is if you're willing to ditch the prototype and start over once you're happy with it I guess, which can be a valid way to go about it

twin juniper
#
UCLASS()
class AStorage : public AActor
{
    GENERATED_BODY()
public:
    AQyStorage();
    void Initialize(int InStorageSizeX, int InStorageSizeY, int InTileSize, EStorageType InStorageType);

    UPROPERTY(ReplicatedUsing=OnRep_Data, BlueprintReadOnly)
    FStorageData Data;
    UFUNCTION()
    void OnRep_Data();
    //- Array
    UPROPERTY(Replicated)
    TArray<FInventoryTile> Tiles;
    UPROPERTY(Replicated)
    TArray<AItem*> Items;
}
UCLASS(BlueprintType)
class LASTDROPGAME_API AItem : public AActor
{
    GENERATED_BODY()
public:
    AQyItem();
    void Initialize(AQyStorage* InParentStorage, TSubclassOf<AQyItemActor> InItemActorClass,
            FIntPoint InLocation, FIntPoint InSize, int InQuantity, bool InIsRotated);
    virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;

    UPROPERTY(ReplicatedUsing=OnRep_Data, BlueprintReadOnly)
    FItemData Data;
    UFUNCTION()
    void OnRep_Data() const;
};

Hey guys, i have a question about designing inventory.

My current inventory is: A big thing that store items is AStorage. It has FStorageData to store its own variables that is related to widget displaying (SizeX, SIzeY, TileSize). When the Data is replicated down, the OnRep will call a delegate and display the storage. AItem is pretty much the same.

The problem occur when i tried to open a storage. An empty one would be fine, because it doesn't need AItem->Data to be replicated. But if i open a storage with item in it, i would need AItem->Data somehow.

I can use a timer client side, but it gonna delay the widget display timing. If the timer rate is low, it gonna impact performance. Or i can wrap everything inside of a big FRealStorage struct, then use that to replicate and display thing. But then i would lose the pointer design which i need. Or i can have a class that only store a truct reference..?

#

Do you guys have any idea with this?

grand kestrel
#

It's easier to read if you specify c++
````cpp`

twin juniper
#

You must have a bug then, because i did

grand kestrel
#

Maybe it's just my phone, not at PC

#

I'm not understanding the issue tho, is the server only replicating when the storage is opened, causing a delay for the client to receive the data via replication and thus a delay with the UI showing what's available?

twin juniper
#

Wait that actually make sense

neat oxide
#

Okai thanks then i will do it mp before

twin juniper
#

But using client data would generate edge cases. Like if someone tried to add an item to an inventory right before you tried to open it the the server, and when the OnRep fire, it may be looking for a nullptr because the item is still not replicated

#

I guess i can really add a timer there because they are edge cases

#

Thanks Vaei , i think i got the gist

grand kestrel
#

So yeah, seems phone doesn't display code syntax πŸ˜„

#

Didn't notice before

grand kestrel
#

And maybe replicate the information before they open it as well, you'll still need to do the above for edge cases - or if another player takes something?
Just give it a small net cull distance, so if they go near it, it replicates usually before they get close enough to open it

inland hedge
#

How would one prevent a client from sending movement? Or rather, how would you prevent the server from accepting said movements? (move and look)
These go through the MovementComponent - all the other actions go through replicated functions (with validate methods) - so I can bail out there. How would I implement that with the movementcomponent? I can't just disable it because I want the gravity to keep acting.

gloomy tiger
#

Anyone know of any out-of-the-box way to monitor PlayerArray client-side? That is, when it changes. I know that is pretty much bookkeeped by AGameMode; am just making sure I am not reinventing the wheel by implementing my own stuff.

quasi tide
gloomy tiger
#

The AddPlayerState and RemovePlayerState are virtual methods. You can override them and broadcast your own event inside of 'em

Gold. Thank you! ⭐

sudden dock
#

Is syncing Mixamo animations possibly for online multiplayer?

supple junco
#

hi I'm currently working on a game with multiplayer, but listen server only. I was attempting to convert it to a dedicated server structure. May I know if there are common best practices for making it such that the entire code base can be run as a dedicated server and also listen server?

I know about the basic stuff like checking if "can display cosmetic events". But for example, in many places in my project I currently use "Get Player Controller (0)". Is it normal just to put this behind "Is Valid" nodes to make sure there aren't any exceptions on the dedicated server?

nova wasp
#

Get Player Controller (0) makes sense for things that are for the first local player controller, but you have given no context for why you want just the first player controller here

supple junco
nova wasp
#

that is not the current player, but the current world's first player controller

#

the current player is something that depends on the context

supple junco
#

from taht page, it seems like the closest I should replace it with is this node?

#

it was a 1v1 game, therefore getplayercontroller(0) would always return me the respective client/server's player controller

#

ah I just saw there's a c++ function GetFirstLocalPlayerController(). strange that that isn't exposed to BP

thin stratus
#

The point is that you usually don't need that node

#

Cause you can get the controller, if needed, usually via your current context

#

May it be the Pawn you are in

#

Or the PlayerState

#

Get Controller on the Pawn would return something else than GetPlayerController0 depending on where you call it

#

Client calling it on their own Pawn would be the same. ListenServer calling it on their own Pawn should also be the same.

But server calling it on a different pawn would result in Get Controller returning the Controller of that pawn and not of the ListenServer

And Get Controller called by a Client on a different pawn would just be null

#

You can use GetPlayerController0 in cases where you really just want the world's local first PlayerController. But that is a specific choice in a specific case.

#

If the server for example should respawn the current pawn reference of some client and also in the end repossess it, then you can't just use GetPlayerController0 cause that's the wrong controller then. You want to Get the Controller of that pawn

supple junco
#

There are several places in my project where the player’s controller is not immediately accessible. For example from the game state, or from a WBP, or even from some other actor in my world

#

How should I go about getting a local player controller reference in those cases? Should I be passing in the controller and hold that reference on initialisation?

quasi tide
#

Why would the controller not be available to the WBP? Are you not passing it in when you're PC is creating it?

#

All widgets accept a PC

#

And you can just use GetOwningPlayer to get it

supple junco
#

World space widgets. Widget components

#

That just exist on an actor in the world

quasi tide
#

They shouldn't be PC dependent then imo

supple junco
#

For example if I have a health bar component on a tree in the world. And on damage, i want to check if the instigator is the local player controller. I was using get player controller (0) as the == check

#

But that’s just an example. I’m sure there’re other cases where actors in the world would like a reference to the local player controller. I could probably find a way to manually pass in a reference. Just that I was used to using get player controller(0) as a convenience function to getting the player controller in single player games.

crude kelp
#

Hey guys is there any way to read root motion and expose it as a variable ?

#

like a vector

#

Being velocity?

#

I post it here so I can replicate it later

#

That is why

#

But if anyone has already a workaround tell me

karmic oyster
#

Animation Montages... How would do if I want to trigger the animation locally on the client immediately but replicate to the rest of the clients via server Multicast?
Using server multicast event I guess my local client animation would be triggered twice? Once when starting locally and once when replicated.
Is there a way to replicate to the "other" clients only?

twin juniper
#

Hey guys, is there a pretty way to trigger OnRep function even when no property is changed on the server? Like ForceNetUpdate kind of style

#

I can probably make a RPC since no data is changed anyway

hoary spear
#

You can set it to repnotify_always, if that helps?

#

It will onrep even if no change occured (but the var was set)

upbeat basin
#

Would APawn::IsLocallyControlled() return true for an AI that runs on the listen server?

nova wasp
#

Which is not over the network, just in case it helps reduce code duplication etc

strong fable
#

Hi, so I have setup dedicated servers using playfab and am able to connect multiple clients via matchmaking, is there a way to browse and search these lobbies instead of directly connecting to an available one?

thin stratus
#

I think using OnClientCorrectionReceived here is totally valid

#

Totally quoted the wrong message.

#

But well

digital tulip
burnt wadi
#

In unreal engine what is the hierarchy in which classes are initialized? like at what point in a dedicated server setup can i be sure it is ready to accept players?

sinful tree
burnt wadi
solid fjord
#

Hey, i'm trying to spawn a replicated Actor from an ActorComponent on my PlayerCharacter.
The component should then either directly or via server RPC if it has no authority, call a function on the spawned actor, my question is: does the function in the spawned actor need to call another RPC or would it still be the server calling that function?

Any tips, advice or pointers in the right direction would be awesome!

timid breach
#

Hello Comrades! We are working in unreal engine many years, but I still can't get best way to create inventory. Which type of item is best?

  1. Structure
  2. Object
  3. Actor
  4. DataAsset object

what are u prefer? why?

tardy fossil
#

Personally I use a struct and data assets. Basically just a variable for the data asset and a numerical quantity variable. But every system has its pros and cons. Using data assets I can’t generate unique items at runtime but for my purposes that doesn’t matter

solar stirrup
#

data asset for item templates, structure for item instances w/ FInstancedStruct for data composition, UObject for inventories that holds item instances

dark wing
#

Just to let you know, if you don't already know

Iris is now compiled in ue 5.2 by default
and Mover 2.0 is available in UE 5.4 Dev branch

quasi tide
#

I do know. But Iris isn't production ready for me yet, so I'm staying on the ol' tried and true.

wintry forge
#

Hello everyone, I'm trying to make an object throwing system with a projectile. The object server is also pretty smooth. For clients, it's jerky. I couldn't solve my problem. Is there anyone who can help?

grand kestrel
# thin stratus I think using OnClientCorrectionReceived here is totally valid

It has been done πŸ™‚ @pallid mesa you might want to be aware of this change too, we've replaced ClientHandleMoveResponse with OnClientCorrectionReceived for Stamina. It was quite ugly in my own project, because I'd have to call UCharacterMovementComponent::ClientHandleMoveResponse instead of Super and then reintroduce everything from the super classes πŸ˜„

pallid mesa
#

thanks vaei - i... made this change myself but never retrobacked it to ya - completely forgot

grand kestrel
#

All good haha πŸ˜„

#

I mean, how could you?! πŸ™‚

#

Uh, wait a minute, I think 5.3 might have changed, need to add preprocessor stuff. Yeah their arbitrary gravity stuff (which I'm grateful is finally here)

pallid mesa
#

doesnt work too well

grand kestrel
#

Yeah I don't think they've completed it yet

#

Bit late, given we have Mover 2.0 coming

pallid mesa
#

fn doesnt use mover, so...cmc will still be getting some love

grand kestrel
#

True

#

I wonder if they will eventually change to it

#

They did try making CMC async (and don't think they quite got there), maybe if Mover 2.0 is async they will use it

#

It was an interesting example of how to build async movement code actually

grand kestrel
#

Good lord this is so ugly

solar stirrup
grand kestrel
#

These new macros don't have UE_VERSION_NEWER_OR_EQUAL_THAN either

#

And... actually... these new macros don't even work

#

Thanks for trying Epic shrug

#

This is on 5.1, am I using it wrong?

#

I will just do this #define WITH_ARBITRARY_GRAVITY ENGINE_MAJOR_VERSION > 5 || (ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 3)

cosmic yoke
#

hello, what is the best place to handle the change of controller on a pawn? if i use OnRep_Controller sometimes it doesn't trigger on the client, in the past i also think i had problems with NotifyControllerChanged

quick rapids
#

I was under the impression a dedicated server had no playercontroller, however when my player joins a game, first I'm getting a ROLE_Authority calling some methods of my playercontroller class, then when that's done, some methods on a ROLE_AutonomousProxy, can anyone explain what's going on, please?

grand kestrel
cosmic yoke
#

the dedicated server has all of the player controllers, but it doesn't have one for itself

#

since it's not a listen server

#

so no client

quick rapids
#

Oh ok, thanks for clearing that up!

cosmic yoke
#

NotifyControllerChanged also doesn't seem to trigger on the client when OnRep_Controller doesn't trigger

#

it seems to be this piece of code that sets the controller to null without calling the OnRep_Controller or NotifyControllerChanged

grand kestrel
#

Have you tried using SetPawn from player controller

#

I don't remember exactly where that gets called

cosmic yoke
#

the possess on the server should handle everything

glossy storm
#

Hey guys, so Im thinking about creating multiplayer for my game. I understand that this is a newbie view of the problematic and many had this idea and failed, so I would like to ask this community, what are the big obstacles, what is the best architecture, where are the best guides and docs etc. Thank you πŸ™‚

nimble sky
#

@glossy storm learn to build from source

glossy storm
#

always do

nimble sky
#

then do steam sessions and AWS with a simple main menu and server browser

glossy storm
#

ok, what if target hardware is oculus, should I focus first on Steam sessions or go with different approach?

nimble sky
#

i dunno about VR

#

have know idea what it entails

glossy storm
#

ok android then

#

gotchya

nimble sky
#

yah i only know how to do steam sessions with dedicated server server browser stuff

#

my builds are windows only sorry i couldnt help

glossy storm
#

no problem, thanks for reply

#

Also if there is anyone with VR multiplayer experience in Unreal I would be willing to pay for consultation (sorry if this request offended someone ), I really want to talk to expert before diving into learning process myself, because from experience it would just save me a lot of time.

devout sonnet
#

I'm looking for really simple tutorials or projects that would teach making a multiplayer game, any recommendations?

#

Ideally something like Rock,Paper, Scissors.

twin juniper
#

Hey guys, is there any video or article about designing anti-packet-loss system?

twin juniper
#

Or just simply don't do chain actions based on multiple packet?

#

wdym what.. im just asking

torpid whale
#

How can I make a set visibility only for a player that enters the overlap of a sphere? I made a system but when a player enters, the visibility changes for all players

twin juniper
#

with overlap you are just running it on all machine

torpid whale
#

Would I have to move everything to a function that runs client-side?

fossil spoke
#

Packet loss can occur for any number of reasons.

#

Reasons you cannot solve with software.

#

IE: physical line faults

fossil spoke
#

The reason no one talks about it here, is because its not something that can be dealt with outside of what the engine already handles.

twin juniper
#

Oh, i didn't know that the engine auto resend them

solar stirrup
#

For replicated properties and reliable RPCs yes

twin juniper
#

Thanks Matt.

twin juniper
#

Hey guys, is there a good way to make OnRep function also run on server? For now, i am just manually do a server check and call them each time any value changes, it feel hard to keep track of them and keep the sync.

fossil spoke
fossil spoke
quasi tide
#

Then do the server check inside of the setter

quiet flame
#

hello i have a boat that moves through a spline (like a elevator) , everything is replicated and multicasted. but im experiencing a jitter on the client end. in server it works fine , anyone can give me tips how to remove this jittering on clients end when they are above the boat?

supple junco
#

How do you guys generally deal with trying to use replicated variables on client-side very early in the game's lifecycle? for example I'm trying to access a replicated variable on a WBP's construction, but the variable hasn't been replicated yet so it's returning null. What's the best practice around this? I've seen some code "delay until next tick" until the variable is no longer null, but that doesn't seem right.

fossil spoke
#

What are you waiting for exactly?

#

That early?

supple junco
#

I wanted to subscribe to an event dispatcher on an object (and that object reference is a replicated variable on my player controller)

fossil spoke
#

Well, you could setup a delegate that gets called when that Object is replicated, sub to that first, then sub to the delegate on the Object in that callback.

#

Alternatively, if the Widget is dependant on that Object existing, perhaps you need to create the Widget when its replicated, not before.

supple junco
#

for option 1, you mean like on a RepNotify?

fossil spoke
#

Yes, in the OnRep, you would broadcast a delegate that says the Object is ready.

#

The Widget would sub to that first.

supple junco
#

is this generally how you would handle replicated variables that you need to access early on in a game's lifecycle?

#

in general I was also looking for a way that unreal can tell me "ok, this client is done with initial replication for all variables/actors that are relevant to him". But I can't find a way to achieve that.

fossil spoke
#

Replication can initiate and take arbitrary time in a non deterministic order. So that broad of a concept just isn't really possible.

#

What constitutes as initial?

supple junco
#

from null to no longer being null (at least for my use cases). I get your point, and I realise there's probably a reason for it. It just feels awkward to handle early in the lifecycle of the game starting up.

fossil spoke
#

What is the Object you are replicating?

#

Whats its purpose?

#

If this is a special manager Object of some kind, like a Team Object or whatever, you probably want a system that broadcasts its availability anyway

supple junco
near granite
#

Is there a way to connect to a dedicated server packaged in Windows with an iOS app?

supple junco
fossil spoke
#

Same with the other framework class counterparts

#

Like GetPawn GetPlayerState

#

Etc

supple junco
#

not even getplayerstate?

fossil spoke
#

I mean the Id variants

supple junco
#

ah i see

fossil spoke
#

Where you are passing the Id of the Player they belong to

supple junco
#

yeah, but I do have an example of a situation where I'd like to get a ref to the player controller from an arbitrary actor in the world

fossil spoke
#

GetPawn and GetPlayerState that are specific functions of another class like PlayerController or Pawn is fine to use

supple junco
#

in single player games I obviously can do the Id method

#

For example if I have a health bar widget component on a tree in the world. And on damage, i want to check if the instigator is the local player controller. I was using get player controller (0) as the == check

^ Copied from my message yesterday

twin juniper
fossil spoke
supple junco
#

because I'm handling damage dealt on this tree, so it'd be on the actor. Only if the instigator is the local PC, does the widget component show up

#

I need the reference to local PC on the tree Actor, not the widget

fossil spoke
#

Yeah well you said nothing about a tree, you only referenced the Widget

#

In the case of an arbitrary Actor that isnt owned directly by the local Player

#

Then yeah, you need to determine the local player some other way.

supple junco
#

"a health bar widget component on a tree in the world". For example imagine the health bar on a tree in fortnite. It only shows up when the player attacks the tree

#

i see ok... so there isn't some easy reference. hmm

#

thanks!

fossil spoke
shut vigil
#

So i just set up this peer to peer hosting and whichever the client is doesnt have any of the fire rate variable or anything Ive set
only the person who joins
the stats are replicated

#

its like

#

there not replicating for the host

shut vigil
#

so i found out why
the host is using the default values
but i have no idea how to fix that

near granite
#

I'm currently encountering an issue where, upon running the iOS app built on my Mac, it fails to connect to a dedicated server hosted on a Windows machine. The connection consistently drops, and the following error message is repeated in the logs:

Here's a breakdown of the steps I followed:

  1. I created a dedicated server using the Unreal Engine source code version tailored for Magic Leap in window
  2. I brought the entire project to my Mac, and I opened it using Epic Launcher version 5.3, without the need for the Magic Leap plugin.
  3. Subsequently, I built the project for iOS.

Details about my environment:

  • Mac OS version: [Sonoma 14.3.1]
  • Windows version: [Window 11 pro]
  • Development tools and versions: [Xcode 15.2]
  • Unreal Engine Source code 5.3(magic leap2)
burnt wadi
near granite
burnt wadi
#

OK i will give you everything i did to completly remove version mismatch, NOTE-what i am about to give you is a 100% removal of version system and mismatch all alltogether, you should only use it for development for later phase overwrite it with custom logic that works across platforms and stuff
I used these bcz i was facing issue idk if they were same as yours or not in WindowsXMac

#

Default engine.ini add this

[URL]
net.IgnoreNetworkChecksumMismatch=1

In my game instance's C++ class
header file

    UFUNCTION()
    uint32 GetGameNetworkVersion();

the .cpp file

uint32 UPanoverseGameInstance::GetGameNetworkVersion()
{
    return 111;
}

i think the above code solves your network version mismatch all together too so you prolly DONT need the below function as i have it commented out too but i will give just in case you decide to use it for something in future
header

    UFUNCTION()
    bool IsNetworkVersionCompatible(uint32 LocalVersion, uint32 RemoteVersion);

.cpp file

bool UPanoverseGameInstance::IsNetworkVersionCompatible(uint32 LocalVersion, uint32 RemoteVersion)
{
    return true;
}

Now we come to GAMEMODE you are connecting too, here also there's a prelogic funtion that verifies your stuff before letting you join
header file

virtual void PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage) override;

.cpp file

void APanoverseGameMode::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage)
{
    ErrorMessage = GameSession->ApproveLogin(Options);
    FGameModeEvents::GameModePreLoginEvent.Broadcast(this, UniqueId, ErrorMessage);
    
}

@near granite

#

as i said this i im pretty sure this is removing lots of fail safe for weird version mismatches so do replace it with good logic for production use πŸ˜‚ these only for development

honest bloom
#

Putting the answer to my question that no one could answer.
So I tried seemless travel and it didn't work.
However, in a hopeless attempt after trying everything, I disabled the firewall .. and everything worked..
I reenabled the firewall again later after closing unreal, and reopening it this time .. windows popped the firewall permission thing and everything works correctly again.

upbeat basin
#

I might be missing a simple solution here but is it possible to let some players pass through an object and not the others?

#

If I would disable the object's collision on the clients, the server would still block the movement through it. If I would disable the object's collision on the server, then everyone would be able to move through it

#

This could be solved by playing with the Pawn's collision settings but then the players could pass through each other as well

#

Would creating a new collision object type, setting the mesh I want to be passed through as this type and playing with specific pawn's object response to this channel on both server and client an optimal solution or is there a better one?

zinc canopy
#

We have a multiplayer game and are working on the HUD setup. I like to use β€œGet Owning Player Pawn” in the Initialize function of a WBP and then bind to pawn specific event dispatchers such as β€œOnDamageTaken”, β€œOnItemPickup” etc. This seem to be a nice way to decouple the widgets and have them only listen to event and refresh UI elements on events. However, in a multiplayer setting the event dispatchers are almost always server called and when you bind in a UI context it only binds on the client version of the event dispatcher. Obviously, you then need to call each dispatcher on client as well then but is this really good best practice? Does anyone have any insight on UI architecture in a multiplayer setting?

upbeat basin
burnt wadi
upbeat basin
# upbeat basin I'm not sure what the best practice would be, but the way I follow is broadcasti...

For example if you show every player's health on a widget, broadcasting the event on the OnRep function will notify every player that one specific player has now an updated health value. Binding widgets to respective PlayerState's events will make the widget update itself according to the value changes. Or if you want to show a pop up saying "30 seconds remaining", you can call the broadcast in a multicast and any player that receives the broadcast can create/show the widget on the screen

upbeat basin
burnt wadi
#

the client version of that pawn, set it from server

#

send rpc for that request or whereever you like

upbeat basin
#

Right, this should be the simple solution that I was feeling like missing

#

But it confirms that it's not possible to achieve the logic by playing the mesh's collision, right?

burnt wadi
upbeat basin
#

I see. I was thinking about letting the actor I want to be pass through decide and store the state of who can pass through and who can't, that's why I was focusing on changing that actor's mesh's collision settings. But I guess letting the pawns decide and store their state of if they can pass through or not would be more logical since changing pawn collision looks like a robust solution

#

Thanks

ruby parrot
#

Hello,
how do I get the local player controller(better the owned player controller i guess) if i dont have a pawn yet? i tried this but it says -1

upbeat basin
# ruby parrot Hello, how do I get the local player controller(better the owned player controll...

I'm not aware of a clean pure BP solution for this so I'll say just use the player controller getter node with the id/index, which can work properly most of the time but could cause problems if you use seamless travel with listen server, iirc. The proper way should be to use UGameInstance::GetFirstLocalPlayerController() which is only available for cpp. So creating your own blueprint callable function that returns the result of that should be the best solution

ruby parrot
upbeat basin
#

Oh also it seems like a widget so using GetOwningPlayer would be better than GetPlayerController with index

ruby parrot
upbeat basin
#

The HUD version should be GetOwningPlayerController node

ruby parrot
#

its basically a "character selection screen"...
player joins...gets that screen and selects the characters according to his steam id that he created on that specifc server etc

#

hm,lemme see

#

ha,youre correct...weirdly i assumed i tried that one, and couldnt find it...worked immediately now. thanks πŸ™‚

dark parcel
#

When a player joins, the server will have ref of the new player controller in Game Mode :: Post Login

ruby parrot
warm lintel
#

The lazy way would be to have some PlayerStateUpdated event, and the UI just updates the entirety of the displayed info. Negligible overhead - depending on how much data ofc - and have each of your OnRep invoke that.

zinc canopy
thin stratus
#

You gonna end up having a mixture of RPCs and OnReps

#

Anything that is State Related will be communicated via OnRep

#

Which will call your Delegate

#

Anything that is a one time event will be an RPC

#

Which again calls your Delegate

#

Which one is which depends on your context

#

Health for example is a State, and changes to that would run throug hthe OnRep variable

#

One can argue that a "Flash Screen Due To Damage" would be a One Time Event, but also is connected to Health going down, so you could set it up with both.

#

I would probably use an RPC for that specific one

#

But again, that one could be done by just comparing health values

#

RPCs are theoretically very rare for UI fwiw

#

Most of your Data for UI is a State

#

So they will most likely be an OnRep driven Variable

#

@zinc canopy

warm lintel
sturdy sand
sturdy sand
thin stratus
#

If you need Multiplayer Sprinting, it has to go into the CharacterMovementComponent

#

We have a repo in the pinned section that has examples

sturdy sand
#

I'll check it out

zinc canopy
#

Thanks for great explanation. @thin stratus So what about this setup? The player pawn has a health Actor component (which is also used by creatures and such). The component has a health float value which is updated by server with OnRepNotify. In rep notify we call the event dispatcher OnValueChanged which I guess will fire on the relevant clients? Then we bind to it via GetOwningPlayerPawn in the UI. To me it feels quite clean. No real need for RPC then.

thin stratus
#

That is correct

#

I assume you already handle any sort of race condition between UI and Pawn replication

zinc canopy
#

Hmm, you mean if health is updated in very short intervals and some ping

shrewd ginkgo
#

i want to assign a different and random skin for each player that connects to the game. how do i do this. when i do it this way everyone in the game has the same skin.

dark parcel
#

well that's because everyone run their own logic

#

so the shuffle in player 1 machine and player 2 machine doesn't necessarily produce the same result

#

if you want to sync with the same skin, the obvious step is to let server run the logic and tell each player the result

upbeat basin
#

So when you try to bind events that resides on Pawn, you might want to bind PlayerController's possessed pawn changed event to try bindings again, if pawn is not valid on your first try

#

Or if you have a widget that is always on screen and swapping pawns on death/respawn scenarios

zinc canopy
#

True, haven't had that issue yet though. For this case it is only the player HUD which I is only valid as the player is alive. But I Think I will continue with this approach, I really like having the UI as its own entity and mainly listen to events. Not being called from the player pawn class.

sturdy sand
thin stratus
#

Unless you wait for 5.4, and start learning Mover 2.0, you don't really have the choice.

thin stratus
#

Or your pawn gets destroyed and respawned

sturdy sand
#

What's Mover 2.0? Is that like another architecture just better than the CMC?

thin stratus
#

You basically want to handle the Pawn Setup via the OnRep pawn of the Controller if possible

thin stratus
#

But it will only ship with 5.4 I assume

#

And who knows what bugs it might have

#

You'd probably still need to manually implement the sprinting into it

#

And we have no date for 5.4

#

Assumption is at GDC

sturdy sand
#

ight

shrewd ginkgo
dark parcel
#

if you don't know how to do that, probably a better idea to read the pinned articles

shrewd ginkgo
#

ty

sullen plover
#

Okay, so I'm having trouble replicating component references. I've got a bunch of interaction logic stored in its own component, which has references to other components on the same pawn, but when I run two players on a listen server and try to interact with stuff with player 2, UE complains afterwards that the component references are null

#

Player 1 has no such problems, which implies that for some reason the references are null on the server on the replicated client pawn

sullen plover
#

Okay I managed to solve the problem by assigning the references from the pawn to the component instead of the component doing it by itself

magic vessel
#

Trying to replicate an audio component, since the Sound UPROPERTY isn't replicated how can I load in a sound on the client?

#

I've currently got it so that the owning actor will supply it with SetSound, after loading in a replicated soft object pointer, but I want to be able to check if it is currently playing before requesting the next sound to be played

#

For some reason, the bIsPlaying bool is replicated so it is blocking me from doing it locally to each player

solar stirrup
#

Don't replicate the audio component

#

Instead tell the players to play XYZ sounds whenever you want

#

Or better have them play it on their own without replicating anything, if possible: generally you can run cosmetics like sound based on other gameplay events already happening on players

magic vessel
#

Yeah, I set the replication off on the audio component and it works flawlessly

worn wagon
#

Not unreal specific, but what's up with all the awful launches of live service games where no one can login? Why is there such a problem with scaling up server capacity? Helldivers 2 is a good example recently.

solar stirrup
#

It's tough

#

They didn't expect so many players

#

And it's cross platform

shrewd ginkgo
#

now the costumes I have selected appear correctly for everyone, but I think they are selected at the same time so several people can have the same costume. how can I solve this?

quasi tide
dark parcel
sturdy sand
#

quick question. I tried to implement jumping in the character movement component and tried to change bPressedJump but it didn't allow me. So to confirm, am I doing something wrong or should I just do the jump() and stopjumping() in the character code?