#multiplayer

1 messages Β· Page 125 of 1

blazing sinew
#

sure

frail temple
#

That was my hack around it. It runs on the Lobby game mode and checks when a player joins via OnPostLogin

#

You can change the instance to the Extra Settings session, this was made by me before I understood/used them.

blazing sinew
#

cool, thanks!

frail temple
#

Like they still join but then they get kicked out.

blazing sinew
#

I was trying to do something like that

frail temple
#

Then when loading sessions you can just do a check to see if the session is full.

#

Keeping old projects pay off πŸ˜‚

blazing sinew
hoary spear
#

Any array works like this unless specified otherwise

#

Index is just the offset in memory to read from

cosmic yoke
#

hello, i have some initializations on begin play, but sometimes repnotifies are received before begin play starts and i get crashes or unexpected behavior because they weren't spawned/initialized yet. What is the proper way of handling that? Here are a couple of possibilities to handle this:
1- If we receive the repnotify we make sure the things it needs are initialized also there, even if it means duplicate code
2- Defer what the repnotify executes to a point where begin play has already executed
3- Have a way to only replicate variables that have repnotifies after begin play executes
4- Move the begin play logic to PostInitializeComponents which i think always fires before any repnotify

latent heart
#

You can always add a list of delegates to be executed on beginplay.

#

Or perhaps on end frame after beginplay.

cosmic yoke
#

@latent heart do you mean option 2?

latent heart
#

Yeah.

#

But what "begin play" indicates is up to you.

#

You can't rely on the end of frame for the first begin play that happens.

lusty sky
cosmic yoke
#

@lusty sky that's option 1

#

there are cases where begin play triggers first and others the repnotify triggers first

#

so either i defer everything to begin play, or i need to initialize in both places

#

this situation happens with GAS with the InitAbilityInfo

#

you put the initialize code twice

#

to whatever function is called first

latent heart
#

How about checking if the actor has begun play and then calling it only if it has, and then calling whtaever setup you need in beginplay?

lusty sky
#

that should be initialized on possess right?

cosmic yoke
#

i would need to have delegates to be able to do that, because the repnotify executes logic

latent heart
#

If you say so.

cosmic yoke
#

in the repnotify i chekc HasActorBegunPlay() if it has execute the logic, if not add to delegate

#

when it finished begin play broadcast the delegate

#

to execute the deferred logic

latent heart
#

But then how do you detect if everything has begun play?

lusty sky
#

its kinda weird that on reps fired before begin play

latent heart
#

Depends if you're using deferred start or not.

modern cipher
#

@cosmic yoke when testing try to uncheck run under one process it can cause some problems, and try to emulate bad network to catch race conditions

fierce egret
#

There is a chest on level and it has Inventory Component which holds some variables. First screenshot is BeginPlay of ChestBP to save any variable at begin. But when a client tries to get any variable of component of ChestBP, he always get default value of variable. Variables are right when Client to Client, but they cant access of variables of chest. Where am i doing wrong?

#

Client prints length of "Duff" is 0

#

But if i add a default value to variable, it prints 1

cosmic yoke
#

i'm using deferred start

#

@latent heart

latent heart
#

That'll be why then.

#

Begin play is called at start, not when actors are loaded.

#

(or when they are loaded if start has already happened)

#

(I'm sure you know that, but others may not!)

cosmic yoke
#

yeah πŸ™‚

prime pawn
#

Does anyone know how to get player count with advanced steam sessions?

meager spade
#

anyone had an issue where PushModel

#

fails to replicate a property, turning off pushmodel it works, but fails when its enabled

#

MARK_PROPERTY_DIRTY_FROM_NAME(ThisClass, RepAmmoCount, this)

#

but the property fails to replicate

#

thing is, it replicates initially

#

fails after that

obtuse loom
#

guys am i doing something wrong? new rotation is a variable i have made

dusk orchid
#

did you declare NewRotation in CPP_Character.h?

meager spade
#

this is just visual studio being weird

#

also make sure you call Super::GetLifeftimeReplicatedProps

#

else your entire character will break

obtuse loom
#

ok so im trying to replicate rotationg of my charcter

#

but whenever i play test, the joystick controls both players

#

i have another input that adds velocity and it works correctly

#

i also did in the same way with rep notify

#

i added a print and it just prints from client 0 for both screens

#

any ideas why?

meager spade
#

err

#

why you doing this for?

#

rotation is already replicated

obtuse loom
#

it wasnt for me

#

niether my velocity or rotation was replicating

young spoke
#

will unreal perform the network id lookup automatically if i try to rpc a TArray<AActor*> ? if not i can just do TArray<FNetworkGUID> yeah?

young spoke
#

Nvm Trying to send a FNetworkGUID via rpc wont compile

Is there a way of sending a variable amount of actor pointers In a rpc, or do I need to make a rpc signature for 2,3,4, etc.

latent heart
#

TArray<>...

young spoke
latent heart
#

Yes

dusk orchid
#

yes it should

young spoke
#

Oh. Ok

#

Simple

latent heart
#

It will never send raw pointers across the network for anything, unless you hamfistedly force it to by reinterpret cast or something.

young spoke
#

Smoart

#

Bless the unreal devs

astral cypress
#

So I take it Iris is abandoned?

latent heart
#

Nope

#

Just taking its sweet time.

astral cypress
#

Is it usable? I know it’s marked as experimental but so was geometry scripting when I was using it just fine

latent heart
#

Enhanced Input has only just gotten out of experiemental...

#

And the previous system was marked deprecated like 5 versions ago.

#

There are some people that use it. I believe they say there are benefits to it, but a lot of extra boilerplate or something.

obtuse loom
#

any ideas on how to fix it

latent heart
#

You can't ahve input events run on 3 different machines.

#

It doesn't work like that.

#

If you want to share input, you need to forward the input events to the server from the clients.

obtuse loom
#

no i dont want to share inputs

#

i want the joystick to rotate my character

#

but it rotates mine and the other players character

#

like one joystick is controolling both

#

this is also in the default thirdperson template

#

wth

latent heart
#

Are you using "get player character / controller" with the index input anywhere?

obtuse loom
#

htis is whats happening^

latent heart
#

Seems to only be controlling that one character there, not both.

#

I get that it's controlling the wrong character in one of those instances, but...

obtuse loom
#

ya thats what i meant

#

thats whats happening to me

latent heart
#

Search your editor/project preferences for "process" and make sure the 'run under 1 process' isn't ticked.

obtuse loom
#

sorry if i was ocnfusing

#

oh holy crap you fixed it

#

thank you so much

#

😘 😘 😘 😘

stuck cloud
#

First time working with unreal and I'm a bit confused about how multiplayer works. This is in my player controller:

latent heart
obtuse loom
stuck cloud
# stuck cloud

From my understanding: On the client side GetGameMode will return null. But will the player controllers that live on the server trigger the begin match function?

latent heart
stuck cloud
#

I would just like to do things the right way, but I'm using local multiplayer only for now

latent heart
obtuse loom
#

hm so does it mean that its not a fix?

#

or will it still work

latent heart
stuck cloud
#

And on clients the code will just return a nullpointer?

latent heart
stuck cloud
#

Ok cool thanks! Perfect thats nice

latent heart
#

That is, the server has a copy of all of their player controllers so it will be called on each PC object on the server - i.e. all of them.

#

Regardless of whether that player is actually the server (in the case of a listen server) or not.

stuck cloud
#

Very cool, thats how I hoped it would work

latent heart
#

Just to be clear, as I don't think I was very clear, the remote clients do not have any other player's player controller.

#

Only the server has them all.

obtuse loom
latent heart
#

It might be the mobile joystick is shittily coded.

obtuse loom
#

probably

meager spade
#

anyone have any idea why a pushmodel prop wont replicate

#

even when its marked dirty

obtuse loom
#

i guess ue5 isnt made for mobilwe games

meager spade
#

ofc its made for mobile games

#

lyra has an implementation of virtual joysticks that work

obtuse loom
#

aight i need to try it out

clear island
meager spade
#

i have that

#

it replicates initally

#

but never again after

#

it hits here just fine

#

(on initial replication)

#

this hits just fine

#

and you can see i am marking it dirty

#

it hits and calls it just fine

#
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);

    FDoRepLifetimeParams SharedParams;
    SharedParams.bIsPushBased = true;

    //Initial and owner only
    SharedParams.Condition = COND_InitialOrOwner;
    DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, bFromPickup, SharedParams)
    SharedParams.Condition = COND_None;
    SharedParams.RepNotifyCondition = REPNOTIFY_Always;
    DOREPLIFETIME_WITH_PARAMS_FAST(ThisClass, RepAmmoCount, SharedParams)``` the properties are fine also
clear island
#
FDoRepLifetimeParams Params;
Params.bIsPushBased = true;
Params.RepNotifyCondition = REPNOTIFY_OnChanged;

#

I have no .Condition

meager spade
#

yeah but regardless

obtuse loom
meager spade
#

it should work

#

en removing all conditions

#

it doesn't work

obtuse loom
#

do you think it could be an engine version error that causes my both players to control one character when using mobily joystick

clear island
#

ended up changing to REPNOTIFY_OnChanged, I didnt really need to always replicate anyway

#

have you tried REPNOTIFY_OnChanged instead?

#

and make sure the value actually changes

meager spade
#

yes it replicates first time just fine

#

any other times it doesnt replicate

clear island
meager spade
#

it is

clear island
#

hmm strange

meager spade
#

RepAmmoCount on server changes from 0 to 30

#

client is always just 0

#

cause the property doesn't replicate back

rain condor
#

Any idea why when i played alone works fine but when played on client line trace it's weird?

#

It's necessary replicated line trace? Or i need only destiny location?

pseudo ermine
#

How does the SpectatorPawn gets spawned on the server as a not replicated Actorc but the same spawns only at the client?

#

And why the heck the same Actor BeingPlay method doesn't get called at the said client

graceful flame
#

Each item in your inventory uses an RPC?

#

What if instead you handled the inventory state using RepNotify?

#

and just have one RPC to handle an inventory change which has some input for the inventory item's ID or something

#

eventually means reliable after sometime

#

but a single unreliable RPC can be dropped and won't happen again unless manually called

#

but if you make them reliable RPCs then players could potentially cause an overflow if they trigger too many RPCs which results in a disconnect

#

Yes you can do client side prediction by just setting the variable at the same time with a regular custom event

hollow eagle
#

There are a few things you need to do to solve this:

  1. Use replication for updating the inventory from server > client, as lawlster mentioned.
  2. Don't use the index of an item to identify the item in an operation from client > server. Use some other id that uniquely identifies that specific item, because the server may have changed indices while the client was sending its RPC.
  3. Inventory prediction is very difficult to get right and you'd be better off separating out the bits that need prediction from the rest of the inventory. If by "equipping" you mean dragging things into slots I wouldn't bother predicting at all, or only "visually" predict it.
#

If by "equipping" you mean scrolling through a hotbar/quickbar/whatever, then the answer is it's complicated, but less complicated than predicting the whole inventory.

#

So more of scrolling through available weapons then

#

quickbar/hotbar

#

So the basic flow for that would be to have the "hotbar" basically be a simple property that specifies which slot in the inventory is selected.
When the client wants to switch weapons, it changes this slot locally and sends an RPC to say "i want to swap to this new slot".
The server replicates the new selection back and in the OnRep you check if it's the same as what the client already has or if it's different. If it's the same you do nothing, if it's different you run the "equip" logic for what the server sent.

#

There's a lot of extra complication here though. The server rejecting the selection isn't too bad - it just replicates back the old selection (you will have to force this depending on the replication method).
The complicated part is something like the server telling the client to equip an item that the client doesn't know about yet.

#

Which can happen if the selection replicates before the item itself does.

graceful flame
#

I haven't made any inventory systems before but I do understand that its considered best practice to try and always use replicated properties for anything stateful and use RPCs for events. Multicast events are only really used for anything else that doesn't affect gameplay as much such as particles or audio that everyone should still see / hear.

hollow eagle
#

Yep, you want replicated properties rather than RPCs for a lot of reasons. The most obvious one is general network performance - reliable RPCs are sent out immediately so if you have a lot going on this could hinder performance (and if you have too many you'll overflow the reliable buffer and disconnect). Replicated properties are only sent out at specific intervals and only when they change, and they are reliable (they will eventually be received, it just takes some time). For something that's predicted this is generally fine as long as you don't need additional information from the server.

#

The other reason is that you don't have to manage sending out RPCs for other players if they join late. Also, multicast reliable RPCs are very expensive.

#

That doesn't really solve anything

#

The actual solution is that the thing managing the hotbar needs to also listen for when items get added. If the newly selected item doesn't exist yet it has to defer processing it until the new item is received.

#

This kind of data race is super common and unfortunately something you just have to learn how to deal with.

#

Deferring things until you have all of the required data is pretty common.

#

Ehh, I guess? That's about deferring synchronous operations until later. This might not happen until who-knows-how-many frames later so it's async.

#

Yeah I don't know about creating a queue. This would be more like just not firing off any "item equipped" events until the item exists.

#

You listen for both an "item added" and "selected item changed" event. If "selected item changed" fires but the item doesn't exist, you don't do anything. If "item added" fires and the selection is for that item then you fire the event.

#

You could do that as part of a more generic solution but it's somewhat unnecessary for this

#

there's only a few possibilities here when you receive a new slot selected:

  1. the item already exists locally, immediately fire off any functions to show meshes or whatever you need to do
  2. the item doesn't exist locally. Mark it as selected (even though it doesn't exist) but don't fire off any functions to "enable" it (since it doesn't exist). When a new item arrives, simply check if it's the item that's supposed to be selected and then fire off your functions.
#

You don't need to store any extra state for #2 - if an item has newly arrived then you know for a fact that you haven't fired off events that result from selection.

#

Lyra's quickbar might be worth looking at for some inspiration. It has a pretty simple quickbar component.

gleaming kite
#

Is there a way to conditionally replicate a component? Similar to AActor::IsNetRelevantFor?

quasi tide
#

Not as a whole object, but you can do conditional property replication

#

DOREPLIFETIME_COND is the macro I believe.

tropic snow
#

I got a door that opens and closes with rpc. When players joins mid game the doors start glitching out. I read you need to use a rep notify but is there a way to fix this issue with rpc. The doors use a timeline and I can't use that in a rep notify function.

quasi tide
#

Use OnRep for state. In the onrep function, just call the custom event that does the timeline.

tropic snow
#

via multicast or server?

quasi tide
#

Neither

tropic snow
#

when calling the custom event

quasi tide
#

You don't need to do either

#

You just replicate the state and the onrep function will run locally. Inside of that function you call a custom event that just runs the timeline.

tropic snow
#

what do you mean by replicate the state?

quasi tide
#

You know how to do an OnRep, right?

#

I assumed you did based on your original message

echo bough
#

Variable replication

tropic snow
#

ok got it

#

state = varible that does the repnotify

quasi tide
#

You just change some variable value, that represents the state of the door (most commonly something like bIsOpen). That is then replicated to clients. Because it is stateful, joining clients will get the most updated value. Inside of the OnRep function, that will be called when the client receives the updated value, you just call a custom event that actually runs the timeline.

obtuse loom
#

hey guys for some reason when i am using mobile joystick in multiplayer, both players control the same character instead of their own

#

i tried it in the ThirdPerson starter and in Lyra

#

same problem

dusk fable
#

check in blueorint channel u might find an answer

obtuse loom
#

alright

dusk fable
#

help needed , i have a multiplayer game of 8 players , im trying to make the players have the ability to switch cameras from third person camera to a free-look camera to navigate across the map , so far it works , i can keep switching between the character and the camera , but that only happens for the host , client arent able to possess the camera , how do i make the clients possess the camera ? (there's only one camera that they share)

obtuse loom
#

guys i have a problem that is fixed if i uncheck run under one process, is that an okay fix or should i not do that

gritty kestrel
hushed rain
#

Do bp Rep notifies execute on client joining an in progress game if the rep was updated/activated prior to them joining?

hushed rain
#

Ty

rain condor
#

Io

#

I wanna replicate muzzle flash. When i fire on client sv can see it

chrome bay
#

Replicate a byte, increment it each time a shot is fired. Play FX from an OnRep

#

If it's automatic and fire rate is fixed, use a timer and a replicated 'bisfiring' bool or whatever

rain condor
#

I'm using bp

dark edge
meager spade
#

anyone here used iris and got it to work, could maybe give me a little hand? πŸ˜›

#
[2023.10.22-23.05.38:786][140]LogIris: Verbose: Generated identifier(0xf8d1408505cb4131) From /SCRIPT/KAOSCORE.KAOSCOREGAMESTATEBASE:KaosCoreGameStateBase_LifetimeConditionals
[2023.10.22-23.05.38:786][140]LogIris: Verbose: Generated identifier(0x403e205f56e2c0dc) From /SCRIPT/KAOSCORE.KAOSCOREGAMESTATEBASE:KaosCoreGameStateBase_State
[2023.10.22-23.05.38:786][140]LogIris: Verbose: Registering descriptors for  Class KaosCoreGameStateBase : ArcheTypeOrKey: /Script/KaosCore.Default__KaosCoreGameStateBase
[2023.10.22-23.05.38:786][140]LogIris: Verbose: FReplicationProtocolManager::CreateReplicationProtocol Created new protocol KaosCoreGameStateBase with ProtocolId:0x4245a685fbaa6463
[2023.10.22-23.05.38:789][140]LogIris: Verbose: Registering descriptors for  Class KaosCoreAbilitySystemComponent : ArcheTypeOrKey: /Script/KaosCore.Default__KaosCoreGameStateBase:AbilitySystemComponent
[2023.10.22-23.05.38:790][140]LogIris: Verbose: Registering descriptors for  Class KaosCoreExperienceManagerComponent : ArcheTypeOrKey: /Script/KaosCore.Default__KaosCoreGameStateBase:ExperienceManagerComponent
[2023.10.22-23.05.38:840][140]LogLoadingScreen: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.38:868][140]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.43:740][673]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.48:873][289]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.53:874][889]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.05.58:874][489]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.03:874][ 89]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.09:100][716]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.14:100][316]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.19:817][  2]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.25:592][695]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.30:951][338]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.36:318][982]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.41:324][582]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)
[2023.10.22-23.06.46:326][182]LogLoadingScreen: Loading screen showing: 1. Reason: GameState hasn't yet replicated (it's null)``` seems iris doesn't want to replicate my gamestate to client
#

infact nothing is ending up going to client

#

now getting

#
[2023.10.22-23.16.11:825][205]LogOutputDevice: Warning: Script Stack (0 frames) :
[2023.10.22-23.16.11:825][205]LogOutputDevice: Error: Ensure condition failed: !Context.HasErrorOrOverflow() [File:I:\Daniel_AresGame\Engine\Source\Runtime\Experimental\Iris\Core\Private\Iris\ReplicationSystem\ReplicationReader.cpp] [Line: 1618] 
Overflow: Y Error: None Bit stream bits left: 0 position: 6377
[2023.10.22-23.16.21:351][205]LogStats:             FDebug::EnsureFailed -  0.000 s
[2023.10.22-23.16.21:351][205]LogNetTraffic: Error: UChannel::ReceivedRawBunch: Bunch.IsError() after ReceivedNextBunch 1
[2023.10.22-23.16.21:351][205]LogNetTraffic: Error: Received corrupted packet data with SequenceId: 505 from server 127.0.0.1
[2023.10.22-23.16.21:351][205]LogOutputDevice: Warning: Script Stack (0 frames) :
[2023.10.22-23.16.21:351][205]LogOutputDevice: Error: Ensure condition failed: false [File:I:\Daniel_AresGame\Engine\Source\Runtime\Engine\Private\NetConnection.cpp] [Line: 3662] 
Received corrupted packet data with SequenceId: 505 from server.```
latent heart
#

Seems like a version mismatch.

#

Or a server/client compilation mismatch

worthy wasp
#

I have a delegate that is firing - but it is always on server auth .... i want to run a local function minus any RPC if this is possible? I dont need an RPC event - dont need the overhead/network traffic... because end of hte day it goes to UI rendering things.

Is there a way to pull this off?

hollow eagle
#

if the server is the only thing that knows the event is firing then no

#

clients can't pull events out of thin air unless they already had the data necessary to know the event happened

worthy wasp
#

thanks for hte clarification

#

i'll have to track down GAS stuff - theres local prediction - which i should be able to rely on

worthy wasp
#

is this a rule of thumb? Any RPC that would fire off a delegate - client doesnt have access to?

#

i can RPC this event series here - and i can see that it is running on client at this point ... however hands down the delegate i'm trying to execute doesnt make it through the clients UI

#

but works perfectly fine on the server

#

yep that seems to be the case - i can run a function with direct access to the widget chain - but the delegate doesnt bind in clients :/

#Live&Learn

hollow eagle
molten bone
#

Hello folks! I am pretty new to unreal and I am learning how to create a multiplayer game, today I have been running into an error message saying "LogPlayerController: Error: EnableInput can only be specified on a PlayerController for itself" whenever an client is running. After a little bit digging, I noticed this error message was from the APlayerController Class. From the function it seems to be implying the clients don't have their own player controller, although I have set the BP_Controller to be replicated?

At the moment, I have created a character BP with a Character Movement Component, both are set to replicated, and a controller BP which is set to replicated as well. If anyone has any insight about how to resolve this error message that would be greatly appreciated! I have read through all the posts on google and sadly none seems to help...

#

Not sure if this would help or not but this is a screen shot of the function where the error message was triggered:

#

This is the game mode I am using:

sinful tree
#

Are you calling enable input on your character class anywhere? Like maybe you're calling enable input while running on the server, or somewhere in Begin Play?

molten bone
#

Hello Datura, thank you! I will try unchecking the Replicate box and see if the error message goes away or not. The tutorial I was following has the replicated ticked and that is why I have that set....

I am not calling the enable input anywhere! Although I am indeed using the enhanced input system and calling "AddMappingContext" in my GSPlayercntroller cpp

#

I am not sure if that would be relevant in any way

molten bone
#

A small update... the error message went away when I re-generated a blank controller. Guess I will have to start from the scratch again 😫

lilac jasper
# molten bone A small update... the error message went away when I re-generated a blank contro...

I remember I ran into similar issues when I first started. I don't remember the exact details but I remember it was happening because of live coding. There is nothing wrong with using live coding but you have to be a little more careful or it creates problems in bp side. Make sure you use live coding for small codes and time to time make a normal full compile(from VS when the editor is closed).

And it is always a good idea to double-check if bp is overwriting CPP settings. Like the replicated checkbox.

molten bone
#

Thank you! @lilac jasper I will be more careful next time...

upbeat estuary
#

BPs are unfortunately easily corrupted

#

Commit often

halcyon ore
#

Could anyone provide some insight on what might be seen as the "max" RPC size, in bytes?
I'm doing a heavy network call, but IDK if I should split it into like 50 calls, or 1 big one?

#

If in the end the amount of bytes end up being the same, I'm not sure if splitting is really needed.
For context 1 call is 45 bytes, but say I had to do 300, or 600 calls, very well reaches 13500 bytes, or 27000 bytes?
and, thats at the most basic of data.
This data needs to be on demand as the player wants to access it.
But, also don't want to store it all the time, as that just leads to massive memory leaks, since one of these actors can do this 300 calls, but what if the user has 10 or 20 of these actors.

halcyon ore
#

Oh..
Well, that makes the answer simple.
Now I just gotta make it work. πŸ˜›
I didn’t realize they had a forced limit like that.

barren plank
#

what videos/documentation is best for COMPLETE begginers to learn multiplayer?

plucky prawn
#

so im reading Jambax's guide to replicated uobjects and in the actor that contains the uobject to be replicated, ReplicateSubobjects is overridden to replicate the uobject/s on the given channel. is this actually needed? shouldnt marking the uobject as Replicated be enough? or does unreal only automatically replicate actors?

sinful tree
sinful tree
chrome bay
#

However note that there is no need to make the list client-side too as that post suggests.

#

The only main advantage here is you don't need a specialist actor or component to register the objects with.

plucky prawn
chrome bay
#

just the header comments. Push model isn't worth the effort IMO

#

Iris will do it properly though

plucky prawn
#

so do you think i should just wait a bit until its more ready and just learn that instead?

chrome bay
#

Probably not tbh, the default system isn't going anywhere since Epics plan is for both to coexist. Iris is really going to be more about scale

#

But push model in the 'default' system we know and love is barely worth persuing

#

Makes no measurable difference even to large scale games

blazing spruce
#

Hi mate, just going back to a conversation we had a while ago around clients being able to call Run on Server events I just want to make sure I'm doing this correctly before I go through and change everything in my project where clients are directly calling Run on Server events, is this the correct kind of set up? The Run on Server event is doing all the checks to make sure it can happen and if the conditions are met it runs it, but since this type of event only happens to the particular client who is wanting to heal, its called from a Run on Owning Client event to request the action, is that correct?

sinful tree
#

So Input > Run On Server "Input Pressed" > Call the pressed input on your custom macro > Hold Output from Macro triggers the actual healing bit you already have running on the server.
Input Release > Run On Server "Input Released" > Call the released input on your custom macro.

#

Also this branch here isn't really necessary. Use a Clamp Float node instead which you'd connect into the Set Health node and set the Max on the clamp to Max Health.

blazing spruce
#

The PCref stuff is just widgets being updated

cerulean tangle
#

Is there a "more proper" way to set player rotation with a gamepad stick than a plain RPC? I set local rotation via state machine plugin and call server to set it there via this setup. I'm a "BP only guy" so that narrows the field of possible solutions, but still

sinful tree
# blazing spruce Okay interesting! So if i don't need the Request Heal event, how come I can call...

A client must be able to call Run On Server events, otherwise the server can't know to run them. The idea is you need to control what happens after the event is called on the server.
Technically, you cannot prevent a client from repeatedly spamming the Run On Server event and it can technically be called at any time, even if you're not expecting your client code to be able to call it, someone can figure out how to call it whenever they want. That means your only way to prevent cheaty behavior is circumvnent what they may attempt to do - like if you need to hold an input for a certain duration before you want them to heal, that's something that you probably want the server to ensure is happening... That then means a player can spam the Run On Server event all they want, but unless they actually hold the input for as long as the server wants, they won't be able to do the heal.

As for the decrementing (or incrementing for that matter), that isn't something you should allow a client to call at all. You can just decrement the count after a bandage has been used (which would already be running on the server). Incrementing should be when the server decides that the player should be given more bandages (like when the player walks on to a bandage item, the server detects the overlap and then grants them the extra bandage.

#

The number of bandages should be a "Rep W/ Notify" variable. No need to RPC back to the client, just use the OnRep function to drive anything that you want changed when the updated value is received from the server.

blazing spruce
sinful tree
blazing spruce
sinful tree
# blazing spruce Maybe its my understanding of OnRep's but i thought that they're to replicate in...

OnRep functions are called when a replicated value is received by a client, and in blueprints, it also ends up being called on the server when a value is changed. You can differentiate where the OnRep is being executed based on the Local Role and Remote Role of the actor and the authority, (Has Authority > Remote typically calls on all clients who have the actor relevant, where Authority is usually the server).
You can change the replication conditions on variables so that the variable only replicates to the owner - there's a bunch of settings for that when you are modifying the properties of the variable.

blazing spruce
#

Also, does using the decrement/increment node on a OnRep variable call the OnRep function or do you actually have to set the variable for the OnRep function to be called?

sinful tree
# blazing spruce Oh yeah I forgot about replication conditions although have never had to use the...

Events can happen on both the clients and the server. You can differentiate that it's happening on the server using Has Authority an use the authority path assuming it's an actor that was spawned by the server. Overlaps are an example where you probably want to detected that overlap on the server without the client telling the server that they overlapped.

If you know you're already executing on the server because of something a client triggered, any functions you call from that point is then running on the server too.

sinful tree
blazing spruce
blazing spruce
sinful tree
sinful tree
blazing spruce
sinful tree
blazing spruce
round acorn
#

Rando question but has anyone heard whether Epic has plans to improve CMC, maybe something along the lines of bringing what's in Fortnite into the standard UE 5 dev environment?

latent heart
#

I did hear they were working to replace it with something more generalised.

#

Or something like that.

hoary spear
#

Movement 2.0 was it

round acorn
#

I shall once again hold off on purchasing GMC lol

hoary spear
#

πŸ˜†

#

Ive held off from a vat plugin so long that its prob 5-10x original asking price

#

Now i regret it

blazing sinew
#

sry guys, how can I get the max players in session without having a session result?

#

I mean the max players of the current session the player is in

latent heart
#

Surely you need a session to get the max players of a session?

blazing sinew
latent heart
#

So get that then.

blazing sinew
#

maybe I should use another method to retrieve that ref

blazing sinew
latent heart
#

Now that I can't help with!

tough anchor
#

Hey, is it possible to replicate a web browser (widget) in multiplayer. At the moment, the server and client can access it, but the client can’t interact with it

sinful tree
tough anchor
cerulean tangle
#

Can anyone advise on how to properly restart a co-op session without dropping a guest player?

sour geyser
#

i have this blueprint that is run from the server, on a replicated actor. it has this timeline that is replicated which should change color of the background lighting. however, as seen on the gif, on the left (client) it just suddenly changes while on the right (server) it works as expected. why is this happening?

serene kestrel
sour geyser
latent basin
#

Hey all im trying to get this system replicated where a actor weapon is spawned and static meshes that are attached to the preview weapon are updated to what is selected in the SetStaticMeshes custom event

#

Its working in singleplayer fine and not in multiplayer

#

If i explictily set the meshes like this it works in multiplayer

#

So im guessing that the information where i select the static meshes isnt getting passed in from this blueprint where 'drop weapon' is called

#

Any help much appreciated

graceful flame
latent basin
#

Sorry forgot to mention where its called

#

Because the actual spawn actor is fine its replicating but im just struggling with the static meshes

hoary spear
#

If I have a nested struct with an inner-most array which i add elements to, how Can i expected only that array entry to be replicated, or will everything, even the owning struct, be replciated?

#

Wondering if i should swap for fastArray or not ..

#

Its a quest system, so i don't reallllly see the need but...

hoary spear
#

Tried to network profile it but guess that wont work during loopback x)

night walrus
#

Hello guys I'm trying to use multiplayer with listen mode, I want my other players to be a sphere instead of their Pawn for the local player. How do I create an sphere that replicates to the server all the player movement without replicating the character pawns?

crude quail
#

Strange bug, I don't really know what to make of this. My player controller is applying a selection effect in what I presumed was a local context, I'm doing no networking here:

    if (InputTag.MatchesTagExact(TAGS::INPUT::LeftMouseButton)) {
        if(CurrentSelection.IsValid() && IsValid(CurrentSelection->GetAbilitySystem()))
        {
            const auto UISubsys = GetWorld()->GetSubsystem<UUIControllerSubsystem>();
            UISubsys->UnbindAbilitySystem(CurrentSelection->
GetAbilitySystem());
            CurrentSelection->SetPortraitRenderTarget(nullptr);
        }
        if(CurrentMouseOver.IsValid() && IsValid(CurrentMouseOver->GetAbilitySystem()))
        {
            CurrentSelection = CurrentMouseOver;
            const auto UISubsys = GetWorld()->GetSubsystem<UUIControllerSubsystem>();
            UISubsys->BindToAbilitySystem(CurrentSelection->GetAbilitySystem());
            CurrentSelection->SetPortraitRenderTarget(UISubsys->PortraitRenderTarget);
        }
        return;
    }
#

For some reason on a 2 client setup, the render target is bleeding over to the other client when I hover over

#

I have no idea why that would be replicated

#

but only on the render target?

#

Perhaps a bug with the engine doing this locally?

round mural
#

Hey guys
How can I make my replicated project of unreal 5 (blue prints) work multiplayer through steam services i

halcyon ore
#

Normally when the game is played, both players point to file A, but on computer 1, and computer 2.
But, now "players" that are on the same computer 1, see the shared output of file A.

fossil spoke
#

Why are you setting it to Always notify?

#

Dont apply a condition at all?

#

Regular DOREPLIFETIME is fine

#

That may actually fix your problem

#

If not, post all of your code.

#

You maybe marking it dirty incorrectly

#

Please dont paraphrase, just post the code so we can see.

latent heart
night walrus
# latent heart Why not make a pawn that has a sphere mesh?

Player Pawn? Well, I've tried to use my oculus Hands Character Pawn but the Hands started to get frozen in the floor after that and I could move both players hand pawns (could only move fingers) at the same time like I was controlling both or something like that but they were stuck on the floor and the sphere too so.. I thought it would be hard to manage that

rotund onyx
#

I'm wondering if anyone has a solution to laggy UI in multiplayer.
Basically I have actions that players can queue up using the UI, but I dont know the best way to set them up so that the player is able to create and then modify an action that they have queued for the end of the turn.
Right now I sort of have something working but it isn't consistent enough because sometimes clients will make multiple actions instead of editing the first one they made due to lag

prime pawn
#

Trying to replicate a montage in a actor class

#

But this doesnt seem to work properly.

short arrow
# prime pawn

none of the other clients know what mesh you're referring to

#

you need to pass in a reference to the character you'd like to play the montage on

short arrow
pseudo kernel
#

How common is it to implement custom player movement prediction inside the character movement component?
Referencing this specifically: https://forums.unrealengine.com/t/character-movement-optimizations/264969

I was seeing some rubberbanding with very basic character movement in a very basic setup. This fixed it a bit - but I'm wondering if something else was misconfigured

prime pawn
#

Appreciate that

#

Works great

rotund onyx
short arrow
#

All you'd need to do is create the button, when the player selects that button allow them to see all of the nececcary properties (presumably by changing a struct). Once all the properties has been created you'd want to send that struct to your controller... From there you would call an RPC to the server with the struct being sent... Finally the server would spawn the actor and set it's properties based on the struct it received

rotund onyx
#

well server side its instant, sure, but its very easy for the client to send two commands to "create thing" when they really want to create and then modify the thing

short arrow
#

you should create and modify it before sending, unless you want to be able to make edits later on

rotund onyx
#

I do need to be able to edit later on

short arrow
#

then you need to create a way to keep track of all of the actors you created

#

Setup either an ID system to identify which actor you want to edit, or use direct actor references

rotund onyx
#

to be clear I dont have trouble with the client getting the actor that they created, I have a problem where they are able to accidentally create multiple of them because they have not been informed yet that they made one

short arrow
#

oh

#

Just wait for the server to verify this information

#

Make a bool bCanCreateActor or something which on beginplay is set to true, whenever you create an actor set this bool to false, have the server send you an event "run on owning client" which tells you that the actor has been created, then you can set the bool back to true

#

that's simplest way I could think of doing it. You're just waiting for the servers validation here

#

You can add a timeout (say after 5 seconds, automatically set it back to true)

sinful tree
#

I'd say bCanCreateActor should just be a replicated variable, no need to RPC back to the client to set it true or not.

short arrow
#

also an option, I don't like replicated variables but yeah

rotund onyx
short arrow
#

wait I don't think he can use a replicated variable, because it'd defeat the purpose if he's worried about lag I think

rotund onyx
#

I'll give this a try, thanks guys
I hadnt set up this kind of functionality before

short arrow
#

If you do go with RPC, make sure you set the sending event, and callback to either be either reliable.. Or add a timeout

#

because if you never receive the callback you'll never be able to spawn another actor otherwise

reef bison
#

hey πŸ‘‹ I built an inventory component with FFastArraySerializer to learn a bit but in my game the players should have "authority" of their own data instead of the server. so I am planning to remove all the replicated stuff from the component, but I have a few questions about the networking concepts that are a bit blurry in my mind:

  1. if I declare the inventory component as a UPROPERTY() in a replicated actor without doing anything else, is it gonna be available both in the client and the server? is there a way to make it only available for the client?
  2. the game is gonna have chests and it would be amazing if I could use the same inventory component for everything, but chests should be managed only on the server and the inventory contents replicated to the clients. so for that I would need to keep the replicated stuff in the inventory component, right? then how would I keep it local for the players?
sinful tree
pseudo wagon
#

Hi guys, multiple RPC vs a RPC with array data, which one should I use?

sinful tree
reef bison
#

you can also use the same character on multiple worlds so its easier to keep the data on the client

#

I have been thinking about adding a setting on the world host to save the players data on the server to avoid cheating (like how it works with minecraft) but I think this would add too much complexity πŸ€”

pseudo wagon
sinful tree
# reef bison > You don't care if they add whatever they want to their inventory? nope, the pl...

Ok. So having a UPROPERTY() of your component class doesn't meant it'll be populated with an actual component. You can create the component at runtime only on the client if you so desire and then store the reference that you created in that UPROPERTY. You can leave the inventory component marked as not replicated too.

In order to have an inventory component that replicates, you'll likely need to subclass your current inventory and mark it replicated. You can add this to chests and what have you, and players can read from that "shared" inventory class and see its contents. You'd have to make requests to the server to transfer items from that inventory and the server could RPC back to the client to indicate to add the item to their inventory.

You start to run into issues here as you're now relying on the server to send an item out of an inventory but without confirmation on the server side that the client successfully received it. You can code around this with extra RPCs but that's also having to send specific details of the data sent from the server to the client and back again to ensure that if it didn't work things get reset properly, but this is also assuming that something didn't happen to the connection before validation was confirmed.

#

Same with sending the server an item to a specific inventory, you'd send the item details to the server, along with what shared inventory component you want to place the item into, with the same caveats of validating.

reef bison
#

I see, so I could have the same inventory component implemented with FFastArraySerializer for both players and chests, but only flag it to replicate it on chests actors?

sinful tree
#

Yep.

reef bison
#

got it, I am gonna play with it, thanks a lot!

#

good point about the item confirmation, I might need to do something to avoid an item being sucked into the void if the client suddenly disconnects blobthinkingglare

#

I am thinking more about this and another solution would be that when the player enters in a server, the client sends the save data and the server uses it as the initial point

#

so I don't need to deal with two different authoritative models

#

the inventory might still lag a lot tho, so I will need to think more about this hmm

hoary spear
short arrow
hoary spear
#

It really sounds like a tad flawed logic client side

#

Creating and modifying one action should be possible even without a server connection?

#

And whenever the client is 'ready', the action can be sent / commited

short arrow
#

I think the actor is replicated, he just wants to create one, and make it impossible to create another. Althought the server could just make it impossible to do that I agree

hoary spear
#

The replicated bool should work just as good as an rpc

#

The initial actor would be local only untill it's configured?

#

Ah well seems they got an idea / proposed solution

short arrow
#

I have no idea what the exact details were for him, but I wasn't focused on the best way to do it, I was focused on the easiest

hoary spear
#

I may be all wrong ofc

dark parcel
#

How to get the Local Controller? I thought there is a function for it. It's not exposed to bp?

hoary spear
#

Dont think so

#

Owning controller is usully the route i go..

#

Depends om where and for what tho

low trellis
#

Hi, I have a box collision which is letting character to control web browser widget. In multiplayer Server gets control and can interact, but client gets mouse control but cant interact.

I have a mesh (for the screen) Attached widget to in and Box collision. (Blueprints are attached)

queen escarp
#

hey guys since i cant have events in a function

#

how can i "return on notify begin"

#

when calling an event

#

since im RPCΒ΄ing the event since its a anim related motange

#

( its not rpc on the pic)

dark parcel
#

Custom events can't return data

#

Not sure what you are doing but you can probably broadcast event on the on notify begin

night walrus
#

Is possible that when I try to replicate a Character Pawn to the server this character position and rotation gets stuck because now is owned by server? I don't know how to solve it, my char pawn in the client is stuck on the floor

surreal plaza
#

I am developing my EOS service with Steam. If I want to switch it out with Epic's backend, will it be a simple config change for simple functionality like session finding, server travel, etc?

queen escarp
#

hmm they dont get added to the "zone of enemies" :/ ?

#

anyone se anything wrong

hoary spear
#

Doed the code trigger?

queen escarp
#

yeah

hoary spear
#

Inside the foreach ?

queen escarp
#

5 is the only number displayed.

#

not even the 3rd one

#

get overlapping actors they remade it somehow from 5,1 to 5,3 ?

#

i updated yesterday

#

detection area*

#

both deers derive from the enemy parnet class

#

do they need some kind of collision parameters enabled if its picking classes inside ?

sinful tree
# queen escarp

If you're not seeing 3 printed, then the Get Overlapping Actors array is empty, and if that array is empty that is an indication that the deer may be ignoring the collision response you have set on your Detect Area.

queen escarp
#

exactly my thought

#

so the collision respone on the detect area how dose that work ?

#

oh wait fixed it

#

it was on ignore,

#

nice ty

kindred fjord
#

I am trying to create a multiplayer first person game, and have a separate first and third person model. For swapping held equipment I am spawning a replicating equipment actor in c++ for the static mesh with owner only see and owner no see for first and third person respectively. This works fine on the server but the owner no see and owner only see are not set on the client. Is there a good solution to setting those properties on spawn while using the same actor blueprint for both equipment actors, or is the best solution to have two blueprints for each equipment, one with owner no see and one with only owner see

serene kestrel
#

Alternatively, if you know before hand which model is which, just have begin play call those methods correctly on the 1st and 3rd person meshes. This logic will also run on the Client when it calls BeginPlay

kindred fjord
#

Ok, thanks for the help

quartz star
#

I'm trying to make a character that rotates when I press A or D
In local multiplayer it works fine but when I try with 2 different machines the client is having weird problems.
On client side he rotates very slow (50% less as on server side)
While on the server side it looks like he is rotating with twice the speed.

When I calculate the new rotation on client and then send it to the server who calls a multicast to apply the new rotation the client rotates extremely slow.

This is what I have rn.

// Called when i press A or D
void Turn(float Value)
{
  CalculateTurn(Value);
}

void CalculateTurn(float Value)
{
  if (!HasAuthority())
  {
    Server_CalculateTurn(Value);
  }
  const FVector NewRotation = GetActorRotation() + FVector(0.f, Value, 0.f); 
  SetActorRotation(NewRotation);
}

void Server_CalculateTurn_Implementation(float Value)
{
  CalculateTurn(Value);
}
#

I'm pretty new to this so I hope there is a more professional way to achieve my wanted results

dusk orchid
#
client calls this part
if (!HasAuthority())
  {
    Server_CalculateTurn(Value); rotates once on the server
  }
  const FVector NewRotation = GetActorRotation() + FVector(0.f, Value, 0.f); 
  SetActorRotation(NewRotation); // rotates again on the client
#

i'd suggest splitting up the logic a bit more it seems very strange that CalculateTurn -> Server_CalculateTurn -> CalculateTurn
@quartz star

raw sorrel
#

When replicating gameplay events like abilities in RPGs or MOBAs that need to be seen on-time and reliably, are replicated variables the correct approach?

I cannot use an unreliable multicast RPC because these abilities need to be seen.
And I cannot use a reliable multicast RPC because it would be too expensive to call them if I have tens to hundreds of characters using abilities often.

From what I have read, replicated variables seem to be the correct approach. And I had naively used unreliable multicast RPCs for my ability code and it isn't reliable enough. I just want to confirm this before making big changes to my codebase.

Thanks.

forest bolt
#

How can I get world input direction in multiplayer? I know I can't use last movement input as it's not replicated. I've tried doing math with acceleration but no luck.

quasi tide
#

Just replicate it if you need it.

fossil spoke
#

It handles all that nitty gritty detail for you.

raw sorrel
# fossil spoke It handles all that nitty gritty detail for you.

I like to do things myself. And I have been looking at how GAS works while adding multiplayer functionality to my own ability system. I have client side prediction and synchronization working, along with a couple of abilities already.

I just wanted to confirm the part where the server multicasts the usage of the ability to display animations/vfx . I have tested this with both an RPC and a replicated variable/struct. Right now I believe that using an replicated variable/struct is the correct choice.

Also, I think regardless of system used, it would be nice to know what is the general approach.

At first I thought it would be an RPC, because to me, a one time usage of an ability makes sense as a function. But after reading some great articles and posts about variable replication and what can be done with it in Unreal, it seems that variable replication is the correct approach. (https://jambax.co.uk/better-burst-counters/ https://forums.unrealengine.com/t/replicated-properties-vs-rpcs/264973). It also seems to me that most things--even events should be done through variable replication.

What adds a little bit of confusion to this is that I believe GAS uses unreliable NetMulticast RPCs for their GameplayCues (https://github.com/tranek/GASDocumentation#concepts-gc-batching). I would think Gameplay Cues would be a good parallel to what I am trying to do. I could definitely be wrong though.

fossil spoke
#

Variable replication is typically never a good idea for one time events. Replicated Variables are stateful. Events (RPCs) are not.

#

Gameplay Cues are exactly what you are looking for.

#

They are Multicast to all Clients.

#

To perform cosmetics

quasi tide
#

Change your character's shirt? Variable replication (OnRep)
Show that someone is ignited due to a spell? RPC

raw sorrel
#

What about the reliability? Think a moba ability, every player needs to see it, you cannot have a situation where it is not received.

quasi tide
#

GAS was literally created FOR a MOBA

raw sorrel
# quasi tide GAS was literally created FOR a MOBA

Yes, I know this... I think your response diverges from what I was talking about. The fact that a net multicast RPC would need to be reliable for something like this. And from I have been told NetMulticast RPCs should be used sparingly.

serene kestrel
#

Net Multicast for "short lived" effects makes a lot of sense due to the time to NACK and resend the effects to clients might be longer than the effect itself should be seen. For longer term visual effects, a replicated array could make sense. It really depends on how important it is for your game for the effects to always show up on the Client or not

hollow eagle
#

The situation where something won't be seen is when you have packet loss or other bad network conditions. Everything is going to shit if that happens, and by the time a reliable effect gets resent an instantaneous effect may not even be relevant anymore.
That said, if the effects being played are tied to other data you already guarantee on the client (such as a montage being played) then you can potentially infer the effect's playback rather than replicating it as a separate event.

raw sorrel
# fossil spoke Variable replication is typically never a good idea for one time events. Replica...

This is from what I have read in the unreal documentation. It seems though, the way I have seen replication used, stateful can mean quite a few things.

https://jambax.co.uk/better-burst-counters/ Uses variable replication for weapon firing. And quoted from the article:

"This is also a preferred approach to using Multicast RPCs, for several key reasons:
    We want to leave the unreliable RPC buffer free for more important data, such as Character Movement and/or other mechanics that must remain responsive. (This matters more as we scale up).
    We still want to know if a player has fired, even if we miss a few updates.

The solution works for weapons firing multiple shots and I have it working with a one time use ability.

It seems as though variable replication is generally less expensive overall, and I believe there isn't a difference in speed to the client. Atleast from the articles I have read--again Im not someone with multiple years experience in unreal multiplayer.

hollow eagle
#

An instantanious effect is not stateful, that's why it's instantaneous.

fossil spoke
#

Hence why I said "typically" not how you use Replicated Variables.

raw sorrel
#

"That said, if the effects being played are tied to other data you already guarantee on the client" well that is the crux of it isn't it? I'm looking for way to reliably get that info to the client in a multicast scenario.

fossil spoke
#

Your comments seemed to imply that you were moving in the direction of thinking that you will want to use variable replication for EVERYTHING

hollow eagle
#

Weapon firing is stateful, it very easily fits into this. A ton of effects are potentially tied to it too, which massively lowers the cost compared to replicating everything individually (think about how often an automatic weapon fires, multiplied by every possible effect that it can result in).

#

A single ability activation does not fit any of that criteria.

raw sorrel
hollow eagle
#

Sorry, I should say that a single particle effect does not fit any of that criteria.

#

Most ability activations are not instantaneous. You have some form of animation or wind up or something. GAS does accomplish this via variable replication.

#

And for sim proxies montages are replicated separately. Some effect data could be tied to that.

serene kestrel
#

If the effects that you want to play need to be reliable, then variable replication is probably your best approach. If you use RPC's, you'll need some way to handle the player re-connect case and also potentially other Player Actors becoming relevant to your client after the effect was triggered. This can be done with RPC's but you'll need various hooks into the networking system to handle those edge cases (which variable rep should do for you by default)

raw sorrel
hollow eagle
#

And for things that can't be tied to animation or the simple fact the ability is running, once again - the situations where an unreliable RPC are dropped are few and far between without other elements of gameplay being impacted.

fossil spoke
#

There are not really any "wrong" ways, only "better" ways.

serene kestrel
#

The downside to variable replication is that it relies on the Rep Frequency and you generally will be sending all changed values each time you replicate an actor, where as the RPC approach allows for more fine grained control of the data you are sending. If that does become a concern, you can use a "Container" actor to hold all of your effects and just make it owned by the Actor they should be affecting

fossil spoke
#

A wrong way is something that doesnt work at all.

raw sorrel
fossil spoke
#

A better way is something that would be more efficient.

#

Whats efficient comes down to your requirements/needs.

#

Among other things.

hollow eagle
#

Also, variable replication can still result in something being "dropped" - if replication data is unable to be sent by the time the ability finishes and whatever variables it used are set back then a client won't see that an ability ever triggered. There is no way to guarantee both timely delivery and reliability. The latter can only be guaranteed without the former, and only at a high cost.
You have to pick your tradeoffs, nothing is perfect.

raw sorrel
# fossil spoke A better way is something that would be more efficient.

Yes, and having a small struct or a single variable replicated for many characters every time an ability used should be fine, right?

My other solution of using a NetMulticast RPC, even though unreliable I thought would not be efficient after I had done more reading.

I'm just worried of a situation where I spend a couple of weeks finsihing the abilities for characters and turns out I was wrong in my approach.

fossil spoke
#

Profile. This is what its about. You make an educated guess as to what is going to be the most efficient. Then you build it and profile it.

#

If its not where you want it to be, then perhaps you need a different approach or optimize what you have until its sufficient.

quasi tide
raw sorrel
raw sorrel
# quasi tide I disagree that my response diverges. Looking at how GAS would do something, a f...

I'm very well aware of what GAS is, I looked to their documentation and their sample projects as guidance before. And I stated this in my very first response to the discussion.

I just wanted clarification on the uses cases for RPCs and variable replication for a multicast scenario. If the only input I got back was to look at GAS or to just use GAS, then there would be no point in me asking any questions in the first place. Thankfully the discussion moved on from this and I got some good insight in the end.

raw sorrel
quasi tide
raw sorrel
#

Hahahah, exactly "stateful" can be tricky

dark edge
#

A better example for a multicast might be a muzzle flash or explosion

quasi tide
#

To be fair as well - being on fire is only a state if it actually has an actual gameplay effect. It could be entirely cosmetic.

ember vine
#

anyone know much about root motion replication ? i can see there is some code references to "networked root motion montage", is that stuff worth using ?

#

i want some customizable behaviour with the root motion e.g allow some turning during root motion etc, does going down that code path support that ? i cant seem to find any docso n it

quasi tide
#

What is "stateful" is determined by the rules of your game.

quasi tide
# ember vine i want some customizable behaviour with the root motion e.g allow some turning d...

The only root motion I've messed with is doing it locally and then doing an RPC to let everyone else know to do it as well. It's worked well enough so far. But I don't do much networked root motion admittingly. Maybe look into motion warping to see how you could incorporate it in your usecase. Don't know how well that works networked. I'd imagine it would follow the same principals though.

ember vine
#

yeah thats basically what im doing rn, server rpc into locally predicted client playing, i also pass in the rot/loc just to ensure its synced

#

problem is the AI is capable of rotating very slightly during the "windup" of the attack and looks like the cmc refuses to show it to the observer during the montage but i can see on the server hes turning

#

so was basically wondering if i am missing something or if i am going to have to enjoy a nice venture into the cmc to override some weirdo behaviour

#

yea motion warping is a possibility aswell but i think we'd go for it more in a polish phase, rn im just setting up a new enemy for some basic playtesting

quasi tide
#

MW is actually pretty darn easy to setup. Like, 5-ish minutes to be honest.

ember vine
#

hmm, i am abit suspicious how easy this looks

#

looks too good to be true

#

will try now

raw sorrel
# dark edge A better example for a multicast might be a muzzle flash or explosion

You know this really got me thinking, thank you for posting this.

I think an explosion like a grenade is an excellent example for this problem.

An explosion--grenade whether stateful or not should be seen by all players, even if it was late. If you were to die, or to take massive damage, you would want to know what it was from, even if it was 0.25s late. Lets not debate this exact point, because its not the issue.

The issue is that we have an event that occurs fairly often that needs to be reliably multicasted. Normally you would think "replicated variables are stateful. Events (RPCs) are not"--I agree with this. But Mutlicast Reliable RPCs are expensive.
So it seems the solution for cheap, reliable multicast events are replicated variables. I'd much rather just call an RPC because it's more straightforward, but it seems like variable replication is a better solution for this.

Unless there is some other technique or something that I have missed--and this is where my real question lies. Though from what I have read, it seems that there isn't an obvious superior solution.

What do you think, Adriel?

quasi tide
#

Your choices are as follows:

  1. Use variable replication and do the explosion as a stateful thing. Then when the explosion is done, replicate that it is done as well. Otherwise, clients who walk into relevancy range will get to experience that explosion, due to them receiving the updated value. Even if the explosion has long since finished.

  2. Use reliable multicast RPC - which has the pitfalls of being reliable (when it comes to the bandwidth) but clients walking back into relevancy won't get the explosion

  3. Use unreliable multicast RPC - avoid the clogging of the network like reliable does, but run the risk of the client not receiving the packets.

raw sorrel
#

Thank you, excellent rundown.

There are some work-arounds for clients who walk out of relevancy range here if you are curious:
https://jambax.co.uk/better-burst-counters/

I'm very glad it looks like I'm not going to unknowingly make a huge blunder going forward...at least on this singular issue πŸ˜… .

And thanks to all who have dealt with me!

hoary spear
#

Second option, for a grenade, would relevancy range really be an issue beyond theory?

#

If you can take damage from it, surely you're well within relevancy range?

#

Depends etirely on game and settings ofc..

weary otter
#

Does anyone know if gamelift has auto scaling feature ?

#

Like when demand goes up it can start more servers and create instances automatically ?

uncut frost
#

Hello πŸ™‚

Does anybody have great resources regarding projectile lag compensation and client prediction (no linetrace actual object spawning) ?
Thanks in advance

grand kestrel
uncut frost
#

Ok thanks πŸ™‚ There's not talk/literature on the topic ? Diving into UT source could be a next step, but I first want to get a more holitic idea on the different solutions people have explored. I can't find valuable resources for now 😦

chrome bay
#

Nothing I'm aware of. It's messy and there's no one-size-fits-all solution

uncut frost
#

Ok thanks

chrome bay
#

Using actors makes it harder since they're expensive to spawn and move around

#

And tbh, it's rarely worth the hassle. UT's implementation quite tightly couples it's weapons, projectiles and characters together which is pretty grim.

dark parcel
pseudo crest
#

Excuse me people, Console commands stay until the game closes or it resets if I, like, join a session/change controller/Spawn new character? I'm thinking in putting all player settings console commands like "voice.MicInputGain" in the gameinstance Init event

quasi tide
hoary spear
#

True that.

quasi tide
#

It's important to note about the difference in relevancy behavior when walking back into the relevancy range of a variable that was replicated like 3 minutes ago and an RPC that happened 3 minutes ago.

hoary spear
#

Would it ever make sense to do both?

#

Replicated vars is prob updated at the owning actors replication rate(?) while the rpc is 'asap'(?) so there could be quite the gap there if I understand this correctly? Which i may not lol

quasi tide
#

It's less so about when the stuff happens and more about the behavior of the client seeing the explosion when they're not in relevancy range and then walk into it.

#

If the explosion happened one minute ago and you use an OnRep, then when a client walks into range, the explosion will happen again on their game - even if it happened a minute ago.

#

RPC doesn't do that because it is more for fire n' forget

hoary spear
#

Right - statefull replication vs not

#

And rpc just firing on relevant clients

queen escarp
#

hey guys i need some tips

i have a widget commponent on each player character that displays their name (all that stuff works) im wondering how i best would do a "hide/show" function that locally shows or hides all player name etc,

#

how would u do it ?

#

i mean this works,,, not pretty but

#

only want to change is locally so

sinful tree
queen escarp
#

well

#

this works as intended its just that i dont like the "get all actors of class"

#

however this function will rarely be used so it wornt harm that much tbh

sinful tree
#

Assuming you don't have 100s of player characters being displayed, get all actors of class shouldn't cause any problems.

queen escarp
#

yeah max is 5 so

#

still getting all actors of class "still getts all actors right" +

#

i mean first it checks all actors for the actors with class

sinful tree
#

No. It's a special hash map.

#

It's bad if say you used "Actor" as the class since everything is an actor.

queen escarp
#

oh, but someone told me it still picks all classes and picks out the specific class

#

wich makes sense

#

but maybe he was missinformed ?

#

well nevermind that

#

ive got another issue tho

#

as you can se when im casting my spell on the "client" it acts as if its the player 0Β΄s action

#

im using a Commponent with a referense

#

how would i set the refence in the commponent to reffer to idnno "the owner of the commponent" something ?

sinful tree
#

Get Owner.

#

Put that into your cast.

queen escarp
#

ive tried that but since its not an actor but a "character" it dosent work

sinful tree
#

There's more than one Get Owner node. You want the one that has "Actor Component" as target.
Just a heads up, using any of the Get Player X nodes that have that index won't work well in games that have a listen server host, and should generally be avoided for online multiplayer anyway.
Additionally, that Begin Play will fire on both clients and server if it is a replicated component so the server and all clients would be doing that same logic.

queen escarp
#

oh thats the one ! thanks

#

yeah i know that,

#

thats why i "understood" why it wasent working

#

so instead of begin play should i make custom event that runs on owning client only when setting ?

#

is that better practice ?

sinful tree
#

Well it depends on what you're trying to accomplish. You're setting a replicated variable which could mean that you want it to run on the server so that the value gets replicated.
If you want everyone to have the same reference, you could just let it be as it is, so when it begins play it grabs the owner and sets the value itself without having to replicate anything.

queen escarp
#

hm okey

#

well ill keep that in mind

#

another thing whats the condition for a actor to be "Valid"

#

in this case in checking if "actor is valid"

#

is he always valid untill destroyed or are there any ways to manipulate validness ?

sinful tree
#

Valid is if the variable contains an actual reference to an actor and not nullptr. On clients actors can go in and out of relevancy, and when they are no longer relevant they can be destroyed on the client, so that reference can be invalid on clients if that actor doesn't currently exist on the client.

#

If you've set that variable on the server, then the server should always have a valid reference until such time as that actor is destroyed or you've intentionally set it as empty.

#

As it's a replicated variable, then that reference can become valid again once the associated actor comes back in to relevancy as well, no additonal setting up that reference required

queen escarp
#

hm okey, can i manipulat it somehow ? i mean instead of casting and checking "if dead" can i when the unit dies set Validity to false* when its still in exsistance ?

sinful tree
#

You can only change whether or not the "Taunt Actor" variable has an actor currently stored in it or not to change its validity or destroy the actor.
So if you want the "Taunt Actor" to be emptied when the "Taunt Actor" dies, whatever is holding this Taunt Actor variable would need to know when the actor stored in that value does die.

#

Could be handled VIA event dispatcher that this would bind and unbind to when the Taunt Actor needs to change.

queen escarp
#

okok

queen escarp
#

last thing

#

Datura

#

im having this weird bugg

#

ill just show u what ive got an explain in a video

#

so i have this spell "defend" when casting it should show the Vfx on all clients

#

the vfx is a VFX commponent thats attached to the parent class

#

that i Set visibility in a rpc when casted to

#

but it dosent show on all,

#

it "works" all the stats etcetc its just the visual part thats not working

#

any ideas ?

#

component is replicated*

sinful tree
#

What kind of RPCs are these?

queen escarp
#

the first event is runn on the server those 2 are the RPC (hiding/Showing) the commponent

sinful tree
#

Does activating this ability give the actor component to the target actor at run time, or is this component always existing on the actor?

sinful tree
# queen escarp

Like, this maybe could avoid RPCs entirely if it's a replicated component that is added at run time by the server which causes the visuals to then appear.
When you want the effect to expire, you'd remove the component on the server, taking its visual aspects away with it on all clients as well.

pale bronze
#

I want to use listen server mode for my game. I have all the functionality setup like movement etc and I wanted to know how do I export it as .exes for me and my friend across the web to test out the game so I can see if multiplayer works?

#

Do i need to make host/join buttons and program the functions for that or can I just use the debug consoles and use the "open" command

#

ah

#

okay

queen escarp
#

@sinful tree its permanentΓΆy there

#

Yeah sure but it should be working this way right

#

Γ–Γ–

sinful tree
#

You may want to even change this so it's driven by an OnRep since it's something stateful that is changing rather than using a multicast.

#

Like you have that "Protected" bool. That could be an OnRep. Based on whether its true or not, then that shield chould be made visible or not.

#

But then that loops back to possibly using the Actor Component itself as the thing that is holding the state, namely if they have the actor component currently, then that means they are under the protection effect. Remove the component, they're no longer under the effect.

queen escarp
#

i mean sure it could be optimized for sure but i want everything to work before

sinful tree
#

It's not just about optimization, it's about how the logic works.

#

Multicasting is usually used for visual effects, but not something that is usually persistent that could be seen at a later point.

queen escarp
#

aye i get that and i can for sure change that, but i wanna understand why this isent working .O

sinful tree
#

And that's part of the problem - multicasts can be ignored by the engine unless they're marked reliable of course, where a replicated variable or a replicated component being added will always eventually arrive

queen escarp
#

hm the protect location is however the parent for the ""visual effect"

#

but it sohuld be propagate to children so shouldent matter

sinful tree
#

Propagate to Children only means propagate to anything that has this component as a parent.

queen escarp
#

yeah

sinful tree
#

"Protect Location" is an actor, is it not?

queen escarp
#

no

#

its another particle effect

#

its just empty

quartz star
#

Im working on this since longer time now but how do i correctly replicate an actors rotation to all clients?
Can i just use SetActorRotation() ?

queen escarp
#

i only use that to "rotate"

#

what do u normally use as component to use as a referense ?

#

i normally use arrow but is there something that u use instead ?

sinful tree
#

I'd change that out for maybe a scene component. No sense in using a more complicated component if it's not actually being used (could have a larger memory footprint).

queen escarp
#

yeah for sure it was just a placeholdder

sinful tree
#

As for the problem, I'd say put some break points or print strings in like in the multicasts and see what they're getting as the target and if they're printing on the client

queen escarp
#

hm ok

#

scene commponent 2d ?

#

scene capture commponent

#

those are the options ./ ?

sinful tree
#

Oh it's just called "Scene" in 5.2

queen escarp
#

oh

#

im using 5.3 since a few days ago also, big regret but it is what it is

#

hm i think i solved it by replacing the VFX parent

#

now it kinda just works .,.

#

πŸ€·πŸ»β€β™‚οΈ

pale bronze
#

quick question. When I create a session is the "Public Connections" including the host so If i set max 8 players would it be 8 including host or excluding host.

#

Like if i want to do it just me and my friend would i set public connection to 2 or 1

queen escarp
#

they start at 0

#

so 8 wiould be 9

#

i think

sinful tree
quartz star
#

it doesnt really work well

#

i tried creating a Replicated Variable with ReplicatedUsing but the OnRep_NewActorRotation doesnt fire at all

#
UPROPERTY(ReplicatedUsing = OnRep_NewActorRotation)
FRotator NewActorRotation

UFUNCTION()
void OnRep_NewActorRotation();```
#

okay i see, but is there something i can do to achive a similar result?

#

the setter function should be on server right

sinful tree
#

If you want a variable to replicate when setting it, then you need to set it on the server.

#

If your setter function is to set that variable, and you want it to call the OnRep on the server as well, then you'd call the OnRep function in the setter function.

quartz star
#

So i do this?

void ATestActor::Turn(float Value)
{
     NewActorRotation = GetActorRotation() + FRotator(0.f, GetActorRotation().Yaw + Value, 0.f);
     OnRep_NewActorRotation();
}

void ATestActor::OnRep_NewActorRotation()
{
    SetActorRotation(NewActoRotation);
}
gleaming kite
#

are multiple client -> server rpcs always received on the server in the same order they were sent from the client? Say if the first rpc the client sent failed due to network conditions and had to be resent, would the second rpc that the client sent get processed first due to the first one failing? Or do rpcs carry some data with them letting the server know this is rpc "2"/x and the server waits for that first rpc before doing anything?

silent valley
gleaming kite
#

Ok sweet, thats what i was looking for. thank you

quartz star
quasi tide
#

Correct

crisp shard
#

curious if there is any difference in either of the options presented in this image? when calling the player state

crisp shard
hoary spear
#

Inteface to get char ref is suspicious πŸ€”πŸ«£

hoary spear
#

Because it doesnt make to much sense when you can just cast

crisp shard
#

i just have it setup already, and would rather do that than cast

#

but i may not even need the interface tbh, could probably just call player state right off the actor object ref

hoary spear
#

"Issue" is that you abuse a tool not made for specifics like that

#

Is it an actual issue aside from the theory ? Nah it will work just fine

crisp shard
#

this is the full function

crisp shard
#

i genueinily dont think it makes a difference

hoary spear
#

What do you mean by overkill

#

Casts are type checkers

#

Interfaces are made for unknown /sparse set of unrelated types with some common functionality

sinful tree
#

And a cast to character if you have an actor reference would effectively cost nothing if all you need from it is the playerstate.

hoary spear
#

Cast to pawn even

crisp shard
#

i avoid casting for the reason of cost, but im not sure if an interface is more costly

#

im all ears fr

hoary spear
#

Cast is free

#

So what are you saving

chrome bay
#

😬

sinful tree
#

Not seen from those links: They're under a category labelled "Myths"

crisp shard
#

ahhh interesting

chrome bay
#

Oh good πŸ˜„

sinful tree
#

I was worried too XD

crisp shard
#

i mean, this does kinda seem like it doesnt matter in this case

#

but

#

i do enjoy this learning

chrome bay
#

Thing is if you're casting to a specific type to do something with it, you need that class to be loaded anyway so it's kind of a non-issue.

#

Casting an object to many unrelated types is where things get dumb, but that's just 'bad' design.

sinful tree
#

If I remember right, I think Authaer did some testing on the time used for using an interface vs the time used for casting at some point and posted the results in #blueprint

quasi tide
#

I don't fault you MAiWORLD - there is just a lot of bad info out there about interface vs cast.

chrome bay
#

Without looking.. I'd expect them to be pretty much the same, maybe a reflected interface cast would be a little slower since you're not just traversing the class hierarchy, you're looing at properties of the class too.

#

Just take NVidia approach, improve nothing and add upscaling

quasi tide
#

I don't have the :kek: emoji 😭

chrome bay
#

Instant trillion-dollar evaluation right there

crisp shard
#

for the record, the logic works fine, but i am genuinely interested in finding how i can really retain this info for future things

#

i use interfaces to replace casting for almost everything

#

not everything

#

but a lot of things

quasi tide
chrome bay
#

The use-case for an interface is purely when you want classes that don't share a common base to provide the same logic (or at least, the 'interface' for said logic).

crisp shard
chrome bay
#

That's their sole purpose

quasi tide
crisp shard
#

ok

#

so

#

if we use my example as an example

#

what would you guys do instead that you think would be "better"

quasi tide
#

Just cast to character and get the playerstate

crisp shard
#

this is it again for ref

quasi tide
#

Character is a built in class, so you don't have to worry about loading of assets and things like that

#

Unless Epic done goofed

crisp shard
#

like "cast to character" and not my actual BP_character? just the base classs?

quasi tide
#

Correct

#

I always cast to the lowest required class. So you could cast to Pawn as well. Because Pawn has playerstate.

hoary spear
#

A good example for when you probably want an interface is an interaction system

#

Where you can interact with doors, Houses. Npcs, trees and whatnot

crisp shard
#

very dope info, i appreciate all of this

#

when considering multiplayer does any of this info change?

quasi tide
#

Not really

crisp shard
#

(this is the multiplayer channel after all lol) and i am making the game mulitplayer of course

quasi tide
#

I was team interface until we spoke about it. Now I am team component πŸ˜…

#

You can get the benefits of both with team component

hoary spear
#

Im team component myself

#

Allows states and whatnot ^^

chrome bay
#

FindComponent is basically ECS fite me IRL

#

it's not but yolo

queen pine
#

Has anyone who has worked with fast arrays thought of a way to serialize dynamic properties into a single struct member?
I think byte arrays is probably the best solution, but I think it would still be problematic.
basically, I need to store dynamic properties, their values, and metadata on actors. So If a property were to be changed, added, or removed on an actor, PostReplicatedChange would return the exact property and not all the actor's properties.

#

I guess the regular way to do this would be to have serialized structs for every type of property and if they included the GUID of the owning actor, I would be able to make the change. This seems weird though to have a new serializer for every type.

steel vault
#

Is there a reason why my CMC wouldn't be replicating the Flying movement mode properly to simulated proxies? My listen server enters flight mode and animations for the locomotion that rely on the CMC.IsFlying variable do not play for the simulated proxy, and it falls to the ground but remains in air on the server.

steel vault
#

I guess I was under the impression that movement modes were automatically replicated out to clients, is this not the case?

steel vault
#

Hmm, it appears I was doing my movement mode check based solely off of the movement safe variable, which isn't set to true for the simulated proxy.

sly kernel
#

Is it possible to build for and run dedicated server on Android (phone, tablet) ? Clients (other phones) would be expected to be near by (within the same wifi network) to connect.

fossil spoke
sly kernel
#

someone said dedicated server isn't possible on Android, that's why I am asking πŸ˜…

fossil spoke
#

Ive not developed for Mobile, so I honestly cannot answer that.

sinful tree
# sly kernel Is it possible to build for and run dedicated server on Android (phone, tablet) ...

It's probably possible, but seems illogical to use an android device as a dedicated server. Lower processing power + RAM tied with typically lower quality wireless internet connections especially if using a cellular provider's network, and if you're talking about running on a phone then you also have battery life to worry about, and all this adds up to android devices not typically being a good fit for running a dedicated server, especially if the intent is for the person using the android to also be connecting to said server to play or do whatever your app is supposed to allow them to do while connected to the server.

Based on what little development (outside of Unreal) that I've done for Androids, the programming paradigm for Android doesn't really support background applications the same way a linux or windows server would - like usually applications need to be up front and center to have the highest priority, and anything that isn't up front could potentially be terminated at any time by the OS if it determines it needs the resources. Though things may have changed since then, it still seems an odd thing to want to do.

woven basin
#

Just on this - I've never realised this or heard of this before.

So all the various things (including Epic talks themselves) make reference to casting in BP can be expensive because it loads all the references because the casted BP version is the one pulling in all of its references.

But are you saying that if you cast to the c++ version, although we are casting in BP - the cast itself wont pull in references - because it is only a c++ class?

#

:mind blown:

quasi tide
#

Casting to your BP_Player is even fine in a lot of scenarios, because BP_Player is already going to be loaded anyway.

#

If you know that the BP is already going to be loaded at a given time, cast away.

sly kernel
#

I guess I have no choice but forget dedicated server on Android :/ Maybe I could do listen server, but just render some 2D UI and have game running without actually rendering world. Seems like overly complicated endeavor :/

pseudo kernel
#

When thinking about lag compensation, is the server clock synchronized enough to say, trim a timer a little bit based on when it was started on the server - and when the client received the command to start it?

#

This specifically: GameStateBase::GetServerWorldTimeSeconds

hollow eagle
raw sorrel
crisp shard
#

How would you cast to a C++ class? ( I’m full blueprints and would not know where to find this or which is the C++ class)

#

Or would that be the β€œcast to pawn”. Or β€œcast to character” ect?

I.e. the base classes ?

latent heart
#

Yes

crisp shard
crisp shard
#

That is actually super dope to know. Legitimately this convo today has helped me immensely and will absolutely change how i approach certain logic

pseudo kernel
#

@hollow eagle @raw sorrel this looks perfect, love that it has data to back it up too. Less worry for me

latent heart
crisp shard
latent heart
#

It's like in the whole of the UK, if you're under 30 you can't spell etc.

crisp shard
#

Lmaooo I’m 29 so that be me

twin juniper
#

is there a way to set the visibility of a 3d widget per player?

dark edge
#

The widget is visible..... When?

#

Be very specific

twin juniper
#

but for each player individually

dark edge
#

That doesn't look network aware at all

twin juniper
#

it isn't

dark edge
#

This is multiplayer, you need to be very specific. Every replicated actor exists in every machine.

twin juniper
#

true

dark edge
#

The actual rule should be that the widget is visible if the overlapping actor is the local players character. Not just A character.

#

What you have is just checking if it is A character.

twin juniper
#

how to implement that?

dark edge
#

However you want.
Is locally controlled, compare vs get player pawn 0, however else.

#

This isn't multiplayer specific though, you'd have the same problem if an AI is overlapped this thing.

twin juniper
#

so get player pawn 0 is always the local one?

dark edge
#

Yes except in the case of dedicated server I think.

#

It's hacky but start there

twin juniper
#

so for setting the visibility itself i should make that bp class unreplicated, ...right?

dark edge
#

If think IsLocalPlayerController is the most robust thing to do this check

dark edge
twin juniper
#

it's replicated by default i think (unless i checked something somewhere accidentally)

#

either way i have no idea how to do that

#

to change the replication rules of the visbility i mean

dark edge
dark edge
twin juniper
#

prob

dark edge
#

Test

twin juniper
#

how can running some code only on the client be so complicated kappa

dark edge
#

This is multiplayer

twin juniper
#

every client

#

but just not the server

dark edge
#

Your current code is running on every client

twin juniper
dark edge
#

Every machine sees the widget when a character gets close right?

twin juniper
#

yep

dark edge
#

What do you actually care about here? Do you want to see the widget when YOUR character gets close or when ANY character does?

#

This is why multiplayer is hard as fuck.

twin juniper
#

when the pawn 0 (local char) gets close

#

all i need to know is how to make it not run on the server now

dark edge
#

No

#

Listen server wants to see the widget if their character gets close

#

Use the role thing I mentioned

twin juniper
#

multiplayer sure seems fun to work on πŸ™‚

#

thanks

queen escarp
#

Ok ive got an issue, i just made a minimap wich works with Mp and all but when i try to change the "Orthi Width" on my Scene Capture Component 2D it dosent work, if i RPC the change then it works but it affects all clients Ortho... . ???

chrome bay
#

Are you using a render target asset by chance?

queen escarp
#

yeah

chrome bay
#

There's ya problem

queen escarp
#

why?

chrome bay
#

You've got presumably many scene captures all rendering into the same render target every frame, and you're in editor, so they all share the same asset. One of them will win.

queen escarp
#

oh

chrome bay
#

You'll need each instance to create a render target at runtime, then set that as the property of a material instance.

queen escarp
#

yeah

#

thats what ive done

#

or what

chrome bay
#

You're not creating an RT at runtime though, you're using a content browser asset

queen escarp
#

yeah so im just setting the texture target thats true

chrome bay
#

All those scene captures will be drawing to the same render target. One of them will be the one that 'wins'

queen escarp
#

yeah i get what your saying

chrome bay
#

and all your materials are using the same render target

queen escarp
#

so i need to create their own ones

chrome bay
#

yip

queen escarp
#

hm, any simple way to do it or need to watch a tutorial or

chrome bay
#

There's literally a create render target 2D BP node

queen escarp
#

ah right,

#

altho dont i need to create the material ?

chrome bay
#

Create the RT and use that as the render target, then create a material instance for the UI widget and set the texture parameter to that render target

queen escarp
#

or isent that enough

#

aha

#

hm how do i create a material based on the created render target in bp

chrome bay
#

The widget should use the material as the brush not the texture

queen escarp
#

yeah

#

it dose

#

but i need to create a material from the RT

#

to assign it to the WB

chrome bay
#

You don't create a material from the RT. You create a material instance of whatever material the minimap uses, and set the parameter to the RT

queen escarp
#

aye

#

well-.-'

#

so in my widget im using a image wich is a "material instance" based on the RT

#

i need to change that to the newly created RT

#

right

#

and im not sure how to do that since i had to create a material instance from the RT in the content brower and assign that one

queen escarp
#

@chrome bay

#

hm am i on the right track atleast +

chrome bay
#

Yeah, You need to tell the widget to use that dynamic material instance

queen escarp
#

nice!

#

ty for the help

#

just one issue, ive set the scene capture commponent 2D to ignore Skeletal meshes

but its still begin shown have u encountered this :/ ?

#

@chrome bay

chrome bay
#

negative, can't help there

queen escarp
#

ok

undone chasm
#

isn't this for your Minimap cature ?

queen escarp
#

yeah

chrome bay
#

If it's for a minimap I'd have as much of that off as possible

undone chasm
#

you should parse like only 2 objects maybe 3

chrome bay
#

Scene captures are incredibly expensive

#

The less you can draw the better

queen escarp
#

oh

undone chasm
#

you only want to show like WorldStatic, AActors that you flag as Environment/WorldStatic WorldDynamic

#

you won't want to drag decals and fog and everything else

#

draw*

queen escarp
#

well

undone chasm
#

I have only used the Capture Render for PaperDoll inventory screens and added in tags to view not used the ignore tags

queen escarp
#

well since im doing a "tactile turn-based game" i kinda wanna have all the fancyness

undone chasm
#

not for your minimap

queen escarp
#

well kinda :/

undone chasm
#

you don't want to show blood stains and explosion marks i.e. Decal

queen escarp
#

aye ofc

#

basicly what im showing now is all that i wanna show (except the skeltatl meshes)..

undone chasm
#

Fog won't render the same from a birdseye view as it would from player camera

#

so that's another flag you want to ignore

#

and atmoshpere, and particle sprites

queen escarp
#

hm, shadows

#

what are those

undone chasm
queen escarp
#

and what dose A-A show really ?

undone chasm
#

I wonder if that's Temporal Anti Aliasing TAA or just a filter for your camera

queen escarp
#

and translucency

undone chasm
#

if you have glass on a building, and you want it shown from birds eye, instead of a opaque block that players won't know what they are at first

#

you may need translucency

queen escarp
#

ah ok i can remove that hen

#

so ive removed most of them now

#

but the shadows are still ther :/ ?

undone chasm
#

tweak these maybe

queen escarp
#

hmm

south crane
#

I spawn around 17 of these actors and they have insanely high impact on the networking because of the replicated movement

#

what steps can I take to reduce this?

chrome bay
#

reduce their net frequency and/or stop them moving as much

south crane
#

how low should I go for the net frequency? By default it was 100, I set it to 3 and it feels about the same

#

these are the settings I have

#

they kinda do need to move as much but if there is no other way I might have to reduce it or something because its the biggest offender on network performance by a large margin

chrome bay
#

3 seems too low tbh, surprised if it looks good at that rate

#

Depends though I guess

#

How long of a period of time is this?

queen escarp
#

https://forums.unrealengine.com/t/can-i-disable-shadows-on-a-scene-capture-component/404486/2

this is all i can find on how to hide Shadows in the Scene 2d Commponent

Epic Developer Community Forums

Hi Evil_Fischi Not directly in the scene capture 2D component, but you have some options available inside the Scene Capture 2D actor, below in the Scene Capture tab, you can hit the arrow to display more options, here you can enable/disable lots of features like bloom, translucency, decals, fog, etc that you do not need capture, I afraid this ...

#

my project is soley BP, i cant create a c++ class then right ?

south crane
south crane
queen escarp
#

@whole grove yeah the whole thing right ?

#

like its a big deal since the project is quite big already

south crane
#

but its still a huge impact on the network

queen escarp
#

oh

#

hm alright,

#

but im guessing this is the way then or no one know how to hide shadows :/& ?

chrome bay
south crane
#

hmm

#

alright thanks for letting me know then

chrome bay
#

32Kb over 4 minutes is nothing

south crane
#

that is true

#

its just significantly higher than other stuff

#

so it spooked me

#

hahaha

chrome bay
#

yeah but probably because nothing else is changing as often. Movement is often the biggest chunk of networking cost

bitter veldt
queen escarp
#

yeah

#

or the fog of war has nothing to to withj the scene component

bitter veldt
#

ohh it doesn't, my bad, was skimming through the convo

queen escarp
#

aye

sinful tree
# sly kernel I guess I have no choice but forget dedicated server on Android :/ Maybe I could...

"Dedicated Server" and "Wifi" don't mix well. While today's wireless connectivity speeds may be good, it's still not as reliable as a hardwired connection and again I'd still question why would someone be considering using a smart phone, especially one that's only a year old, as a dedicated server? An old phone that you've replaced could make sense to use as a server, but investing that kind of money to have a device that is meant to keep you connected and able to compute while you're out and about, but you're wanting to leave it at home so others can play a game on it? It just seems like such an odd use case for the form factor, power usage and hardware capabilities.

The CPUs in phones are pretty impressive, but they still don't compare to desktop computer hardware. What may be possible with a 7 year old 4-core 65W 3GHz desktop CPU may not be possible on an 8-core 5W 3GHz mobile CPU from last year. There's no real way of doing an apples to apples comparison because how the hardware and software works for phones is vastly different than desktop CPUs, so the 3GHz clock is mostly meaningless, as is the core count.

A listen server could make sense on an Android as then the person hosting would likely be playing on it too, but then you're consuming what processing power is available to help host the network while also playing so performance may suffer. That said, I'm still in the camp that it would be technically possible to host a dedicated server on an Android, but I don't understand why anyone would want to, other than perhaps as a learning experience to see if it is possible. If it was something that was going to be released to the public, it wouldn't make sense and I don't think you'd find many people wanting to sacrifice their phone to be used as a dedicated server, even sporadically, except for tech enthusiast type people.

graceful mango
#

How do i send rpc on specific client? For example i want to send some non-uobject data which must be sent manually and could not be replicated with property. New client loaded, how do i do hot-join sync? I need to server, when new client connected, replicate data to that client.

latent heart
sinful tree
#

Yeah I mentioned that before - you could have people end up hosting dedicated servers on their phones who are then connected to their cellular provider and wondering why its lagging so much or there is frequent disconnects or packet loss :/

latent heart
#

Indeed.

sinful tree
latent heart
#

Another solution would be to redesign your data so that it does live on a replicated actor, like gamestate.

#

If it's being sent to clients anyway...

sly kernel
#

and surely if the game runs on Quest 2, there is no reason why it wouldn't run as server for 2-4 players coop on a phone of equal specs.

#

hell, people run listen server on Quest 2 directly for 2-3 players coop

sinful tree
sly kernel
#

can you please help me understand how would they play a VR game on a flat screen of the phone?!

sinful tree
#

You can use cell phones for VR.

#

You plug your phone into boxes that have the lenses and stuff.

sly kernel
#

ok, thanks for your help

#

you are veering into whataboutism territory

sinful tree
#

"People who use standalone VR most likely have a powerful phone already. Or tablet. "

sly kernel
#

the set up is Quest2+ hardware to play a game and a LAN server needed to be hosted over WiFi so people with VR hardware play coop

sinful tree
#

People who want to host dedicated servers are likely not the type of people who would think that they would want to use their phone as the server.

sly kernel
#

statistical data

sinful tree
#

Most people who own phones don't even understand the concepts of servers.

sly kernel
#

and they don't need to - run the app, specify game's rules, put on HMD and join game's world

sinful tree
#

That then is a listen server.

sly kernel
#

days where you have to fiddle with cmd like arguments and bat files are gone

sly kernel
sinful tree
#

Sorry I'm confusing myself here... When you say run the app, I'm thinking launching the app in VR.

#

I'm not trying to be difficult, i'm really not, it's an interesting concept to me too. I'm just concerned that for the vast majority of people they still won't understand what it is you're attempting to accomplish and they absolutely will attempt to run such a dedicated server on less than ideal hardware over mediocre wifi connections.

sly kernel
#

since it's not a straight forward setup, I am just not going to mess with it..

sinful tree
#

Most people may end up starting up the server, completely forget about it running, and then boom their battery life is gone in half an hour/hour.