#multiplayer

1 messages ยท Page 262 of 1

queen ermine
#

In a shipping build, I am unable to get a ServerTravel execute command node (BP) to actuall transfer everybody

#

In the editor, it works without issues

thin stratus
#

Also why do you multicast the server travel

queen ermine
#

I am testing EVEYRTHING lol

thin stratus
#

Only the server should execute that

queen ermine
#

I have been doing this for 5hrs now

#

and nothing else worked

thin stratus
#

Are you using steam with your packaged build?

queen ermine
#

I was throwing crap at the wall to see what stuck

#

We are using SteamCore

#

packaged in the editor

thin stratus
#

So the builds are actively run through steam?

#

Are your GameModes set to Seamless Travel?

queen ermine
#

Yes

thin stratus
#

Yes to what

queen ermine
#

and levels are set in the editor map

#

No clue on Steam and run through, SteamCore is a plugin

quasi tide
#

I know - I was just trolling

queen ermine
#

I am using package build in editor

hollow swallow
#

Okay so its not getting the actors correctly. it knows theres 4 because it runs the loop 4 times, but it only sets 3 of them for some reason

thin stratus
queen ermine
#

I can host a server, friends can join, steam shows up

thin stratus
#

Steam core doesn't matter here

#

Thanks

#

And you are sure you are seamless traveling?

queen ermine
#

StreamCore, is what is building the steamworks stuff

#

no?

#

Yes, I will show you

thin stratus
hollow swallow
#

Am i doing something wrong in this section where i set the platforms? length is 3 (4) but in the player platforms it adds 1 with no reference for some reason

queen ermine
#

Ah

thin stratus
#

The only reason packaged with steam could not move all players is if you were to use hard travel

#

And please don't multicast the server travel

queen ermine
#

I have a GameMode for the Lobby, and have seamless travel turned on

#

I have a GameMode for the Main level (not lobby) and seamless isnt on there. Does that matter?

thin stratus
hollow swallow
#

yes each player does it i think

thin stratus
#

You should preferably only do this once. You can't guarantee the order will be the same

#

The whole setup looks pretty cursed tbh

hollow swallow
#

its on the game mode begin play. does that fire for each client or just once?

#

its from a lobby tutorial xD im in too deep now to make my own

thin stratus
hollow swallow
#

okay so its only firing once then

#

i just dont get why its adding one as null all of a sudden

thin stratus
#

Are you potentially expecting tags 1 to 4 but pass 0 to 3?

hollow swallow
#

nah i always get 0

thin stratus
#

I would suggest you get all Actors of Class for each of the classes once, then save them to an array, and then loop the arrays and compare the tags

#

That way you can debug this easier

hollow swallow
#

sorry bad explanation. So i get them all on begin play on game mode, then store it, the playerplatforms array is replicated too.

Then whenever a player connects, it gets all player controllers, loops them and adds to an array and sets a bool once its done.

Then it loops the playerplatforms array, and for each it gets the player controller variable of that platform, if its invalid, it spawns a character on it and loops til all of them are spawned. Then when someone leaves, it does the same thing

#

ive been trying to debug for ages, only thing i can find is this one platform is empty, but it still has 4 items in there (i have 4 playerplatforms)

dark parcel
#

Unrelated but where is player platform array declared?

hollow swallow
#

game mode

dark parcel
#

Make no sense to replicate it then.

#

Game mode only exist on server.

#

Clients dont have a copy of the game mode, they will never know an array called player platform.

#

You probably should read exi's guide pinned in this channel.

hollow swallow
#

alright thats off now. Only the game mode handles the platforms and spawning too

dark parcel
#

Bp lobby players are placed at editor time?

hollow swallow
#

at run time yeah

dark parcel
#

You need to debug on your end. First check if you get all expected lobby players, also checking each of the tag.

Then you check if all the platform have the matching tag.

#

I dont know what you are doing but it may be neater to just spawn a platform for joining player and assign that platform to the joining player.

hollow swallow
#

That is printing that theres 1 less platform in the array than its finding, but if its finding them all, why arent they added

dark parcel
#

Add a break point and you will see why.

#

Most likely there is a tag that doesn't match, hence it return null.

#

Also using get all actors here is pretty nasty imo.

Heed what exi says about getting it once and caching the result.

#

You then iterate from the result that way the order is guaranteed.

hollow swallow
#

Okay thanks ill keep at it

fluid prawn
#

Question when setting a PC on the Server for an actor. I assume its only 1 PC owner per actor?

verbal ice
#

Yes

fluid prawn
#

lame

#

so that means I can have only one PC owner that can send RPCs to the server

#

via that actor?

quasi tide
#

Any client can send server rpcs from any actor they have network ownership of

verbal ice
#

Via one single actor yes

fluid prawn
#

So basically If I have a sim proxy actor B and lets say I don't touch the gamemode or PC. Then this means my sim proxy will need to sit on tick an poll when a player connects so I can assign it an owner for that SimProxy

#

Then I can call RPC functions to the Server Version on that SimProxy Actor

modest crater
#

Finally got around to implementing it (Screenshot from mess around project), once again I really appreciate your tips, only took like 20 minutes to get up an running.

For anyone interested, here is the only code required to make this work. Just copypasta this inside of UEditorEngine::CreateInnerProcessPIEGameInstance in file PlayLevel.cpp above the following line here:

// Might be invalid depending how pie was launched. Code below handles this
if (InParams.DestinationSlateViewport.Get(nullptr).IsValid())
bool bUsingSplitMainView = CVarEnableMultiPIEInMainViewport.GetValueOnGameThread();

EPlayNetMode PlayNM = PIE_Standalone;
GetDefault<ULevelEditorPlaySettings>()->GetPlayNetMode(PlayNM);
int32 PIEWindowIndex = PlayNM == PIE_Client && InPIEInstanceIndex != 0 ? InPIEInstanceIndex - 1 : InPIEInstanceIndex;

if (bUsingSplitMainView && PIEWindowIndex < 4) // The 5th client falls back to the old way of creating a new PIE window.
{
    FLevelEditorModule& LevelEditorModule = FModuleManager::GetModuleChecked<FLevelEditorModule>("LevelEditor");
    TWeakPtr<ILevelEditor> WeakLevelEditor = LevelEditorModule.GetLevelEditorInstance();

    if (TSharedPtr<ILevelEditor> LevelEditor = WeakLevelEditor.Pin())
    {
        TArray<TSharedPtr<SLevelViewport>> Viewports = LevelEditor->GetViewports();
        for (auto IT = Viewports.CreateIterator(); IT; ++IT)
        {
            TSharedPtr<SLevelViewport>& VP = *IT;
            if (!VP->IsInForegroundTab())
            {
                IT.RemoveCurrent();
            }
        }

        if (PIEWindowIndex < Viewports.Num())
        {
            SlatePlayInEditorSession.DestinationSlateViewport = Viewports[PIEWindowIndex];
            InParams.DestinationSlateViewport = nullptr;
        }
    }
}
#

@thin stratus was supposed to reply to you ๐Ÿ˜…

#

(Anyone copying would need to implement their own CVar if you want to toggle it like my implementation)

thin stratus
#

I think your code formatting is broken in that post.

#

Glad you got it working.

fallen fossil
#

But then how do you tell client which text to load? xD
or maybe you want to hard code one answer

thin stratus
#

I also added something on our end that morning that spawns the windows (not the viewports) in a nice 2x2 grid.

verbal ice
#

As long as your gameplay tags are deterministic (loaded the same order on the client & server) i'm pretty sure there's cheap replication for them

thin stratus
#

Not sure what the identifier for their columns are though.

verbal ice
#

Where they're replicated by index

#

@hollow breach

fallen fossil
#

im pretty sure Ftext is serialized as key not full string

verbal ice
#

Check fast replication is enabled in Project Settings -> Gameplay Tags

#

If you mean replicating a list of them, try a FGameplayTagContainer

thin stratus
#

There isn't really anything special to consider here. Tags are usually replicated as ints due to being FNames internally. The only useful thing that GAS has is the Tag Counter thingy.

thin stratus
fallen fossil
#

well, I should mention that I meant to use Localized Text :d

#

not just Text

thin stratus
#

Yeah although you might want tag counts so I would suggest you just copy the tag count map thing GAS has.

fallen fossil
#
        Value.TextData = MakeShared<FTextHistory_Base, ESPMode::ThreadSafe>(TextId, MoveTemp(SourceStringToImplantIntoHistory));
meager spade
#

any iris gurus ?

#
[1/2] Fragment: L_WorldMap_C_LifetimeConditionals DescriptorId: 0x1820fd811fed97ce DefaultStateHash: 0xb16437061a0eca2b
FPropertyReplicationState L_WorldMap_C_LifetimeConditionals
0 - AttachmentReplication : (AttachParent=None,LocationOffset=(X=0.000000,Y=0.000000,Z=0.000000),RelativeScale3D=(X=0.000000,Y=0.000000,Z=0.000000),RotationOffset=(Pitch=0.000000,Yaw=0.000000,Roll=0.000000),AttachSocket="",AttachComponent=None)
1 - ReplicatedMovement : (LinearVelocity=(X=0.000000,Y=0.000000,Z=0.000000),AngularVelocity=(X=0.000000,Y=0.000000,Z=0.000000),Location=(X=0.000000,Y=0.000000,Z=0.000000),Rotation=(Pitch=0.000000,Yaw=0.000000,Roll=0.000000),Acceleration=(X=0.000000,Y=0.000000,Z=0.000000),bSimulatedPhysicSleep=False,bRepPhysics=False,bRepAcceleration=False,ServerFrame=0,ServerPhysicsHandle=-1,LocationQuantizationLevel=RoundWholeNumber,VelocityQuantizationLevel=RoundWholeNumber,RotationQuantizationLevel=ByteComponents)
2 - NetCullDistanceSquared : 0.000000
[2/2] Fragment: L_WorldMap_C_State DescriptorId: 0xb10480b0ce3459a3 DefaultStateHash: 0xa5791ced902d251e
FPropertyReplicationState L_WorldMap_C_State
0 - bReplicateMovement : False
1 - bHidden : False
2 - bTearOff : False
3 - bCanBeDamaged : False
4 - RemoteRole : ROLE_Authority
5 - Owner : None
6 - Role : ROLE_SimulatedProxy
7 - Instigator : None
Printing default state hash for members of [1/2] Fragment: L_WorldMap_C_LifetimeConditionals DescriptorId: 0x1820fd811fed97ce DefaultStateHash: 0xb16437061a0eca2b
Member: 0 AttachmentReplication
    Member: 0 AttachParent Serializer: FObjectNetSerializer Hash: 0xbe6056edf5e94b54
    Member: 1 LocationOffset Serializer: FVectorNetQuantize100NetSerializer Hash: 0x3f317f46466233af
    Member: 2 RelativeScale3D Serializer: FVectorNetQuantize100NetSerializer Hash: 0x3f317f46466233af
    Member: 3 RotationOffset Serializer: FRotatorNetSerializer Hash: 0xbe6056edf5e94b54
    Member: 4 AttachSocket Serializer: FNameAsNetTokenNetSerializer Hash: 0x9ae16a3b2f90404f
    Member: 5 AttachComponent Serializer: FObjectNetSerializer Hash: 0xbe6056edf5e94b54
Printing default state hash for members of [2/2] Fragment: L_WorldMap_C_State DescriptorId: 0xb10480b0ce3459a3 DefaultStateHash: 0xa5791ced902d251e
Member: 0 bReplicateMovement Serializer: FBitfieldNetSerializer Hash: 0xbe6056edf5e94b54
Member: 1 bHidden Serializer: FBitfieldNetSerializer Hash: 0xbe6056edf5e94b54
Member: 2 bTearOff Serializer: FBitfieldNetSerializer Hash: 0xbe6056edf5e94b54
Member: 3 bCanBeDamaged Serializer: FBitfieldNetSerializer Hash: 0xbe6056edf5e94b54
Member: 4 RemoteRole Serializer: FNetRoleNetSerializer Hash: 0x47a24c13b17e583e
Member: 5 Owner Serializer: FObjectNetSerializer Hash: 0xbe6056edf5e94b54
Member: 6 Role Serializer: FNetRoleNetSerializer Hash: 0xbec09cc447469d8b
Member: 7 Instigator Serializer: FObjectNetSerializer Hash: 0xbe6056edf5e94b54```
#
Warning      LogIris                   index 0/2 named L_WorldMap_C_LifetimeConditionals identifier (0x563ca04a11f2a58d, 0xb16437061a0eca2b) Pointer: 000006319AB26C00
Warning      LogIris                   index 1/2 named L_WorldMap_C_State identifier (0x1ce45043dc41f9a7, 0xa5791ced902d251e) Pointer: 00000631A7AB3800```
#

hitting this ensure ensureMsgf(NewProtocolId == ProtocolId, TEXT("FReplicationProtocolManager::CreateReplicationProtocol Id mismatch when creating protocol named %s with in ProtocolId:0x%x Calculated ProtocolId:0x%x"), DebugName, ProtocolId, NewProtocolId);

verbal ice
#

You might as well use FGameplayTagContainer at that point

#

But yes, you should enable it anyway

#

It should work even with an array

fallen fossil
#

found another solution.
I can retrive key and name space from FText

    const FString* sourceStringPtr = FTextInspector::GetSourceString(message);
    TOptional<FString> sourceNameSpacePtr = FTextInspector::GetNamespace(message);
#

but in both cases, I did not predict that I sometimes still need to pass values to format text ๐Ÿ˜…

#

which makes this kinda restricted to simple messages

formal solar
#

I just realised I was randomly replicating all my ai controllers with an always relevant flag and net update rate of 100

#

I have some old code from when I first started the project and was new to MP and just spammed multicast lol

modest crater
#

Sign me up!

quasi tide
#

Didn't even know you could do this

thin stratus
#

btw, I don't think you can have more than 4 players in PIE.

modest crater
#

Cursed or what aha

Epic has a max count at 10

#define MAX_PIE_INSTANCES 10
static TMap<FGuid, FGuid> PIEGuidMap[MAX_PIE_INSTANCES];
modest crater
# quasi tide Didn't even know you could do this

Just a heads up I noticed there was a bug there with dedicated where the first viewport is skipped, would be a super easy fix by just checking if its a dedicated server with the InPIEInstanceIndex but I just have been busy with other stuff

I just updated it now so it works with dedicated just fine

quasi tide
#

I'm an indie with a bubblegum budget. I don't do dedicated.

#

The real question is - do I need a source build, lol

modest crater
#

Yeah unfortunately

fluid prawn
#

Can you have a TFastArray Item contain another nested TFastArray item in it? then mark the inner and outer items dirty and still get the PostReplicatedChanged etc call backs?

#

I did just tryed it out of curiously but I wonder if you really need to do some custom serialization stuff

#

So you can Imagine you have two TArray Containers where each item in the outer container has a set of items. Then when the inner item changes of that array changes I can get the outer item change and the inner item. This way I dont need to do any extra inner checks to find the inner index that is changed?

random flicker
#

hello!
Does any one find a new contextstring in 5.6?
{,,UnrealEditor-Engine.dll}::GPlayInEditorContextString -> this is not working anymore in 5.6

modest crater
#

That should work, perhaps remove .dll

random flicker
modest crater
#

Iโ€™m on mobile and it linked the wrong thing, if you expand the side bar you will see Tips and Tricks

#

That will give you the correct expression

quasi tide
#

@verbal ice Are you still using GMC and its network prediction stuff? If so - still going pretty well for you? Any updates on frustrations you've found?

verbal ice
#

Personally don't have much negatives to report

#

The author added support for instanced structs in the move data so now you can pretty much sync w/e you want

#

(or you can add custom sync data too via some macro definitions if instanced structs are too heavy)

#

The community created the GMAS (General Movement Ability System) which is a plugin similar to GAS in function but made to work with GMC

quasi tide
#

Yeah - I'm curious about the stability of GMAS

verbal ice
#

It even has stuff like server applied effects that are "predicted" by the client

#

So you can do stuff like stuns with no errors

#

Server just tells the client to apply the effect and the client tells the server it has applied it within move data

#

I know GMAS is used by at least one big project atm and they contribute to it a lot

quasi tide
#

I've been pondering combining GMC + GMAS + U# ๐Ÿ˜…

verbal ice
#

Having used it myself it is pretty good

#

What kind of project?

#

The first two I'm probably gonna end up using in my project that has Lua as well DogKek

quasi tide
#

Standard run of the mill MP zombie game honestly.

verbal ice
#

Yeah that'll do fine

#

I love the rollback stuff it exposes

#

I generally end up routing shooting netcode through the GMC too

#

because of how sweet it is to be able to shoot at the same position as the client on the server

#

You end up with pretty much what games like CS do

#
  • GMC's rollback capabilities are cool
#

(Even though I technically wouldn't use them very often, they're expensive, depends on the player count and all)

#

But for instance it's able to rollback players around the player you're applying movement to

#

So you can do player to player collisions fine

quasi tide
#

Yeah - rollback type stuff is.

verbal ice
#

Overall it's great

#

The code is very readable too so if you need to modify it or improve performance it's defo doable

#

I like that it buffers moves (it's a setting, you can change how it works)

#

But you can do a static X ms buffer or adaptive based on the player's network performance

#

being able to peek into the future that way is nice

#

The downside is that anything not networked through the GMC will be "out of sync" with that buffer so you gotta be careful

#

like for instance you'll see players X ms in the past like other games do, but regular replicated properties don't care about that buffer

#

I think that's probably my only "issue" with it. It's not a deal breaker of any kind but you have to work around it/be wary of it

grizzled stirrup
quasi tide
#

I'm already pretty comfy with UE's stock stuff. Just curious about GMC stuff specifically and I know Cyn uses/d it

grizzled stirrup
#

Nice ๐Ÿ™‚

verbal ice
#

I love the GMC and will probs use it for all my projects

grizzled stirrup
#

where it doesn't really matter if clients can confirm hits

verbal ice
#

At least not for hits

#

If you need to rollback for player to player collisions or the likes sure

#

Or moving platforms which GMC can do as long as you can deterministically roll them back

grizzled stirrup
#

Makes total sense ๐Ÿ™‚

#

I've been enjoying giving the client a lot more freedom in my game, nice to give clients the most responsive feeling game within your design limits!

verbal ice
#

Yeah

#

It also makes your game code so much more cleaner

#

The shooting netcode one is an example I use a lot

#

You don't have to check if the position the player reported the shot at is valid because you've already validated it

#

You're running their shot at the same time you processed their movement input

#

since the shot input is within the movement input

#

Oh right - just make sure you're not using Iris, I don't think the GMC supports it yet

grizzled stirrup
#

sounds useful for competitive games! the CSGO rollback still blows my mind

grizzled stirrup
#

client hits on his screen, tells server he hit, server deals damage

verbal ice
#

Yeah if you're trusting the client that's fine

#

GMC's just got a lot more to it that I like

#

custom collision shapes for one

#

Being able to change them at runtime

#

i.e. prone players can have horizontal capsules

#

How easy it is to add new data to the move stuff

#

And it being fully Blueprint compatible, like you can't add custom movement data to the CMC in Blueprints

grizzled stirrup
#

sounds like a dream for competitive games. I still haven't been brave to even try just because of how hard it is to prevent cheaters even with a good anticheat

verbal ice
#

I wouldn't do it personally but it being a thing makes it awesome

verbal ice
#

Cheaters will always be a problem but you can do a lot to make it harder for them

grizzled stirrup
#

It's just discouraging to see even AAA companies like COD still have rampant cheating

#

makes me want to focus efforts on games where cheating doesn't matter

#

all it takes is a single cheater to compromise the trust of players and ruin a competitive economy especially if you were running a game that lasts longer than a few matches and has persistent inventory

#

hats off to the games that can pull all that off

verbal ice
#

I mean most games just don't have cheating affect the inventory, when possible

#

Like CS

#

Although some games like Escape From Tarkov somehow allow cheaters to "vacuum" all items in the map into their inventory, like holy shit what kind of rats nest is that codebase

grizzled stirrup
#

Well say games where a player with an aimbot can eliminate another player that drops inventory

verbal ice
#

Hell i've seen clips of cheaters stealing a SCOPE on a weapon that was held in another player's hands

#

It's hilarious

latent heart
verbal ice
verbal ice
#

Gives them more money

#

I'm surprised that game still has a community in that sense, but not too much since it's the only game of the sort that does it well

#

Every other game tries to be a new EFT but like, you can't unless you make EFT 1:1

#

The playerbase for that game won't want anything else

grizzled stirrup
#

I do admire how games like path of exile have absolutely everything serverside and they manage to keep a steady economy that isn't exploited

verbal ice
#

Yeah

#

MMOs have it a little easier in that sense

#

Or well, it's difficult in different ways than we're used to

#

It's mostly botting they have to combat afaik

grizzled stirrup
#

yeah for sure

#

games like COD ranked where you have people soft cheating are the really annoying cases as the entire game revolves around having fair gunfights

#

not sure things will improve with the looming AI stuff

latent heart
#

Even worse was the MMR exploiting.

exotic wasp
verbal ice
#

Do they even have anticheat

#

right they have BattlEye kek

exotic wasp
#

yes and its "decent"

#

but anticheat is a bandaid

verbal ice
#

doesn't matter when the game itself leaves itself wide open lol

grizzled stirrup
#

Would you not just straight up quit the game if you grinded for gear for 10 hours and some cheater aimbotted you and stole it?

exotic wasp
#

on a severed artery

grizzled stirrup
#

Why do players stay?

verbal ice
#

Only game of its kind

verbal ice
#

Every other attempt to make a similar game has died

exotic wasp
#

and pretty much everyone i know did the same

verbal ice
#

or was just too different for them

#

yeah I stopped playing years ago

#

that game is not good for my mental health LOL

exotic wasp
verbal ice
#

Yeah

exotic wasp
#

then there was the cycle which somehow had a WORSE cheating issue than tarkov

verbal ice
#

I loved the cycle

#

i'm sad they fucked it up

exotic wasp
#

i just genuinely dont know how games are made to be this wide open

verbal ice
#

And here other studios I've worked for always told me I'm "too careful"

#

lol no

exotic wasp
#

like surely someone along the path of development raised the question "what if someone cheats"

verbal ice
#

i'm doing the bare minimum

exotic wasp
#

movement i can at least understand because its so hard

#

but inventory management? like cmon man

#

and tarkov has no concept of relevancy with their networking. so everything is sent to every player all the time

grizzled stirrup
#

Really shows that a good idea matters more than a good technical foundation

exotic wasp
#

players dont care how a game is built under the hood as long as it works well

timid nymph
#

Hey all,

Have a strange question.

I have a button that gives my characters a skill (add the string "lockpicking" to a string array on the character pawn)

when I press the button, I am trying to replicate it correctly but I think im doing something wrong.

On the client itself, its skill list is being updated properly and when it interacts with a locked door, the door opens as expected. But the door opening does not replicate to other players, only to the client that has the lockpicking skill who opened it.

When the door is not locked, it replicates the opening fine.

Im trying to deduce whether the skill itself is not replicating correctly to tell other players that they have the skill to open it or if there is an issue with my door logic for locked door replication.

anyone have some ideas to help debug this?

dark parcel
verbal ice
#

It's possible but I've never done it for a client

dark parcel
dark parcel
timid nymph
formal solar
#

I move away from always relevant, I had to replicate the teams colour and update it on a timer but got massive performance gains. Will have to keep an eye out since there is now some graphical information that might be inconsistent (seems ok so far though) but shouldn't be too hard to fix and definitely worth the tradeoff.

thin stratus
#

In theory most of the time a combination of OnRep variable and EventDispatcher goes a long way in keeping stuff like team colors event driven.

formal solar
#

Well what I do is replicate the team colour variable and then hide the widget when player is far away anyway, when player gets near enough I set the team colour locally based on the replicated variable (which will get replicated sooner or later because the net cull distance > widget hide distance and my min net update rate is like 5), sometimes the team colours do flash black for a moment (the default colour) but I can probably just hide them if they are black easy enough

#

theres a chance units will display wrong stats and stuff so may need to fix that but its just cosmetic all the fighting logic is done on server anyway

thin stratus
#

Then you don't have to worry about the Widget not having the info replicated in time.

#

Or probably better even just replicate the team through the playerstate and have a DataAsset or fwiw a map somewhere for Team to StaticTeamData, so the local player can just look up the color

formal solar
#

yea im sure ill figure out a way tbh it works ok now i fiddled with some stuff only it does flash black for a second

nova wasp
formal solar
#

by team you mean all my allied ai?

nova wasp
#

some small ID that represents the team they are on or something?

formal solar
#

i have that

#

owner id i call it

#

if i did on widget a binding it would be pretty much instant just less performant i guess i can do like tick every 0.05

#

but then still black for those 0.05 lol

rigid smelt
#

hey. just started looking into networking side of ue and I started with the 3rd person template but when I play as client side the camera doesn't rotate, how to fix?

gusty slate
#

Hello hello, if an actor is replicated and replicates movement, should SetTransform called on server context not update the transform on all clients?

modest crater
#

Is the actor hidden? There are some caviates to how set transform skips stuff

formal solar
#

Multiplayer movement is normally handled by the character movement component. If you don't use character movement component it's much less smooth and you need to handle a lot of net issues yourself, eg you can get bad rubberbanding

Setting transform directly doesn't involve using character movement. The 'replicates movement' flag corresponds to the character movement component and not custom movement nodes like set transform

#

I suggest to use nodes that involve character movement component, or AI nodes like AI move to also use it

#

Actually I realised I am just assuming you're talking about a character here. It all depends. if it's something like teleporting a static object without physics as a one time thing then yeah you can just multicast or repnotify set transform (actually if it is replicated it should move on clients too, maybe you have replication turned off for a particular component?

#

But replicates movement flag has nothing to do with that kind of repositioning

modest crater
#

Tbf lots of things can move that aren't just characters, the engine also supports interpolation/extrapolation methods for actor movement being replicated

#

A platform moving, a door opening etc

formal solar
#

A lot of that would be in C++ though right

modest crater
#

Wdym, for physics sims (what you would interp/extrap for anyway) its just an enum

/** Which mode to replicate physics through for this actor. Only relevant if the actor replicates movement and has a component that simulate physics.*/
UPROPERTY(EditDefaultsOnly, Category = Replication)
EPhysicsReplicationMode PhysicsReplicationMode;
formal solar
#

ah well maybe my knowledge is not 100% correct, however replicates movement is certainly not intended for stuff like set transform node

modest crater
#

I do agree that you would usually replicate something like a platform or door different, IE send the final position and let the local client handle interpolation. You can then get fancy by subtracting HTT to try get it more in sync but yeah, I was just saying you don't always need a MC for it

sonic obsidian
#

Is a replicated actors spawn transform quantized when sent to clients to spawn or is it full floating point precision

tardy fossil
#

pretty sure all actors's spawned on server send position/rotation quantized unless disabled by a cvar

#

well the spawn transform at least

#
net.QuantizeActorLocationOnSpawn=1
net.QuantizeActorRotationOnSpawn=1
sonic obsidian
#

thanks

mystic estuary
#

Hello, is it possible to change replication condition of a property in children classes? So if actor A does DOREPLIFETIME(ThisClass, Foo), is it possible for actor B that inherits A make it be something like DOREPLIFETIME_CONDITION(ThisClass, Foo, COND_InitialOnly)?

keen slate
#

I got this message while failing to join a game - I think someone was trying to join at the same time, and the server limit of 4 players was hit:
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BP_PlayerCharacter_C_2147473386. Function Server_SetEnabled will not be processed.

I'm not exactly sure how to interpret this message. Anyone can tell me what it means?

robust linden
#

hey

#

replication only works from server to clients?

#

or like from authority to others

#

it's a very basic question but Im unsure

modest crater
#

Yes only the server is in communication with all clients, if A wants to talk to B it must go from A -> Server -> B

#

Same goes for property updates, if A wants to change something that is replicated, it must do it via the server otherwise it and all clients will be out of sync with client A

modest crater
keen slate
thin stratus
mystic estuary
crisp shard
#

i have a situation where a plyer can get "killed" and they become soemthing that can be picked up by another player, when i do this i attach that dead player to an actor, and then that actor (basically an interactable sphere) is picked up by another player, this works until the player that picked up the player jumps from high distance or flys at all, it seems that the height or Z isn't updating on that client that is dead, and on their screen they falll through the ground. but the server still maintains everything so everything still works its just not appealing to be the captured player in that case as you just fall thruogh the ground in certain cases

nocturne quail
#

which one is more likely recommended to use in terms of stability and optimization?

void AArmaRealPlayer::SetBoardingPlane(ABoardingPlane* NewBoardingPlane)
{
    BoardingPlaneRef = NewBoardingPlane;
    const bool NewInBoardingPlaneState = BoardingPlaneRef ? true : false;
    SetInBoardingPlane(NewInBoardingPlaneState);
}
void AArmaRealPlayer::SetBoardingPlane(ABoardingPlane* NewBoardingPlane)
{
    BoardingPlaneRef = NewBoardingPlane;
    SetInBoardingPlane(BoardingPlaneRef != nullptr);
}
latent heart
#

SetIsBoardingPlane(!!BoardingPlaneRef);

nocturne quail
latent heart
#

! converts the pointer to a bool based on whether it's null. !! inverts that.

#

Not null -> true

nocturne quail
verbal ice
#

Has anyone gotten online beacons to work via Steam Relay?

#

Anything that would make that impossible?

exotic wasp
latent heart
#

It's the way!

#

๐Ÿ˜„

dark edge
#

It is wrong

#

why have 2 variables representing the same state

#

Redundant at best and a bug factory at worst

#

just check BoardingPlaneRef when you wanna know if you're boarding or not

#

What's next, MyCurrentWeapon and bCurrentlyHasWeapon?

latent heart
#

That was not an option!

dark edge
#

how many different shapes?

#

I suppose what are you trying to do?

#

it'd be far easier to make a bp for YourReplicatedThingy then just set whatever you want in it

#

you'd make 1 asset, not 1 per shape

#

What is the actual problem here

#

your asset would reference the packaged shapes

#

you'd just be able to replicate the asset ref and swap the shape out on both ends

latent heart
#

Replicate an enum. Use an onrep for that enum which changes the mesh.

#

1 enum entry per shape.

quasi tide
#

Could you spawn actor deferred, add a static mesh component, set the mesh to some hardcoded asset, turn on breplicates, and then finish spawning it?

#

I don't know of any other way to do this with your other constraints.

dark edge
#

You said the shape is on the user side already

verbal ice
#

Is it even possible to create multiple steam networking sockets for one server

#

Was thinking one for the server itself, and one for online beacons

true stream
#

Im thinking of upgrading a game made on 5.3.2 to 5.6, in terms of multiplayer, can anything break? the rest of the game is quite simple.

#

(Im using listen-servers, replication, multicast, etc)

verbal ice
#

but you can request multiple ports for your fake ip from Steam

#

So I'll do one for the game server and one for the beacon host

verbal ice
#

so if you have a replicated property that isn't registered, it'll start replicating once you upgrade to 5.6

#

Otherwise, I don't think there will be issues

true stream
#

Great, I will upgrade then.

#

mostly because apparently now it saves the position of my PIE windows.

#

(size, position, etc)

#

it was driving me crazy

meager spade
#

since when and where

#

that sounds like a huge (and potential bug creating thing)

grand kestrel
#

That sounds awful

#

It was helpful having those errors if I forgot to add something, because its probably COND_Simulated...

#

Now it will just silently replicate to all

fossil spoke
#

Yeah that should be opt in not opt out...

#

The hell are they thinking

meager spade
#

๐Ÿ˜ฆ

verbal ice
#

Yeah should've been opt in

halcyon ore
#

Just out of curiosity.
Why is that bad?

fossil spoke
# halcyon ore Just out of curiosity. Why is that bad?

For one, the DOREP is sort of acting like a check for the programmer, asking "are you sure you want this replicated". If its missing, UHT will complain about it. So you have to either add it and be sure that was intentional, or remove the Replicated/ReplicatedUsing from the UPROP.

#

With this you can easily just forget that you added that specifier to the UPROP and all of a sudden that variable is affecting change across the network.

modest crater
#

I agree opt in is better but like that said itโ€™s bc of iris so they would need to make iris opt in too if that were the case. Being a cvar now means it goes from a compiler error to runtime error which is slightly more annoying but eh

fossil spoke
#

I havent been keeping up with Iris (or anything UE5 really), how does Iris come into this specifically?

modest crater
#

This simulates the default behaviour when iris is enabled

#multiplayer message

So theyโ€™re making it default in standard replication to better align with iris replication

I have only touched iris in a fiddle project, I havenโ€™t needed it myself so Iโ€™m in the same boat really

fossil spoke
modest crater
#

Iris does it by default, so to make it aligned with that? Easier to switch between the two

fossil spoke
#

Iris does it by default what exactly are you saying Iris does by default?

modest crater
#

I'm saying the inverse, one replicates without tht requirement and the other (pre 5.6 needed it) so now it's making both not require it lol

#

From the way I read it, itโ€™s saying the default behaviour in iris is that and this change is to simulate that same behaviour

I mean, I could be wrong and If I am let me know, that was just how I interpreted the change note

thin stratus
#

I just realized, they actually tried to fix the bug some people here had.

#

Basically, if you have a property, like a boolean, set to false in the BP Class and then to true in an placed Instances of the BP. And the Server sets it back to false before the Client connects, the Client won't get the OnRep call for it properly.

#

Cause it will compare False to False and then say the value is already correct.

#

I would still argue this is a setup issue on the BP though.

bright summit
#

something changed in 5.6? I can't add this variable to be watched

nova wasp
bright summit
nova wasp
#

I meant more in the rider debugger module list

#

but that is technically a module list... fair

#

In my case for some reason it changed to being named after my target

#

{,,BattlementEditor-Engine.dll}::GPlayInEditorContextString

#

In my case my project is called "battlement"

#

try using that thing you found in that list

bright summit
#

ah sorry xD

#

there is a lot of these dlls

nova wasp
bright summit
#

can it be this?

nova wasp
bright summit
#

can't find any

#

and I assume this watch is not working because of this, but I have downloaded symbols...

bright summit
#

Yes

modest crater
#

I was reading that

#

๐Ÿ˜ 

soft relic
#

Hey!
Does anyone know if there's a way to disable the root motion montages from syncing? It seems like Montage_SetPosition when with root motion also somehow affects the owning client of the character

#

basically calling SetPosition without root motion works fnie, but with root motion it also "jumps" the montage on the client

latent nest
#

Does epics online services for ue5 work for both pc, and xbox

nocturne quail
#
GameMode->SpawnAeroPlane [Replicated Actor]
AeroPlane->GS->GetPlayersArray [Board all players in a server only array]
Player->PlaneRef->ServerTryEject(this)->PlayerArray->ifcontains->MultiCastEject(player)

UNetDriver::ProcessRemoteFunction: No owning connection for actor BPBoardingPlane_C_0. Function ServerTryEject will not be processed

if i replicate the players array it works fine, but why would i need to replicate the players array in case the player is passed to server to look in the server only player array to eject?

#

PlaneRef is also replicated so client can have valid plane it is attached to

#

Playing as server works fine, and No owning connectiononly when i play as client

nocturne quail
#

Setting the owner this way works fine on both server and client, but is it not against the unreal network model where the actor can have only one owner at a time?

void AArmaRealPlayer::OnBoardedByPlane(AArmaBoardingPlane* NewBoardingPlane)
{
    BoardingPlane = NewBoardingPlane;
    BoardingPlane->SetOwner(this);
    SetCanMove(false);
    SetbOnTheAir(true);
    SetActorEnableCollision(false);
    SetActorHiddenInGame(true);
    AttachToActor(BoardingPlane, FAttachmentTransformRules::SnapToTargetNotIncludingScale);
}
#

or does it mean each player will be owner of their own instance of the plane?

nocturne quail
#

one thing i can think of is to spawn a seperate spwner actor that will spawn the plane and put that spawner as owner of the plane

left marsh
#

How are you supposed to use characters with NavMeshWalking in multiplayer? Do you just always include the navMesh on clients? Why would you ever not?

nocturne quail
#

hmm, seems like setting ownership of a replicated actor by server only sets ownership for server, and clients will not know about it even if the actor is replicated, so i guess need to set the ownership by multicast...

logs for server only ownership of a replicatd actor:

LogTemp: Warning: Player trying to eject: BP_RealPlayer_C_0
LogTemp: Warning: Boarding Plane Authority: BPSpawnManager_C_0
LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor BPBoardingPlane_C_0. Function ServerRequestPlayerJump will not be processed.
thin stratus
#

Owner is replicated.

#

And you can only have one Owner on a given Actor at a time.

nocturne quail
thin stratus
#

Can more than one Client do the Eject on a Plane?

nocturne quail
thin stratus
#

And all of them are supposed to run the Eject function?

nocturne quail
thin stratus
#

Then you can't do it like that. Then you need to route that ServerRPC through an already owned Actor of the Client. Like the PlayerController, possessed Character/Pawn, PlayerState, etc.

#

Most people have an Interaction System set up for stuff like that.

thin stratus
left marsh
#

Yeah. I'm curious why it's possible to use NavMeshWalking in a project while not providing the navmesh to the client, because it just breaks if you do so.

quasi tide
#

Don't think I've ever said to not include it. Don't know why you wouldn't to be honest.

nocturne quail
# thin stratus Then you can't do it like that. Then you need to route that ServerRPC through an...

Plane spawns by the game mode , so character needs to tell the game mode to eject from the plane?

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

    if (HasAuthority())
    {
        SpawnAircraft();
    }
}

void AArmaGameModeBase::SpawnAircraft()
{
    FTimerHandle UnusedLocalHandle;
    GetWorld()->GetTimerManager().SetTimer
    (
        UnusedLocalHandle,
        [this]()
        {
            ensure(BoardingPlaneClass);
            FActorSpawnParameters SpawnParams;
            SpawnParams.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;

            if (AArmaBoardingPlane* Plane = GetWorld()->SpawnActor<AArmaBoardingPlane>(BoardingPlaneClass, FVector::ZeroVector, FRotator::ZeroRotator))
            {
                Plane->SetOwner(this);
            }
        },
        5.0f, false
    );
}
nocturne quail
tame sapphire
#

Is there an improved or preferential method for showing a widget on all clients and waiting for the display time before proceeding?

I was wondering how bad the wait node is and possibly just replacing the timer with a wait. This is in the game state. Or am I way off from the start. Currently all users get the widget displayed

dark edge
#

is it a countdown to a start or something?

#

What is the actual state being represented

tame sapphire
#

@dark edge so it is currently for changes in game phase/state e.g. i have a decision phase where you can make a choice for each server phase. its similar to a tabletop game so charge, combat, movement as well as the decision phase then new turn start. so will display where in the turn it currently is

#

its all time limited so was hoping to not eat into that with the widgets display time

thin stratus
#

Usually if you have a system like this you have some form of variable on the character or some component on it that holds the vehicle or plan.

thin stratus
#

Server RPC in the character to then call eject on the plane/vehicle basically

tame sapphire
#

@dark edge I am rep notifying the E_phase

dark edge
#

you shouldn't be multicasting anything here, you can do a turn based game 100% with onreps

#

and should

tame sapphire
#

@dark edge ok.... but currently its only in the decision phase for 20s as an example if im showing the widget for 3-5s i was hoping to have the phase start after maybe im just too tired and missing it

#

this is the first multicast

dark edge
#

no multicasts, just have the onrep of the state do the things that changing into that state should do

tame sapphire
#

yeah i have that currently but im just missing the delay part?

thin stratus
#

What delay though

dark edge
#

I think like a toast

tame sapphire
#

the delay fopr the length of time widget is shown

dark edge
#

just slap that in the widget if it's meant to just be a toast

#

or in whatever is managing showing these things

thin stratus
#

Isn't that a setting in theory?

#

Like, is this dynamic and different every time? If not, then the client should already know the delay

dark edge
#

You mean like the "Your Turn" thing here right?
https://www.youtube.com/watch?v=RWsLWFqeQDM&t=235s

This is my first time playing Dungeons and Dragonds (DnD) type of game and I have a great experience playing this game. This is one of the combat experiences from Baldur's Gate 3. The combat is very strategic and I find it fun and challenging at the same time. One of the best games that I've played so far!

ABOUT ME:
Iโ€™m Maryo and I upload gam...

โ–ถ Play video
tame sapphire
#

so yes theres a setting and it works for widget display time but if i change to the phase and use the phase to show the widget instead of 20s you only have 17s

dark edge
#

how long should the phase last and how long should the widget be shown?

thin stratus
#

Because of the delay caused by the replication?

tame sapphire
#

yeah pretty much i could just not disable anything whilst that widget is active

#

no delay is a setting time for the length of time it is displayed on screen

dark edge
#

is it different from the length of time the phase lasts?

#

You aren't being very clear at all

thin stratus
#

No I mean, how do you get to your "it's 17 instead of 20"?

tame sapphire
#

depending on the notification type its currently set to display for 1. 3 or 5s

#

and i did have input disabled whilst it was showing so it ate into the decision time. I should just not disable the input so it doesnt matter

thin stratus
#

Oh I get it. You want them to choose something in game for 20 seconds but the notification blocks gameplay for 3 seconds.

dark edge
#

Yeah I'd just have it not block

tame sapphire
#

yes

nocturne quail
thin stratus
#

Yeah no blocking is the answer then

dark edge
#

Everyone would hate it blocking if it's meant to just be a toast or popup

thin stratus
dark edge
#

if all notifications of a type have the same duration then just bake that into the class. If not, make it a parameter on the ShowNotification code along with the notification class and context

tame sapphire
#

so its blocked anyway whilst the server resolves your choices so didnt think it would matter if it was extended for the first and last notification

thin stratus
#

The server RPC has to be in e.g. the character

tame sapphire
#

but i guess ux of non blocking makes sense

#

thank you both

nocturne quail
# thin stratus The server RPC has to be in e.g. the character

I just refactored it and RPC now on the character, and it works fine.. i feel like boarding should be done by the plane and ejecting should be done by the character itself as you said.

but now the plane will check an extra call when auto dropping players Player->IsAttachedTo(this)
since player can't call the server rpc to modify the array of players when it ejects/detached from plane but plane still have it in the players array

 if (IsValid(Player) && BoardedPlayers.Contains(Player) && Player->IsAttachedTo(this))
 {
     UE_LOG(LogTemp, Log, TEXT("Dropping player: %s"), *GetNameSafe(Player));
     UE_LOG(LogTemp, Warning, TEXT("Boarding Plane Authority: %s"), *GetNameSafe(GetOwner()));

     DropPlayer_Internal(Player);
 }
thorny ore
#

I'm guessing that on player login you'd load a players data that was saved. But does anybody know the best way to reference a player?

Like, let's say you're playing a multiplayer game you've played before... like.. something with an inventory and when you connect it remembers what your inventory was.

What's the best identifier for a system like that? Any ideas

verbal ice
#

The online subsystem you use should assign one to the player state

thorny ore
#

ahh. Thanks.

#

It will remain persistent after multiple logins?

verbal ice
#

It should yes

#

For Steam it would hold the player's steamid

#

Etc etc

thorny ore
#

thank you.

crisp shard
#

are webview plugins (plugins that would open a url on client machine) be secure enough to use in a multiplayer scenario? i suppose it would be the same issue as any other client input but im not sure if that's not a good idea

#

i would use it to launch a url and bascially use it to get back some data from that interaction

thin stratus
proud jewel
#

Hi everyone, I am creating a fast api server for my unreal app. I want to package and distribute it with the game so that it runs simultaneously when we start the game. It's a local server type setup. Is it possible to do it and how?

latent heart
#

It's definitely possible. Remote Control does the web server thing, for instance.

#

Not sure if it's an external one or not.

crisp shard
thin stratus
#

And then use that same plugin's module to start/stop your stuff

#

Fwiw you might even have stuff in the engine for this already. As Daekesh said you might want to check the RemoteControl stuff.

proud jewel
#

@thin stratus I am integrating SLM and using python to do it. I don't want a user to install python and all its dependencies that's why I am using portable python. I am not able to integrate python script in packaged app that's why using it as a server app to communicate with it using the rest api. So is there a way to run python script in unreal engine?

thin stratus
#

Nothing should stop you from writing a plugin that includes the portable python stuff.

torpid girder
#

Hello, I am trying to setup my builds, I created a module for the client binary and another for the game server, the problem is the game server module keeps trying to compile code from the client, i've tried blacklisting, returning early etc, but its being ignored and code from the client is leaking into the server build with errors

0>StormAccountWidget.gen.cpp(7): Error C1083 : Cannot open include file: 'UObject/GeneratedCppIncludes.h': No such file or directory

am i just trying to swim up stream and should just not bother trying?

thin stratus
tardy fossil
#

can also make a target with Type = TargetType.Client; and wrap server only stuff with #if WITH_SERVER_CODE

torpid girder
#

maybe i am over engineering things

finite kernel
#

Im trying to defer some logic for each client until all necessary actors are replicated from server to each client
Im thinking of making some subsystem on the side to register all replicated actors to keep track of until all actors are replicated and the client is ready
Just wondering if there is any more reasonable approach or built in one?

chrome bay
#

extend as per your needs

#

link updated

torpid crest
#

any idea why this only destroys first item in array?

#

I have 4 objects which needs to be destroyed

#

and it always just do it for first one

#

hmm it looks like it destroys pawn before processing them all

#

I will try send to game state

#

completed but still two things in array

#

is it an engine bug?

exotic wasp
#

you're looping through the array of actors from the start

#

so index 0

torpid crest
#

There 4 actors - two are destroyed and then it jumps to completed

#

With 2 left

exotic wasp
#

can you do a reverse for loop?

torpid crest
#

Start from last index?

#

I can try

exotic wasp
#

yeah

torpid crest
#

Basically what i want to do is to remove attached actors when player disconnects

exotic wasp
#

my guess is that the array is resizing or something though I have no idea how arrays work in bp

torpid crest
#

We have floating actors stuck in the scene after logout ๐Ÿคฃ

tranquil current
torpid crest
#

so get -> store as array variable -> process

tranquil current
#

you can try deleting from the back like plinyvic said
or do a for loop (e.g. x = array.size, after that for i = 0; i < x; i++, idk the correct blueprints) and always delete the first one

#

just in case here I made an extra variable because I don't know if it's possible for the array.size value to change during the for loop, that's why I save the original one into a temporary x variable because that way it is sure to remain the same, even if the array shrinks

torpid crest
#

cheers

crystal crag
#

Would it be super difficult to implement a feature where two players have to carry an object on each end in a multi-player setting?

#

I haven't seen anything really implement that and I am sure a good part of that is due to limited audience / use-case, but I'm also trying to think about (high-level) how you would go about doing that.

#

Maybe you would have a replicated flag that, when set, would prevent the player from moving outside of an acceptable radius of the other player, using an AnimBP to make it look like they are both "carrying" the item. I'm not sure I really like that being placed inside of the CMC though. Maybe that would be implemented as a GA / GP-Task?

#

Well, it would have to be implemented in some way inside of the CMC, to limit the inputs.

errant charm
#

do client rpcs not work on actor components?

crystal crag
#

The owning actor has to be replicated, but I don't see why they wouldn't work

errant charm
#

ah ok, wont work on player controller SCcrying

crystal crag
#

Well only the controller owned by the player on the client is replicated, so the same rules should apply for the components attached to it

#

The other player controllers do not exist on the other clients. The all exist on the server and only each player's own controller exists on their client.

chrome bay
#

Client RPC will work fine on a player controller

exotic wasp
#

but i have no idea if BP arrays automatically resize or some jank if a UObject they point to gets destroyed

#

regardless its always better to reverse loop through an array if you're deleting things

#

(or use an iterator)

dark edge
nova wasp
#

Clients locally destroying things after tear off or something isn't that weird if it's mostly for visuals

#

But not sure about this case

bronze glade
#

If a client does not send any info to the server and is only receiving information, does that add any major strain to the server?
I'd like to have a feature in my game where players can join as spectators who see the game live and can fly around locally. They aren't able to do anything that the server would care about. But I'm wondering if having a bunch of spectators could cause any overhead on the server that the actual players could experience?

exotic wasp
#

well they'll receive just as much data as anyone else

fossil spoke
#

Its a bit more nuanced than that.

#

The Server needs to know where the Client is, so that it can apply things like Distanced Based Relevancy for networked Actors.

bronze glade
fossil spoke
#

So the "Spectator" would need to be telling the Server about changes in its position.

bronze glade
#

I didn't think about that! So it will need location for sure. Good to know

#

I am obviously doubting my game would get this popular. But just a hypothetical.
If there was like a "pro" match for a tournament and a thousand people joined to spectate, I'm assuming that would cause major overhead for the server then?

#

Even though it's just location

fossil spoke
#

How many Spectators do you want to support is a question you should ask. If you are planning for a large number, you may want to explore alternative solutions that involve Streaming the state of the Game.

#

The Server might send out the state of a game to an external service. Which Spectators could use to replicate that state by connecting to the Service instead of directly to the Server.

bronze glade
#

That makes sense. What type of service would do something like this? I haven't really heard about a process like this before. Any information is a great starting point ๐Ÿ™‚ I appreciate your input

thin stratus
#

The act of writing the packages does cost performance btw. But that only matters with 50-100 players.

#

Well not "only", but that's when you will start noticing it piling up

verbal ice
#

If spectators only get to spectate players directly (their POV), you could just use the same relevancy as them

#

Would be a lot cheaper

fossil spoke
#

This is a very custom solution type thing.

#

TLDR: You will likely need to do the entire thing yourself.

bronze glade
#

Yeah that makes sense haha. I just don't really understand where that begins, would it be like spinning up another set of servers that allow X spectators and have to get the data from the main game server?

#

Or are you talking about something else entirely

bronze glade
fossil spoke
#

I think you probably need to just stick to what you can reasonably achieve within the limits of your capabilities in engine.

#

This solution would involve stuff outside of UE

#

Which personally, Im not even qualified to comment on how to achieve.

#

Im just speaking conceptually.

bronze glade
#

Okay. I'm not focusing on it for now I just thought it would be an interesting idea and assumed it would be complex. Just wanted to hear some thoughts on this!

#

Thank you for your advice and input I appreciate it

thin stratus
#

I wonder if a relay server would actually gain performance on the main game server.

thin stratus
#

Quantization only happens once for all players, but iirc it still has to serialize the data individually. Now if it would only serialize once and send the data to another server, something non-ue, that then forwards the data to each player, it might improve performance on high player servers. But that's a wild guess and lots of work

fossil spoke
#

I see

#

Possibly

thin stratus
#

It's probably easier at that point to multithread iris

fossil spoke
#

Even then, in his context he is talking more about like a dummy terminal

#

The Client cant do anything

#

So its not like they can negotiate back with the main game server

thin stratus
#

What he is talking about should just be tested in terms of performance first before even thinking about custom solutons

fossil spoke
#

Well thats why I asked how many Spectators

#

If its like 10 slots or something

#

Its not worth leaving UE

#

For that

thin stratus
#

Yeah

bronze glade
#

Yeah this would be for a more custom solution to allow many spectators. More just a hypothetical, for now I will have something simple in the same server with a few spectators

#

I was kinda thinking about a large game like league of legends or csgo or something imagine if people could tune in by joining a spectator mode and watch themselves from whatever perspective they want ๐Ÿ˜„

fossil spoke
#

If this was a popular thing to do, I would have thought it would be something LoL would support.

#

Or those other high profile comp titles

bronze glade
#

Yeah that's what I was imagining lol

fossil spoke
#

But I cant really think of an example of any game that does this

bronze glade
#

Only thing is less money for them in competitions because people aren't watching the streams as often

fossil spoke
#

Its likely not worth the trouble.

#

Outside of massive esports titles, would it really be worth the effort to support.

bronze glade
#

Definitely. I don't really think it's a good idea for most games, it just seems like a cool idea so I wanted to bring up the hypothetical here. Maybe eventually our team will try something out! Thanks again

fossil spoke
#

Your other alternative is Replays.

bronze glade
#

I do like the idea that Cyn mentioned for a more dumbed down version. If they don't get free-cam but only get direct POV they can use relevancy of whoever they spectate

fossil spoke
#

But Replays are generally post match offline

#

So like, the Server records the state of play throughout the course of a match

#

Caches that somewhere

#

Then you as a player can receive that replay

#

For that match

#

And quite literally replay it

bronze glade
#

Makes sense

fossil spoke
#

PUBG has something like this if I remember rightly

bronze glade
#

So do some other games like Marvel Rivals and some other competitive games

fossil spoke
#

I remember using it to validate if someone was cheating when I died lol

#

Its the same principle behind Killcams like you might see in COD

#

The state of play is recorded as it progresses.

#

When you die, the game recreates that state behind the scenes for the Killcam

#

Plays it

#

Then resumes regular play afterwards.

bronze glade
#

If that's the case, couldn't the replay system technically be "near" live and just do the full match with a bit of delay as the server records and sends it off to be stored? A user could read the stored data in real time with a bit of a delay

#

Instead of waiting for the match to fully finish before allowing replays

fossil spoke
#

Probably, but again, you would need to setup some sort of custom streaming service.

#

Not to mention the custom mechanism for receiving that stream AND replaying it as its streamed.

#

So not quite the walk in the park it might sound like on paper.

bronze glade
#

Yeah. This has me brainstorming some things. I think Marvel Rivals does exactly this the more we're discussing it. They are using UE as well

#

I will try to find some info about it. You can spectate your friends or any of the top 100 players games at any point with only a few seconds delay

fossil spoke
#

Good luck finding reliable sources that arent wildly out dated lol

bronze glade
#

Yeah, right ๐Ÿ˜…

#

If I do find anything I'd be happy to share (if you'd like)

fossil spoke
thin stratus
fossil spoke
#

Thats kinda what I meant by "recreates that state behind the scenes".

thin stratus
#

And that thing cheats a lot. It basically locally calls the SerializeActor code and write it into memory or onto the disk. And then acts later like it received the data from the server when replaying

fossil spoke
#

Ive done a Killcam like it before duplicating the world etc.

thin stratus
#

I love that one can actually do a seamless! Client Travel with that

fossil spoke
#

It is pretty cool

thin stratus
#

Just need to stop the net driver from nuking the original world and do it manually once the new one has the connection set up.

fossil spoke
#

Its not surprising how well it works when its kinda what the Editor does with PIE anyway

thin stratus
#

Yeah

nova wasp
#

Is there a consistent override for when a playerstate has their unique name +id and has begun play? It seems local players take a distinct flow from clients. Client's beginplay happens before registering with the session and getting a unique ID but locals are the opposite

I suppose I can just handle each separately but... sheesh

thin stratus
#

I looked into it for hit Validation but it's a bit too pricey for the server for that

fossil spoke
thin stratus
thin stratus
#

But was just an idea. Didn't follow through on it

fossil spoke
#

Yeah fair enough, honestly hadnt considered that as an option

nova wasp
fossil spoke
#

Does seem expensive though

nova wasp
#

I guess FWIW I could just do my own unique ID

thin stratus
#

I did also learn that I can throw collision into the chaos scene that doesn't need a representation visually in the game. So I can push the geo of a rolled back actor and trace against it without needing an actual actor or to modify the original one

#

But that's also expensive crying

fossil spoke
#

What isnt expensive these days ๐Ÿ˜›

nova wasp
#

well... you could get pretty cute with when you do the check

#

there's hardly any physics stuff happening for a large part of the frame

#

it could be tasked out

thin stratus
#

The pushing and updating transform of physics stuff is shitty expensice

fossil spoke
#

Ehhh transform updates

nova wasp
#

you just have to access the particle handle and update the broadphase

fossil spoke
#

The bane of everyones existence I think.

thin stratus
#

Not even actor transform stuff. Just the updating of a body in the physics scene

#

Multiply that by 100 and you lost 1.2ms

#

For a simple fucking box

fossil spoke
#

I just shudder everytime those terms are used together in a sentence

#

lol

nova wasp
#

you can do it in a grouped way

thin stratus
#

I know

#

It's also what I'm going to do

#

I will handle the collision of rolled back actors as one "body" so to speak

#

And push all at once

nova wasp
#

in 5.6 they even allow for parallel broadphase updates (which is just it checking if it needs to even move buckets)

#

so it's not totally parallel but it's somewhat nicer

#

also FWIW chaos threading in the editor uses a different locking primitive

#

than a built game

unkempt tiger
#

How badly will my fast array serialization break if I give my FFastArraySerializer substruct a regular NetSerialize override (non-delta) so that clients can send them to the server as well?

nova wasp
#

just send the inner array

#

no need for complexity

unkempt tiger
#

..yes, that makes sense! Thank you ๐Ÿ˜„

nova wasp
#

that said I'm not sure why the client is able to change the array locally

#

I don't think you want to do that

#

if they must have local only values they should be a distinct container

fossil spoke
#

What do you mean by the substruct? Are you talking about the FFastArraySerializerItem that is contained by the FFastArraySerializer?

unkempt tiger
#

It's not to change it locally, it's more like send the server a wish and receive an auth-validated reply

fossil spoke
#

The FFastArraySerializerItem can have its own NetSerialize override

unkempt tiger
nova wasp
#

The fast array is already replicated from the server

fossil spoke
#

I think he wants to send it via an RPC from the Client

unkempt tiger
#

Yes, exactly

nova wasp
#

I'm going to need a specific example of what this actually is supposed to do and not "wish"

#

so the client has some elements it sends and the reply includes some elements?

fossil spoke
#

I honestly havent had a usecase that ive needed that, so I cant really answer what it will do.

#

Why not just try it and see what happens

#

It would probably just use default serialization in that case

#

But thats just a guess

unkempt tiger
#

Basically add a bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess); to FLoadoutRequestsItems (which derives from FFastArraySerializer ) and send a FLoadoutRequestsItems instance to the server from an RPC, as @fossil spoke said

nova wasp
#

but why would you need to send something to the server it replcated to you already?

#

I guess if it's a new one just send the array

fossil spoke
#

Its probably in a completely separate system

nova wasp
#

fast arrays don't care about rpcs afaik

fossil spoke
#

To where he is using it as a fast array

#

From the Server

#

@unkempt tiger Just try it, see what happens, I would be curious to know. Ive never needed that.

#

Why do you need to send the fast array type? As Mega pointed out earlier, why cant you just send a regular array of the inner type?

unkempt tiger
#

The idea is to indeed have a client go 'hey server, give me this weapon, and this outfit, and 3 mags of this 9mm ammo' and have the server go 'okay buddy but im not giving you this outfit becuase you don't own it' and have it send back the validated list of requested items via fast array serialization

nova wasp
#

well

#

if it's an rpc it's not going to delta anything

#

in order to take advantage of fast array serialization it would need to be a replicated property

fossil spoke
fossil spoke
#

I think he just wanted to be efficient in terms of type reuse

#

At least thats what im assuming

nova wasp
#

fair enough

unkempt tiger
nova wasp
#

You could honestly use a fast array replicated property to represent the most recent request IMO and just onrep a request ID in the struct to make sure it's the same one

might need to be atomic though

unkempt tiger
fossil spoke
#

Personally I would just send the array of the inner type, and make sure that there was a separate system that manages interpreting that, for which the fast array could also utilize.

#

Instead of baking it all into the fast array.

nova wasp
#

a fast array as a separate thing is fine, it's how things tend to end up

fossil spoke
#

Separation of responsibilities

nova wasp
#

the code for reacting to a new item can be just called by both

fossil spoke
#

The fast array is just responsible for being efficient at data transfer

#

It shouldnt be THE loadout system as well

unkempt tiger
#

Yes, agreed

#

Thanks for your very valid inputs ๐Ÿ‘

thin stratus
#

I would send an array with just the Id that identifies the item. Maybe a custom struct with Id and count. That would probably largely be different to what I would even have in the FastArray

#

I usually create items as DataAssets that are identified by Tags. And the FastArrayItem is usually a combination of that and maybe some object that holds runtime state of the item.

#

So if I would want to request an item I would just send the Tag/PrimaryAssetId

#

@unkempt tiger idk if that makes sense to you

unkempt tiger
#

I think it does

#

In my case thankfully my items have no state to manage

#

so it's more like a grocery list of things to get when spawning in

#

So I think this is why I wanted clients to send a list of wanted items rather than each item individually, but my mental model of my needs is admittedly starting to liquify ๐Ÿซ 

#

Also I read your earlier conversation about the expenses of updating the physics scene, which I found relatable :(

static lava
#

hey

#

CMC causes corrections when a mesh is rotated along X axis, it works fine with Z axis, the mode used is simple walk mode, ping is 120

#

first thought it was cause of my custom movement mode but it works perfectly with Z rotation

#

so I tested it with simply jumping on said mesh and: correction

#

what can cause it? does the based movement not handle pitch and roll based rotations? as this doesn't happen with yaw

unkempt tiger
#

I think I have an idea, perhaps it has to do with how the objects are synchronized between server and client

static lava
static lava
unkempt tiger
#

Oh still a sphere in the z axis case, nvm

static lava
#

I'm using a server authoritive rotation with client getting the replicated movement

#

issue is when I change the rotation axis it dies even in the engine provided walk mode

left marsh
#

I have a component that ticks and checks against certain input actions to get a reaction. I'm testing as a Client now, and the tick is happening but there's no Input Component present. Would the component only be ticking on the server?

static lava
#

if (GetOwner()->GetLocalRole() == ROLE_AutonomousProxy)
{
GEngine->AddOnScreenDebugMessage(51312, 5.f, FColor::Green, FString::Printf(TEXT("ServerTicks: %s"), bGreenHit ? TEXT("true") : TEXT("false")));
}
else if (GetOwner()->GetLocalRole() == ROLE_Authority)
{
GEngine->AddOnScreenDebugMessage(325, 5.f, FColor::Green, FString::Printf(TEXT("ClientTicks: %s"), bGreenHit ? TEXT("true") : TEXT("false")));
}

#

there is also a simmulatedproxy if you want third parties' oppinion

#

add this to the tick function and you will see on screen whats up

left marsh
#

Okay.

#

it says ClientTicks. So it's ticking on client. Why would it not be able to find an input component, then? I am able to walk around via keyboard controls just fine.

#

Why does a character on client not have an input component?

thin stratus
left marsh
#

Oh! The thing Loki gave me is backward. ๐Ÿ˜ 

thin stratus
#

Yeah was just about to write that.

static lava
#

yeah, had to rewrite the message it sends

#

didn't pay much attention, sry

#

although authority and proxy are pretty self explainatory

thin stratus
#

Yeah still not helpful if it prints the opposite :D

static lava
#

are you replicating the actor that you tick?

left marsh
#

Okay, so this component is only ticking on the server. Why would it not be ticking on client?

static lava
#

like is it set replicated?

thin stratus
static lava
#

or is it the CMC?

#

Character movement component is technically not replicated

left marsh
#

Not the CMC.

thin stratus
#

No I mean the Component.

left marsh
#

The player character I'm using has this component in its BP.

#

The component is the Combo Component.

thin stratus
#

Hm.

left marsh
#

(Custom).

thin stratus
#

Does BeginPlay call for it on the Client?

left marsh
#

Let me check.

#

What's the fastest way to check a component's owner's Role through visual studio Locals browser?

static lava
#

GetOwner()->GetLocalRole()

left marsh
#

Looks like yets, it is called in both client and server.

static lava
#

what calls your tick function?

#

is it component's tick or something you yourself call?

#

is there an 'IF' anywhere?

#

deviance in variables on server and local can cause it

left marsh
#

Aaah, found my problem. I was filtering some data setup out of the client because it involved granting GAS abilities, but I still need to set up the links localy. Let me fix it.

#

Hmm. Crud. I need to be able to get the spec handle after the ability is granted.

ebon pollen
#

Hi. I have encountered an error when starting PIE in client mode.

LogRep: Error: ReceivedBunch: Invalid replicated field 0 in InventoryComponent 
/Game/ProtocolTerminate/Maps/DevOnly/UEDPIE_1_MechanicsMap.MechanicsMap:PersistentLevel.BP_Human_C_0.Inventory
LogNet: Error: UActorChannel::ProcessBunch: Replicator.ReceivedBunch failed.  Closing connection. RepObj: InventoryComponent /Game/ProtocolTerminate/Maps/DevOnly/UEDPIE_1_MechanicsMap.MechanicsMap:PersistentLevel.BP_Human_C_0.Inventory, Channel: 98
LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_10, Driver: Name:GameNetDriver Def:GameNetDriver IpNetDriver_17, IsServer: NO, PC: Plc_new_C_0, Owner: Plc_new_C_0, UniqueId: NULL:DESKTOP-GS7TPRB-CCF24D2F4DF265A5457B18B7251F9311, Channels: 102, Time: 2025.07.11-06.57.15
LogNet: UNetConnection::SendCloseReason:
LogNet:  - Result=ObjectReplicatorReceivedBunchFail, ErrorContext="ObjectReplicatorReceivedBunchFail"
LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 127.0.0.1:17777, Name: IpConnection_10, Driver: Name:GameNetDriver Def:GameNetDriver IpNetDriver_17, IsServer: NO, PC: Plc_new_C_0, Owner: Plc_new_C_0, UniqueId: NULL:DESKTOP-GS7TPRB-CCF24D2F4DF265A5457B18B7251F9311
LogNet: Error: UEngine::BroadcastNetworkFailure: FailureType = ConnectionLost, ErrorString = Your connection to the host has been lost., Driver = Name:GameNetDriver Def:GameNetDriver IpNetDriver_17
LogNet: Warning: Network Failure: GameNetDriver[ConnectionLost]: Your connection to the host has been lost.
LogNet: NetworkFailure: ConnectionLost, Error: 'Your connection to the host has been lost.'
LogBlueprintUserMessages: [ProtocolTerminateGameInstance_C_12] Client 1: Network error: Connection Lost
LogOnlineSession: Warning: OSS: Can't destroy a null online session (GameSession)
ebon pollen
# ebon pollen Hi. I have encountered an error when starting PIE in client mode. ``` LogRep: Er...

This is caused by inventory component.

UInventoryComponent::UInventoryComponent()
{
    PrimaryComponentTick.bCanEverTick = false;
    SetIsReplicatedByDefault(true);
#if ENGINE_MAJOR_VERSION == 5 && ENGINE_MINOR_VERSION >= 1
    bReplicateUsingRegisteredSubObjectList = true;
#endif
}

void UInventoryComponent::BeginPlay()
{
    Super::BeginPlay();
    InitializeInventorySlots();
}
void UInventoryComponent::InitializeInventorySlots()
{
    if (InventorySlots.Num() == 0)
    {
        InventorySlots.SetNum(MaxSlots);
    }
}
#

struct:

USTRUCT(BlueprintType)
struct INVENTORYSYSTEMRUNTIME_API FInventorySlot
{
    GENERATED_BODY()

    UPROPERTY(BlueprintReadOnly)
    FGameplayTag ItemKey;

    UPROPERTY(BlueprintReadOnly)
    TArray<FInstancedStruct> Properties;

    UPROPERTY(BlueprintReadOnly)
    int32 Quantity;

    UPROPERTY(BlueprintReadOnly)
    FInstancedStruct SlotMetadata;

    FInventorySlot()
        : ItemKey(FGameplayTag::EmptyTag)
        , Quantity(0)
    {
    }

    explicit FInventorySlot(FGameplayTag InItemKey, int32 InQuantity = 1)
        : ItemKey(InItemKey)
        , Quantity(InQuantity)
    {
    }

    bool operator==(const FInventorySlot& Other) const
    {
        return ItemKey == Other.ItemKey && 
               Properties == Other.Properties && 
               Quantity == Other.Quantity && 
               SlotMetadata == Other.SlotMetadata;
    }

    FORCEINLINE bool IsEmpty() const
    {
        return Quantity <= 0 || !ItemKey.IsValid();
    }

    bool NetSerialize(FArchive& Ar, class UPackageMap* Map, bool& bOutSuccess)
    {
        Ar << ItemKey;
        
        int32 PropertiesNum = Properties.Num();
        Ar << PropertiesNum;
        
        if (Ar.IsLoading())
        {
            Properties.SetNum(PropertiesNum);
        }
        
        for (int32 i = 0; i < PropertiesNum; ++i)
        {
            Properties[i].Serialize(Ar);
        }
        
        Ar << Quantity;
        
        SlotMetadata.Serialize(Ar);
        
        bOutSuccess = true;
        return true;
    }
};

template<>
struct TStructOpsTypeTraits<FInventorySlot> : public TStructOpsTypeTraitsBase2<FInventorySlot>
{
    enum
    {
        WithNetSerializer = true,
    };
};
#

It is important to note that after such an error, the client gets kicked to the main menu, but you can create and join a session. And everything works without errors after that.
Maybe I've missed something in struct serialization?

left marsh
#

Okay, for the multiplayer team: I have a component on client and I need to get some particular information from the server. This info is set up on beginplay and then edited infrequently. Should I replicate it? Or is there a more one-off way to set the data?

dark parcel
#

What data? If just variable cant you use RepCondition to initial only or something like that.

ebon pollen
left marsh
#

Change of plan: I actually can get the data directly from the AbilitySystemComponent, which is already replicated. However, I need to be notified when the data is available to the client so my component can access it.
The data is a list of FAbilitySpecHandle structs.

dark parcel
#

A combo of boolean and delegate i would suggest.

#

Gotta handle the race condition.

left marsh
#

Can you elaborate?

verbal ice
#

I don't exactly get what you're trying to do here though

ebon pollen
# verbal ice I don't exactly get what you're trying to do here though

I was thinking of setting the size of the array in advance so that there would be information in advance about which slots could store what.
The number and types of slots are limited.
for example, slots 0-3 for weapons, slots 4-5 for consumables, etc.
It is managed using the FInstancedStruct SlotMetadata

left marsh
#

I'll elaborate my problem.
I have a component called Combo Component. Combo Component has some pre-done configuration about what abilities should be activated by the player's ASC and in what condition. Previously I was working in standalone, granting the ability from the Combo Component and storing the FAbilitySpecHandles. Now that I'm in multiplayer, I can't grant the abilities from the client, so the client cannot get the FAbilitySpecHandles. However, those handles are stored in the Ability System Component, which is replicated. How can my client component notice when the handles are replicated and access them?

dark parcel
#

Replicating handle?

Maybe you mean replicate the abilities?

left marsh
#

I guess the simplest thing would just be to replicate the combo component, so the derived data is identical on client and server.

dark parcel
#

Imo only server shluld grand abilities

left marsh
#

Yes, only the serer is granting abilities. But I need the Spec Handles for those granted abilities so the client component can request one be activated (client reads input data and decides which spec handle to activate).

ebon pollen
dark parcel
#

Isnt the spec handle created from the abilities?

#

You dont replicate the handle, you grant the ability which has the spec handle?

Been forever since I touch Gas. Gonna keep quiet now instead giving wrong info.

left marsh
#

Yes. The component runs on both client and server. On the server it grants the abilities and stores the handles. I need to get those handles to the client component.

#

I can either replicate them on my combo component itself, or access them from the Ability System Component.

ebon pollen
left marsh
#

When an ability is granted in GAS, you get back a spec handle: an ID that identifies which ability instance you want to use. This is how abilities are activated and passed around through networking.

dark parcel
#

Reading above if its true OnGiveAbility called on OnRep then that's the client on the receiving end. Since OnRep gets called on client.

ebon pollen
ebon pollen
dark parcel
#

Can pass the handle to your combo component from there if that's the aim.

left marsh
ebon pollen
#

So your child ASC knows about Combo component, but combo component does not know about ASC

left marsh
#

Aha! Better idea. MarkAbilitySpecDirty!

#

I can bind to ASC->AbilitySpecDirtiedCallbacks

ebon pollen
#

AbilitySpecDirtiedCallbacks

#

well, it can work

left marsh
#

It specifically gets fired whenever an ability is added or removed.

ebon pollen
#

because it's also gets triggered OnRep

ebon pollen
verbal ice
#

Not Serialize

#

For all of those

#

Should fix it

ebon pollen
verbal ice
#

Happens

blazing spruce
#

Hi, I'm trying to move my interaction functionality out into an actor component, I'm using virtually the same functionality as I was before however it wont work properly for the client anymore when using the actor component for interaction.. so on the event tick ive disconnected everything after the 'Choose Interactable Actor' function is called but that's essentially how I was doing it when the functionality was on the pawn class directly which worked.. now however, for the client the IsLocallyControlled check goes false so it wont display any widgets, i then tried putting the widget functionality into an OnRep instead but same thing happens the IsLocallyControlled check goes false for the client

Any ideas how i can get this working properly? Is there any reason that the functionality worked fine when directly on the pawn but doesn't when inside an actor component?

pseudo crest
#

I'm working on the https://www.fab.com/listings/6a167276-1a5c-43fe-9be7-02fe900eb371

It works fine IF the mesh is a UE4 skeleton mesh, BUT if I use a UE5 or Metahuman Mesh the GetActorLocation on clients stop returning the current location, it keeps stuck on the last location before ragdolling.

GOD HAVE MERCY

Fab.com

Quick:Demonstration video and tutorial playlist: Youtube Link!Dedicated server demonstration: Youtube Link!Custom project issue fix: Youtube Link!Playable Demo with host widget: Download Link! (use [1] key to hide-unhide host/mp widget)(UPD - 2022)I am happy to announce all my Unreal Engine content is free now!I hope to support more content crea...

#

How does the GetActorLocation() always works with one skeleton but not in others?

errant charm
#

Hello, why am I getting this error? Function 'OnRep_CurrentInteractable' called from On Rep Current Interactable should not be called from a Blueprint

#

can it not be set by other actors?

#

oh, it just fixed itself

left marsh
#

Can TMaps be replicated? What about regular Arrays of Uobjects?

quasi tide
#
  1. No.
  2. Should be able to.
left marsh
#

Thanks. I will have to send my data as a array and and convert it to a tmap on client.

latent heart
#

As long as the uobjects are themselves replicated.

exotic wasp
#

^ they will have to be a subobject most likely

blazing spruce
karmic venture
left marsh
karmic venture
#

should be able, it replicates array, it doesnt care about whats inside

#

these are just values

karmic venture
#

I have interaction component and it worked just fine so its either component not replicating or sth else

#

also does server set variables? it doesn't have any switch auth node

latent nest
#

Is there a way to curve a projectile, side to side?

exotic wasp
left marsh
# exotic wasp they need to be a replicated subobject of some actor or component

My current setup is:
1: I spawn a player character on both server and client.
2: Player character has a Combo Component on it with pre-configured data.
3: Both Client and Server components run a Setup step, building a combo web that connects the pre-configured data and stores it as UObjects locally.
4: However, only the server can grant Abilities to the character, which returns a number of AbilitySpecHandle structs that the component needs.
5: I need to get those structs to the client, preferably with the context of the combo web.

reef bison
#

if you really need the handle you can listen for the ASC callbacks

left marsh
#

Yeah, I'm considering using the AbilitySpecDirty tag to get them and I'll have to figure out which part of the combo web created that spec.

reef bison
#

a gameplay tag that you can assign to the ability

#

you can activate the ability by using it instead of having a reference to the ability or the ability spec

formal solar
karmic bramble
#

if i have a component im creating dynamically on an actor and i only create it on the server and set it to replicate, is the pointer i store it in on the client side ever going to get the version i created on the server or do i need to set the pointer to replicate so that it actually gets the component?

#

it seems like the component never reaches my client currently and i seem to have it setup to replicate properly, so im assuming its just that the pointer never actually recieves a reference unless i predict the creation of the component

#

alright i was able to use GetComponentByClass on the client and find it so i just need to think about how to predictively create it on the client properly instead of trying to replicate the pointer cause that seems illadvised

dark parcel
left marsh
#

Client is the only thing that can read inputs. I want combo component to check inputs and pick an appropriate ability then request that from server

dark parcel
#

Yeah my AC reacts to player input, it's all handled locally on each player.

But wdym by checking inputs then requesting it from server?

My approach is to just dump a combo data for the player and let them deal with it locally.
E.g for a sword man, they get this combo, for another job they get another combo.

#

I think if I have to wait for the server when I press input then you will introduce input delay, no way around it.

#

and I think attack should be predicted at least outside 1v1 games like Tekken.

dark parcel
#

like it should exist, regardless on how you get the component.

#

Can you show your setup?
Make sure the component is set to bComponentReplicate and the pointer to the component should also set to replicate.

#

no issue on my end.

#

@karmic bramble Oh yeah, you need to set the ptr to replicate, otherwise server will never send the info.

karmic bramble
#

yeah

#

im just gonna rpc it or predict it

dark parcel
#

Why do you need to predict it if I may ask?

#

you should only predict things you can get away with.

#

if this is for important gameplay and not visual, consider your option imo.

dark parcel
#

your ptr will only be valid for the player that gets the rpc, the late joiners or some unfortunate soul that doesn't execute the RPC may / will have different value.

karmic bramble
#

was out walking dog, yeah i realized that. Im trying to think if theres a better way to rethink my component generally.
it basically is a component that holds instanced pawn data, Not unlike pawndata in lyra but take the pawn data there, and then instance it based on various random rolls and other per instance things
its dynamically created because theres a player and ai version of it. (it cant be attached to the controllers because you can have multiple of these character and swap between them)
i can probably figure out a way to sanely unify them and stop worrying about needing to replicate their creation so that the constructor handles that for me by making them default sub objects instead.
mainly trying to avoid needing a player version of the pawn and enemy version of the pawn so that the definition can be universal

#

worst case i replicate the ptr

dark parcel
#

May want to consider attaching to PlayerState. That's where a lot of folks dump their AbilitySystemComponent when we don't want to tie it to one specific character.

karmic bramble
#

each one needs its own asc unfortunately though

#

I mean i guess i could like save out the stats everyime you swap characters mid combat

#

but it seems more logical that they each own all their own information

dark parcel
#

Can't give much opinion but if I prefer to have the data lies somewhere persistent and read from it so I don't need the hassle of saving the data.

As for PlayerState, there is one for A.I too but I never touched it. So I guess this way you can create one per A.I and player character?

Can't elaborate though, hopefully the smart people wake up later.

karmic bramble
dark parcel
#

ActorComponent already replicate out of the box.

#

but when it comes to UObject, yeah there is extra steps need to be done.

karmic bramble
#

Defaulted ones will, Dynamically created ones seem to not

dark parcel
#

oh wait, I tried recreating it and getting null.

#

trying again.

karmic bramble
#

yeah it seems to come across eventually

#
//.h

    UPROPERTY(VisibleInstanceOnly, Replicated, Category = "Monster")
    TObjectPtr<UMGMonsterComponent> MonsterComponent;


//.cpp
void AMGMonsterCharacter::GetLifetimeReplicatedProps(TArray<class FLifetimeProperty>& OutLifetimeProps) const
{
    Super::GetLifetimeReplicatedProps(OutLifetimeProps);
    DOREPLIFETIME(ThisClass, MonsterComponent)
}

void AMGMonsterCharacter::SetMonsterInstance(UMGMonsterInstanceData* MonsterInstance)
{
    if (MonsterComponent)
    {
        //RemoveReplicatedSubObject(MonsterComponent);
        MonsterComponent = nullptr;
    }
    if (UMGPlayerMonsterInstanceData* PlayerMonsterInstance = Cast<UMGPlayerMonsterInstanceData>(MonsterInstance))
    {
        MonsterComponent = NewObject<UMGPlayerMonsterComponent>(this, TEXT("Monster Component"));
        GetMGAbilitySystemComponent()->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);
    }
    if (UMGAIMonsterInstanceData* EnemyMonsterInstance = Cast<UMGAIMonsterInstanceData>(MonsterInstance))
    {
        MonsterComponent = NewObject<UMGAIMonsterComponent>(this, TEXT("Monster Component"));
        GetCharacterMovement()->bOrientRotationToMovement = true;
    }
    ensureAlways(MonsterComponent);

    
    MonsterComponent->SetIsReplicated(true);
    MonsterComponent->RegisterComponent();
    MonsterComponent->Initialize(MonsterInstance);
    //AddReplicatedSubObject(MonsterComponent);
}
#

feels weird to have to replicate the object ptr but works otherwise

dark parcel
#

property has to be marked as replicated if you want it to replicate (server -> client)

#

Hmm I can't seems to replicate dynamic ac anymore, I thought I did earlier.

karmic bramble
#

im aware, its just that something magically happens for defaulted subobjects. Im assuming its because the client has no idea what the object to replicate the info is without replicating the ptr, which tells it to at least create it.
where as for defaulted it knows it has the object so the ptr cache can route it properly, the component is getting replicated out regardless though its just the ptr that doesnt ever get a reference for free

#

ty for all the help though i do apreciate it

dark parcel
#

How can I set a member variable of a replicated actor and ensure that the client spawn the actor with the replicated variable?

For context, I am trying to use ProjectileMovementComponent on a replicated actor. The server spawn using defered spawn sets the velocity then FinishSpawning.

However the client velocity remain 0. I am aware it's not a replicated variable, so what are my option here?

#
       
        _fragment->ProjectileMovementComponent->bShouldBounce = true;
        _fragment->ProjectileMovementComponent->Bounciness = 0.2f;
        _fragment->ProjectileMovementComponent->Velocity = _randVelocity;
        
        FTransform transform;
        transform.SetLocation(GetActorLocation());
        transform.SetScale3D(FVector(1.f,1.f,1.f));
        _fragment->FinishSpawning(transform);

Velocity is 0 on client =(.

#

hmm maybe I just need replicated variable and propagate it to the PMC
^ does the trick.

latent nest
#

Does epic online serves for ue5 have cross play between Xbox and pc?

verbal ice
#

As long as you have the console SDKs I don't see why not

#

@latent nest

cosmic trench
#

im currently working on this multiplayer prop hunt game and im somewhat new to how multiplayer works. my game works fine without any errors but the issue that im facing is that the score system is messed up. the hunter who kills the prop within the timer gets +100 score and if the prop survives during the whole timer then the prop gets +100 score and i have used a game instance to save the score at the end of each round before doing server travel (which resets the level to start the next round- and yes i need to work on a round system after this). can someone help me please?

dark parcel
#

@cosmic trench keeping a tab of a variable is the most basic form of multiplayer. Have you read through pinned material in this channel? If not then you should.

#

As for your score, server can hold the data and replicate to client

#

You can do this with combination of game instance and GameState

#

Game state keep the score variable, make sure its set to replicate.

#

Server set the score and replicate it to client.

Before you commit to server travel, as a server you can store the score in the G.I.

Then on the next map, again as the server you can set the game state score from the GI and that's it.

cosmic trench
dark parcel
#

The pinned material is your bible.

#

Player state is fine if the score is tied to a specific player.

#

You can do what said above but use the player state instead of game state. Both of them r replicated anyway.

#

Player score = player state

#

Team A score = game state

karmic venture
cosmic trench
#

I have just one level and the players keep spawning in the same map after each round, i dont have multiple levels

karmic venture
#

but you server travel and open new map (restart it)

cosmic trench
karmic venture
#

you can simply use restart game node in game mode

cosmic trench
#

which is why i have a game instance to store the scores at the end of every round

karmic venture
#

but you can use copy properties function inside Player state to transfer score

cosmic trench
#

i have already come a long way into this logic but it has proven to be an absolute mess to deal with, i have been working on this for a week now and i can't seem to be able to wrap my head around it. how would you guys recommend me to implement this system if i am to start from scratch?

karmic venture
#

INSIDE GAME MODE

#

sorry, capslock

#

to restart map

#

if its always the same map

#

in your case set score value

#

inside player state

#

should do the job

#

it will transfer player score to new round

cosmic trench
#

well it does work and the level gets restarted but maybe because of my previous logic the score doesnt go to the expected player. the hunter who killed the prop is the only one who should get the score but all hunters are getting it

#

my game is set in such a way that a random player is selected as the prop and the hunters have to find and hunt the prop within the timer

#

im still not sure if its the copy properties function doing its job or my previous logic is affecting how the saving works

karmic venture
#

copy do the job, you need to probably fix/adjust your score setup logic to work properly

cosmic trench
#

i should probably start the score logic from scratch

#

chatgpt and youtube didnt really help me set up a proper logic for this

karmic venture
#

it shouldn't be more complex then game state setting propert score inside target player state

cosmic trench
#

i was sure it shouldn't really be that complex but i tried a lot of things and it just complicated my entire setup

karmic venture
glacial zealot
#

Hey guys, quick question, the documentation for structs say: ```
UStructs ARE NOT considered for replication. However, UProperty variables ARE considered for replication.

#

I was just wondering what that actually means? If I have some FExampleStruct and do, say: ```cpp
UPROPERTY(EditAnywhere, BlueprintReadWrite, Replicated)
FExampleStruct Example;

#

Or does it just mean that adding Replicated to properties inside of the struct itself won't work?

cosmic trench
#

i'll work on my issues tomorrow, i feel like i've tried everything today and feeling burnt out

#

frustrated that i still haven't found the solution yet

modest crater
glacial zealot
tired spoke
#

what do you guys think about "cheats" in UE multiplayer games?
i had some experience in doing those and i could say that once you make it once for one game the rest of games are preety much copy paste everything and change basic offsets and you are good to go

so here is my idea
what if:

  • main offsets change each update of the game (and updates occur each week automatically - aka game is being compiled with engine once a week on the server and files are being served automatically to the game servers and clients updater)
  • structures such as UObject AActor Field Struct etc whetever is the basic classes of unreal and also some of user defined classes that require to be "mangled" - Will be fully randomized added bunch of random garbage in between variables so when you try to check it in memory reading softwares you can just see random garbage and you will not know which is where
  • just doing that will make most if not all cheat makers/developers give up after few weeks

additionally you can add a detections for macros/mouse virtualized movement etc. but thats just additional...

glacial zealot
#

Tricks like these are usually pretty easy to negate or automate against

marsh flame
#

As a developer EAC is okay, but as a player or user it's awful. Its kernal level access is deeply concerning.

#

I wish there was more options for devs to use for Anti-cheat measures but that weren't kernal level.

tired spoke
tired spoke
#

the only games eac works is fortnite and pubg as pubg has 3 more anticheats ontop of it...

#

and not sure what rust has but its AC implementation is also good

glacial zealot
tired spoke
#

external or internal

glacial zealot
#

Yes, I'm familiar with how cheats are made

#

And with how anti-cheats are made

#

So I can tell you with high confidence your approach won't work

#

At least not long-term

tired spoke
#

WRONG

#

i dont mean how they read memory etc.

#

noone cares about that

#

what my method does its making all cehat devs fully reverse the game engine to make sdk

#

so then they can make cheat

glacial zealot
#

There's a million ways to write cheats other than auto-generated SDKs, it just happens to be the easiest way with Unreal Engine because of the reflection system

tired spoke
#

imagine that each update even smallest one you need to reverse game engine again and again

glacial zealot
#

Finding the structure of the basic UE5 classes to fix up some SDK generator is a ten minute process at most for starters

#

Second of all, even if you do that, they can still do their things /without/ auto generated SDKs

#

Offsets of things you don't change, pattern matching, etc

marsh flame
tired spoke
#

making all ingame offsets (as you change core class field structure) will make it so everything will shift in different places its preety much too tidious to make cheat for that

marsh flame
#

I thiink they recently switched to something else tho.

#

I know that Halo MCC on PC uses EAC

glacial zealot
#

Not at all, since, again, the process you're talking about is just an easy way to generate SDKs for UE games

#

War Thunder still does use EAC afaik