#multiplayer

1 messages Β· Page 668 of 1

amber slate
#

is there any doc?

#

I can't seem to find anything besides people on forums

silent valley
amber slate
#

ty

silent valley
#

oh, worth saying that if you use Steam for development you don't need to Release it for others to play it. You can generate keys for your friends to give them access to it.

lime skiff
#

Hey together, for my UMG windows I have a window manager (for interaction between windows etc) which is currently owned by the PlayerController. Since I only need that window manager on clients and not on server, is there a better default Unreal class available which is only present on clients?

silent valley
#

What about the HUD?

amber slate
#

I just need to save 100$ then I will get it

lime skiff
# silent valley What about the HUD?

Hm, neat idea, though this is owned by the PlayerController, too. So it would be only meaningful, if it is only existent on the client (didn't checked it yet). I also thought about using ULocalPlayerSubsystem but have no experience with that either.

silent valley
#

HUD only exists on client

#

but do you want these windows to persist between game sessions/maps etc?

silent valley
#

I think GameInstance might be best then

#

or create your own GameInstanceSubsystem

lime skiff
chrome bay
#

Local Player probs makes sense for widgets, they do persist

#

UMG doesn't really behave very well when widgets transition levels though tbh

#

Have to be cautious with it

violet sentinel
#

is it possible to track changes to array built with FFastArraySerializerItem ?

#

I have an array of ~300 elements replicating with FFastArraySerializerItem to make use delta serializer

#

but i need to somehow respond on "onrep" for each element

#
USTRUCT()
struct FDataComponent : public FFastArraySerializerItem
{
   GENERATED_BODY()
   // fields and needed stuff 
}
USTRUCT()
struct FDataComponentArray : public FFastArraySerializer
{
    GENERATED_BODY()

         UPROPERTY(NotReplicated)
         AActor* Owner;
         UPROPERTY()
         TArray<FDataComponent> Items;

         bool NetDeltaSerialize(FNetDeltaSerializeInfo& DeltaParms);
         // utility methods
}

template<>
struct TStructOpsTypeTraits<FDataComponentArray> : public TStructOpsTypeTraitsBase2<FDataComponentArray>
{
    enum
    {
        WithNetDeltaSerializer = true,
    };
};

class AMyActor : AActor
{
     UPROPERTY(Replicated)
     FDataComponentArray DataArray;
     // actor boilerplate
}

but how to try listen to array item changes?

silent valley
#

OnRep also works for fastarrayserializer:

UPROPERTY(ReplicatedUsing=OnRep_DataArray) FDataComponentArray DataArray;
#

but you need to know which has changed?

violet sentinel
#

just found this, checking


    /**
     * Called after updating all existing elements with new data and after the elements themselves are notified. The indices are valid for this function call only!
     *
     * NOTE: intentionally not virtual; invoked via templated code, @see FExampleItemEntry
     */
    FORCEINLINE void PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize) { }
#

 void FDataComponentArray::PostReplicatedChange(const TArrayView<int32>& ChangedIndices, int32 FinalSize)
{
    if (Owner)
    {
        for (int32 Index : ChangedIndices)
        {
            Owner->OnDataItemChange(Index, Items[Index]);
        }
    }
}

silent valley
#

πŸ‘

violet sentinel
#

bad thing, that it does not preserve the order because uses RemoveAtSwap inside

silent valley
#

yes that is the problem with FastArray's

#

If you don't delete items I think the order seems to be preserved, although the docs say there's no guarantee of this

eager jolt
#

any good tutorials i should look at?

#

just getttin started at mp?

sinful tundra
#

Hmm.. ok. Thanks for the response

jaunty hazel
#

guys is there any way to posses another actor from the client

trim kindle
#

Is it safe to handle custom net dirty bool in NetSerialize()? I would like to serialize struct only if its bNetDirty bool is set to true and then set it to false as soon as NetSerialize() ends, however I am not sure if engine is not calling NetSerialize() multiple times therefore setting bNetDirty to false on first call would break the system.

#

I wonder what happens if packet gets lost and bNetDirty is now false. Will it try to resend (call NetSerialize again) the variable but fail because of bNetDirty being now false?

sinful tundra
#

Hmm... is running a line trace in front of the player to get interactables the best method for a pickup system? I tried having on overlap begin/exit collision on pickups, and it works, but kinda sucks if there are multiple pickups that are close to each other. I dont like the idea of being forced to stand in front of an item to pick it up.

warm sequoia
#

Hey guys, I am trying to replicate a chest where a player takes items out it and it will be empty, but each player sees the original amount in the chest. any ideas?

trim kindle
#

how is it possible that variable replication is reliable? What system is there to ensure that it is reliable? I am interested especially in case when only single var modification happens and the packet gets lost.

#

I would expect server won't send it again because value did not change

summer tide
#

So i have an array of weather types. Once in a while I randomly pick a weather type then change the weather. I have a blueprint with event overlaps. Let's say I have placed 3 of them. If one of the player goes to BP #1, it will randomize a weather type then show the weather only to the player within the bound/

sinful tree
worthy eagle
#

So catch 22 I am currently trying to think of a solution for. I am wanting to eventually include multiplayer capabilities in my game. Right now I have all the relevant values that need to persist across multiple play sessions being saved and stored in the game instance on each players local machine. (Game instance, serializes and writes that data out to a file).

I thought this would be a great way to do this, especially since game instances are local to each machine. However upon looking more into multiplayer I'm wondering if this isn't a good solution in that it essentially relies on clients not mess about with their save files. Might open the door for cheaters. How could I reduce the likelihood that clients modify theses files? I'm probably overthinking this but wanted opinions before continuing development on the game instance.

hollow eagle
#

Don't bother. If you're trusting the client on anything related to their save then there's nothing you can do to prevent someone who really wants to modify it. The only way to truly prevent someone from modifying their save is to have an always-online game (which is a bad experience if the game doesn't have a good reason to be always online). Something harder to modify would be to not have their save locally at all but to save data on your servers even when the game runs locally (still a bad experience if the game doesn't have a good reason to be always online, and still possible to modify the data in-transit or while it's still on the client).
Validating that the client's save makes sense when they connect to a server is a good idea, on the other hand.

worthy eagle
hollow eagle
#

Yeah. For example, if you are making an RPG with a skill tree, making sure that the player's level and the number of skill points allocated to the tree are correct.

#

Or, if you have randomized stats on weapons that the stats are within the expected range for whatever the weapon is.

#

Obviously someone can still edit things to be the maximum you allow, but at least they can't outright break your design beyond skipping the time necessary to get to that point.

worthy eagle
#

Yeah and they would have to be the server in order to do so, presuming I am doing the checking on the server right?

hollow eagle
#

Assuming all saves are kept locally (and transferred to the server) they can edit things however they want. The server would check that these values are correct and reject them if they aren't.

#

If you're doing listen servers then the player acting as the server can, of course, find workarounds for this by modifying the game, but again this is something you shouldn't really bother with - dedicated servers are the only way to be absolutely sure no one can do this.

worthy eagle
#

Gotcha, alright well thank you very much!

fair lantern
#

Does anyone know how I would have someone attack with a sword on their screen that lines up with the server weapon tracing whilst allowing realtime tracer manipulation from the client without having to send that info to the server before registering that change on the client whilst still having the server handle and verify all the hit detection?

#

without putting everything on a delay

#

that offsets by the latency

#

I understand the delay offset would line up with the server as for inputs but not for realtime manipulation of that tracer on the client

dense forum
#

Why might it be that i can connect to my dedicated server hosted in the cloud on some pcs but not others using the same exe

jaunty hazel
#

guys i have a problem with spawning.

#

The first client spawns in fine but the second one just stands there and moves the first one.

fair lantern
#

does anyone know how I can retrieve the ping variable?

dark edge
dark edge
young thunder
#

I have a replicated event (like spawning an attachment). This works fine for the server and the client of the current session. But if a new client joins the existing session, the event (or attachement mesh) doesn’t get carried over. Any tips how to fix that?

#

I tried reliable and also tried force net update

chrome bay
#

Use a property not an event

#

Only way to do it properly

young thunder
#

@chrome bay could u explain a tiny bit more? And thanks for the reply

#

I should mention that it is a blueprint only project

ebon plume
kindred widget
#

@young thunder When you run a replicated event, it only happens for connected clients. If you instead make a replicated property, then each new client that joins will have this property replicated to them and they can run OnRep functions.

So in your case, you have an attachment. I assume this is for a weapon or something. You should have a datatable of these. Gameplaytags are best, but even something like integers can work. If you make a variable and replicate it with OnRep, you can set it on the server.

So you want a silencer attached. That might be Gameplaytag WeaponAttachments.Silencers.Basic or something, however you want to lay it out. Or if you want to do it with just integers, Item ID 31675. You set this on server on the weapon. The onrep runs on server when it's set and then on clients when they receive it. OnRep looks up which attachment this is via the Tag or ID, and sets it up on the weapon locally.

young thunder
#

@kindred widget thanks mate. I guess I was almost there. I have an ID system derived from the save file that can be decoded into integers to get the right attachment from the data table. BUT I didn’t use OnRep notifies, but normal replication for variables and then used custom events

warm sequoia
#

Hey guys, I am trying to replicate a chest where a player takes items out it and it will be empty, but each player sees the original amount in the chest. any ideas?

sinful tundra
ebon plume
# warm sequoia Hey guys, I am trying to replicate a chest where a player takes items out it and...

How is the event being called for when the player takes the item ? Is it being replicated ? You also need to handle the logic for removing the item properly to start with.

And other than some basic stuff, I'm still super new to multiplayer replication so if I'm out of line or wrong with any of my statements / questions. Anyone; feel free to correct me

When you say "replicate a chest" you are really talking about replicating the contents of the chest.

tight glen
#

Anyone have the issue on a listen server where the Frame Rate drops over time and eventually goes to a crawl?

jaunty hazel
#

Guys how do i add a hud to a specific player

#

the hud spawns but it overlaps with the other players

tight glen
#

What do you mean by overlapping

#

widgets should only be on the clients

#

what is it you are trying to do?

jaunty hazel
#

im just spawning and possus diffrent characters and it works but as soon i possus it and switcb to the other client it shows the hud there too

#

@tight glen

restive breach
#

I'm noob at this. So, can you explain how can I do that?
I want to make a game, in that users makes own dedicated servers and so on.

#

Like ARK: Survivled Evolved.

ebon plume
restive breach
#

Thanks.

weak fog
#

got a very vague question. when running my game in standalone (where a client connects to a dedicated server), none of my actors other than my player are replicating. stuff like target dummies, capture points, etc. they are set to replicate, and they do replicate in the normal editor flow if i play as client etc.

really i'm just looking for a starting point here for debugging

sinful tree
weak fog
# sinful tree What part of your actors are not replicating that you're expecting to replicate?

basically everything, which makes me think it's a high-level problem

for example, i have a target dummy in the map which paces back and forth. in the standalone game he's just floating there in midair, which is just where he's placed on the map initially. i printed his location on the server and he is moving there, just not replicating to the client. for capture points it's all info that comes from server--capture progress etc.

#

and again, all this stuff works in the editor, but not standalone

sinful tree
#

are you actually connecting to your server?

weak fog
#

yeah

#

everything works minus these actors replicating. i can run around, use abilities, etc

fair lantern
#

Does anyone know how to get the outgoing ping from the server?

bitter oriole
#

Get the ping from the player state on client

weak fog
fair lantern
#

I have no experience in c++, how would I go about doing that? @weak fog

bitter oriole
#

Consider not doing it, it's not like ping is crucial stuff

fair lantern
#

😦

bitter oriole
#

It's not like Blueprint-only multiplayer is a common thing - MP is hard and usually ends up requiring some engineering work

#

FWIW the Advanced Sessions plugin might have the ping in Blueprint

weak fog
#

yes MP is very tough...one thing you'll need to do often is expose stuff to blueprint. this is probably as simple an example as any

what you need to do is make your own subclass of PlayerState. there are lots of resources out there for this that'll go into better depth than me. once you've got that tho, this is how i expose ping:

.h

    UFUNCTION(BlueprintPure, BlueprintCallable, DisplayName = "GetPing")
        float BP_GetPing();

.cpp

float AAFPlayerState_C::BP_GetPing()
{
    return ExactPing;
}

very very small and straightforward example to get your feet wet

elder sage
#

is this, in conjunction with the ui stuff to actually fire the events, what I'd need just to get started with a listen server, or am I oversimplifying it massively?

#

I did what the cedric pdf said, but I'm not sure what more I would need to do just to make it function at a base level

thin stratus
#

Has anyone ever improved the interpolation of Clients on ListenServers?
I know this problem exists for ages. They did some Smoothing stuff for this, but it's by far not as smooth as Clients see other Clients/Server.
I tried the change with the TickPose, which I think made it a bit better, but still far from optimal. NetSpeed in the ini files is also increased already.

#

Althouuugh

#

I just changed the interp variables to the same as the client ones and it seeeems to be better

#

Question is though if I still need the tickpose change. TESTING IT IS

#

Okay yeah, that is still needed.

#

Still open for any ping about this, if someone has some info on improving that even more.
Feels more like hacking it together

summer spade
#

Does anyone have a good reference for implementing client side prediction for projectiles?
I want to learn it
Pls someone help

summer spade
#

Anyother reference apart from this ?πŸ˜…

#

Something a bit more simpler

tight glen
# jaunty hazel

What event is happening first. Not obvious from screen shot. Highlight in colors what should/shouldn’t be there on hud.

hazy silo
#

Quick question: In multiplayer, can clients access data from data assets?

amber raft
#

fast question, i found that is possible to replicate animation during networking replicating variables that drives them..
is it possible to do that with live link animation too?

#

i wrote this too in animation, i think it's a question for both topics

bitter oriole
#

Well they're in the executable, but you get the idea

jaunty hazel
#

I found the problem, i was multicasting the hud. the only problem now is that the player controller is not being fed into the player

#

@tight glen

harsh lintel
#

is there a way to simulate lag on a shipping build?

harsh lintel
#

what happens if I have a client RPC and the player has a packet loss of that RPC?

harsh lintel
#

So if packet loss can cause the client to not receive client RPCs, how about a replicated variable that is set on the server? would the variable replicate or is the replication also lost because of packet loss?

meager spade
#

Depends if the rpc is reliable

#

A reliable rpc will always eventually arrive

#

If it doesn't the connection is dropped completely

#

Actor replication is always reliable. Eventually an actors replication will get through but it can take many many ms under packet loss for it to arrive. You also can not guarantee the order.

#

If its an unreliable rpc. Then if it doesn't make it, it doesn't make it.

amber raft
elder sage
#

if I'm using the "open [IPADDRESS]" command, can I test that in the editor? My server player is able to open fine, but I'm not sure what to input if it's on the same machine

tight glen
#

So the left is the listen server and the right is the client. This is after 3-4 minutes of a client joining. As can be seen the Frame, Game, Draw, and GPU are all crazy slow. Trying to figure out what is the best way of debugging this or what could cause this on the client and not the server. I have a hunch maybe my widget is always being drawn (checking now) but is there another way to debug this besides using the profiler? Trying to see if it is a networking issue or a dumb logic error issue.

fossil veldt
#

Is there a way to know if a connection has received an OnRep? Kinda like TCP with a handshake? I don't want reliable traffic, I just want to know on the server once the traffic actually reaches

tight glen
harsh lintel
grim rain
#

how does one go about making a random character system like among us with an enemy character and player characters?

ebon plume
#

Anyhow:

I am overriding and using the Restart() function to initialize the PlayerState.

Does this sound like a bad practice ?

Everything seems to work fine

royal vault
#

when i add this code to my header file

#

i get a million compiler errors

#

if i remove it everything works

#

but i need it

hollow eagle
#

what's your implementation look like

#

you probably implemented ServerFire instead of ServerFire_Implementation

royal vault
#

heres my implementation

#

am i missing some kind of include or something?

hollow eagle
#

well to start, you're missing the validation function

#

which you probably mistyped as "Replication"

royal vault
#

ohhhh ok

#

lemme try to compile now

#

not working still :d

hollow eagle
#

it's validate, not validation

royal vault
#

bruh my brain lol ty lemme try again

#

TYSM

#

its working

lost inlet
#

did you also fix "Implmentation"?

royal vault
#

yes

chrome bay
#

It's _Validate() and _Implementation()

#

Spelling/Capitalisation matters

#

Also if ServerFire_Validate() just returns true, you can skip it and remove WithValidation

#

Saves on some boiletplate

uncut dirge
#

Hi guys, got a quick question, we are building pvp vr games. wondering what's the best voice chat tool for unreal engine?

fossil spoke
#

Vivox is also relatively easy to integrate, however it isnt free.

uncut dirge
#

we using Vivox now, but got a bit issues on integrate with game on llinux, and just realize they owned by unity lol

pallid mesa
#

guys any good resource to learn rep graph besides shootergame? πŸ˜…

chrome bay
#

That's the only official one

#

Bear in mind it's not worth it though unless you have lots of connections + actors

pallid mesa
#

Good, and from the theoretical point of view just the 2018 streaming?

pallid mesa
#

just hobbying around

chrome bay
#

Yeah that's all I know of, I've used it on 2 projects now though so have some reasonable understanding of it. Does have some "gotchas" that you run into eventually

pallid mesa
#

ah perfect, I'll revision the 2018 stream and take a look at SG then

#

thanks James!

chrome bay
#

UE5 seems to have improved on some of it too

#

They got rid of the weird actor lists thing which is a welcome change

pallid mesa
#

buggers, need a ShooterGame UE5 version teehehehe

chrome bay
#

tbh it's mostly the same, just some of the stranger parts are gone

#

Concept is similar though

bitter oriole
#

what parts

chrome bay
#

The thing I didn't like was the "RepList" thing they had going on, and you had to preallocate some "lists" of arbitrary sizes but it never really explained why they were the sizes they were etc etc.

bitter oriole
#

Cool

chrome bay
#

Like this wierdness:

    PreAllocateRepList(3, 12);
    PreAllocateRepList(6, 12);
    PreAllocateRepList(128, 64);
    PreAllocateRepList(512, 16);```
#

no other explanation

pallid mesa
#

so assume that's gone also in 4.27? or just UE5?

chrome bay
#

Just that πŸ˜„

#

I think just UE5, not sure. Possibly 4.27

pallid mesa
#

will take a look! πŸ˜„

#

@chrome bay

#

hehehe

#

shootergame 4.27 carried these changes

#

this is super convenient. Pinging you also @bitter oriole in case you are interested

chrome bay
#

Ahh good, makes sense actually if 4.27 is compatible with UE5_EA

pallid mesa
#

it isn't but 4.27 released after UE5.0 UE5.0 EA so it goes like... (edit)
4.26 -> 5.0 EA -> 4.27

#

to an extent

#

so I bet that some of the non-breaking features made it onto 4.27

chrome bay
#

I forget myself tbh πŸ˜„

pallid mesa
#

yeah meant EA, sorry!

twin juniper
#

hello all can i make a multiplayer game using only BP(Blue Prints) only with AWS?

bitter oriole
#

Depends on the game

twin juniper
#

like pubg

#

and fortnight

bitter oriole
#

Depends on your marketing budget

twin juniper
#

i need pubg like graphics

bitter oriole
#

What about the gameplay, though ?

twin juniper
#

same like recreating pugb

#

re creating pugb

bitter oriole
#

Assuming PUBG you need 100 players on each map and you probably need 10 servers for different regions and to avoid 20min matchmaking times, so say 1000 online players, you need about 100k sales

#

Got a publisher ?

twin juniper
#

bro

#

we have a team of 50 and ya we got publisher and we want to make a battle royale game

chrome bay
#

Answer is no tbh

twin juniper
#

same like as it is like pubg

pallid mesa
#

You'll have to learn C++

bitter oriole
#

You'll need to move a lot of systems to C++ to ever get 100 players, and you'll need some anti-cheat work anyway

#

The main issue BR games face is the marketing anyway

chrome bay
#

Also how do you get a 50 person team and a publisher not knowing this already

#

These are the questions I need answers to

bitter oriole
#

Kinda skeptical too that BR games in 2021 is the thing you want to bet millions on but hey

#

It's not my money

pallid mesa
#

tbh, didn't see the word money anywhere xD

bitter oriole
#

I kinda explained that I think

#

100 players in game = need at least 1000 online = need like 100k sales

pallid mesa
#

Speaking from personal experience... if you get big numbers in marketing, you can get free server deals. I was more like on the side of paying the staff

bitter oriole
#

Getting 100k sales is the costly part

#

Not the servers

#

Servers for games with 100 players are likely not the worst expense in the world

pallid mesa
#

unless it's F2P with MX in mind, which is the actual model pushed by big pubs

#

but yeah, not very feasible

bitter oriole
#

Then you literally need millions of players

#

And monthly events

#

And a good store with lots of content

#

But sure

pallid mesa
#

given that you expect income per say... maybe it's just for portfolio consolidation. That can happen

bitter oriole
#

No it cannot

pallid mesa
#

well it happened to me

bitter oriole
#

You got thousands playing your portfolio project ?

pallid mesa
#

yes

bitter oriole
#

At the same time ?

pallid mesa
#

not concurrently tho haha

bitter oriole
#

My point exactly

pallid mesa
#

I think max was 4 servers full (64 player per server). Quite humble, but the release was a disaster

bitter oriole
#

The only thing I'm saying here is that BR games specifically only function at a huge scale that imply a huge ability to get players - that shouldn't be a very controversial opinion

#

But OP has a publisher and large team so maybe it'll go well

pallid mesa
#

if marketing is great, sure

#

you can look-it-up my case, the infamous Galaxy In Turmoil.

bitter oriole
#

There's a reason I'll never do more than 4-5 players cooperative

chrome bay
#

Can't beat a good PVE horde mode

pallid mesa
#

πŸ˜…

#

yeah, that's trendy now and I f* love it

chrome bay
#

Epic don't get nearly enough credit for kicking off that format IMO

pallid mesa
#

right

chrome bay
#

Not that PVE didn't exist before ofc

#

But then of course.. you have to do AI too

#

as if MP wasn't hard enough πŸ˜„

pallid mesa
#

well in this game I mentioned above, I was forced to do AI because the servers were getting emptied pretty fast

#

it was a crunch fest, and someone as me that didn't touch AI at all, It was all pretty rough

#

glad I'm not touching that project again xD

#

althought this seems more of a #lounge conversation

viscid escarp
#

Hey guys! I have a RPC with Client replication, and whenever I call it, both Client and Server reads it, even when the actor is owned only by client. It should'nt be readed just by Client? I'm using 4.26.

tight glen
pallid mesa
tight glen
#

I’ve actually seen this game. Congrats it looked really cool.

kindred widget
#

@viscid escarp Need to see what you're actually calling on what to understand why it would do that.

viscid escarp
#

I suppose that only the owning player should create the widget

violet sentinel
#

actor component can have NetMulticast RPCs in them?
The owning actor is set to be replicating
The component is set to be replicating
but neither OnReps nor Multicasts do not trigger on client (multicast only on server)

chrome bay
#

they can yeah, same features as actors

#

Don't even have to be replicated to call RPC's if they are default sub objects

violet sentinel
#

if actor won't be replicated won't it fail to broadcast (as there will be no relevant actor on client) ?

kindred widget
#

@viscid escarpI am not sure what your BasePlayer is, whether it's a PlayerController or Character. But either way, it's usually best to avoid networking when it comes to UI displaying. Your AHUD should handle adding stuff to screen and creating important widgets. Your networking should just be basic values for the most part that are sent to client.

#

The rare time that I'd say networking should display UI directly is in the case of like a network wide message.

violet sentinel
violet sentinel
#

nvm, someone unticked replicated on component in blueprint class hierarchy chain.

#

πŸ€¦β€β™‚οΈ

pallid mesa
swift turret
#

Hey, i have a problem with Destroy Session. Destroy session doesn't work for me. Server is still on (listen server) and when server quits a game (changes map), all players are moved with him to menu level instead of just staying there (they should stay offline on map, without server)
Any ideas what i need to config?

violet sentinel
swift turret
#

i have it on, but there is no problem with travel

#

the problem is that destroy session doesnt work

#

it doesnt destroy a server

#

it still works

#

im using advanced session to create server

violet sentinel
#

why are you destroying session ?

#

when server is gone all clients handle disconnect and return to menu (default map)

#

you can try change it in HandleDisconnect

sinful tree
#

Are you spawning the building on the server?

rancid flame
#

What is the correct way to make an ALS character face a direction and have it replicated over the network?

steady briar
#

when an actors net relevancy changes, is it spawned and destroyed on the client? like, would beginplay and endplay work for it

violet sentinel
#

i think setting focus point would do that or rotatetofacebbentry

violet sentinel
#

still spaghetti in places but works better

steady briar
#

neat. thx

rancid flame
rancid flame
# violet sentinel check out https://github.com/Sixze/ALS-Refactored/

Sigh, it doesn't compile in UE5.0EA despite claiming to:

unresolved external symbol "public: virtual void __cdecl UAnimGraphNode_BlendListBase::GetOutputLinkAttributes(class TArray<class FName,class TInlineAllocator<4,class TSizedDefaultAllocator<32> > > &)const " (?GetOutputLinkAttributes@UAnimGraphNode_BlendListBase@@UEBAXAEAV?$TArray@VFName@@V?$TInlineAllocator@$03V?$TSizedDefaultAllocator@$0CA@@@@@@@@Z)```
violet sentinel
nimble parcelBOT
#

:triangular_flag_on_post: Alaa (Alex)#4397 received strike 1. As a result, they were muted for 10 minutes.

cosmic trail
#

Can someone explain for Replication graph what these do:

    PreAllocateRepList(6, 12);
    PreAllocateRepList(128, 64);
    PreAllocateRepList(512, 16);```
Trying to figure out what the first number has to do with the second.
#

Does this have anything to do with the spatialization?

fossil spoke
cosmic trail
fossil spoke
#

Yeah 4.27 it was removed.

cosmic trail
#

Ah, Ok thanks. I should update, wanted to get the oodle network stuff too.

fossil spoke
#

The lists are only used if necessary

#

If 512 isnt enough, declare another large list.

cosmic trail
#

yeah, wanted to understand the numbers I was throwing at it, particularly what that second number meant

fossil spoke
#

We dropped our support for RepGraph as it turned out we didnt quite need it. So its been a while since ive played with it.

cosmic trail
#

Ah ok. Wonder how much rep graph helps now vs. just push model since they seem to try to do similar things, and I'm actually not even using the spatial portion of rep graph since you can see most of the map all the time.

fossil spoke
#

Push Model is different to RepGraph.

#

RepGraph is useful if you have a large world with many replicating actors and connections.

#

Push Model simply requires Programmers to explicitly mark properties when they need to replicate.

#

This helps save on performance as the Engine doesnt bother doing automatic value comparisons in order to determine if a property has changed and therefore needs to be sent to clients.

#

Essentially passing the responsibility to the Programmers.

#

On a per property opt in basis.

cosmic trail
#

Ok. Rep graph sorts it out for the connection relevancy, and push is the ability to skip the checks for properties of actors

fossil spoke
#

Basically.

lost dune
#

Hello , is it possible to bypass the Map Loading at startup and connect the game directly to a server adress at game start?

#

Because the game loads all the map 2 times

meager spade
#

that doesnt sound right..

#

only loads the map once for me..

lost dune
#

The game starts offline because i'm in standalone mode , after its loaded i have to click a button to "open 127.0.0.1" and its loads the server map

#

two map loadings

#

Or maybe have i to run as client?

#

Solved , i simply had to run as client with separate server

warm sequoia
#

Hey guys, i added a build feature to my game, for some reason only the main character is setting builds for everyone to see but when the other players try to build nothing places in the game, only for them. I don't know what is wrong with my replication, all the code is in my player character

elder sage
#

It sounds like your clients are creating the actors, instead of telling the server to create actors for everyone

#

@warm sequoia

#

Could someone tell me exactly which nodes I need to create a listen server and then join it from the client?

twin juniper
#

I know apex destruction is technically deprecated but has anyone had success getting destructible mesh components to fracture on clients after creating the comp and applying damage via netmulticast? Currently I can create the comp for all clients but the damage never seems to be applied so it never fractures

#

FWIW my setup works perfectly running as a client and connecting to a local server within the editor, however if I package the project and connect a client to a dedicated server, the destruct comp gets created but damage never applies

twin juniper
#

Or alternatively, since apex is deprecated should I be trying to use chaos? Last time I tried using chaos it was extremely unstable and would cause crashes consistently. Are there any other options for networked destruction?

vivid seal
#

I've created a basic teleport ability integrated with SavedMoves and NetworkMoveData, but for some reason I am still seeing net corrections. Any idea why that might be the case? Is it normal to see net corrections even with custom moves integrated into saved moves?

this is 100ms lag on each machine, 20ms variance, and 3% packet loss, so if this amount of corrections is normal for that quality of connection, let me know

summer tide
#

SO in my component, if I want to toggle a variable, what's the efficient way to replicate it.

#

So far using server and multicast works.

#

Unless I should move that to char bp

void nest
#

Small question. When a repnotify bool's value is set to say false when it's already false, does this still trigger a repnotify or does the repnotify only trigger when the value actually changes?

chrome bay
#

@void nest By default (and blueprint) - the rep notify only fires when the received value is different from the local value.

void nest
#

Yeah seemed logical, thanks! πŸ™‚

chrome bay
#

You can force them to always be called when the value is received, but a Server still won't send a value unless it thinks the client has a different one.

#

If you want the RepNotify to always be called, you can do this:
DOREPLIFETIME_CONDITION_NOTIFY(AHT_CommandData, NetRequestSyncHandle, COND_None, REPNOTIFY_Always);

spiral timber
#

Are PreReplicatedRemove and PostReplicatedAdd also called on the server for FFastArraySerializer ?

chrome bay
#

no

#

Only ever called on the Client

thin stratus
#

I have a reaaaally strange issue. The Mesh of Clients jitters on the ListenServer.
And I know that stuff like this is known, but here comes the weird thing: If I open the AnimBP and save it, it stops, until I reload the BP or the Project.
Changing the AnimBP to something new and empty also works SOMETIMES.
I disconnected everything in the actual AnimBP, being anim graph and event graph, saved -> Fixed, restarted -> Jitters.

I'm not sure why. I tried with and without the TickPose changes (so native code and with the more aggressive fix), no difference.

It's also only on the ListenServer, but I don#t get why saving the AnimBP fixes it temporary

#

It's so bad that the capsule moves smoother than the mesh....

#

I'm still debugging to get more infos, but right now I don't even know what it could be

#

Do ListenServer and Client use the same Smoothing code? are there any general differences? Some variables that are changed for ListenServer despite the Interp Time (which I set to the same for both)?

rose egret
#

@thin stratus u derived from ACharacter ?

thin stratus
#

Yeah

#

I know about the TickPose stuff, as written above. I applied and reverted the change for ticking it manually instead of via RPC updates, but no effect

#

Maybe I did it wrong though

rose egret
#

by default the default mesh is interpolated for smooth simulation not capsule .

#

maybe you have your own mesh as child of capsule ?

thin stratus
#

No it's the Mesh itself

rose egret
#

πŸ€”

thin stratus
#

I know only the Mesh and ChildComps of that are smoothed

#

It feels like the Mesh position is fighting with an new and an old location

#

But if it was code driven why would it resolve by just saving the animBP

#

And if it's the ANimBP, why only the server

#

Freaking annoying issue

#

Hmmm

#

So I added a Sphere/Cube to the Mesh and the Capsule, to see the smoothing in action. The Client actually doesn't smooth the Server o.o

#

Sphere and Cube remain fully inside each other. For the Server seeing clients you can actually see how the sphere (mesh child) gets smoothed and follows the cube (capsule child) delayed

winged badger
#

@thin stratus host sees the client jitter?

#

there is this thing with listen servers where the CMC update from client actually Ticks the Skeleton

#

if the client has low framerate, i don't think the problem is solveable

thin stratus
#

Yeah I know about that

#

You can comment out hte TickPose call in the MoveAutonomous function

#

And then set the boolean for not ticking the pose for autonomous to false in your character

#

That way it should work normally. it also looks fine if I save the animBP

winged badger
#

this is obviously in editor test

#

have you looked at what callbacks anim BP throws when its saved?

hexed pewter
#

Say I wanted to make a platformer for 2 players, but my moving platforms are very stuttery on client. Do I use some kind of prediction for that, like building something similar to UCharacterMovementComponent but for boxes?

thin stratus
#

Okay so it stops doing it if I disable the listen server smoothing

#

which makes me think it has to do with that

#

I'm confused as to why the Clients don't smooth other clients in this project

thin stratus
#

It's way too much for a simple platform

#

But you would indeed try to interpolate the visuals over time

hexed pewter
#

I see, at first I thought it should be quite easy, but now that i think about it, its not. I'm nowhere near that level of expertise to even try writing something similar to charactermovement. Kinda bummer because that makes me think I'll be severely limited in terms of what i can do in my multiplayer project.

thin stratus
#

Again it shouldn't be anything close to that

#

If it's a moving platform that is not controled directly by the player, then the CMC is too much

#

And even if controlled indirectrly if might not be needed

#

It would be enough to take the new location/rotation and interpolate from old to new

#

That's a fraction of the code that the CMC has

winged badger
#

and if its movement is entirely predictable

#

you just need to sync it for one frame

#

and let the clients take over

thin stratus
#

Yeah you could just sync it every now and then and let the client move it by hand

hexed pewter
#

Now i feel encouraged, Ill definetely look into this, I missed the fact that the movement is predictable.

thin stratus
#

trying around with the different debug modes the CMC has, I still can't figure out why the Client sees the Server so perfectly. The Mesh is barely if at all behind the capsule.

#

Other way round, it's sometimes a full capsule radius behind

#

Is the update rate just lower from client to server?

#

Although that shouldn't change anything about how far it lags behind. Feels more like the server uses different interpolation values, while I made sure the two that are avaiable are the same as the clients have

#

Server isn't using SimulateMovement for the Client, which makes sense, maybe there is the diff

#

is that still uptodate? ...

#

Although that's for forward prediction only

twin juniper
#

Hi all, I'm trying to work my head around when to serialize variables.

I understand that when you mark a property as "UPROPERTY(Replicated)" it will replicate itself over the network using it's owner's replication settings (NetFrequency, etc). However, what I don't understand is where does serialization come in? When would I want to "serialize" a variable?

Sorry if this sounds dumb, serialization is quite new to me so I'm just trying to understand it/trying to find ways to utilize serialization, as I've dug through some of Epic's code and seen it a fair bit. Thanks. πŸ™‚

chrome bay
#

Serialize essentially just means "turn this into a stream of binary data"

#

Not that it isn't already.. sort of. You don't really have to do anything special. The only time you might want to do custom serialisation is when you want to compress values, or force things to replicate atomically etc. Usually for bandwidth/cpu optimisation reasons

thin stratus
#
    else if (NetMode == NM_ListenServer)
    {
        // Linear smoothing works on listen servers, but makes a lot less sense under the typical high update rate.
        if (NetworkSmoothingMode == ENetworkSmoothingMode::Linear)
        {
            NetworkSmoothingMode = ENetworkSmoothingMode::Exponential;
        }
    }
#

Okay..

chrome quest
#

Quick question please. You know how physics isn't deterministic at the moment.

I want to know if the LaunchCharacter or AddForce functions in a character are deterministic over a network? i.e. do they use the physics engine or is it calculated movement?

chrome bay
#

Character Movement is all internal simulation

#

But things like AddForce/Launch aren't part of the predicted/replayed sim

chrome quest
chrome bay
#

Well determinism is different to prediction/replay

#

It's deterministic in that if you provide the same input conditions, you get the same output - but so is physics really.

#

But networking in Unreals style really makes determinism impossible, because every factor has to be deterministic

chrome quest
#

Oh, okay. I see what you mean.
Let me provide some context. I'm trying to simulate pendulum motion in a character without using physics constraints (which use the physics engine and physics is a no no for me on multiplayer). Using GAS for the system, would I get the same forces on the character on both client and server?

chrome bay
#

Not really no, you have to build the custom movement completely into the characters movement component

chrome quest
#

Right. So using one of those compressed flags and saved moves e.t.c I can get something reasonable

chrome bay
#

Anything other than jumping, crouching and changing max speed basically isn't supported out of the box

#

At least, not properly

#

You can maybe get it to work

thin stratus
#

That only counts for Client initiated movement though

#

If your movement is server initiated, you can't do much about corrections

chrome bay
#

yeah

chrome bay
#

But that's really an unsolvable problem

#

Character can't forward predict stuff it doesn't know is gonna happen

chrome quest
#

So I'll just have to roll with it and hope for the bestπŸ˜…

chrome bay
#

And it can't be both forward and replaying at the same time

thin stratus
#

We basically have the same issue atm, where we launch an enemy that is hit by the player and you just can't predict it. We gave up and accepted the delay on higher pings now

chrome bay
#

Yeah there's not really a solution to that IMO

#

Outside of switching to a lockstep simulation

#

But then you get input lag anyway so meh

#

But to be honest, have two players with different pings walk into each other and watch the universe divide by zero

chrome quest
#

I don't mind prediction just that the motion is consistent on both ends. Unless that is prediction.....

chrome bay
#

If you want to avoid corrections, both client and server should do it, in lockstep with the character movement sim

#

If something is initiated by the server, that can be near impossible to achieve completely seamlessly.

#

But since GAS does prediction (but doesn't directly interop with CMC), it might be a little better

chrome quest
chrome bay
#

None I know of

#

You can look at UT source code, and see how Epic integrated different movement styles with it

#

like sliding/wall dodge

chrome quest
#

Not sure about performance though

chrome bay
#

SetActorLocation will immediately break unless the server also changes it's location (assuming you're doing it client-side)

#

If you call SetActorLocation server-side, you'll just get a correction

chrome quest
#

It works fine for the vaulting where I am doing it on tick using an ability task

#

With simulated lag.

#

In any case. Thanks for the insight. Both of you. I'll try different things and choose the most consistent method.
I hope I don't regret any decisions.

thin stratus
#

Vaulting is something you usually do via a Montage

#

And RootMotionMontages are handled by the CMC

#

So that could be why you see it properly

blazing spruce
#

Hi all, im having an issue with a Line Trace, i have a system where I have objects that can be interacted with lit up to show it can be interacted with which i have running on my characters base BP, i need this working properly for both server and client but i can still see the line trace as a client if the server player looks at one of the objects, i thought i'd get around that by making the event that calls the line trace function to run on owning client and then calling that event on tick, but that hasn't fixed the issue, and its somehow relating to a crash im having when a client joins the server through steam, has anyone got any idea's how i'd go about getting a line trace thats ran on tick in the characters base class to work properly for both client and server?

#

Here is the log from the Client, which gives a different error but no mention of the event that isn't working

#

Here is the log from Server hosting the session, you can see where i join then get kicked as well as the warning log for this event that isn't working properly

azure hollow
#

hey guys! How can I test my game with some friends on steam without publishing the game? any advice?

twin juniper
thin stratus
#

Not sure what you actually need here

twin juniper
#

basically they need ue4 and the project too

thin stratus
#

it's enough to use the 480 appid

#

But you can also use your own

#

You don't need to publish the game for it

#

You just need to give your friends some keys that you can generate

#

It's enough for them to have the key , cause that allows the mto download the package via steam

#

So they don't need the project at all if it's just for gaming

#

That is not possible for 480 though

#

There you'd need to send the packaged game over to them by hand

#

But again, no need for them to have ue4 or the project

twin juniper
#

i never done it, do they accept wip projects?(steam)

thin stratus
#

They don't care about your project

#

You pay the $100 and then you are fine

#

Given you supplied all the tax shit they need, cause 'MERICA

twin juniper
#

money solves all the problems as usual

thin stratus
#

Yeah, but if $100 stop you from deving your multiplayer project, then you might dev the wrong project :P

#

Or just use 480 in the meantime

bitter oriole
#

Or use EGS, or get your game picked by GOG

#

Or do your own subsystem

thin stratus
#

But EGS needs to accept you or?

#

I guess EOS without any proper Auth method works too

bitter oriole
#

Sorry, EOS, not EGS

thin stratus
#

--

Okay so these values, if set to the same, are resulting in different visuals on server and client:

#

Client sees other simulated clients very close with their mesh to their capsule (location wise).
ListenServer sees autonomous Clients quite far behind (location wise).

#

And quite far being +- the radius of the capsule as distance

#

That's with no simulated lag

#

I just noticed that if you run against a Player as a Client, that the Server extrapolates the Mesh backwards, even though nothing is moving

chrome quest
# thin stratus Vaulting is something you usually do via a Montage

It's a combination. I have only a few vaulting montages so to get it to look right and work properly, I force root lock on the montage and move the capsule with code using set actor location. So the montage is essentially just a regular animation without root motion.

#

It's done in a local predicted ability so..... Maybe that's why it works properly

cinder quartz
chrome quest
pure vigil
#

I have an actor with a replicated boolean. On the server on BeginPlay, it is set to true. Then a client connects - the replicated boolean is still false initially (on BeginPlay) despite it being set on the server prior. Is there any way to force variables to be Net Updated before begin play?

crimson valve
#

If I have a gun, and the player pressed the button to fire it, is the typical approach to issue an RPC to the server (SV_FireWeapon) or is there another way that is more correct?

crimson valve
pure vigil
crimson valve
#

There's also that option to load replicated objects on the map on the client before receiving replication

#

Is this a placed actor?

pure vigil
#

Placed in the map, yeah

crimson valve
#

Yeah, I'd try turning off Net Load on Client. That way the actor won't exist (no BeginPlay) until the server sends the data

#

My guess is that would do it

#

You could also just add a delay loop in the BeginPlay based on a replicated boolean that gets set to true on the server's Beginplay

pure vigil
#

Trying it now, so far seems ok. Issue isn't reliable reproducible. I don't like relying on delays, just feels like a messy solution

#

Oh, delay loop.. yeah but the variable isn't always set

#

So I have no exit condition

odd iron
#

Hello guys how can i make the advanced session joinable from anywhere without Steam ? ..
Im using Playfab to register and transfer session data and IP

crimson valve
#

Yeah, you'd add a second variable server has begunplay

#

or something

#

and that's the one your delay loop would be based upon

#

so it would always be set to true on the server, and would only become true on the client after replication

pure vigil
#

ahhhhh yeah. I think I'd rather just disable net load on client, seems cleaner

crimson valve
#

Yep, if you can do it that way I agree

pure vigil
#

looks like it's working, thanks!

crimson valve
#

The downside to that is if the actor isn't relevant yet it won't exist until it enters relevancy

pure vigil
#

I've always seen that but never thought about the implication

#

Hmm, shouldn't be a problem I don't think...

crimson valve
#

Cool πŸ™‚

pure vigil
#

(knock on wood)

#

Sorry to flood over your question

crimson valve
#

Oh no worries. I'll just repost it

#

Q: If I have a gun, and the player pressed the button to fire it, is the typical approach to issue an RPC to the server (SV_FireWeapon) or is there another way that is more correct? If using an RPC for this, should it be set to reliable?

empty axle
chrome quest
#

Depending on the ROF of the gun, unreliable might be better or you risk flooding the bandwidth with requests. Depends if you're pedantic with hitreg @crimson valve

chrome bay
#

Reliables fine unless it's like 50 rounds a second

#

If it's a shooter you don't want shots missing or never firing

#

We've got 100 players firing 1200RPM weapons in HLL, and that's up to 2 reliables per shot

#

Never been an issue

chrome quest
chrome bay
#

If it's something that crazy then probably want to do something like UT where they tie it into character movement.

#

Or preferably, shoot the designer and ask them to get real

chrome quest
#

πŸ˜‚

meager spade
#

we send 1 RPC per shot

#

no issues

#

projectile guns are 2 RPC's per shot, (snipers, rocket launchers, etc)

eternal canyon
chrome quest
#

I take back my earlier statement then. Misconception.

meager spade
#

cause proejctiles activate the ability, this is one RPC, then 1 rpc for target data + end ability call

#

hitscan, does it one rpc, as its done the same frame

crimson valve
#

Sounds like RPCs are fine

#

I was kind of afraid of sending too much, but it seems like I don't really need to be if that's how yall are doing it

#

One of the cases was player footsteps. Easiest way to do it would be a RPC per footstep trigger. Harder was is to infer the footsteps based on movement on the client.

#

I also had it suggested to me to just use anim notifies on the client, but since my character is a VR character with no legs nor a run animation, that won't really work πŸ™‚

meager spade
#

footsteps as RPC's?

#

those are normally done via the animation and a notify on the footstep

#

as this is ran on all clients anyway?

#

you can just fake it tho

#

even with VR

kindred widget
#

Even something as simple as a constant distance check from the last footstep sound on the client would be better than RPCing that.

summer tide
#

So If I have a custom component added to my character. in that component. Is that server and all clients or diff than pawn?

cosmic yoke
#

hello, i have lobby map with a weapon loadout section. once the player finishes picking the loadout it can press a button to server travel to the game map and the player's character should use that loadout. what is the best approach to do that? i assume it's either storing just that player's loadout on the game instance or in disk of the client and when the character spawns the client gets that information and tells the server what to spawn?

fading birch
#

@cosmic yoke how complicated of an answer do you want?

cosmic yoke
#

as best as you can do πŸ˜„

fading birch
#

well, first and foremost you should never trust the client with any type of data. They could easily cheat and give themselves weapons they haven't unlocked/earned yet.

#

There's a few ways to approach a loadouts option.

#

You could have a lobby server the client connects to and just have the server display what they can/can't use, then connect to another server from there.

#

The best way i've personally found is to store that loadout data in a database that the server and read/write

#

when a client joins, the server fetches data about the client from the backend, in this case loadouts, then sends that data to the client, showing them which loadouts they can use

#

if you don't want to go the lobby server route, it gets more complicated

#

I would still recommend using a backend to store the data

#

whether that be a database, dynamoDB, w/e

#

but you'll need to run checks on your API server that's writing to the database, you should never write to a database directly, to ensure the player can actually use the loadout they've built.

#

Which becomes an annoying mess to maintain.

#

does that answer your question?

cosmic yoke
#

what could i use in the db to identify the player?

#

ip?

#

steam user?

fading birch
#

I would use their uniquenetid

cosmic yoke
#

that's generated by unreal?

winged badger
#

steam OSS will get the steam ID there

fading birch
#

The uniquenetid be the same each time you log into that specific online subsystem.

winged badger
#

but generally, you want the loadout struct of some sort

#

along with a function that can fully equip the player taking that struct in

#

and you also want all loadout data thats static stuffed into data assets/tables

#

so that your loadout struct just refers to data rows/entries

#

that way its much easier on the network

fading birch
#

Yup. You should still store all that stuff in a database though.

#

Personally I've just converted it to JSON data and sent it to my rest api

winged badger
#

in case you're using seamless travel, which you should be doing

#

then the server can just stuff the loadout data into playerstates that will persist through seamless travel, or at least long enough to call copyproperties

fading birch
#

Yeah once the server actually has the data, it's just a matter of attaching it to the playerstate and persisting it between levels

winged badger
#

and the loadout data arrives on the game level before the characters need to be spawned

#

without any writing to disk shenannigans

quartz smelt
#

When I have a player join a session, it sends them back to the main menu. Is there a reason for this??

winged badger
#

there is, and its probably your handling of the callback when client joins a session

fading birch
#

I would check the logs

quartz smelt
#

Ah alright, ty

quartz smelt
#

"LogWindows: Failed to load 'aqProf.dll' (GetLastError=126)
LogWindows: File 'aqProf.dll' does not exist
LogWindows: Failed to load 'VtuneApi.dll' (GetLastError=126)
LogWindows: File 'VtuneApi.dll' does not exist
LogWindows: Failed to load 'VtuneApi32e.dll' (GetLastError=126)
LogWindows: File 'VtuneApi32e.dll' does not exist"

What should I do with this information

winged badger
#

with that? nothing, its unrelated

quartz smelt
#

those are the logs

#

Well not the full logs obv

winged badger
#

well, you want the bit starting with joining a session

#

and ending with loading main menu

quartz smelt
#

alrighty

fair lantern
#

I have a combo counter for my attacks to determine the montage selection of attacks. The combo counter works fine for the client to server replication but always retrieves an INT of 0 upon every execution of the multicast. Does anyone know why this may be happening?

#

do i have to physically pass through the integer through the replicated function?

royal vault
#

Greetings, how would one approach creating a local health bar UI in multiplayer that runs independently on client and server. Client labelled RPC and β€œreplicatedusing= β€œ have already been tested and it only replicates the servers health. Please help, there are no resources anywhere about this!

empty dove
#

CreateSession and JoinSession not working in LAN with OnlineSubsystemNull. Tracing through the code shows that no GameNetDriver is initilized. Why this may not be working

elder sage
hollow eagle
elder sage
#

the best way I think to do it is to have your server apply the damage in the first place, just server rpc the "apply damage" node and then it should be used to update your Health variable, which is onrep. Your onrep Health then runs either a BPI or custom event to update the bar to the new value

#

I don't know many C++ functions btw but you can probably translate it to that from BP easily

elder sage
#

so the highlighted nodes should work for my basic usage, right?

#

I don't necessarily feel like packaging to test in MP and then having it not function past the menu

quartz smelt
#

Is there a way to have the client possess a character?

rocky night
#

if i have some eents in the mp character bp and get player controller. Will this coutn online for al players or just the client who is playing his cahracter?

small mirage
#

Get player controller references the player with index 0
You would need to assign your players an index to reference them correctly via get player controller
Otherwise you always reference the player that has joined first so to say

swift turret
#

I think there was a little miscommunication yesterday.
The problem: I have a P2P game (using advanced session to create server), and when the host leaves a game, all players (clients) are automatically send to main menu level.
Needs: I dont want that. I want them to stay on that map, without a server, just local game. I want to show them a UI saying "The host left, now click this button to back to menu". Because if they just change the level, the know nothing. It looks like a bug for them.
Problem again: Destroy Session doesnt work - when i call it in editor (or steam), the server still works, the clients are connected and all things are replicated. I want to shutdown the server before host leaves a Main Map to make sure that clients will not travel with host to Main Menu.

bitter oriole
#

So first you don't have P2P, you have a listen server

#

Second, you can do that but not easily or without engine changes

#

Third, sessions do nothing in editor

#

Debug with -game or right-click uproject / launch to run without editor

#

As to the main thing here, clients don't follow the host to main menu - the engine just puts you back to the entry level whenever you disconnect. You can easily edit the engine source to make it pick say, the last level, but you're still going to have a hard level reload with loading screen and gameplay reset

#

And you cannot control the timing of that since the host may simply have had its power cut or the network went offline

#

So you have three paths here - dedicated servers, ignoring the issue, and undergoing engine changes to implement some sort of host transfer

rocky night
small mirage
#

Index 0 for listen server will be the Hosting Client
But right now im not 100% sure whether running get player controller with index 0 on client only will give you a reference to the listen server or the client running it
Havent used it for a while, as I tend to use "get controller" when possible or just have an index stored for each connected player

rocky night
#

yes i also struggle here, in local the playercontroller will be added p 1pc 2 pc 3 ect.. but in online its always 0 as i know---- thats whast make it now hard πŸ˜„

winged badger
#

while seamless travel is in progress, it might not be

#

use GetGameInstance()->GetFirstLocalPlayerController() instead

#

imo, the only good practical use of GetPlayerController[Index] is when iterating over all controllers from blueprint

#

every other use has a cleaner, safer, or faster approach

#

*there might be some cases where it is practical during a split-screen MP, with multiple local PCs

thin stratus
#

So I'm still wondering why the interpolation time for ListenServer and Clients on Smoothing, when being the same value, is super different in terms of the result :(

#

Epic does a poor job here on actually explaining what the difference is.

    /**
    * Similar setting as NetworkSimulatedSmoothLocationTime but only used on Listen servers.
    */
#

It's similar, yeah, but the value is not doing the same. Setting them both to 1 second, the Server has a huge delay, which nicely shows the smoothing and the client still nearly sticks the mesh to the capsule

winged badger
#

just as useful tho

thin stratus
#

:/

#

I also just have a DebugGame Editor build that still doesn't give me all debug info.
Lovely

winged badger
#

thats odd. whats missing?

thin stratus
#

const bool bIsListenServer = (ClientMovement.GetNetMode() == NM_ListenServer);

#

I just can't get that boolean value

#

I know it's true based on following lines by now. But still, why is that optimized away

winged badger
#

you can probably grab it from outer scope and put into watch

thin stratus
#

Either Epic didn't implement the smoothing correctly, or the Time variables are totally not "similar"

#

I can literally run around my mesh as the capsule when setting the time to 1. It's like a 2-3 second ghost that follows me

woeful ferry
#

I might have this all wrong, but I’m having a discussion with someone on notifies/multicast.

My take is that a reliable multicast is bad for updating UI due to you never know when the data arrives to the client, and a repnotify would be a safer choice.

While the other guy says you should just use a multicast because it’s just a matter of small ms differences.

#

I’m eager to learn more if I’m wrong

chrome bay
#

RepNotify is always a better choice than a reliable multicast

woeful ferry
#

Yes, that was my thought

chrome bay
#

But broadcasting events to update the UI only is a bad design anyway

#

UI should update itself locally

#

Based on the current status of the game

woeful ferry
#

Yea, but I guess I’m not gonna argue then. Doesn’t seem like he has grasped it even after all my explanation πŸ˜…

chrome bay
#

Yeah if you already have the data being replicated, use a rep notify. Apart from a reliable multicast being expensive, there's no garauntee whether the property or the multicast will arrive first, and it's wasteful if a repnotify is already there

#

RepNotify is entirely client-side, they have zero bandwidth cost

woeful ferry
#

Yea, that was my point all along. But still gives me the argument its just a matter of ms. I’m giving up on this πŸ˜‚

chrome bay
#

If someone is telling you to use reliable multicasts to update a players' UI, they have it all wrong πŸ˜„

restive breach
#

How can I replicate Client Rotation on the Server? I'm changing in specific function a Capsule Component World Rotation. But I have a problem that this rotation does not replicate on the server-side.

woeful ferry
restive breach
#

I'm a noob, so, resource about this.

#

Or.

#

Explanation. Will appreciate.

woeful ferry
#

Hold on

restive breach
#

Roger that.

woeful ferry
#

This is in BP though

restive breach
#

Very appreciate.

blazing spruce
#

Anyone know what this error is? this is from the clients log when losing connection to the host for some reason

empty axle
restive breach
woeful ferry
restive breach
#

For to change Pawn Rotation.

#

No?

#

Does exists more good way?

woeful ferry
#

it's already replicated by default with replicating movement afaik.

restive breach
#

If yes.

#

It doesn't work.

#

Rotation changes on Client-side.

#

But not Server-side.

restive breach
woeful ferry
#

Rotation of the player is already replicated

restive breach
#

What's the problem?

chrome bay
#

Are you using a Character or a Pawn?

#

Important difference

restive breach
#

Character.

chrome bay
#

Then you're not supposed to do anything with world rotation/actor rotation

#

It's all done internally within the character

#

All you have to do client-side is call "Add Movement Input" and "Add Controller Pitch/Yaw" etc.

#

Character Movement handles everything else

restive breach
#

Okay, thanks, now I need to figure out what I did wrong.

#

@woeful ferry @chrome bay
Thanks.

restive breach
chrome bay
#

You use control rotation

#

Which is automatically sent to the server via character movement as part of the networked movement code

#

Even the FPP character sample will work in MP out of the box, Epic have done everything for it

restive breach
#

And my character rotates.

#

To the mouse's impact point.

chrome bay
#

You have to set control rotation

#

Not the actors' rotation

restive breach
chrome bay
#

No

woeful ferry
#

Player controller

chrome bay
#

GetController->SetControlRotation()

woeful ferry
#

yea

restive breach
#

Oh, thanks.

#

My bad.

thin stratus
#

The ControlRotation caught me offguard a few years ago too, when trying to rotate players to face spawnpoint rotation >.>

chrome bay
#

For some stupid reason, 'ControlRotation' is a property of controllers. The character has an option to align itself with control rotation which is handled by character movement

#

I think it's a legacy thing that's just stuck

#

But it's an irritating part of the framework IMO

thin stratus
#

It's useful for characters that have that upper body rotation I guess

chrome bay
#

Should just be AddLinearInput and AddAngularInput IMO

#

Yeah

#

Even then they could just separate aim vs actor rotation at the pawn level.. but yolo

thin stratus
#

So UT shit :D

chrome bay
#

yeah

thin stratus
#

Or just use the Controller Rotation

#

Instead of making a Rotation on the Controller

bitter swift
#

I tried opening a new project to test AddForce.
I applied force to an object through Server and observed how far the object flew.
Then I did the same thing, only now I had 9 additional clients.
This time, despite only running once on server, the object flew WAY further. I am positive that the add force is somehow multiplied by the number of clients - despite only running it on server.

Does anyone know about this issue?

thin stratus
#

For the viewtarget stuff you'd need the controller rotation anyway

#

What Object are we talking about

#

And what Force

restive breach
#

Thanks, guys, now, finally, this works. You prevented me to do shit-code. Brave men.

thin stratus
#

Afaik Force added through the CMC is different than Force added to a Physics Component

#

And on top of that: without you showing your code, I blame your code

#

Had too many peeps that said "Engine has a bug" and then showing their buggy code >.>

bitter swift
#

I have no intention of judging an engine I love. I only wish to understand it ❀️

thin stratus
#

So that's a Physics Simulating Object?

bitter swift
thin stratus
#

Keep in mind that Physics and Multiplayer aren't something you want to mix

#

But that aside, does the Server keep the same FPS with the 9 Clients?

bitter swift
thin stratus
#

stat fps in console

#

My random idea would be that the Server has less FPS and physics is just shite and doesn't compensate?

#

I would suggest you don't use physics, but use the ProjectileMovementComponent

#

That is at least somewhat networked with smoothing of the Mesh

bitter swift
#

fps is 30 when i play with 10 players.
it's 120 when i play alone

thin stratus
#

Yeeeeah,

bitter swift
#

Ah I see. This would explain it

thin stratus
#

I can't 100% say that's the problem, but would be my guess

bitter swift
hexed pewter
#

How should i handle "broadcasting" back to clients that a gun is being fired on the server and it just spawned a projectile?

What I'm doing now is calling server_RPC from client that asks server to handle shooting;
then server checks if everything is alright and proceeds to fire/spawn a projectile;
everything works just fine, because projectile actors are being replicated on creation, also its movement is replicated;
damage is further handled by replicated variables on pawns, so the damage should only be dealt on the server.

But say i wanted to also play a sound/animation back on clients after the upper mentioned gun is fired.
Now I think I could either do a multicast and report back to clients that they should play appropriate effect,
or I could fire the effect in RepNotify. Which is better? I know that multicast is more costly, but repnotify has its own issue with not being guaranteed call repnotify at the same exact moment.

thin stratus
#

Okay soooo

#

First of all, for the local client you don't want to use any replication for the visuals

#

The RPC + the Replication back to the Client might take quite long

#

You want to predict the shot

#

Means you client, in addition to running the RPC, should also check if it can fire, and should then perform a fake shot basically, playing animation, sound, VFX.

#

In addition to that, you can replicate the firing down to the SIMULATED Clients via OnReps

#

I think a good way of doing that is to have an Integer which you increase with each shot, and set back to 0 if you stop

#

In the OnRep you can then filter the owning player, cause they predicted already

hexed pewter
thin stratus
#

And either start a looping effect, e.g. a weapon that fires until you release the key, or a single effect, e.g. a pistol.

#

Yeah

#

And UT does it similar to that too

#

What I usually do to help with this stuff is to cut the whole thing into multiple functions, and then picture (or even actually draw) what should happen when. You can usually reuse all your functions. e.g. the playing of the sound can be reused. Just have to call it in 2 different places.

hexed pewter
#

Does that mean i only have to predict on the exact client that fired the shot, so the feedback is instant? Then i could call a server rpc to check if its valid and eventually fire repnotify from server to replicate to all other cleints except the guy that did actually fire (he already has his local simulation)?

thin stratus
#

It also helps to simply leave a comment above you function with // SERVER ONLY // SIMULATED ONLY // SERVER AND OWNING CLIENT etc.

thin stratus
#

Server and Owning Client would run the same code

#

But you put Authority checks in place

#

To make sure the Local Client doesn't spawn the Projectile and stuff like that

#

Or set the OnRep variable

#

But you can even predict the ammo count with this

rocky topaz
#

how come the physics of cubes aren't replicated in the First Person Template?

#

even though their physics are set to be replicated

#

even after enabling static mesh replication too

bitter oriole
#

It's somewhat doable with some engine changes but it's never going to be an engine feature

#

UE5's new physics engine is pretty much built to make it possible, though it's also not nearly there either

rocky topaz
#

awh but that's not the only problem, the location isn't replicating whatsoever

#

I would have assumed it would at least update from time to time

#

...

#

nevermind I was playing in standalone mode

#

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

#

what would you suggest as a base to make a multiplayer FPS game? I took the FPS template but I feel like I might need to merge some functionality from the TPS one (and the animations)

#

should I perhaps go with neither and build my classes from scratch?

bitter oriole
#

But starting from scratch can also be welcome if you'd rather add functionality cleanly step by step

rocky topaz
#

I want to add functionality cleanly I think, but I'm afraid I'd mess things up

bitter swift
#

@thin stratus I can launch my stuff successfully with a projectile component (KnockbackComponenet), but if I enable physics, then it won't move.

Is there a better way you can recommend?

thin stratus
#

You shouldn't use Physics at all

#

The Projectile Component already moves it just fine

floral crow
#

I feel this is gonna be a dumb question, but I couldn't find the answer. Is there any event that runs client-side when the client looses connection to the server?

chrome bay
#

Noop

#

Well, HandleNetworkError in game instance

floral crow
#

The heck, HandleNetworkError is just blueprint implementable? Is there no C++ event for "I lost connection, let's display that to the user so they know they've lost connection, and do some error handling" ?

chrome bay
#

There is, just check where it's called from

floral crow
#

Yeah, at least I now have a lead with this event. I'll go up the chain, ty!

swift turret
ornate hearth
#

Hi, I'm new to unreal engine and I'm trying to make small games with blueprints in multiplayer, I would like to be able to make a client have control over an actor's mesh transform and have the position sent to the server.
Is there any way to replicate transform from Client to Server with blueprints?

kindred widget
#

@ornate hearth Replication only goes one way, Server to Clients. You can however have your Clients do a ServerRPC from a client owned actor with the transform.

#

Which could then set the value on server, and let that replicate to Non Owner clients.

ornate hearth
#

Thanks, I will investigate, I guess it is done this way to avoid cheating, in unity at least it was possible to replicate from the client to the server.

kindred widget
#

You get used to the nuances quickly.

plucky tree
#

Greetings, everyone!

What UE4 multiplayer learning resources would you recommend? I'm going through Tom Looman's "Creating Multiplayer Games" on Udemy but it has about 10% of its content dedicated to multiplayer, which is not much πŸ™‚ I found "'Unreal Engine 4' Network Compendium" on the Internet and will read it once I finish the course but is there anything else you would recommend? C++-focused, if possible.

rocky stag
#

What is the best way to send client data to game server in ue4 ?

bitter oriole
#

The only way is a server function on a client-owned Actor

rocky stag
#

you mean not player state or game state ?

bitter oriole
#

Game state cannot work for that indeed

#

Player state should work well, though it's usually either Player Controller or Pawn

#

Or any actor owned by them

rocky stag
#

thanks for helping πŸ™

blazing spruce
#

Hi, if im trying to set up sessions to make it so once the session has started other players can no longer see the session listed on the menu, where is the best place to destroy the session?

vague spruce
#

i asked this in the GAS channel but i wasnt able to get an answer. i have a projectile that's a server-side authoritative actor and i need to execute some code only on the local simulated proxy. it needs to happen when the simulated proxy is being destroyed. is there a way i can do this? the problem i'm having is that OnComponentBeginOverlap only fires on the server, and technically when the projectile is destroyed i always want it to display an effect so i don't need server authorization to play the effect. the effect also needs to happen on all clients, so in order to avoid using a NetMulticast i just want to do something on the simulated proxy

vague spruce
#

EndPlay is only called on the server currently and BeginDestroy is only called on GC

rich locust
#

is this project replicated ?

vague spruce
#

yes

rich locust
#

why

#

just spawn another one on the client

#

it doesnt need to be %100 accurate

#

it would lag the player

vague spruce
#

oh that's a good idea

#

that's a great idea, thank you

rich locust
#

dont replicate a projectile

#

unless it is absolutely necessary

vague spruce
#

let me try this now, uno momento

#

@rich locust you're a genius, thank you. i have other issues now but they're related to GAS

tranquil beacon
#

I'm trying to spawn an object for each player at the start of play. I'm running the spawn object command by starting with a simple Server execution event, which is triggering a Multi-cast event. Inside the Multi-cast event is where I'm actually spawning the object. The object is set to replicate and always relevant. When I test, the server sees everyone's object and their own. The clients see the server's object, other clients' obejcts, but not their own. Why wouldn't they see their own object if I'm multicasting?

amber slate
#

can i use steam online subsystem and use the default app id, and post my game on itch.io

winged badger
tranquil beacon
#

The server RPC starts from the player that needs to spawn their own object. Server executes a multi-cast event that spawns the object. Everyone sees it except for the player that initiated the RPC

#

I've seen in other examples the multi-cast will be excluded from the "local" player and the local player will just run the event locally, I'm assuming so they're not waiting for the server to return the object. I just don't understand why my method wouldn't work

winged badger
#

from the player = PlayerController, Character, PlayerState? whats the entry point

tranquil beacon
#

I think it's a character class. It's a custom character though, so maybe there is some unique code blocking the replication?

winged badger
#

what triggers the server RPC inside the character? doesn't matter if its custom or not

tranquil beacon
#

I have a child actor attached to the character. This code is inside the child actor. It's triggering the RPC after one of the child actor's components finishes "OnComponentInitialized"

winged badger
#

if the object is supposed to be replicated

#

you should spawn it from HandleStartingNewPlayer in GameMode, after calling Parent

#

you should avoid using child actor components in MP, as they are... temperamental

tranquil beacon
#

Would I also use the GameMode to do this if the object needs to be respawned regularly? It's a usable object the players will throw, then it is destroyed after use, and another object should spawn for the player to use.

winged badger
#

have the object call an event dispatcher when its thrown or destroyed

#

have the gamemode bind an event to it as soon as it spawns it, and spawn a new one (binding an event to the new instance) when the event fires

tranquil beacon
#

Awesome, thanks for the advice, I'll give it a shot!

fleet viper
#

i just dont get it i tried it in every way i could imagine yet my characters damage events wont register any damage, anyone has an idea?

#

welp it wont register it only on itself

sinful tree
fleet viper
#

yes i know i did it for testing

sinful tree
#

Check your radius, check your damage amount, check your origin.

gray orchid
#

so im kinda new Unreal and I want to make a random game join for my fps game dose anyone know how to do that

quartz smelt
gray orchid
#

ok

rocky stag
#

can i change netowningplayer class (UPlayer) ? . this class is passed by Login function in GameMode.

kindred widget
#

@gray orchid Sounds like something where you would just get a list of sessions that are active and select on based on criteria and join it. Failing that, create a new session for others to join. Some older FPS console games do this, and might have a checkbox for "Prefer Hosting" or "Avoid Hosting".

elder sage
#

I tested my project on another machine and I notice that the client's base movement is really jittery. What's the correct way to set up movement replication, so that it doesn't get corrected at that rate?

wooden charm
#

Hi
I'm new to ue4 and I'm having a problem
I'm pretty sure its an animation or multiplayer issue, but idk
When I play with two or more players and I do an animation on one, it does the animation for all players, but only shows on the original players screen. It only happens with 2 animations (crouch & crouch walk) any ideas about what the problem is or how to fix it?
Heres a vid of whats happening.

vague spruce
#

Hello. Do player controllers get replicated to all connected players like the player state does?

hollow eagle
#

no

#

player controllers only exist on the server and the owning player's client

wooden charm
elder sage
#

could someone help me figure out why this variable isn't being changed, even if the criteria are met? It's in my game mode, so shouldn't the server be able to change its value?

clever plinth
elder sage
#

I actually ended up figuring it out. It was something unrelated

left marsh
#

Hello, I need some networking clarification. I have an actor that is replicating (a thunderball). I need to be able to attach a component to it on the client that does not replicate to handle a visual effect. How can I do so?

fossil spoke
nimble parcelBOT
#

:no_entry_sign: Garrett#8803 was banned.

left marsh
#

thanks, bot

fossil spoke
#

That was me

hollow eagle
#

lol that was fast

left marsh
fossil spoke
hollow eagle
#

hehe

fossil spoke
left marsh
#

wasnt sure if there were any consequences

fierce grove
#

hello guys do you think that you could "replicate" locations with Firebase for Micro instanciation on 2D game Or simple 3D topdown ?

hardy valve
#

Hello Everyone! Any clues why the Hosts pawn doesnt replicate the Yaw/Pitch rotation to the clients? the client hosts does to both Server and other clients πŸ˜„

finite goblet
#

What is the best way to counter race conditions arising from replication delays of game framework actors like game state, hud,player state etc. That may or may not have been spwned on a newly connected client

chrome bay
#

Just have to code around it. If something isn't available currently, try again later

#

A common approach is have those actors notify some centralised object that is always accessible when they first arrive on the client.

#

I use a world subsystem for it

#

And have an optional callback option when the actors are received

finite goblet
#

I just use delegates in game instance for it and I wondered if there was a better approach that I didn't know of

chrome bay
#

Seems fine to me

#

GI might cause problems in PIE though. Best to confine it to a UWorld lifetime

sweet ore
#

how can i make host and join? (i made one but it says you need public ip. when i put my public ip i need to open port 7777 and opening port is very hard i tried to do it but i don't think this is the method because other games do it without me or my friend opening ports) sorry for long explaining

finite goblet
#

Or change port to something that is already forwarded

#

Or if you are just testing, use a VPN that offers dedicated IP with all open ports

kindred widget
#

@gray orchid I would assume so. Sessions are just data about servers you can connect to. I mean consoles have done this at least since UE3. It's just the idea of getting available sessions, and sorting them based on your decided criteria. A fair warning, this is much easier in C++, but it may be fairly easily doable in BP.

gray orchid
#

umm ok

#

I can try

gray orchid
#

@kindred widget dose this look right?

kindred widget
#

Vaguely. You'll need a lot of extra checks. And you'll probably want to create a sorting function to filter down session results.

gray orchid
#

how would I do that?

lucid pewter
#

Hey folks I made a listen server, now I would like to know the procedure to enter from distant computers... between me and me it works, via IP

kindred widget
#

I don't remember what all data is available on a session to start. I vaguely remember that in BP you can specify extra options. That might be using Advanced Steam Sessions though. Just take the results array for instance and iterate over it. Remove sessions in an order you want based on whatever data. Then just pick one at random from whatever is left.

round star
#

question about multiplayer and players. Should the controls for the character be done through the player controllers or the character or does it not really matter

gray orchid
#

I cant get it to work I have looked for videos online but I can't find any for random join

sinful tree
pure vigil
#

(sorry in advance for the wall of text)

I'm seeing an issue testing multiplayer using 3 clients on my machine. All players connect to a server lobby, this works fine. Then when the host starts the game, a ServerTravel is executed. Then, the server loops through each PlayerState in the GameState's PlayerArray, looks for an appropriate spawn point, spawns the player pawn, then uses GetOwner() on the PlayerState to get the controller and has the controller Possess the pawn.

9 times out of 10 this works fine. But in testing with multiple clients locally, I think I have accidentally found a potential timing issue. Since there are multiple clients, each one is performing slower than usual. Probably taking longer to process the level transition. I think the end result is that the Possess gets called before the client is in a ready state. Then by the time the client is done loading it missed the boat on possessing the pawn and I think even the pawn gets destroyed because the controller isn't valid anymore.. not super sure.

I've run into this issue before where the server thinks everything is happy but the client isn't actually ready yet. In the past I've done workarounds like having the client run an RPC to the server to basically say "I'm done loading!" which has always seemed crummy to me. Not sure if there is a better alternative though.

#

I'm thinking I need to overhaul my logic to use PostLogin and/or HandleStartingNewPlayer to determine when a player is ready rather than just trying to spawn stuff hoping it is

gray orchid
#

can somone pls explain how to make a random game join like in most FPS game?

#

I can't seem to get it

pure vigil
#

Your servers should be using "Create Session" to .. well, create a session. Then if you want others to join they should use "Find Sessions" which will give you an array of results. You can pick one at random from the array and use "Join Session" to connect to it. For further explanation I'd suggest watching a video like https://www.youtube.com/watch?v=tcVEP2fqYmA (havent watched myself but it was the first search result)

In this series we are setting up the connections for online multiplayer using the base Steam sessions that come with UE4.

In Part 1 we put together the basic components and the menus for the online multiplayer connections.

SUPPORT ME
Patreon I https://www.patreon.com/ryanlaley
Buy Me a Coffee I buymeacoffee.com/RyanLaley
Donations I paypal.me...

β–Ά Play video
gray orchid
#

ok thanks

pure vigil
#

Also if you're new to UE4, multiplayer can be a high hurdle to tackle, just something to keep in mind

sterile plaza
#

I'm playing around with initial replication timing to try and simplify OnRep logic.

What I understand to be true:

  • Replicated variables set on an actor before BeginPlay will be available to clients during their BeginPlay
  • Subsystems on the server have been created by the time actor BeginPlay is called, but at this point is too late to be part of the initial replication

What would be nice:

  • Is there a time where subsystems have been created (and can thus be used to generate variables to be replicated) but before actor BeginPlay has been called?
lusty badger
#

Something like the team you are currently on, it should be stored in the PlayerState and managed by the gameMode, right?

gray orchid
#

what are advanced sessions?

lusty badger
#

So... If I want the GameMode to assign a team to a player when It connects, I have to use the onPostLogin() and get the PlayerState from the PlayerController and assign the variable, right?

lusty badger
#

It let you do some things like manage steam and so on blueprints

gray orchid
#

oh ok

#

nothing I do works

dark edge
dull lance
#

Also largely depends on the online subsystem that you're using

#

whether it's listen server vs dedicated server, etc

dull lance
#

they'll have to pretty much write it from scratch

gray orchid
gray orchid
#

dose UE have multiplayer videos that do random join?

vivid seal
#

Asked a similar question a few days ago but never saw an answer. What net settings do you guys test on (pktlag, pktloss, pktdup, etc.), and when using CMC how often do you expect to see net corrections with your test lag settings? I have been doing 200ms, 3% loss, 20ms variance, and I see a LOT of corrections, but for the most part the gameplay still feels alright (not jittering too much).

gray orchid
#

ummmmm can you simplify that for a 14 year old who is new?

vivid seal
#

what would you consider bad?

winged badger
#

editor has presets

#

one of them is "bad"

vivid seal
#

i had no idea there were presets

#

okay, how often do you see CMC net corrections with the bad preset? Just trying to get a feel for if I've implemented custom movement correctly. I see a lot of corrections on poor settings, but I also see similar corrections just walking around.

winged badger
#

frequent

#

but they won't be too large

#

wouldn't notice most if not for p.ShowNetCorrections

nova wasp
#

Gears of war did 500ms 15% loss tests iirc

#

Which is extreme but they had high standards

winged badger
#

15% is not a play test, its a will it break test

clever plinth
# winged badger but they won't be too large

How much is "not too large" out of curiosity? When testing I've been using ~200ms latency, 1% packet loss. On those settings I still see corrections on the order of tens of centimeters sometimes. I don't really have a strong frame of reference though for determining if that is problematic. Sometimes they are visually noticeable, sometimes not

winged badger
#

the one i wouldn't be able to eyeball playing on 1080x720 in PIE

vivid seal
#

i was asking a separate question, not sure about your question

gray orchid
#

oh ok

neon mango
#

Is unreal's networking and UDP plugin crossplatform?

nimble parcelBOT
#

:triangular_flag_on_post: Quest#5614 received strike 1. As a result, they were muted for 10 minutes.

elder sage
#

how do I fix jittery movement on the client?

ebon plume
#

Jittery movement can be a number of things. One of the most common I'd say is that the client is trying to set location different from the server. Or they are both trying to set the location and it's not being handled by just the server and properly replicated back to the client.

I think. Lol I'm new to multiplayer

#

For example: if you are using Add movement input > make sure these are executed by a custom event (Running on server).

Do your inputs locally and call the RPCs to move the character / pawn.

If it's the default replicated Character Movement Comp on the character class, it's handled automatically. (Some things are)

If you are having issues with jittery movement after you ensure everything is being executed properly. You may need to do some fine tweaking. This is case by case subjective though. Depends on what you are doing and what you are using to do it that determines the approach to mitigate. There's no straight forward answer on "how to fix jittery movement on the client"

vivid seal
#

got networked teleport working with prediction using the CMC and it looks good on owning client and server. However, other clients are applying smoothing so it doesn't look like a teleport but instead just a dash or something. I'm just using SetActorLocation in the actual execution of the teleport, do I need to use the physics state teleport param for that so remote clients know it was a teleport, or is that strictly for physics?

elder sage
fair lantern
#

Does anyone know why pulling a value from this would multicast a null value?

short arrow
fair lantern
#

im trying to call this multicast from an animation blueprint

#

@short arrow

short arrow
#

oh, I see it clearly says anim instance, you're expecting a component from the character blueprints? @fair lantern

fair lantern
#

it works correctly for server

#

but not multicast

kindred widget
#

@fair lanternYou should not network from an animation blueprint. Animations are meant to be client only. You need to network from an actor or an actorcomponent owned by an actor.

fair lantern
#

Got it chief xoxoxoxo ❀️ legend @kindred widget

lusty badger
#

Where gets a pawn possessed in multiplayer? If I try to get PlayerState() of my character in BeginPlay it returns always null

kindred widget
kindred widget
#

@lusty badger Unfortunately SetPlayerState isn't virtual, that would be too easy. So if you want a Listenserver compatible binding for when the Playerstate is set and run, you'll have to override both OnRep_PlayerState, and PossessedBy, maybe also UnPossessed if you need to know when it's null.

dull lance
#

is there a way to force a given type of actor replicate before another one if packages for each were sent on the same frame?

#

I want my Characters to always Replicate/process Replication before another actor class

steady briar
#

is there a way to force something to be not relevant immediately and not have to wait for the timer where it waits for it to be relevant again?

winged badger
#

unless you wait to spawn another actor class until clients ack Character replication

#

you can either set net priorities, which will do what you want 99% of the time, and miserably fail when there is a packet lost

#

or you can try to do post replication in other class by starting it from Character

dull lance
#

99% it is then

fringe galleon
#

Is this ok to ignore? my game seems to work just fine.

SetReplicates called on non-initialized actor NNNN. Directly setting bReplicates is the correct procedure for pre-init actors
kindred widget
#

Possibly. Until it breaks. It's just one line. Just change the SetReplicates(true); you have in contstructors to bReplicates = true;

dull lance
#

^ If it thaaat was okay to ignore, it wouldn't give you a warning πŸ˜›

#

like it does protect you from doing dumb stuff, but you definitely should just do bReplicates = true inside ctor instead

kindred widget
#

Errors are there for a reason. If some programmer went out of his way to mark something as an error, there was a reason for it and they're trying to keep you from blatantly putting your foot in a bear trap. Best to just listen. πŸ˜„

nimble parcelBOT
#

:no_entry_sign: darren77theone#8435 was banned.

round star
#

What is good practice to place server join and hosting functions

#

like where should I

#

Game instance? Player controller?

#

StinkyButtPoop?

#

What about game modes. Should there be seperate game mode/states etc for the menu and then the server itself..does it matter at all..or is that a facepalm and just have one set of classes for the entirity of the game

winged badger
#

separate gamemodes are good

#

more maintainable

#

as for the connection/session code, GI subsystem is nice

sweet ore
#

is there a way to host my game on like aws or google cloud without dedicated server? if yes why we need dedicated server then

sinful tree
quartz smelt
#

What's the correct way to destroy an actor? I tried using a variable of the actor then replicating it, but it didn't work client side

sinful tree
#

If the actor is replicated from the server, then calling DestroyActor on the server should be sufficient.

quartz smelt
#

It didn't work sadly. It says pending kill, though when I try to check if it's valid it returns true

sinful tree
#

If it says pending kill, that sounds like it's already being destroyed somehow.

quartz smelt
#

Ik, which is hella weird lol