#multiplayer

1 messages Β· Page 718 of 1

magic yoke
#

what is fd_bp

jovial pike
#

my door

#

front door (fd)

magic yoke
#

in thirdpersoncharacter

#

you activate dooropenclosed

#

you can pass "self" as a reference by giving dooropenclosed an input variable of thirdpersoncharacter

#

and use that

#

that way the player ref will be the player open/closing the door

#

(since it's a default class that should work without any shenanigans, characters are replicated innately by some under the hood code)

jovial pike
#

You lost me there

magic yoke
#

(use the appropriate character type for your program, thirdpersoncharacter I think it was)

#

@jovial pike I'm 99% sure that's what's causing your issue and doing this should fix you up

#

gotta run for dinner though

jovial pike
#

I understood that part, I just dont know how it would fit into my existing bp. thank you for your help πŸ™‚

twin juniper
#

Why is 4.27 bugging out for me with networking errors. Didn't change any of my replication code yet now this error is popping up: LogNetTraffic: Error: UActorChannel::ReadContentBlockHeader: Sub-object not in parent actor. Literally was not there the other day. And copy and move over to 5.0, its all good

magic yoke
jovial pike
#

Worked! Wow you earned that meal. πŸ˜‰ Thank you @magic yoke

magic yoke
jovial pike
upbeat basin
#

Is it possible to load a softobjptr on server and set on a static mesh component (for example) that replicates and expect it to be loaded and set on the clients as well as the new connections? Or do I need to set it ona replicated variable and make clients load and set on the OnRep function?

near bison
#

I have 3 maps - MainMenu, Lobby, Game

Would it be a smarter idea to make Lobby and Game 1 map, or is it better to keep them separate?

For now my lobby just shows all connected players, and leader can start game.
Later it will be picking skins etc

Suggestions?

pallid mesa
#

it will be a bit more coupled

#

for sure

#

are you using GAS by any chance?

near bison
#

might be hard to move things around

near bison
#

any suggsetions on how I can refactor my code to have those beginplays run only when traveling to. the game map?

pallid mesa
#

selecting skins and such can be just a series of IDs in your PlayerState that can be seamless travelled through CopyProperties

#

so you can do whatever you please as long as you understand how to seamless travel between maps work

near bison
#

Even when I don't use seamless travel, some of my beginplays in game map don't get called

pallid mesa
#

The Ancient demo implements non-gas input components, maybe you can take a look there πŸ˜„

pallid mesa
#

try to keep your stuff centric to the gameplay framework classes, there are handles now that get called on map travel

near bison
pallid mesa
near bison
pallid mesa
#

mh not too sure about BP's, did seamless travel in BP's but that was a while ago... I don't remember if there was a flag to activate it

near bison
#

but what am I even seamless traveling for? right now I don't want it

#

I just want open level to work without causing issues in my game scene

pallid mesa
#

what issues exactly?

near bison
#

some code in my game's gamestate class isn't running

pallid mesa
#

which code, where is it placed

near bison
#

beginplay

pallid mesa
#

and it doesn't call after traveling i suppose

#

so beginplay of your GS doesn't get called on map change

near bison
#

lemme check

#

well it is being called πŸ€”
it's something else, I'll gather some more info

pallid mesa
#

πŸ‘

silent valley
#

Hi, has anyone used LevelInstances in a multiplayer scenario?
We're trying them out but we're getting some issues around net name lookup...
LogNetPackageMap: Warning: InternalLoadObject: Unable to resolve object. FullNetGUIDPath: ...

silent valley
#

Oh I think I found a UDN thread that this is a bug fixed in Main...

near bison
#

Does OpenWorld() called in GameMode not get all the clients to stay connected to the same server?

latent heart
#

Are you sure the players aren't still travelling when you're checking playerstate count?

#

And probalby not

bitter oriole
near bison
#

will all that be overriden if the new map uses different game mode?

bitter oriole
#

Fairly sure you can seamless travel to a different game mode

latent heart
#

OpenMap, I think, will disconnect everyone and just locally open a new map.

near bison
#
{
    UWorld::SeamlessTravel("Overview_Demo");
}
#

Am I doing it right, now?

#

Or is the path probably wrong?

bitter oriole
#

Server calls ServerTravel

#

Clients will be traveled seamlessly

near bison
#

No I mean, is the arg correct?

#

"Overview_Demo" is the name of my map, will the code find it?

bitter oriole
#

Should probably use /Maps/ThatMap or something

near bison
bitter oriole
#

Yeah

near bison
bitter oriole
#

?

near bison
#

The map name, can I assign it as a hard reference somewhere? In case the path changes tomorrow

#

Cause I tried running the game after supplying an invalid path, and my editor crashed xD

bitter oriole
#

There are many ways to do that yes, use a soft ptr and set the map in Blueprint

near bison
#

What type is this? (i.e maps)

bitter oriole
#

ULevel IIRC

near bison
#

Also, can't assign my game level to to ULevel!!

#

@bitter oriole have you done this before? I'm completely clueless.

#

I mean where do I even start? First of all, ServerTravel() in C++ takes in an FString, so what's the point of me assigning a ULevel*?

bitter oriole
#

You wanted to have a safe path so obviously you'll want an asset reference

near bison
bitter oriole
#

Yes

near bison
bitter oriole
#

Soft object pointers will literally be the path

near bison
#

World->ServerTravel(PointerToGameMap.ToString());

So like this?

#

Where PointerToGameMap is a TSoftObjectPtr

kindred gazelle
#

What's the danger of an RPC not being set as reliable (when it should be)? Will the rpc sometimes not fire off depending on connection strength?

near bison
kindred gazelle
#

cool thanks guys

near bison
# bitter oriole Soft object pointers will literally *be* the path

Note that, like weak pointers, soft pointers will not prevent the target object from being garbage collected, so once loading is completed, it may be useful to 'pin' the object instance with a hard object pointer to keep the object instance in memory.
This doesn't sound very fun.

bitter oriole
#

You don't want the Blueprint referencing a level to force-load the entire level and all its assets in memory as soon as you spawn it

near bison
bitter oriole
#

Solution to what problem

#

You asked how to get a path that would be safe to use

#

I said use a soft pointer to a map so that renaming the map won't break the string

#

You do not want the level loaded

#

You just want a nice path

near bison
#
    @#'.)```

Last error I guess: Why is  the map being suffixed to the `.`?πŸ€”
Overview_Demo.Overview_Demo???
chrome bay
#

You'll need to parse it

#

Most of the time, it's better to just keep a list of map names somewhere

#

E.g. a custom developer settings file, or config file etc.

near bison
#

so, soft pointers are useless? 😦

chrome bay
#

Any path you keep is going to keep the path to the internal object

#

Or you can use FSoftObjectPath::GetAssetPathName() to get the actual asset path etc.

#

Rather than the package + subobject path

#

Or GetAssetPathString()

#

I mean you do need to be very careful here. If you load that soft pointer, the entire level and it's content will load

near bison
chrome bay
#

The soft pointer can just be treated like a path, that's fine

near bison
#

World->ServerTravel("/path/to/Maps/Overview_Demo");

This is working much much better.

chrome bay
#

But yeah, just don't load it yourself by accident, just use it for paths

near bison
#

Is that because Unreal is caching something in PIE when I directly my game level?

chrome bay
#

Well it's loading the level

#

If you just play in PIE, the existing PIE world is reused

near bison
#

gotcha

neon atlas
#

So, I've tested my Dedicated server for the first time, since upgrading to UE5

Issue is that it no longer works

It took a while to connect the client and server, but once the connection was established, the server crashed and the live coding console spammed a lot of

And then ended in:

Call to function NtWriteVirtualMemory in module ntdll.dll failed. Error: 0x8000000D

Call to function NtResumeProcess in module ntdll.dll failed. Error: 0xC000010A

Successfully installed 2 patches (0.000s)
Registering module E:\UnrealEngine-5.0.0-release\Engine\Binaries\Win64\UnrealEditor-LiveCoding.dll (PID: 14596)

Call to function NtSuspendProcess in module ntdll.dll failed. Error: 0xC000010A

Call to function NtReadVirtualMemory in module ntdll.dll failed. Error: 0x8000000D

Call to function NtWriteVirtualMemory in module ntdll.dll failed. Error: 0x8000000D

Call to function NtResumeProcess in module ntdll.dll failed. Error: 0xC000010A```

I checked the crash log, and some assertion failed, I'm not too fluent in Unreal debugging though πŸ‘€ 

https://pastebin.com/qzQtvjWe
chrome bay
#

Don't use live coding would be the obvious solution I'd think

#

I mean it's risky at the best of times let alone while you've got a network game running...

meager fable
#

Hi I'm trying to replicate an actor after spawning like this but the clients aren't getting it. Is it possible to do this?

neon atlas
near bison
#

does anyone know if it';s possible to make dedicated server builds without source?

#

like, can i build it somewhere in the cloud? jenkins or gameci or something?

graceful flame
near bison
#

and thats 200gb

#

and my mac has like 200gb left

#

I was wondering if I pushed my code to VCS and that triggered a build on the cloud (if it has the right settings), and then give me an exe

#

btw what's the average size of an unreal server build for a very small game?

#

how big is the binary itself?

graceful flame
#

The server build target is usually smaller than the client build, but there's no average size it all depends on how large and complex your game is.

near bison
#

it's really small

#

it's a board game lol

#

server build will have literally ntohing. no physics computations, nothingf. just like 15 repnotifies to worry about and a handful of client RPCs

#

if this was a non unreal project I'm literally staring at KBs (if it was a websocket server build)

graceful flame
#

My server build is about half the size of my game build

near bison
#

what's your game build size

graceful flame
#

6gb

near bison
#

and what kinda game is it?

near bison
graceful flame
#

capture the flag

near bison
#

why is it half? unreal server build won't include asset data like meshes, lighting etc right?

graceful flame
#

yea, its a headless build meaning there's no need to render out all the gpu stuff, it just handles the logic

#

its a exe that runs in a terminal window

near bison
#

i know that

#

so why does that make it 3gb

graceful flame
near bison
#

i klnow

#

that's not what I'm asking

graceful flame
#

So you might be out of luck trying to find a workaround

near bison
#

it sounds like your server build is unoptimized

near bison
#

the source build can be on another machine somewhere, that's the power of ci/cd

graceful flame
#

either way you still need a source build

near bison
#

use an external service

#

playfab or somethign similar

graceful flame
#

@near bison You could try checking out Render Farms, but I suspect they are mostly used for remote rendering of GPU intensive scenes and may not necessarily be used for source builds.

kindred gazelle
#

Might I ask why you call the server and do a multicast? Because it sounds like the server call isn't working properly and is just doing a multicast (which would do exactly whats happening here: clients execute locally, server executes all)

#

You could do that, but it should work just as well (if not better) by using just a server call from the player, otherwise a multicast will create an issue where any players that join late will not know that it has been equipped so it wont be equipped for them

#

you probably don't need the second linetrace since you still have the info from the first one, but yeah. Linetrace which does a server rpc in the player which then calls the interact function.

#

If the server rpc is done on the actor you're interacting with, it likely won't be called on the server since the client won't have ownership of it

#

yeah okay, never done it that way but I'm sure it would work

#

Wait a component on the player or the actor?

#

Assuming everything is fine on the component, can you send a screenshot of the actor's bp? I'm really not sure what the issue is

pallid mesa
#

what's going on Bib?

#

aham πŸ˜„ can I see code??

kindred gazelle
pallid mesa
#

let me put the pieces of the puzzle alltogether Bib

#

oh btw Bib, you don't call the _Implementation() one

#

you call RS_InteractTrace()

#

RS_ I suppose it means server

#

Usually by convention you'd call it

#

ServerInteractTrace()

#

and make the change I mentioned

#

instead of calling the _Implementation() one

#

call RS_InteractTrace()

#

and once that's done, I'm missing some bits of the server impl to say.. breakpointing will definitely help Bib

#

yes

#

x'D

#

okay so that was it then

#

yes, you don't call the _Implementation() directly

#

Unfortunately Bib, haven't dug into the effects on calling directly the _Implementation() one, just don't 🀣

#

I don't think it's something worth researching unless you want to know how UHT handles this

#

one sec

grizzled stirrup
#

Character::IsLocallyControlled should return true for AI characters on the server right? Even if it's a listen server

pallid mesa
#

but so far the interesting bit is IsLocalController

#

that can be found in AController

glossy kettle
#

nice blog @pallid mesa 😊

pallid mesa
#

thanks πŸ˜„

glossy kettle
#

tho i struggle to imagine there are ppl out there who do not implement correct stateful replication

#

is this common πŸ€”

pallid mesa
#

way more than you can imagine

#

that's why I did the blog post, at least once or twice everyday around here

glossy kettle
#

the closest i got to grief was a COND_OwnerOnly on a rep var on a pseudo auto proxy with a manual net owner

#

still wasnt replicating properly to the overriden owner

pallid mesa
#

pseudo auto proxy sounds fun

glossy kettle
#

yeah it wasn't a good time

pallid mesa
#

there are going to be some quality releases blog post soon by the community and for the community

glossy kettle
#

πŸ™ blessed

pallid mesa
#

we are lucky to be in such a good place with people willing to share

near bison
#

(jk I know nothing in Unreal)

#

plz make a guide on how to build dedicated servers somewhere in the cloud without downloading a 200gb source build

#

XD

pallid mesa
#

hahaha, I'm so sorry, it's the price to pay

#

although saying 200gb is unfair 🀣

near bison
glossy kettle
#

data ingress isn't an issue tho

#

storing the artefacts/pch etc is where they get U

#

unless you know the tricks

near bison
#

btw, for my (small) mobile board game that i built in unreal, what's a good build size for my server?

#

the gmae has literally nothing. like 20 rpcs and 10 repvars

pallid mesa
glossy kettle
pallid mesa
glossy kettle
#

noo my dev ops side hustles

near bison
glossy kettle
#

tbh I don't think I can ethically publish half of the cloud infra stuff publicly like that

#

it would kill like 10k jobs in UE

near bison
graceful flame
#

Why not just buy an external hard drive? You're probably going to need a lot more than 200gb in the long run.

near bison
#

i'm a big believer in smol software πŸ™‚

latent heart
#

Epic isn't.

graceful flame
#

Especially if you plan on using any of the megascans

near bison
#

i will never use any of that

#

I will build the whole game in Rider, unit test everything, keep my scenes really small, download low poly packs

#

and ship πŸ™‚

#

the less I can open unreal editor the better πŸ™‚

near bison
glossy kettle
#

better to not risk it..

#

I don't want half of the dev ops community out for me..

graceful flame
#

Just release an ebook / course under a pseudo name? Nobody will know...

vivid seal
#

my fastarray code looks like this:

USTRUCT()
struct FDamagingEventItem : public FFastArraySerializerItem
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY()
    FDamagingEvent DamageEvent;
    UPROPERTY()
    float Time;

    void PostReplicatedAdd(const struct FDamagingEventArray& InArraySerializer);
};

USTRUCT()
struct FDamagingEventArray : public FFastArraySerializer
{
    GENERATED_USTRUCT_BODY()

    UPROPERTY()
    TArray<FDamagingEventItem> Items;
    UPROPERTY(NotReplicated)
    class UHealthAttributeSet* OwningHealthSet;
    UPROPERTY(NotReplicated)
    class UDamageAttributeSet* OwningDamageSet;

    bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms)
    {
        return FFastArraySerializer::FastArrayDeltaSerialize<FDamagingEventItem, FDamagingEventArray>(Items, DeltaParms, *this);
    }

    void OnAdded(const FDamagingEvent& NewEvent, const float EventTime) const;
};

template<>
struct TStructOpsTypeTraits<FDamagingEventArray> : public TStructOpsTypeTraitsBase2<FDamagingEventArray>
{
    enum
    {
        WithNetDeltaSerializer = true,
    };
};
young kestrel
#

Regarding Networked movement (extending move data) I still kind of don't know what to do exactly.

What do I need to do to get the exact results, as if I used CompressedFlags? I have dodging, sprinting, wallrunning and walljumping, now I want to add climbing and sliding, but how exactly can I save the moves and how do I check for those flags? (like "bClimbingKeyIsDown")

Not even sure, if it actually works or not. Because currently I still use the compressed flags I have.

neon mango
#

My event on network error for a timeout never fires. IN fact client side no network events fire when the server goes down.

river dome
#

Hey guys i am having some issues with multiplayer replication on a custom class that ive created. The client can see the server moving around and the server can see the client but the client can't actually move it can only look around but the server doesnt seem to see anything other than the character

#

Anyone have an idea what this might be? I have overridden the possedby function could that be the issue?:

void ABBCharacter::PossessedBy(AController* NewController)
{
//Server GAS Init

if (AbilitySystemComponent)
{
    AbilitySystemComponent->InitAbilityActorInfo(this, this);
    AddStartupGameplayAbilities();
}

}

#

fixed it by adding Super sorry

winged badger
#

formats them nicely like this

winged badger
lost inlet
#

a tiny resized screenshot was definitely the best way to share those errors

winged badger
#

it works if you hit the link instead of the pic

#

fastarrays module is engine, so its not build.cs

#

and it seems its running linker errors from included NetSerialization.h header

#

got Networking included in your build.cs?

vivid seal
vivid seal
obsidian cargo
#

IIRC I had to at NetCore to my Build.cs for fastarrays. I'm on 4.27

vivid seal
#

How would I figure that out, for future reference?

#

Like how do you know what the name of the module a header is in needs to be, is it the folder name?

winged badger
#

you can google the unreal engine API doc

#

each class has a module listed

#

but Networking was a guess, as all of them come up as Engine module

#

did it even work?

vivid seal
#

Can’t check, at work 😦

reef badge
#

How bad of an idea was to write a game for single player to later on decide to convert it into multiplayer? Am I facing nights without sleep or it’s not that bad?

young kestrel
#

I did that. And I just began from scratch. It was easier... Somewhat.

#

Especially as I had lots of advanced movement stuff.

low helm
#

For most types of games, converting to multiplayer takes so much work that it is better to do a full restart, which is not necessarily as bad as it sounds

reef badge
#

Is there like a YouTube video or something that covers all of that?

low helm
#

No

#

It is an entire Discipline

#

There is a PDF compendium somewhere that someone wrote that’s pretty good

#

But I’m not home right now

reef badge
#

Fair

#

I mean I have not spent that much time on the project yet. Only my first weak

winged badger
#

the how bad an idea basically depends on how familiar are you with unreal

#

its best not to tackle unreal basics parallel to unreal networking

plain spade
#

I'm having some trouble with multicasting, when the interface event gets called on a client character, the MC print string works fine on all clients and server, but when the interface event gets fired off of the server character, the MC print string only shows the server

gleaming kite
#

Is it possible to do well replicated curve based movement? (Using animation curves to drive players speed and movement)

winged badger
#

it is

#

you'll want GameplayTasks with root motion

winged badger
#

when you call t with server character

#

Server RPC called on server is just a normal function

#

other options include this being say, a PlayerController and All players being all 2 players

gleaming kite
winged badger
#

we have a jetpack skill that uses root motion, predicted movement and uses a float curve to manipulate height

#

and its smooth

gleaming kite
#

interesting, thank you

winged badger
#

i did not write that system though, so i can't give you much in the way of details off the top of my head

azure knoll
#

Hey so when I push begin play only one of my character's camera works and the other is like under the map

winged badger
#

odds are the other controller doesn't even have a pawn, but is instead using a camera from playerstart position

gleaming kite
winged badger
#

GAS documentation might have something on it

winged badger
#

it is a system GAS uses

#

yeah, that looks like 2nd controller never possessed the pawn

azure knoll
#

so how can i fix this?

winged badger
#

i have no idea what you did, so i really can't tell

gleaming kite
azure knoll
plain spade
winged badger
#

what class is that in?

thin stratus
#

A Weapon I guess

#

Probably not owned by any client

winged badger
#

im guessing PC

#

from the symtoms

thin stratus
#

So it drops all RPCs

winged badger
#

as the multicast is not visible on client player

thin stratus
#

Then it's probably not even marked as replicated?

#

The target on the rpcs is weapon

winged badger
#

i missed that

thin stratus
#

My guess is either not replicated or additionally owned by the server

winged badger
#

it would have to be replicated for client shot to work

thin stratus
#

That would explain both server RPC and multicast

#

Failing*

winged badger
#

but servers weapon not relevant to the client

plain spade
#

It's called on an actor class spawned in by individual character classes

thin stratus
#

For server rpcs it has to be owned by that client

#

For multicast it has to be marked as replicated

plain spade
#

Class is indeed marked as replicated

winged badger
thin stratus
#

Then the multicast should work at least

#

Uff

#

Maybe timing issue?

winged badger
plain spade
#

No

winged badger
#

there is an illuminati eye bottom right of the outliner in PIE

#

switch to client world

#

and see if both character's weapons are present

plain spade
#

This eye?

#

Bottom Right?

#

Oh I see

summer tide
#

So I've a player possessing and attaching to another character. While possessed, if I play anim montage or anim sequence via blueprint, the player get removed from possession and get detached. Is this collision or replication issue?

plain spade
winged badger
#

try to turn on always relevant on the weapon, to see if its a relevancy issue

plain spade
#

Both guns are there, always relevant on the weapon spawns in a third gun on the server

winged badger
#

begs the question, how do you spawn the weapon?

plain spade
#

Both child actors are of the weapon base class

azure knoll
#

hey guys why does my character still replicate even though all replication settings are off

plain spade
compact talon
#

Using seamless transition and I was wondering if anybody knew a good source of knowledge for having everything transition in a good looking fashion to the client.

For example going from my lobby > transition level > actual level to the client looks like lobby, flash of black (transition level), then the next level loads (not everything is loaded in immediately so props may be missing), their camera defaults to 0,0,0 and then they are given a character and it looks good again.

I would rather have stuff like the camera defaulting to an angle of my choice, instead of just 0,0,0. Also having the player only actually spawn in when everybody has finished loading the level etc.

I am not really sure what I am looking for, I tried searching stuff along the lines of changing default camera, and waiting for players to load but I am not really finding much.

molten matrix
#

I’m working on building my own client prediction for a pawn that is not a character. Right now, the movement/location of the pawn is marked as replicated, but if I start going down the path of doing client side prediction I’m guessing I will have to stop replicating the movement and instead handle it manually using the prediction logic so that I prevent rubber banding. Does that sound right?

plain spade
#

Thank you for trying to help me out though, sorry

short veldt
#

I still have a problem with the image transfer of the object. When the room owner (red hand) picks up the object, the other hands can see it, but when the other hand picks up the item, the room owner cannot. Is there a problem with the object or with the character?https://blueprintue.com/blueprint/gkohxlku/ - https://blueprintue.com/blueprint/_7dl5qvl/ - https://disk.yandex.com.tr/d/fMkX9dyiDFkSlQ

scarlet turtle
#

If I have a ball that is my player, its using "add impulse" for movement like the roll a ball template. But going through making it for multiplayer doesn't seem to work for me, The host seems fine but the clients when you hit forward they just rocket off the map at mach 10.

vivid seal
#

@winged badger from the issue earlier of getting linker errors when trying to use FastArraySerializer, it looks like the module is called "NetCore" and adding it to build.cs fixed the issue, thanks for the help!

twin juniper
#

I want to ask something related to Unreal engine netcode. Do I need to deploy more than one GameServer to start multiple game sessions? Let there be 100 groups of four people playing independently of each other in my game. They are each in their own world. What kind of deployment model should I consider for such a structure?

pallid mesa
#

one dc server binary per server instance

#

u can hold many DC servers in the same physical machine

#

can even do core allocation to constraint cpu usage

static flare
#

I have a sort of "singleton" actor that is spawned immediately when the server/host starts playing (and is also owned by the server), and I want it to also be spawned for all clients that will be joining the game later.
Since it's an integral part of the game/communication I'm currently spawning it in "GameState::HandleBeginPlay" and storing the spawned instance as UPROPERTY(Replicated) AMyActor*.. in the GameState.
However, when other clients connect to the game, this instance does not exist for them.
I'm obviously not well-traversed in the world of replication..
Per now, there's no code running on the clients to actually spawn the actor, but I thought having the variable replicated in the GameState would automagically sort that for me since they all have a copy of the GameState, but it seems not.
Do I need to perform actual GetWorld()->Spawn..-code to spawn the actor for all clients when they connect to the game? If so, what about ownership..?

twin juniper
#

In this case, I can put a load balancer on it and deploy it more than once.

chrome bay
#

@static flare you can't guarantee the actor will have replicated by the time you need it, there's no way around that. What you can do is setup an event somewhere that other objects can bind to, and it can push that event when it's received

#

The same rules are true for any replicated actor. You're not even guaranteed to receive the Game State immediately

pallid mesa
chrome bay
#

The actor itself needs to be replicated btw

#

You're replicating a reference to the actor there, not the actor itself

static flare
pallid mesa
#

replicate the actor and when the actor executes begin play in the client, register it

#

can do it generic with world subsystemsℒ️ if it's inherent to your game

twin juniper
pallid mesa
#

well it's budget dependent

#

you can automate server deployment, like AWS does with a high degree of controllability

#

but so far the first step is to monitor what you need

#

and to aim for less if possible, as an universal solution

#

resources cost money

#

in our amateur-ish project we rented some nitrado servers in different regions

#

and slapped 5 dc binaries in each, all by hand

#

we had a person in charge of setting these up and doing some basic mantainance

#

@twin juniper

chrome bay
#

But just bear in mind that it will take an arbitrary amount of time for that actor to resolve client-side

twin juniper
#

According to the power of the server, for example, you can play 1000 rooms with 5dc binary?

pallid mesa
#

each binary handles one gamemode

#

so one room, per se.

twin juniper
#

Wait a minute, that's too many servers

pallid mesa
#

in our case we had 5 dc binaries per server

#

and each dc binary handled a 40 player TDM match

twin juniper
#

Ah okay

#

Thats what I mean

pallid mesa
#

by server i mean a physical server PC

twin juniper
#

Each dc binary is developed to manage more than one match.

pallid mesa
#

no

#

each dc binary is a match

#

so each pc server handles 5 matches

twin juniper
#

Did you consider this while writing the server code? Or is there a way to do this automatically in Unreal?

pallid mesa
#

meaning that if we got 3 pc servers

#

we got 15 matches

#

no, as I said, you just generate the dc server binary

#

put it in the pc server

#

execute it

#

and profit

#

if you want 5 dc servers

#

u put 5 dc server binaries in the server

#

execute them and profit

#

haha

#

it's simple

#

so each server PC handled 5 tdm matches

#

meaning 5 dc server binaries running in the same PC

#

it's just an executable

#

a program u run

twin juniper
#

i understand but how do you make a dc have more than one match

pallid mesa
#

I didn't

nova wasp
#

It's literally running multiple instances of the engine

twin juniper
nova wasp
#

Not a specific unreal thing

#

Afaik

pallid mesa
#

no

#

40 players match

#

hahaha

#

each dc server hosts a 40 players TDM match

#

not 40 matches x'DD

twin juniper
#

ah, sorry πŸ˜„

#

This is something related to your game.

pallid mesa
#

no worries haha

#

yes

#

it was -

twin juniper
#

I was talking about a scenario with lots of small rooms

#

My bad

#

I didnt told this

pallid mesa
#

i mean... u'll have to measure how many rooms u can put in a single dc server binary

#

so measure, profile, monitor

#

and constraint it to some resources if you can

twin juniper
#

Another option is to deploy a container for each room with docker

#

I can limit ram and cpu usage with Docker

pallid mesa
#

not recommended

#

I'd use docker to automatize server deployment with a high level abstraction

#

but one dc server binary for many rooms with limited capacity looks like a nice idea

#

then when dc server binary is full

#

deploy another dc server binary

twin juniper
#

Thanks for help. I got a clear idea in my head

young kestrel
static flare
chrome bay
#

no

#

Totes impossible

static flare
#

gotcha

#

Why does UPROPERTY(Replicated) and UPROPERTY(ReplicatedUsing=...) behave very differently?
I haven't added anything for GetLifetimeReplicatedProps or anything yet, I just spawned an actor and stored it in a UPROPERTY(Replicated), and nothing replicated (I assumed because I'm missing GetLifetimeReplicatedProps..). But then I changed it to ReplicatedUsing=OnRep... and it replicated perfectly..

chrome bay
#

It has to be replicated in GetLifetimeReplicatedProps()

#

Otherwise you'll get a warning in the log

#

AFAIK they shouldn't be any different in that aspect

static flare
#

Yeah I will, I just noticed that it did this and thought it was weird. It's 100% reproducible, but could perhaps still be a race condition of some sort due to the onrep I guess.. Weird.

chrome bay
#

Well GetLifetimeReplicatedProps() is called once on the class when a new replicator is created

#

Might just be some weird fluke

#

or might explain why it's called ReplicatedUsing.. would explain that mystery

lone steeple
#

Hello, I have a pet that follows the player which is controlled by an AI controller. It works in singleplayer, but now I'm trying to convert it to multiplayer.

I've managed to spawn the pet on each player and I'm starting to see the scope of this multiplayer conversion... I'm basically already stuck and concerned that this pet following system is too complex (I can also possess the pet and fly around) and that it's outside of my capabilities.

Besides watching videos on replication, I have no practical experience with multiplayer implementations. What would you guys recommend me to do? Any advice would be greatly appreciated!

chrome bay
#

So first of all, the "Pet" has to be a replicated pawn actor spawned server-side. All AI logic etc. should generally only run server-side, clients will just get position/rotation etc. updates about that pawn.

#

Possessing it is another ball-game. You will need the player to possess the "pet" server-side, then they'll be able to control it. Hopefully you are using the character movement component and if so, all movement etc. should just work. If not, you might want to consider doing so.

lone steeple
#

If I understand right, the pet is using floatingpawnmovement

#

The major thing I'm struggling to wrap my head around is which variables and such I'd have to replicate

lone steeple
#

This is in the thirdpersoncharacter bp and called on begin play. Is this right so far?

chrome bay
#

Should be fine yep, the pet actor itself should be replicated

#

The only movement component with any proper multiplayer support is character movement

lone steeple
#

oh...

chrome bay
#

You can make it work for others, but realistically it needs to be done in C++. Options in BP are pretty limited

#

And it is complex to do from scratch, which is why most people just hack character movement until it suits their needs

lone steeple
#

This is mostly relevant for the possession part right?

#

Like, if we for the time being ignore the possession system, this wouldn't necessarily be relevant I guess

#

I'd be fine with just restricting the possession system for now until a future update, but I'd really need the following part to work

chrome bay
#

If the following part is just AI moving it around that should be fine

#

It might jitter around a bit, you may want to implement some smoothing somehow

#

And be sure to test with real-world conditions like lag, jitter and packet loss

lone steeple
#

Yeah, I'll keep that in mind if I ever get that far lol

#

I think the setting of the Player REF variable with the get instigator node seems to work, beyond that I'm pretty much clueless

#

Idk if get controlled pawn works in this workflow, or if I need to replicate the set variables and so on...

chrome bay
#

Well the problem is that the Pet actor might replicate before the Character to some clients (even the owner), so there's a chance "Instigator" will return null if you do that too early

#

You can get around this in C++ by using the OnRep callbacks for those properties, but they aren't available in BP

#

So you may need to replicate your own references to the players' pet, using RepNotifies to set other properties from that etc.

#

All actors replicate individually and any actor could be received before the other, regardless of how they're spawned etc. The MP code has to be resilient to that to avoid such race conditions

#

This is generally much more difficult to deal with in BP because you don't have access to the callbacks for existing references

lone steeple
#

Do most multiplayer projects use c++?

chrome bay
#

To be honest any reasonable MP project should expect to have to use some C++

#

BP has only a fraction of the tools available

#

And that's unlikely to change

#

Not to say you can't do it, I'm sure some people have managed - but as someone whose only ever really worked on MP, I wouldn't advise it

lone steeple
#

I haven't looked into C++ and unreal yet, is it a drastic change to a project or can the project be mostly the same as is with some added C++ stuff... idk if that makes sense

#

Like, if I just have to create a small file and add it (kinda like a bp) then that's okay with me, but I don't know what that looks like in reality

half umbra
#

which means Reliable Check Box at Custom Event

chrome bay
#

Yeah you can add C++ in the background and slowly replace BP parts for sure

#

Generally though if you're going to do MP, it's worth starting with it from the get-go. Getting things working step-by-step. Generally more work to convert a SP project over because you end up throwing a lot out

chrome bay
half umbra
#

anything more? some example

chrome bay
#

That's all it means

half umbra
#

when is it best to use it?

chrome bay
#

When the RPC has to be received for the game to function

#

So it depends on what you're doing with it. Firing a weapon? Probably needs to be reliable. Spawning an effect? Can probably be unreliable.

half umbra
#

aaa, I understand ;p thanks

chrome bay
#

Just don't call reliables from tick or something like that

#

Apart from being more expensive generally, you can flood it and the client will get kicked.

half umbra
#

understand

#

thx

lone steeple
# chrome bay Generally though if you're going to do MP, it's worth starting with it from the ...

Yeah, I spent the last few weeks cleaning up my project to the point where it's a very clean (for my skill level atleast) 1.0 singleplayer version that I can build up on. Currently I have only two major features and the pet is one of those.

I plan on adding quite a few basic rpg systems, like fighting enemies, loot, inventory and stuff like that, but I first wanted to create a clean foundation to work off of. Which is why I'm trying to convert everything to multiplayer compatible now, before I start working on the rpg elements. Hope that makes sense...

chrome bay
#

Yep for sure

lone steeple
#

I really hope that I'm not setting myself up for failure with this, considering that I'm a solo dev and even singleplayer systems are anything but trivial to implement for me lol

half umbra
#

I'm looking for someone who can easily tell me the most important rules related to this πŸ™‚
when it comes to calculations, health, stamina or some important variables, this must be done on the server and then sent to the clients
and I don't really know how to do it properly
or when I create a timer that subtracts some health from time to time, this timer must also be made on the server, I guess
when it comes to variables and changing their values ​​on the server, it is probably enough that after Event Run On Server I will do Call to Event Multicast?
but when it comes to something that is visible to other players, such as Sprint, in order for it to work properly on the client, without any lags, then need to be done also local?
I don't know if I mean it right, could you explain it better to me, or write if I understand correctly?

chrome bay
#

MP is absolutely a lot more difficult. Probably 5-10x the raw amount of time/work required, the major difficulties come from understanding how it really works and being able to design for it/problem solve. If it's your first game or something, I'd stick to single player

chrome bay
#

As for sprint, realistically it's only possible to do it properly in C++.

#

You can fudge it in BP, but it's not flawless

#

There are probably a plethora of tuts out there to hack together an MP sprint in BP

half umbra
#

I'm learning and would like to know what to avoid in multiplayer games

#

and how to do it correctly

chrome bay
#

Check the pins in this channel

#

If you want one golden rule, it's this:

  • State = Replicated Properties
  • One-Shot Events = RPCs (Custom Events in BP)
lone steeple
# chrome bay MP is absolutely a lot more difficult. Probably 5-10x the raw amount of time/wor...

The thing is, I'm committed to this particular project long term and even if I ignore the whole rpg side of things, multiplayer still feels like something I'll have to do eventually.

In it's most basic form, this project is a virtual art museum with a heavy focus on community. I plan on hosting events and stuff like that within it. They could be singleplayer, but multiplayer would allow to build a much tighter community.

So, I'm in a weird spot... Either I take the dive now while I still only have a few systems to convert, or screw myself in the future. Idk, I'm really torn on it.

chrome quest
#

Almost every game in this age ends up having multiplayer elements which can be a pain to hack on when the game is fully fleshed out as single player.

woven basin
lone steeple
# chrome quest Almost every game in this age ends up having multiplayer elements which can be a...

Makes sense, but practically speaking, if you have zero gamedev experience it's already hard as hell to implement singleplayer systems properly. So starting with multiplayer, ups the barrier of entry right away to a very unreachable level for most. Atleast that's my experience of it.

Which is why I setup my museum in a very static way, where I only built the things that would work in either singleplayer or multiplayer, like displaying statues/paintings and such. So, the core of it is fine either way. The difficult thing now is starting the process of learning multiplayer implementations with the few things that are busted, like the pet system that I have.

That system was the most recent thing I implemented and I had to first see if I can even pull it off in singleplayer.

Now I'm at the point where I have to start working on more complex systems that wouldn't work in singleplayer and multiplayer right away, so this is the point where I have to dive in. Hope that explains why I haven't done any multiplayer stuff yet.

young kestrel
winged badger
#

yes, blueprint doesn't have any tools to recover from packet loss or high variance

chrome quest
winged badger
#

literally only networking tools you have is blueprints are:
1 - RPCs
2 - Marking variable replicated, OnRep is also a nasty hack (property changed, not replication callback)
3 - basic replication settings on the Actor
4 - dormancy

#

which is less then 10% of stuff available in c++

lone steeple
#

Oh man, I'm so screwed lol

#

Solo game dev is quite the journey to say the least

young kestrel
#

It is. But it's still somewhat fun. Until you reach the point where art assets are needed and you don't want to create some kind of shovelware.

#

Or you get stuck because UE documentation lacks a lot at more niche parts.

winged badger
#

thatr works without c++?

chrome quest
#

Oh blueprints πŸ˜…

#

I gave up on any serious multiplayer there

#

Works great mind you, but I do more c++

young kestrel
chrome bay
#

That can only be done in CPP

#

BP will usually get you by well enough though

#

But if it was a competitive game or something, BP wouldn't cut the mustard

somber bluff
#

Hey guys, I've setup a 'Set Overhead Nametag from Main Menu' System. Currently the host can type their name in a textbox from the Main Menu, hit start server and it'll load the level and be displayed correctly clients side. However when another player types in their name and hits joins server it overwrites the hosts 'Player Name' with their own text and both the host and client can only themselves as the most recent set 'Player Name' while the other players are unset (which is a replication issue?). Do I use an integer to differentiate the players by hooking it into the Save Game Slot & Load Game Slot nodes to make them unique?

Image 1. Main Menu Widget Button Gets Text Input and sets 'Player Name' (saved within a SaveGameObject)
Image 2. Level runs 'Set Player Name' function which runs a custom event (PlayerState)..
Image 3. Custom event makes the 'Player Name' variable RepNoteworthy, then (Loads the Saved Variable)

visual urchin
#

Did anyone buy a Multiplayer Template on Marketplace?

#

I'm thinking of buying one, cause no matter what I try, nothing works. (v4.27.2)

winged badger
somber bluff
winged badger
#

aside from being able to clog the reliable buffer, reliable serves no purpose whatsoever when sent on Tick

#

because if it was unreliable, it would just keep resending data before the client had any idea reliable RPC failed and had to be resent

#

second point, GetPlayerPawn/Controller/Character[0] is generally dangerous in MP

#

problem being that the index 0 is interpreted differently on different machines

somber bluff
#

Yeah I know that you're not meant to do that, I just needed to fill the node for it to work

#

As for differentiating players

winged badger
#

simplest working version of this

#

PlayerState -> BeginPlay -> if (Cast GetOwner to PlayerController IsLocalController) -> Load Save -> Send ServerSetPlayerName RPC with name as argument

#

then display the name in pawn's playerstate for each of the pawns separately

somber bluff
#

Cool I'll definitely give that a go

#

Thanks

winged badger
#

im not sure if PlayerState can set PlayerName in BP on whatever engine version you're using

#

but GameMode has a function to rename players

somber bluff
#

@winged badger something along the lines?

marble fox
#

Alright i just have a question, it goes through the hasauthority() but doesnt spawn particles and replicate them to all the clients?

winged badger
# somber bluff

no, owner of the PlayerState is the PlayerController, not PlayerPawn

#

that cast will always fail

somber bluff
#

sorry haha I'm new to all of this

winged badger
#

also, you're creating widgets on server only

#

which is a fail

#

also, this is not normal BeginPlay

#

executes on Server doesn't belong there

marble fox
#

Theres really no need to make ui on the server

somber bluff
#

Yeah I created a custom event instead because I figured they also fire off on beginplay aswell

near bison
#

Any suggestions on how I can listen to my players joining my Lobby level? Right now in OnPostLogin and OnLogout events, I add to a replicated Controllers list in my GameState. in the OnRep I do my required UI changes. Any better suggestions?

marble fox
#

It goes through the HasAuthority() but none of the MuzzleFX or FireSound and Animation replicates, Please help!

chrome bay
#

Why would it replicate?

#

Sounds, FX etc. are created locally only and for good reason

marble fox
#

Well, All the other clients should hear the gun and also see the muzzleflash

#
  • My self should also see it, Since rn i dont
chrome quest
#

Not really replication

#

It'll be a multicast.

marble fox
#

ahhh

chrome quest
#

Extract all the VFX and SFX stuff into a multicast function.

marble fox
#

πŸ‘

drowsy pine
#

Hey! I wanna make a hot potato styled game, and but i don't know how to check if the bomb hit another player, and if the bomb does, how do I know who threw it?

#

or I know how the other player equips it, but don't know how to make the player who threw it loose it's tag

young kestrel
chrome quest
#

Or they don't have any?

dark edge
#

Send over a character/pawn/actor reference on interact

#

That way the door knows what's doing the interacting.

#

Then you can choose which direction to open.

pallid mesa
#

what's the state of chaos vehicles in multiplayer?

graceful flame
#

Chaotic?

chrome bay
#

I mean, what's the state of chaos vehicles

#

amiright

young kestrel
# chrome quest Have you checked the source for the original implementations of those functions?

The thing is, I don't understand what I need to change at all. What do I need to add in those functions to get the flags from my derived classes? The source didn't help me with understanding what I need to change. And there are no examples which extend the move data.

Either because no one needed to do that, no one understood what do or no one was willing to make some example project.

If I had any idea what exactly I'd need to do to make it work, I'd actually do some kind of documentation about it, so I can use it later again.

dark edge
pallid mesa
chrome quest
drowsy pine
dark edge
drowsy pine
#

yeah but do I get display name? or id? and if so how do I get the Player ID¨?

dark edge
#

Why are you using tags? The bomb can just know who's holding it

drowsy pine
#

I think I'll just pass the bomb on with a line trace, since having the player throw the bomb and other people getting hit by it and all that jazz just over complicates stuff

dark edge
#

Okay, that has nothing to do with what you're asking about though.

drowsy pine
#

no ik, but I thnk I'll change the way they pass the bomb

#

since having the bomb being thrown is way harder (atleast for me) to make

compact talon
#

If I want an event to only happen when everybody has finished loading with seamless transition, am I supposed to hold them in the transition level until the next level has finished loading, or do I just add a loading screen to the actual level?

#

With seamless transition they get a frame of black (transition level), then they see the actual level as it is loading in objects. I would rather hold them in a loading screen while all players load and then have the actual level run

pallid mesa
#

look at Lyra for example

#

they do that

compact talon
#

They do which, hold players in the transition level while loading, or have a loading screen in the actual level while players load?

pallid mesa
#

not totally sure which technique is employed but the loading screen keeps active until a series of rules are accomplished

#

I recommend you to look right away

compact talon
#

I see, do you know where in particular to look? I assume the gamemode or something? The lyra project is very bulky and I am new to UE

pallid mesa
#

ouch... just removed lyra from my computer, would do a fast exploration to point you were to look

#

but I have to download it yet again

#

😬

compact talon
#

I will just download it and have a look around and see if I can find it. Thanks for the help

uncut schooner
#

Anyone know how to validate a fire rate on the server with variable network latency?

winged badger
#

with approximate accuracy i'd say

uncut schooner
#

Wouldn't that allow room for hacking

winged badger
#

it doesn't matter if you catch the cheater on the first attempt

#

as long as you catch him

uncut schooner
#

So like a batch check?

#

Record the shot times, and when they start and stop firing

#

Then calculate if its off?

winged badger
#

you can just record last, say 10 shots

#

and then randomly check that time between first and last is not significantly less then 10x the delay between shots for that weapon

uncut schooner
#

True, that should work well

winged badger
#

it doesn't matter if you catch them on their 50th try, the inevitability of getting caught is what ultimately makes them not use that cheat

uncut schooner
#

Then ban them or something?

#

Or just give a warning lol

winged badger
#

depends on the game

#

and how confident are you you won't catch a false positive

#

which is the other side of the coin here

uncut schooner
#

Yup

#

That's what I am worried about

#

But I guess I could do the check multiple times

#

And flag the person/ something

winged badger
#

and i'd check client, not server timestamps when shots were fired

#

which i'd send along with the firing package

uncut schooner
#

So if they send an incorrect time stamp, then server side rewind wouldn't give the shot?

winged badger
#

you can still get a temporary dropout in connection and have 6 reliable RPCs get resent together

uncut schooner
#

Makes sense

winged badger
#

client timestamps are for your rate of fire validation

uncut schooner
#

With projectile weapons it would be a bit harder I'd say

#

They could maybe send like -10 for the timestamp, then up to 0

#

While they shoot

#

But I guess I could validate that as well

#

Maybe

winged badger
#

honestly if you just release without that teleport random enemy right infront of your muzzle whenever you fire hack working

#

you'll be fine patching things afterwards

#

i do know few people who released with it,and still ended up ok

uncut schooner
#

Sounds good, Ok, ill go try that

winged badger
#

that happens when there is no positional validation for the shot on server

#

hack just grabs a random enemy (or less then random), teleports their pawn locally in a way that their head is right in the bullet's path

#

then reports a killshot to server

uncut schooner
#

That won't work in my game

#

I validate the shot location from the latest camera location

#

On the server only

#

So I don't think that could work

winged badger
#

camera location pulled from where?

uncut schooner
#

Saved in the server side rewind component

#

As well as just the servers version of the camera location

winged badger
#

since i can just send you ServerUpdateCamera RPC prior to this and you're fucked still

uncut schooner
#

No it doesn't work like that, I record the position on the server only

#

So there is no RPC

#

Only the CMC updates the character location, then in turn the camera location

winged badger
#

what i mean, client is constantly sending ServerUpdateCamera

#

under the hood

uncut schooner
#

Hmm

#

Ill have to check that out

winged badger
#

that location is coincidentally also the center for your relevancy calculations

uncut schooner
#

But I can still fix that, by just using an offset from the players location

#

Since its a first person shooter

#

Thanks for bringing it up

#

Ill try to disable bUseClientSideCameraUpdates, dunno if that will cause lag tho

uncut schooner
winged badger
#

camera is attached to a weapon socket, yes?

#

in that case you would just need to additionally verify that camera is close to the weapon as not to have been teleported halfway across the map

dark edge
winged badger
#
    /** If PlayerCamera.bUseClientSideCameraUpdates is set, client will replicate camera positions to the server. */
    // @TODO - combine pitch/yaw into one int, maybe also send location compressed
    UFUNCTION(unreliable, server, WithValidation)
    void ServerUpdateCamera(FVector_NetQuantize CamLoc, int32 CamPitchAndYaw);```
#

in APlayerController

dark edge
#

dafuq

#

why, relevency only?

winged badger
#

i think yes

#

or at least mostly relevancy

#

if you have a separately controllable camera relevancy adjusts to what you're looking at

frank flax
#

how do I detect if a player joins a match for the first time?

#

specifically for the first time ever

willow prism
#

Hello, I'm using the network Profile to see how my game is going and a doubt arose, there are actors who have a very high waste of 100 and I don't know if this is good, if so, I could lower it considering that it is the worldsettings, playerController and playerstate

dark edge
#

Especially if you want it to survive a reboot

willow prism
frank flax
dark edge
#

You sure it doesn't already exist?

#

If you can make your own additional ones just make one with an array of all player IDs who've joined OR make one per player if you need to store other data like location and inventory or whatever.

frank flax
#

hmmm the project basically gets packed at the end and I have to upload it on mod.io, where I can use the mod ID in my online server to load the mod in. No clue if it would actually find my save games folders

#

will have to look into save games then, actually no clue how that even works to begin with ahahhaha

frank flax
dark edge
#

That's your check to see if they've ever joined before

frank flax
#

aaah how do I do that exactly?

dark edge
#

that should be what's unique

#

use the play fab name or whatever

#

but prolly need to do some investigation to see what is already being done. I bet they already have a save per player

#

In Minecraft you would have a file called Mano.dat or whatever. That's the save file for Mano

#

if Mano.dat doesn't exist and Mano is logging in, then they've never been on the server before

frank flax
#

Hmmm I couldn't find any other save game objects in the unreal files

#

so basically something like this?

dark edge
#

Read up on save games. That would probably work for creating the save (assuming Mordhau isn't already doing that and now you just nuked the stock save file).
You want to check if the save exists first.

drowsy pine
#

I think I’m be able todo the bomb throwing now actually

woven basin
shell sorrel
#
[2022.05.26-22.21.47:859][701]LogNet: Join succeeded: AAA
[2022.05.26-22.21.56:854][874]LogNet: UNetConnection::Cleanup: Closing open connection. [UNetConnection] RemoteAddr: XX.XX.51.168:64189, Name: IpConnection_2147459359, Driver: GameNetDriver IpNetDriver_2147482482, IsServer: YES, PC: BP_PlayerController_C_2147458680, Owner: BP_PlayerController_C_2147458680, UniqueId: NULL:ATXD-1E779E5C4ECE5914B86174B684EFC73D
[2022.05.26-22.21.56:854][874]LogNet: UNetConnection::Close: [UNetConnection] RemoteAddr: 26.88.51.168:64189, Name: IpConnection_2147459359, Driver: GameNetDriver IpNetDriver_2147482482, IsServer: YES, PC: BP_PlayerController_C_2147458680, Owner: BP_PlayerController_C_2147458680, UniqueId: NULL:ATXD-1E779E5C4ECE5914B86174B684EFC73D, Channels: 19, Time: 2022.05.26-22.21.56
[2022.05.26-22.21.56:855][874]LogNet: UNetConnection::Close: CloseReason:
[2022.05.26-22.21.56:855][874]LogNet:  - Result=Cleanup, ErrorContext="Cleanup"
[2022.05.26-22.21.56:856][874]LogNet: UChannel::Close: Sending CloseBunch. ChIndex == 0. Name: [UChannel] ChIndex: 0, Closing: 0 [UNetConnection] RemoteAddr: 26.88.51.168:64189, Name: IpConnection_2147459359, Driver: GameNetDriver IpNetDriver_2147482482, IsServer: YES, PC: BP_PlayerController_C_2147458680, Owner: BP_PlayerController_C_2147458680, UniqueId: NULL:ATXD-1E779E5C4ECE5914B86174B684EFC73D
[2022.05.26-22.21.56:858][874]LogOnlineSession: Warning: OSS: No game present to leave for session (GameSession)

Do you guys know what close reason Result=Cleanup, ErrorContext="Cleanup" means ?

neon mango
#

Does a listen server count as being an empty server if no other clients have connected to it? I ask because typically the listen server includes itself as part of the player count.

fathom aspen
neon mango
#

So you can't really search for an empty listen server

#

it will never be empty

#

it will always have itself at least

fathom aspen
#

Right

#

While there should be at least 1 player(the host), you can tell other clients that want to join that this server is empty(has 0 visitors), but I don't know why would someone want to do that

winged badger
#

if you were thinking of using empty listen servers as dedicated ones - i really wouldn't

winged badger
# woven basin Is there somewhere I can read more about the c++ options? I’ve done lots of tuto...

i am now aware of any place that has a summary for that, but c++ can:
1 - use Replication Graphs
2 - use Push Model, however little that helps
3 - use custom Net(Delta)Serialization for types
4 - use FFastArraySerializers, which are pure awesome
5 - has proper replication callbacks, including OnRep function overload that has pre-replication value as an argument
6 - has far more fine control over replication conditions, like it can fire OnReps even if the value is unchanged if told to do so
7 - it can actually manipulate structs, among other things allowing you to replicate only some of struct members
8 - override a ton of very handy virtual functions that were never exposed to blueprints (like AController::SetPawn or OnRep_PlayerState
9 - it can replicate UObjects that are not Actors or ActorComponents
10 - it can even spawn an Actor separately on server and client and replicate it after the fact

#

in addition c++ has more fine control over literally every aspect of Unreal

fathom aspen
#

I thought it's as easy as to turn on that flag in the config file

winged badger
#

how? you don't have access to FDoRepLifetimeParams

fathom aspen
#

I see, good point

solar stirrup
#

@winged badger BP can use push model

#

Sec

fathom aspen
#

I think you need to turn on this flag for that in the config file

solar stirrup
#

net.MakeBpPropertiesPushModel

#

Yeah

winged badger
#

so you can do all or none?

solar stirrup
#

Yep

winged badger
#

no fine control there 😦

solar stirrup
#

If you enable that cvar, bp props set the params when they're registered

#

Eh tbh there's literally no drawback

#

It automatically marks em dirty if you call the Set node

winged badger
#

i had some issues with struct members not working with push model properly

solar stirrup
#

That's odd

#

Like was the push model not picking them up?

winged badger
#

it wasn't if i don't set the struct member itself, but instead set one of its members and mark the struct property dirty

solar stirrup
#

That's weird

#

Never had that issue

winged badger
#

i did not have time to explore why at the time, so i just turned push model off for affected 2 structs

solar stirrup
#

Ay

#

Could be operator== maybe

#

I think it still checks for changes although I'm not sure

#

Maybe I'm confusing it with the changelist

winged badger
#

but also, push model just helps a little, its my least favorite thing on that list

#

fastarrays being #1

solar stirrup
#

I like the fine grain control of telling the engine when to replicate a prop

#

Makes me feel in control in an otherwise chaotic engine

fathom aspen
#

Haha also when you have too many players

winged badger
#

i replicate a majority of my Actors by turning their replication off and having few manager actors with fastarrays do replication work for few hundred actors each

solar stirrup
#

Ay I do that when they can be handled by simple data via a proxy

#

Performance stonks

winged badger
#

it is a push model in its own right

#

i took it a bit further

solar stirrup
#

I think the Push Model was just an attempt by Epic to improve perf, but overall, not much difference

winged badger
#

my NetworkManagers have 8 fastarrays

solar stirrup
#

Unless your operator== costs 5 ms

winged badger
#

one handles interaction, other damage/death, then one for buffs, one for gameplay tags...

solar stirrup
#

Neato

winged badger
#

so more complex actors have several functions they need to call when updated on server

#

but all in all, its far more responsive then any vanilla solution

tawny nova
#

if the player initiates a thing that changes an actors skelemesh.. does that get replicated as part of the actor?

#

that's just wishful thinking isn't it

winged badger
#

it doesnt

#

skeletal mesh components are not replicated by default and generally replicating them causes more problems then it solves

#

you replicate the change inside the actor and use onrep to adjust clients

finite forge
#

Hey guys does amazon aws gamelift sdk work in UE5? I couldnt find any info online πŸ™‚

plucky prawn
#

How would RPCs normally be handled where the player could potentially spam them? For example in csgo you can bind the mouse wheel the select the last weapon you had, then just scroll the mouse wheel to flip between your weapons quick which, in my case, would send an RPC each switch

plucky prawn
glossy kettle
#

ye

void nest
#

So is there any solution yet for the steam session region lock? We are making a coop game and we want everyone around the world to be able to play together. And yeah i know changing download region in Steam fixes the issue, but we can't expect our customers to change their download region to be able to play with their friends, that's a bit ridiculous. If you pay for a game that is advertised as coop it should just work. We don't want players to have to fiddle with region settings and stuff. I was wondering if EOS subsystem has the same issue?

void nest
magic yoke
kindred widget
#

Sounds more like a bad plugin limitation. We have settings that allow distances. But they're easily accessible in C++.

chrome bay
#

Don't think we've had any issue with region locks though, but we are on dedicated servers. Lobbies work very differently

#

If you want to make the Lobby filter worldwide, you can edit FOnlineAsyncTaskSteamFindLobbiesBase::CreateQuery() and change the distance flter to worldwide

#

SteamMatchmakingPtr->AddRequestLobbyListDistanceFilter(k_ELobbyDistanceFilterWorldwide);

#

But obviously there's very good reason you don't do this by default...

k_ELobbyDistanceFilterDefault,        // only lobbies in the same region or near by regions
k_ELobbyDistanceFilterFar,            // for games that don't have many latency requirements, will return lobbies about half-way around the globe
k_ELobbyDistanceFilterWorldwide,    // no filtering, will match lobbies as far as India to NY (not recommended, expect multiple seconds of latency between the clients)```
void nest
#

Thanks for the information. I'll research this. πŸ™‚

split briar
#

Hey. Anyone facing issue with the vehicle template in ue5? The speed of the car in client doesnt go above 50km/hr. But the standalone or listen server speed is fine.

real ridge
#

hello bro I have same error as u had did u solve it ? please hit me up with a message....

rocky night
#

HI, where is the best location to make atimer which is counted on server and shares the time with the clients?

upbeat basin
#

Is there a way to estimate the maximum player capacity of a game server?

empty axle
solar stirrup
lone steeple
#

After pressing the play button, is it possible to add another client afterwards? I want to see if this system I'm working on works when someone new joins the server.

winged badger
#

you need to enable join in progress in editor preferences @lone steeple

#

then you get add client button next to play/stop

lone steeple
#

Oh wow, that's convenient! Thanks πŸ˜„

deep geode
tame quarry
#

Should i work on multiplayer from the get go when i start building a game, or can i just work on converting it into a multiplayer game later on?
I know nothing of multiplayer except some tutorials i saw, so i just have a general picture of it, and know that you need to replicate β˜‘οΈ . So for now im making my game single player, but its intended to be full multiplayer asap. Should i start doing it now, or i can leave this for last?

young kestrel
#

I would start working on it from the beginning. Because converting it can be a pain.

willow prism
#

hi, it is the first time that I use the network profile and I see that my main actor and the world has a "waste" of 100, is this bad?

lone steeple
#

I have a teleport button that I can interact with which teleports the player. Works fine in singleplayer but I need to convert it to multiplayer.

The screenshot is within the teleport button bp and specifically in the interact interface function. Could someone help me out?

elder quartz
#

@lone steeple You can try using the game state player array to get the list of players and teleport them (must run it on the server). something like this:

lone steeple
elder quartz
lone steeple
sinful tree
# lone steeple

You'll never get this to work as you can only send RPCs (The "Replicated to Server" event) if the client is the owner of the actor, which I'm guessing wouldn't be the case here....

Normally you'd want to do something like:
Character Interact Input > RPC "Replicated To Server" event, passing along the actor the player is attempting to interact with (you can add inputs to events which will allow you to do this) > Server Validates if the interaction is valid (ie. player is in range of actor requesting to be interacted with) > Pass to the actor to perform the interaction required (normally VIA an interface call)

dark edge
winged badger
#

its not ECSish

#

it just simplifies the code

#

as each fastarrayitem needs to be able to handle postreplicatedadd/change

#

and its simpler keeping them to 1 responsibility per fastarray

#

but yeah, the general idea is one actor replicates few hundred others

elder quartz
lone steeple
#

Like this??

#

I'm so lost

elder quartz
young kestrel
#

If I had an ability that spawns jumppads on the server, could they launch players and would it be replicated or would I need to find a way to make it work for multiplayer?

elder quartz
# lone steeple

That looks about right. The input triggers the RPC on the controller, which then talks to the interactable actor server side

lone steeple
#

Seems to be working! What an interesting workflow

lone steeple
lone steeple
bronze arch
#

Attempted to send bunch exceeding max allowed size. BunchSize=78542, MaximumSize=65536
Seem we have limitation to send a string data(json) length up to 65536 bytes? ThinkO_O

chrome bay
#

Yes, and realistically you don't want to be anywhere near that limit

#

Replication is built for small, fast packets - not data transfer

bronze arch
#

Well, what would you suggest to get that data? prolly custom TCP or web communication?

chrome bay
#

A custom UDP socket probably

bronze arch
#

Dont think UDP can reliable to get correct data

#

far away cuz of packet loss and MTU partition

chrome bay
#

All UE networking is UDP but it has it's own system for ensuring reliability

#

All assuming this is just a one-off transfer

#

Another option is you chunk it, and send it in chunks via RPCs

#

And you wait for the ack that the last chunk has been received before sending next one

#

But this is something you'd want to avoid for general gameplay ofc, but is probably okay when initialising or something

bronze arch
#

ye just want to data once time at lobby

#

alright do you know there is ideas to make chunks with blueprint or C++?

chrome bay
#

I don't know of one, but it's not too hard in theory

#

Just split the data into chunks of bytes, and ping-pong RPC's from Server->Client until it's all sent

bronze arch
#

Well just asked if theres ready idea would be time save for me but i will think about this. Thank you very much!

chrome bay
#

yeah not sure of anything off the top of my head

lone steeple
#

I don't understand why this doesn't set the rotation of the interactor/player. Could someone help me out?

#

Why can I set the location just fine, but can't set the rotation? Doesn't quite make sense to me.

sinful tree
#

Same problem but reversed... You can't run a Run On Client RPC when the client doesn't own the actor (again the BP_TP-Hub is the actor in question)

#

Similarly, you don't need to run a "Run On Server" event for the "Set Rotation Server" event, as at that point you should already be running on the server.

#

Interact > Run On Server > Interact Interface to Target Actor > Do whatever needs to be done on the server.
If you need to go back to the player controller that triggered it, then you'd have to be sure to utilize the interactor reference you're passing through your interface already allowing you to go back to the player controller, then doing your Run On Owning Client event there.

lone steeple
#

So there's no way to to just have everything in the actor bp that I'm interacting with, like in singleplayer

sinful tree
#

Sure you could... For example, you can have a replicated "with notify" vector variable on your player controller. Whenever you want to force the client's rotation to update, you can set that value on the server from anywhere, so long as you have a reference to the player controller you want to update.

#

Then on the OnRep function, you use the variable and set the control rotation using the node you're trying to use.

lone steeple
#

This would require additional setup in the controller for each specific interaction. As far as I know, this isn't necessarily required for singleplayer, since you can do pretty much everything within the actor you are interacting with. If that's one of those multiplayer quirks, that's fine with me, just trying to understand it better.

sinful tree
#

No it wouldn't.
You have a reference to the player controller currently. Your "Generic Interact" function can be used to set a value on the player controller as you're passing the reference to it through the interface. That means you can set a value in that player controller on the server and have the client respond to that change.

A generic interaction interface is what you've set up, which means that the actor being interacted with can respond to the interaction however they want to. It's just a matter of getting any thing that changes back to the client and you only have two options for that, either an RPC or through replicated variables, and if you want, a client can react to a replicated variable if it's set w/notify.

Interact > Run On Server (passing a reference to the actor the client intends to interact with) > Interact Interface (target is the actor the client passed through, and yes, you can pass through the interacting player controller) > Target Actor does what it needs to do such as change variables, call functions, etc. any of which can be used just as you would in single player with the caveat that it's run on server only, so you need to utilize appropriate replicated variables and call Run On Client RPCs (on actors owned by the client) if necessary.

chrome quest
#

I want to make a projectile simulator subsystem that only runs on server.
Unfortunately, I don't think that would work properly because of subsystem replication issues.
I tried creating the subsystem only on server but it doesn't seem to work. It creates on client and even one more place that I can't determine.

I'm guessing I'd have to use a manager actor instead?

#

It's inheriting the FTickableGameObject btw, for ticking the simulation.

lone steeple
#

This works, but obviously isn't a good setup

sinful tree
#

That's definitely one way to go about it, and what's nice about it, is that it keeps the code decoupled.
As far as what I was thinking it's more that you utilize the "Interactor" reference within the interface function and you can use it to call something like the "ClientsideChanges" event you have there.

lone steeple
#

Ok, this is probably stupid, but couldn't I technically have an interface specifically for clientside changes, with multiple functions for each particular change.

sinful tree
# lone steeple Do I have to use an event dispatcher for something like that?

Event dispatchers are usually useful if you need to wait for an event to happen, or if you need multiple things listening to something.
In terms of replication and passing around for a single operation, it's usually not necessary.

Generally speaking, yes, you'd need functions or events for any different change that needs to happen. Here's an example of using a second interface to go back to the player controller. This too would keep the code decoupled.

bronze arch
#

Um i tried something about chunking strings, but "get substring" is broken or what? i want to get string between 5 and 6 it gets up to 5 whole string..?

#

the code

#

do you have any idea Jambax?

lone steeple
lone steeple
#

huh interesting. Thought that my idea with that would be dumb

sinful tree
# bronze arch the code

Is it really necessary to send the JSON to the client? I mean, is it not possible to perhaps break it down into variables at that point? In a structure of some kind? I know not always possible but... may be a better solution if you can.

bronze arch
#

what i can use for it else json

#

(doing friend list interface btw)

sinful tree
#

So however you'd be consuming the JSON on the client side, do it on the server instead and create a structure that can hold the data that is necessary to be replicated to clients (ie. the data that each friend has), then replicate an array of that structure.
JSON has a lot of extra unnecessary stuff in it, like the brackets, quotes, even the field names.
Not sure how many you can send at once, but it'd probably be easier to page out a certain number of friends then trying to chunk the strings.

bronze arch
#

umm making 110k structure array

sinful tree
#

110k friends?

bronze arch
#

is this healthy to send the array throught

#

im testing the limit

#

11k ups*

pallid mesa
#

hook net insights when you do and provide some data pls

sinful tree
#

But again... Still would probably be smarter to page out an array response from the server.... Eg client asks for friends starting at position 0, server reads friends from 0-50 and sends those in the array back. Client when necessary can request more when it reaches the bottom of the list, then requesting friends starting at position 50, etc.

bronze arch
#

so paging system

#

i see

#

just wondering, isnt Structure data has more bytes than json?

#

same form id name status etc with json and structure

#

thought sending String more cheaper o.O

pallid mesa
#

wait, what

#

dependsℒ️

bronze arch
#

lets call 1k peoples inside in array

pallid mesa
#

depends turns into a no

#

for almost all use cases

#

let's use a simple char array as our use case...
each char array element -> 8 bit

#

ie: encode an int8 number -> 64
int8 encoding 8 bits.
char encoding 16 bits.

#

its dependent on the nature of the data

bronze arch
#

well mostly using strings(char) so there is no int or either float

#

same char at json and structure

pallid mesa
#

if all you are sending are strings that can be easily tokenized

#

you can encode it and decode it using an extra 8 bit char per token

#

it'd be a matter to see if its worth given your use case

bronze arch
#

u mean combine others in to one with parse in to array?

pallid mesa
#

blah;bleh;blih;bloh;a;eeeii;

#

pretty much

bronze arch
#

yeah like that

#

i was doing this already

pallid mesa
#

it's just a bit of a PITA to recode it back

sullen plover
#

So I'm trying to use anim notifies to enable and disable collisions for hitboxes, but I'm not sure how notifies and notify states work in regards to replication

bronze arch
#

name,online,battleground,profileicon1
then parsing that text with get array 0,1,2,3

pallid mesa
#

blah;bleh;blih;bloh;a;eeeii; -> 28 bytes

#

profileicon is... a softpath?

bronze arch
#

no just data table name

pallid mesa
#

ah oki hehe

bronze arch
#

its 0-100 id

pallid mesa
#

good good.

bronze arch
#

just example xD

#

but with that

pallid mesa
#

yes?

bronze arch
#

sending through string more cheaper than structure itself guess? ThinkO_O

pallid mesa
#

yes

#

in that specific use case yes

#

just in this use case

bronze arch
#

alright

pallid mesa
#

but, use the profiler

#

don't trust a random in the interwebs

#

I'm using background knowledge, haven't tested it

#

maybe we get surprised

bronze arch
#

will test through limits hh_thumbsUp1

pallid mesa
#

perfect, and again, I'm interested in data

#

whatever you find, if you can share it, it'd be awesome!

#

πŸ˜„

bronze arch
#

Sure in a simple project xD

#

will open it and work later

bronze arch
sullen plover
#

You guys got any knowledge on how to handle animation notifies/notify states in multiplayer?

bronze arch
#

if animation played on everyone, the notifies fires on played clients

#

if you want to fire that notifies only on server, use authority or is dedicated server bool branch

sullen plover
#

Well, I'm trying to use notifies to switch colliders on and off for attacks but I suppose that doesn't sound like the best way to go about handling collisions then

bronze arch
#

well there is always latency so this possible. maybe switches collision first on server then your client

lone steeple
#

@sinful tree Sorry for pinging you! For whatever reason, the first teleport works, but any afterwards don't change the rotation anymore. Any idea why?

#

On the server it's fine, but on each client it only works once

#

This is so confusing

lone steeple
#

Anyone know why the client only changes the rotation only the first time I interact with this actor? Any time after the first interaction, I still get teleported, but my client doesn't change the rotation anymore. This is genuinely confusing to me 😡

void nest
#

Could it be because the rep notify doesnt trigger because the value doesn't change?

#

Repnotifies only fire when the value is changed on the server and is actually different from the version clients already have. For example if a bool is false and server sets it to false, repnotify wont fire on clients because the value hasn't changed.

#

If the desired control rotation doesn't change after the first time it was set client won't have it's notify event fire and thus no code inside the notify will fire

sinful tree
lone steeple
sinful tree
#

My bad... meant to do run on client.

lone steeple
#

Oh okay, well atleast I caught that which means I somewhat understand what's going on lol

#

but that seems to have fixed it!

lone steeple
#

And thank you Datura as well ofc! Wouldn't have figured it out on my own that's for sure!

void nest
#

A repnotify is for when you want something to change when a value is changed on the server and you want clients to update something based on said value. Great for when a value is changed when a client isn't even around (outside relevance range or not connected yet). When client connect or comes withing range the value will replicate and client can do with it what it needs to do using the repnotify event.

RPCs (multicasts) are for when you want stuff to happen right away and only once. If clients that aren't around have missed it, too bad for them it has happened and won't happen again. Great for replicating effects such as particles or sounds or whatever.

#

Like you dont want to spawn sounds or particles or any cosmetic stuff on repnotify because then clients will get random effects when they come within range or when they connect.

lone steeple
#

Ohh I see, makes sense I guess!

marsh niche
#

Hey, what's up for everyone, i'm have some problems with replicate some morphtargets, i'm using de OVR lipsync and the Ready Plyer Me, but when i try to replicate all the visemes animations of the mouth, the other player can't see anything... i lost much time on this and i need to put this in a multiplayer game, i need your help! I will send and image with my BPs, to show what i'm doing, showing the begin play, the logic of OVR lipSync, and in left, the replication of the two custom events. To understand what is occuring, when i talk, with other people in VR, to me show the 2 character moving the mouth in same time and in the same way, like the two characters are controlled by me, but for the other people nothing happens.

vocal cargo
#

Hey, how can I remove the local player from the PlayerArray in GameState? And how would I make that work for both dedicated server and P2P architectures?

kindred widget
#

There is a function that is called that adds playerstates to the array. Just override it and don't do it if PlayerState->GetOwner() == GetLocalController()

#

Can't really say anything about P2P. P2P doesn't exist in Unreal by default.

compact talon
#

Can I not call set view target on a remote player controller from the server?

#

This is my gamemode blueprint, I transition to this gamemode seamlessly from the lobby gamemode.

I want players to immediately have their camera set to a cinematic camera (on a rail) that plays the intro sequence. Then they are spawned in and can play.

So I tried handling the new player by setting their view target with blend and after a 3 second delay (for intro) it would run the parent function to actually spawn them.

There are a few issues though, only the first player controller sees the cinematic camera, any player being handled after this refuses to run the node and just has the camera sit at the player start.

As well as this only the last player to be handled actually spawns in, I assume this is to do with the delay because other players are being handled before the delay finishes and calls the parent function, so it never gets called. Unsure of the proper way to handle this as well.

#

Hrm, I have tried working around it by having an event within the player controller to set the view target, and just calling that event from the gamemode. However that also has the same issues

thin stratus
#

ViewTarget is a Client Concept

#

You get nothing by setting the ViewTarget of a Client on the Server

#

The Client has to call the function locally

#

Place it into BeginPlay or so with IsLocalPlayerController check

#

Or use the PlayerCameraManager and return the custom camera transform if some condition is given

compact talon
#

I moved this functionality over to my custom player controller and it still doesn't work for clients

thin stratus
#

No