#multiplayer

1 messages ยท Page 516 of 1

keen thorn
#

will do ๐Ÿ˜„

#

thanks alot again man

#

appreciated

rich ridge
#

No problem

keen thorn
#

back to coding ๐Ÿ˜„

jovial cipher
#

is there a way to prevent an event inside a multicast event from replicating?

#

I know it sounds weird

random verge
#

@rich ridge how do you feel about PlayFab? Any feedback?

rich ridge
#

Playfab now owned by Microsoft. I have also evaluated this platform

#

It also has same problems of over pricing

#

It's free tier allows you only 20 hours a month I guess

#

To host a dedicated server

random verge
#

oh wow, I didn't catch that part

#

that wouldn't even cover testing

#

or maybe just barely lol

rich ridge
#

I tried out playfab to host the intentory and player authentication but it sucks

#

I can't even upload my nested JSON

#

Gamespark really has good features and Damm cheap but they are not updating their SDK for unreal engine

#

I will wait till GDC 2020 for epic games services

#

If they don't release I would have to do it myself

#

I believe Amazon is going to merge Gamespark into gamelift, and probably expand gamelift thereon

random verge
#

thats disappointing to hear about playfab. I'm glad you're able to give feedback.

rich ridge
#

No problem

random verge
#

actually on the dedicated server note, I noticed you can now load a dedicated server from the launcher (it's been awhile for me lol). Is it no longer required to do a source build of the engine to use a dedicated server for distro?

#

unless customizing the engine of course

rich ridge
#

Ok so can you host that on cloud. Do you want to upload the whole engine for that.

random verge
#

not if I can avoid it lol

rich ridge
#

That's a feature to test locally

random verge
#

ak k. so its basically best for developing on the release branch locally and then switch to an engine source build for distro?

rich ridge
#

Yes

random verge
#

k thank you. wasn't sure if they let us package headless now or not from the editor

rich ridge
#

Because Everytime you do small change and to test it out you don't want to build dedicated server and run it again

random verge
#

they've made some pretty awesome changes since I last touched things. Going to dig into the prediction modules to see whats up.

rich ridge
#

Network prediction is still in beta and no official docs yet

random verge
#

yeah its gonna be fun digging through that lol

rich ridge
#

It's probably to use with GameplayAbility System

random verge
#

I heard it was originally for that exclusively but they adapted it to be more abstract as well

rich ridge
#

In 4.25 epic will say anything on this. So in the meanwhile I m doing other stuffs , because I don't wanna change code to integrate network prediction

keen thorn
#

@indigo viper I just remembered ur question regarding multicast, you can control which player to send data to by calling multicast on the right controller on server. i.e call only for players 1,2,3 and not 4,5,6. Because 1 controllers exist uniquely only for each client this ensures the data wont get sent to other players.

#

@jovial cipher very hard to answer, you gotta clarify here

indigo viper
#

@keen thorn Sooo I have to call something like this on the server (sorry for the syntax) : GetPlayerController(id)->MyMulticastFunction() ?

unique kelp
#

Why would you have a multicast on a controller?

indigo viper
#

@unique kelp I would find it weird to do it this way... The thing is, I'm working on a competitive multiplayer game with two teams. But some data will only be sent to the team 1, and to the team 2, and I don't want the teams to receive data that do not concern them

#

That's why I would like to "filter" the multicast

chrome bay
#

You can't filter multicasts

#

Unless of course, the actor isn't relevant

#

The only alternative in this case is a client function where you iterate over the players manually and determine who to call it on

#

But yeah JB makes a good point that a multicast on a controller doesn't make sense anyway, controllers don't exist on other clients - you only have your own.

indigo viper
#

I was thinking about doing it like this, but I don't quite understand how to pass the player I want as parameter

chrome bay
#

If you need to pass information about one player to another it has to be done by referencing the player state object.

indigo viper
#

I mean, to call a rpc client you have to write it this way for example [Client, Reliable] void MyRPCClientMethod()

#

Hmm okay but then all clients would receive the data anyway, if we only filter the data at reception (sorry, I'm quite new with networking ^^')

chrome bay
#

Basically calling or having a Multicast function in the Player Controller wouldn't make sense, because Clients only know about their own Player Controller so you can only have Server/Client functions in there. I mean, you can have a Multicast, but it will throw an error when trying to call it on clients which aren't that player because the controller doesn't exist there.

#

I don't know what the end goal is here but anything state-related (i.e, not a one-time event) must be done via replicated variables not RPC's anyway

#

What is it you're trying to do exactly?

indigo viper
#

I will try to do it simple ^^ Well in the game there are two teams, one red and one blue. There are three players in each team, 2 rushers and 1 blocker. Each member can spawn mobs of the color of his team. But the thing is, the rushers should not be able to see or hear the rushers of the other team. They can see the blocker of the other team but not the one in their team, and all mobs.

#

There will be probably be a chat too, and the players of the red team should not be able to see the messages of the blue team for example

chrome bay
#

So what's the use for the multicasts in this case?

#

AFAIK you can just spawn the actors you need and mark them as not relevant to whoever isn't supposed to know about them

indigo viper
#

i'm saying multicast because I don't really know how to explain it otherwise ^^

#

I just have to find a way to prevent the data to be sent to everyone

chrome bay
#

If you have an actor that somebody doesn't need to know about, you can mark it as not relevant to certain players

#

In C++ that is

#

Blueprint doesn't give you that control IIRC

#

If it's not relevant, it's not sending any data to that connection, and it doesn't exist as far as that client is concerned

indigo viper
#

Okay, I didn't know about that !

chrome bay
#

Yep, you can override virtual bool IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const in C++

indigo viper
#

Oh I think that's exactly what I am looking for !

#

Thanks you so much xD I will give a try and tell you if this works

unique kelp
#

be aware that if you change the conditions you are evaluating in that function on the fly, it usually takes a few seconds to realize net relevancy has changed

#

not sure it will be a problem for you, if teams and positions are already decided

chrome bay
#

Yeah. Typically it's something that should be relatively static i.e. not changing too often

#

The alternative is to use something like replication graph where you create a "Team" node of some kind

#

But that's a tad more advanced

karmic briar
#

In replication graph how u register let's say tree as dormant actor and things as ai as the other 2(I forgot what it's called)

chrome bay
#

Well a tree probably shouldn't be even considered for replication anyway

#

But IIRC you just call SetNetDormancy on the tree and rep graph will update accordingly. Not sure if rep graph properly handles dormancy yet, might have updated it since though.

#

Actually it must do since Epic are using it on FN

karmic briar
#

hmmm do u have any exmaple you use in your netgraph

chrome bay
#

not anything I can show

#

ShooterGame has a basic example

empty axle
#

Hello, it's a question regarding AdvancedSessions plugin. Can you "ask" the server which was found by FindSession, for any "dynamic" informations? Like, hey server can you give me total money that all players have now and then on the server side respond in c++ code by calculating it and sending it back? This is just a high level example.

karmic briar
#

ahh okay i'll check that out

chrome bay
#

@empty axle no you can't

#

You can only get the info that the session advertises

empty axle
#

the session properties?

chrome bay
#

yep

empty axle
#

@chrome bay ah okey, thank you

meager spade
#

Trees in fortnite are domant till interacted with

#

they are replicated using Repgraph in spatializtion grid node

#

my repgraph has the same sorta setup

#

i also replicate certain pawn only things via the pawn as a dependant actor

karmic briar
#

@meager spade can u show example code u use to define actor such as tree for their dormancy I wanna make things like static like tree dormant and actor like ai get the other 2 type

meager spade
#

eh?

#

the actor has the dormancy option

#

in the Replication settings

rocky totem
#

@lost inlet any idea how to fix the issue since i followed the same pattern that works for changing meshes

rocky totem
#

On my object I'm trying to change either the mesh or the material. I have the mesh working and I was attempting to replicate the pattern for materials these are the headers

meager spade
#

MaterialInstance is not replicated

#

you cant send it via replication

#

@rocky totem

rocky totem
#

And here is the source. Setting the mesh works just fine however the material doesn't seem to want to change. If I call from the server I only hit the breakpoint on line 100 and if i call from the client i only hit the breakpoints on lines 100 and 115

meager spade
#

did you not read what i just put?

rocky totem
#

sorry i was typing and didnt see the ping

meager spade
#

you cant send a materialInstance over a RPC

rocky totem
#

wait but i can send a static mesh

meager spade
#

yes

#

thats different

winged badger
#

StaticMesh is an ActorComponent

#

UMaterialInstance isn't

meager spade
#

well even if its just UStaticMesh

#

its still available on all clients

winged badger
#

thats an asset so its fine

meager spade
#

MaterialInstance is created dynamicallyh

winged badger
#

can be uniquely IDed by a path

rocky totem
#

so couldi theoretically send a umaterial?

meager spade
#

yes

rocky totem
#

ok so it's just that it's a material instance thats the problem

meager spade
#

thing is, the object has to be able to be referenced

rocky totem
#

except aren't those created and stored as separate uassets as well?

meager spade
#

either via the package or net name stable replicated

#

the material exists on all as an asset

#

MaterialInstance is created

#

dynamically

#

oh hmm

#

unless that is a packaged material instance..

#

maybe i read it wrong, cause i was helping someone not long ago who was trying to send a dynamic material instance over RPC

rocky totem
#

like the material's im referencing are all created i the engine and save and packaged out

#

ok brainstorm

#

if just had it set to UMaterial

#

could I use one of the material instances I created in the editor

#

would that create a larger amount of overhead

meager spade
#

no but are you running Debug Editor

#

or Development Editor

rocky totem
#

Dev Editor

meager spade
#

cause you might be skipping out of the breakpoint

#

if its optimized away

#

always always debug in Debug Editor

rocky totem
#

Ok but doesn't it need to run in both to work when packaged

meager spade
#

eh>

#

right but you are debugging

rocky totem
#

fair

meager spade
#

so debug with Debug Editor

rocky totem
#

rebuilding now lets see what it has to sya

meager spade
#

cause Dev Editor optimizes stuff

#

it can skip breakpoints

#

if the code is optimized

rocky totem
#

ahh so it may actually be running and noot doing anything and just skipping the breakpoint

meager spade
#

you internal call might actuall be working

#

but the breakpoint wont hit

rocky totem
#

ok so it's actually making it all the way through so let's see if i can figure out where the problem is now

#

and according to the locals the pointer is correctly being passed without being dropped

#

i think i may have found it

#

thanks for the i'll rmb to check the build type

#

well i found something else interesting

#

CurrentlyDisplayedMaterials.Emplace(InElementIndex, InMaterial); to keep track of which materials are in use where for replication i use this

#

however it doesn't cause the replication to fire

meager spade
#

is that a TMap?

rocky totem
#

yes

meager spade
#

no just an TArray

#

TMaps cant replicate

rocky totem
#

why not

meager spade
#

not supported for replication

rocky totem
#

ok

#

ty

#

is there a list of all the things that aren't supported for replication

meager spade
#

๐Ÿคท somewhere probably

#

if you want a TMap like thing

#

use a TArray with a custom struct

#

holding your two elemnets

rocky totem
#

i'm justgunna do exactly that

meager spade
#

Index and Material

glacial shuttle
#

oh didn't even thing about this I have been debuging in dev editor this whole time

rocky totem
#

i was already writing it

#

lmao the structs are back

#

they can't run forever

#

do i need to do anythign special to the struct like replicating all of it's properties

glacial shuttle
#

don't think so

narrow prairie
#

i have a strange issue: and i dont know where to look. I have a enemy and some npcs. they react all nice and well. however when i move towards the action on client . damage calculations not beeing done anymore. so the actors stop dying. when the server moves in towards the action . suddenly everything works again as intented

#

when i simulate i dont have any issue

#

Is anyone familiar with this kinda behavior and guide me in the right direciton where to look

meager spade
#

properties need to be marked with UPROPERTY()

#

in a struct to be serialized

#

if you dont want something to be replicated in a struct put UPROPERTY(NotReplicated)

rocky totem
#

thanks for everything kaos and being so patient with me

jolly siren
#

Does anyone know if any of this made it back into CMC?

pseudo iris
#

sorry, I was asleep, does anyone know how to get a client's player state for widgets?

#

OH i figured it out

#

if I put a delay in at begin play it works

#

now that's done, does anyone know how to increase a player's score when he kills an opponent?

#

I have code that recognizes it but it does it for both the server and client

pseudo iris
#

It's still doing this, unsure how to fix

odd scaffold
#

Hello, I am trying to compile the aws-c-event-stream with bash with this command cmake -DCMAKE_INSTALL_PREFIX=~/aws_deps -DBUILD_SHARED_LIBS=ON
but I get these errors

CMake Error at CMakeLists.txt:36 (include):
  include could not find load file:

    AwsCFlags


CMake Error at CMakeLists.txt:37 (include):
  include could not find load file:

    AwsSharedLibSetup


CMake Error at CMakeLists.txt:38 (include):
  include could not find load file:

    AwsSanitizers


CMake Error at CMakeLists.txt:74 (aws_set_common_properties):
  Unknown CMake command "aws_set_common_properties".```

I tried googling but to no avail
I succesfully compiled `aws-c-common` and `aws-checksums` but got stuck at `aws-c-event-stream`

Does anyone have ideas?
pseudo iris
#

never mind i got it

thin stratus
#

@odd scaffold Don't think a lot of people use AWS and if they do, compile that library by hand.
You might be better off asking on the AWS fourms.

odd scaffold
#

Hmm.. thanks

odd scaffold
drifting geode
#

Hi guys, would somebody smarter than me please give me a hint how to fix this. I spend many hours trying to figure it out and am cluelss :S

I need to replicate a few variables that are set in the AI event graph. They are used like i.e. the one marked in red below. The only way I can figure out how to do this is to use RPC to get all the variables back to the BP_AI and set them to multicast there but the editor freaks out when I do that and doesn't work in PIE anymore (Ai won't walk, takes forever to load, etc.)

#

Also for some reason nothing happens when I set the variables to replicate in the anim blueprint. They are not updated on client dispate them changing on server.

cunning shoal
#

hey guys... so i managed to get my FPS/TPS camera thing to work in multiplayer using get control rotation for the FPS camera mode..... now im working on the ADS mode, which smoothly slides over to the camera on the gun - and it works on the server, but the client is hit or miss (no pun intended)

#

i notice it will always work on the side-side movement, but up/down sometimes works and sometimes doesnt

#

any ideas? when the up/down breaks - shooting makes the bullets go in the same position up/down wise, only accounting for side-side movement of your mouse

tawny mason
#

Hey guys any idea on how to handle a disconnect from a session on the client side ?

thin stratus
#

GameInstance has OnTravelError and OnNetworkError

tawny mason
#

yes, but the engine is still taking me back to the startup map, is my only option to do an open level before the engine does to take him elsewhere ?

chrome bay
#

it'll always take you to the startup map on a disconnect

#

think of it like returning to the menu

rain coral
#

If I parent a Character to some object, the character stops replicating movement. Does anyone know a way around that?

chrome bay
#

When you stay stops replicating movement how do you mean?

#

Prediction probably won't work but the attachment should, that comes down via AttachmentReplication

rain coral
#

It doesn't send OnRep_ReplicatedMovement, for example, when it's attached to something

chrome bay
#

Yeah it won't

#

It'll use OnRep_AttachmentReplication

rain coral
#

Ahaa. Does that include the updated position/rotation whenever it changes on the server?

chrome bay
#

It should I think, sometimes I think OnRep_AttachmentReplication() also calls ONRep_ReplicatedMovement itself, but essentially all the location/rotation info is treated as "relative" to the attach parent from that point on

rain coral
#

I see, will check it out then, thanks!

chrome bay
#

np's

rain coral
#

Yee works as expected ๐Ÿ‘

barren mirage
#

Hey!
Has anyone successfully been able to use the Online Subsystem Steam, with a listen server, and a P2P connection, in 4.24? I can't seem to get it working, I get this warning, in packaged build:
ModuleManager: Module 'SocketsSteamSockets' not found - its StaticallyLinkedModuleInitializers function is null.
I have run though the whole setup
Have anyone experienced this?
Thanks !

grizzled stirrup
#
    HealthComponent = CreateDefaultSubobject<UHealthComponent>(TEXT("HealthComponent"));
    HealthComponent->SetIsReplicated(true);
#

Is the second line necessary if the actor the component is being created on is replicated?

#

I have this on all my health components but have always wondered if it is needed

winged badger
#

bReplicates = true in constructor is sugficient

#

And unless the component has replicated members and/or RPCs there is no need to replicate it at all

#

Being on the CDO its net addressable as long as its actor is

grizzled stirrup
#

The health component in this case has replicated health properties. So bReplicates = true should be set in the owning actor? (the actor that the lines above are written in)

winged badger
#

In components constructor

grizzled stirrup
#

Oh right got it thanks!

grizzled stirrup
#

@winged badger warning C4996: 'UActorComponent::bReplicates': This member will be made private. Please use GetIsReplicated, SetIsReplicated,

#

It's fine to call SetIsReplicated() in the constructor of the component right?

#

Never usually call functions there

astral fossil
#

yes

#

I believe

grizzled stirrup
#

Thanks

astral fossil
#

to reassure, even tom Looman does that on a udemy course (and he worked as an Epic's engineer)

#

also on a health component =p

meager spade
#

calling functions is no different to setting properties, if the object exists.

chrome bay
#

@grizzled stirrup It's SetIsReplicatedByDefault() now in constructor

stiff echo
#

Actor->SetActorTransform(Record.Transform);

#

It breaks replication for few seconds? Does someone know why?

#

Do I need to change teleport type?

eternal lake
#

@stiff echo Have you tried other methods like setting worldLocation and worldRotation separately?

stiff echo
#

Yes

#

I think I have to implement teleport ability

eternal lake
#

I don't think that's the right way to go about it

stiff echo
#

as described in documentation of UCharacterMovementComponent

eternal lake
#

Because the CharacterMovementComponent has support for making minor network adjustments to replicated actors, which would require replicated teleports

It may be worth digging a bit within there to see what you can find about their implementations.

stiff echo
#

I would be fine with default smooth correction but it is way too big like 10 sec or even more

eternal lake
#

Are there any important overloads of SetActorTransform you are missing?

stiff echo
#

I do not understand what you mean. I have save/load system. And on load I want to set saved position to actor.

eternal lake
#

the method SetActorTransform

#

are there any overloads of that method (those that have different parameters) that you have not seen?

#

(I don't have the UE documentation open right now)

stiff echo
#

I see only one:

#

bool SetActorTransform
(
const FTransform& NewTransform,
bool bSweep,
FHitResult* OutSweepHitResult,
ETeleportType Teleport
)

#

But I think it is controlled completely by movement component

eternal lake
#

Okay, you didnt't specify what values you are passing in for the other 3 parameters, you only told me you're passing in a transform

stiff echo
#

I use default: (const FTransform& NewTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None)

eternal lake
#

So you're trying to teleport an actor, but you're using a teleportType of none?

stiff echo
#

I tried all possible options. Does not have effect.

#

Teleport defines physic state. Has nothing to do with replication

eternal lake
#

I assume replication works for you outside of this transform setting you are doing on load/

grizzled stirrup
#

@chrome bay Thanks! Is there a reason to ever use SetIsReplicated() over that or is that the new standard?

chrome bay
#

That's the new standard, you'll get a compiler warning/startup warning calling it anything else in the constructor

#

SetIsReplicated() is for use at runtime now

grizzled stirrup
#

Many thanks

#

Wiill change my classes over to that new standard ๐Ÿ™‚

#

Though I don't get the warning in the constructor

stiff echo
#

@eternal lake yes, it works perfectly, but after load it stuck for 10 seconds

grizzled stirrup
#

Unless I directly set bReplicates

stiff echo
#

@eternal lake After correction applied I can observe replication again.

eternal lake
#

hm

meager spade
#

virtual void ForceAmmoNeedSync() { MARK_PROPERTY_DIRTY_FROM_NAME(AKaosWeapon_Ranged, CurrentAmmo, this); }

#

o_0

#
    Params.bIsPushBased = true;
    
    DOREPLIFETIME_WITH_PARAMS_FAST(AKaosWeapon_Ranged, CurrentAmmo, Params);```
#

awesome i like the new changes

eternal lake
#

Doing some reading:

CMC implements auto movement replication, but if you're setting a transform directly, this may not directly be replicated to the server.
You may need to look into sending this transform set to the server as well @stiff echo

stiff echo
#

@eternal lake I load it on server, the problem is to notify clients

#

@eternal lake I think the only way to achieve such simple functionality is to extend CMC with teleport ability

eternal lake
#

I think what's happening is exactly that

#

the client is not being updated

#

because the setTransform call should be called from the client, not the server

#

can you pass the information gained on load to the appropriate client and then have the setTransform call be done there?

stiff echo
#

@eternal lake I can implement it. But my main question is this expected behavior?

meager spade
#

doesnt SetActor have the Teleport option?

#

SetActorLocation*

eternal lake
#

I am not experienced in Multiplayer

meager spade
#

i mean you have to do it on both

#

client and server

eternal lake
#

just trying to help with c++ knowledge and Unreal shittery

#

^^
This

meager spade
#

normally you tell the server, server will multicast the position

#

this will update all clients and server with new position

#

you cant just teleport a client, server will correct it

stiff echo
#

@meager spade exactly I do it on server and my expectation is that it will be replicated to clients. And actually it is but with huge delay.

meager spade
#

it wont

#

you have to multicast it

#

otherwise like you said

#

it will be a stupid delay

stiff echo
eternal lake
#

how do you multicast a setTransform from a server by hand?

meager spade
#

i am familiar with it

stiff echo
#

I want to have Approach 2

#

I mean its not the best but it is cheap

meager spade
#

client tells server, server adjusts transform, server sends multicast, adjusts transform

#

2 rpc's

#

easy

#

i do it for my monsters when teleporting them across the map

eternal lake
#

what is the code to send a multicast?

meager spade
#

c++ or bp?

eternal lake
#

c++

stiff echo
#

I save/load entire scene, do I need to wright custom code for every property?

#

Or transform is special case because of CMC?

meager spade
#
{ 
    SetActorLocation(Location);
    MulticastActorLocation(Location);
}

void MulticastActorLocation_Implementation(const FVector& Location)
{
    SetActorLocation(Location);
}```
#

replace location with transform/rotation, w/e

eternal lake
#

o.o

#

Thanks!

#

I learnt something today!

meager spade
#

thats psuedo code

#

you will need to make RPC funtions

eternal lake
#

o.O

#

Do you recommend a source for learning RPC functions?

stiff echo
#

FPS template

meager spade
#

no ShooterGame

#

if your doing c++

stiff echo
#

true

meager spade
#

FPS template doesn't handle replication

eternal lake
#

Thanks! I'll have a read and see if I can learn me something

meager spade
#

in a sense

stiff echo
#

So I need to replicate it to every client.

meager spade
#

replicate what?

stiff echo
#

Or even send SaveFile to all clients and load positions there

meager spade
#

no?

#

you would spawn the actor at the location

#

it was last saved at

stiff echo
#

only if it is deleted from scene

meager spade
#

if its replicated then all clients will see it

stiff echo
#

otherwise just to update position

meager spade
#

why would it be deleted from scene from a save ?

stiff echo
#

No, I save, then something happens on scene, some actors are deleted, and I load save game.

#

So I do not respawn all actors.

#

But now I see it is not good idea. It is easier to delete them all and spawn again.

#

Then I do not need to write any code.

ember slate
#

How do I access the GameSession from inside the gamemode blueprint?

eternal lake
#

GameSession is a variable.

#

You should check if it is public in the engine code for AGameModeBase

#

'A game session exists only the server, while running an online game.'

#

It will not be accessible from the gamemode blueprint

#

you will need to obtain it from the server

polar lotus
#

Could anyone help me set up a replication graph?

meager spade
#

i really doubt anyone has the time to help you do that

#

do you really need a rep graph? do you have a game with 30+ players and 25000+ replicated actors?

polar lotus
#

I max out at 25 Players

#

25000 replicated actors? heck no

meager spade
#

check out ShooterGame

#

it has an example repgraph

#

which could help you get the ball rolling

polar lotus
#

There is a replication graph in the plugin source called BasicReplicationGraph

#

How can I utilize it?

meager spade
#

you really don't want to use that

#

its basic for a reason

#

honestly check out ShooterGame it's basically the same as what Epic used in fortnite (minus a few fortnite specific stuff)

polar lotus
#

Alright

meager spade
#

i have my own custom one, but i spent 3 days writing it

polar lotus
#

Jeez

#

My maps are huge though so I think it might be useful

meager spade
#

sure

polar lotus
#

I am not using dedicated server tho

#

it's listen based

meager spade
#

make sure you set up spatialization properly

#

doesnt matter

#

it will help the listen server by reducing his load

#

if its a big map

#

but 25 people on a listen server

#

is gonna be taxing on the poor host

#

hopefully he has a powerful internet connection ๐Ÿ™‚

polar lotus
#

eh

#

I might have to lower that possibly

meager spade
#

even call of duty games of a couple years ago, 12v12 was a pain

#

or w/e groundwar was

hoary lark
#

minimum requirement: 150 Mbps fibre?

meager spade
#

maybe 9v9

polar lotus
#

Do you think 10 would be bad

meager spade
#

10 is fine

#

but i honestly wouldnt worry about repgraph

#

but if you want to do it to learn, sure

#

but its not needed

polar lotus
#

could I make a simple one?

#

Just to keep as much load off of host as possible?

meager spade
#

with only maybe 2-3000 replicated actors and 10 players, it will be minimal gain

#

but yeah try it

polar lotus
#

ah I see

meager spade
#

we have 8 player co-op game

polar lotus
#

it couldn't hurt anything

meager spade
#

and we havent noticed any major issues

polar lotus
#

I'm working on a TPS

meager spade
#

and we have around 1500 replicated actors

polar lotus
#

But I have some other modes In mind

meager spade
#

i would focus on gameplay first

#

repgraph should be last

polar lotus
#

Alright then

meager spade
#

once you think "yeah i need it!"

polar lotus
#

I'll put it on the backburner for now

meager spade
#

i would, honestly, make a playable game first, test it, etc. then optimize

#

repgraph can be slotted in relatively easy at anytime

#

with minimal (and i mean zero) changes

polar lotus
#

what if I don't base every class in C++

#

(I usually do but,)

meager spade
#

not everything has to be c++

polar lotus
#

?

#

but the RepGraph is 100% C++

meager spade
#

yes

#

and?

polar lotus
#

How am I supposed to manage blueprint classes from C++?

meager spade
#

you don't need to put everything through the repgraph

polar lotus
#

I thought it was C++->BP

#

1 way

meager spade
#
    AddInfo( AKaosWeapon::StaticClass(),                            EClassRepNodeMapping::NotRouted);                // Handled via DependantActor replication (Pawn)
    AddInfo( AKaosInventory::StaticClass(),                         EClassRepNodeMapping::NotRouted);               // Handled via DependantActor replication (Pawn)
    AddInfo( ALevelScriptActor::StaticClass(),                        EClassRepNodeMapping::NotRouted);                // Not needed
    AddInfo( APlayerState::StaticClass(),                            EClassRepNodeMapping::NotRouted);                // Special cased via UKaosReplicationGraphNode_PlayerStateFrequencyLimiter
    AddInfo( AReplicationGraphDebugActor::StaticClass(),            EClassRepNodeMapping::NotRouted);                // Not needed. Replicated special case inside RepGraph
    AddInfo( AInfo::StaticClass(),                                    EClassRepNodeMapping::RelevantAllConnections);    // Non spatialized, relevant to all
    AddInfo( AKaosPickup::StaticClass(),                            EClassRepNodeMapping::Spatialize_Dormancy);        // Spatialized and moves, dormant once static.
    AddInfo( AKaosGABuildingActor::StaticClass(),                   EClassRepNodeMapping::Spatialize_Static);       // Never moves, always static.```
#

like this for example

polar lotus
#

oh I see

meager spade
#

certain things are routed

#

to special node mappings

polar lotus
#

would this be of any use?

meager spade
#

sure

polar lotus
#

it's all BP based

meager spade
#

kinda

polar lotus
#

But I heard they changed RepGraph in 4.24

#

this plugin is a bit old

meager spade
#

not really

#

just a few little things

#

but its easy to fix

polar lotus
#

so it wouldn't break this plugin?

meager spade
#

probably would

#

but its easy to fix

pseudo iris
#

how can I test connecting to two servers in unreal editor?

#

I set up a server list but I can't find the server

pseudo iris
#

do I need to add anything to DefaultEngine?

#

actually I got it to work

#

clicking the server button not working

#

actually I got THAT to work too

past bear
#

Repnotify and arrays - I assume these cannot be used together?

bitter oriole
#

They can, AFAIK

chrome bay
#

yeah I use em

past bear
#

yeah, I colleague of mine tried it, and it doesn't seem to do anything

#

array of playerstate references did not work, simple integer did

chrome bay
#

Sometimes you get more than one RepNotify call for them. Once for one the size of the array changes, and again for when the items within it change

#

Pointers in particular since you can't garauntee rep order etc.

#

Not sure if that's relevant in this case

past bear
#

testing atm - in his case he's not getting a Repnotify on the host if the array size changes (e.g. adding an element)

#

he does if a value changes

chrome bay
#

huh that's odd

#

Oh wait, host as in server right? In CPP at least the rep notify won't get called automatically on the Server

#

In their infinite wisdom Epic decided to make BP/CPP different in that regard... unsure why

past bear
#

we're in BP - it usually does get called

chrome bay
#

But in CPP anyway if you want a repNotify to be called you gotta call it manually

past bear
#

just not in CPP

chrome bay
#

Ah okay, maybe BP behaves differently

past bear
#

wonder if it's because a native function is technically making the change

#

if you add an element to the array, a CPP function does it, rather than if you change a variable value it happens in BP directly

chrome bay
#

Ultimately AFAIK if the property is changing at all, it should trigger the notify, whether it be size of elements.

#

But IDK if maybe it behaves differently in BP because.. reasons.

past bear
#

aye - we've sent an e-mail to the other team to see if they've been fiddling with replication because it seems counterintuitive

sleek current
#

How can I draw debug strings for each client separately?

rich ridge
#

@sleek current UE4 already does that

#

It will print like Client 1 : Hello

teal python
#

I've noticed that when running multiple instances from the editor (client + server), that the behavior is different from manually running each instance as standalone. This is causing problems. Is there documentation anywhere outlining what the editor is doing? Does anyone know where I can look in the engine source code to find out?

rose egret
#

how do I make client only component in C++ ? in other words I have an C++ actor which is replicated. this actor has two SkeletalMeshComponent that I only need them for rendering. I just want to save memory for dedicated server and do a little optimization since I have nearly 10,000 of these actors on server

teal python
#

set the "replicates" property of the component to false

#

this should be the case for all components by default

#

since replication is an opt-in procedure

#

the one exception is the Character class

#

that's been set up with a lot of stuff and to replicate by default

sleek current
#

How can I make my component to work literally seperately for each client so each client has its own variables, ticking things etc?

#

I set the bReplicates to false and checked the Role if its < ENetRole::Role_Authority

#

and also tried to use Client, reliable rpc's

#

still not working, other clients see the work of the same scene components

glass plaza
#

Is there a way to check in runtime if a component is properly replicating?

worthy perch
#

I guess just send some sort of RPC.

pseudo iris
#

What's the best way of starting a new multiplayer match when the last one ends?

meager spade
#

@pseudo iris

#

earlier on you was having issue with widget errors right/

pseudo iris
#

yeah

meager spade
#

did you solve it? cause i realised you was getting the issue cause you was trying to create it on server

pseudo iris
#

i've solved it for the most part, I'm just going to ignore the errors

meager spade
#

dedicated server cant create widgets

#

and begin play is called on dedicated server and clients

#

you need a switch authority node and only spawn the widgets on remote

pseudo iris
#

what about on the menu?

meager spade
#

you dont show the widget on server full stop

#

it cant have widgets

pseudo iris
#

well it's on the playercharacter so

meager spade
#

right

#

but that is also called on server

#

so server will try to create a widget

#

and it will fail

#

just put switch authority and on the remote branch, do your widget code

#

and you will have 0 errors

pseudo iris
#

i did this but it still gave me the error

meager spade
#

right but you are still creating it on server

#

why have a client rpc

#

honestly

#

its easy

pseudo iris
#

not for me dude

meager spade
#

2secs

#

so just connect that remote pin to delay

#

remove all the stuff i scribbled out

pseudo iris
#

oh it fixed it

#

thanks

#

that also fixed it not setting my mouse cursor in-game too

#

just set a switch has authority network on

gray scroll
#

why does event on possess get triggered twice on clients?
this is inside playercontroller

meager spade
#

OnPossess is server only

#

so it shouldnt

#

it will fire once for each player

gray scroll
#

exactly... i m spawning players on server via game mode

#

but event on possessed gets called twice

meager spade
#

maybe you are possessing twice

gray scroll
#

nope

meager spade
#

have you printed the pawn?

gray scroll
#

it prints once only there

meager spade
#

to see what the value is

gray scroll
#

its the same pawn

#

twice

#

on possessed

meager spade
#

show me your logic

gray scroll
#

being run on server

#

and only prints once here

meager spade
#

and what calls SpawnCharacter Pawn

#

also do you have Default pawn set in your game mode?

#

if so remove it

gray scroll
#

this is run on post login

#

and eventually calls the spawn player function

#

i just removed pawn from gamemode

#

let me try now

#

nope still spawns twice

meager spade
#

hmm

#

spawnplayer is that in gamemode?

#

not sure why its a server rpc

#

everything in GameMode is server only

#

clients cant ever access it

gray scroll
#

true

#

but shouldnt effect this

meager spade
#

yeah without seeing properly whats going on and debugging

#

i wouldn't really know

#

all i know is out OnPossess only fire ones

#

so you are doing something odd

#

somewhere

gray scroll
#

it fires twice when i package a build

#

and join the server

#

runs once on dedicated server checked

meager spade
#

only fires once for me

#

on dedicated and listen server

#

why you using OnPostLogin

#

to spawn the pawn?

#

i mean this works fine for me and prints only once in OnPossess

gray scroll
#

i will try that event

#

starting new player event worked

#

thank you!

hybrid wren
#

Hi there, I'm back after many month away from UE ... and remains a begginer. I'm trying to run my project with dedicated server, and got an issue with my character. My animations are shaking ... Do I have to enable something special for animations ? My project is not very complex atm, i'm using a basic animation blueprint. Anybody had similar issue ?

sleek current
#

How can I draw debug strings so each client see it's own values?

hoary lark
#

Turn off "use single process"

sleek current
#

But how can I do that when it is actually multiplayer :P?

hoary lark
#

you find the option, and then you click on it? ๐Ÿ˜„ I'm just making a guess what the problem probably is based on everything else I've seen you say in here recently about that. If you are running packaged builds with separate EXE's already then my guess will be wrong. show some screenshots or video clips of what's going wrong for you if you want more help from someone, the question is far too vague to try and give an exact answer

chrome bay
#

If the game is running separate EXE's it's not sharing the same process anyway

#

To save iteration time the engine shares a lot of memory/processes in PIE multiplayer. That option disables that and spools up new instances of the game as completely separate processes. It's like clicking the packaged .exe multiple times.

sleek current
#

The problem is when I run the multiplayer the strings show the same values for first subscribed player to it

#

I want it to be separately for each player

hoary lark
#

well ok, so are you launching built game EXEs or are you playing in editor? @sleek current if you are playing in editor, have you verified it is not caused by shared memory from running in single process?

zinc tree
#

I've been having trouble with replication for the past week or so that I've probably spent 20+ hours trying to fix and I'm almost to the point of just starting everything over from scratch. I'm creating a multiplayer game with an Archer character, and I have had an immense amount of trouble with getting arrows to shoot correctly on all clients. I spawn the arrow projectile out of a bone on his hand, where I have a static mesh arrow attached that I make visible/invisible when he draws an arrow and shoots. I am running a dedicated server and 2 clients, yet the 2 clients and the server have a different idea of the world transform for the socket, so the arrow is spawning differently on all clients. I fixed this problem by just having multiple custom events so that the client always tells the server where it should spawn the arrow. This brought me to a new problem where the server and client have different versions of the arrow when it is shooting. The arrow is spawned on the server, and when I use a non-dedicated server

#

and look at what the server sees, the arrow spawns backwards and the fletchings are facing the target as it flies in the air, yet on the clients screen it is facing the correct way. While this alone isn't a big problem because it's just a straight projectile so the hitbox doesn't change much, it becomes a larger problem when put together with another issue that I am having where the rotation of the arrow isn't changing while it is in the air. I have the "Rotation Follows Velocity" checked off, and it works on the server (albeit backwards), but it isn't being replicated, and on the clients' screen, the arrow just keeps the same rotation throughout its flight path. This changes its hitbox slightly, but the biggest issue with all of this is with the character's special ability. His ability is an arrow volley, which spawns in 20 arrows in a random box around the initial arrow while it is mid air. If I do the same thing I did with the primary fire and have the client tell the server where to spawn the arrow, because the initial arrow never changes its rotation, the new arrows are spawned with that same initial rotation, despite where the arrow is in its trajectory, so they fly off weirdly instead of following the same path. If I instead have the server figure out where to spawn the arrow, the new arrows spawn backwards and fly back towards the character because for the server, the initial arrow is spawned backwards. I've tried many different ways of getting it to work correctly, but no matter what I replicate or how I spawn the arrow, I haven't been able to get it working correctly for all clients.

winged badger
#

i'd probably go with the simplest replication that completely describes the arrows flight path -> starting location + initial velocity

#

have the projectile movement components take it from there

#

there is no way you'll ever sync animations well enough to be able to shoot from a bone socket

zinc tree
#

that is all im doing

winged badger
#

you can try to IK the thing into place on simulated versions of the character

zinc tree
#

I have the client get the transform of the static arrow attached to his hand, and then the projectile arrow is spawned at that transform

winged badger
#

juggling lag becomes a challenge though

#

to have it look seamless, simulated proxies, that are already late, would need to run IK then shoot

zinc tree
#

i can worry about making it look good later

#

i just want it to work right now

winged badger
#

i would not replicate the arrows position, velocity, or anything of the like

#

just its initial velocity

zinc tree
#

?

#

the arrow projectile is spawned on the server

winged badger
#

and then set it on projectile movement component on BeginPlay

zinc tree
#

and then it is replicated

winged badger
#

yeah

zinc tree
#

dont do that?

winged badger
#

but you do have a lot of network traffic

#

where you in theory need just one replicated vector on arrow projectile

zinc tree
#

?

winged badger
#

(not accounting for lag compensation here)

zinc tree
#

so i should spawn the arrow on all clients?

winged badger
#

no

#

you should spawn the replicated arrow on server, and have a replicated vector in it

#

that vector being set as projectile movement components velocity onrep or during beginplay

zinc tree
#

isnt that the same as what i am doing now?

#

I spawn the arrow with projectile movement

#

and it is replicated to the clients as it flies

#

except that replication isnt working

#

and it isn't replicating rotation

winged badger
#

you can take manual control of it

#

send the target instead

zinc tree
#

what

winged badger
#

target location for the arrow

#

have each client calculate the shot separately

zinc tree
#

how would you know that

#

until it hits

winged badger
#

you do know what you aimed at, no

zinc tree
#

yes, but enemies can move

winged badger
#

there are ton of suggestprojectilevelocity

zinc tree
#

the velocity shouldn't change

#

or well

#

the speed shouldnt change

#

It's set at a constant initial speed

winged badger
#

what are you replicating in the arrow projectile?

zinc tree
#

I've tried a lot of different combinations, but right now I have the static mesh and the projectile movement replicated

winged badger
#

why?

zinc tree
#

What do you mean why?

winged badger
#

why do you replicate either of those?

zinc tree
#

Do I not have to?

winged badger
#

nope

zinc tree
#

what should I replicate then?

winged badger
#

you just need the initial velocity

#

put it as a member

#

and set it on projectile movement

zinc tree
#

What

winged badger
#

add a Vector variable

#

replicated, RepNotify

zinc tree
#

I'm so confused

winged badger
#

owning client or server calculate a shot

zinc tree
#

If I want the client to see the arrow

winged badger
#

the actor is still replicated

#

but you don't need to replicate those components

zinc tree
#

Oh ok

winged badger
#

all components on the CDO

#

(if you're BP only, think visible on component list)

zinc tree
#

I am

winged badger
#

are always there, client or server

#

don't need to be replicated to exist

zinc tree
#

Ok

winged badger
#

and can be referenced over network without being replicated

zinc tree
#

So why isn't the rotation being updated on clients?

winged badger
#

(unless we're talking non-replicated actor spawned at runtime)

zinc tree
#

I think if we fix one problem the rest won't matter too much

winged badger
#

so

#

say your server calculates a shot

#

it sets the InitialVelcotiy vector

#

to what the function told him is correct launch velocity

zinc tree
#

I never set the velocity

#

It's set in the default

winged badger
#

everyone uses OnRep to set velocity on ProjectileMovementComponent

zinc tree
#

I never change it

winged badger
#

look at suggest projectile velocity

#

predict projectile path

#

functions

zinc tree
#

Why would that help the rotation?

winged badger
#

getting rotation working is trivial, in most cases

zinc tree
#

I have shooting working

winged badger
#

and each client should handle its own

zinc tree
#

The path the projectile follows is fine

#

It's just the rotation I need to fix

#

The velocity is fine

#

Why would I need to change any of that?

winged badger
#

for a sensible bow

#

you'd need the velocity direction to come from players aim

zinc tree
#

Yes

#

It does

winged badger
#

velocity length to come from the strength of the pull

zinc tree
#

I don't have variable pull

#

It's a constant speed

#

The direction vector is just forward

#

So when it is spawned

#

It shoots forward

winged badger
#

so how do clients get that velocity?

zinc tree
#

They don't need it?

#

Why would they need the velocity?

#

All they need is the arrows position and rotation

winged badger
#

because their projectile movement is independent

#

thats the entire thing i was trying to suggest

zinc tree
#

What

#

The arrow is being replicated

winged badger
#

if the clients have the location and velocity of the arrow

#

they can calculate every step of its path without any further info

#

accurately

zinc tree
#

So I should spawn the arrow on clients?

winged badger
#

they don't need any more replication

#

no

#

you should just try to spawn an arrow that has the velocity in a replicated variable

zinc tree
#

So why are they calculating the path?

winged badger
#

that way arrow as soon as its spawned on clients

#

knows the position and velocity

#

rest is just ballistic shot physics

#

that they can calculate individually

#

and which projectilemovementcomponent does

zinc tree
#

So I shouldn't use projectile movement?

#

Maybe I'm stupid but you just keep confusing me more

winged badger
#

how did you get to that conclusion?

#

ok

#

step by step

zinc tree
#

Why do the clients need to calculate path

#

And how would they calculate path?

winged badger
#

1 - server knows the direction of the arrow and location of the arrow

zinc tree
#

If the arrow is spawned on the server

winged badger
#

2 - server spawns the arrow, and sets its velocity on its ProjectileMovementComponent to be direction * speed

#

at this point arrow flies to wherever it would normally fly to on server

zinc tree
#

Yes, thats what I have now

winged badger
#

3 - server sets the direction * speed into a replicated variable, with RepNotidy

#

4 - the arrow itself is replicated

#

client :

zinc tree
#

so when the arrow is replicated, wouldn't the projectile movement be replicated as well?

winged badger
#

1 - receives a bunch telling it it should spawn an arrow at given location and also receives all replicated variables in that same bunch

#

2 - client spawns the arrow

zinc tree
#

ok, so the client should spawn its own arrow

winged badger
#

not by you

#

manually

zinc tree
#

what

#

not by me?

#

then who spawns it?

winged badger
#

it has to spawn an actor whenever a replicated actor is spawned on server

zinc tree
#

ok

winged badger
#

and it does that under the hood

zinc tree
#

thats what i thought

winged badger
#

3 - arrows replicated variables are set

#

at this point client's arrow is in correct location, it has the correct velocity in a variable you replicated, but not on ProjectileMovementComponent

zinc tree
#

why not?

#

is the projectile movement not replicated?

winged badger
#

3 - client uses either OnRep_LaunchVelocity or BeginPlay to set the ProjectileMovementComponent's velocity to the replicated launch velocity value

#

at this point clients arrow is at same location and has same velocity as it had on server half the ping time ago

#

and that is it

zinc tree
#

thats it?

winged badger
#

the arrow flies, locally

#

exactly as it should

zinc tree
#

ok, ill try that i guess

winged badger
#

you let client's ProjectileMovement handle the client side

#

as it will do exact same calculation as the server

#

you don't need to correct it, you don't need to replicate any of the arrow's components

#

and also shouldn't

zinc tree
#

so what about for the volley ability?

#

that one spawns arrows while the velocity is changing

short gulch
#

Sooo, I'm just gonna repost here because I asked in the wrong channel yesterday so:
Hullo, still trying to figure multiplayer stuff out.
I can't seem to get an actor to replicate properly. When the game starts and for a few seconds while a player is pushing it around, its location and rotation is replicated just fine, but after a while it just isn't, and both players see the actor in different locations. I'm using a hover blueprint that I followed a tutorial for in single player, if that matters.

dark edge
#

@short gulch do you have replicate movement turned on?

short gulch
#

yes

dark edge
#

I take it it's a physics enabled object?

short gulch
#

? like I'm using another blueprint for its physics, but I'm not actually simulating it

dark edge
#

what do you mean you're using other blueprint force physics question mark how exactly do your characters push the object around?

short gulch
#

yeah, and the players collide with the objects

dark edge
#

What I'm asking is, how exactly is the object move? Did you make a movement component for it, do the characters move it from there logic? How is it moved.

short gulch
#

either a blueprint is adding force to it, or a player is colliding with it to push it around.

dark edge
#

So it is simulated physics.

short gulch
#

if that's what you meant ๐Ÿ˜“

dark edge
#

It is what I meant because it makes a huge difference how you are actually moving the object. Do you have replicate physics to autonomous proxies turned on?

short gulch
#

yes

dark edge
#

First you should test that the server is authoritative over the position, by just moving the object on the server and checking that it gets replicate to the clients correctly.

#

Once you can confirm that works, you want to look in the project settings for the physics replication settings, which is where you find tune how much error is considered acceptable, etc.

short gulch
#

well for the first test, it didn't replicate correctly.

dark edge
#

With replicated physics, the three simulations, those on the server, first client, and second client, are always going to be slightly out of sync. Those physics replication settings determine how much correction should be applied when the clients receive the server authoritative physics state

short gulch
#

ah

#

error per linear/angular difference?

dark edge
#

Start with getting forces are impulses applied on the server to replicate out correctly. as long as replicate movement is turned on and replicate physics to autonomous proxies is turned on and, I think it has to be like this, the root component of the actor is what is simulating physics, it should work.

#

Is the root component your physics body?

short gulch
#

what do you mean?

dark edge
#

On whatever actor the characters are meant to be pushing, is the top level component the one that is simulating physics? It will usually be a box or sphere collider.

short gulch
#

like I see the root component, but what do you mean that is simulating physics? like I use the blueprint on that instead of my mesh component?

dark edge
#

Is the mesh component the part that is simulating physics?

short gulch
#

yes

dark edge
#

All right then you should either make that mesh the root component or add a collider above it in the higher key to service route. typically the simple shape gliders like box, sphere, capsule, are much better to use for physics than a static mesh.

#

Don't quote me, but I'm pretty certain that the physics body has to be the root component to replicate correctly.

short gulch
#

okay, how do I do that, do I just delete the default scene root or

dark edge
#

If the mesh hasn't been scale, you should just be able to drag it over the default scene root and it'll have an option to replace it.

short gulch
#

ah done

dark edge
#

Now just a like a five second timer after begin play, do a switch has authority, and then fire and impulse on the server. It'll look like s*** on the clients, but it should follow the movement from the server.

#

Sorry if it sounds like I'm having a stroke, I'm using voice to text.

short gulch
#

lol no problem

#

okay one sec

#

back

#

add impulse right?

dark edge
#

Sorry stepped out for a second. Yes on the server only try to add just a pretty big impulse that'll move the object. You're just doing this to test if things would be replicated correctly

half jewel
#

i have this problem with netDormancy and server RPCs. i recently found a way to improve performance vastly by setting certain actors to network dormant when they are not needed for a time during gameplay. But at any moment they need to return to the game. its sort of like a poor man's actor pool and it works great... my problem is the client needs to send RPC's to the server (related to the actor of course). in this example the player is updating the name of the actor before returning it to play, but the RPC never goes threw because its network dormant!

how can i make server RPC's go threw for actors that are networkDormant ?

lime lion
#

Hi, I'm looking for a good backend solution for a persistent multiplayer system - I was looking at using SpatialOS however it is not supported on Android (I'm making a quest app). Does anyone have any recommendations? Is Playfab a mature solution?

plush wave
#

Can you replicate an FTimerHandle?

winged badger
#

no, and you also shouldn't

half jewel
#

u have been defeated twice now and ur still say for be a things?? tisk tisk we shall see.

meager spade
#

@half jewel ?

sleek current
#

Im looping through this method UFUNCTION(Client, Reliable)
void DrawDebugStrings(AActor* Player); with for each player, then inside I draw debug strings. How can I show each player his own debug strings and dont replicate other players debug strings?

bitter oriole
#

Debug strings are not replicated

sleek current
#

What ever they are, how can I achieve what I want?

bitter oriole
#

Don't call that function for remote players

sleek current
#

how can I do that?

bitter oriole
#

Check the owner.

sleek current
#

Could you explain? Because when I see check the owner I imagine if(GetOwner()) which is not the thing you mention ๐Ÿ˜›

bitter oriole
#

Check if the owner is not the local player

winged badger
#

why would you rpc debug information to start with?

bitter oriole
#

Yeah, makes no sense

#

Just do it on tick in the pawn if IsLocallyControlled() and it's over

sleek current
#

Bruh

#

Thanks Bruh

#

โค๏ธ

final swallow
#

is there any way to know on the server side when an actor was fully replicated, on the initial replication?

bitter oriole
#

Have the clients send you a reliable RPC to notify you of full replication.

final swallow
#

that's what i thought of doing, was wondering if there was something built-in in the engine that i could use

bitter oriole
#

Not that I know of

winged badger
#

there is internal ack somewhere

#

in any case you can't resend an actor

#

so not entirely sure what you're trying to do

final swallow
#

i have an AbilitySystemComponent on my PlayerState, so I can't start the match before it fully replicates. So i'm trying to figure out how to know that all players got their ASC

#

i found AActor::PostNetInit, might be what i need (posting here in case anyone else is interested)

twin juniper
#

LogNet: Warning: UNetDriver::ProcessRemoteFunction: No owning connection for actor SourceMovement_C_0

#

What does that mean?

trim elm
#

Hey folks, I'm trying to have my player controller spawn another Character (not the player character) that it then owns, and I want it to be relevant only to that player controller. This works by setting the bOnlyRelevantToOwner flag and then overriding GetNetOwner() to return the player controller pointer. Seems to work fine with only one player connected, but when a second player connects to the server the server crashes with some kind of stale pointer in the actor channels map. Anyone ever tried anything like this?

winged badger
#

@final swallow you also have OnRep_PlayerState in both Controller and Pawn

#

although not 100% reliable (when a packet is lost) increasing the PS NetPriority from default 1 to over 3 will have PlayerState replicate before the Pawn, too

trim elm
#

Hrm. Think I found my problem. Looks like without the RF_Transient flag the character was getting destroyed (though for some reason only when the 2nd player connected. Strange!)

winged badger
#

that seems like you went out of your way not to do things using existing game framework @trim elm

final swallow
#

@winged badger thanks, i will look at it

winged badger
#

only relevant to owner won't do much unless you call SetOwner() on that object server-side

#

and if its spawned by the PC bUseNetOwnerRelevancy seems like a better choice

trim elm
#

I did call set owner server side. But GetNetOwner() is overridden by APawn to return itself, not it's actual owner.

#

But yeah, maybe bUseNetOwnerRelevancy might be better. Will look into it.

winged badger
#

why would you do that?

trim elm
#

I didn't. It's that way in the engine.

winged badger
#

engine looks for TopOwner

trim elm
#

const AActor* APawn::GetNetOwner() const
{
return this;
}

#

But thanks @winged badger I'll definitely check out bNetUseOwnerRelevancy.

winged badger
#

i'd call that yet another game framework fail

trim elm
#

Heh

winged badger
#
    /** Return the actor responsible for replication, if any. Typically the player controller */
    virtual const AActor* GetNetOwner() const;

    /**
     * Does this actor have an owner responsible for replication? (APlayerController typically)
     *
     * @return true if this actor can call RPCs or false if no such owner chain exists
     */
    virtual bool HasNetOwner() const;

bool AActor::HasNetOwner() const
{
    if (Owner == nullptr)
    {
        // all basic AActors are unable to call RPCs without special AActors as their owners (ie APlayerController)
        return false;
    }

    // Find the topmost actor in this owner chain
    AActor* TopOwner = nullptr;
    for (TopOwner = Owner; TopOwner->Owner; TopOwner = TopOwner->Owner)
    {
    }

    return TopOwner->HasNetOwner();
}```
quaint coyote
#

Im having some problems trying to get a 3D widget to work in a multiplayer sense. Im just trying to have a box collision that gets all the players within it and then create a 3D list that shows the name of all the players to everyone. the problem im having is that widgets mainly work clientside and I dont know how to bypass that. im mainly working with blueprints

winged badger
#

the usual way to go about that is to add a WidgetComponent on the players

#

or a WidgetComponent on their PlayerStates, and attach PlayerStates to pawns

#

and have those display the name in the PS

pseudo iris
#

how do I make a match end and start another one?

#

i've been trying to find help on google to no avail

dawn nova
#

What's the issue you're having with doing that?

quaint coyote
#

@winged badger im confused as to what the widget component attached to the playerstate would do. I have the player names stored in the Player state but the 3D widget would be its own object on the map is what im trying to get. ive tried having it so the server is the one that gets the player names, stores them in an array and then mulitcasts the array to the clients to be able to create the list on the 3D widget and be able to see the text. when ive been trying it some names from the array appear but then others just appear as "none"

winged badger
#

never replicate whats already replicated

#

you have an array with replicated playerstates in gamestate->playerarray on all clients already

quaint coyote
#

ah ok so if I can link the 3D widget to the gamestate and get the playerarray from there it should show all the player names to all clients

pseudo iris
#

sorry

#

@dawn nova I just dont know what to do

#

Like, what kind of custom event do I create to tell to start a new round?

rancid barn
#

Seeing if anyone has experience with this type of problem: I have a project that involves cards, so say I have an ACard class and then child classes like ABonusCard and APenaltyCard with their own sets of functionality.

What would be a clean cheat-proof way, with a dedicated server, to have cards display "face down" for some clients, and "face up" for others? I originally had everything all crammed insided ACard, which made it easy to selectively replicate various attributes to different clients. Now that I'm splitting it up into children, however, that method no longer works, because if I spawn an APenaltyCard it's impossible to hide the fact that it's a penalty card from the client as it can just look at the class

#

I'm thinking of spawning generic ACards on clients, and having the actual card type exist only on the server

icy latch
#

Maybe do a uint8 variable as a card value 0 == face down and only modify it via RPC to the individual clients instead of replicating it that way you can control the value each client receives.

#

If the card isn't 0 you can do a switch and cast it to another type.

#

enum or whatever

rancid barn
#

Oh that's interesting. Have it be un-casted on the client, and don't tell the client what to cast it to until you want to reveal it

#

is that a thing you can do?

icy latch
#

ya

#

you can change the texture or w/e when it receives the non-facedown value. and perform logic that casts it to the specific type base on the enum/uint8 value.

rancid barn
#

I've never come across this concept before, am I understanding that I can spawn for example an ACard into the game, and then turn that instance directly into AChildCard without making a new instance or breaking its references?

icy latch
#

I'm not sure about changing the stored reference it would still be ACard* but when you

ACard->SomeAction() {
  switch(CardValue) {
    case 1:
      Cast<APenaltyCard>(this)->whatever();
      break;
    default:
      break;
  }
}
rancid barn
#

I'll play around with this. Thanks for your insight!

icy latch
#

np

rancid barn
#

on that topic, is there a way to cast to a type defined at runtime for example pseudocode

classtocastto = AMyActor1
classtocastto* castedactor = Cast<classtocastto (actor)```
icy latch
#

TSubclassOf<ACard> classtocastto;

rancid barn
#

I've only ever used that to give a blueprint property

#

can you actually assign that to something programatically?

icy latch
#

ya, let me find an example

#

AEnemyPaperCharacter* NewActor = Cast<AEnemyPaperCharacter>(GetWorld()->SpawnActor(EnemySpawn.EnemyClass, &SpawnLocation));

rancid barn
#

oh that's neat

#

very cool, thanks again

icy latch
#

np

shut ruin
#

Hello. Help me please. I use the playfab server, I connect STEAM throws it from the server. Api error. Support said that you need to use ExternalMatchmakerEndpoint, show an example please in BluePrint how to do it correctly.

#

๐Ÿ˜ฆ

cedar finch
#

Should aiming down sights be handled locally then just replicate the animation to everyone else later? Or should I force it to go through the server first before allowing?

rancid barn
#

The ADS animation itself has no effect on gamestate, so it should be able to be done locally

#

then if the server winds up rejecting the client's attempt to ADS, you can kick them out of it

#

it would feel pretty bad to wait 30-100ms for your ADS client-side

cerulean escarp
#

hey guys, I have an issue where my players gun does not update the position of the bullet spawn on the server. the bullet spawn is a component of the gun which is spawned as an actor and attached to the player. I've had this issue before and I think it has something to do with dedicated servers not replicating skeletal meshes properly, but I couldn't find anything on google and I can't remember. any ideas?

#

also I'm doing this in blueprints

twin juniper
#

spawn bullet as actor from server side

cerulean escarp
#

I'm already doing that

#

I'd be stupid to not do that

twin juniper
#

ure replicating transform?

cerulean escarp
#

yep

twin juniper
#

it doesnt move or disapear?

cerulean escarp
#

what doesn't move or disappear?

twin juniper
#

the bullet

cerulean escarp
#

it shoots perfectly fine, but only directly out from the player

#

the pitch never changes though

twin juniper
#

maybe ur attached component to the character isnt being replicated

#

so at client it looks fine

#

but at server it doesnt exist

cerulean escarp
#

doesn't even look right on the client

#

and everything is being replicated

cedar finch
#

Ok cool. Thanks @rancid barn

cerulean escarp
#

is a cameras rotation able to be replicated so that when it rotates the children move/rotate with it on a server?

compact ocean
#

Hello, I'm looking for help because I didn't find a way to create a multiplayer game without the host/join thing but with a server hosting for everyone.
Can someone explain me or send me a link to a explanation ?
Thanks ๐Ÿ˜„

bitter oriole
#

Define "everyone"

#

It's up to 100 in UE4, with immense care

#

Most indie games need a lot less than that

compact ocean
#

?

bitter oriole
#

Well, what did you mean by everyone ?

compact ocean
#

I meant the server is hosting the game

#

not a player that can leave

#

Basic client/server but I have no idea how to do that

#

all the tuto that i've seen were about hosting/joining

bitter oriole
#

Yeah - so what I'm telling you is that you can do that, but you need multiple servers, not one

onyx crest
#

you're talking about an authorative or dedicated server

compact ocean
#

oh ok

#

@onyx crest sad to say that but I'm not sure I know the difference ๐Ÿ˜…

onyx crest
#

and from my experience you can handle over 100 users on a unreal hosted server. and they're the same basically authorative just means that the server decides movement

#

but using those search terms you'll be able to probably find better results for what you're looking for

compact ocean
#

ok, that's what I want to do ๐Ÿ˜„

#

oh ? using authorative instead of dedicated ?

onyx crest
#

they're one and the same

compact ocean
#

ok

compact ocean
#

Yes i followed this guide but i don't understood how this is working

#

I mean what is the server part and what is the client part and how do they interract

#

and how can I code the interraction between two users for example

#

I did this tutorial and ended up with .exe files but I had no idea how this was interracting

onyx crest
#

sadly outside of my range of skill so far, i'm using a premade mmo kit ๐Ÿ˜…

compact ocean
#

ok, does a premade online fps kit exist ?

#

it's ok i will search for it

bitter oriole
#

Well I guess there is ShooterGame in the samples

rancid barn
#

Mr Moine you're referring to Dedicated Server vs Listen Server. A listen server is where the server is also a client, which would be a host/join system. A dedicated server in separate, usually owned by you. You can run your game as a dedicated server at any time by clicking the little dropdown next to play and ticking "Run Dedicated Server".

#

For the most part, the concepts are the same whether you are coding for a listen server or dedicated server. Any regular guide that covers coding for listen servers will be good for learning to code a dedicated server, too. You use all the same replication, RPCs, etc. just keeping in mind that your server is not a client.

#

when you package the game, Unreal will generate both your client.exe and server.exe if you tell it you are using dedicated

pseudo iris
#

could someone help with my deathmatch game mode please?

half jewel
#

are on_rep properties eventually reliable, like reliable rpcs ?

cerulean escarp
#

is there a way to make camera rotation replicated? I have a skeletal mesh (FPS arms) that is the child of my camera, and I'm having an issue where when I shoot my gun the bullet only shoots directly forward wherever the actor is facing. it won't change elevation even if I move the camera up. any ideas?

steady briar
#

can anyone help me understand Role? ive read a bunch about it but... still really confused. trying to use an easy example, what is the pawn i control, what is the pawn another player controls, what is an ai pawn? also theres Local and Remote and it hurts my brain a bit...

viscid escarp
#

@steady briar pawn is like the character that you control. Player controller is the representation of the player inside the game. So, basically, like a chess match, the Player Controller is the player, and the pawn is any individual piece(king, queen, pawn, knight,bishop,rook). Don't know what do you mean about Local and Remote

steady briar
#

like GetLocalRole, GetRemoteRole. ROLE_AutonomousProxy, ROLE_SimulatedProxy, ROLE_Authority and whatnot

meager spade
#

An actor owned by a locally controller player, will be Autonomous Proxy, An Actor owned by the server will be Authority, an actor not locally controlled on other clients will be SimulatedProxy. A listenserver is both autonomous and authority. Local Role is the role this actor is to the local client.

#

some caveats, this is specifically to replicated actors

#

a client locally spawned actor will be authority to that client.

steady briar
#

@meager spade so, my pawn = Autonomous, other peoples pawn / ai Local (to me) is SimulatedProxy?

meager spade
#

so say dedicated server, the pawn you control is Autonomous

#

other clients Simulated

#

server Authority

steady briar
#

im trying to replicate somethings movement... autonomous seems to work but the simulated is screwing with me. i must be way off about something

#

and when would Remote role be useful?

cerulean escarp
#

@meager spade could you help me with my shooting issue? I've got a skele mesh that is the child of my player camera and it holds the weapon which contains the bullet spawn. the bullet spawn only follows the actor rotation for some reason, and completely ignores the camera rotation. this is all on a dedicated server

winged badger
#

wait, you put the skeletal mesh under a camera in component hierarchy?

worthy perch
#

Some people do that for first person arms.

winged badger
#

GetPlayerVIewPoint is replicated under the hood, on the PC

meager spade
#

dedicated server doesnt play animations

#

that is probably the reason

#

weapon could be in the wrong place shrug

pseudo iris
#

how do I make multiple rounds happen in a single session like in counter strike, where things reset?

#

does anyone know of a good resource for making multiplayer games in UE?

livid holly
#

the best resource I've found was the Udemy course, making multiplayer games with ue4 c++

#

not free though

pseudo iris
#

bought it

#

it's super cheap

#

the tutorial says it would really help to download Visual Assist

#

its a hundred dollars

#

it doesn't even have what i'm looking for particularly, might refund it

steady briar
#

u need to stick with things...

#

if u found something that did everything u wanted, then why bother doing it

#

its about learning concepts, not just the exact thing u want

#

multiplayer adds many layers of complication on top of things too

pseudo iris
#

if it involves a one hundred dollar plugin to follow along though

#

don't be condescending to me

meager spade
#

VAX has a free trial

#

30 days

steady briar
#

ive never used it. i think it might be handy but i dont think its required for anything. u can code in notepad

meager spade
#

its just an ehancement, not required.

pseudo iris
#

does anyone here know what to do when you want to start a new multiplayer match?

steady briar
#

thats so vague really

meager spade
#

call restart on GameMode?

pseudo iris
#

so in a deathmatch game

#

like this?

#

what kind of replication would it have?

gray scroll
#

is there a way to detect weapons on the floor?

cerulean escarp
#

overlap

pseudo iris
#

where do you set the state of the match, in the game mode or in the state?

cerulean escarp
#

@meager spade sorry for the late response, I checked the whole dedicated server running without anims and I had already fixed that with the optimization options under the skeletal mesh

#

I also found out that no matter what component I put hierarchally under the camera, it won't rotate with the camera

plush mist
#

Hi ! I am trying to travel server to a new map via GetWorld()->ServerTravel(MapName, true); but I can't . And I have a next log.
[2020.01.20-00.29.04:477][616]LogWorld: SeamlessTravel to: /Game/Maps/BlankMap
[2020.01.20-00.29.04:477][616]LogStreaming: Error: Couldn't find file for package /Game/Maps/Temp requested by async loading code. NameToLoad: /Game/Maps/Temp
[2020.01.20-00.29.04:477][616]LogStreaming: Error: This will hitch streaming because it ends up searching the disk instead of finding the file in the pak file.
[2020.01.20-00.29.04:477][616]LogStreaming: Error: Found 0 dependent packages...
Why its trying to find Temp Map ? If I ask to load BlankMap?

#

Simple Local MP Seamless travel...

hoary lark
#

I don't know much about it but from what little I do know (and until someone more knowledgeable comes along) seamless travel, by design, travels to a temporary map first. maybe you don't have that set or something. have you read the documentation on this?

plush mist
#

@hoary lark transition map if not specified will be empty. [UE DOC][Enabling Seamless Travel
To enable seamless travel, you need to setup a transition map. This is configured through the UGameMapsSettings::TransitionMap property. By default this property is empty, and if your game leaves this property empty, an empty map will be created for the transition map.]

#

my other projects work just fine without transition maps

hoary lark
#

well if I look this dumb I might as well try to go dumber. there is a setting under Project Settings > Packaging > (advanced dropdown) > List of maps to include in a packaged build ... is it necessary to add all of your maps to that?

cerulean escarp
#

figured out my issue for those who might need a solution to the same problem:
cameras are not replicated at all so if you have anything that is the child of a camera and needs to rotate, slap a spring arm as the parent of the camera and have the spring arm do the rotation

plush mist
#

@hoary lark thank you. It was silly me! I set transition map to None by editor but DefaultEngine.ini for some reasons not updated. When I edit it manualy all works just fine

hoary lark